Commit eebd5458 LN

异常打印修改

1 个父辈 c9531543
正在显示 32 个修改的文件 包含 118 行增加97 行删除
...@@ -36,7 +36,7 @@ namespace OnlineStore.AssemblyLine ...@@ -36,7 +36,7 @@ namespace OnlineStore.AssemblyLine
catch (Exception ex) catch (Exception ex)
{ {
str = version; str = version;
LogUtil.error("解析版本号【" + str + "】出错:" + ex.ToString()); LogUtil.error("解析版本号【" + str + "】出错:" ,ex);
} }
if (IsShow) if (IsShow)
{ {
......
...@@ -132,7 +132,7 @@ namespace OnlineStore.AssemblyLine ...@@ -132,7 +132,7 @@ namespace OnlineStore.AssemblyLine
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error(equipBean.Name + "界面定时器出错:" + ex.ToString()); LogUtil.error(equipBean.Name + "界面定时器出错:" ,ex);
} }
} }
...@@ -150,7 +150,7 @@ namespace OnlineStore.AssemblyLine ...@@ -150,7 +150,7 @@ namespace OnlineStore.AssemblyLine
catch (Exception ex) catch (Exception ex)
{ {
MessageBox.Show(ex.StackTrace, "Exception(异常)", MessageBoxButtons.OK, MessageBoxIcon.Error); MessageBox.Show(ex.StackTrace, "Exception(异常)", MessageBoxButtons.OK, MessageBoxIcon.Error);
LogUtil.error(LOGGER, ex.StackTrace); LogUtil.error("",ex);
} }
} }
private void btnOpenDo_Click(object sender, EventArgs e) private void btnOpenDo_Click(object sender, EventArgs e)
......
...@@ -118,7 +118,7 @@ namespace OnlineStore.AssemblyLine ...@@ -118,7 +118,7 @@ namespace OnlineStore.AssemblyLine
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error("出错:" + ex.StackTrace); LogUtil.error("出错:" ,ex);
} }
} }
protected void Reset() protected void Reset()
......
...@@ -148,7 +148,7 @@ namespace OnlineStore.AssemblyLine ...@@ -148,7 +148,7 @@ namespace OnlineStore.AssemblyLine
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error(equipBean.Name + "界面定时器出错:" + ex.ToString()); LogUtil.error(equipBean.Name + "界面定时器出错:" ,ex);
} }
} }
...@@ -166,7 +166,7 @@ namespace OnlineStore.AssemblyLine ...@@ -166,7 +166,7 @@ namespace OnlineStore.AssemblyLine
catch (Exception ex) catch (Exception ex)
{ {
MessageBox.Show(ex.StackTrace, "Exception(异常)", MessageBoxButtons.OK, MessageBoxIcon.Error); MessageBox.Show(ex.StackTrace, "Exception(异常)", MessageBoxButtons.OK, MessageBoxIcon.Error);
LogUtil.error(LOGGER, ex.StackTrace); LogUtil.error("",ex);
} }
} }
private void btnOpenDo_Click(object sender, EventArgs e) private void btnOpenDo_Click(object sender, EventArgs e)
......
...@@ -116,7 +116,7 @@ namespace OnlineStore.AssemblyLine ...@@ -116,7 +116,7 @@ namespace OnlineStore.AssemblyLine
catch (Exception ex) catch (Exception ex)
{ {
MessageBox.Show(ex.StackTrace, "Exception(异常)", MessageBoxButtons.OK, MessageBoxIcon.Error); MessageBox.Show(ex.StackTrace, "Exception(异常)", MessageBoxButtons.OK, MessageBoxIcon.Error);
LogUtil.error(LOGGER, ex.StackTrace); LogUtil.error("",ex);
} }
} }
......
...@@ -282,7 +282,7 @@ namespace OnlineStore.AssemblyLine ...@@ -282,7 +282,7 @@ namespace OnlineStore.AssemblyLine
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error("退出出错:" + ex.ToString()); LogUtil.error("退出出错:" ,ex);
} }
//this.Close(); //this.Close();
} }
...@@ -307,7 +307,7 @@ namespace OnlineStore.AssemblyLine ...@@ -307,7 +307,7 @@ namespace OnlineStore.AssemblyLine
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error("显示界面出错:" + ex.ToString()); LogUtil.error("显示界面出错:" ,ex);
} }
} }
......
...@@ -160,7 +160,7 @@ namespace OnlineStore.AssemblyLine ...@@ -160,7 +160,7 @@ namespace OnlineStore.AssemblyLine
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error(equipBean.Name + "界面定时器出错:" + ex.ToString()); LogUtil.error(equipBean.Name + "界面定时器出错:" ,ex);
} }
} }
...@@ -178,7 +178,7 @@ namespace OnlineStore.AssemblyLine ...@@ -178,7 +178,7 @@ namespace OnlineStore.AssemblyLine
catch (Exception ex) catch (Exception ex)
{ {
MessageBox.Show(ex.StackTrace, "Exception(异常)", MessageBoxButtons.OK, MessageBoxIcon.Error); MessageBox.Show(ex.StackTrace, "Exception(异常)", MessageBoxButtons.OK, MessageBoxIcon.Error);
LogUtil.error(LOGGER, ex.StackTrace); LogUtil.error("",ex);
} }
} }
private void btnOpenDo_Click(object sender, EventArgs e) private void btnOpenDo_Click(object sender, EventArgs e)
......
...@@ -164,7 +164,7 @@ namespace OnlineStore.AssemblyLine ...@@ -164,7 +164,7 @@ namespace OnlineStore.AssemblyLine
catch (Exception ex) catch (Exception ex)
{ {
MessageBox.Show(ex.StackTrace, "Exception(异常)", MessageBoxButtons.OK, MessageBoxIcon.Error); MessageBox.Show(ex.StackTrace, "Exception(异常)", MessageBoxButtons.OK, MessageBoxIcon.Error);
LogUtil.error(LOGGER, ex.StackTrace); LogUtil.error("",ex);
} }
} }
private void btnOpenDo_Click(object sender, EventArgs e) private void btnOpenDo_Click(object sender, EventArgs e)
......
...@@ -145,7 +145,7 @@ namespace OnlineStore.Common ...@@ -145,7 +145,7 @@ namespace OnlineStore.Common
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error(LOGGER, "SaveValue保存配置出错:AppKey=" + key + ",AppValue=" + value + "," + ex.StackTrace); LogUtil.error(LOGGER, "SaveValue保存配置出错:AppKey=" + key + ",AppValue=" + value + ",",ex);
} }
} }
...@@ -172,7 +172,7 @@ namespace OnlineStore.Common ...@@ -172,7 +172,7 @@ namespace OnlineStore.Common
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error(LOGGER, "UpdateConfig保存配置出错:name=" + name + ",Xvalue=" + Xvalue + "," + ex.StackTrace); LogUtil.error(LOGGER, "UpdateConfig保存配置出错:name=" + name + ",Xvalue=" + Xvalue + ",",ex);
} }
} }
...@@ -206,7 +206,7 @@ namespace OnlineStore.Common ...@@ -206,7 +206,7 @@ namespace OnlineStore.Common
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error(LOGGER, "SetValue保存配置出错:AppKey=" + AppKey + ",AppValue=" + AppValue + "," + ex.StackTrace); LogUtil.error(LOGGER, "SetValue保存配置出错:AppKey=" + AppKey + ",AppValue=" + AppValue + ",",ex);
} }
} }
} }
......
...@@ -79,13 +79,20 @@ namespace OnlineStore.Common ...@@ -79,13 +79,20 @@ namespace OnlineStore.Common
error(LOGGER, errorMsg); error(LOGGER, errorMsg);
} }
} }
public static void error(ILog log, string errorMsg) public static void error(ILog log, string errorMsg, Exception ex = null)
{ {
if (errorMsg.Trim().Equals("")) if (errorMsg.Trim().Equals(""))
{ {
return; return;
} }
if (ex == null)
{
log.Error(errorMsg); log.Error(errorMsg);
}
else
{
log.Error(errorMsg, ex);
}
AddToBox(errorMsg, Color.Red); AddToBox(errorMsg, Color.Red);
} }
private static void AddToBox(string msg, Color color) private static void AddToBox(string msg, Color color)
...@@ -96,7 +103,7 @@ namespace OnlineStore.Common ...@@ -96,7 +103,7 @@ namespace OnlineStore.Common
} }
catch (Exception ex) catch (Exception ex)
{ {
LOGGER.Error("出错:" + ex.StackTrace); LOGGER.Error("出错:",ex);
} }
} }
private static List<string> logList = new List<string>(); private static List<string> logList = new List<string>();
...@@ -171,9 +178,9 @@ namespace OnlineStore.Common ...@@ -171,9 +178,9 @@ namespace OnlineStore.Common
{ {
debug(LOGGER, msg); debug(LOGGER, msg);
} }
public static void error(string errorMsg) public static void error(string errorMsg,Exception ex=null)
{ {
error(LOGGER, errorMsg); error(LOGGER, errorMsg,ex);
} }
public static void info(string msg) public static void info(string msg)
{ {
......
...@@ -38,7 +38,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -38,7 +38,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error("初始化agvClient " + ServerIp + " 出错:" + ex.ToString()); LogUtil.error("初始化agvClient " + ServerIp + " 出错:",ex);
} }
} }
internal static bool ISConnected() internal static bool ISConnected()
...@@ -156,7 +156,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -156,7 +156,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error("释放 agvClient "+ ServerIp + " 出错:" + ex.ToString()); LogUtil.error("释放 agvClient "+ ServerIp + " 出错:",ex);
} }
} }
} }
......
...@@ -66,7 +66,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -66,7 +66,6 @@ namespace OnlineStore.DeviceLibrary
SecondMoveInfo.EndMove(); SecondMoveInfo.EndMove();
lineStatus = LineStatus.StoreOnline; lineStatus = LineStatus.StoreOnline;
runStatus = LineRunStatus.HomeMoving; runStatus = LineRunStatus.HomeMoving;
LogInfo("开始原点返回: (重置灯状态,关闭所有皮带线,定位气缸下降 )开始");
MoveInfo.NewMove(LineMoveType.ReturnHome); MoveInfo.NewMove(LineMoveType.ReturnHome);
StartReset(); StartReset();
if ( isDebug) if ( isDebug)
...@@ -82,7 +81,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -82,7 +81,6 @@ namespace OnlineStore.DeviceLibrary
public override bool Reset() public override bool Reset()
{ {
StopMove(); StopMove();
LogInfo("开始重置: (重置灯状态,关闭所有皮带线,定位气缸下降 开始;");
runStatus = LineRunStatus.Reset; runStatus = LineRunStatus.Reset;
MoveInfo.NewMove(LineMoveType.Reset); MoveInfo.NewMove(LineMoveType.Reset);
StartReset(); StartReset();
...@@ -90,6 +88,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -90,6 +88,8 @@ namespace OnlineStore.DeviceLibrary
} }
private void StartReset() private void StartReset()
{ {
LogInfo("StartReset: 重置灯状态,关闭所有皮带线,定位气缸下降 开始;");
//复位时默认为有托盘 //复位时默认为有托盘
TrayLine1.LastTrayPosition = 1; TrayLine1.LastTrayPosition = 1;
TrayLine2.LastTrayPosition = 1; TrayLine2.LastTrayPosition = 1;
...@@ -108,17 +108,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -108,17 +108,14 @@ namespace OnlineStore.DeviceLibrary
CheckAndMove(IO_Type.SeparateDevice_Run, IO_VALUE.LOW); CheckAndMove(IO_Type.SeparateDevice_Run, IO_VALUE.LOW);
if (DeviceID.Equals(302)) if (DeviceID.Equals(302))
{ {
LogInfo("后退NG气缸");
CylinderMove(MoveInfo, IO_Type.NGCylinder_Before, IO_Type.NGCylinder_After); CylinderMove(MoveInfo, IO_Type.NGCylinder_Before, IO_Type.NGCylinder_After);
} }
if (IsDebug) if (IsDebug)
{ {
mainTimer.Start(); mainTimer.Start();
} }
//三个流水线都转动到定位亮
//TrayLine1.LineStartTurn();
//TrayLine2.LineStartTurn();
//Line3Turn.StartLineRun(IO_Type.DLine_Run3, IO_Type.Location_Check3, Line3EndProcess);
isInPro = false; isInPro = false;
} }
...@@ -255,10 +252,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -255,10 +252,13 @@ namespace OnlineStore.DeviceLibrary
StartOutStoreMove(new InOutParam()); StartOutStoreMove(new InOutParam());
} }
} }
if (runStatus >= (LineRunStatus.HomeMoving) && NoAlarm()) if ((runStatus .Equals(LineRunStatus.Runing)||runStatus.Equals(LineRunStatus.Busy))&& NoAlarm())
{ {
TrayLine1.TimerPro(); TrayLine1.TimerPro();
if (NgISBack())
{
TrayLine2.TimerPro(); TrayLine2.TimerPro();
}
Line3TimerPro(); Line3TimerPro();
} }
IOTimeOutProcess(); IOTimeOutProcess();
...@@ -273,6 +273,21 @@ namespace OnlineStore.DeviceLibrary ...@@ -273,6 +273,21 @@ namespace OnlineStore.DeviceLibrary
IOMove(IO_Type.DLine_RunAlarm, IO_VALUE.HIGH); IOMove(IO_Type.DLine_RunAlarm, IO_VALUE.HIGH);
} }
} }
internal bool NgISBack()
{
if (DeviceID.Equals(302))
{
if (IOValue(IO_Type.NGCylinder_After).Equals(IO_VALUE.HIGH) && IOValue(IO_Type.NGCylinder_Before).Equals(IO_VALUE.LOW))
{
return true;
}
}
else
{
return true;
}
return false ;
}
internal bool Line3TurnIsStop() internal bool Line3TurnIsStop()
{ {
if (Line3Turn.InTurn.Equals(false)) if (Line3Turn.InTurn.Equals(false))
......
...@@ -97,7 +97,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -97,7 +97,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error("FI_13_ScanCode扫码出错:" + ex.ToString()); LogUtil.error("FI_13_ScanCode扫码出错:",ex);
} }
} }
else else
......
...@@ -145,7 +145,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -145,7 +145,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error(Name + "TimerProcess出错:" + ex.ToString()); LogUtil.error(Name + "TimerProcess出错:",ex);
} }
isInPro = false; isInPro = false;
...@@ -175,7 +175,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -175,7 +175,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error("IOTimeOutProcess出错:" + ex.ToString()); LogUtil.error("IOTimeOutProcess出错:",ex);
} }
} }
protected bool CanStartRun() protected bool CanStartRun()
...@@ -504,7 +504,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -504,7 +504,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error(moveInfo.Name + " [" + moveInfo.MoveStep + "] CheckWait 出错:" + ex.StackTrace + ex.Message + ex.ToString()); LogUtil.error(moveInfo.Name + " [" + moveInfo.MoveStep + "] CheckWait 出错:" ,ex );
} }
} }
......
...@@ -560,7 +560,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -560,7 +560,7 @@ namespace OnlineStore.DeviceLibrary
} }
}catch(Exception ex) }catch(Exception ex)
{ {
LogUtil.error("CheckTimer_Elapsed出错:" + ex.ToString()); LogUtil.error("CheckTimer_Elapsed出错:",ex);
} }
finally finally
{ {
...@@ -690,7 +690,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -690,7 +690,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error("出库料架送入AGV出错:" + ex); LogUtil.error("出库料架送入AGV出错:" ,ex);
} }
finally finally
{ {
...@@ -720,7 +720,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -720,7 +720,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error(Name + "UpdateShelfId出错:" + ex.ToString()); LogUtil.error(Name + "UpdateShelfId出错:",ex);
} }
return true; return true;
} }
...@@ -775,7 +775,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -775,7 +775,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error("AGV料架进入缓冲工位 出错:" + ex); LogUtil.error("AGV料架进入缓冲工位 出错:" ,ex);
} }
finally finally
{ {
......
...@@ -603,7 +603,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -603,7 +603,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error("FI_13_ScanCode扫码出错:" + ex.ToString()); LogUtil.error("FI_13_ScanCode扫码出错:",ex);
} }
} }
} }
...@@ -1047,7 +1047,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -1047,7 +1047,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error(Name + "CurrTrayIsNeed出错:" + ex.StackTrace); LogUtil.error(Name + "CurrTrayIsNeed出错:" ,ex);
} }
return false; return false;
......
...@@ -164,7 +164,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -164,7 +164,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error(Name + "加载调试设备出错:" + ex.ToString()); LogUtil.error(Name + "加载调试设备出错:",ex);
} }
} }
...@@ -651,7 +651,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -651,7 +651,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error(Name + "灯处理定时器出错:"+ ex.ToString()); LogUtil.error(Name + "灯处理定时器出错:",ex);
} }
Thread.Sleep(5); Thread.Sleep(5);
} }
...@@ -705,7 +705,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -705,7 +705,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error(Name + "定时检测报警出错:" + ex.ToString()); LogUtil.error(Name + "定时检测报警出错:",ex);
} }
Thread.Sleep(1); Thread.Sleep(1);
} }
...@@ -782,7 +782,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -782,7 +782,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error(Name + "主定时器出错:" + ex.ToString()); LogUtil.error(Name + "主定时器出错:",ex);
} }
Thread.Sleep(1); Thread.Sleep(1);
} }
...@@ -820,8 +820,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -820,8 +820,6 @@ namespace OnlineStore.DeviceLibrary
#region 扫码枪代码 #region 扫码枪代码
/// <summary> /// <summary>
///是否已经接收到过出库信息 ///是否已经接收到过出库信息
///</summary> ///</summary>
...@@ -956,6 +954,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -956,6 +954,7 @@ namespace OnlineStore.DeviceLibrary
} }
} }
} }
public string GetMoveStr() public string GetMoveStr()
{ {
string msg = ""; string msg = "";
......
...@@ -63,7 +63,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -63,7 +63,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error("IOTimeOutProcess出错:" + ex.ToString()); LogUtil.error("IOTimeOutProcess出错:",ex);
} }
} }
private DateTime preRWTime = DateTime.Now; private DateTime preRWTime = DateTime.Now;
...@@ -173,7 +173,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -173,7 +173,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error(checkWaitInfo.Name + " [" + checkWaitInfo.MoveStep + "] CheckWait 出错:" +ex.StackTrace+ ex.Message+ex.ToString()); LogUtil.error(checkWaitInfo.Name + " [" + checkWaitInfo.MoveStep + "] CheckWait 出错:",ex);
} }
} }
...@@ -271,7 +271,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -271,7 +271,7 @@ namespace OnlineStore.DeviceLibrary
} }
}catch(Exception ex) }catch(Exception ex)
{ {
LogUtil.error(Name + "Equip_TrayPEndEvent出错:" + ex.ToString()); LogUtil.error(Name + "Equip_TrayPEndEvent出错:",ex);
} }
} }
...@@ -451,7 +451,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -451,7 +451,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error("SideWayTimerProcess 出错:" + ex.StackTrace); LogUtil.error("SideWayTimerProcess 出错:" ,ex);
} }
sdIsInprocess = false; sdIsInprocess = false;
} }
......
...@@ -533,7 +533,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -533,7 +533,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error("判断托盘是否需要顶升出错:" + ex.ToString()); LogUtil.error("判断托盘是否需要顶升出错:",ex);
} }
} }
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MIO_05_WaitTime)) else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MIO_05_WaitTime))
......
...@@ -504,7 +504,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -504,7 +504,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error(Name + ex.ToString()); LogUtil.error(Name,ex);
} }
return null; return null;
} }
......
...@@ -153,7 +153,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -153,7 +153,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error("出错:"+ ex); LogUtil.error("出错:",ex);
MessageBox.Show(ex.ToString(), "加载配置错误(请检查配置)"); MessageBox.Show(ex.ToString(), "加载配置错误(请检查配置)");
Application.Exit(); Application.Exit();
} }
...@@ -178,7 +178,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -178,7 +178,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error("出错:"+ ex); LogUtil.error("出错:",ex);
} }
} }
public static void SaveFeedingEquipConfig(FeedingEquip_Config config) public static void SaveFeedingEquipConfig(FeedingEquip_Config config)
...@@ -200,7 +200,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -200,7 +200,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error("出错:"+ ex); LogUtil.error("出错:",ex);
} }
} }
public static void SaveProvidingEquipConfig(ProvidingEquip_Config config) public static void SaveProvidingEquipConfig(ProvidingEquip_Config config)
...@@ -221,7 +221,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -221,7 +221,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error("出错:"+ ex); LogUtil.error("出错:",ex);
} }
} }
...@@ -244,7 +244,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -244,7 +244,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error("出错:"+ ex); LogUtil.error("出错:",ex);
} }
} }
......
...@@ -116,7 +116,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -116,7 +116,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
//LogUtil.error("ReadRFID["+ip+"]出错:" + ex.ToString()); //LogUtil.error("ReadRFID["+ip+"]出错:",ex);
} }
return new RFIDData(-1, -1); return new RFIDData(-1, -1);
} }
...@@ -143,7 +143,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -143,7 +143,7 @@ namespace OnlineStore.DeviceLibrary
RFIDReader.CloseAll(); RFIDReader.CloseAll();
}catch(Exception ex) }catch(Exception ex)
{ {
LogUtil.error("关闭RFID出错:" + ex.ToString()); LogUtil.error("关闭RFID出错:",ex);
} }
} }
} }
......
...@@ -139,7 +139,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -139,7 +139,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error(deviceName + " " + ex.ToString()); LogUtil.error(deviceName + " ",ex);
} }
return ""; return "";
} }
...@@ -193,7 +193,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -193,7 +193,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error(deviceName + " " + ex.ToString()); LogUtil.error(deviceName + " ",ex);
} }
return ""; return "";
} }
...@@ -234,7 +234,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -234,7 +234,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error(deviceName + " " + ex.ToString()); LogUtil.error(deviceName + " ",ex);
} }
return msg; return msg;
} }
...@@ -271,7 +271,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -271,7 +271,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error(deviceName + " " + ex.ToString()); LogUtil.error(deviceName + " ",ex);
} }
return ""; return "";
} }
......
...@@ -47,7 +47,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -47,7 +47,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error("同步等待出现异常:" + ex.Message); LogUtil.error("同步等待出现异常:" ,ex);
} }
Thread.Sleep(sleepTime); Thread.Sleep(sleepTime);
waitSpan = System.DateTime.Now.Subtract(startTime); waitSpan = System.DateTime.Now.Subtract(startTime);
......
...@@ -82,7 +82,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -82,7 +82,7 @@ namespace OnlineStore.DeviceLibrary
} }
}catch(Exception ex) }catch(Exception ex)
{ {
LogUtil.error("AOI 判断是否需要重连 出错" + ex.ToString()); LogUtil.error("AOI 判断是否需要重连 出错",ex);
} }
try try
{ {
...@@ -100,7 +100,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -100,7 +100,7 @@ namespace OnlineStore.DeviceLibrary
GC.Collect(); GC.Collect();
}catch(Exception ex) }catch(Exception ex)
{ {
LogUtil.error("AOI ConTimer_Elapsed 出错: " + ex.ToString()); LogUtil.error("AOI ConTimer_Elapsed 出错: ",ex);
} }
isProcess = false; isProcess = false;
} }
...@@ -121,7 +121,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -121,7 +121,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error("关闭Io模块【" + ioIp + "】出错:" + ex); LogUtil.error("关闭Io模块【" + ioIp + "】出错:" ,ex);
} }
AIOMap.Remove(ioIp); AIOMap.Remove(ioIp);
} }
...@@ -232,7 +232,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -232,7 +232,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error("AioBox_DI_Changed_Event出错:" + ex.ToString()); LogUtil.error("AioBox_DI_Changed_Event出错:",ex);
} }
} }
private void AioBox_DO_Changed_Event(AIOBOX box, Box_Sta[] sta) private void AioBox_DO_Changed_Event(AIOBOX box, Box_Sta[] sta)
...@@ -244,7 +244,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -244,7 +244,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error("AioBox_DO_Changed_Event出错:" + ex.ToString()); LogUtil.error("AioBox_DO_Changed_Event出错:",ex);
} }
} }
...@@ -364,7 +364,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -364,7 +364,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error("aio.Close出错:" + ex.ToString()); LogUtil.error("aio.Close出错:",ex);
} }
} }
AIOMap.Clear(); AIOMap.Clear();
...@@ -399,7 +399,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -399,7 +399,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LOGGER.Error("AIO WriteSingleDO [" + ioIp + "] [" + StartAddress + "] 出错啦:" + ex.ToString()); LOGGER.Error("AIO WriteSingleDO [" + ioIp + "] [" + StartAddress + "] 出错啦:",ex);
} }
} }
public override void WriteSingleDO(string ioIp, byte slaveId, ushort StartAddress, IO_VALUE onOff, int mSeconds ) public override void WriteSingleDO(string ioIp, byte slaveId, ushort StartAddress, IO_VALUE onOff, int mSeconds )
...@@ -423,7 +423,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -423,7 +423,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error(LOGGER, "**********定时回写入 出错:" + ex.StackTrace); LogUtil.error(LOGGER, "**********定时回写入 出错:" ,ex);
} }
}; };
mytimer.AutoReset = false;//设置是否自动重启,即自动执行多次; mytimer.AutoReset = false;//设置是否自动重启,即自动执行多次;
...@@ -496,7 +496,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -496,7 +496,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error("GetDOValue [" + ioIP + "] [" + StartAddress + "] 出错:" + ex.ToString()); LogUtil.error("GetDOValue [" + ioIP + "] [" + StartAddress + "] 出错:",ex);
} }
return value; return value;
} }
...@@ -528,7 +528,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -528,7 +528,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error("GetDIValue [" + ioIP + "] [" + StartAddress + "] 出错:" + ex.ToString()); LogUtil.error("GetDIValue [" + ioIP + "] [" + StartAddress + "] 出错:",ex);
} }
return value; return value;
} }
...@@ -548,7 +548,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -548,7 +548,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error(LOGGER, " GetIOValue [" + configIO.IO_IP + "] [" + configIO.GetIOAddr() + "] 获取数据出错:" + ex.ToString()); LogUtil.error(LOGGER, " GetIOValue [" + configIO.IO_IP + "] [" + configIO.GetIOAddr() + "] 获取数据出错:",ex);
} }
return value; return value;
} }
......
...@@ -122,7 +122,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -122,7 +122,7 @@ namespace OnlineStore.DeviceLibrary
// } // }
// catch (Exception ex) // catch (Exception ex)
// { // {
// LogUtil.error(LOGGER, "出错啦:" + ex.ToString()); // LogUtil.error(LOGGER, "出错啦:",ex);
// } // }
// return false; // return false;
//} //}
...@@ -151,7 +151,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -151,7 +151,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error(LOGGER, "出错啦:" + ex.ToString()); LogUtil.error(LOGGER, "出错啦:",ex);
} }
Thread.Sleep(1); Thread.Sleep(1);
} }
...@@ -286,7 +286,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -286,7 +286,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error(LOGGER, "**********定时回写入 出错:" + ex.StackTrace); LogUtil.error(LOGGER, "**********定时回写入 出错:" ,ex);
} }
}; };
mytimer.AutoReset = false;//设置是否自动重启,即自动执行多次; mytimer.AutoReset = false;//设置是否自动重启,即自动执行多次;
...@@ -327,7 +327,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -327,7 +327,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error(LOGGER, "SaveDOValue出错:" + ex.ToString()); LogUtil.error(LOGGER, "SaveDOValue出错:",ex);
} }
} }
public override IO_VALUE GetDOValue(string ioIP, byte slaveId, ushort StartAddress) public override IO_VALUE GetDOValue(string ioIP, byte slaveId, ushort StartAddress)
...@@ -393,7 +393,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -393,7 +393,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error(LOGGER, "获取数据出错:" + ex.ToString()); LogUtil.error(LOGGER, "获取数据出错:",ex);
} }
return value; return value;
} }
...@@ -444,7 +444,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -444,7 +444,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error(LOGGER, "SaveDIData出错:" + ex.ToString()); LogUtil.error(LOGGER, "SaveDIData出错:",ex);
//LOGGER.Error("处理接受数据出错:", ex); //LOGGER.Error("处理接受数据出错:", ex);
} }
} }
...@@ -553,7 +553,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -553,7 +553,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error(LOGGER, "处理接受数据出错:" + ex.ToString()); LogUtil.error(LOGGER, "处理接受数据出错:",ex);
//LOGGER.Error("处理接受数据出错:", ex); //LOGGER.Error("处理接受数据出错:", ex);
} }
} }
...@@ -580,7 +580,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -580,7 +580,7 @@ namespace OnlineStore.DeviceLibrary
default: default:
break; break;
} }
LOGGER.Error("接收数据出错:" + exc); LOGGER.Error("接收数据出错:" +exc );
//MessageBox.Show(exc, "Modbus slave exception"); //MessageBox.Show(exc, "Modbus slave exception");
} }
...@@ -605,7 +605,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -605,7 +605,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error(LOGGER, "出错啦:" + ex.ToString()); LogUtil.error(LOGGER, "出错啦:",ex);
} }
return false; return false;
} }
......
...@@ -171,7 +171,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -171,7 +171,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LOGGER.Error("IO模块[" + IP + "]出错:" + ex.ToString()); LOGGER.Error("IO模块[" + IP + "]出错:",ex);
} }
} }
...@@ -231,7 +231,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -231,7 +231,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error(clientipe.ToString() + "收到数据:" + str + "分包出错 [" + currStartIndex + "]:" + ex.ToString()); LogUtil.error(clientipe.ToString() + "收到数据:" + str + "分包出错 [" + currStartIndex + "]:",ex);
} }
} }
...@@ -335,7 +335,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -335,7 +335,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error(LOGGER, "IO模块[" + IP + "]dispose出错:" + ex.ToString()); LogUtil.error(LOGGER, "IO模块[" + IP + "]dispose出错:",ex);
} }
socketClient.Close(); socketClient.Close();
} }
......
...@@ -39,7 +39,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -39,7 +39,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error("UpdateAddrValue出错:" + ex.ToString()); LogUtil.error("UpdateAddrValue出错:",ex);
} }
return value; return value;
} }
...@@ -70,7 +70,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -70,7 +70,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error("UpdateAddrValue出错:" + ex.ToString()); LogUtil.error("UpdateAddrValue出错:",ex);
} }
} }
...@@ -354,7 +354,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -354,7 +354,7 @@ namespace OnlineStore.DeviceLibrary
} }
}catch(Exception ex) }catch(Exception ex)
{ {
LogUtil.error("轴【" + portName + "_" + slvAddr + "】原点返回前验证是否在原点出错:" + ex.StackTrace); LogUtil.error("轴【" + portName + "_" + slvAddr + "】原点返回前验证是否在原点出错:" ,ex);
} }
//默认负方向原点返回 //默认负方向原点返回
UpdateBlock(portName, slvAddr, ACCMDManager.Block_HomeMove1); UpdateBlock(portName, slvAddr, ACCMDManager.Block_HomeMove1);
......
...@@ -44,7 +44,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -44,7 +44,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error("解析摄像机配置出错:" + ex.StackTrace); LogUtil.error("解析摄像机配置出错:" ,ex);
} }
} }
private static void LoadCamera(bool isReLoad) private static void LoadCamera(bool isReLoad)
...@@ -57,7 +57,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -57,7 +57,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error("加载HIK相机出错:" + ex.ToString()); LogUtil.error("加载HIK相机出错:",ex);
} }
try try
{ {
...@@ -65,7 +65,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -65,7 +65,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error("加载Basler相机出错:" + ex.ToString()); LogUtil.error("加载Basler相机出错:",ex);
} }
} }
string[] names = CodeLibrary.HIKCamera.Instance.CameraName; string[] names = CodeLibrary.HIKCamera.Instance.CameraName;
...@@ -157,7 +157,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -157,7 +157,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error("从相机【" + cameraName + "】获取图片出错:" + ex.ToString()); LogUtil.error("从相机【" + cameraName + "】获取图片出错:",ex);
} }
return bitm; return bitm;
} }
...@@ -231,7 +231,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -231,7 +231,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error("扫码出错:" + ex.ToString()); LogUtil.error("扫码出错:",ex);
} }
return codeList; return codeList;
} }
......
...@@ -131,7 +131,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -131,7 +131,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error("BusyMoveProcess出错:" + ex.ToString()); LogUtil.error("BusyMoveProcess出错:",ex);
} }
isInPro = false; isInPro = false;
} }
......
...@@ -954,7 +954,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -954,7 +954,7 @@ namespace OnlineStore.DeviceLibrary
#region 出料流水线处理,30000开始 #region 出料流水线处理,30000开始
/// <summary> /// <summary>
/// 出料流水线复位,定位气缸下降 /// 出料流水线复位,定位气缸下降,NG气缸后退
/// </summary> /// </summary>
DL_R_CylinderDown=30001, DL_R_CylinderDown=30001,
/// <summary> /// <summary>
......
...@@ -190,7 +190,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -190,7 +190,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error(LOGGER, "关闭 监听出错:" + ex.ToString()); LogUtil.error(LOGGER, "关闭 监听出错:",ex);
} }
} }
public static bool UpdateBoxDebug(int id, int isDebug) public static bool UpdateBoxDebug(int id, int isDebug)
...@@ -338,7 +338,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -338,7 +338,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error("处理料仓消息【" + msg + "】出错:" + ex.ToString()); LogUtil.error("处理料仓消息【" + msg + "】出错:",ex);
} }
} }
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!