Commit 66b5b84b LN

调宽失败时提示原因

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