Commit 66b5b84b LN

调宽失败时提示原因

1 个父辈 ac07ba06
......@@ -21,6 +21,8 @@ namespace TSA_V.DeviceLibrary
public static int Line_LastWidth = ConfigAppSettings.GetIntValue(Setting_Init.Line_LastWidth);
private static string Line_WidthPosition = ConfigAppSettings.GetValue(Setting_Init.Line_WidthPosition);
public static int DefaultPosition = 0;
public static bool LineInitOk = false;
public static void Init()
{
LaodMap();
......@@ -29,21 +31,33 @@ namespace TSA_V.DeviceLibrary
public static bool CanStartChWidth()
public static bool CanStartChWidth(out string msg)
{
msg = "";
if (!LineInitOk)
{
msg = ResourceControl.GetString("LineNotInitOk", "设备未初始化完成");
return false;
}
//是否可以开始调宽
if (IOManager.IOValue(IOManager.LineInCheck).Equals(IO_VALUE.HIGH) ||
IOManager.IOValue(IOManager.LineOutCheck).Equals(IO_VALUE.HIGH) ||
IOManager.IOValue(IOManager.LineWorkCheck).Equals(IO_VALUE.HIGH))
{
msg = msg = ResourceControl.GetString("LineCheckHigh", "线体检测信号亮");
return false;
}
//如果已经在调宽中
if (!IsStop)
{
msg = msg = ResourceControl.GetString("PreNotEnd", "上次调宽还未结束");
return false ;
}
return true ;
}
......@@ -62,9 +76,9 @@ namespace TSA_V.DeviceLibrary
{
return result =ResourceControl.GetString(ResourceControl.WidthInvalid, "宽度无效");
}
if (!CanStartChWidth())
if (!CanStartChWidth(out string msg))
{
return result = ResourceControl.GetString(ResourceControl.ChangeWFail, "启动调宽失败");
return result = ResourceControl.GetString(ResourceControl.ChangeWFail, "启动调宽失败")+" : "+msg;
}
if (!IsStop)
{
......
......@@ -338,6 +338,9 @@ namespace TSA_V.DeviceLibrary
{
PUSICANControl.InitRNodeConfig(LWidthManager.Line_NodeAddr, true);
Thread.Sleep(10);
LWidthManager.LineInitOk = true;
LogUtil.info(Name + " LWidthManager.LineInitOk =true");
}
//所有轴原点返回
foreach (Dictionary<int, NodeInfo> map in RotateMap.Values)
......@@ -432,8 +435,9 @@ namespace TSA_V.DeviceLibrary
{
PUSICANControl.InitRNodeConfig(LWidthManager.Line_NodeAddr, true);
Thread.Sleep(10);
LWidthManager.LineInitOk = true;
LogUtil.info(Name + " LWidthManager.LineInitOk =true");
}
if (lineOk)
{
ToRunning("当前为过板模式,转盘不需要复位,复位完成,进入运行状态");
......@@ -571,7 +575,7 @@ namespace TSA_V.DeviceLibrary
IsInSuddenDown = true;
StopWork();
//StopMove();
PUSICANControl.Close();
//PUSICANControl.Close();
IOManager.IOMove(IOManager.SMEMA_Up, IO_VALUE.LOW);
IOManager.IOMove(IOManager.SMEMA_Down, IO_VALUE.LOW);
}
......
......@@ -63,9 +63,9 @@ namespace TSA_V
int w = (int)numTarget.Value;
int p = FormUtil.GetIntValue(txtTargetPosition);
LogUtil.info("点击 轨道调宽:【" + w + "】【" + p + "】");
if (!LWidthManager.CanStartChWidth())
if (!LWidthManager.CanStartChWidth(out string msg))
{
MessageBox.Show(ResourceCulture.GetString(ResourceCulture.ChangeWFail, "启动调宽失败"));
MessageBox.Show(ResourceCulture.GetString(ResourceCulture.ChangeWFail, "启动调宽失败")+" : "+msg);
return;
}
Task.Factory.StartNew(delegate
......
......@@ -2569,4 +2569,14 @@
<data name="GuobanMode" xml:space="preserve">
<value>Operation failed, currently in InLine mode</value>
</data>
<data name="LineCheckHigh" xml:space="preserve">
<value>Line detection signal on</value>
</data>
<data name="LineNotInitOk" xml:space="preserve">
<value>Device not initialized</value>
</data>
<data name="PreNotEnd" xml:space="preserve">
<value>The last adjustment of width has not yet ended</value>
</data>
</root>
\ No newline at end of file
......@@ -2568,4 +2568,13 @@
<data name="GuobanMode" xml:space="preserve">
<value>操作失败,当前为过板模式</value>
</data>
<data name="LineCheckHigh" xml:space="preserve">
<value>线体检测信号亮</value>
</data>
<data name="LineNotInitOk" xml:space="preserve">
<value>设备未初始化完成</value>
</data>
<data name="PreNotEnd" xml:space="preserve">
<value>上次调宽还未结束</value>
</data>
</root>
\ No newline at end of file
......@@ -259,9 +259,9 @@ namespace TSA_V
return;
}
if (!LWidthManager.CanStartChWidth())
if (!LWidthManager.CanStartChWidth(out string errMsg))
{
MessageBox.Show(ResourceCulture.GetString(ResourceCulture.ChangeWFail, "启动调宽失败"));
MessageBox.Show(ResourceCulture.GetString(ResourceCulture.ChangeWFail, "启动调宽失败")+ ":" + errMsg);
return;
}
......
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!