Commit 6cdc29a9 LN

入库时增加rfid参数

1 个父辈 bf17fbff
......@@ -39,7 +39,7 @@
<!--流水线监听端口-->
<add key="TCPServerPort" value="5246" />
<!--AGV调度服务器地址-->
<add key="AgvServerIp" value="192.168.103.12" />
<add key="AgvServerIp" value="10.80.160.20" />
<!--IO配置-->
<add key ="DIMS" value ="60"/>
<add key ="DOMS" value ="300"/>
......
......@@ -112,23 +112,8 @@ namespace OnlineStore.AssemblyLine
}
}
lblMoveInfo.Text = equipBean.GetMoveStr();
// string canOut = LineManager.Line.CanOutStore(equipBean.DeviceID) ? "可出库":"不可出库" ;
lblStoreStatus.Text = KTK_Store.GetRunStr(equipBean.lineStatus, equipBean.runStatus);
lblThisSta.Text = equipBean.WarnMsg;
//string text = "";
//List<InOutParam> ps = new List<InOutParam>(equipBean.waitOutStoreList);
//if (ps.Count > 0)
//{
// text = "等待出料列表:\r";
// foreach (InOutParam param in ps)
// {
// text += param.ToStr() + "\r";
// }
//}
//if (!lblInstoreList.Text.Equals(text))
//{
// lblInstoreList.Text = text;
//}
}
catch (Exception ex)
{
......
......@@ -250,5 +250,6 @@ namespace OnlineStore.Common
public static string rfidLoc = "rfidLoc";
public static string barcode = "barcode";
}
}
......@@ -702,7 +702,7 @@ namespace OnlineStore.DeviceLibrary
TrayManager.UpdateTrayInfo(currTrayNum, true, ReelType.InStore, param, "扫码失败");
}
//从服务器获取库位号
string result = SServerManager.CodeReceived(Name, currTrayNum, LastCodeList, LastHeight, LastWidth);
string result = SServerManager.CodeReceived(Name, currTrayNum, LastCodeList, LastHeight, LastWidth,CurrShelfId);
if (!result.Equals(""))
{
InOutParam param = new InOutParam(currTrayNum, code, "", LastHeight, LastWidth, true);
......
......@@ -196,7 +196,6 @@ namespace OnlineStore.DeviceLibrary
}
public void InitTimer()
{
ledProcessTimer = new System.Timers.Timer();
ledProcessTimer.Interval = 1000;
ledProcessTimer.Elapsed += LedProcess;
......@@ -296,10 +295,7 @@ namespace OnlineStore.DeviceLibrary
}
else
{
// Task.Factory.StartNew(delegate
//{
bool result = moveEquip.StartRun();
// });
Thread.Sleep(60);
}
}
......@@ -314,7 +310,6 @@ namespace OnlineStore.DeviceLibrary
isNoAirCheck = false;
TrayManager.TrayErrorMsg = "";
SetWarnMsg("");
PreIsHasProcess = true;
MoveInfo.NewMove(LineMoveType.Reset);
MoveInfo.NextMoveStep(LineMoveStep.Wait);
if (TrayManager.ErrorDeviceId > 0)
......@@ -391,9 +386,7 @@ namespace OnlineStore.DeviceLibrary
if (isNeedAllReset || TrayManager.ErrorDeviceId.Equals(equip.DeviceID) || (!NoAlarm()))
{
LogUtil.info(Name + "收到复位信号," + equip.Name + " 需要复位");
// Task.Factory.StartNew(delegate {
equip.Reset();
// });
Thread.Sleep(60);
}
else
......@@ -452,51 +445,6 @@ namespace OnlineStore.DeviceLibrary
IOMove(IO_Type.Alarm_HddLed, IO_VALUE.HIGH);
}
#region 休眠处理
private DateTime LastNoOperateTime = DateTime.Now;
public bool IsSleep = false;
private bool PreIsHasProcess = true;
private bool isHasProcess()
{
if (isInSuddenDown || isNoAirCheck)
{
return true;
}
if (!runStatus.Equals(LineRunStatus.Runing))
{
return true;
}
if (TrayManager.IsHasFullTray())
{
return true;
}
////判断是否有操作
//if (IOValue(IO_Type.InStore_TrayCheck1).Equals(IO_VALUE.HIGH) || IOValue(IO_Type.InStore_TrayCheck2).Equals(IO_VALUE.HIGH))
//{
// return true;
//}
if (MoveInfo.MoveType.Equals(LineMoveType.None).Equals(false))
{
return true;
}
if (SW41_MoveInfo.MoveType.Equals(LineMoveType.None).Equals(false))
{
return true;
}
if (SW23_MoveInfo.MoveType.Equals(LineMoveType.None).Equals(false))
{
return true;
}
foreach (EquipBase move in AllEquipMap.Values)
{
if (!move.IsDebug && (!move.runStatus.Equals(LineRunStatus.Runing)))
{
return true;
}
}
return false;
}
public void WriteDrivetMotorRun(IO_VALUE value)
{
......@@ -505,58 +453,7 @@ namespace OnlineStore.DeviceLibrary
IOMove(IO_Type.DriveMotor_Run3, value);
IOMove(IO_Type.DriveMotor_Run4, value);
}
private void UpdateSleep(bool isS)
{
if (isS != IsSleep)
{
if (isS)
{
LogUtil.info(Name + "***********更新为休眠状态");
WriteDrivetMotorRun(IO_VALUE.LOW);
}
else
{
LogUtil.info(Name + "***********更新为工作状态");
WriteDrivetMotorRun(IO_VALUE.HIGH);
}
}
IsSleep = isS;
}
private void SleepProcess()
{
////休眠处理
////判断所有的盘的都是空盘
//bool isHasO = isHasProcess();
//if (!isHasO)
//{
// if (IsSleep)
// {
// return;
// }
// if (PreIsHasProcess.Equals(isHasO))
// {
// //判断时间是否需要休眠
// TimeSpan span = DateTime.Now - LastNoOperateTime;
// if (span.TotalSeconds > Config.Sleep_MSeconds)
// {
// LogUtil.info( Name + "***********已经【" + span.TotalSeconds + "】秒没有操作了,开始进入休眠状态");
// UpdateSleep(true);
// }
// }
// else
// {
// PreIsHasProcess = isHasO;
// LastNoOperateTime = DateTime.Now;
// }
//}
//else
//{
// PreIsHasProcess = isHasO;
// UpdateSleep(false);
//}
}
#endregion
#region 灯光处理
private void LedProcess(object sender, ElapsedEventArgs e)
......@@ -564,7 +461,6 @@ namespace OnlineStore.DeviceLibrary
try
{
DateTime time = DateTime.Now;
SleepProcess();
//黄灯
if ( runStatus.Equals(LineRunStatus.HomeMoving) || runStatus.Equals(LineRunStatus.Reset))
......@@ -580,20 +476,20 @@ namespace OnlineStore.DeviceLibrary
}
}
//休眠状态黄灯常亮
else if (IsSleep)
{
if (IsDoValue(IO_Type.RunSign_HddLed, IO_VALUE.LOW))
{
IOMove(IO_Type.RunSign_HddLed, IO_VALUE.HIGH);
}
}
else
{
//else if (IsSleep)
//{
// if (IsDoValue(IO_Type.RunSign_HddLed, IO_VALUE.LOW))
// {
// IOMove(IO_Type.RunSign_HddLed, IO_VALUE.HIGH);
// }
//}
//else
//{
if (IsDoValue(IO_Type.RunSign_HddLed, IO_VALUE.HIGH))
{
IOMove(IO_Type.RunSign_HddLed, IO_VALUE.LOW);
}
}
//}
bool isNeedAlarmLed = false;
bool isInOut = false;
......@@ -681,23 +577,24 @@ namespace OnlineStore.DeviceLibrary
IO_VALUE airValue = CheckAir(airCheck, lastAir);
//急停按钮和气压检测按钮需要一起使用
if (suddenBtn .Equals( IO_VALUE.LOW))
if (suddenBtn.Equals(IO_VALUE.LOW))
{
Alarm(LineAlarmType.SuddenStop );
SetWarnMsg("收到急停信号,报警急停");
Alarm(LineAlarmType.SuddenStop);
}
if (fuweiValue.Equals(IO_VALUE.HIGH) && (!fuweiValue.Equals(lastFuwei)))
{
if (suddenBtn.Equals(IO_VALUE.LOW))
{
SetWarnMsg("收到复位信号但急停未开,不处理复位");
SetWarnMsg("收到复位信号但急停未开,不处理复位");
}
else if (airValue.Equals(IO_VALUE.LOW))
{
SetWarnMsg("收到复位信号但未检测到气压信号,不处理复位");
SetWarnMsg("收到复位信号但未检测到气压信号,不处理复位");
}
else
{
LogUtil.info( Name + "收到复位信号,开始复位!");
LogUtil.info(Name + "收到复位信号,开始复位!");
Reset();
}
}
......@@ -705,7 +602,7 @@ namespace OnlineStore.DeviceLibrary
}
catch (Exception ex)
{
LogUtil.error(Name + "定时检测报警出错:",ex);
LogUtil.error(Name + "定时检测报警出错:", ex);
}
Thread.Sleep(1);
}
......@@ -885,13 +782,9 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.EndMove();
WriteDrivetMotorRun(IO_VALUE.LOW);
//IOMove(IO_Type.NGCylinder_After, IO_VALUE.LOW);
//IOMove(IO_Type.NGCylinder_Before, IO_VALUE.LOW);
IOMove(IO_Type.SW4_MotorRun, IO_VALUE.LOW);
IOMove(IO_Type.SW4_TopCylinder_Down, IO_VALUE.LOW);
IOMove(IO_Type.SW4_TopCylinder_Up, IO_VALUE.LOW);
//IOMove(IO_Type.StopCylinder_Down1, IO_VALUE.LOW);
//IOMove(IO_Type.StopCylinder_Down2, IO_VALUE.LOW);
SideWayStop();
}
......@@ -966,7 +859,7 @@ namespace OnlineStore.DeviceLibrary
{
SetWarnMsg("");
}
PreIsHasProcess = false;
// PreIsHasProcess = false;
//打开流水线
WriteDrivetMotorRun(IO_VALUE.HIGH);
//所有原点重置完成
......
......@@ -176,9 +176,6 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error(checkWaitInfo.Name + " [" + checkWaitInfo.MoveStep + "] CheckWait 出错:",ex);
}
}
#endregion
......@@ -314,18 +311,11 @@ namespace OnlineStore.DeviceLibrary
sw41WaitWatch.Stop();
SW41_MoveInfo.EndMove();
SW23_MoveInfo.EndMove();
IOMove(IO_Type.SW1_MotorRun, IO_VALUE.LOW);
IOMove(IO_Type.SW2_MotorRun, IO_VALUE.LOW);
IOMove(IO_Type.SW3_MotorRun, IO_VALUE.LOW);
IOMove(IO_Type.SW4_MotorRun, IO_VALUE.LOW);
}
//private DateTime SideWay41Ntime = DateTime.Now;
//private bool SideWay41IsWait = false;
//private DateTime SideWay23Ntime = DateTime.Now;
//private bool SideWay23IsWait = false;
private Stopwatch sw41WaitWatch = new Stopwatch();
private Stopwatch sw23WaitWatch = new Stopwatch();
private bool sdIsInprocess = false;
......
......@@ -220,8 +220,8 @@ namespace OnlineStore.DeviceLibrary
{
CheckLog("托盘阻挡" + SecondMoveInfo.SLog + " ,等待编码信号稳定)");
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_04_Wait);
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500));
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(TrayManager.StopDownWaitTime));
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(100));
//SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(TrayManager.StopDownWaitTime));
}
else
{
......
......@@ -150,9 +150,9 @@ namespace OnlineStore.DeviceLibrary
public class RFIDData
{
/// <summary>
/// RFID类型,区分是料架还是托盘,托盘E=69,A=65
/// RFID类型,区分是料架还是托盘,托盘E=69,包装料料架A=65,料串=B
/// </summary>
public int RFType = 0;
public char RFType = 'E';
/// <summary>
/// 托盘编号,从1-32
/// </summary>
......@@ -160,7 +160,7 @@ namespace OnlineStore.DeviceLibrary
public RFIDData(int num, int t)
{
this.RFType = t;
this.RFType = (char)t;
this.Num = num;
}
......@@ -170,8 +170,8 @@ namespace OnlineStore.DeviceLibrary
{
if (data != null && data.Length > 2)
{
RFType = data[1];
Num = Convert.ToInt32(data[2]);
RFType = (char)data[1];
Num = (int)(data[2]);
}
}
catch (Exception ex)
......@@ -185,8 +185,7 @@ namespace OnlineStore.DeviceLibrary
}
public string NumStr()
{
return "" + (char)RFType + "" + ((int)Num).ToString().PadLeft(2, '0');
//return " [" + RFType + "],[" + Num + "] ";
return "" + RFType + "" + Num.ToString().PadLeft(2, '0') + "";
}
}
}
......@@ -47,7 +47,7 @@ namespace OnlineStore.DeviceLibrary
}
//##
private static string spiltStr = "##";
public static string CodeReceived(string deviceName, int trayNum, List<string> codeList, int height, int width)
public static string CodeReceived(string deviceName, int trayNum, List<string> codeList, int height, int width,string rfid)
{
string msg = "";
try
......@@ -75,10 +75,11 @@ namespace OnlineStore.DeviceLibrary
Dictionary<string, string> paramMap = new Dictionary<string, string>();
paramMap.Add("cids", LineServer.GetAllCID());
paramMap.Add("code", codeStr);
paramMap.Add(ParamDefine.rfid, rfid);
string server = GetAddr(Addr_PosForPutin, paramMap);
//string server = GetAddr(Addr_PosForPutin) + "?cids=" + LineServer.GetAllCID() + "&code=%3D" + codeStr;
LogUtil.info(deviceName + "托盘【" + trayNum + "】 条码<< " + codeStr + ",获取入库PosID:");
LogUtil.info(deviceName + "托盘【" + trayNum + "】 条码【 " + codeStr + "】料串【"+rfid+"】,获取入库库位:");
string resultStr = HttpHelper.Post(server, "");
LogUtil.info("CodeReceived 【" + server + "】【" + resultStr + "】");
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!