Commit bf97d423 LN

报警消息WarnMsg 改为WarnIfo对象。

1 个父辈 b6d40e83
...@@ -260,8 +260,8 @@ namespace OnlineStore.AutoInOutStore ...@@ -260,8 +260,8 @@ namespace OnlineStore.AutoInOutStore
return; return;
} }
lblTemp.Text = store.currTempStr; lblTemp.Text = store.currTempStr;
lblBatchMsg.Text = AutomaticBaiting.WarnMsg; lblBatchMsg.Text = AutomaticBaiting.WarnObj.WarnMsg;
lblWarnMsg.Text = store.WarnMsg; lblWarnMsg.Text = store.WarnObj.WarnMsg ;
BatchInoutStatus(); BatchInoutStatus();
//忙碌状态不读取状态 //忙碌状态不读取状态
if (!store.storeRunStatus.Equals(StoreRunStatus.Busy)) if (!store.storeRunStatus.Equals(StoreRunStatus.Busy))
......
...@@ -253,16 +253,16 @@ ...@@ -253,16 +253,16 @@
<value>Alarm</value> <value>Alarm</value>
</data> </data>
<data name="InStoreError" xml:space="preserve"> <data name="InStoreError" xml:space="preserve">
<value>Saving format error</value> <value>Saving format error:code [{0}] posId [{1}]</value>
</data> </data>
<data name="InStoreNoPosition" xml:space="preserve"> <data name="InStoreNoPosition" xml:space="preserve">
<value>Saving location not found</value> <value>Saving location not found:code [{0}] posId [{1}]</value>
</data> </data>
<data name="OutStoreError" xml:space="preserve"> <data name="OutStoreError" xml:space="preserve">
<value>Providing format error</value> <value>Providing format error{0}</value>
</data> </data>
<data name="OutStoreNoPosition" xml:space="preserve"> <data name="OutStoreNoPosition" xml:space="preserve">
<value>Providing location not found</value> <value>Providing location not found{0}</value>
</data> </data>
<data name="AbsMove" xml:space="preserve"> <data name="AbsMove" xml:space="preserve">
<value>Absolute move</value> <value>Absolute move</value>
...@@ -875,7 +875,7 @@ ...@@ -875,7 +875,7 @@
<value>Access controller block</value> <value>Access controller block</value>
</data> </data>
<data name="Y16" xml:space="preserve"> <data name="Y16" xml:space="preserve">
<value >alarm buzzer</value> <value>alarm buzzer</value>
</data> </data>
<data name="X21" xml:space="preserve"> <data name="X21" xml:space="preserve">
<value>Feeding door close</value> <value>Feeding door close</value>
...@@ -1153,7 +1153,6 @@ ...@@ -1153,7 +1153,6 @@
<data name="startFailAir" xml:space="preserve"> <data name="startFailAir" xml:space="preserve">
<value>Startup failure: no air pressure signal</value> <value>Startup failure: no air pressure signal</value>
</data> </data>
<data name="FrmStoreBox_groupAuto_Text" xml:space="preserve"> <data name="FrmStoreBox_groupAuto_Text" xml:space="preserve">
<value>auto storing</value> <value>auto storing</value>
</data> </data>
...@@ -1190,7 +1189,6 @@ ...@@ -1190,7 +1189,6 @@
<data name="禁用调试" xml:space="preserve"> <data name="禁用调试" xml:space="preserve">
<value>Disable debugging</value> <value>Disable debugging</value>
</data> </data>
<data name="X25" xml:space="preserve"> <data name="X25" xml:space="preserve">
<value>Doorlock cylinder open 2</value> <value>Doorlock cylinder open 2</value>
</data> </data>
...@@ -1221,4 +1219,31 @@ ...@@ -1221,4 +1219,31 @@
<data name="自动出入库操作" xml:space="preserve"> <data name="自动出入库操作" xml:space="preserve">
<value>Auto providing operation</value> <value>Auto providing operation</value>
</data> </data>
<data name="AxisAlarm" xml:space="preserve">
<value>Motion axis {0} alarm</value>
</data>
<data name="OpenAxisFail" xml:space="preserve">
<value>Failed to open axis {0}</value>
</data>
<data name="AxisHomeMoveAlarm" xml:space="preserve">
<value>The movement {0} axis {1} receives the origin completion signal, the current position [{2}], the error is too large, it needs to alarm</value>
</data>
<data name="AxisMoveAlarm" xml:space="preserve">
<value>Movement {0} axis {1} target position [{2}] current position {3} error is too large, need to alarm</value>
</data>
<data name="MoveTimeOut" xml:space="preserve">
<value>[{0}]Timeout{1}[{2}]</value>
</data>
<data name="WaitSingleTimeOut" xml:space="preserve">
<value>Wait signal {0}={1} timeout</value>
</data>
<data name="WaitInstoreTimeOut" xml:space="preserve">
<value>[{0}] timeout [wait to store][{1} seconds]</value>
</data>
<data name="InStoreNoCode" xml:space="preserve">
<value>The qr code is not scanned, the material plate needs to be sent out</value>
</data>
<data name="NoCodeMsg" xml:space="preserve">
<value>If the qr code is not scanned, please put it back into the material tray</value>
</data>
</root> </root>
\ No newline at end of file \ No newline at end of file
...@@ -253,16 +253,16 @@ ...@@ -253,16 +253,16 @@
<value>报警</value> <value>报警</value>
</data> </data>
<data name="InStoreError" xml:space="preserve"> <data name="InStoreError" xml:space="preserve">
<value>入库库位格式错误:</value> <value>入库库位格式错误条码[{0}]库位号[{1}]</value>
</data> </data>
<data name="InStoreNoPosition" xml:space="preserve"> <data name="InStoreNoPosition" xml:space="preserve">
<value>入库未找到库位:</value> <value>入库未找到库位:条码[{0}]库位号[{1}]</value>
</data> </data>
<data name="OutStoreError" xml:space="preserve"> <data name="OutStoreError" xml:space="preserve">
<value>出库格式错误:</value> <value>出库格式错误{0}</value>
</data> </data>
<data name="OutStoreNoPosition" xml:space="preserve"> <data name="OutStoreNoPosition" xml:space="preserve">
<value>出库未找库位:</value> <value>出库未找库位:{0}</value>
</data> </data>
<data name="AbsMove" xml:space="preserve"> <data name="AbsMove" xml:space="preserve">
<value>绝对运动</value> <value>绝对运动</value>
...@@ -871,7 +871,7 @@ ...@@ -871,7 +871,7 @@
<value>门禁功能屏蔽</value> <value>门禁功能屏蔽</value>
</data> </data>
<data name="Y16" xml:space="preserve"> <data name="Y16" xml:space="preserve">
<value >报警蜂鸣器</value> <value>报警蜂鸣器</value>
</data> </data>
<data name="X21" xml:space="preserve"> <data name="X21" xml:space="preserve">
<value>上料机构门关闭</value> <value>上料机构门关闭</value>
...@@ -1188,8 +1188,6 @@ ...@@ -1188,8 +1188,6 @@
<data name="禁用调试" xml:space="preserve"> <data name="禁用调试" xml:space="preserve">
<value>禁用调试</value> <value>禁用调试</value>
</data> </data>
<data name="X25" xml:space="preserve"> <data name="X25" xml:space="preserve">
<value>门锁气缸打开端2</value> <value>门锁气缸打开端2</value>
</data> </data>
...@@ -1220,4 +1218,31 @@ ...@@ -1220,4 +1218,31 @@
<data name="自动出入库操作" xml:space="preserve"> <data name="自动出入库操作" xml:space="preserve">
<value>自动出入库操作</value> <value>自动出入库操作</value>
</data> </data>
<data name="AxisAlarm" xml:space="preserve">
<value>运动轴{0}报警</value>
</data>
<data name="OpenAxisFail" xml:space="preserve">
<value>打开轴{0}失败</value>
</data>
<data name="AxisHomeMoveAlarm" xml:space="preserve">
<value>运动{0}轴{1}收到原点完成信号,当前位置[{2}],误差过大,需要报警</value>
</data>
<data name="AxisMoveAlarm" xml:space="preserve">
<value>运动{0}轴{1}目标位置[{2}]当前位置{3}误差过大,需要报警</value>
</data>
<data name="MoveTimeOut" xml:space="preserve">
<value>[{0}]超时{1}[{2}]</value>
</data>
<data name="WaitSingleTimeOut" xml:space="preserve">
<value>等待信号{0}={1}超时</value>
</data>
<data name="WaitInstoreTimeOut" xml:space="preserve">
<value>[{0}]超时[等待可以入库][{1}秒]</value>
</data>
<data name="InStoreNoCode" xml:space="preserve">
<value>未扫到二维码,需要将料盘送出</value>
</data>
<data name="NoCodeMsg" xml:space="preserve">
<value>未扫到二维码,请重新放入料盘</value>
</data>
</root> </root>
\ No newline at end of file \ No newline at end of file
...@@ -210,6 +210,7 @@ IO模块读取时间改为可配置。 ...@@ -210,6 +210,7 @@ IO模块读取时间改为可配置。
20190610 20190610
部分中英文修改。 部分中英文修改。
20190613
报警消息WarnMsg 改为WarnIfo对象。
...@@ -64,6 +64,14 @@ namespace OnlineStore.Common ...@@ -64,6 +64,14 @@ namespace OnlineStore.Common
/// </summary> /// </summary>
public string msg { get; set; } public string msg { get; set; }
/// <summary> /// <summary>
///提示消息类型
/// </summary>
public string msgCode { get; set; }
/// <summary>
/// 消息参数
/// </summary>
public string[] msgParam { get; set; }
/// <summary>
/// 包含的多个 BOX 的状态信息 /// 包含的多个 BOX 的状态信息
/// </summary> /// </summary>
public Dictionary<int, BoxStatus> boxStatus = new Dictionary<int, BoxStatus>(); public Dictionary<int, BoxStatus> boxStatus = new Dictionary<int, BoxStatus>();
...@@ -71,6 +79,12 @@ namespace OnlineStore.Common ...@@ -71,6 +79,12 @@ namespace OnlineStore.Common
/// 报警集合 /// 报警集合
/// </summary> /// </summary>
public List<AlarmInfo> alarmList = new List<AlarmInfo>(); public List<AlarmInfo> alarmList = new List<AlarmInfo>();
public void SetMsg(string msg, string type, params string[] param)
{
this.msg = msg;
this.msgCode = type;
this.msgParam = param;
}
} }
/// <summary> /// <summary>
...@@ -97,6 +111,14 @@ namespace OnlineStore.Common ...@@ -97,6 +111,14 @@ namespace OnlineStore.Common
/// </summary> /// </summary>
public string msg { get; set; } public string msg { get; set; }
/// <summary> /// <summary>
///提示消息类型
/// </summary>
public string msgCode { get; set; }
/// <summary>
/// 消息参数
/// </summary>
public string[] msgParam { get; set; }
/// <summary>
/// 温度 /// 温度
/// </summary> /// </summary>
public string temperature { get; set; } public string temperature { get; set; }
...@@ -115,6 +137,13 @@ namespace OnlineStore.Common ...@@ -115,6 +137,13 @@ namespace OnlineStore.Common
get { return _data; } get { return _data; }
set { _data = value; } set { _data = value; }
} }
public void SetMsg(string msg,string type,params string[] param)
{
this.msg = msg;
this.msgCode = type;
this.msgParam = param;
}
} }
public class AlarmInfo public class AlarmInfo
{ {
...@@ -163,7 +192,7 @@ namespace OnlineStore.Common ...@@ -163,7 +192,7 @@ namespace OnlineStore.Common
/// <summary> /// <summary>
/// 0,1=入库,2=出库 /// 0,1=入库,2=出库
/// </summary> /// </summary>
public int inOutStatus { get; set; } public int inOutStatus { get; set; }
} }
public class ParamDefine public class ParamDefine
......
...@@ -18,7 +18,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -18,7 +18,12 @@ namespace OnlineStore.DeviceLibrary
string result = GetStrEvent?.Invoke(value, value); string result = GetStrEvent?.Invoke(value, value);
return result; return result;
} }
public static string GetString(string id, string defaultStr) public static string GetString(string id, params object[] param)
{
string result = GetStringEvent?.Invoke(id, id, param);
return result;
}
public static string GetString(string id, string defaultStr)
{ {
string result = GetStrEvent?.Invoke(id, defaultStr); string result = GetStrEvent?.Invoke(id, defaultStr);
return result; return result;
...@@ -149,19 +154,19 @@ namespace OnlineStore.DeviceLibrary ...@@ -149,19 +154,19 @@ namespace OnlineStore.DeviceLibrary
/// </summary> /// </summary>
public static string Alarm = "Alarm"; public static string Alarm = "Alarm";
/// <summary> /// <summary>
///"入库库位格式错误:" ///入库库位格式错误:条码[{0}]库位号[{1}]
/// </summary> /// </summary>
public static string InStoreError = "InStoreError"; public static string InStoreError = "InStoreError";
/// <summary> /// <summary>
///"入库未找到库位:" ///"入库未找到库位:条码[{0}]库位号[{1}]"
/// </summary> /// </summary>
public static string InStoreNoPosition = "InStoreNoPosition"; public static string InStoreNoPosition = "InStoreNoPosition";
/// <summary> /// <summary>
///"出库格式错误:" ///出库格式错误{0}
/// </summary> /// </summary>
public static string OutStoreError = "OutStoreError"; public static string OutStoreError = "OutStoreError";
/// <summary> /// <summary>
///"出库未找库位:" ///"出库未找库位:{0}"
/// </summary> /// </summary>
public static string OutStoreNoPosition = "OutStoreNoPosition"; public static string OutStoreNoPosition = "OutStoreNoPosition";
...@@ -314,5 +319,50 @@ namespace OnlineStore.DeviceLibrary ...@@ -314,5 +319,50 @@ namespace OnlineStore.DeviceLibrary
///启动失败:没有气压信号 ///启动失败:没有气压信号
/// </summary> /// </summary>
public static string startFailAir = "startFailAir"; public static string startFailAir = "startFailAir";
/// <summary>
/// 打开轴{0}失败
/// </summary>
public static string OpenAxisFail = "OpenAxisFail";
/// <summary>
/// 运动轴{0}报警
/// </summary>
public static string AxisAlarm = "AxisAlarm";
/// <summary>
/// 等待信号{0}={1}超时
/// </summary>
public static string WaitSingleTimeOut = "WaitSingleTimeOut";
/// <summary>
/// 运动{0}轴{1}收到原点完成信号,当前位置[{2}],误差过大,需要报警
/// </summary>
public static string AxisHomeMoveAlarm = "AxisHomeMoveAlarm";
/// <summary>
/// 运动{0}轴{1}目标位置[{2}]当前位置{3}误差过大,需要报警
/// </summary>
public static string AxisMoveAlarm = "AxisMoveAlarm";
/// <summary>
/// [{0}]超时{1}[{2}]
/// </summary>
public static string MoveTimeOut = "MoveTimeOut";
/// <summary>
/// [{0}]超时[等待可以入库][{1}秒]
/// </summary>
public static string WaitInstoreTimeOut = "WaitInstoreTimeOut";
/// <summary>
/// 叉子料盘检测有料,请检查
/// </summary>
public static string HasWare = "HasWare";
/// <summary>
/// 未扫到二维码,请重新放入料盘
/// </summary>
public static string NoCodeMsg = "NoCodeMsg";
/// <summary>
/// 未扫到二维码,需要将料盘送出
/// </summary>
public static string InStoreNoCode = "InStoreNoCode";
} }
} }
...@@ -114,18 +114,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -114,18 +114,13 @@ namespace OnlineStore.DeviceLibrary
if (IOManager.IOValue(IO_Type.SuddenStop_BTN).Equals(IO_VALUE.LOW)) if (IOManager.IOValue(IO_Type.SuddenStop_BTN).Equals(IO_VALUE.LOW))
{ {
if (isInSuddenDown.Equals(false)) if (isInSuddenDown.Equals(false))
{ {
//LogUtil.error(LOGGER, StoreName + "收到急停信号,等待200后再次判断");
//Thread.Sleep(200);
//if (IOManager.IOValue(IO_Type.SuddenStop_BTN).Equals(IO_VALUE.LOW))
//{
isInSuddenDown = true; isInSuddenDown = true;
LogUtil.error(LOGGER, StoreName + "收到急停信号,报警急停"); LogUtil.error(LOGGER, StoreName + "收到急停信号,报警急停");
WarnMsg = StoreName + ResourceControl.GetString(ResourceControl.inSuddenStop, "Receive emergency stop signal, alarm to stop"); // WarnMsg = StoreName + ResourceControl.GetString(ResourceControl.inSuddenStop, "收到急停信号,报警急停");
SetWarnMsg( ResourceControl.inSuddenStop);
//报警时会关闭所有轴 //报警时会关闭所有轴
Alarm(StoreAlarmType.SuddenStop, "1", WarnMsg, StoreMoveType.None); Alarm(StoreAlarmType.SuddenStop, "1", WarnObj.WarnMsg, StoreMoveType.None);
//}
} }
} }
else else
...@@ -160,10 +155,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -160,10 +155,11 @@ namespace OnlineStore.DeviceLibrary
TimeSpan span = DateTime.Now - lastAirCloseTime; TimeSpan span = DateTime.Now - lastAirCloseTime;
if (span.TotalSeconds > Config.AirCheckSeconds) if (span.TotalSeconds > Config.AirCheckSeconds)
{ {
WarnMsg =ResourceControl.GetString(ResourceControl.NoAIr, "未检测到气压信号"); // WarnMsg = ResourceControl.GetString(ResourceControl.NoAIr, "未检测到气压信号");
SetWarnMsg( ResourceControl.NoAIr);
preAirValue = IO_VALUE.LOW; preAirValue = IO_VALUE.LOW;
LogUtil.info("已持续【" + FormUtil.GetSpanStr(span) + "】未检测到气压信号,报警"); LogUtil.error("已持续【" + FormUtil.GetSpanStr(span) + "】未检测到气压信号,报警");
Alarm(StoreAlarmType.NoAirCheck, "2", WarnMsg, StoreMoveType.None); Alarm(StoreAlarmType.NoAirCheck, "2", WarnObj.WarnMsg, StoreMoveType.None);
return; return;
} }
} }
...@@ -212,16 +208,18 @@ namespace OnlineStore.DeviceLibrary ...@@ -212,16 +208,18 @@ namespace OnlineStore.DeviceLibrary
{ {
if (ShuoKeControls.isRun == false && (!StoreManager.OpenShuoKe(this))) if (ShuoKeControls.isRun == false && (!StoreManager.OpenShuoKe(this)))
{ {
WarnMsg = ResourceControl.GetString(ResourceControl.PreConnectFail, "启动失败:压紧轴连接失败"); // WarnMsg = ResourceControl.GetString(ResourceControl.PreConnectFail, "启动失败:压紧轴连接失败");
LogUtil.error(StoreName + "打开驱动器串口失败,启动失败!"); SetWarnMsgAndLog(ResourceControl.PreConnectFail);
// LogUtil.error(StoreName + "打开驱动器串口失败,启动失败!");
return false; return false;
} }
} }
string canStart = AutomaticBaiting.CanStart(); string canStart = AutomaticBaiting.CanStart();
if (!canStart.Equals("")) if (!canStart.Equals(""))
{ {
WarnMsg = canStart; //WarnMsg = canStart;
LogUtil.info(StoreName + canStart); SetWarnMsg(canStart);
// LogUtil.info(StoreName + canStart);
return false; return false;
} }
autoNext = false; autoNext = false;
...@@ -259,13 +257,15 @@ namespace OnlineStore.DeviceLibrary ...@@ -259,13 +257,15 @@ namespace OnlineStore.DeviceLibrary
{ {
if (suddenBtn.Equals(IO_VALUE.LOW)) if (suddenBtn.Equals(IO_VALUE.LOW))
{ {
WarnMsg = ResourceControl.GetString(ResourceControl.startFail, "Startup failure: emergency stop not opened"); //WarnMsg = ResourceControl.GetString(ResourceControl.startFail, "Startup failure: emergency stop not opened");
LogUtil.error(LOGGER, " (" + StoreName + ")启动出现错误:急停没开 !启动失败!"); SetWarnMsgAndLog(ResourceControl.startFail);
// LogUtil.error(LOGGER, " (" + StoreName + ")启动出现错误:急停没开 !启动失败!");
} }
else else
{ {
WarnMsg = ResourceControl.GetString(ResourceControl.startFailAir, "Startup failure: no air pressure signal"); // WarnMsg = ResourceControl.GetString(ResourceControl.startFailAir, "Startup failure: no air pressure signal");
LogUtil.error(LOGGER, " (" + StoreName + ")启动出现错误:没有气压信号 !启动失败!"); // LogUtil.error(LOGGER, " (" + StoreName + ")启动出现错误:没有气压信号 !启动失败!");
SetWarnMsgAndLog(ResourceControl.startFailAir);
} }
return false; return false;
} }
...@@ -280,8 +280,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -280,8 +280,9 @@ namespace OnlineStore.DeviceLibrary
private void ReturnHome() private void ReturnHome()
{ {
ResetEvent?.Invoke(); ResetEvent?.Invoke();
WarnMsg = ""; // WarnMsg = "";
CurrInOutACount = 0; SetWarnMsg("");
CurrInOutACount = 0;
CurrInOutCount = 0; CurrInOutCount = 0;
IOManager.IOMove(IO_Type.Alarm_HddLed, IO_VALUE.LOW); IOManager.IOMove(IO_Type.Alarm_HddLed, IO_VALUE.LOW);
IOManager.IOMove(IO_Type.AutoRun_HddLed, IO_VALUE.HIGH); IOManager.IOMove(IO_Type.AutoRun_HddLed, IO_VALUE.HIGH);
...@@ -339,8 +340,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -339,8 +340,8 @@ namespace OnlineStore.DeviceLibrary
storeRunStatus = StoreRunStatus.Reset; storeRunStatus = StoreRunStatus.Reset;
storeStatus = StoreStatus.ResetMove; storeStatus = StoreStatus.ResetMove;
StoreMove.NewMove(StoreMoveType.StoreReset); StoreMove.NewMove(StoreMoveType.StoreReset);
WarnMsg = ""; //WarnMsg = "";
SetWarnMsg("");
if (!RunAxis(true)) if (!RunAxis(true))
{ {
LogUtil.info(LOGGER, StoreName + "复位时打开轴失败,需要再次复位,直接报警停止复位"); LogUtil.info(LOGGER, StoreName + "复位时打开轴失败,需要再次复位,直接报警停止复位");
...@@ -509,7 +510,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -509,7 +510,8 @@ namespace OnlineStore.DeviceLibrary
storeRunStatus = StoreRunStatus.Runing; storeRunStatus = StoreRunStatus.Runing;
if (alarmType.Equals(StoreAlarmType.None)) if (alarmType.Equals(StoreAlarmType.None))
{ {
WarnMsg = ""; SetWarnMsg("");
//WarnMsg = "";
} }
} }
...@@ -668,8 +670,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -668,8 +670,9 @@ namespace OnlineStore.DeviceLibrary
//如果此时轴三还在报警,需要提示错误并等待 //如果此时轴三还在报警,需要提示错误并等待
if (ACServerManager.GetAlarmStatus(Config.InOut_Axis.DeviceName, Config.InOut_Axis.GetAxisValue()) > 0) if (ACServerManager.GetAlarmStatus(Config.InOut_Axis.DeviceName, Config.InOut_Axis.GetAxisValue()) > 0)
{ {
WarnMsg = ResourceControl.GetString(ResourceControl.InoutAlarm, "进出轴报警!复位失败,请检查!"); //WarnMsg = ResourceControl.GetString(ResourceControl.InoutAlarm, "进出轴报警!复位失败,请检查!");
LogUtil.error(LOGGER, "进出轴报警!复位失败,请检查!"); //LogUtil.error(LOGGER, "进出轴报警!复位失败,请检查!");
SetWarnMsgAndLog(ResourceControl.InoutAlarm);
} }
//复位和回原点要等轴3进出轴ORG亮了以后才能返回其他轴 //复位和回原点要等轴3进出轴ORG亮了以后才能返回其他轴
ResetLog("原点返回中 :压紧轴,旋转轴,上下轴开始原点返回"); ResetLog("原点返回中 :压紧轴,旋转轴,上下轴开始原点返回");
...@@ -697,7 +700,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -697,7 +700,8 @@ namespace OnlineStore.DeviceLibrary
storeRunStatus = StoreRunStatus.Runing; storeRunStatus = StoreRunStatus.Runing;
StoreMove.EndMove(); StoreMove.EndMove();
storeStatus = StoreStatus.StoreOnline; storeStatus = StoreStatus.StoreOnline;
WarnMsg = ""; //WarnMsg = "";
SetWarnMsg("");
break; break;
default: break; default: break;
} }
...@@ -772,9 +776,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -772,9 +776,10 @@ namespace OnlineStore.DeviceLibrary
{ {
ACServerManager.ServoOff(axis.DeviceName, axis.GetAxisValue()); ACServerManager.ServoOff(axis.DeviceName, axis.GetAxisValue());
int alarmCode = GetAlarmCodeByAxis(axis); int alarmCode = GetAlarmCodeByAxis(axis);
WarnMsg = StoreName + "打开轴" + axis.Explain + "失败 "; // WarnMsg = StoreName + "打开轴" + axis.Explain + "失败 ";
LogUtil.info(LOGGER, StoreName + WarnMsg); //LogUtil.info(LOGGER, StoreName + WarnMsg);
Alarm(StoreAlarmType.AxisAlarm, GetAlarmCodeByAxis(axis).ToString(), WarnMsg, StoreMove.MoveType); SetWarnMsgAndLog(ResourceControl.OpenAxisFail, axis.GetNameStr());
Alarm(StoreAlarmType.AxisAlarm, GetAlarmCodeByAxis(axis).ToString(), WarnObj.WarnMsg, StoreMove.MoveType);
return false; return false;
} }
} }
...@@ -830,7 +835,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -830,7 +835,8 @@ namespace OnlineStore.DeviceLibrary
/// </summary> /// </summary>
public override void StopRun() public override void StopRun()
{ {
WarnMsg = ""; SetWarnMsg("");
//WarnMsg = "";
autoNext = false; autoNext = false;
IoCheckTimer.Enabled = false; IoCheckTimer.Enabled = false;
serverConnectTimer.Enabled = false; serverConnectTimer.Enabled = false;
...@@ -850,7 +856,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -850,7 +856,8 @@ namespace OnlineStore.DeviceLibrary
ShuoKeControls.ClosePort(); ShuoKeControls.ClosePort();
} }
HumitureController.Release(); HumitureController.Release();
StoreManager.CurrInOutType = 0;
//StoreManager.CurrInOutType = 0;
LogUtil.info(LOGGER, StoreName + "StopRun,停止运行,总运行时间:" + runTimeWatch.Elapsed.ToString()); LogUtil.info(LOGGER, StoreName + "StopRun,停止运行,总运行时间:" + runTimeWatch.Elapsed.ToString());
} }
public void Exit() public void Exit()
...@@ -1103,8 +1110,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -1103,8 +1110,8 @@ namespace OnlineStore.DeviceLibrary
{ {
//收到复位信号 //收到复位信号
LogUtil.info(LOGGER, "收到复位信号,自动复位"); LogUtil.info(LOGGER, "收到复位信号,自动复位");
// WarnMsg = ResourceControl.GetString(ResourceControl.AutoReset, "收到复位信号,自动复位");
WarnMsg = ResourceControl.GetString(ResourceControl.AutoReset, "收到复位信号,自动复位"); SetWarnMsg(ResourceControl.AutoReset);
Reset(); Reset();
} }
} }
...@@ -1166,33 +1173,35 @@ namespace OnlineStore.DeviceLibrary ...@@ -1166,33 +1173,35 @@ namespace OnlineStore.DeviceLibrary
//若BOX和移栽都没有在等待Io的过程中则此Io超时异常可能已经处理过 //若BOX和移栽都没有在等待Io的过程中则此Io超时异常可能已经处理过
if (alarmType.Equals(StoreAlarmType.IoSingleTimeOut) && StoreMove.IsInWait == false) if (alarmType.Equals(StoreAlarmType.IoSingleTimeOut) && StoreMove.IsInWait == false)
{ {
LogUtil.info(StoreName + "当前空闲中,清理信号超时异常【" + StoreManager.Store.alarmType + "】" + WarnMsg); LogUtil.info(StoreName + "当前空闲中,清理信号超时异常【" + StoreManager.Store.alarmType + "】" + WarnObj.WarnMsg);
alarmType = StoreAlarmType.None; alarmType = StoreAlarmType.None;
IOManager.IOMove(IO_Type.Buzzer_Sign, IO_VALUE.LOW); IOManager.IOMove(IO_Type.Buzzer_Sign, IO_VALUE.LOW);
WarnMsg = ""; // WarnMsg = "";
SetWarnMsg("");
} }
else if (alarmType.Equals(StoreAlarmType.BatchAlarm) || alarmType.Equals(StoreAlarmType.BatchIoTimeOut)) else if (alarmType.Equals(StoreAlarmType.BatchAlarm) || alarmType.Equals(StoreAlarmType.BatchIoTimeOut))
{ {
if (AutomaticBaiting.AutoBaitingStatus.Equals(StoreRunStatus.Runing) && AutomaticBaiting.StoreMove.IsInWait.Equals(false)) if (AutomaticBaiting.AutoBaitingStatus.Equals(StoreRunStatus.Runing) && AutomaticBaiting.StoreMove.IsInWait.Equals(false))
{ {
LogUtil.info("批量上下料模块空闲中,清理报警【" + StoreManager.Store.alarmType + "】" + AutomaticBaiting.WarnMsg); LogUtil.info("批量上下料模块空闲中,清理报警【" + StoreManager.Store.alarmType + "】" + AutomaticBaiting.WarnObj.WarnMsg);
alarmType = StoreAlarmType.None; alarmType = StoreAlarmType.None;
IOManager.IOMove(IO_Type.Buzzer_Sign, IO_VALUE.LOW); IOManager.IOMove(IO_Type.Buzzer_Sign, IO_VALUE.LOW);
AutomaticBaiting.WarnMsg = ""; AutomaticBaiting.SetWarnMsg( "");
} }
} }
} }
if (alarmType.Equals(StoreAlarmType.None)) if (alarmType.Equals(StoreAlarmType.None))
{ {
if (WarnMsg.Contains(AutomaticBaiting.TimeOut)) if (WarnObj.WarnMsg.Contains(AutomaticBaiting.TimeOut))
{ {
LogUtil.info("清理超时异常信息:"+WarnMsg); LogUtil.info("清理超时异常信息:"+ WarnObj.WarnMsg);
WarnMsg = ""; //WarnMsg = "";
SetWarnMsg("");
} }
if (AutomaticBaiting.WarnMsg.Contains(AutomaticBaiting.TimeOut)) if (AutomaticBaiting.WarnObj.WarnMsg.Contains(AutomaticBaiting.TimeOut))
{ {
LogUtil.info("清理超时异常信息:" + AutomaticBaiting.WarnMsg); LogUtil.info("清理超时异常信息:" + AutomaticBaiting.WarnObj.WarnMsg);
AutomaticBaiting.WarnMsg = ""; AutomaticBaiting.SetWarnMsg("");
} }
} }
...@@ -1358,16 +1367,18 @@ namespace OnlineStore.DeviceLibrary ...@@ -1358,16 +1367,18 @@ namespace OnlineStore.DeviceLibrary
{ {
if (Config.Batch_Axis.IsSameAxis(axisInfo.DeviceName,axisInfo.GetAxisValue()) ) if (Config.Batch_Axis.IsSameAxis(axisInfo.DeviceName,axisInfo.GetAxisValue()) )
{ {
AutomaticBaiting.WarnMsg = ResourceControl.GetString(ResourceControl.MoveAxis, " 运动轴") + axisInfo.Explain + ResourceControl.GetString(ResourceControl.Alarm, "报警"); // AutomaticBaiting.WarnMsg = ResourceControl.GetString(ResourceControl.MoveAxis, " 运动轴") + axisInfo.Explain + ResourceControl.GetString(ResourceControl.Alarm, "报警");
AutomaticBaiting.SetWarnMsg(ResourceControl.AxisAlarm, axisInfo.GetNameStr());
info.AlarmIoValue = alarmIo; info.AlarmIoValue = alarmIo;
Alarm(StoreAlarmType.BatchAxisAlarm, GetAlarmCodeByAxis(axisInfo).ToString(), WarnMsg, StoreMoveType.None); Alarm(StoreAlarmType.BatchAxisAlarm, GetAlarmCodeByAxis(axisInfo).ToString(), AutomaticBaiting.WarnObj.WarnMsg, StoreMoveType.None);
} }
else else
{ {
WarnMsg = StoreName + ResourceControl.GetString(ResourceControl.MoveAxis, " 运动轴") + axisInfo.Explain + ResourceControl.GetString(ResourceControl.Alarm, "报警"); // WarnMsg = StoreName + ResourceControl.GetString(ResourceControl.MoveAxis, " 运动轴") + axisInfo.Explain + ResourceControl.GetString(ResourceControl.Alarm, "报警");
SetWarnMsg(ResourceControl.AxisAlarm,axisInfo.GetNameStr());
info.AlarmIoValue = alarmIo; info.AlarmIoValue = alarmIo;
Alarm(StoreAlarmType.AxisAlarm, GetAlarmCodeByAxis(axisInfo).ToString(), WarnMsg, StoreMoveType.None); Alarm(StoreAlarmType.AxisAlarm, GetAlarmCodeByAxis(axisInfo).ToString(), WarnObj.WarnMsg, StoreMoveType.None);
} }
isInAlarm = true; isInAlarm = true;
} }
...@@ -1613,43 +1624,46 @@ namespace OnlineStore.DeviceLibrary ...@@ -1613,43 +1624,46 @@ namespace OnlineStore.DeviceLibrary
lineOperation.cid = CID; lineOperation.cid = CID;
lineOperation.seq = ConfigAppSettings.nextSeq(); lineOperation.seq = ConfigAppSettings.nextSeq();
lineOperation.status = 1; lineOperation.status = 1;
if (WarnMsg != "") if (WarnObj.WarnMsg != "")
{ {
lineOperation.status = (int)StoreStatus.Warning; lineOperation.status = (int)StoreStatus.Warning;
lineOperation.msg = WarnMsg;
} }
lineOperation.status = (int)StoreStatus.StoreOnline; lineOperation.status = (int)StoreStatus.StoreOnline;
BoxStatus boxStatus = new BoxStatus(); BoxStatus boxStatus = new BoxStatus();
boxStatus.boxId = StoreID; boxStatus.boxId = StoreID;
boxStatus.SetMsg(WarnObj.WarnMsg,WarnObj.MsgCode,WarnObj.MsgParam);
lineOperation.SetMsg(WarnObj.WarnMsg, WarnObj.MsgCode,WarnObj.MsgParam);
boxStatus.msg = WarnMsg; if (lineOperation.msg.Equals(""))
lineOperation.msg = WarnMsg;
if (WarnMsg.Equals(""))
{ {
boxStatus.msg = AutomaticBaiting.CodeMsg; WarnInfo obj = AutomaticBaiting.WarnObj;
lineOperation.msg = AutomaticBaiting.CodeMsg; boxStatus.SetMsg(obj.WarnMsg, obj.MsgCode, obj.MsgParam);
lineOperation.SetMsg(obj.WarnMsg, obj.MsgCode, obj.MsgParam);
}
if (lineOperation.msg.Equals(""))
{
boxStatus.SetMsg(AutomaticBaiting.CodeMsg, ResourceControl.NoCodeMsg );
lineOperation.SetMsg(AutomaticBaiting.CodeMsg, ResourceControl.NoCodeMsg);
AutomaticBaiting.CodeMsg = ""; AutomaticBaiting.CodeMsg = "";
} }
if (boxStatus.msg.Equals("")) if (lineOperation.msg.Equals(""))
{ {
boxStatus.msg = CodeOrInoutMsg; boxStatus.SetMsg(CodeOrInoutMsg, ResourceControl.InStoreNoCode);
lineOperation.msg = CodeOrInoutMsg; lineOperation.SetMsg(CodeOrInoutMsg, ResourceControl.InStoreNoCode);
CodeOrInoutMsg = "";
} }
if (CodeOrInoutMsg.Equals("")) if (CodeOrInoutMsg.Equals(""))
{ {
if (storeRunStatus.Equals(StoreRunStatus.Runing)&&AutomaticBaiting.AutoBaitingStatus.Equals(StoreRunStatus.Runing) if (storeRunStatus.Equals(StoreRunStatus.Runing)&&AutomaticBaiting.AutoBaitingStatus.Equals(StoreRunStatus.Runing)
&& IOManager.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH)) && IOManager.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH))
{ {
boxStatus.msg = "叉子料盘检测有料,请检查"; boxStatus.SetMsg(ResourceControl.GetString(ResourceControl.HasWare, "叉子料盘检测有料,请检查"),ResourceControl.HasWare);
lineOperation.msg = "叉子料盘检测有料,请检查"; lineOperation.SetMsg(ResourceControl.GetString(ResourceControl.HasWare, "叉子料盘检测有料,请检查"), ResourceControl.HasWare);
} }
} }
CodeOrInoutMsg = "";
//WarnMsg = ""; //WarnMsg = "";
//状态 //状态
boxStatus.status = GetStoreStatus(); boxStatus.status = GetStoreStatus();
...@@ -1905,8 +1919,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -1905,8 +1919,9 @@ namespace OnlineStore.DeviceLibrary
string[] posArray = posId.Split('#'); string[] posArray = posId.Split('#');
if (posArray.Length != 2) if (posArray.Length != 2)
{ {
WarnMsg = StoreName + ResourceControl.GetString(ResourceControl.OutStoreError, "出库格式错误:") + "【" + posId + "】"; //WarnMsg = StoreName + ResourceControl.GetString(ResourceControl.OutStoreError, "出库格式错误:") + "【" + posId + "】";
LogUtil.error(LOGGER, "收到服务器出库命令:库位号【" + posId + "】格式错误"); SetWarnMsgAndLog( ResourceControl.OutStoreError,posId);
//LogUtil.error(LOGGER, "收到服务器出库命令:库位号【" + posId + "】格式错误");
continue; continue;
} }
int storeId = int.Parse(posArray[0]); int storeId = int.Parse(posArray[0]);
...@@ -1916,8 +1931,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -1916,8 +1931,9 @@ namespace OnlineStore.DeviceLibrary
if (position == null) if (position == null)
{ {
//出入库没有找到服务器发送的库位,需要打印日志方便查询原因 //出入库没有找到服务器发送的库位,需要打印日志方便查询原因
WarnMsg = StoreName + ResourceControl.GetString(ResourceControl.OutStoreNoPosition, "出库未找库位:") + "【" + posId + "】"; //WarnMsg = StoreName + ResourceControl.GetString(ResourceControl.OutStoreNoPosition, "出库未找库位:") + "【" + posId + "】";
LogUtil.error(LOGGER, "收到服务器出库命令:未找到【" + posId + "】的库位信息"); // LogUtil.error(LOGGER, "收到服务器出库命令:未找到【" + posId + "】的库位信息");
SetWarnMsgAndLog(ResourceControl.OutStoreNoPosition, posId);
continue; continue;
} }
else else
......
...@@ -119,6 +119,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -119,6 +119,7 @@ namespace OnlineStore.DeviceLibrary
//当等待超过一分钟时,需要打印提示 //当等待超过一分钟时,需要打印提示
TimeSpan span = DateTime.Now - StoreMove.LastSetpTime; TimeSpan span = DateTime.Now - StoreMove.LastSetpTime;
string NotOkMsg = ""; string NotOkMsg = "";
int waitType = 0;
if (list.Count <= 0) if (list.Count <= 0)
{ {
StoreMove.EndStepWait(); StoreMove.EndStepWait();
...@@ -135,7 +136,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -135,7 +136,9 @@ namespace OnlineStore.DeviceLibrary
{ {
continue; continue;
} }
NotOkMsg = wait.ToStr(); NotOkMsg = wait.ToStr();
waitType = wait.WaitType;
if (wait.WaitType == (int)Wait_Type.AxisMove_1) if (wait.WaitType == (int)Wait_Type.AxisMove_1)
{ {
string msg = ""; string msg = "";
...@@ -150,9 +153,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -150,9 +153,9 @@ namespace OnlineStore.DeviceLibrary
if (!msg.Equals("")) if (!msg.Equals(""))
{ {
isOk = false; isOk = false;
WarnMsg = msg; //WarnMsg = msg;
//LogUtil.info(msg); //LogUtil.info(msg);
Alarm(StoreAlarmType.AxisMoveError, GetAlarmCodeByAxis(wait.AxisInfo).ToString(), WarnMsg, StoreMove.MoveType); Alarm(StoreAlarmType.AxisMoveError, GetAlarmCodeByAxis(wait.AxisInfo).ToString(), WarnObj.WarnMsg, StoreMove.MoveType);
return; return;
break; break;
} }
...@@ -172,15 +175,16 @@ namespace OnlineStore.DeviceLibrary ...@@ -172,15 +175,16 @@ namespace OnlineStore.DeviceLibrary
if (!doValue.Equals(wait.IoValue)) if (!doValue.Equals(wait.IoValue))
{ {
LogUtil.error("等待[" + NotOkMsg + "],重写DO(" + ioType + "=" + wait.IoValue + ")"); LogUtil.error("等待[" + NotOkMsg + "],重写DO(" + ioType + "=" + wait.IoValue + ")");
IOManager.IOMove(ioType, wait.IoValue); IOManager.IOMove(ioType, wait.IoValue);
} }
} }
if ((!wait.IsEnd) && span.TotalMilliseconds > timeOutMs) if ((!wait.IsEnd) && span.TotalMilliseconds > timeOutMs)
{ {
ConfigIO io = Config.getWaitIO(wait.IoType); ConfigIO io = Config.getWaitIO(wait.IoType);
WarnMsg = StoreName + ResourceControl.GetString(ResourceControl.WaitSingle, " 等待信号") + io.DisplayStr + "=" + wait.IoValue + ResourceControl.GetString(ResourceControl.TimeOut, "超时!"); // WarnMsg = StoreName + ResourceControl.GetString(ResourceControl.WaitSingle, " 等待信号") + io.DisplayStr + "=" + wait.IoValue + ResourceControl.GetString(ResourceControl.TimeOut, "超时!");
Alarm(StoreAlarmType.IoSingleTimeOut, io.ElectricalDefinition, WarnMsg, StoreMove.MoveType); SetWarnMsg(ResourceControl.WaitSingleTimeOut, io.ElectricalDefinition + "_" + io.ProName, wait.IoValue + "");
LogUtil.error( StoreName + wait.IoType + ResourceControl.GetString(ResourceControl.WaitSingle, " 等待信号") + "(" + io.DisplayStr + "=" + wait.IoValue + ") " + ResourceControl.GetString(ResourceControl.TimeOut, "超时"), 14); Alarm(StoreAlarmType.IoSingleTimeOut, io.ElectricalDefinition, WarnObj.WarnMsg, StoreMove.MoveType);
LogUtil.error(WarnObj.WarnMsg, 14);
isOk = false; isOk = false;
return; return;
break; break;
...@@ -199,10 +203,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -199,10 +203,10 @@ namespace OnlineStore.DeviceLibrary
wait.IsEnd = AutomaticBaiting.IsGetTrayGo; wait.IsEnd = AutomaticBaiting.IsGetTrayGo;
} }
else if (wait.WaitType == (int)Wait_Type.BatchAxisMove_10) else if (wait.WaitType == (int)Wait_Type.BatchAxisMove_10)
{ {
if (!wait.IsEnd) if (!wait.IsEnd)
{ {
wait.IsEnd = AutomaticBaiting.BatchAxisIsEnd(wait,span); wait.IsEnd = AutomaticBaiting.BatchAxisIsEnd(wait, span);
} }
if (!wait.IsEnd) if (!wait.IsEnd)
{ {
...@@ -248,9 +252,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -248,9 +252,12 @@ namespace OnlineStore.DeviceLibrary
} }
else if (span.TotalSeconds > StoreMove.TimeOutSeconds) else if (span.TotalSeconds > StoreMove.TimeOutSeconds)
{ {
WarnMsg = "[" + StoreMove.MoveStep + "]"+ResourceControl.GetString(ResourceControl.TimeOut, "超时" )+"[" + NotOkMsg + "][" + Math.Round(span.TotalSeconds, 1) + "]"; string msg = ResourceControl.GetString(ResourceControl.MoveTimeOut, "[" + StoreMove.MoveStep + "]" +
LogUtil.error(WarnMsg, 15); ResourceControl.GetString(ResourceControl.TimeOut, "超时") + "[" + NotOkMsg + "][" + Math.Round(span.TotalSeconds, 1) + "]");
Alarm(StoreAlarmType.IoSingleTimeOut, "", WarnMsg, StoreMove.MoveType); string newType = ResourceControl.MoveTimeOut + "_" + waitType.ToString().PadLeft(2, '0');
SetWaitWarnMsg(msg, newType, StoreMove.MoveStep + "", Math.Round(span.TotalSeconds, 1) + "");
LogUtil.error(WarnObj.WarnMsg, 15);
Alarm(StoreAlarmType.IoSingleTimeOut, "", WarnObj.WarnMsg, StoreMove.MoveType);
} }
} }
private bool ShuoKeIsEnd(WaitResultInfo wait, out string msg) private bool ShuoKeIsEnd(WaitResultInfo wait, out string msg)
......
...@@ -27,7 +27,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -27,7 +27,7 @@ namespace OnlineStore.DeviceLibrary
public static string LastCode = ""; public static string LastCode = "";
private static string LastPosId = ""; private static string LastPosId = "";
public static int AxisChangeValue = ConfigAppSettings.GetIntValue(Setting_Init.AxisChangeValue); public static int AxisChangeValue = ConfigAppSettings.GetIntValue(Setting_Init.AxisChangeValue);
public static string WarnMsg = ""; // public static string WarnMsg = "";
public static string CodeMsg = ""; public static string CodeMsg = "";
public static string Name = "批量上下料 "; public static string Name = "批量上下料 ";
public static StoreMoveInfo StoreMove = null; public static StoreMoveInfo StoreMove = null;
...@@ -42,7 +42,35 @@ namespace OnlineStore.DeviceLibrary ...@@ -42,7 +42,35 @@ namespace OnlineStore.DeviceLibrary
public static int BatchInStoreCount = 0; public static int BatchInStoreCount = 0;
public static int BatchInStoreHeight = 0; public static int BatchInStoreHeight = 0;
public static WarnInfo WarnObj = new WarnInfo();
public static void SetWarnMsg(string code, params string[] param)
{
if (code.Equals(""))
{
// WarnMsg =msg;
WarnObj.WarnMsg = "";
WarnObj.MsgCode = "";
WarnObj.MsgParam = null;
}
else
{
// WarnMsg = String.Format(msg, param);
WarnObj.WarnMsg = ResourceControl.GetString(code, param);
WarnObj.MsgCode = code;
WarnObj.MsgParam = param;
}
}
public static void SetWarnMsgAndLog(string type, params string[] param)
{
SetWarnMsg(type, param);
LogUtil.error("AutomaticBaiting WarnObj: Type[" + WarnObj.MsgCode + "]Msg[" + WarnObj.WarnMsg + "]");
}
public static void SetWaitWarnMsg(string myType, string type, params string[] param)
{
WarnObj.WarnMsg = myType;
WarnObj.MsgCode = type;
WarnObj.MsgParam = param;
}
/// <summary> /// <summary>
/// 初始化数据 /// 初始化数据
/// </summary> /// </summary>
...@@ -88,8 +116,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -88,8 +116,8 @@ namespace OnlineStore.DeviceLibrary
//需要判断门关闭 //需要判断门关闭
if (!DoorIsClose()) if (!DoorIsClose())
{ {
msg = (ResourceControl.GetString(ResourceControl.CloseError, "锁门失败:请先关闭上料机构")); ; // msg = (ResourceControl.GetString(ResourceControl.CloseError, "锁门失败:请先关闭上料机构")); ;
return msg; return ResourceControl.CloseError;
} }
return msg; return msg;
...@@ -149,7 +177,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -149,7 +177,8 @@ namespace OnlineStore.DeviceLibrary
LogUtil.info(Name + " 复位前,清理报警【" + StoreManager.Store.alarmType + "】"); LogUtil.info(Name + " 复位前,清理报警【" + StoreManager.Store.alarmType + "】");
StoreManager.Store.alarmType = StoreAlarmType.None; StoreManager.Store.alarmType = StoreAlarmType.None;
IOManager.IOMove(IO_Type.Buzzer_Sign, IO_VALUE.LOW); IOManager.IOMove(IO_Type.Buzzer_Sign, IO_VALUE.LOW);
WarnMsg = ""; // WarnMsg = "";
SetWarnMsg("");
} }
AutomaticBaiting.IsNeedStartInout = isNeedInout; AutomaticBaiting.IsNeedStartInout = isNeedInout;
AutomaticBaiting.IsNeedAxisHome = isNeedHome; AutomaticBaiting.IsNeedAxisHome = isNeedHome;
...@@ -243,7 +272,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -243,7 +272,8 @@ namespace OnlineStore.DeviceLibrary
LogUtil.info(Name + "复位完成"); LogUtil.info(Name + "复位完成");
StoreMove.EndMove(); StoreMove.EndMove();
AutoBaitingStatus = StoreRunStatus.Runing; AutoBaitingStatus = StoreRunStatus.Runing;
WarnMsg = ""; // WarnMsg = "";
SetWarnMsg("");
IsNeedStartInout = false; IsNeedStartInout = false;
break; break;
default: break; default: break;
...@@ -347,9 +377,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -347,9 +377,10 @@ namespace OnlineStore.DeviceLibrary
else else
{ {
//TODO 报警 //TODO 报警
WarnMsg = ResourceControl.GetString(ResourceControl.XiLiaoError, "吸盘吸料失败"); //WarnMsg = ResourceControl.GetString(ResourceControl.XiLiaoError, "吸盘吸料失败");
StoreManager.Store.Alarm(StoreAlarmType.BatchAlarm, ResourceControl.GetString(ResourceControl.XiLiaoError, "吸盘吸料失败"), WarnMsg, StoreMoveType.InStore); SetWarnMsg(ResourceControl.XiLiaoError);
LogUtil.error(WarnMsg, 103); StoreManager.Store.Alarm(StoreAlarmType.BatchAlarm, WarnObj.WarnMsg, WarnObj.WarnMsg, StoreMoveType.InStore);
LogUtil.error(WarnObj.WarnMsg, 103);
} }
} }
else if (StoreMove.MoveStep.Equals(StoreMoveStep.AUTO_I06_SuckingDisc_Up)) else if (StoreMove.MoveStep.Equals(StoreMoveStep.AUTO_I06_SuckingDisc_Up))
...@@ -377,8 +408,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -377,8 +408,9 @@ namespace OnlineStore.DeviceLibrary
} }
else else
{ {
WarnMsg = ResourceControl.GetString(ResourceControl.XiLiaoError, "吸盘吸料失败"); // WarnMsg = ResourceControl.GetString(ResourceControl.XiLiaoError, "吸盘吸料失败");
StoreManager.Store.Alarm(StoreAlarmType.BatchAlarm, ResourceControl.GetString(ResourceControl.XiLiaoError, "吸盘吸料失败"), WarnMsg, StoreMoveType.InStore); SetWarnMsg(ResourceControl.XiLiaoError);
StoreManager.Store.Alarm(StoreAlarmType.BatchAlarm, WarnObj.WarnMsg, WarnObj.WarnMsg, StoreMoveType.InStore);
LogUtil.error(Name + "入料: 吸盘上升后未检测到吸盘压力信号,吸取料盘失败", 105); LogUtil.error(Name + "入料: 吸盘上升后未检测到吸盘压力信号,吸取料盘失败", 105);
} }
} }
...@@ -427,15 +459,17 @@ namespace OnlineStore.DeviceLibrary ...@@ -427,15 +459,17 @@ namespace OnlineStore.DeviceLibrary
{ {
StoreManager.Store.LoguStatus(); StoreManager.Store.LoguStatus();
//一分钟还未开始,报警超时 //一分钟还未开始,报警超时
WarnMsg = "[" + StoreMove.MoveStep + "]" + ResourceControl.GetString(ResourceControl.TimeOut, "超时") + "[等待可以入库][" + Math.Round(span.TotalSeconds, 0) + "秒]"; // WarnMsg = "[" + StoreMove.MoveStep + "]" + ResourceControl.GetString(ResourceControl.TimeOut, "超时") + "[等待可以入库][" + Math.Round(span.TotalSeconds, 0) + "秒]";
LogUtil.error(WarnMsg, 105); SetWarnMsg(ResourceControl.WaitInstoreTimeOut, StoreMove.MoveStep + "", Math.Round(span.TotalSeconds, 0) + "");
StoreManager.Store.Alarm(StoreAlarmType.BatchIoTimeOut, "", WarnMsg, StoreMove.MoveType); LogUtil.error(WarnObj.WarnMsg, 105);
StoreManager.Store.Alarm(StoreAlarmType.BatchIoTimeOut, "", WarnObj.WarnMsg, StoreMove.MoveType);
} }
} }
else else
{ {
WarnMsg = ResourceControl.GetString(ResourceControl.XiLiaoError, "吸盘吸料失败"); //WarnMsg = ResourceControl.GetString(ResourceControl.XiLiaoError, "吸盘吸料失败");
StoreManager.Store.Alarm(StoreAlarmType.BatchAlarm, ResourceControl.GetString(ResourceControl.XiLiaoError, "吸盘吸料失败"), WarnMsg, StoreMoveType.InStore); SetWarnMsg(ResourceControl.XiLiaoError);
StoreManager.Store.Alarm(StoreAlarmType.BatchAlarm, ResourceControl.GetString(ResourceControl.XiLiaoError, "吸盘吸料失败"), WarnObj.WarnMsg, StoreMoveType.InStore);
LogUtil.error(Name + "入料: 吸盘上升后未检测到吸盘压力信号,吸取料盘失败", 105); LogUtil.error(Name + "入料: 吸盘上升后未检测到吸盘压力信号,吸取料盘失败", 105);
} }
} }
...@@ -569,9 +603,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -569,9 +603,9 @@ namespace OnlineStore.DeviceLibrary
private static void ClearTimeOut() private static void ClearTimeOut()
{ {
if (WarnMsg.Contains(TimeOut)) if (WarnObj.WarnMsg.Contains(TimeOut))
{ {
WarnMsg = ""; SetWarnMsg( "");
} }
} }
......
...@@ -58,7 +58,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -58,7 +58,10 @@ namespace OnlineStore.DeviceLibrary
} }
else else
{ {
msg = Name + " storeMoveStep=" + StoreMove.MoveStep + moveAxis.DisplayStr + "收到原点完成信号,当前位置[" + outCount + "],误差过大,需要报警";
// msg = Name + " storeMoveStep=" + StoreMove.MoveStep + moveAxis.DisplayStr + "收到原点完成信号,当前位置[" + outCount + "],误差过大,需要报警";
SetWarnMsgAndLog(ResourceControl.AxisHomeMoveAlarm, StoreMove.MoveStep + "", moveAxis.GetNameStr(), outCount + "");
msg = WarnObj.WarnMsg;
LogUtil.error(msg, 100); LogUtil.error(msg, 100);
return false; return false;
} }
...@@ -80,6 +83,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -80,6 +83,7 @@ namespace OnlineStore.DeviceLibrary
//当等待超过一分钟时,需要打印提示 //当等待超过一分钟时,需要打印提示
TimeSpan span = DateTime.Now - StoreMove.LastSetpTime; TimeSpan span = DateTime.Now - StoreMove.LastSetpTime;
string NotOkMsg = ""; string NotOkMsg = "";
int waitType = 0;
bool isOk = !StoreMove.OneWaitCanEndStep; bool isOk = !StoreMove.OneWaitCanEndStep;
foreach (WaitResultInfo wait in list) foreach (WaitResultInfo wait in list)
{ {
...@@ -88,6 +92,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -88,6 +92,7 @@ namespace OnlineStore.DeviceLibrary
continue; continue;
} }
NotOkMsg = wait.ToStr(); NotOkMsg = wait.ToStr();
waitType = wait.WaitType;
if (wait.WaitType == (int)Wait_Type.AxisMove_1) if (wait.WaitType == (int)Wait_Type.AxisMove_1)
{ {
bool isAlarm = false; bool isAlarm = false;
...@@ -190,9 +195,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -190,9 +195,11 @@ namespace OnlineStore.DeviceLibrary
} }
else if (span.TotalSeconds > StoreMove.TimeOutSeconds) else if (span.TotalSeconds > StoreMove.TimeOutSeconds)
{ {
WarnMsg = "[" + StoreMove.MoveStep + "]" + ResourceControl.GetString(ResourceControl.TimeOut, "超时") + " [" + NotOkMsg + "][" + Math.Round(span.TotalSeconds, 0) + "秒]"; string msg = "[" + StoreMove.MoveStep + "]" + ResourceControl.GetString(ResourceControl.TimeOut, "超时") + " [" + NotOkMsg + "][" + Math.Round(span.TotalSeconds, 0) + "秒]";
LogUtil.error(WarnMsg, 102); string newType = ResourceControl.MoveTimeOut + "_" + waitType.ToString().PadLeft(2, '0');
StoreManager.Store.Alarm(StoreAlarmType.BatchIoTimeOut, "", WarnMsg, StoreMove.MoveType); SetWaitWarnMsg(msg, newType,StoreMove.MoveStep+"", Math.Round(span.TotalSeconds, 0) + "");
LogUtil.error(msg, 102);
StoreManager.Store.Alarm(StoreAlarmType.BatchIoTimeOut, "", msg, StoreMove.MoveType);
} }
} }
...@@ -226,7 +233,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -226,7 +233,10 @@ namespace OnlineStore.DeviceLibrary
} }
else else
{ {
msg = Name + moveAxis.DisplayStr + "目标[" + targetPosition + "]当前[" + outCount + "],误差过大,需要报警"; // msg = Name + moveAxis.DisplayStr + "目标[" + targetPosition + "]当前[" + outCount + "],误差过大,需要报警";
SetWarnMsgAndLog(ResourceControl.AxisMoveAlarm, StoreMove.MoveStep + "", moveAxis.GetNameStr(), targetPosition + "", outCount + "");
msg = WarnObj.WarnMsg;
LogUtil.error(msg); LogUtil.error(msg);
} }
} }
...@@ -248,8 +258,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -248,8 +258,8 @@ namespace OnlineStore.DeviceLibrary
if (!msg.Equals("")) if (!msg.Equals(""))
{ {
isAlarm = true; isAlarm = true;
WarnMsg = msg; // WarnMsg = msg;
StoreManager.Store.Alarm(StoreAlarmType.BatchAxisAlarm, StoreManager.Store.GetAlarmCodeByAxis(wait.AxisInfo).ToString(), WarnMsg, StoreMove.MoveType); StoreManager.Store.Alarm(StoreAlarmType.BatchAxisAlarm, StoreManager.Store.GetAlarmCodeByAxis(wait.AxisInfo).ToString(), WarnObj.WarnMsg, StoreMove.MoveType);
} }
return wait.IsEnd; return wait.IsEnd;
...@@ -353,7 +363,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -353,7 +363,7 @@ namespace OnlineStore.DeviceLibrary
} }
if (LastCode.Equals("")) if (LastCode.Equals(""))
{ {
StoreManager.Store.CodeOrInoutMsg = "未扫到二维码,需要将料盘送出"; StoreManager.Store.CodeOrInoutMsg =ResourceControl.GetString(ResourceControl.InStoreNoCode, "未扫到二维码,需要将料盘送出");
LogUtil.error("未扫到二维码,需要将料盘送出"); LogUtil.error("未扫到二维码,需要将料盘送出");
} }
else else
...@@ -461,7 +471,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -461,7 +471,7 @@ namespace OnlineStore.DeviceLibrary
message = ScanCodeManager.ReplaceCode(message); message = ScanCodeManager.ReplaceCode(message);
if (message.Equals("") || string.IsNullOrEmpty(message)) if (message.Equals("") || string.IsNullOrEmpty(message))
{ {
CodeMsg = "没有收到二维码信息,请重新放入料盘"; CodeMsg =ResourceControl.GetString(ResourceControl.NoCodeMsg, "没有收到二维码信息,请重新放入料盘");
LogUtil.info(LogName + "没有收到二维码信息,请重新放入料盘"); LogUtil.info(LogName + "没有收到二维码信息,请重新放入料盘");
return null; return null;
} }
...@@ -523,8 +533,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -523,8 +533,9 @@ namespace OnlineStore.DeviceLibrary
string[] posArray = posId.Split('#'); string[] posArray = posId.Split('#');
if (!(posArray.Length == 2)) if (!(posArray.Length == 2))
{ {
WarnMsg = Name + ResourceControl.GetString(ResourceControl.InStoreError, "入库库位格式错误:") + "【" + message + "】【" + posId + "】"; // WarnMsg = Name + ResourceControl.GetString(ResourceControl.InStoreError, "入库库位格式错误:") + "【" + message + "】【" + posId + "】";
LogUtil.error("服务器反馈 入库库位格式错误:二维码【" + message + "】库位【" + posId + "】"); SetWarnMsgAndLog(ResourceControl.InStoreError, message, posId);
// LogUtil.error("服务器反馈 入库库位格式错误:二维码【" + message + "】库位【" + posId + "】");
return null; return null;
} }
...@@ -533,8 +544,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -533,8 +544,9 @@ namespace OnlineStore.DeviceLibrary
AutoStorePosition position = CSVPositionReader<AutoStorePosition>.GetPositon(posId); AutoStorePosition position = CSVPositionReader<AutoStorePosition>.GetPositon(posId);
if (position == null) if (position == null)
{ //出入库没有找到服务器发送的库位,需要打印日志方便查询原因 { //出入库没有找到服务器发送的库位,需要打印日志方便查询原因
WarnMsg = ResourceControl.GetString(ResourceControl.InStoreNoPosition, "入库未找到库位:") + "【" + message + "】【" + posId + "】 "; // WarnMsg = ResourceControl.GetString(ResourceControl.InStoreNoPosition, "入库未找到库位:") + "【" + message + "】【" + posId + "】 ";
LogUtil.error("服务器反馈 入库未找到库位:二维码【" + message + "】库位【" + posId + "】"); SetWarnMsgAndLog(ResourceControl.InStoreNoPosition, message, posId);
// LogUtil.error("服务器反馈 入库未找到库位:二维码【" + message + "】库位【" + posId + "】");
return null; return null;
} }
......
...@@ -8,7 +8,7 @@ using System.Drawing; ...@@ -8,7 +8,7 @@ using System.Drawing;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading; using System.Threading;
namespace OnlineStore.DeviceLibrary namespace OnlineStore.DeviceLibrary
{ {
...@@ -20,7 +20,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -20,7 +20,7 @@ namespace OnlineStore.DeviceLibrary
protected static readonly ILog LOGGER = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); protected static readonly ILog LOGGER = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
public Stopwatch runTimeWatch = new Stopwatch(); public Stopwatch runTimeWatch = new Stopwatch();
/// <summary> /// <summary>
/// 最后一次气压检测变为0的时间 /// 最后一次气压检测变为0的时间
/// </summary> /// </summary>
...@@ -33,7 +33,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -33,7 +33,7 @@ namespace OnlineStore.DeviceLibrary
/// 是否没有检测到气压 /// 是否没有检测到气压
/// </summary> /// </summary>
public bool isNoAirCheck = false; public bool isNoAirCheck = false;
/// <summary> /// <summary>
/// 是否再报警中 /// 是否再报警中
/// </summary> /// </summary>
...@@ -45,7 +45,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -45,7 +45,7 @@ namespace OnlineStore.DeviceLibrary
/// 料仓单个调试状态(默认不是调试状态) /// 料仓单个调试状态(默认不是调试状态)
/// </summary> /// </summary>
public bool IsDebug = false; public bool IsDebug = false;
/// <summary> /// <summary>
///1=设备联机(正常就绪)(入库后,BOX恢复原始状态)(出库后,移载装置恢复原始状态), ///1=设备联机(正常就绪)(入库后,BOX恢复原始状态)(出库后,移载装置恢复原始状态),
///2=急停,3=故障,4=警告,5=调试 ///2=急停,3=故障,4=警告,5=调试
...@@ -65,11 +65,42 @@ namespace OnlineStore.DeviceLibrary ...@@ -65,11 +65,42 @@ namespace OnlineStore.DeviceLibrary
/// <summary> /// <summary>
/// 提示消息,一般发给服务器后清空(LineBean表示报警提示消息,BoxBean表示出入库失败的原因记录) /// 提示消息,一般发给服务器后清空(LineBean表示报警提示消息,BoxBean表示出入库失败的原因记录)
/// </summary> /// </summary>
public string WarnMsg = ""; // public string MyWarnMsg = "";
public WarnInfo WarnObj = new WarnInfo();
public void SetWarnMsg(string code , params string[] param)
{
if (code.Equals(""))
{
// WarnMsg =msg;
WarnObj.WarnMsg = "";
WarnObj.MsgCode = "";
WarnObj.MsgParam = param;
}
else
{
// WarnMsg = String.Format(msg, param);
WarnObj.WarnMsg = ResourceControl.GetString(code, param);
WarnObj.MsgCode = code;
WarnObj.MsgParam = param;
}
}
public void SetWarnMsgAndLog(string code, params string[] param)
{
SetWarnMsg(code, param);
LogUtil.error("WarnObj: Type[" + WarnObj.MsgCode + "]Msg[" + WarnObj.WarnMsg + "]");
}
public void SetWaitWarnMsg(string myType, string type, params string[] param)
{
WarnObj.WarnMsg = myType;
WarnObj.MsgCode = type;
WarnObj.MsgParam = param;
}
public string StoreName { get; set; } public string StoreName { get; set; }
public int StoreID { get; set; } public int StoreID { get; set; }
protected System.Timers.Timer mainTimer; protected System.Timers.Timer mainTimer;
protected System.Timers.Timer serverConnectTimer = new System.Timers.Timer(); protected System.Timers.Timer serverConnectTimer = new System.Timers.Timer();
protected System.Timers.Timer IoCheckTimer = new System.Timers.Timer(); protected System.Timers.Timer IoCheckTimer = new System.Timers.Timer();
...@@ -83,7 +114,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -83,7 +114,7 @@ namespace OnlineStore.DeviceLibrary
/// </summary> /// </summary>
protected virtual void Init() protected virtual void Init()
{ {
StoreMove = new StoreMoveInfo(StoreName); StoreMove = new StoreMoveInfo(StoreName);
mainTimer = new System.Timers.Timer(); mainTimer = new System.Timers.Timer();
mainTimer.Enabled = false; mainTimer.Enabled = false;
mainTimer.Interval = 300; mainTimer.Interval = 300;
...@@ -104,7 +135,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -104,7 +135,7 @@ namespace OnlineStore.DeviceLibrary
ledCheckTimer.AutoReset = true; ledCheckTimer.AutoReset = true;
ledCheckTimer.Enabled = false; ledCheckTimer.Enabled = false;
//IoCheckTimer.Elapsed += IoCheckTimer_Elapsed; //IoCheckTimer.Elapsed += IoCheckTimer_Elapsed;
} }
/// <summary> /// <summary>
...@@ -179,10 +210,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -179,10 +210,10 @@ namespace OnlineStore.DeviceLibrary
aa = ResourceControl.GetString(ResourceControl.OutMoveExecute, "出库完成"); aa = ResourceControl.GetString(ResourceControl.OutMoveExecute, "出库完成");
break; break;
case StoreStatus.InStoreFaild: case StoreStatus.InStoreFaild:
aa = ResourceControl.GetString(ResourceControl.InStoreFailed, "入库失败") + "(" + WarnMsg + ")"; aa = ResourceControl.GetString(ResourceControl.InStoreFailed, "入库失败") + "(" + WarnObj.WarnMsg + ")";
break; break;
case StoreStatus.OutStoreFaild: case StoreStatus.OutStoreFaild:
aa = ResourceControl.GetString(ResourceControl.OutStoreFailed, "出库失败") + "(" + WarnMsg + ")"; aa = ResourceControl.GetString(ResourceControl.OutStoreFailed, "出库失败") + "(" + WarnObj.WarnMsg + ")";
break; break;
} }
if (!aa.Equals("")) if (!aa.Equals(""))
...@@ -206,7 +237,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -206,7 +237,7 @@ namespace OnlineStore.DeviceLibrary
public object lastDiListLock = ""; public object lastDiListLock = "";
public void addLastDI(string type, IO_VALUE value) public void addLastDI(string type, IO_VALUE value)
{ {
try try
{ {
lock (lastDiListLock) lock (lastDiListLock)
...@@ -223,14 +254,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -223,14 +254,14 @@ namespace OnlineStore.DeviceLibrary
LOGGER.Error(ex.ToString()); LOGGER.Error(ex.ToString());
} }
} }
/// <summary> /// <summary>
/// 运动处理 /// 运动处理
/// </summary> /// </summary>
protected bool isInPro = false; protected bool isInPro = false;
protected virtual void BusyMoveProcess() protected virtual void BusyMoveProcess()
{ {
isInPro = true; isInPro = true;
try try
{ {
...@@ -254,12 +285,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -254,12 +285,12 @@ namespace OnlineStore.DeviceLibrary
break; break;
default: break; default: break;
} }
}catch(Exception ex) } catch (Exception ex)
{ {
LogUtil.error("BusyMoveProcess出错:"+ex.ToString()); LogUtil.error("BusyMoveProcess出错:" + ex.ToString());
} }
isInPro = false; isInPro = false;
} }
protected void SaveAlarmInfo(StoreAlarmType alarmType, string alarmDetial, string alarmMsg, StoreMoveType storeMoveType) protected void SaveAlarmInfo(StoreAlarmType alarmType, string alarmDetial, string alarmMsg, StoreMoveType storeMoveType)
{ {
alarmMsg = alarmMsg.Replace(StoreName, ""); alarmMsg = alarmMsg.Replace(StoreName, "");
...@@ -295,7 +326,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -295,7 +326,7 @@ namespace OnlineStore.DeviceLibrary
//case StoreAlarmType.StellAlarm: //case StoreAlarmType.StellAlarm:
// aType = 2; // aType = 2;
// alarmDetial = "5"; // alarmDetial = "5";
//break; //break;
default: break; default: break;
} }
alarmInfo = new AlarmInfo(StoreID, aType, alarmDetial, alarmMsg, inoutStatus); alarmInfo = new AlarmInfo(StoreID, aType, alarmDetial, alarmMsg, inoutStatus);
...@@ -304,7 +335,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -304,7 +335,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary> /// <summary>
/// 开始运行 /// 开始运行
/// </summary> /// </summary>
public abstract bool StartRun(); public abstract bool StartRun();
/// <summary> /// <summary>
/// 停止运行 /// 停止运行
/// </summary> /// </summary>
...@@ -318,12 +349,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -318,12 +349,12 @@ namespace OnlineStore.DeviceLibrary
/// 重置(夹料装置状态不变) /// 重置(夹料装置状态不变)
/// </summary> /// </summary>
public abstract void Reset(); public abstract void Reset();
/// <summary> /// <summary>
/// 停止所有运动 /// 停止所有运动
/// </summary> /// </summary>
public abstract void StopMove( bool IsCloseAxis); public abstract void StopMove(bool IsCloseAxis);
/// <summary> /// <summary>
/// 重置处理 /// 重置处理
/// </summary> /// </summary>
...@@ -340,8 +371,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -340,8 +371,8 @@ namespace OnlineStore.DeviceLibrary
{ {
moveAxis.TargetPosition = 0; moveAxis.TargetPosition = 0;
LogUtil.debug(LOGGER, moveAxis.DisplayStr + "speed[" + moveAxis.TargetSpeed + "]开始原点返回"); LogUtil.debug(LOGGER, moveAxis.DisplayStr + "speed[" + moveAxis.TargetSpeed + "]开始原点返回");
StoreMove.WaitList.Add(WaitResultInfo.WaitAxis(moveAxis, true)); StoreMove.WaitList.Add(WaitResultInfo.WaitAxis(moveAxis, true));
ACServerManager.HomeMove(moveAxis.DeviceName, (short)moveAxis.GetAxisValue(), moveAxis.HomeHighSpeed); ACServerManager.HomeMove(moveAxis.DeviceName, (short)moveAxis.GetAxisValue(), moveAxis.HomeHighSpeed);
} }
/// <summary> /// <summary>
...@@ -362,20 +393,20 @@ namespace OnlineStore.DeviceLibrary ...@@ -362,20 +393,20 @@ namespace OnlineStore.DeviceLibrary
msg = ""; msg = "";
string deviceName = moveAxis.DeviceName; string deviceName = moveAxis.DeviceName;
int axisNo = moveAxis.GetAxisValue(); int axisNo = moveAxis.GetAxisValue();
bool isOk = ACServerManager.GetBusyStatus(deviceName, axisNo).Equals(0); bool isOk = ACServerManager.GetBusyStatus(deviceName, axisNo).Equals(0);
int outCount = ACServerManager.GetActualtPosition(deviceName, axisNo); int outCount = ACServerManager.GetActualtPosition(deviceName, axisNo);
int errorCount = Math.Abs(outCount - targetPosition); int errorCount = Math.Abs(outCount - targetPosition);
if (isOk) if (isOk)
{ {
if (errorCount > moveAxis.CanErrorCountMax) if (errorCount > moveAxis.CanErrorCountMax)
{ {
//判断是否需要重新运动 //判断是否需要重新运动
if (StoreMove.CanWhileCount > 0) if (StoreMove.CanWhileCount > 0)
{ {
LogUtil.error(LOGGER, moveAxis.DisplayStr + "目标位置[" + targetPosition + "]当前位置[" + outCount + LogUtil.error(LOGGER, moveAxis.DisplayStr + "目标位置[" + targetPosition + "]当前位置[" + outCount +
"],误差过大,重新开始运动,剩余[" + StoreMove.CanWhileCount + "]次"); "],误差过大,重新开始运动,剩余[" + StoreMove.CanWhileCount + "]次");
ACServerManager.SuddenStop(moveAxis.DeviceName,moveAxis.GetAxisValue()); ACServerManager.SuddenStop(moveAxis.DeviceName, moveAxis.GetAxisValue());
Thread.Sleep(2000); Thread.Sleep(2000);
ACServerManager.AbsMove(moveAxis.DeviceName, moveAxis.GetAxisValue(), targetPosition, targetSpeed); ACServerManager.AbsMove(moveAxis.DeviceName, moveAxis.GetAxisValue(), targetPosition, targetSpeed);
StoreMove.CanWhileCount--; StoreMove.CanWhileCount--;
...@@ -383,9 +414,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -383,9 +414,10 @@ namespace OnlineStore.DeviceLibrary
} }
else else
{ {
msg = StoreName + " storeMoveStep=" + StoreMove.MoveStep + moveAxis.DisplayStr + "目标位置[" + targetPosition + "]当前位置[" + outCount // msg = StoreName + " storeMoveStep=" + StoreMove.MoveStep + moveAxis.DisplayStr + "目标位置[" + targetPosition + "]当前位置[" + outCount+ "],误差过大,需要报警";
+ "],误差过大,需要报警"; SetWarnMsgAndLog(ResourceControl.AxisMoveAlarm, StoreMove.MoveStep + "", moveAxis.GetNameStr(), targetPosition + "", outCount + "");
LogUtil.error(LOGGER, msg); msg = WarnObj.WarnMsg;
// LogUtil.error(LOGGER, msg);
return false; return false;
} }
...@@ -424,13 +456,31 @@ namespace OnlineStore.DeviceLibrary ...@@ -424,13 +456,31 @@ namespace OnlineStore.DeviceLibrary
} }
else else
{ {
msg = StoreName + " storeMoveStep=" + StoreMove.MoveStep + moveAxis.DisplayStr + "收到原点完成信号,当前位置[" + outCount + "],误差过大,需要报警"; // msg = StoreName + " storeMoveStep=" + StoreMove.MoveStep + moveAxis.DisplayStr + "收到原点完成信号,当前位置[" + outCount + "],误差过大,需要报警";
LogUtil.error(LOGGER, msg); SetWarnMsgAndLog(ResourceControl.AxisHomeMoveAlarm, StoreMove.MoveStep + "", moveAxis.GetNameStr(), outCount + "");
} msg = WarnObj.WarnMsg;
// LogUtil.error(LOGGER, msg);
}
} }
return false; return false;
} }
}
public class WarnInfo
{
public WarnInfo()
{
MsgCode = "";
WarnMsg = "";
MsgParam = null;
}
public string MsgCode { set; get; }
public string WarnMsg { set; get; }
public string[] MsgParam { set; get; }
} }
} }
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!