完善反馈的result

This commit is contained in:
bnala committed 2025-02-19 20:27:41 +08:00
1 parent 7b2c4fa68a
commit 29587623fe
4 files changed
+33 -10

No files matched your search

+24 -6
View File
@@ -139,16 +139,22 @@ namespace WindowsFormsApp1
if (oldstatus != PlcData.Read_Status || (Plc_Time - oldPlcstatus_LastTime).TotalSeconds > 5) if (oldstatus != PlcData.Read_Status || (Plc_Time - oldPlcstatus_LastTime).TotalSeconds > 5)
{ {
//反馈状态 //反馈状态
Init.Plcstatus = PlcData.Read_Status;
Init.Plcstatus_LastTime = DateTime.Now;
otherdata.Plc_Status = PlcData.Read_Status; otherdata.Plc_Status = PlcData.Read_Status;
var statusresult = apiClient.CallFunctionByName("Status", PlcData, otherdata); var statusresult = apiClient.CallFunctionByName("Status", PlcData, otherdata);
if (statusresult.Success) if (statusresult.Success)
{ {
Init.Plcstatus = PlcData.Read_Status;
Init.Plcstatus_LastTime = DateTime.Now;
MES链接状态.Text = "MES链接状态:OK"; MES链接状态.Text = "MES链接状态:OK";
MES链接状态.BackColor = SystemColors.Control; MES链接状态.BackColor = SystemColors.Control;
MES通讯时间.Text = "MES通讯时间:" + DateTime.Now.ToString("MM-dd HH:mm:ss"); MES通讯时间.Text = "MES通讯时间:" + DateTime.Now.ToString("MM-dd HH:mm:ss");
MES_MsgfORM("Status", statusresult.Mesresult, statusresult.Requesttime); MES_MsgfORM("Status", statusresult.Mesresult, statusresult.Requesttime);
if (statusresult.Mesresult != mesresult.PASS)
{
PlcData.Write_Status = 1001;
siemensHelp.WriteAddress(plcaddress, PlcData);
continue;
}
} }
else else
{ {
@@ -168,15 +174,21 @@ namespace WindowsFormsApp1
///////////////////////////////测试用 ///////////////////////////////测试用
list.Add("M03CVSO-01"); list.Add("M03CVSO-01");
otherdata.Plc_ErrorMsgs = list; otherdata.Plc_ErrorMsgs = list;
Init.Plcstatus = PlcData.Read_Status;
Init.Plcstatus_LastTime = DateTime.Now;
var statusresult = apiClient.CallFunctionByName("Alarm", PlcData, otherdata); var statusresult = apiClient.CallFunctionByName("Alarm", PlcData, otherdata);
if (statusresult.Success) if (statusresult.Success)
{ {
Init.Plcstatus = PlcData.Read_Status;
Init.Plcstatus_LastTime = DateTime.Now;
MES链接状态.Text = "MES链接状态:OK"; MES链接状态.Text = "MES链接状态:OK";
MES链接状态.BackColor = SystemColors.Control; MES链接状态.BackColor = SystemColors.Control;
MES通讯时间.Text = "MES通讯时间:" + DateTime.Now.ToString("MM-dd HH:mm:ss"); MES通讯时间.Text = "MES通讯时间:" + DateTime.Now.ToString("MM-dd HH:mm:ss");
MES_MsgfORM("Alarm", statusresult.Mesresult, statusresult.Requesttime); MES_MsgfORM("Alarm", statusresult.Mesresult, statusresult.Requesttime);
if (statusresult.Mesresult != mesresult.PASS)
{
PlcData.Write_Status = 1001;
siemensHelp.WriteAddress(plcaddress, PlcData);
continue;
}
} }
else else
{ {
@@ -230,7 +242,7 @@ namespace WindowsFormsApp1
if(nowinterface.code == "SN_CheckIN") if(nowinterface.code == "SN_CheckIN")
{ {
请扫描LOT号.Enabled = true; 请扫描LOT号.Enabled = true;
ScanPort.Read(); //ScanPort.Read();
} }
@@ -243,7 +255,7 @@ namespace WindowsFormsApp1
var result = apiClient.CallFunctionByName(nowinterface.code,PlcData, otherdata); var result = apiClient.CallFunctionByName(nowinterface.code,PlcData, otherdata);
if (result.Success) if (result.Success)
{ {
var writeresult = siemensHelp.WriteAddress(Init.t_Plcaddresses.FindAll(a => a.plcid == Plc.id),PlcData); var writeresult = siemensHelp.WriteAddress(plcaddress, PlcData);
if (!writeresult.Success) if (!writeresult.Success)
{ {
PLC链接状态.Text = "PLC链接状态:NG"; PLC链接状态.Text = "PLC链接状态:NG";
@@ -256,6 +268,12 @@ namespace WindowsFormsApp1
MES链接状态.Text = "MES链接状态:OK"; MES链接状态.Text = "MES链接状态:OK";
MES链接状态.BackColor = SystemColors.Control; MES链接状态.BackColor = SystemColors.Control;
MES通讯时间.Text = "MES通讯时间:" + DateTime.Now.ToString("MM-dd HH:mm:ss"); MES通讯时间.Text = "MES通讯时间:" + DateTime.Now.ToString("MM-dd HH:mm:ss");
if (result.Mesresult != mesresult.PASS)
{
PlcData.Write_Status = 1001;
siemensHelp.WriteAddress(plcaddress, PlcData);
continue;
}
} }
} }
else else
Binary file not shown.
+1 -1
View File
@@ -175,7 +175,6 @@
this.portName.HeaderText = "COM口"; this.portName.HeaderText = "COM口";
this.portName.MinimumWidth = 9; this.portName.MinimumWidth = 9;
this.portName.Name = "portName"; this.portName.Name = "portName";
this.portName.ReadOnly = true;
// //
// baudRate // baudRate
// //
@@ -217,6 +216,7 @@
this.reamrk.HeaderText = "备注"; this.reamrk.HeaderText = "备注";
this.reamrk.MinimumWidth = 9; this.reamrk.MinimumWidth = 9;
this.reamrk.Name = "reamrk"; this.reamrk.Name = "reamrk";
this.reamrk.ReadOnly = true;
// //
// SerialPort_Manage // SerialPort_Manage
// //
+8 -3
View File
@@ -14,7 +14,7 @@ namespace WindowsFormsApp1.mod.server
public int Plc_Status { get; set; } public int Plc_Status { get; set; }
/// <summary> /// <summary>
/// PLC反馈的机台报警 /// PLC反馈的机台报警(默认获取0位)
/// </summary> /// </summary>
public List<string> Plc_ErrorMsgs { get; set; } public List<string> Plc_ErrorMsgs { get; set; }
@@ -24,15 +24,20 @@ namespace WindowsFormsApp1.mod.server
public string FileUploadAddress { get; set; } public string FileUploadAddress { get; set; }
/// <summary> /// <summary>
/// 胶水码 /// 前端返回的扫码
/// </summary> /// </summary>
public string JS_SN { get; set; } public string JS_SN { get; set; }
/// <summary> /// <summary>
/// 螺丝枪扭力角度 /// 螺丝枪扭力
/// </summary> /// </summary>
public List<float> FinalTorqueValue { get; set; } public List<float> FinalTorqueValue { get; set; }
/// <summary>
/// 螺丝枪角度
/// </summary>
public List<float> FinalAngleValue { get; set; }
/// <summary> /// <summary>
/// 螺丝枪扭力曲线 /// 螺丝枪扭力曲线
/// </summary> /// </summary>