|
@@ -156,7 +156,7 @@ namespace MainForm
|
|
/// </summary>
|
|
/// </summary>
|
|
private Dictionary<string, List<Alarm>> DicAlarms_Cur = new Dictionary<string, List<Alarm>>();
|
|
private Dictionary<string, List<Alarm>> DicAlarms_Cur = new Dictionary<string, List<Alarm>>();
|
|
|
|
|
|
- Dictionary<int, Inovance_EIP> FunsEip = new Dictionary<int, Inovance_EIP>();
|
|
|
|
|
|
+ public Dictionary<int, Inovance_EIP> FunsEip = new Dictionary<int, Inovance_EIP>();
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// 单机用-设备状态
|
|
/// 单机用-设备状态
|
|
@@ -1117,6 +1117,8 @@ namespace MainForm
|
|
private static int res = 0;
|
|
private static int res = 0;
|
|
public static bool StopWhile =false; //二维码弹窗后停止循环
|
|
public static bool StopWhile =false; //二维码弹窗后停止循环
|
|
public static bool inStationPass = true; //过站结果,保存进站结果
|
|
public static bool inStationPass = true; //过站结果,保存进站结果
|
|
|
|
+ public static string _strProductBarcode = "";
|
|
|
|
+ public static string _strCarrierBarcode = "";
|
|
|
|
|
|
public void ConnectToIOT()
|
|
public void ConnectToIOT()
|
|
{
|
|
{
|
|
@@ -3182,6 +3184,8 @@ namespace MainForm
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
if (FunsEip[plcNo].IsConnected) // 检查PLC是否已连接上
|
|
if (FunsEip[plcNo].IsConnected) // 检查PLC是否已连接上
|
|
{
|
|
{
|
|
Stopwatch stopwatch1 = new Stopwatch();
|
|
Stopwatch stopwatch1 = new Stopwatch();
|
|
@@ -3201,6 +3205,10 @@ namespace MainForm
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
|
|
+ //测试数据
|
|
|
|
+ //stPLC_MesData.mesCommFrmPLC.cmdParam = 1;
|
|
|
|
+
|
|
|
|
+
|
|
//richTextBox1.AppendText("\n" + "读取成功");
|
|
//richTextBox1.AppendText("\n" + "读取成功");
|
|
stPLC_MesData.BarcodeSet.strProductBarcode =
|
|
stPLC_MesData.BarcodeSet.strProductBarcode =
|
|
FormatStrbyPLC(stPLC_MesData.BarcodeSet.strProductBarcode);
|
|
FormatStrbyPLC(stPLC_MesData.BarcodeSet.strProductBarcode);
|
|
@@ -3225,36 +3233,69 @@ namespace MainForm
|
|
s1PLCData["a1OEEType"] = stPLC_MesData.iotData.beatAction;
|
|
s1PLCData["a1OEEType"] = stPLC_MesData.iotData.beatAction;
|
|
//报警信息
|
|
//报警信息
|
|
_FaultDatas = stPLC_MesData.iotData.fault_codes;
|
|
_FaultDatas = stPLC_MesData.iotData.fault_codes;
|
|
|
|
+
|
|
|
|
+ if (stPLC_MesData.mesCommFrmPLC.cmdParam == 2)
|
|
|
|
+ {
|
|
|
|
+ BandBarodeDialog_S1.isNoClose=true;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
#endregion 一次性读取所有数据
|
|
#endregion 一次性读取所有数据
|
|
|
|
|
|
stopwatch2.Stop();
|
|
stopwatch2.Stop();
|
|
|
|
|
|
- #region 进站
|
|
|
|
|
|
+ #region 扫码
|
|
|
|
+ //弹窗期间跳过循环
|
|
|
|
+ //if (StopWhile)
|
|
|
|
+ //{
|
|
|
|
+ // continue;
|
|
|
|
+ //}
|
|
|
|
|
|
- try
|
|
|
|
|
|
+ if (stPLC_MesData.mesCommFrmPLC.cmdParam==1)
|
|
{
|
|
{
|
|
- if (OpenDailogFalg)
|
|
|
|
|
|
+ using (var dialog = new BandBarodeDialog_S1())
|
|
{
|
|
{
|
|
- using (var dialog = new BandBarodeDialog(strCarrierBarcode, ProductBarcode, PCBBarcode))
|
|
|
|
|
|
+ var rs = dialog.ShowDialog();
|
|
|
|
+ if (rs == DialogResult.OK)
|
|
{
|
|
{
|
|
- var rs = dialog.ShowDialog();
|
|
|
|
- if (rs == DialogResult.OK)
|
|
|
|
|
|
+ //绑定载具和产品
|
|
|
|
+ ResponseMessage message = new ResponseMessage();
|
|
|
|
+
|
|
|
|
+ message = SQLHelper.InsertCarrierBind(_strCarrierBarcode, _strProductBarcode);
|
|
|
|
+ if (message.result == false)
|
|
{
|
|
{
|
|
- AddMessage(LogType.Info, $"扫码校验通过,载具码:{strCarrierBarcode}");
|
|
|
|
- OpenDailogFalg = false; //关闭扫码
|
|
|
|
- StopWhile = false;//开启while循环
|
|
|
|
|
|
+ AddMessage(LogType.Error, stationNameStr + "_载具码与产品码绑定失败,错误:" + message.text);
|
|
|
|
+
|
|
|
|
+ CommandFromPLC CommandToPlC = new CommandFromPLC();
|
|
|
|
+ CommandToPlC.cmd = 0;
|
|
|
|
+ CommandToPlC.cmdParam = 0;
|
|
|
|
+ CommandToPlC.cmdResult = 110;
|
|
|
|
+ WriteResultToPlc(plcNo, stationNameStr, tagBaseName + "." + tagMesCommName, 1, CommandToPlC);
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- ProgressState = false;
|
|
|
|
- return;
|
|
|
|
|
|
+ AddMessage(LogType.Error, stationNameStr + "_载具码与产品码绑定成功");
|
|
|
|
+
|
|
|
|
+ CommandFromPLC CommandToPlC = new CommandFromPLC();
|
|
|
|
+ CommandToPlC.cmd = 0;
|
|
|
|
+ CommandToPlC.cmdParam = 0;
|
|
|
|
+ CommandToPlC.cmdResult = 1;
|
|
|
|
+ WriteResultToPlc(plcNo, stationNameStr, tagBaseName + "." + tagMesCommName, 1, CommandToPlC);
|
|
}
|
|
}
|
|
|
|
+ AddMessage(LogType.Info, $"载具码:{_strCarrierBarcode},产品码:{_strProductBarcode}");
|
|
|
|
+ _strCarrierBarcode = "";
|
|
|
|
+ _strProductBarcode = "";
|
|
|
|
+ //StopWhile = false;//开启while循环
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ }
|
|
|
|
+ #endregion
|
|
|
|
|
|
|
|
+ #region 进站
|
|
|
|
|
|
|
|
+ try
|
|
|
|
+ {
|
|
if (stPLC_MesData.mesCommFrmPLC.cmd == (byte)eMesCmd.InStation)
|
|
if (stPLC_MesData.mesCommFrmPLC.cmd == (byte)eMesCmd.InStation)
|
|
{
|
|
{
|
|
lock (lockObj)
|
|
lock (lockObj)
|
|
@@ -4146,7 +4187,7 @@ namespace MainForm
|
|
else
|
|
else
|
|
{
|
|
{
|
|
//测试数据
|
|
//测试数据
|
|
- //stPLC_MesData.Left.mesCommFrmPLC.cmd = 2;
|
|
|
|
|
|
+ //stPLC_MesData.Left.mesCommFrmPLC.cmdParam = 1;
|
|
//stPLC_MesData.Left.BarcodeSet.strCarrierBarcode = "A123456";
|
|
//stPLC_MesData.Left.BarcodeSet.strCarrierBarcode = "A123456";
|
|
//stPLC_MesData.Left.BarcodeSet.strPCBBarcode = "A1507V000239";
|
|
//stPLC_MesData.Left.BarcodeSet.strPCBBarcode = "A1507V000239";
|
|
//stPLC_MesData.Left.iotData.beatAction = 1;
|
|
//stPLC_MesData.Left.iotData.beatAction = 1;
|
|
@@ -6059,24 +6100,6 @@ namespace MainForm
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
sn = ProductBarcode;
|
|
sn = ProductBarcode;
|
|
- if (OpenDailogFalg)
|
|
|
|
- {
|
|
|
|
- using (var dialog = new BandBarodeDialog(strCarrierBarcode, ProductBarcode, PCBBarcode))
|
|
|
|
- {
|
|
|
|
- var rs = dialog.ShowDialog();
|
|
|
|
- if (rs == DialogResult.OK)
|
|
|
|
- {
|
|
|
|
- AddMessage(LogType.Info, $"扫码校验通过,载具码:{strCarrierBarcode}");
|
|
|
|
- OpenDailogFalg = false; //关闭扫码
|
|
|
|
- StopWhile = false;//开启while循环
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
- ProgressState = false;
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
AddMessage(LogType.Info, $"载具码:{strCarrierBarcode};产品码:{sn}");
|
|
AddMessage(LogType.Info, $"载具码:{strCarrierBarcode};产品码:{sn}");
|
|
|
|
|
|
// 产品SN(物料码)校验
|
|
// 产品SN(物料码)校验
|
|
@@ -6093,6 +6116,25 @@ namespace MainForm
|
|
if (a1Result == 1)
|
|
if (a1Result == 1)
|
|
{
|
|
{
|
|
mesResultFrmWeb = 1;
|
|
mesResultFrmWeb = 1;
|
|
|
|
+
|
|
|
|
+ if (OpenDailogFalg)
|
|
|
|
+ {
|
|
|
|
+ using (var dialog = new BandBarodeDialog(strCarrierBarcode, ProductBarcode, PCBBarcode))
|
|
|
|
+ {
|
|
|
|
+ var rs = dialog.ShowDialog();
|
|
|
|
+ if (rs == DialogResult.OK)
|
|
|
|
+ {
|
|
|
|
+ AddMessage(LogType.Info, $"扫码校验通过,载具码:{strCarrierBarcode}");
|
|
|
|
+ OpenDailogFalg = false; //关闭扫码
|
|
|
|
+ StopWhile = false;//开启while循环
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ ProgressState = false;
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
@@ -14135,7 +14177,7 @@ namespace MainForm
|
|
/// </summary>
|
|
/// </summary>
|
|
/// <param name="logType">日志类型</param>
|
|
/// <param name="logType">日志类型</param>
|
|
/// <param name="message">日志内容</param>
|
|
/// <param name="message">日志内容</param>
|
|
- private void OnMessage(LogType logType, string msg)
|
|
|
|
|
|
+ public void OnMessage(LogType logType, string msg)
|
|
{
|
|
{
|
|
MessageEvent?.Invoke(logType, msg);
|
|
MessageEvent?.Invoke(logType, msg);
|
|
}
|
|
}
|