Browse Source

提交

master
songnan.zhang 2 years ago
parent
commit
00d996f6b1
  1. 2
      APPQ5/QMAPP.WinForm/App.config
  2. 6
      APPQ5/QMAPP.WinForm/Dictionary.xml
  3. 14
      APPQ5/QMAPP.WinForm/Forms/Injection/SlushMoldingPrintForOldNewForm.cs
  4. 76
      APPQ5/QMAPP.WinForm/Forms/Operation/OperationForm_316.cs
  5. 4
      APPQ5/QMAPP.WinForm/Properties/AssemblyInfo.cs

2
APPQ5/QMAPP.WinForm/App.config

@ -211,7 +211,7 @@
<!--<endpoint address="net.tcp://localhost:4444/OpcService" binding="netTcpBinding" bindingConfiguration="NetTcpBinding_IOpcService" contract="ServiceOpc.IOpcService" name="NetTcpBinding_IOpcService" />--> <!--<endpoint address="net.tcp://localhost:4444/OpcService" binding="netTcpBinding" bindingConfiguration="NetTcpBinding_IOpcService" contract="ServiceOpc.IOpcService" name="NetTcpBinding_IOpcService" />-->
<!--<endpoint address="net.tcp://127.0.0.1:4444/OpcService" binding="netTcpBinding" bindingConfiguration="NetTcpBinding_IOpcService" contract="ServiceOpc.IOpcService" name="NetTcpBinding_IOpcService" />--> <!--<endpoint address="net.tcp://127.0.0.1:4444/OpcService" binding="netTcpBinding" bindingConfiguration="NetTcpBinding_IOpcService" contract="ServiceOpc.IOpcService" name="NetTcpBinding_IOpcService" />-->
<endpoint address="net.tcp://10.111.144.99:4444/OpcService" binding="netTcpBinding" bindingConfiguration="NetTcpBinding_IOpcService" contract="ServiceOpc.IOpcService" name="NetTcpBinding_IOpcService" /> <endpoint address="net.tcp://10.111.144.97:4444/OpcService" binding="netTcpBinding" bindingConfiguration="NetTcpBinding_IOpcService" contract="ServiceOpc.IOpcService" name="NetTcpBinding_IOpcService" />
<endpoint address="http://localhost:8938/GeneralService.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IGeneralService" contract="CenterGeneralService.IGeneralService" name="BasicHttpBinding_IGeneralService" /> <endpoint address="http://localhost:8938/GeneralService.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IGeneralService" contract="CenterGeneralService.IGeneralService" name="BasicHttpBinding_IGeneralService" />
<endpoint address="http://localhost:8938/LoginService.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IGeneralService" contract="LoginService.ILoginService" name="BasicHttpBinding_ILoginService" /> <endpoint address="http://localhost:8938/LoginService.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IGeneralService" contract="LoginService.ILoginService" name="BasicHttpBinding_ILoginService" />

6
APPQ5/QMAPP.WinForm/Dictionary.xml

@ -141,9 +141,11 @@
<Dictionary Name="COLOR"> <Dictionary Name="COLOR">
<items key="" value="" /> <items key="" value="" />
<items key="2" value="棕色" />
<items key="1" value="黑色" /> <items key="1" value="黑色" />
<items key="2" value="灰色" /> <items key="3" value="灰色" />
<items key="3" value="棕色" /> <items key="4" value="黑色PA" />
<items key="5" value="灰色PA" />
</Dictionary> </Dictionary>
<Dictionary Name="PROTYPE"> <Dictionary Name="PROTYPE">

14
APPQ5/QMAPP.WinForm/Forms/Injection/SlushMoldingPrintForOldNewForm.cs

