Commit 85436596 几米阳光

断开连接时清理上次的命令

1 个父辈 07b72b9c
...@@ -152,11 +152,7 @@ namespace URSoldering.DeviceLibrary ...@@ -152,11 +152,7 @@ namespace URSoldering.DeviceLibrary
{ {
WeldLog("焊接结束,等待AOI检测"); WeldLog("焊接结束,等待AOI检测");
WeldMoveStep.NextMoveStep(MoveStep.W14_AOICheck); WeldMoveStep.NextMoveStep(MoveStep.W14_AOICheck);
int AOIWaitSeconds = ConfigAppSettings.GetIntValue(Setting_Init.AOIWaitSeconds); int AOIWaitSeconds = ConfigAppSettings.GetIntValue(Setting_Init.AOIWaitSeconds);
if (AOIWaitSeconds <= 0)
{
AOIWaitSeconds = 4000;
}
WeldMoveStep.WaitList.Add(WaitResultInfo.WaitTime(AOIWaitSeconds)); WeldMoveStep.WaitList.Add(WaitResultInfo.WaitTime(AOIWaitSeconds));
} }
else if (WeldMoveStep.moveStep.Equals(MoveStep.W14_AOICheck)) else if (WeldMoveStep.moveStep.Equals(MoveStep.W14_AOICheck))
......
...@@ -157,6 +157,7 @@ namespace URSoldering.DeviceLibrary ...@@ -157,6 +157,7 @@ namespace URSoldering.DeviceLibrary
} }
WarnMsg = ""; WarnMsg = "";
IsRun = false; IsRun = false;
ClearPreCMD();
LogUtil.info("" + LogName + "开始连接"); LogUtil.info("" + LogName + "开始连接");
PreStartTime = DateTime.Now; PreStartTime = DateTime.Now;
startCount++; startCount++;
...@@ -330,7 +331,6 @@ namespace URSoldering.DeviceLibrary ...@@ -330,7 +331,6 @@ namespace URSoldering.DeviceLibrary
{ {
WarnMsg = "机器人状态[" + msg + "],启动超时"; WarnMsg = "机器人状态[" + msg + "],启动超时";
StopRobot(); StopRobot();
IsRun = false;
} }
} }
} }
...@@ -370,7 +370,6 @@ namespace URSoldering.DeviceLibrary ...@@ -370,7 +370,6 @@ namespace URSoldering.DeviceLibrary
{ {
WarnMsg = "机器人急停中[" + msg + "],启动超时"; WarnMsg = "机器人急停中[" + msg + "],启动超时";
StopRobot(); StopRobot();
IsRun = false;
} }
} }
else else
...@@ -430,6 +429,7 @@ namespace URSoldering.DeviceLibrary ...@@ -430,6 +429,7 @@ namespace URSoldering.DeviceLibrary
{ {
try try
{ {
ClearPreCMD();
IsStartConnect = false; IsStartConnect = false;
reconnectTimer.Enabled = false; reconnectTimer.Enabled = false;
URRobotClient.StopListen(); URRobotClient.StopListen();
...@@ -481,19 +481,20 @@ namespace URSoldering.DeviceLibrary ...@@ -481,19 +481,20 @@ namespace URSoldering.DeviceLibrary
{ {
moveCmd = "movep(p[" + x + spiltStr + y + spiltStr + z + spiltStr + point.RX + spiltStr + point.RY + spiltStr + point.RZ + "],a=1.0, v=1.0, r=0)"; moveCmd = "movep(p[" + x + spiltStr + y + spiltStr + z + spiltStr + point.RX + spiltStr + point.RY + spiltStr + point.RZ + "],a=1.0, v=1.0, r=0)";
} }
ClearPreCMD();
URRobotClient.LastMoveCMD = moveCmd;
LastSendPoint = point;
}
public static void ClearPreCMD()
{
if (!URRobotClient.LastMoveCMD.Equals("")) if (!URRobotClient.LastMoveCMD.Equals(""))
{ {
LogUtil.info(LogName+ ",清除上次未发送指令:【" + URRobotClient.LastMoveCMD + "】" + "新坐标" + point.ToShowStr()); LogUtil.info(LogName + ",清除上次未发送指令:【" + URRobotClient.LastMoveCMD + "】" );
URRobotClient.LastMoveCMD = ""; URRobotClient.LastMoveCMD = "";
} }
else
{
//LogUtil.info(LogName + "试图移动到:" + point.ToShowStr());
}
URRobotClient.LastMoveCMD = moveCmd;
LastSendPoint = point;
} }
public static void MoveTo(URPointValue point) public static void MoveTo(URPointValue point)
{ {
MoveTo(point, false); MoveTo(point, false);
} }
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<add key="VideoCameraName" value="[0] Integrated Camera" /> <add key="VideoCameraName" value="[0] Integrated Camera" />
<add key="AOIFileConfig" value="\RobotConfig\AOIConfig\AOIProgram.vscf" /> <add key="AOIFileConfig" value="\RobotConfig\AOIConfig\AOIProgram.vscf" />
<add key="AOICheckPointFile" value="\RobotConfig\AOIConfig\AOIPointProgram.vscf" /> <add key="AOICheckPointFile" value="\RobotConfig\AOIConfig\AOIPointProgram.vscf" />
<add key="AOIWaitSeconds" value="4000" /> <add key="AOIWaitSeconds" value="1000" />
<!--送丝器消除报警需要持续的秒数--> <!--送丝器消除报警需要持续的秒数-->
<add key="SendWireRecoverSeconds" value="5" /> <add key="SendWireRecoverSeconds" value="5" />
<!--空闲多久需要休眠,=0表示不需要休眠,>0表示休眠秒数--> <!--空闲多久需要休眠,=0表示不需要休眠,>0表示休眠秒数-->
......
...@@ -128,48 +128,52 @@ ...@@ -128,48 +128,52 @@
// label17 // label17
// //
this.label17.AutoSize = true; this.label17.AutoSize = true;
this.label17.Location = new System.Drawing.Point(219, 58); this.label17.Location = new System.Drawing.Point(219, 68);
this.label17.Name = "label17"; this.label17.Name = "label17";
this.label17.Size = new System.Drawing.Size(32, 17); this.label17.Size = new System.Drawing.Size(92, 17);
this.label17.TabIndex = 66; this.label17.TabIndex = 66;
this.label17.Text = "说明"; this.label17.Text = "正常焊接的焊点";
this.label17.Visible = false; this.label17.Visible = false;
// //
// label16 // label16
// //
this.label16.AutoSize = true; this.label16.AutoSize = true;
this.label16.Location = new System.Drawing.Point(215, 93); this.label16.Location = new System.Drawing.Point(215, 98);
this.label16.Name = "label16"; this.label16.Name = "label16";
this.label16.Size = new System.Drawing.Size(68, 17); this.label16.Size = new System.Drawing.Size(68, 17);
this.label16.TabIndex = 65; this.label16.TabIndex = 65;
this.label16.Text = "清洗时间:"; this.label16.Text = "清洗时间:";
this.label16.Visible = false;
// //
// txtClearTime // txtClearTime
// //
this.txtClearTime.Enabled = false; this.txtClearTime.Enabled = false;
this.txtClearTime.Location = new System.Drawing.Point(286, 90); this.txtClearTime.Location = new System.Drawing.Point(286, 95);
this.txtClearTime.Name = "txtClearTime"; this.txtClearTime.Name = "txtClearTime";
this.txtClearTime.Size = new System.Drawing.Size(66, 23); this.txtClearTime.Size = new System.Drawing.Size(66, 23);
this.txtClearTime.TabIndex = 64; this.txtClearTime.TabIndex = 64;
this.txtClearTime.Visible = false;
// //
// label15 // label15
// //
this.label15.AutoSize = true; this.label15.AutoSize = true;
this.label15.Location = new System.Drawing.Point(358, 93); this.label15.Location = new System.Drawing.Point(358, 98);
this.label15.Name = "label15"; this.label15.Name = "label15";
this.label15.Size = new System.Drawing.Size(25, 17); this.label15.Size = new System.Drawing.Size(25, 17);
this.label15.TabIndex = 63; this.label15.TabIndex = 63;
this.label15.Text = "ms"; this.label15.Text = "ms";
this.label15.Visible = false;
// //
// chbClear // chbClear
// //
this.chbClear.AutoSize = true; this.chbClear.AutoSize = true;
this.chbClear.Location = new System.Drawing.Point(92, 91); this.chbClear.Location = new System.Drawing.Point(92, 96);
this.chbClear.Name = "chbClear"; this.chbClear.Name = "chbClear";
this.chbClear.Size = new System.Drawing.Size(87, 21); this.chbClear.Size = new System.Drawing.Size(87, 21);
this.chbClear.TabIndex = 62; this.chbClear.TabIndex = 62;
this.chbClear.Text = "清洗烙铁头"; this.chbClear.Text = "清洗烙铁头";
this.chbClear.UseVisualStyleBackColor = true; this.chbClear.UseVisualStyleBackColor = true;
this.chbClear.Visible = false;
this.chbClear.CheckedChanged += new System.EventHandler(this.chbClear_CheckedChanged); this.chbClear.CheckedChanged += new System.EventHandler(this.chbClear_CheckedChanged);
// //
// cmbPointType // cmbPointType
...@@ -178,7 +182,7 @@ ...@@ -178,7 +182,7 @@
this.cmbPointType.FormattingEnabled = true; this.cmbPointType.FormattingEnabled = true;
this.cmbPointType.Items.AddRange(new object[] { this.cmbPointType.Items.AddRange(new object[] {
"普通焊点"}); "普通焊点"});
this.cmbPointType.Location = new System.Drawing.Point(92, 55); this.cmbPointType.Location = new System.Drawing.Point(92, 65);
this.cmbPointType.Name = "cmbPointType"; this.cmbPointType.Name = "cmbPointType";
this.cmbPointType.Size = new System.Drawing.Size(121, 25); this.cmbPointType.Size = new System.Drawing.Size(121, 25);
this.cmbPointType.TabIndex = 61; this.cmbPointType.TabIndex = 61;
...@@ -186,7 +190,7 @@ ...@@ -186,7 +190,7 @@
// label2 // label2
// //
this.label2.AutoSize = true; this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(43, 58); this.label2.Location = new System.Drawing.Point(43, 68);
this.label2.Name = "label2"; this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(44, 17); this.label2.Size = new System.Drawing.Size(44, 17);
this.label2.TabIndex = 60; this.label2.TabIndex = 60;
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!