Commit 3a0bb722 张东亮

称重逻辑加入入库

1 个父辈 8fd26869
...@@ -23,10 +23,11 @@ namespace DeviceLibrary ...@@ -23,10 +23,11 @@ namespace DeviceLibrary
{ {
get => MoveInfo.MoveStep == MoveStep.InWaitBoxLeave; get => MoveInfo.MoveStep == MoveStep.InWaitBoxLeave;
} }
public void OpenDoor(MoveInfo moveInfo) { public void OpenDoor(MoveInfo moveInfo)
{
LogUtil.info($"OpenDoor:low:{DO_Door_Down},up:{DO_Door_Up}"); LogUtil.info($"OpenDoor:low:{DO_Door_Down},up:{DO_Door_Up}");
MainMachine.CylinderMove(moveInfo, DO_Door_Down, DO_Door_Up, IO_VALUE.HIGH); MainMachine.CylinderMove(moveInfo, DO_Door_Down, DO_Door_Up, IO_VALUE.HIGH);
} }
public void CloseDoor(MoveInfo moveInfo) public void CloseDoor(MoveInfo moveInfo)
{ {
...@@ -49,7 +50,8 @@ namespace DeviceLibrary ...@@ -49,7 +50,8 @@ namespace DeviceLibrary
} }
return false; return false;
} }
public void Rescan() { public void Rescan()
{
MoveInfo.NextMoveStep(MoveStep.In03); MoveInfo.NextMoveStep(MoveStep.In03);
MoveInfo.log("扫码失败重新扫码"); MoveInfo.log("扫码失败重新扫码");
} }
...@@ -126,13 +128,11 @@ namespace DeviceLibrary ...@@ -126,13 +128,11 @@ namespace DeviceLibrary
} }
else else
{ {
MoveInfo.NextMoveStep(MoveStep.InWaitServerCallback); MoveInfo.NextMoveStep(MoveStep.In05);
MoveInfo.log($"已完成扫码,等待服务器反馈库位 Count={x.Count}"); Lift.LiftDown(MoveInfo);
MoveInfo.MoveParam.IsNg = false; MoveInfo.log($"放下入料阻挡");
MoveInfo.MoveParam.codeInfos = x;
var cc = x.Select((a) => a.CodeStr);
mainMachine.ServerCM.SendInStoreRequest(cc.ToArray(), this, true);
} }
} }
else if (MoveInfo.IsTimeOut(10)) else if (MoveInfo.IsTimeOut(10))
{ {
...@@ -140,30 +140,11 @@ namespace DeviceLibrary ...@@ -140,30 +140,11 @@ namespace DeviceLibrary
MoveInfo.log($"等待扫码超时,重新扫码"); MoveInfo.log($"等待扫码超时,重新扫码");
} }
break; break;
case MoveStep.InWaitServerCallback: case MoveStep.In05:
if (RobotManage.InoutDebugMode) Line.LineRun("work", false, 999);
{ MoveInfo.NextMoveStep(MoveStep.In06);
//Msg.add("等待手动选择入库库位", MsgLevel.info); MiddleStop(MoveInfo, IO_VALUE.LOW);
MoveInfo.NextMoveStep(MoveStep.StartInStore); MoveInfo.log("检测到周转箱3,中间阻挡下降");
}
else if (MoveInfo.IsTimeOut(5))
Msg.add("等待服务器返回库位", MsgLevel.info);
else if (MoveInfo.IsTimeOut(15))
{
MoveInfo.NextMoveStep(MoveStep.Wait);
MoveInfo.log($"等待服务器返回库位超时");
}
break;
case MoveStep.StartInStore:
MoveInfo.NextMoveStep(MoveStep.In05);
Lift.LiftDown(MoveInfo);
MoveInfo.log($"放下入料阻挡");
break;
case MoveStep.In05:
Line.LineRun("work", false, 999);
MoveInfo.NextMoveStep(MoveStep.In06);
MiddleStop(MoveInfo, IO_VALUE.LOW);
MoveInfo.log("检测到周转箱3,中间阻挡下降");
break; break;
case MoveStep.In06: case MoveStep.In06:
if (IOValue(IO_OverHead_Check).Equals(IO_VALUE.LOW)) if (IOValue(IO_OverHead_Check).Equals(IO_VALUE.LOW))
...@@ -179,7 +160,7 @@ namespace DeviceLibrary ...@@ -179,7 +160,7 @@ namespace DeviceLibrary
{ {
MoveInfo.NextMoveStep(MoveStep.In09); MoveInfo.NextMoveStep(MoveStep.In09);
MiddleStop(MoveInfo, IO_VALUE.HIGH); MiddleStop(MoveInfo, IO_VALUE.HIGH);
Line.LineRun("work",false, 2); Line.LineRun("work", false, 2);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000)); MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
} }
else if (MoveInfo.IsTimeOut(15)) else if (MoveInfo.IsTimeOut(15))
...@@ -195,7 +176,58 @@ namespace DeviceLibrary ...@@ -195,7 +176,58 @@ namespace DeviceLibrary
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_EndMaterialTop_Check, IO_VALUE.HIGH)); MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_EndMaterialTop_Check, IO_VALUE.HIGH));
break; break;
case MoveStep.In10: case MoveStep.In10:
MoveInfo.NextMoveStep(MoveStep.InWaitBoxLeave); MoveInfo.NextMoveStep(MoveStep.In11);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
break;
case MoveStep.In11:
//读取称重
bool res = BSQController.queryData(Config.WeightSensorPort, out double weight);
if (res)
{
if (weight > 0 && weight <= Config.StoreWeightLimited)
{
var x = InScanTask.Result;
{
MoveInfo.NextMoveStep(MoveStep.InWaitServerCallback);
MoveInfo.log($"已完成扫码,并称重完成 {weight}kg,等待服务器反馈库位 Count={x.Count}");
MoveInfo.MoveParam.IsNg = false;
MoveInfo.MoveParam.codeInfos = x;
var cc = x.Select((a) => a.CodeStr);
mainMachine.ServerCM.SendInStoreRequest(cc.ToArray(), this, true,weight);
}
}
else//超重
{
MoveInfo.NextMoveStep(MoveStep.Out05);
Lift.LiftDown(MoveInfo);
Msg.add("周转箱超重,退出", MsgLevel.alarm);
MoveInfo.log($"周转箱当前重量{weight},超重。顶升下降,出库该周转箱");
}
}
else
{
MoveInfo.NextMoveStep(MoveStep.In10);
MoveInfo.log($"获取周转箱重量失败,重新读取");
}
break;
case MoveStep.InWaitServerCallback:
if (RobotManage.InoutDebugMode)
{
//Msg.add("等待手动选择入库库位", MsgLevel.info);
MoveInfo.NextMoveStep(MoveStep.StartInStore);
}
else if (MoveInfo.IsTimeOut(5))
Msg.add("等待服务器返回库位", MsgLevel.info);
else if (MoveInfo.IsTimeOut(15))
{
MoveInfo.NextMoveStep(MoveStep.Wait);
MoveInfo.log($"等待服务器返回库位超时");
}
break;
case MoveStep.StartInStore:
MoveInfo.NextMoveStep(MoveStep.InWaitBoxLeave);
break; break;
case MoveStep.InWaitBoxLeave: case MoveStep.InWaitBoxLeave:
Msg.add("周转箱等待入库", MsgLevel.info); Msg.add("周转箱等待入库", MsgLevel.info);
...@@ -252,7 +284,7 @@ namespace DeviceLibrary ...@@ -252,7 +284,7 @@ namespace DeviceLibrary
Task.Delay(delay).Wait(); Task.Delay(delay).Wait();
List<CodeInfo> LastCodeList; List<CodeInfo> LastCodeList;
CodeManager.CloseCamera(InOutSide == InOutSideE.Left ? Config.CameraName_Left : Config.CameraName_Right); CodeManager.CloseCamera(InOutSide == InOutSideE.Left ? Config.CameraName_Left : Config.CameraName_Right);
LastCodeList = CodeManager.CameraScan(new List<string> { InOutSide== InOutSideE.Left? Config.CameraName_Left: Config.CameraName_Right }); LastCodeList = CodeManager.CameraScan(new List<string> { InOutSide == InOutSideE.Left ? Config.CameraName_Left : Config.CameraName_Right });
return LastCodeList; return LastCodeList;
})); }));
......
...@@ -38,6 +38,9 @@ namespace DeviceLibrary ...@@ -38,6 +38,9 @@ namespace DeviceLibrary
In08, In08,
In09, In09,
In10, In10,
In11,
In12,
In13,
InWaitBoxLeave, //等待料箱入库 InWaitBoxLeave, //等待料箱入库
InBoxLeaved, //料箱已取走 InBoxLeaved, //料箱已取走
InOverHead, InOverHead,
......
...@@ -31,8 +31,8 @@ namespace TheMachine ...@@ -31,8 +31,8 @@ namespace TheMachine
{ {
this.axisMoveControl1 = new DeviceLibrary.AxisMoveControl(); this.axisMoveControl1 = new DeviceLibrary.AxisMoveControl();
this.panel1 = new System.Windows.Forms.Panel(); this.panel1 = new System.Windows.Forms.Panel();
this.configControl1 = new TheMachine.ConfigControl();
this.button1 = new System.Windows.Forms.Button(); this.button1 = new System.Windows.Forms.Button();
this.configControl1 = new TheMachine.ConfigControl();
this.panel1.SuspendLayout(); this.panel1.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
...@@ -55,15 +55,6 @@ namespace TheMachine ...@@ -55,15 +55,6 @@ namespace TheMachine
this.panel1.Size = new System.Drawing.Size(1234, 924); this.panel1.Size = new System.Drawing.Size(1234, 924);
this.panel1.TabIndex = 2; this.panel1.TabIndex = 2;
// //
// configControl1
//
this.configControl1.Config = null;
this.configControl1.Location = new System.Drawing.Point(568, 3);
this.configControl1.Name = "configControl1";
this.configControl1.Size = new System.Drawing.Size(647, 474);
this.configControl1.TabIndex = 1;
this.configControl1.Tag = "not";
//
// button1 // button1
// //
this.button1.Location = new System.Drawing.Point(16, 409); this.button1.Location = new System.Drawing.Point(16, 409);
...@@ -74,6 +65,15 @@ namespace TheMachine ...@@ -74,6 +65,15 @@ namespace TheMachine
this.button1.UseVisualStyleBackColor = true; this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click); this.button1.Click += new System.EventHandler(this.button1_Click);
// //
// configControl1
//
this.configControl1.Config = null;
this.configControl1.Location = new System.Drawing.Point(568, 3);
this.configControl1.Name = "configControl1";
this.configControl1.Size = new System.Drawing.Size(647, 474);
this.configControl1.TabIndex = 1;
this.configControl1.Tag = "not";
//
// AxisControl // AxisControl
// //
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
......
...@@ -20,6 +20,7 @@ namespace TheMachine ...@@ -20,6 +20,7 @@ namespace TheMachine
{ {
public Form1() public Form1()
{ {
Control.CheckForIllegalCrossThreadCalls = false;
InitializeComponent(); InitializeComponent();
this.FormClosing += Form1_FormClosing; this.FormClosing += Form1_FormClosing;
this.Text = Setting_Init.App_Title + " " + Setting_Init.Server_CID; this.Text = Setting_Init.App_Title + " " + Setting_Init.Server_CID;
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!