|
@@ -34,226 +34,284 @@ namespace SCADA_DAQ.Customer.Machines
|
|
|
base.ScanCompleted(sender, e);
|
|
|
if (BaseDevice.DeviceID.StartsWith("输送线"))
|
|
|
{
|
|
|
- var op = new OperationBo { StartRow = 2, StartCol = 42, StartLayer = 5, ItemName = "标准_塑料管夹_THPG-342" };
|
|
|
- var opHex = op.OperToHex();
|
|
|
- var screen3 = MachineServer.GetInstance().GetMachine<SampleMachine>("显示屏3");
|
|
|
- // if (screen3.GetListenReg("400001") != null)
|
|
|
- // {
|
|
|
- // screen3.GetListenReg("400001").WriteReg("标准_塑料管夹_THPG-342");
|
|
|
- // }
|
|
|
-
|
|
|
-
|
|
|
- //var screen4 = MachineServer.GetInstance().GetMachine<SampleMachine>("显示屏4");
|
|
|
-
|
|
|
-
|
|
|
+ // 写入显示屏
|
|
|
+ WriteScreen();
|
|
|
|
|
|
#region 按输送线按钮回原位
|
|
|
bool lowThenUpShelf(OperationBo ltuOperation)
|
|
|
{
|
|
|
- var flag = false;
|
|
|
- var craneIsRun = false;
|
|
|
- if (ltuOperation.Crane == 1)
|
|
|
- {
|
|
|
- craneIsRun = Crane_1IsRun;
|
|
|
- }
|
|
|
- else if (ltuOperation.Crane == 2)
|
|
|
- {
|
|
|
- craneIsRun = Crane_2IsRun;
|
|
|
- }
|
|
|
- if (base.GetListenReg($"{ltuOperation.Line}#CheckButton").Value == 1 && base.GetListenReg($"{ltuOperation.Crane}#CraneReady").Value == 1 && craneIsRun == false)
|
|
|
- {
|
|
|
+ var flag = false;
|
|
|
+ var craneIsRun = false;
|
|
|
if (ltuOperation.Crane == 1)
|
|
|
{
|
|
|
- Crane_1IsRun = true;
|
|
|
+ craneIsRun = Crane_1IsRun;
|
|
|
}
|
|
|
else if (ltuOperation.Crane == 2)
|
|
|
{
|
|
|
- Crane_2IsRun = true;
|
|
|
+ craneIsRun = Crane_2IsRun;
|
|
|
}
|
|
|
- var isWriteRCL = base.GetListenReg($"{ltuOperation.Crane}#CraneFrom_Row").WriteReg(new int[] { ltuOperation.StartRow, ltuOperation.StartCol, ltuOperation.StartLayer, ltuOperation.EndRow, ltuOperation.EndCol, ltuOperation.EndLayer });
|
|
|
- if (isWriteRCL)
|
|
|
+ if (base.GetListenReg($"{ltuOperation.Line}#CheckButton").Value == 1 && base.GetListenReg($"{ltuOperation.Crane}#CraneReady").Value == 1 && craneIsRun == false)
|
|
|
{
|
|
|
- var isWriteStart = base.GetListenReg($"{ltuOperation.Crane}#CraneStart").WriteReg(1); //堆垛机启动
|
|
|
- var isWriteButton = base.GetListenReg($"{ltuOperation.Line}#CheckButton").WriteReg("0"); //输送线按钮复位
|
|
|
- if (isWriteStart == true && isWriteButton == true)
|
|
|
+ if (ltuOperation.Crane == 1)
|
|
|
+ {
|
|
|
+ Crane_1IsRun = true;
|
|
|
+ }
|
|
|
+ else if (ltuOperation.Crane == 2)
|
|
|
+ {
|
|
|
+ Crane_2IsRun = true;
|
|
|
+ }
|
|
|
+ var isWriteRCL = base.GetListenReg($"{ltuOperation.Crane}#CraneFrom_Row").WriteReg(new int[] { ltuOperation.StartRow, ltuOperation.StartCol, ltuOperation.StartLayer, ltuOperation.EndRow, ltuOperation.EndCol, ltuOperation.EndLayer });
|
|
|
+ if (isWriteRCL)
|
|
|
{
|
|
|
- flag = true;
|
|
|
- Env.DAL.App_BC_OperateLog.Insert(
|
|
|
- new UpdateItem(T_Col_Name.App_BC_OperateLog.OperateNo_Str, ltuOperation.OperateNo),
|
|
|
- new UpdateItem(T_Col_Name.App_BC_OperateLog.MachineTaskId_Int, ltuOperation.MachineTaskId),
|
|
|
- new UpdateItem(T_Col_Name.App_BC_OperateLog.Crane_Str, $"堆垛机{ltuOperation.Crane}"),
|
|
|
- new UpdateItem(T_Col_Name.App_BC_OperateLog.Line_Str, $"输送线{ltuOperation.Line}"),
|
|
|
- new UpdateItem(T_Col_Name.App_BC_OperateLog.StartCol_Int, ltuOperation.StartCol),
|
|
|
- new UpdateItem(T_Col_Name.App_BC_OperateLog.StartRow_Int, ltuOperation.StartRow),
|
|
|
- new UpdateItem(T_Col_Name.App_BC_OperateLog.StartLayer_Int, ltuOperation.StartLayer),
|
|
|
- new UpdateItem(T_Col_Name.App_BC_OperateLog.EndRow_Int, ltuOperation.EndRow),
|
|
|
- new UpdateItem(T_Col_Name.App_BC_OperateLog.EndCol_Int, ltuOperation.EndCol),
|
|
|
- new UpdateItem(T_Col_Name.App_BC_OperateLog.EndLayer_Int, ltuOperation.EndLayer),
|
|
|
- new UpdateItem(T_Col_Name.App_BC_OperateLog.Remark_Str, "入库")
|
|
|
- );
|
|
|
+ var isWriteStart = base.GetListenReg($"{ltuOperation.Crane}#CraneStart").WriteReg(1); //堆垛机启动
|
|
|
+ var isWriteButton = base.GetListenReg($"{ltuOperation.Line}#CheckButton").WriteReg("0"); //输送线按钮复位
|
|
|
+ if (isWriteStart == true && isWriteButton == true)
|
|
|
+ {
|
|
|
+ flag = true;
|
|
|
+ Env.DAL.App_BC_OperateLog.Insert(
|
|
|
+ new UpdateItem(T_Col_Name.App_BC_OperateLog.OperateNo_Str, ltuOperation.OperateNo),
|
|
|
+ new UpdateItem(T_Col_Name.App_BC_OperateLog.MachineTaskId_Int, ltuOperation.MachineTaskId),
|
|
|
+ new UpdateItem(T_Col_Name.App_BC_OperateLog.Crane_Str, $"堆垛机{ltuOperation.Crane}"),
|
|
|
+ new UpdateItem(T_Col_Name.App_BC_OperateLog.Line_Str, $"输送线{ltuOperation.Line}"),
|
|
|
+ new UpdateItem(T_Col_Name.App_BC_OperateLog.StartCol_Int, ltuOperation.StartCol),
|
|
|
+ new UpdateItem(T_Col_Name.App_BC_OperateLog.StartRow_Int, ltuOperation.StartRow),
|
|
|
+ new UpdateItem(T_Col_Name.App_BC_OperateLog.StartLayer_Int, ltuOperation.StartLayer),
|
|
|
+ new UpdateItem(T_Col_Name.App_BC_OperateLog.EndRow_Int, ltuOperation.EndRow),
|
|
|
+ new UpdateItem(T_Col_Name.App_BC_OperateLog.EndCol_Int, ltuOperation.EndCol),
|
|
|
+ new UpdateItem(T_Col_Name.App_BC_OperateLog.EndLayer_Int, ltuOperation.EndLayer),
|
|
|
+ new UpdateItem(T_Col_Name.App_BC_OperateLog.Remark_Str, "入库")
|
|
|
+ );
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+ return flag;
|
|
|
}
|
|
|
- return flag;
|
|
|
- }
|
|
|
- if (LowThenUpOperation11 != null)
|
|
|
- {
|
|
|
- var isOk = lowThenUpShelf(LowThenUpOperation11);
|
|
|
- if (isOk)
|
|
|
+ if (LowThenUpOperation11 != null)
|
|
|
{
|
|
|
- LowThenUpOperation11 = null;
|
|
|
+ var isOk = lowThenUpShelf(LowThenUpOperation11);
|
|
|
+ if (isOk)
|
|
|
+ {
|
|
|
+ LowThenUpOperation11 = null;
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- if (LowThenUpOperation12 != null)
|
|
|
- {
|
|
|
- var isOk = lowThenUpShelf(LowThenUpOperation12);
|
|
|
- if (isOk)
|
|
|
+ if (LowThenUpOperation12 != null)
|
|
|
{
|
|
|
- LowThenUpOperation12 = null;
|
|
|
+ var isOk = lowThenUpShelf(LowThenUpOperation12);
|
|
|
+ if (isOk)
|
|
|
+ {
|
|
|
+ LowThenUpOperation12 = null;
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- if (LowThenUpOperation23 != null)
|
|
|
- {
|
|
|
- var isOk = lowThenUpShelf(LowThenUpOperation23);
|
|
|
- if (isOk)
|
|
|
+ if (LowThenUpOperation23 != null)
|
|
|
{
|
|
|
- LowThenUpOperation23 = null;
|
|
|
+ var isOk = lowThenUpShelf(LowThenUpOperation23);
|
|
|
+ if (isOk)
|
|
|
+ {
|
|
|
+ LowThenUpOperation23 = null;
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- if (LowThenUpOperation24 != null)
|
|
|
- {
|
|
|
- var isOk = lowThenUpShelf(LowThenUpOperation24);
|
|
|
- if (isOk)
|
|
|
+ if (LowThenUpOperation24 != null)
|
|
|
{
|
|
|
- LowThenUpOperation24 = null;
|
|
|
+ var isOk = lowThenUpShelf(LowThenUpOperation24);
|
|
|
+ if (isOk)
|
|
|
+ {
|
|
|
+ LowThenUpOperation24 = null;
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- #endregion
|
|
|
+ #endregion
|
|
|
|
|
|
|
|
|
- #region 从任务队列下发任务到设备
|
|
|
- if (GetListenReg($"1#CraneReady").Value == 1 && GetListenReg($"1#LineReady").Value == 1 &&
|
|
|
- CustomerEnv.LowThenUpOperation11 == null && GetListenReg($"2#CheckButton").Value == 0 && Crane_1IsRun == false)
|
|
|
- {
|
|
|
- if (OperationCrane1List.Count != 0 && CustomerEnv.CurrentOperationLine1 == null && OperationCrane1List.Where(t => t.IsStart == false && t.Line == 1).ToList().Count != 0
|
|
|
- && GetListenReg($"1#LineDone").Value == 0)
|
|
|
+ #region 从任务队列下发任务到设备
|
|
|
+ if (GetListenReg($"1#CraneReady").Value == 1 && GetListenReg($"1#LineReady").Value == 1 &&
|
|
|
+ CustomerEnv.LowThenUpOperation11 == null && GetListenReg($"2#CheckButton").Value == 0 && Crane_1IsRun == false)
|
|
|
{
|
|
|
- var currentTask = OperationCrane1List.Where(t => t.IsStart == false && t.Line == 1).First();
|
|
|
- var ok = CustomerEnv.CraneLineOperate(this, currentTask);
|
|
|
- if (ok == "OK")
|
|
|
+ if (OperationCrane1List.Count != 0 && CustomerEnv.CurrentOperationLine1 == null && OperationCrane1List.Where(t => t.IsStart == false && t.Line == 1).ToList().Count != 0
|
|
|
+ && GetListenReg($"1#LineDone").Value == 0)
|
|
|
{
|
|
|
- currentTask.IsStart = true;
|
|
|
- CustomerEnv.CurrentOperationLine1 = currentTask;
|
|
|
- OperationCrane1List.Remove(CurrentOperationLine1);
|
|
|
+ var currentTask = OperationCrane1List.Where(t => t.IsStart == false && t.Line == 1).First();
|
|
|
+ var ok = CustomerEnv.CraneLineOperate(this, currentTask);
|
|
|
+ if (ok == "OK")
|
|
|
+ {
|
|
|
+ currentTask.IsStart = true;
|
|
|
+ CustomerEnv.CurrentOperationLine1 = currentTask;
|
|
|
+ OperationCrane1List.Remove(CurrentOperationLine1);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- if (GetListenReg($"1#CraneReady").Value == 1 && GetListenReg($"2#LineReady").Value == 1 &&
|
|
|
- CustomerEnv.LowThenUpOperation12 == null && GetListenReg($"1#CheckButton").Value == 0 && Crane_1IsRun == false)
|
|
|
- {
|
|
|
- if (OperationCrane1List.Count != 0 && CustomerEnv.CurrentOperationLine2 == null && OperationCrane1List.Where(t => t.IsStart == false && t.Line == 2).ToList().Count != 0
|
|
|
- && GetListenReg($"2#LineDone").Value == 0)
|
|
|
+ if (GetListenReg($"1#CraneReady").Value == 1 && GetListenReg($"2#LineReady").Value == 1 &&
|
|
|
+ CustomerEnv.LowThenUpOperation12 == null && GetListenReg($"1#CheckButton").Value == 0 && Crane_1IsRun == false)
|
|
|
{
|
|
|
- var currentTask = OperationCrane1List.Where(t => t.IsStart == false && t.Line == 2).First();
|
|
|
- var ok = CustomerEnv.CraneLineOperate(this, currentTask);
|
|
|
- if (ok == "OK")
|
|
|
+ if (OperationCrane1List.Count != 0 && CustomerEnv.CurrentOperationLine2 == null && OperationCrane1List.Where(t => t.IsStart == false && t.Line == 2).ToList().Count != 0
|
|
|
+ && GetListenReg($"2#LineDone").Value == 0)
|
|
|
{
|
|
|
- currentTask.IsStart = true;
|
|
|
- CustomerEnv.CurrentOperationLine2 = currentTask;
|
|
|
- OperationCrane1List.Remove(CurrentOperationLine2);
|
|
|
+ var currentTask = OperationCrane1List.Where(t => t.IsStart == false && t.Line == 2).First();
|
|
|
+ var ok = CustomerEnv.CraneLineOperate(this, currentTask);
|
|
|
+ if (ok == "OK")
|
|
|
+ {
|
|
|
+ currentTask.IsStart = true;
|
|
|
+ CustomerEnv.CurrentOperationLine2 = currentTask;
|
|
|
+ OperationCrane1List.Remove(CurrentOperationLine2);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- if (GetListenReg($"2#CraneReady").Value == 1 && GetListenReg($"3#LineReady").Value == 1 &&
|
|
|
- CustomerEnv.LowThenUpOperation23 == null && GetListenReg($"4#CheckButton").Value == 0 && Crane_2IsRun == false)
|
|
|
- {
|
|
|
- if (OperationCrane2List.Count != 0 && CustomerEnv.CurrentOperationLine3 == null && OperationCrane2List.Where(t => t.IsStart == false && t.Line == 3).ToList().Count != 0
|
|
|
- && GetListenReg($"3#LineDone").Value == 0)
|
|
|
+ if (GetListenReg($"2#CraneReady").Value == 1 && GetListenReg($"3#LineReady").Value == 1 &&
|
|
|
+ CustomerEnv.LowThenUpOperation23 == null && GetListenReg($"4#CheckButton").Value == 0 && Crane_2IsRun == false)
|
|
|
{
|
|
|
- var currentTask = OperationCrane2List.Where(t => t.IsStart == false && t.Line == 3).First();
|
|
|
- var ok = CustomerEnv.CraneLineOperate(this, currentTask);
|
|
|
- if (ok == "OK")
|
|
|
+ if (OperationCrane2List.Count != 0 && CustomerEnv.CurrentOperationLine3 == null && OperationCrane2List.Where(t => t.IsStart == false && t.Line == 3).ToList().Count != 0
|
|
|
+ && GetListenReg($"3#LineDone").Value == 0)
|
|
|
{
|
|
|
- currentTask.IsStart = true;
|
|
|
- CustomerEnv.CurrentOperationLine3 = currentTask;
|
|
|
- OperationCrane2List.Remove(CurrentOperationLine3);
|
|
|
+ var currentTask = OperationCrane2List.Where(t => t.IsStart == false && t.Line == 3).First();
|
|
|
+ var ok = CustomerEnv.CraneLineOperate(this, currentTask);
|
|
|
+ if (ok == "OK")
|
|
|
+ {
|
|
|
+ currentTask.IsStart = true;
|
|
|
+ CustomerEnv.CurrentOperationLine3 = currentTask;
|
|
|
+ OperationCrane2List.Remove(CurrentOperationLine3);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- if (GetListenReg($"2#CraneReady").Value == 1 && GetListenReg($"4#LineReady").Value == 1 &&
|
|
|
- CustomerEnv.LowThenUpOperation24 == null && GetListenReg($"3#CheckButton").Value == 0 && Crane_2IsRun == false)
|
|
|
- {
|
|
|
- if (OperationCrane2List.Count != 0 && CustomerEnv.CurrentOperationLine4 == null && OperationCrane2List.Where(t => t.IsStart == false && t.Line == 4).ToList().Count != 0
|
|
|
- && GetListenReg($"4#LineDone").Value == 0)
|
|
|
+ if (GetListenReg($"2#CraneReady").Value == 1 && GetListenReg($"4#LineReady").Value == 1 &&
|
|
|
+ CustomerEnv.LowThenUpOperation24 == null && GetListenReg($"3#CheckButton").Value == 0 && Crane_2IsRun == false)
|
|
|
{
|
|
|
- var currentTask = OperationCrane2List.Where(t => t.IsStart == false && t.Line == 4).First();
|
|
|
- var ok = CustomerEnv.CraneLineOperate(this, currentTask);
|
|
|
- if (ok == "OK")
|
|
|
+ if (OperationCrane2List.Count != 0 && CustomerEnv.CurrentOperationLine4 == null && OperationCrane2List.Where(t => t.IsStart == false && t.Line == 4).ToList().Count != 0
|
|
|
+ && GetListenReg($"4#LineDone").Value == 0)
|
|
|
{
|
|
|
- currentTask.IsStart = true;
|
|
|
- CustomerEnv.CurrentOperationLine4 = currentTask;
|
|
|
- OperationCrane2List.Remove(CurrentOperationLine4);
|
|
|
+ var currentTask = OperationCrane2List.Where(t => t.IsStart == false && t.Line == 4).First();
|
|
|
+ var ok = CustomerEnv.CraneLineOperate(this, currentTask);
|
|
|
+ if (ok == "OK")
|
|
|
+ {
|
|
|
+ currentTask.IsStart = true;
|
|
|
+ CustomerEnv.CurrentOperationLine4 = currentTask;
|
|
|
+ OperationCrane2List.Remove(CurrentOperationLine4);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- #endregion
|
|
|
+ #endregion
|
|
|
|
|
|
|
|
|
- #region 堆垛机任务完成执行逻辑
|
|
|
- if (GetListenReg($"1#LineDone").Value == 1 && GetListenReg($"1#CranePutDone").Value == 1)
|
|
|
- {
|
|
|
- var isWriteOK = base.GetListenReg($"1#LineDone").WriteReg("0");
|
|
|
- var isWriteButton = base.GetListenReg($"1#CheckButton").WriteReg("0"); //输送线按钮复位
|
|
|
- if (CustomerEnv.CurrentOperationLine1 != null && CustomerEnv.CurrentOperationLine1.IsStart == true)
|
|
|
+ #region 堆垛机任务完成执行逻辑
|
|
|
+ if (GetListenReg($"1#LineDone").Value == 1 && GetListenReg($"1#CranePutDone").Value == 1)
|
|
|
{
|
|
|
- if (isWriteOK)
|
|
|
+ var isWriteOK = base.GetListenReg($"1#LineDone").WriteReg("0");
|
|
|
+ var isWriteButton = base.GetListenReg($"1#CheckButton").WriteReg("0"); //输送线按钮复位
|
|
|
+ if (CustomerEnv.CurrentOperationLine1 != null && CustomerEnv.CurrentOperationLine1.IsStart == true)
|
|
|
{
|
|
|
- CurrentOperationLine1 = null;
|
|
|
+ if (isWriteOK)
|
|
|
+ {
|
|
|
+ CurrentOperationLine1 = null;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- else if (GetListenReg($"2#LineDone").Value == 1 && GetListenReg($"1#CranePutDone").Value == 1)
|
|
|
- {
|
|
|
- var isWriteOK = base.GetListenReg($"2#LineDone").WriteReg("0");
|
|
|
- var isWriteButton = base.GetListenReg($"2#CheckButton").WriteReg("0"); //输送线按钮复位
|
|
|
- if (CustomerEnv.CurrentOperationLine2 != null && CustomerEnv.CurrentOperationLine2.IsStart == true)
|
|
|
+ else if (GetListenReg($"2#LineDone").Value == 1 && GetListenReg($"1#CranePutDone").Value == 1)
|
|
|
{
|
|
|
- if (isWriteOK)
|
|
|
+ var isWriteOK = base.GetListenReg($"2#LineDone").WriteReg("0");
|
|
|
+ var isWriteButton = base.GetListenReg($"2#CheckButton").WriteReg("0"); //输送线按钮复位
|
|
|
+ if (CustomerEnv.CurrentOperationLine2 != null && CustomerEnv.CurrentOperationLine2.IsStart == true)
|
|
|
{
|
|
|
- CurrentOperationLine2 = null;
|
|
|
+ if (isWriteOK)
|
|
|
+ {
|
|
|
+ CurrentOperationLine2 = null;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- if (GetListenReg($"3#LineDone").Value == 1 && GetListenReg($"2#CranePutDone").Value == 1)
|
|
|
- {
|
|
|
- var isWriteOK = base.GetListenReg($"3#LineDone").WriteReg("0");
|
|
|
- var isWriteButton = base.GetListenReg($"3#CheckButton").WriteReg("0"); //输送线按钮复位
|
|
|
- if (CustomerEnv.CurrentOperationLine3 != null && CustomerEnv.CurrentOperationLine3.IsStart == true)
|
|
|
+ if (GetListenReg($"3#LineDone").Value == 1 && GetListenReg($"2#CranePutDone").Value == 1)
|
|
|
{
|
|
|
- if (isWriteOK)
|
|
|
+ var isWriteOK = base.GetListenReg($"3#LineDone").WriteReg("0");
|
|
|
+ var isWriteButton = base.GetListenReg($"3#CheckButton").WriteReg("0"); //输送线按钮复位
|
|
|
+ if (CustomerEnv.CurrentOperationLine3 != null && CustomerEnv.CurrentOperationLine3.IsStart == true)
|
|
|
{
|
|
|
- CurrentOperationLine3 = null;
|
|
|
+ if (isWriteOK)
|
|
|
+ {
|
|
|
+ CurrentOperationLine3 = null;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- else if (GetListenReg($"4#LineDone").Value == 1 && GetListenReg($"2#CranePutDone").Value == 1)
|
|
|
- {
|
|
|
- var isWriteOK = base.GetListenReg($"4#LineDone").WriteReg("0");
|
|
|
- var isWriteButton = base.GetListenReg($"4#CheckButton").WriteReg("0"); //输送线按钮复位
|
|
|
- if (CustomerEnv.CurrentOperationLine4 != null && CustomerEnv.CurrentOperationLine4.IsStart == true)
|
|
|
+ else if (GetListenReg($"4#LineDone").Value == 1 && GetListenReg($"2#CranePutDone").Value == 1)
|
|
|
{
|
|
|
- if (isWriteOK)
|
|
|
+ var isWriteOK = base.GetListenReg($"4#LineDone").WriteReg("0");
|
|
|
+ var isWriteButton = base.GetListenReg($"4#CheckButton").WriteReg("0"); //输送线按钮复位
|
|
|
+ if (CustomerEnv.CurrentOperationLine4 != null && CustomerEnv.CurrentOperationLine4.IsStart == true)
|
|
|
{
|
|
|
- CurrentOperationLine4 = null;
|
|
|
+ if (isWriteOK)
|
|
|
+ {
|
|
|
+ CurrentOperationLine4 = null;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
#endregion
|
|
|
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ private void WriteScreen()
|
|
|
+ {
|
|
|
+ var screen1 = MachineServer.GetInstance().GetMachine<SampleMachine>("显示屏1");
|
|
|
+ if (screen1?.GetListenReg("ScreenRow1") != null && CurrentOperationLine1 != null)
|
|
|
+ {
|
|
|
+ var rcl = CurrentOperationLine1.RowColLayerFormat();
|
|
|
+ screen1?.GetListenReg("ScreenRow1").WriteReg($" {rcl}");
|
|
|
+ }
|
|
|
+ if (screen1?.GetListenReg("ScreenRow2") != null && CurrentOperationLine1 != null)
|
|
|
+ {
|
|
|
+ screen1?.GetListenReg("ScreenRow2").WriteReg(CurrentOperationLine1.ItemName);
|
|
|
+ }
|
|
|
+ if (screen1?.GetListenReg("ScreenRow1") != null && CurrentOperationLine1 == null)
|
|
|
+ {
|
|
|
+ screen1?.GetListenReg("ScreenRow1").WriteReg(" 00-000-00");
|
|
|
+ screen1?.GetListenReg("ScreenRow2").WriteReg(" ");
|
|
|
+ }
|
|
|
+
|
|
|
+ var screen2 = MachineServer.GetInstance().GetMachine<SampleMachine>("显示屏2");
|
|
|
+ if (screen2?.GetListenReg("ScreenRow1") != null && CurrentOperationLine2 != null)
|
|
|
+ {
|
|
|
+ var rcl = CurrentOperationLine2.RowColLayerFormat();
|
|
|
+ screen2?.GetListenReg("ScreenRow1").WriteReg($" {rcl}");
|
|
|
+ }
|
|
|
+ if (screen2?.GetListenReg("ScreenRow2") != null && CurrentOperationLine2 != null)
|
|
|
+ {
|
|
|
+ screen2?.GetListenReg("ScreenRow2").WriteReg(CurrentOperationLine2.ItemName);
|
|
|
+ }
|
|
|
+ if (screen2?.GetListenReg("ScreenRow1") != null && CurrentOperationLine2 == null)
|
|
|
+ {
|
|
|
+ screen2?.GetListenReg("ScreenRow1").WriteReg(" 00-000-00");
|
|
|
+ screen2?.GetListenReg("ScreenRow2").WriteReg(" ");
|
|
|
+ }
|
|
|
+
|
|
|
+ var screen3 = MachineServer.GetInstance().GetMachine<SampleMachine>("显示屏3");
|
|
|
+ if (screen3?.GetListenReg("ScreenRow1") != null && CurrentOperationLine3 != null)
|
|
|
+ {
|
|
|
+ var rcl = CurrentOperationLine3.RowColLayerFormat();
|
|
|
+ screen3?.GetListenReg("ScreenRow1").WriteReg($" {rcl}");
|
|
|
+ }
|
|
|
+ if (screen3?.GetListenReg("ScreenRow2") != null && CurrentOperationLine3 != null)
|
|
|
+ {
|
|
|
+ screen3?.GetListenReg("ScreenRow2").WriteReg(CurrentOperationLine3.ItemName);
|
|
|
+ }
|
|
|
+ if (screen3?.GetListenReg("ScreenRow1") != null && CurrentOperationLine3 == null)
|
|
|
+ {
|
|
|
+ screen3?.GetListenReg("ScreenRow1").WriteReg(" 00-000-00");
|
|
|
+ screen3?.GetListenReg("ScreenRow2").WriteReg(" ");
|
|
|
+ }
|
|
|
+
|
|
|
+ var screen4 = MachineServer.GetInstance().GetMachine<SampleMachine>("显示屏4");
|
|
|
+ if (screen4?.GetListenReg("ScreenRow1") != null && CurrentOperationLine4 != null)
|
|
|
+ {
|
|
|
+ var rcl = CurrentOperationLine4.RowColLayerFormat();
|
|
|
+ screen4?.GetListenReg("ScreenRow1").WriteReg($" {rcl}");
|
|
|
+ }
|
|
|
+ if (screen4?.GetListenReg("ScreenRow2") != null && CurrentOperationLine4 != null)
|
|
|
+ {
|
|
|
+ screen4?.GetListenReg("ScreenRow2").WriteReg(CurrentOperationLine4.ItemName);
|
|
|
+ }
|
|
|
+ if (screen4?.GetListenReg("ScreenRow1") != null && CurrentOperationLine4 == null)
|
|
|
+ {
|
|
|
+ screen4?.GetListenReg("ScreenRow1").WriteReg(" 00-000-00");
|
|
|
+ screen4?.GetListenReg("ScreenRow2").WriteReg(" ");
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
}
|