Commit dec60dc4 LN

1

1 个父辈 ce65c829
...@@ -493,26 +493,7 @@ namespace OnlineStore.Common ...@@ -493,26 +493,7 @@ namespace OnlineStore.Common
return putout; return putout;
} }
#endregion #endregion
#region 字节型转十六进制字符串
///// <summary>
///// 字节数组转16进制字符串
///// </summary>
///// <param name="bytes"></param>
///// <returns></returns>
//public static string byteToHexStr(byte[] bytes)
//{
// string returnStr = "";
// if (bytes != null)
// {
// for (int i = 0; i < bytes.Length; i++)
// {
// returnStr += bytes[i].ToString("X2");
// }
// }
// return returnStr;
//}
#endregion
#region 计算校验码 #region 计算校验码
......
...@@ -736,12 +736,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -736,12 +736,12 @@ namespace OnlineStore.DeviceLibrary
return airValue; return airValue;
} }
#region 扫码枪代码 #region 是否已经接收到过出库信息
/// <summary> /// <summary>
///是否已经接收到过出库信息 ///是否已经接收到过出库信息
///</summary> ///</summary>
public bool IsReviceInPosId(MoveEquip moveEquip, string posId) public bool IsReviceInPosId(MoveEquip moveEquip, string posId)
{ {
bool isReviceInfo = false; bool isReviceInfo = false;
if (moveEquip.MoveInfo.MoveType.Equals(LineMoveType.InStore) && moveEquip.MoveInfo.MoveParam != null && moveEquip.MoveInfo.MoveParam.PosId.Equals(posId)) if (moveEquip.MoveInfo.MoveType.Equals(LineMoveType.InStore) && moveEquip.MoveInfo.MoveParam != null && moveEquip.MoveInfo.MoveParam.PosId.Equals(posId))
...@@ -810,7 +810,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -810,7 +810,7 @@ namespace OnlineStore.DeviceLibrary
{ {
msg = moveEquip.Name + "下降阻挡气缸"; msg = moveEquip.Name + "下降阻挡气缸";
TimeSpan rwSpan = DateTime.Now - preRWTime; TimeSpan rwSpan = DateTime.Now - preRWTime;
if (span.TotalSeconds > LineManager.Config.IOSingle_TimerOut*2) if (span.TotalSeconds > LineManager.Config.IOSingle_TimerOut * 2)
{ {
SetWarnMsg(moveEquip.Name + "下降阻挡气缸超时,已等待" + FormUtil.GetSpanStr(span)); SetWarnMsg(moveEquip.Name + "下降阻挡气缸超时,已等待" + FormUtil.GetSpanStr(span));
LogUtil.error(moveEquip.Name + "下降阻挡气缸超时,已等待" + FormUtil.GetSpanStr(span), 112); LogUtil.error(moveEquip.Name + "下降阻挡气缸超时,已等待" + FormUtil.GetSpanStr(span), 112);
...@@ -819,7 +819,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -819,7 +819,7 @@ namespace OnlineStore.DeviceLibrary
{ {
preRWTime = DateTime.Now; preRWTime = DateTime.Now;
LogUtil.error(Name + "复位中:等待" + msg + "已【" + FormUtil.GetSpanStr(span) + "】重新调用OpenStopCylinder方法"); LogUtil.error(Name + "复位中:等待" + msg + "已【" + FormUtil.GetSpanStr(span) + "】重新调用OpenStopCylinder方法");
moveEquip.OpenStopCylinder(); moveEquip.OpenStopCylinder();
} }
isOk = false; isOk = false;
break; break;
...@@ -841,7 +841,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -841,7 +841,7 @@ namespace OnlineStore.DeviceLibrary
else else
{ {
//SetWarnMsg(moveEquip.Name + "在复位过程中报警,需要重新复位"); //SetWarnMsg(moveEquip.Name + "在复位过程中报警,需要重新复位");
LogUtil.error(Name+" "+ moveEquip.Name + "在复位过程中报警,需要重新复位,调用 moveEquip.Reset();"); LogUtil.error(Name + " " + moveEquip.Name + "在复位过程中报警,需要重新复位,调用 moveEquip.Reset();");
moveEquip.Reset(); moveEquip.Reset();
//如果小于80秒,继续等待 //如果小于80秒,继续等待
if (span.TotalSeconds < 70) if (span.TotalSeconds < 70)
...@@ -852,21 +852,21 @@ namespace OnlineStore.DeviceLibrary ...@@ -852,21 +852,21 @@ namespace OnlineStore.DeviceLibrary
} }
} }
} }
if (isOk) if (isOk)
{ {
if (WarnMsg.Contains("下降阻挡气缸超时")) if (WarnMsg.Contains("下降阻挡气缸超时"))
{ {
SetWarnMsg(""); SetWarnMsg("");
} }
// PreIsHasProcess = false; // PreIsHasProcess = false;
//打开流水线 //打开流水线
WriteDrivetMotorRun(IO_VALUE.HIGH); WriteDrivetMotorRun(IO_VALUE.HIGH);
//所有原点重置完成 //所有原点重置完成
runStatus = LineRunStatus.Runing; runStatus = LineRunStatus.Runing;
lineStatus = LineStatus.StoreOnline; lineStatus = LineStatus.StoreOnline;
MoveInfo.EndMove(); MoveInfo.EndMove();
LogUtil.info(Name + "所有移栽模块复位完成,打开流水线,开始运转,耗时 ["+FormUtil.GetSpanStr(span)+"]"); LogUtil.info(Name + "所有移栽模块复位完成,打开流水线,开始运转,耗时 [" + FormUtil.GetSpanStr(span) + "]");
} }
else if (span.TotalSeconds > 120) else if (span.TotalSeconds > 120)
{ {
......
...@@ -172,12 +172,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -172,12 +172,6 @@ namespace OnlineStore.DeviceLibrary
public override bool StartInStoreMove(InOutParam param) public override bool StartInStoreMove(InOutParam param)
{ {
string posId = param != null ? param.PosId : ""; string posId = param != null ? param.PosId : "";
////调试模式移栽装置不需要有操作
//if (IsDebug)
//{
// LogInfo("需要入库【" + posId + "】处于调试模式,暂时不再进行出入库操作");
// return false ;
//}
if (runStatus.Equals(LineRunStatus.Runing)) if (runStatus.Equals(LineRunStatus.Runing))
{ {
runStatus = LineRunStatus.Busy; runStatus = LineRunStatus.Busy;
...@@ -189,7 +183,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -189,7 +183,6 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000)); MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
UpdownDownP2Move(MoveInfo.MoveParam.PlateH); UpdownDownP2Move(MoveInfo.MoveParam.PlateH);
return true; return true;
// CylinderMove(MoveInfo, IO_Type.UpDownCylinder_Up, IO_Type.UpDownCylinder_Down);
} }
else else
{ {
......
...@@ -28,11 +28,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -28,11 +28,6 @@ namespace OnlineStore.DeviceLibrary
bool result = LineManager.Line.DLineStartOut(Config.DLineEquipNum, Config.DLineLineNum); bool result = LineManager.Line.DLineStartOut(Config.DLineEquipNum, Config.DLineLineNum);
wait.IsEnd = result; wait.IsEnd = result;
} }
//else if (wait.WaitType.Equals(WaitEnum.W009_BoxCanInstore))
//{
// int storeId = checkWaitInfo.MoveParam.GetStoreId();
// wait.IsEnd = LineServer.BoxCanReviceTray(storeId);
//}
return false; return false;
} }
private Stopwatch trayCheckWait = new Stopwatch(); private Stopwatch trayCheckWait = new Stopwatch();
...@@ -348,13 +343,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -348,13 +343,7 @@ namespace OnlineStore.DeviceLibrary
#region 料盘移栽处理 #region 料盘移栽处理
public override bool StartOutStoreMove(InOutParam param) public override bool StartOutStoreMove(InOutParam param)
{ {
string posId = param != null ? param.PosId : ""; string posId = param != null ? param.PosId : "";
//调试模式移栽装置不需要有操作
//if (IsDebug)
//{
// LogInfo("需要出料【" + posId + "】处于调试模式,暂时不再进行出出料操作");
// return false;
//}
if (runStatus.Equals(LineRunStatus.Runing)) if (runStatus.Equals(LineRunStatus.Runing))
{ {
runStatus = LineRunStatus.Busy; runStatus = LineRunStatus.Busy;
......
...@@ -11,20 +11,14 @@ using System.Windows.Forms; ...@@ -11,20 +11,14 @@ using System.Windows.Forms;
namespace OnlineStore.DeviceLibrary namespace OnlineStore.DeviceLibrary
{ {
public class RFIDManager public class RFIDManager
{ {
// public static Asa.RFID.RFIDReader RfidReader = new RFIDReader();
private static int DefaultTrayNum = ConfigAppSettings.GetIntValue(Setting_Init.DefaultTrayNum); private static int DefaultTrayNum = ConfigAppSettings.GetIntValue(Setting_Init.DefaultTrayNum);
static RFIDManager() static RFIDManager()
{ {
// RfidReader.GetValue += RfidReader_GetValue;
} }
public static void Open(string[] iparray) public static void Open(string[] iparray)
{ {
string path = Application.StartupPath + @"\logs\rfid\";
// RFIDManager.RfidReader.LogPath = path;
// string[] rfidArray = rfidList.ToArray();
//连接rfip
RFIDReader.Open(null, iparray); RFIDReader.Open(null, iparray);
} }
...@@ -73,11 +67,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -73,11 +67,11 @@ namespace OnlineStore.DeviceLibrary
} }
return 0; return 0;
} }
public static RFIDData GetShelfId(int subType ) public static RFIDData GetShelfId(int subType)
{ {
string ip = GetRFIP(subType, 1); string ip = GetRFIP(subType, 1);
RFIDData data= ReadRFID(ip,true); RFIDData data = ReadRFID(ip, true);
//此处料串为B料架 //此处料串为B料架
//bytedata = data.ToData(); //bytedata = data.ToData();
//if (data.RFType.Equals('B')) //if (data.RFType.Equals('B'))
...@@ -89,7 +83,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -89,7 +83,7 @@ namespace OnlineStore.DeviceLibrary
//} //}
return data; return data;
} }
public static RFIDData ReadRFID(string ip, bool isClear = false) public static RFIDData ReadRFID(string ip, bool isClear = false)
{ {
try try
...@@ -110,7 +104,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -110,7 +104,7 @@ namespace OnlineStore.DeviceLibrary
{ {
LogUtil.error("RFID [ " + ip + " ] 读到数据=null"); LogUtil.error("RFID [ " + ip + " ] 读到数据=null");
} }
RFIDData data = new RFIDData(bdata); RFIDData data = new RFIDData(bdata);
return data; return data;
} }
} }
...@@ -139,11 +133,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -139,11 +133,12 @@ namespace OnlineStore.DeviceLibrary
public static void Close() public static void Close()
{ {
try try
{ {
RFIDReader.CloseAll(); RFIDReader.CloseAll();
}catch(Exception ex) }
catch (Exception ex)
{ {
LogUtil.error("关闭RFID出错:",ex); LogUtil.error("关闭RFID出错:", ex);
} }
} }
} }
...@@ -158,9 +153,17 @@ namespace OnlineStore.DeviceLibrary ...@@ -158,9 +153,17 @@ namespace OnlineStore.DeviceLibrary
/// </summary> /// </summary>
public int Num = 0; public int Num = 0;
public RFIDData(int num, int t) public RFIDData(int num, int t)
{ {
this.RFType = (char)t; if (t < 65)
{
RFType = '0';
}
else
{
this.RFType = (char)t;
}
this.Num = num; this.Num = num;
} }
...@@ -170,7 +173,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -170,7 +173,14 @@ namespace OnlineStore.DeviceLibrary
{ {
if (data != null && data.Length > 2) if (data != null && data.Length > 2)
{ {
RFType = (char)data[1]; if (data[1] < 65)
{
RFType = '0';
}
else
{
RFType = (char)data[1];
}
Num = (int)(data[2]); Num = (int)(data[2]);
} }
} }
...@@ -179,6 +189,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -179,6 +189,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error("RFIP 数据【" + data + "】 获取编码失败"); LogUtil.error("RFIP 数据【" + data + "】 获取编码失败");
} }
} }
public byte[] ToData() public byte[] ToData()
{ {
return new byte[] { (byte)RFType, (byte)Num }; return new byte[] { (byte)RFType, (byte)Num };
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!