@ -52,6 +52,7 @@ namespace QMAPP.WinForm.Forms.Injection
private string _cfgSlushMoldingVW3712 = null;// 预警区间 private string _cfgSlushMoldingVW3712 = null;// 预警区间
private string _cfgSlushMoldingVW371PA = null;// 称重区间 private string _cfgSlushMoldingVW371PA = null;// 称重区间
private string _cfgSlushMoldingVW371PA2 = null;// 预警区间 private string _cfgSlushMoldingVW371PA2 = null;// 预警区间
private string _SetFistColor = null;// 设置首选颜色
/// <summary> /// <summary>
/// 新建 /// 新建
@ -69,6 +70,7 @@ namespace QMAPP.WinForm.Forms.Injection
_cfgSlushMoldingVW3712 = GetAppConfigValue("SLUSHMOLDING2"); _cfgSlushMoldingVW3712 = GetAppConfigValue("SLUSHMOLDING2");
_cfgSlushMoldingVW371PA = GetAppConfigValue("SLUSHMOLDINGPA"); _cfgSlushMoldingVW371PA = GetAppConfigValue("SLUSHMOLDINGPA");
_cfgSlushMoldingVW371PA2 = GetAppConfigValue("SLUSHMOLDINGPA2"); _cfgSlushMoldingVW371PA2 = GetAppConfigValue("SLUSHMOLDINGPA2");
_SetFistColor = GetAppConfigValue("SetFistColor");
btnCommSend.Enabled = true; btnCommSend.Enabled = true;
serialPort1.DataReceived += new SerialDataReceivedEventHandler(serialPort1_DataReceived); serialPort1.DataReceived += new SerialDataReceivedEventHandler(serialPort1_DataReceived);
@ -141,6 +143,10 @@ namespace QMAPP.WinForm.Forms.Injection
this.comColor.SelectedValue = "1"; this.comColor.SelectedValue = "1";
//this.comColor.Enabled = false; //this.comColor.Enabled = false;
if (!string.IsNullOrEmpty(_SetFistColor))
{
this.comColor.SelectedValue = _SetFistColor;
}
ColorPrint = this.comColor.SelectedValue.ToString(); ColorPrint = this.comColor.SelectedValue.ToString();
////AB腔 ////AB腔
@ -1066,6 +1072,8 @@ namespace QMAPP.WinForm.Forms.Injection
private void comColor_SelectedIndexChanged(object sender, EventArgs e) private void comColor_SelectedIndexChanged(object sender, EventArgs e)
{ {
if (!string.IsNullOrEmpty(ColorPrint) && ColorPrint != this.comColor.SelectedValue.ToString()) if (!string.IsNullOrEmpty(ColorPrint) && ColorPrint != this.comColor.SelectedValue.ToString())
{
if (this.comColor.SelectedValue.ToString() != "4")
{ {
UpdatePasswordForm psd = new UpdatePasswordForm(); UpdatePasswordForm psd = new UpdatePasswordForm();
var color = this.comColor.SelectedValue.ToString(); var color = this.comColor.SelectedValue.ToString();
@ -1082,6 +1090,12 @@ namespace QMAPP.WinForm.Forms.Injection
ColorPrint = this.comColor.SelectedValue.ToString(); ColorPrint = this.comColor.SelectedValue.ToString();
} }
} }
else
{
ColorPrint = this.comColor.SelectedValue.ToString();
}
}
} }
} }

76
APPQ5/QMAPP.WinForm/Forms/Operation/OperationForm_316.cs

