Commit 86f05a77 LN

bug修改

1 个父辈 a4f817cd
......@@ -14,7 +14,7 @@ namespace TSA_V.DeviceLibrary
/// 流水线宽度
/// </summary>
public class LWidthManager
{
{
public static int Line_ChangeValue = ConfigAppSettings.GetIntValue(Setting_Init.Line_ChangeValue);
public static int Line_HomeWidth = ConfigAppSettings.GetIntValue(Setting_Init.Line_HomeWidth);
public static uint Line_NodeAddr =(uint) ConfigAppSettings.GetIntValue(Setting_Init.Line_NodeAddr);
......@@ -63,16 +63,23 @@ namespace TSA_V.DeviceLibrary
}
public static bool IsStop = true ;
public static void StopChangeWidth()
{
if (!IsStop)
{
{
IsStop = true;
PUSICANControl.StopMove(LWidthManager.Line_NodeAddr);
LogUtil.info("StopChangeWidth ,停止调宽电机运动");
Thread.Sleep(100);
}
else if (PUSICANControl.IsBusy(Line_NodeAddr))
{
LogUtil.info(" Node[" + Line_NodeAddr + "]停止调宽电机动作");
PUSICANControl.StopMove(Line_NodeAddr);
}
}
public static string StartChangeWidth(int targetWidth, int targetPosition, int timeOutSeconds = 600)
{
......
......@@ -622,7 +622,8 @@ namespace TSA_V.DeviceLibrary
if (!IsInSuddenDown)
{
WarnMsg = GetTime() + ResourceControl.GetString(ResourceControl.SuddenDownMsg, "收到急停信号,停止所有运动,设备断开连接");
LogUtil.error("收到急停信号,停止所有运动,断开can协议连接");
LogUtil.error("收到急停信号,停止所有运动,断开can协议连接, 设置调宽LineInitOk = false");
LWidthManager.LineInitOk = false;
IsInSuddenDown = true;
StopWork();
//StopMove();
......@@ -930,7 +931,10 @@ namespace TSA_V.DeviceLibrary
}
}
LedLabelController.CloseAll();
LedLabelController.CloseAll();
//停止调宽
LWidthManager.StopChangeWidth();
}
private static void CheckWorkWait()
{
......
......@@ -306,7 +306,7 @@
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.btnNext);
this.Controls.Add(this.btnPre);
this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.Margin = new System.Windows.Forms.Padding(4);
this.Name = "FrmBoardPutCom";
this.Text = "备料";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FrmPutCom_FormClosing);
......
......@@ -62,6 +62,12 @@ namespace TSA_V
numTarget_ValueChanged(null, null);
int w = (int)numTarget.Value;
int p = FormUtil.GetIntValue(txtTargetPosition);
if (!IOManager.ShuddenOK())
{
LogUtil.info("点击 轨道调宽:【" + w + "】【" + p + "】 急停未开");
MessageBox.Show(ResourceControl.GetString("FrmBoardInfo_lblMsg_Text", "急停未开"));
return;
}
LogUtil.info("点击 轨道调宽:【" + w + "】【" + p + "】");
if (!LWidthManager.CanStartChWidth(out string msg))
{
......@@ -162,7 +168,20 @@ namespace TSA_V
private void btnHomeM_Click(object sender, EventArgs e)
{
LogUtil.info(Name+ "点击 原点返回");
if (!LWidthManager.LineInitOk)
{
string msg = ResourceControl.GetString("LineNotInitOk", "设备未初始化完成");
LogUtil.info(Name + "点击 原点返回 " + msg);
MessageBox.Show(msg);
return;
}
if (!IOManager.ShuddenOK())
{
LogUtil.info(Name + "点击 原点返回 急停未开");
MessageBox.Show(ResourceControl.GetString("FrmBoardInfo_lblMsg_Text", "急停未开"));
return;
}
LogUtil.info(Name + "点击 原点返回");
PUSICANControl.HomeMove(LWidthManager.Line_NodeAddr, true);
}
......
......@@ -55,6 +55,11 @@ namespace TSA_V
btnBottomDown.Visible = false;
btnBottomUp.Visible=false;
}
if (TSAVBean.DisableSideCylinder)
{
btnSideForward.Visible = false;
btnSideBack.Visible = false;
}
}
private void FrmMain_FormClosing(object sender, FormClosingEventArgs e)
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!