Commit 03579498 LN

增加运行日志打印

1 个父辈 c94c8fec
......@@ -113,6 +113,16 @@
<conversionPattern value="[%date][%t]%-5p %m%n" />
</layout>
</appender>
<appender name="RunLog" type="log4net.Appender.RollingFileAppender">
<file value="logs/log/RunLog-line.log" />
<param name="Encoding" value="UTF-8" />
<appendToFile value="true" />
<rollingStyle value="Date" />
<datePattern value="yyyy-MM-dd" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value=" %m%n" />
</layout>
</appender>
<logger name="RollingLogFileAppender">
<level value="Info" />
<appender-ref ref="RollingLogFileAppender" />
......@@ -125,6 +135,10 @@
<level value="Info" />
<appender-ref ref="AIOBOX" />
</logger>
<logger name="RunLog">
<level value="Info" />
<appender-ref ref="RunLog" />
</logger>
<!--<root>
<level value="Info" />
<appender-ref ref="RollingLogFileAppender" />
......
......@@ -302,6 +302,7 @@ namespace OnlineStore.AssemblyLine
{
LogUtil.info("即将退出程序,停止" + lineBean.Name + "运行 ");
lineBean.StopRun();
lineBean.SetWarnMsg();
}
foreach (EquipBase equip in lineBean.AllEquipMap.Values)
{
......@@ -309,6 +310,7 @@ namespace OnlineStore.AssemblyLine
{
LogUtil.info("即将退出程序,停止" + equip.Name + "运行 ");
equip.StopRun();
equip.SetWarnMsg();
}
}
// IOManager.instance.CloseAllDO();
......@@ -318,7 +320,7 @@ namespace OnlineStore.AssemblyLine
if (Camera._cam != null)
{
Camera._cam.CloseAll();
}
}
// CodeManager.CloseAllCamera();
// RFIDManager.Close();
//System.Environment.Exit(System.Environment.ExitCode);
......
......@@ -65,6 +65,7 @@
<Compile Include="util\NetTCPServer.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="util\RunLogUtil.cs" />
<Compile Include="util\TcpClient.cs" />
<Compile Include="util\TcpServer.cs" />
<Compile Include="util\UdpServer.cs" />
......
......@@ -89,7 +89,7 @@ namespace OnlineStore.Common
}
public static void error(ILog log, string errorMsg, Exception ex = null)
{
if (errorMsg.Trim().Equals("")&&(ex==null))
if (errorMsg.Trim().Equals("") && (ex == null))
{
return;
}
......@@ -103,7 +103,7 @@ namespace OnlineStore.Common
}
AddToBox(errorMsg, Color.Red);
}
private static object lockObj = "";
private static object lockObj = "";
private static void AddToBox(string msg, Color color)
{
if (Monitor.TryEnter(lockObj, 2))
......@@ -123,7 +123,7 @@ namespace OnlineStore.Common
}
else
{
LOGGER.Debug ("ShowLogPro【" + msg + "】失败,未得到锁");
LOGGER.Debug("ShowLogPro【" + msg + "】失败,未得到锁");
}
}
private static List<string> logList = new List<string>();
......@@ -132,7 +132,7 @@ namespace OnlineStore.Common
private static void ShowLogPro(string msg, Color color)
{
try
{
{
if (logList.Count >= showCount)
{
logList.RemoveAt(0);
......@@ -174,7 +174,7 @@ namespace OnlineStore.Common
LOGGER.Error("出错:" + ex.ToString());
}
}
private static DateTime lastTime = DateTime.Now;
private static DateTime lastTime = DateTime.Now;
public static void UpdateLogbox()
{
if (logBox != null && logBox.Visible)
......@@ -192,7 +192,7 @@ namespace OnlineStore.Common
}
public static void ClearLog()
{
if (logBox != null)
{
LastText = "";
......@@ -204,9 +204,9 @@ namespace OnlineStore.Common
{
debug(LOGGER, msg);
}
public static void error(string errorMsg,Exception ex=null)
public static void error(string errorMsg, Exception ex = null)
{
error(LOGGER, errorMsg,ex);
error(LOGGER, errorMsg, ex);
}
public static void info(string msg)
{
......
using log4net;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
namespace OnlineStore.Common
{
public class RunLogUtil
{
public static readonly ILog RunLog = LogManager.GetLogger("RunLog");
public static void ErrorLog(ErrorLog log)
{
string jsonStr = JsonHelper.SerializeObject(log);
RunLog.Error(jsonStr);
}
public static void MoveLog(MoveLog log)
{
//if (log == null || (!log.IsValid()))
//{
// return;
//}
//string jsonStr = JsonHelper.SerializeObject(log);
//RunLog.Info(jsonStr);
}
public static void MoveEndLog(MoveEndLog log)
{
if (log == null || (!log.IsValid()))
{
return;
}
string jsonStr = JsonHelper.SerializeObject(log);
RunLog.Info(jsonStr);
}
public static void AxisLog(AxisMoveLog log)
{
string jsonStr = JsonHelper.SerializeObject(log);
RunLog.Error(jsonStr);
}
}
public class BaseLog
{
[JsonProperty(Order = 0)]
public string Name { get; set; } = "四楼环形线";
[JsonProperty(Order = 1)]
public string DeviceName { get; set; } = "";
[JsonProperty(Order = 2)]
public string LogType { get; set; } = "";
[JsonProperty(Order = 3)]
public string StartTime { get; set; } = "";
[JsonProperty(Order = 4)]
public string EndTime { get; set; } = "";
[JsonProperty(Order = 5)]
public string timeSpan { get; set; } = "";
}
public class ErrorLog : BaseLog
{
public ErrorLog()
{
this.LogType = "Error";
}
public ErrorLog(string deviceName, string errType, string errMsg, DateTime startTime, DateTime endTime, string operType = "", string posid = "", string barcode = "")
{
this.LogType = "Error";
this.DeviceName = deviceName.Trim();
this.ErrorType = errType.Trim();
this.ErrorMsg = errMsg.Trim();
this.StartTime = startTime.ToString("yyyy-MM-dd HH:mm:ss");
this.EndTime = endTime.ToString("yyyy-MM-dd HH:mm:ss");
this.OperateType = operType.Trim();
this.PosId = posid.Trim();
this.Barcode = barcode.Trim();
TimeSpan span = endTime - startTime;
this.timeSpan = (Math.Round(span.TotalMinutes, 2)).ToString();//两位小数的分钟
}
public bool IsValid()
{
if (string.IsNullOrEmpty(DeviceName) || String.IsNullOrEmpty(LogType) || string.IsNullOrEmpty(ErrorType) || string.IsNullOrEmpty(ErrorMsg))
{
return false;
}
return true;
}
[JsonProperty(Order = 11)]
public string ErrorType { get; set; } = "";
[JsonProperty(Order = 12)]
public string ErrorMsg { get; set; } = "";
[JsonProperty(Order = 13)]
public string OperateType { get; set; } = "";
[JsonProperty(Order = 14)]
public string PosId { get; set; } = "";
[JsonProperty(Order = 15)]
public string Barcode { get; set; } = "";
}
public class MoveLog : BaseLog
{
public MoveLog()
{
this.LogType = "Running";
}
public MoveLog(string deviceName, string moveType, string moveMsg, DateTime startTime, DateTime endTime, string posid = "", string barcode = "")
{
this.LogType = "Running";
this.DeviceName = deviceName.Replace("-Move", "").Replace("-SMove", "").Trim();
this.MoveType = moveType.Trim();
this.MoveMsg = moveMsg.Trim();
this.StartTime = startTime.ToString("yyyy-MM-dd HH:mm:ss");
this.EndTime = endTime.ToString("yyyy-MM-dd HH:mm:ss");
this.PosId = posid.Trim();
this.Barcode = barcode.Trim();
TimeSpan span = endTime - startTime;
this.timeSpan = (Math.Round(span.TotalMinutes, 2)).ToString();//两位小数的分钟
}
public bool IsValid()
{
if (string.IsNullOrEmpty(DeviceName) || String.IsNullOrEmpty(LogType) || string.IsNullOrEmpty(MoveType) || string.IsNullOrEmpty(MoveMsg))
{
return false;
}
return true;
}
[JsonProperty(Order = 11)]
public string MoveType { get; set; } = "";
[JsonProperty(Order = 12)]
public string MoveMsg { get; set; } = "";
[JsonProperty(Order = 13)]
public string PosId { get; set; } = "";
[JsonProperty(Order = 14)]
public string Barcode { get; set; } = "";
}
public class MoveEndLog : BaseLog
{
public MoveEndLog()
{
this.LogType = "InoutEnd";
}
public MoveEndLog(string deviceName, string moveType, DateTime startTime, DateTime endTime, string posid = "", string barcode = "")
{
this.LogType = "InoutEnd";
this.DeviceName = deviceName.Replace("-Move", "").Replace("-SMove", "").Trim();
this.MoveType = moveType.Trim();
this.StartTime = startTime.ToString("yyyy-MM-dd HH:mm:ss");
this.EndTime = endTime.ToString("yyyy-MM-dd HH:mm:ss");
this.PosId = posid.Trim();
this.Barcode = barcode.Trim();
TimeSpan span = endTime - startTime;
this.timeSpan = (Math.Round(span.TotalMinutes, 2)).ToString();//两位小数的分钟
}
public bool IsValid()
{
if (string.IsNullOrEmpty(DeviceName) || string.IsNullOrEmpty(MoveType))
{
return false;
}
return true;
}
[JsonProperty(Order = 11)]
public string MoveType { get; set; } = "";
[JsonProperty(Order = 12)]
public string PosId { get; set; } = "";
[JsonProperty(Order = 13)]
public string Barcode { get; set; } = "";
}
public class AxisMoveLog : BaseLog
{
public AxisMoveLog()
{
this.LogType = "Axis";
}
public AxisMoveLog(string deviceName, string axisName, string moveType, int targetP, int speed, DateTime startTime, DateTime endTime, string posid = "", string barcode = "")
{
this.LogType = "Axis";
this.DeviceName = deviceName.Replace("-Move", "").Replace("-SMove", "").Trim();
this.MoveType = moveType.Trim();
this.AxisName = axisName;
this.TargetPos = targetP;
this.StartTime = startTime.ToString("yyyy-MM-dd HH:mm:ss");
this.EndTime = endTime.ToString("yyyy-MM-dd HH:mm:ss");
this.PosId = posid.Trim();
this.Barcode = barcode.Trim();
TimeSpan span = endTime - startTime;
this.timeSpan = (Math.Round(span.TotalMinutes, 2)).ToString();//两位小数的分钟
this.Speed = speed;
}
public bool IsValid()
{
if (string.IsNullOrEmpty(DeviceName) || string.IsNullOrEmpty(MoveType))
{
return false;
}
return true;
}
[JsonProperty(Order = 11)]
public string AxisName { get; set; } = "";
[JsonProperty(Order = 12)]
public string MoveType { get; set; } = "";
[JsonProperty(Order = 13)]
public int TargetPos { get; set; } = 0;
[JsonProperty(Order = 14)]
public int Speed { get; set; }
[JsonProperty(Order = 15)]
public string PosId { get; set; } = "";
[JsonProperty(Order = 16)]
public string Barcode { get; set; } = "";
}
}
......@@ -194,6 +194,7 @@ namespace OnlineStore.DeviceLibrary
}
}
RunLogUtil.MoveEndLog(new MoveEndLog(Name, "复位", MoveInfo.MoveStartTime, DateTime.Now));
MoveEndS();
SecondMoveInfo.EndMove();
break;
......@@ -262,7 +263,7 @@ namespace OnlineStore.DeviceLibrary
Thread.Sleep(300);
if (IOValue(IO_Type.DLine_SuddenStop).Equals(IO_VALUE.LOW))
{
SetWarnMsg(Name + "收到急停信号,急停报警");
SetWarnMsg(Name + "收到急停信号,急停报警", "急停报警");
Alarm(LineAlarmType.SuddenStop);
return;
}
......
......@@ -190,6 +190,8 @@ namespace OnlineStore.DeviceLibrary
int robotIndex = GetRobotIndex();
LogUtil.info(hengyiName + MoveInfo.SLog + "送料,接驳台有料,调用arriveRobotLocation=" + robotIndex + "[" + StationInfo_Move.CodeStr + "]");
string msg = SServerManager.arriveRobotLocation(Name, robotIndex, StationInfo_Move.CodeStr);
MoveEndS();
LogUtil.info(hengyiName + MoveInfo.SLog + "送料结束 [" + msg + "]");
}
......@@ -206,6 +208,7 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.MoveStep.Equals(LineMoveStep.DON_08_CRun))
{
SeparateStopRun();
RunLogUtil.MoveEndLog(new MoveEndLog(Name, "送料", MoveInfo.MoveStartTime, DateTime.Now, "", StationInfo_Move.CodeStr));
MoveEndS();
LogUtil.info(hengyiName + MoveInfo.SLog + "送料结束,停止接驳台皮带线 ");
}
......
......@@ -185,19 +185,8 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error("IOTimeOutProcess出错:",ex);
}
}
protected void ClearTimeoutAlarm(string msg)
{
if (isInSuddenDown || isNoAirCheck)
{
return;
}
if (WarnMsg.Contains(msg) && alarmType.Equals(LineAlarmType.IoSingleTimeOut))
{
LogUtil.info(Name + "清理信号超时报警【" + WarnMsg + "】 ");
alarmType = LineAlarmType.None;
SetWarnMsg("");
}
}
protected bool CanStartRun()
{
string canResult = LineManager.Line.CanStart();
......@@ -380,7 +369,7 @@ namespace OnlineStore.DeviceLibrary
IOMove(axis.Config.BreakOnDO, IO_VALUE.HIGH);
return true;
}
SetWarnMsg(Name + msg);
SetWarnMsg(Name + msg,axis.Config.DisplayStr+"_轴报警");
//WarnMsg = DateTime.Now.ToLongTimeString() + " " + Name + msg;
Alarm(LineAlarmType.AxisAlarm);
return false;
......@@ -443,16 +432,24 @@ namespace OnlineStore.DeviceLibrary
if (wait.IsHomeMove)
{
wait.IsEnd = AxisBean.HomeMoveIsEnd(moveInfo, wait.AxisInfo, out msg);
if (wait.IsEnd)
{
RunLogUtil.AxisLog(new AxisMoveLog(Name, wait.AxisInfo.Explain, "回原点", 0, wait.AxisInfo.HomeHighSpeed, moveInfo.LastSetpTime, DateTime.Now, moveInfo.MoveParam.PosId, moveInfo.MoveParam.WareCode));
}
}
else
{
wait.IsEnd = AxisBean.ACAxisMoveIsEnd(moveInfo, wait.AxisInfo, wait.TargetPosition, wait.TargetSpeed, out msg);
wait.IsEnd = AxisBean.ACAxisMoveIsEnd(moveInfo, wait.AxisInfo, wait.TargetPosition, wait.TargetSpeed, out msg);
if (wait.IsEnd)
{
RunLogUtil.AxisLog(new AxisMoveLog(Name, wait.AxisInfo.Explain, "绝对运动", wait.TargetPosition, wait.TargetSpeed, moveInfo.LastSetpTime, DateTime.Now, moveInfo.MoveParam.PosId, moveInfo.MoveParam.WareCode));
}
}
if (!msg.Equals(""))
{
isOk = false;
WarnMsg = Name + msg;
string type = moveInfo.GetStepDes() + "_轴运动报警";
SetWarnMsg(msg, type,moveInfo);
Alarm(LineAlarmType.AxisMoveError);
CheckAlarmProcess(moveInfo, LineAlarmType.AxisMoveError);
LogUtil.error(WarnMsg, DeviceID * 1000 + 14);
......@@ -477,9 +474,12 @@ namespace OnlineStore.DeviceLibrary
if (span.TotalSeconds > LineManager.Config.IOSingle_TimerOut && alarmType <= LineAlarmType.IoSingleTimeOut)
{
ConfigIO io = baseConfig.getWaitIO(wait.IoType);
WarnMsg = moveInfo.Name + "[" + moveInfo.MoveType + "][" + moveInfo.MoveStep + "] 等待" + NotOkMsg + " 超时 " + Math.Round(span.TotalSeconds, 1) + "秒";
string msg= moveInfo.Name + "[" + moveInfo.MoveType + "][" + moveInfo.MoveStep + "] 等待" + NotOkMsg + " 超时 " + Math.Round(span.TotalSeconds, 1) + "秒";
LogUtil.error(MoveInfo.Name + WarnMsg, DeviceID * 1000 + 13);
string type = moveInfo.GetStepDes() + "_" + "超时报警";
SetWarnMsg(msg, type,moveInfo);
//WarnMsg = moveInfo.Name + "[" + moveInfo.MoveType + "][" + moveInfo.MoveStep + "] 等待" + NotOkMsg + " 超时 " + Math.Round(span.TotalSeconds, 1) + "秒";
//LogUtil.error(MoveInfo.Name + WarnMsg, DeviceID * 1000 + 13);
if (NoAlarm())
{
Alarm(LineAlarmType.IoSingleTimeOut);
......@@ -559,11 +559,11 @@ namespace OnlineStore.DeviceLibrary
if (isOk)
{
moveInfo.EndStepWait();
ClearStepAlarm(moveInfo.GetStepDes());
}
else if (span.TotalSeconds > moveInfo.TimeOutSeconds)
{
WarnMsg = moveInfo.Name + "[" + moveInfo.MoveType + "][" + moveInfo.MoveStep + "]等待" + NotOkMsg
+ "超时[" + Math.Round(span.TotalSeconds, 1) + "]秒";
int second = 10;
if (IsLowAlarm(moveInfo))
{
......@@ -577,7 +577,12 @@ namespace OnlineStore.DeviceLibrary
{
second = 10;
}
LogUtil.error(WarnMsg, DeviceID * 1000 + 15, second);
//WarnMsg = moveInfo.Name + "[" + moveInfo.MoveType + "][" + moveInfo.MoveStep + "]等待" + NotOkMsg+ "超时[" + Math.Round(span.TotalSeconds, 1) + "]秒";
//LogUtil.error(WarnMsg, DeviceID * 1000 + 15, second);
string msg= moveInfo.Name + "[" + moveInfo.MoveType + "][" + moveInfo.MoveStep + "]等待" + NotOkMsg + "超时[" + Math.Round(span.TotalSeconds, 1) + "]秒";
string type = moveInfo.GetStepDes() + "_" + "超时报警";
SetWarnMsg(msg, type,moveInfo, second);
Alarm(LineAlarmType.IoSingleTimeOut);
CheckAlarmProcess(moveInfo, LineAlarmType.IoSingleTimeOut);
}
......@@ -587,6 +592,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error(moveInfo.Name + " [" + moveInfo.MoveStep + "] CheckWait 出错:", ex);
}
}
private bool IsLowAlarm(LineMoveInfo moveInfo)
{
//托盘卡的信号不报警,只提示
......
......@@ -291,6 +291,7 @@ namespace OnlineStore.DeviceLibrary
LogInfo("重置完成,出口检测到有料架,调用 " + Config.AgvOutName + " AgvClient.NeedLeave");
AgvClient.NeedLeave(Config.AgvOutName, LastOutShelfId, level);
}
RunLogUtil.MoveEndLog(new MoveEndLog(Name, "复位", MoveInfo.MoveStartTime, DateTime.Now));
MoveEndS();
break;
default: break;
......@@ -557,9 +558,10 @@ namespace OnlineStore.DeviceLibrary
}
else
{
WarnMsg = Name + "TrayLCylinderAfter:提升轴当前不在下降位置P2,不后退定位气缸";
//WarnMsg = Name + "TrayLCylinderAfter:提升轴当前不在下降位置P2,不后退定位气缸";
//LogUtil.error(Name + "TrayLCylinderAfter:提升轴当前不在下降位置P2,不后退定位气缸");
SetWarnMsg("TrayLCylinderAfter:提升轴当前不在下降位置P2,不后退定位气缸");
Alarm(LineAlarmType.IoSingleTimeOut);
LogUtil.error(Name + "TrayLCylinderAfter:提升轴当前不在下降位置P2,不后退定位气缸");
}
}
if (moveinfo != null)
......@@ -655,7 +657,7 @@ namespace OnlineStore.DeviceLibrary
IsInProcess = true;
lastOkTime = DateTime.Now;
if (IOValue(TargetIoType).Equals(TargetIoValue))
{
{
LogUtil.info(Name + "上料轴,检测到 " + TargetIoType + "=" + TargetIoValue + ",停止运动");
BatchAxis.SuddenStop();
BatchAxisStopCheck();
......
......@@ -436,8 +436,8 @@ namespace OnlineStore.DeviceLibrary
{
if (SecondMoveInfo.IsTimeOut(15))
{
WarnMsg = SecondMoveInfo.Name + "[" + SecondMoveInfo.MoveStep + "] 等待入库托盘超时 [" + Math.Round(MoveInfo.StepSpan().TotalSeconds, 1) + "]秒";
LogUtil.error(WarnMsg + ",暂时放托盘离开");
string msg= SecondMoveInfo.Name + "[" + SecondMoveInfo.MoveStep + "] 等待入库托盘超时 [" + Math.Round(MoveInfo.StepSpan().TotalSeconds, 1) + "]秒";
LogUtil.error(msg + ",暂时放托盘离开");
TrayMoveOk();
}
}
......@@ -448,24 +448,23 @@ namespace OnlineStore.DeviceLibrary
if (StartTrayOut(SecondMoveInfo.MoveParam))
{
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_201_WaitOutEnd);
}
//如果当前无料串,或者料串已离开,直接放行 托盘
}
//如果当前无料串,或者料串已离开,直接放行 托盘
else if (SecondMoveInfo.IsTimeOut(30))
{
WarnMsg = SecondMoveInfo.Name + "[" + SecondMoveInfo.MoveStep + "] 等待出库移栽超时 [" + Math.Round(MoveInfo.StepSpan().TotalSeconds, 1) + "]秒";
LogUtil.error(WarnMsg + ",暂时放托盘离开");
string msg = SecondMoveInfo.Name + "[" + SecondMoveInfo.MoveStep + "] 等待出库移栽超时 [" + Math.Round(MoveInfo.StepSpan().TotalSeconds, 1) + "]秒";
LogUtil.error(msg + ",暂时放托盘离开");
TrayMoveOk();
}
else if (SecondMoveInfo.IsTimeOut(20))
{
WarnMsg = SecondMoveInfo.Name + "[" + SecondMoveInfo.MoveStep + "] 等待出库移栽超时 [" + Math.Round(MoveInfo.StepSpan().TotalSeconds, 1) + "]秒";
LogUtil.error(WarnMsg, DeviceID * 1000 + 21);
Alarm(LineAlarmType.IoSingleTimeOut);
}
MoveTimeoutAlarm(SecondMoveInfo, "等待出库移栽超时");
//WarnMsg = SecondMoveInfo.Name + "[" + SecondMoveInfo.MoveStep + "] 等待出库移栽超时 [" + Math.Round(MoveInfo.StepSpan().TotalSeconds, 1) + "]秒";
//LogUtil.error(WarnMsg, DeviceID * 1000 + 21);
//Alarm(LineAlarmType.IoSingleTimeOut);
}
}
}
}
private void TrayMoveOk(bool needCheck = false)
{
if (needCheck && (!SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_11_CodeRember)))
......@@ -792,9 +791,10 @@ namespace OnlineStore.DeviceLibrary
}
else if (MoveInfo.IsTimeOut(60))
{
WarnMsg = MoveInfo.Name + "[" + MoveInfo.MoveStep + "] 扫码执行结束超时 [" + Math.Round(MoveInfo.StepSpan().TotalSeconds, 1) + "]秒";
LogUtil.error(WarnMsg, DeviceID * 1000 + 30);
Alarm(LineAlarmType.IoSingleTimeOut);
MoveTimeoutAlarm(MoveInfo, "扫码执行结束超时");
//WarnMsg = MoveInfo.Name + "[" + MoveInfo.MoveStep + "] 扫码执行结束超时 [" + Math.Round(MoveInfo.StepSpan().TotalSeconds, 1) + "]秒";
//LogUtil.error(WarnMsg, DeviceID * 1000 + 30);
//Alarm(LineAlarmType.IoSingleTimeOut);
}
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_14_CylinderTake))
......@@ -1001,9 +1001,10 @@ namespace OnlineStore.DeviceLibrary
}
else if (MoveInfo.IsTimeOut(180))
{
WarnMsg = MoveInfo.Name + "[" + MoveInfo.MoveType + "][" + MoveInfo.SLog + "]等待空托盘到达超时[" + Math.Round(MoveInfo.StepSpan().TotalSeconds, 1) + "]秒";
LogUtil.error(WarnMsg, DeviceID * 1000 + 22);
Alarm(LineAlarmType.IoSingleTimeOut);
MoveTimeoutAlarm(MoveInfo, "等待空托盘到达超时");
//WarnMsg = MoveInfo.Name + "[" + MoveInfo.MoveType + "][" + MoveInfo.SLog + "]等待空托盘到达超时[" + Math.Round(MoveInfo.StepSpan().TotalSeconds, 1) + "]秒";
//LogUtil.error(WarnMsg, DeviceID * 1000 + 22);
//Alarm(LineAlarmType.IoSingleTimeOut);
}
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_26_CylinderDown))
......@@ -1162,7 +1163,7 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(300));
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_59_TopDown))
{
{
MoveEndS();
// MoveInfo.NextMoveStep(LineMoveStep.FI_39_OutLineRun);
LastOutShelfId = CurrShelfId;
......@@ -1191,9 +1192,10 @@ namespace OnlineStore.DeviceLibrary
}
else if (MoveInfo.IsTimeOut(15))
{
WarnMsg = MoveInfo.Name + "[" + MoveInfo.MoveStep + "] 获取库位号超时 " + getPosIdMsg + " [" + Math.Round(MoveInfo.StepSpan().TotalSeconds, 1) + "]秒";
LogUtil.error(WarnMsg, DeviceID * 1000 + 30);
Alarm(LineAlarmType.IoSingleTimeOut);
MoveTimeoutAlarm(MoveInfo, "获取库位号超时 " + getPosIdMsg + "");
//WarnMsg = MoveInfo.Name + "[" + MoveInfo.MoveStep + "] 获取库位号超时 " + getPosIdMsg + " [" + Math.Round(MoveInfo.StepSpan().TotalSeconds, 1) + "]秒";
//LogUtil.error(WarnMsg, DeviceID * 1000 + 30);
//Alarm(LineAlarmType.IoSingleTimeOut);
}
}
......@@ -1447,9 +1449,10 @@ namespace OnlineStore.DeviceLibrary
}
else if (MoveInfo.IsTimeOut(60))
{
WarnMsg = SecondMoveInfo.Name + "[" + SecondMoveInfo.MoveStep + "] 等待预扫码结束超时 [" + Math.Round(MoveInfo.StepSpan().TotalSeconds, 1) + "]秒";
LogUtil.error(WarnMsg, DeviceID * 1000 + 21);
Alarm(LineAlarmType.IoSingleTimeOut);
MoveTimeoutAlarm(MoveInfo, "等待预扫码结束超时");
//WarnMsg = SecondMoveInfo.Name + "[" + SecondMoveInfo.MoveStep + "] 等待预扫码结束超时 [" + Math.Round(MoveInfo.StepSpan().TotalSeconds, 1) + "]秒";
//LogUtil.error(WarnMsg, DeviceID * 1000 + 21);
//Alarm(LineAlarmType.IoSingleTimeOut);
}
}
else
......@@ -1499,8 +1502,9 @@ namespace OnlineStore.DeviceLibrary
}
else
{
WarnMsg = Name + "提升轴运动报警。上升到P3点已重复" + LoopCount + "次,仍未检测到料盘信号";
LogUtil.error(WarnMsg);
//WarnMsg = Name + "提升轴运动报警。上升到P3点已重复" + LoopCount + "次,仍未检测到料盘信号";
//LogUtil.error(WarnMsg);
SetWarnMsg("提升轴运动报警。上升到P3点已重复" + LoopCount + "次,仍未检测到料盘信号", "提升轴运动报警,未检测到料盘信号");
Alarm(LineAlarmType.AxisMoveError);
}
return;
......
......@@ -744,9 +744,10 @@ namespace OnlineStore.DeviceLibrary
}
else if (MoveInfo.IsTimeOut(60))
{
WarnMsg = SecondMoveInfo.Name + "[" + SecondMoveInfo.MoveStep + "] 等待给服务器发送afterPut完成超时 [" + Math.Round(MoveInfo.StepSpan().TotalSeconds, 1) + "]秒";
LogUtil.error(WarnMsg, DeviceID * 1000 + 21);
Alarm(LineAlarmType.IoSingleTimeOut);
MoveTimeoutAlarm(MoveInfo, "等待给服务器发送afterPut完成超时");
//WarnMsg = SecondMoveInfo.Name + "[" + SecondMoveInfo.MoveStep + "] 等待给服务器发送afterPut完成超时 [" + Math.Round(MoveInfo.StepSpan().TotalSeconds, 1) + "]秒";
//LogUtil.error(WarnMsg, DeviceID * 1000 + 21);
//Alarm(LineAlarmType.IoSingleTimeOut);
}
}
}
......
......@@ -719,7 +719,7 @@ namespace OnlineStore.DeviceLibrary
Thread.Sleep(300);
if (IOValue(IO_Type.SuddenStop_BTN).Equals(IO_VALUE.LOW))
{
SetWarnMsg("收到急停信号,报警急停");
SetWarnMsg("收到急停信号,报警急停","急停报警");
Alarm(LineAlarmType.SuddenStop);
}
//});
......@@ -865,7 +865,7 @@ namespace OnlineStore.DeviceLibrary
{
if ((DateTime.Now - lastAirCloseTime).TotalSeconds > Config.AirCheckSeconds)
{
SetWarnMsg("持续"+Config.AirCheckSeconds+"秒未检测到气压信号");
SetWarnMsg("持续"+Config.AirCheckSeconds+"秒未检测到气压信号","未检测到气压信号");
//SendAlarmCode(0, LineAlarm.NoAirCheck);
airValue = IO_VALUE.LOW;
Alarm(LineAlarmType.NoAirCheck );
......@@ -1028,8 +1028,8 @@ namespace OnlineStore.DeviceLibrary
}
else if (span.TotalSeconds > 120)
{
WarnMsg = Name + "[" + MoveInfo.MoveStep + "][" + msg + "]已等待[" + Math.Round(span.TotalSeconds, 1) + "]秒";
LogUtil.error(WarnMsg, 903);
string wMsg = Name + "[" + MoveInfo.MoveStep + "][" + msg + "]已等待[" + Math.Round(span.TotalSeconds, 1) + "]秒";
SetWarnMsg(wMsg,$"{msg}超时", MoveInfo);
Alarm(LineAlarmType.IoSingleTimeOut);
}
}
......
......@@ -110,9 +110,9 @@ namespace OnlineStore.DeviceLibrary
if (span.TotalSeconds > LineManager.Config.IOSingle_TimerOut && NoAlarm())
{
ConfigIO io = baseConfig.getWaitIO(wait.IoType);
WarnMsg = Name + "[" + checkWaitInfo.MoveStep + "]等待" + NotOkMsg + " 超时";
string warnMsg= checkWaitInfo.Name + "[" + checkWaitInfo.MoveStep + "]等待" + NotOkMsg + " 超时";
SetWarnMsg(warnMsg, checkWaitInfo.GetStepDes()+"_超时报警", checkWaitInfo);
Alarm(LineAlarmType.IoSingleTimeOut);
LogUtil.error(MoveInfo.Name + WarnMsg, 901);
}
//超过报警时长
else if (rwSpan.TotalSeconds > 5 && span.TotalSeconds > 6 && span.TotalSeconds < LineManager.Config.IOSingle_TimerOut * 2)
......@@ -183,11 +183,12 @@ namespace OnlineStore.DeviceLibrary
if (isOk)
{
checkWaitInfo.EndStepWait();
ClearStepAlarm(checkWaitInfo.GetStepDes());
}
else if (span.TotalSeconds > checkWaitInfo.TimeOutSeconds)
{
WarnMsg = checkWaitInfo.Name + "[" + checkWaitInfo.MoveStep + "][" + NotOkMsg + "]已等待[" + Math.Round(span.TotalSeconds, 1) + "]秒";
LogUtil.error(WarnMsg, 900);
string wanMsg = checkWaitInfo.Name + "[" + checkWaitInfo.MoveStep + "][" + NotOkMsg + "]已等待[" + Math.Round(span.TotalSeconds, 1) + "]秒";
SetWarnMsg(wanMsg, checkWaitInfo.GetStepDes()+"_超时报警" , checkWaitInfo);
Alarm(LineAlarmType.IoSingleTimeOut);
}
}
......
......@@ -285,9 +285,10 @@ namespace OnlineStore.DeviceLibrary
}
else if (Shunt_MoveInfo.IsTimeOut(120))
{
WarnMsg = MoveInfo.Name + "[" + MoveInfo.MoveType + "][" + MoveInfo.SLog + "]等待分流横移2可以上升[" + Math.Round(MoveInfo.StepSpan().TotalSeconds, 1) + "]秒";
LogUtil.error(WarnMsg, DeviceID * 1000 + 12);
Alarm(LineAlarmType.IoSingleTimeOut);
MoveTimeoutAlarm(Shunt_MoveInfo, "等待分流横移2可以上升");
//WarnMsg = Shunt_MoveInfo.Name + "[" + Shunt_MoveInfo.MoveType + "][" + Shunt_MoveInfo.SLog + "]等待分流横移2可以上升[" + Math.Round(Shunt_MoveInfo.StepSpan().TotalSeconds, 1) + "]秒";
//LogUtil.error(WarnMsg, DeviceID * 1000 + 12);
//Alarm(LineAlarmType.IoSingleTimeOut);
}
}
else if (Shunt_MoveInfo.MoveStep.Equals(LineMoveStep.Shunt07_Top2Up))
......
......@@ -337,9 +337,10 @@ namespace OnlineStore.DeviceLibrary
}
else if (Shunt2_MoveInfo.IsTimeOut(120))
{
WarnMsg = MoveInfo.Name + "[" + MoveInfo.MoveType + "][" + MoveInfo.SLog + "]等待分流横移22可以上升[" + Math.Round(MoveInfo.StepSpan().TotalSeconds, 1) + "]秒";
LogUtil.error(WarnMsg, DeviceID * 1000 + 12);
Alarm(LineAlarmType.IoSingleTimeOut);
MoveTimeoutAlarm(Shunt2_MoveInfo, "等待分流横移2可以上升");
//WarnMsg = Shunt2_MoveInfo.Name + "[" + Shunt2_MoveInfo.MoveType + "][" + Shunt2_MoveInfo.SLog + "]等待分流横移22可以上升[" + Math.Round(Shunt2_MoveInfo.StepSpan().TotalSeconds, 1) + "]秒";
//LogUtil.error(WarnMsg, DeviceID * 1000 + 12);
//Alarm(LineAlarmType.IoSingleTimeOut);
}
}
else if (Shunt2_MoveInfo.MoveStep.Equals(LineMoveStep.Shunt07_Top2Up))
......
......@@ -161,6 +161,7 @@ namespace OnlineStore.DeviceLibrary
}
else
{
RunLogUtil.MoveEndLog(new MoveEndLog(Name, "复位", MoveInfo.MoveStartTime, DateTime.Now));
ResetEnd();
}
......
......@@ -249,6 +249,8 @@ namespace OnlineStore.DeviceLibrary
CylinderMove(SecondMoveInfo, IO_Type.TopCylinder_UP, IO_Type.TopCylinder_Down);
OutLog("出库处理结束!");
RunLogUtil.MoveEndLog(new MoveEndLog(Name, "出库", MoveInfo.MoveStartTime, DateTime.Now, MoveInfo.MoveParam.PosId, MoveInfo.MoveParam.WareCode));
MoveEndS();
}
......@@ -275,9 +277,10 @@ namespace OnlineStore.DeviceLibrary
}
else if (MoveInfo.IsTimeOut(300))
{
WarnMsg = MoveInfo.Name + "[" + MoveInfo.MoveType + "][" + MoveInfo.SLog + "]等待空托盘到达超时[" + Math.Round(MoveInfo.StepSpan().TotalSeconds, 1) + "]秒";
LogUtil.error(WarnMsg, DeviceID * 1000 + 12);
Alarm(LineAlarmType.IoSingleTimeOut);
MoveTimeoutAlarm(MoveInfo, "等待空托盘到达超时");
//WarnMsg = MoveInfo.Name + "[" + MoveInfo.MoveType + "][" + MoveInfo.SLog + "]等待空托盘到达超时[" + Math.Round(MoveInfo.StepSpan().TotalSeconds, 1) + "]秒";
//LogUtil.error(WarnMsg, DeviceID * 1000 + 12);
//Alarm(LineAlarmType.IoSingleTimeOut);
return false;
}
return false;
......@@ -521,13 +524,14 @@ namespace OnlineStore.DeviceLibrary
if (sendCount >= 3)
{
WarnMsg = MoveInfo.Name + "[" + MoveInfo.MoveStep + "] " + " 等待BOX开始入库超时 已发送" + sendCount + "次";
LogUtil.error(WarnMsg);
SetWarnMsg(MoveInfo.Name + "[" + MoveInfo.MoveStep + "] " + " 等待BOX开始入库超时 已发送" + sendCount + "次","等待BOX开始入库超时");
//LogUtil.error(WarnMsg);
Alarm(LineAlarmType.IoSingleTimeOut);
}
}
else
{
RunLogUtil.MoveEndLog(new MoveEndLog(Name, "入库", MoveInfo.MoveStartTime, DateTime.Now, MoveInfo.MoveParam.PosId, MoveInfo.MoveParam.WareCode));
sendCount = 0;
LogInfo("入库【" + posId + "】处理(移栽)全部完成!");
MoveEndS();
......@@ -535,6 +539,7 @@ namespace OnlineStore.DeviceLibrary
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.MI_16_SendEnd))
{
RunLogUtil.MoveEndLog(new MoveEndLog(Name, "入库", MoveInfo.MoveStartTime, DateTime.Now, MoveInfo.MoveParam.PosId, MoveInfo.MoveParam.WareCode));
LogInfo("入库【" + posId + "】处理(移栽)全部完成!");
MoveEndS();
}
......@@ -1072,8 +1077,8 @@ namespace OnlineStore.DeviceLibrary
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_09_WaitLetFixtureGo);
}else if (SecondMoveInfo.IsTimeOut(30))
{
WarnMsg = SecondMoveInfo.Name + "[" + SecondMoveInfo.MoveStep + "] 等待开始入库超时 [" + Math.Round(MoveInfo.StepSpan().TotalSeconds, 1) + "]秒";
LogUtil.error(WarnMsg + ",暂时放托盘离开");
string msg = SecondMoveInfo.Name + "[" + SecondMoveInfo.MoveStep + "] 等待开始入库超时 [" + Math.Round(MoveInfo.StepSpan().TotalSeconds, 1) + "]秒";
LogUtil.error(msg + ",暂时放托盘离开");
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_14_TopDown);
InLog("放托盘(放开阻挡): " + MoveInfo.SLog + " 入库超时,放托盘离开,顶升气缸1下降");
CylinderMove(SecondMoveInfo, IO_Type.TopCylinder_UP, IO_Type.TopCylinder_Down);
......@@ -1131,9 +1136,10 @@ namespace OnlineStore.DeviceLibrary
}
else if (SecondMoveInfo.IsTimeOut(120))
{
WarnMsg = MoveInfo.Name + "[" + MoveInfo.MoveType + "][" + MoveInfo.SLog + "]等待分流横移1空闲[" + Math.Round(MoveInfo.StepSpan().TotalSeconds, 1) + "]秒";
LogUtil.error(WarnMsg, DeviceID * 1000 + 12);
Alarm(LineAlarmType.IoSingleTimeOut);
MoveTimeoutAlarm(SecondMoveInfo, "等待分流横移1空闲");
//WarnMsg = SecondMoveInfo.Name + "[" + SecondMoveInfo.MoveType + "][" + SecondMoveInfo.SLog + "]等待分流横移1空闲[" + Math.Round(SecondMoveInfo.StepSpan().TotalSeconds, 1) + "]秒";
//LogUtil.error(WarnMsg, DeviceID * 1000 + 12);
//Alarm(LineAlarmType.IoSingleTimeOut);
}
}
......
......@@ -133,6 +133,7 @@ namespace OnlineStore.DeviceLibrary
CylinderMove(MoveInfo, IO_Type.ClampCylinder_Slack, IO_Type.ClampCylinder_Tighten);
break;
case LineMoveStep.MH_OtherCylinderBack:
RunLogUtil.MoveEndLog(new MoveEndLog(Name, "复位", MoveInfo.MoveStartTime, DateTime.Now));
MoveInfo.EndMove();
SecondMoveInfo.EndMove();
LogInfo(MoveInfo.MoveType + " 完成!");
......
......@@ -423,8 +423,9 @@ namespace OnlineStore.DeviceLibrary
}
else if(SecondMoveInfo.IsTimeOut(30))
{
WarnMsg = Name + TrayDisableManager.ProWarnMsg+ "[" + currTrayNum + "], 请处理并启用托盘,已超时[" + Math.Round(MoveInfo.StepSpan().TotalSeconds, 1) + "]秒";
LogUtil.error(WarnMsg, DeviceID * 1000 + 20);
MoveTimeoutAlarm(SecondMoveInfo, "等待处理并启用托盘超时");
//WarnMsg = Name + TrayDisableManager.ProWarnMsg+ "[" + currTrayNum + "], 请处理并启用托盘,已超时[" + Math.Round(MoveInfo.StepSpan().TotalSeconds, 1) + "]秒";
//LogUtil.error(WarnMsg, DeviceID * 1000 + 20);
}
else
{
......@@ -639,10 +640,10 @@ namespace OnlineStore.DeviceLibrary
PO_07_CylinderBefore();
}
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.PO_05_ClampCheck))
{
PO_07_CylinderBefore();
}
//else if (MoveInfo.MoveStep.Equals(LineMoveStep.PO_05_ClampCheck))
//{
// PO_07_CylinderBefore();
//}
//else if (MoveInfo.MoveStep.Equals(LineMoveStep.PO_06_WaitBox))
//{
// MoveInfo.NextMoveStep(LineMoveStep.PO_07_CylinderBefore);
......@@ -681,9 +682,10 @@ namespace OnlineStore.DeviceLibrary
}
else if (MoveInfo.IsTimeOut())
{
WarnMsg = MoveInfo.Name + "[" + MoveInfo.MoveType + "][" + MoveInfo.MoveStep + "]等待 皮带线可放料 " + "超时[" + Math.Round(MoveInfo.StepSpan().TotalSeconds, 1) + "]秒";
LogUtil.error(WarnMsg, DeviceID * 1000 + 20);
Alarm(LineAlarmType.IoSingleTimeOut);
MoveTimeoutAlarm(MoveInfo, "等待皮带线可放料超时");
//WarnMsg = MoveInfo.Name + "[" + MoveInfo.MoveType + "][" + MoveInfo.MoveStep + "]等待 皮带线可放料 " + "超时[" + Math.Round(MoveInfo.StepSpan().TotalSeconds, 1) + "]秒";
//LogUtil.error(WarnMsg, DeviceID * 1000 + 20);
//Alarm(LineAlarmType.IoSingleTimeOut);
}
}
else
......@@ -707,14 +709,16 @@ namespace OnlineStore.DeviceLibrary
{
if (afterPutCutOK)
{
RunLogUtil.MoveEndLog(new MoveEndLog(Name, "出库", MoveInfo.MoveStartTime, DateTime.Now, MoveInfo.MoveParam.PosId, MoveInfo.MoveParam.WareCode));
OutLog("出料【" + posId + "】处理完成!");
MoveEndS();
}
else if (MoveInfo.IsTimeOut(60))
{
WarnMsg = MoveInfo.Name + "[" + MoveInfo.MoveType + "][" + MoveInfo.MoveStep + "]等待 给服务器发送afterPutCutTask完成 " + "超时[" + Math.Round(MoveInfo.StepSpan().TotalSeconds, 1) + "]秒";
LogUtil.error(WarnMsg, DeviceID * 1000 + 20);
Alarm(LineAlarmType.IoSingleTimeOut);
MoveTimeoutAlarm(MoveInfo, "等待给服务器发送afterPutCutTask完成超时");
//WarnMsg = MoveInfo.Name + "[" + MoveInfo.MoveType + "][" + MoveInfo.MoveStep + "]等待 给服务器发送afterPutCutTask完成 " + "超时[" + Math.Round(MoveInfo.StepSpan().TotalSeconds, 1) + "]秒";
//LogUtil.error(WarnMsg, DeviceID * 1000 + 20);
//Alarm(LineAlarmType.IoSingleTimeOut);
}
}
}
......
......@@ -3,6 +3,7 @@ using OnlineStore.DeviceLibrary;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
......@@ -36,6 +37,9 @@ namespace OnlineStore.DeviceLibrary
public DateTime LastSetpTime { get; set; }
public DateTime MoveStartTime { get; set; }
/// <summary>
/// =true表示满足一个等待条件,就可以完成此步骤的等待
/// </summary>
......@@ -82,6 +86,22 @@ namespace OnlineStore.DeviceLibrary
{
get { return moveStep; }
}
public string GetStepDes()
{
string currName = moveStep.ToString();
try
{
if (LineManager.StepDesMap.ContainsKey(currName))
{
return LineManager.StepDesMap[currName];
}
}
catch (Exception ex)
{
LogUtil.error("GetStepDes 出错:" + ex.ToString());
}
return currName;
}
public string SLog
{
get { return " "+MoveStep + " "; }
......@@ -100,8 +120,31 @@ namespace OnlineStore.DeviceLibrary
TimeSpan span = DateTime.Now - LastSetpTime;
return span;
}
public string GetMoveType()
{
switch (moveType)
{
case LineMoveType.CheckFixture:
return "托盘处理";
break;
case LineMoveType.InStore:
return "入料";
break;
case LineMoveType.OutStore:
return "出料";
break;
case LineMoveType.Reset :
return "复位";
break;
case LineMoveType.ReturnHome:
return "回原";
break;
}
return "";
}
public void NextMoveStep(LineMoveStep step)
{
StepMoveLog();
PreMoveStep = moveStep;
moveStep = step;
LastSetpTime = DateTime.Now;
......@@ -111,6 +154,18 @@ namespace OnlineStore.DeviceLibrary
OneWaitCanEndStep = false;
CanWhileCount = 5;
}
private void StepMoveLog()
{
try
{
RunLogUtil.MoveLog(new MoveLog(Name, GetMoveType(), GetStepDes(), LastSetpTime, DateTime.Now, MoveParam.PosId, MoveParam.WareCode));
}
catch (Exception ex)
{
}
}
/// <summary>
/// 当前步骤执行完成
/// </summary>
......@@ -128,6 +183,7 @@ namespace OnlineStore.DeviceLibrary
WaitList = new List<WaitResultInfo>();
WriteIoList = new List<WriteIOInfo>();
MoveNum++;
MoveStartTime = DateTime.Now;
}
public void NewMove(LineMoveType type, InOutParam param)
{
......@@ -137,9 +193,11 @@ namespace OnlineStore.DeviceLibrary
LastSetpTime = DateTime.Now;
WaitList = new List<WaitResultInfo>();
WriteIoList = new List<WriteIOInfo>();
MoveStartTime = DateTime.Now;
}
public void EndMove()
{
StepMoveLog();
this.moveType = LineMoveType.None;
this.MoveParam = null;
moveStep = LineMoveStep.Wait;
......@@ -217,40 +275,40 @@ namespace OnlineStore.DeviceLibrary
wait.IsEnd = false;
return wait;
}
public static WaitResultInfo WaitStell(byte slvAddr, int targetPosition, int speed)
{
WaitResultInfo wait = new WaitResultInfo();
wait.CanWhileMoveCount =10;
wait.WaitType = WaitEnum.W004_StellMove;
wait.SlvAddr = slvAddr;
wait.IsHomeMove = false;
wait.TargetPosition = targetPosition;
wait.TargetSpeed = speed;
wait.IsEnd = false;
return wait;
}
public static WaitResultInfo WaitStellHome(byte slvAddr, int targetPosition, int speed)
{
WaitResultInfo wait = new WaitResultInfo();
wait.CanWhileMoveCount = 10;
wait.WaitType = WaitEnum.W004_StellMove;
wait.SlvAddr = slvAddr;
wait.IsHomeMove = true;
wait.TargetPosition = 0;
wait.TargetSpeed = speed;
wait.IsEnd = false;
return wait;
}
public static WaitResultInfo WaitShuoKe(int slvAddr, int targetPosition, bool isHome)
{
WaitResultInfo wait = new WaitResultInfo();
wait.CanWhileMoveCount = 0;
wait.WaitType = WaitEnum.W005_ShuoKe;
wait.SlvAddr =(byte) slvAddr;
wait.TargetPosition = targetPosition;
wait.IsHomeMove = isHome;
return wait;
}
//public static WaitResultInfo WaitStell(byte slvAddr, int targetPosition, int speed)
//{
// WaitResultInfo wait = new WaitResultInfo();
// wait.CanWhileMoveCount =10;
// wait.WaitType = WaitEnum.W004_StellMove;
// wait.SlvAddr = slvAddr;
// wait.IsHomeMove = false;
// wait.TargetPosition = targetPosition;
// wait.TargetSpeed = speed;
// wait.IsEnd = false;
// return wait;
//}
// public static WaitResultInfo WaitStellHome(byte slvAddr, int targetPosition, int speed)
//{
// WaitResultInfo wait = new WaitResultInfo();
// wait.CanWhileMoveCount = 10;
// wait.WaitType = WaitEnum.W004_StellMove;
// wait.SlvAddr = slvAddr;
// wait.IsHomeMove = true;
// wait.TargetPosition = 0;
// wait.TargetSpeed = speed;
// wait.IsEnd = false;
// return wait;
//}
// public static WaitResultInfo WaitShuoKe(int slvAddr, int targetPosition, bool isHome)
// {
// WaitResultInfo wait = new WaitResultInfo();
// wait.CanWhileMoveCount = 0;
// wait.WaitType = WaitEnum.W005_ShuoKe;
// wait.SlvAddr =(byte) slvAddr;
// wait.TargetPosition = targetPosition;
// wait.IsHomeMove = isHome;
// return wait;
// }
public static WaitResultInfo WaitTime(int MScends)
{
WaitResultInfo wait = new WaitResultInfo();
......@@ -572,10 +630,6 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 移栽装置的停止,需要先远点返回,然后停止
/// </summary>
StopMove = 5,
///// <summary>
///// 移栽检测托盘
///// </summary>
//CheckFixture=6,
StopMove = 5,
}
}
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!