@ -30,6 +30,7 @@ using gregn6Lib;
using System.Data; using System.Data;
using QMAPP.FJC.Entity.BZD; using QMAPP.FJC.Entity.BZD;
using QMAPP.BoraUpgrade.BLL; using QMAPP.BoraUpgrade.BLL;
using System.Text;
namespace QMAPP.WinForm.Forms.Operation namespace QMAPP.WinForm.Forms.Operation
{ {
@ -1913,6 +1914,8 @@ namespace QMAPP.WinForm.Forms.Operation
{ {
try try
{ {
WriteFile("ZSN, Print052QRCODE 开始", @"D:\MES\Log");
if (!cBoxVANstr || "IP_ASSEMBLING,GWASSEMBLE_VW371PA".Contains(_operationServiceParam.machineInfo.WORKLOC_CODE)) if (!cBoxVANstr || "IP_ASSEMBLING,GWASSEMBLE_VW371PA".Contains(_operationServiceParam.machineInfo.WORKLOC_CODE))
cBoxVAN.Visible = false; cBoxVAN.Visible = false;
@ -1927,20 +1930,24 @@ namespace QMAPP.WinForm.Forms.Operation
//数据填充 //数据填充
Report.FetchRecord += new _IGridppReportEvents_FetchRecordEventHandler(ReadFetchRecordBox); Report.FetchRecord += new _IGridppReportEvents_FetchRecordEventHandler(ReadFetchRecordBox);
WriteFile("ZSN, Print052QRCODE reportPath:" + reportPath, @"D:\MES\Log");
Report.LoadFromFile(reportPath); Report.LoadFromFile(reportPath);
//rep.Printer.PrinterName = "默认打印机";//调取不同的打印机 //rep.Printer.PrinterName = "默认打印机";//调取不同的打印机
Report.Print(false); Report.Print(false);
WriteFile("ZSN, Print052QRCODE 结束", @"D:\MES\Log");
} }
catch (Exception) catch (Exception ex)
{ {
WriteFile("ZSN, Print052QRCODE catch " + ex.Message, @"D:\MES\Log");
throw; throw;
} }
finally finally
{ {
WriteFile("ZSN, Print052QRCODE finally", @"D:\MES\Log");
Report = new GridppReport(); Report = new GridppReport();
} }
@ -1964,9 +1971,15 @@ namespace QMAPP.WinForm.Forms.Operation
private BZD getBZDCode() private BZD getBZDCode()
{ {
BZD bzd = new BZD(); BZD bzd = new BZD();
try
{
List<string> list = new List<string>(); List<string> list = new List<string>();
List<string> paramList = new List<string>(); List<string> paramList = new List<string>();
WriteFile("ZSN,planMATERIAL_CODE =1= " + planMATERIAL_CODE, @"D:\MES\Log");
WriteFile("ZSN,processMainCode =1= " + processMainCode, @"D:\MES\Log");
//张松男 20210207 总成工位打印052 缺少物料号 重新查找填充 start //张松男 20210207 总成工位打印052 缺少物料号 重新查找填充 start
if (string.IsNullOrEmpty(planMATERIAL_CODE)) if (string.IsNullOrEmpty(planMATERIAL_CODE))
{ {
@ -1979,21 +1992,26 @@ namespace QMAPP.WinForm.Forms.Operation
if (!string.IsNullOrEmpty(MaterialCodes)) if (!string.IsNullOrEmpty(MaterialCodes))
planMATERIAL_CODE = MaterialCodes; planMATERIAL_CODE = MaterialCodes;
else else
{
WriteFile("ZSN,缺少planMATERIAL_CODE ", @"D:\MES\Log");
throw new Exception("创建BZD码失败!缺少planMATERIAL_CODE"); throw new Exception("创建BZD码失败!缺少planMATERIAL_CODE");
} }
}
//张松男 20210207 总成工位打印052 缺少物料号 重新查找填充 end //张松男 20210207 总成工位打印052 缺少物料号 重新查找填充 end
paramList.Add(planMATERIAL_CODE); paramList.Add(planMATERIAL_CODE);
paramList.Add(processMainCode); paramList.Add(processMainCode);
try WriteFile("ZSN,planMATERIAL_CODE =2= " + planMATERIAL_CODE, @"D:\MES\Log");
{ WriteFile("ZSN,processMainCode =2= " + processMainCode, @"D:\MES\Log");
//读取BZDCONFIG配置列表 //读取BZDCONFIG配置列表
list = _agent.InvokeServiceFunction<List<string>>( list = _agent.InvokeServiceFunction<List<string>>(
B9IPCService.BZDRecorderBLL_CreateBZDCode.ToString(), paramList); B9IPCService.BZDRecorderBLL_CreateBZDCode.ToString(), paramList);
if (list != null) if (list != null)
{ {
WriteFile("ZSN,查询到list " + processMainCode, @"D:\MES\Log");
//将返回值赋值给bzd对象 //将返回值赋值给bzd对象
bzd.barcode = list[0]; bzd.barcode = list[0];
bzd.color = list[1]; bzd.color = list[1];
@ -2001,6 +2019,7 @@ namespace QMAPP.WinForm.Forms.Operation
bzd.count = list[3]; bzd.count = list[3];
if (bzd.count == "0") if (bzd.count == "0")
{ {
WriteFile("创建BZD码失败!缺少list[3] ", @"D:\MES\Log");
planMATERIAL_CODE = null; planMATERIAL_CODE = null;
processMainCode = null; processMainCode = null;
throw new Exception($"创建BZD码失败!缺少list[3];planMATERIAL_CODE={planMATERIAL_CODE};processMainCode={processMainCode}"); throw new Exception($"创建BZD码失败!缺少list[3];planMATERIAL_CODE={planMATERIAL_CODE};processMainCode={processMainCode}");
@ -2010,6 +2029,7 @@ namespace QMAPP.WinForm.Forms.Operation
} }
else else
{ {
WriteFile("创建BZD码失败!list=null ", @"D:\MES\Log");
planMATERIAL_CODE = null; planMATERIAL_CODE = null;
processMainCode = null; processMainCode = null;
throw new Exception($"创建BZD码异常!list=null;planMATERIAL_CODE={planMATERIAL_CODE};processMainCode={processMainCode}"); throw new Exception($"创建BZD码异常!list=null;planMATERIAL_CODE={planMATERIAL_CODE};processMainCode={processMainCode}");
@ -2017,6 +2037,7 @@ namespace QMAPP.WinForm.Forms.Operation
} }
catch (Exception e) catch (Exception e)
{ {
WriteFile("创建BZD码失败!Exception: " + e.Message, @"D:\MES\Log");
planMATERIAL_CODE = null; planMATERIAL_CODE = null;
processMainCode = null; processMainCode = null;
MessageBox.Show(e.Message); MessageBox.Show(e.Message);
@ -3821,5 +3842,50 @@ namespace QMAPP.WinForm.Forms.Operation
BindPlanView(); BindPlanView();
} }
/// <summary>
/// 临时日志
/// </summary>
/// <param name="strText"></param>
/// <param name="path"></param>
/// <returns></returns>
public string WriteFile(string strText, string path)
{
Encoding code = Encoding.GetEncoding("gb2312");
StreamWriter sw = null;
string filename = DateTime.Now.ToString("yyyy-MM-dd") + ".txt";
if (string.IsNullOrEmpty(path))
{
path = System.AppDomain.CurrentDomain.BaseDirectory;
}
if (Directory.Exists(path) == false)
{
Directory.CreateDirectory(path);
}
try
{
string fullpath = System.IO.Path.Combine(path, filename);
sw = new StreamWriter(fullpath, true, code);
sw.Write("[" + DateTime.Now.ToString() + "]\r\n--" + strText + "\r\n");
sw.Flush();
}
catch (Exception ex)
{
//HttpContext.Current.Response.Write(ex.Message);
//HttpContext.Current.Response.End();
}
finally
{
if (sw != null)
{
sw.Close();
}
}
return filename;
}
} }
} }

4
APPQ5/QMAPP.WinForm/Properties/AssemblyInfo.cs

@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值, // 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值,
// 方法是按如下所示使用“*”: // 方法是按如下所示使用“*”:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2022.06.16.01")] [assembly: AssemblyVersion("2022.06.23.01")]
[assembly: AssemblyFileVersion("2022.06.16.01")] [assembly: AssemblyFileVersion("2022.06.23.01")]

Loading…
Cancel
Save