Commit b0174c0e 张东亮

临时出库不影响料串口

1 个父辈 e747d3a2
......@@ -281,5 +281,6 @@ namespace OnlineStore.Common
/// 温湿度列表
/// </summary>
public static string humiAndtempList = "humiAndtempList";
public static string singleOut = "singleOut";
}
}
......@@ -306,7 +306,7 @@ namespace OnlineStore.Common
}
if (num >= Overtime)
{
LogUtil.error(PortName + " 发送数据" + ByteToString(SendData) + "等待接受数据超时");
//LogUtil.error(PortName + " 发送数据" + ByteToString(SendData) + "等待接受数据超时");
}
if (_serialPort.BytesToRead >= ReceiveData.Length)
{
......@@ -390,7 +390,7 @@ namespace OnlineStore.Common
}
if (num >= Overtime)
{
LogUtil.error(PortName + " 发送数据" + ByteToString(SendData) + "等待接受数据超时");
// LogUtil.error(PortName + " 发送数据" + ByteToString(SendData) + "等待接受数据超时");
}
if (_serialPort.BytesToRead >= ReceiveData.Length)
{
......
......@@ -133,10 +133,13 @@ namespace OnlineStore.DeviceLibrary
public bool singleOut = false;
public string ToStr()
{
return " [" + barcode + "] [" + PosId + "] [" + PlateW + "x" + PlateH + "]"+ $",hSerial[{hSerial}]" +$",isNg[{IsNG}],NgMsg[{NgMsg}]"+ ",urgentReel [" + urgentReel
return " [" + barcode + "] [" + PosId + "] [" + PlateW + "x" + PlateH + "]"+ $",hSerial[{hSerial}]" +$",isNg[{IsNG}],NgMsg[{NgMsg}]"+ ",singleOut[" + singleOut + "]";
}
public string ToStr1()
{
return " [" + barcode + "] [" + PosId + "] [" + PlateW + "x" + PlateH + "]" + $",hSerial[{hSerial}]" + $",isNg[{IsNG}],NgMsg[{NgMsg}]" + ",urgentReel [" + urgentReel
+ "],cutReel [" + cutReel + "],smallReel [" + smallReel + "],rfid [" + rfid + "],rfidLoc [" + rfidLoc + "],singleOut[" + singleOut + "]";
}
public bool IsNG { get; set; } = false;
public string NgMsg { get; set; } = "";
......
......@@ -73,7 +73,7 @@ namespace OnlineStore.DeviceLibrary
isInProcess = false;
}
}
public bool SendStoreState(string posid,string barcode,DeviceStatus storeStatus)
public bool SendStoreState(string posid, string barcode, DeviceStatus storeStatus)
{
if (Monitor.TryEnter(serverLoc))
{
......@@ -98,7 +98,7 @@ namespace OnlineStore.DeviceLibrary
operation.boxStatus[1].status = (int)storeStatus;
LogUtil.info(JsonHelper.SerializeObject(operation));
Operation resultOperation = HttpHelper.Post(SServerManager.GetPostApi(server), operation, false);
if(resultOperation != null)
if (resultOperation != null)
{
if (operation.seq == resultOperation.seq)
{
......@@ -140,7 +140,7 @@ namespace OnlineStore.DeviceLibrary
if (WarnMsg != "")
{
lineOperation.status = (int)DeviceStatus.Warning;
lineOperation.msg =$"W={WarnMsg}";
lineOperation.msg = $"W={WarnMsg}";
}
lineOperation.status = (int)DeviceStatus.StoreOnline;
......@@ -362,9 +362,11 @@ namespace OnlineStore.DeviceLibrary
//int taskCount = FormUtil.GetIntData(data, ParamDefine.taskCount, 0);
string hSerials = "";
bool singleOut = false;
if (data.ContainsKey(ParamDefine.hSerial))
hSerials = data[ParamDefine.hSerial];
if (data.ContainsKey(ParamDefine.singleOut))
bool.TryParse(data[ParamDefine.singleOut], out singleOut);
//urgentReel: true 表示紧急料,需要出到料串上
//cutReel: true 表示分盘料,需要出到料串上
//smallReel: true 小料(7x8),放置到小料架上
......@@ -383,6 +385,7 @@ namespace OnlineStore.DeviceLibrary
InOutParam inoutParam = new InOutParam(new InOutPosInfo(barcode, posId, plateW, plateH, urgentReel));
inoutParam.PosInfo.hSerial = hSerials;
inoutParam.PosInfo.singleOut = singleOut;
//根据发送的posId获取位置列表
BoxPosition position = CSVPositionReader<BoxPosition>.GetPositon(posId);
if (position == null)
......@@ -405,7 +408,7 @@ namespace OnlineStore.DeviceLibrary
//判断排队列表中是否已存在
List<InOutParam> reviceList = new List<InOutParam>();
reviceList.AddRange(waitAOutStoreList);
// reviceList.AddRange(waitBOutStoreList);
// reviceList.AddRange(waitBOutStoreList);
reviceList = (from m in reviceList where m.PosInfo.PosId.Equals(posId) select m).ToList<InOutParam>();
if (reviceList.Count > 0)
{
......
......@@ -218,7 +218,7 @@ namespace OnlineStore.DeviceLibrary
sendData[7] = 0x00;
sendData = buildCheckData(sendData, sendData.Length - 2);
string str = AcSerialBean.byteToHexStr(sendData);
LogUtil.debug("温湿度控制器发送数据:" + str);
//LogUtil.debug("温湿度控制器发送数据:" + str);
byte[] reviceData = new byte[9];
bool isOk = false;
sb.SendCommand(sendData, ref reviceData, 100, out isOk);
......@@ -255,7 +255,7 @@ namespace OnlineStore.DeviceLibrary
sendData[7] = 0x00;
sendData = buildCheckData(sendData, sendData.Length - 2);
string str = AcSerialBean.byteToHexStr(sendData);
LogUtil.debug("温湿度控制器发送数据:" + str);
// LogUtil.debug("温湿度控制器发送数据:" + str);
byte[] reviceData = new byte[9];
bool isOk = false;
sb.SendCommand(sendData, ref reviceData, 100, out isOk);
......@@ -279,7 +279,7 @@ namespace OnlineStore.DeviceLibrary
sendData[7] = 0x00;
sendData = buildCheckData(sendData, sendData.Length - 2);
string str = AcSerialBean.byteToHexStr(sendData);
LogUtil.debug("温湿度控制器发送数据:" + str);
//LogUtil.debug("温湿度控制器发送数据:" + str);
byte[] reviceData = new byte[9];
bool isOk = false;
sb.SendCommand(sendData, ref reviceData, 100, out isOk);
......@@ -304,7 +304,7 @@ namespace OnlineStore.DeviceLibrary
sendData[7] = 0x00;
sendData = buildCheckData(sendData, sendData.Length - 2);
string str = AcSerialBean.byteToHexStr(sendData);
LogUtil.debug("温湿度控制器发送数据:" + str);
//LogUtil.debug("温湿度控制器发送数据:" + str);
byte[] reviceData = new byte[15];
bool isOk = false;
sb.SendCommand(sendData, ref reviceData, 100, out isOk);
......
using Asa;
using HuichuanLibrary;
using log4net.Util;
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
......@@ -582,23 +584,32 @@ namespace OnlineStore.DeviceLibrary
{
InOutParam param = new InOutParam(posInfo.ToCopy());
LogInfo($"{posType} 紧急物料{param.PosInfo.ToStr()},准备出库到紧急箱");
StartOutstore(param);
return true;
return StartOutstore(param);
}
else if (posInfo.IsNG)
{
InOutParam param = new InOutParam(posInfo.ToCopy());
LogInfo($"{posType}物料{param.PosInfo.ToStr()},准备出库到NG箱");
StartOutstore(param);
return true;
LogInfo($"{posType}物料{param.PosInfo.ToStr()},准备出库到NG箱");
return StartOutstore(param);
}
}
if (!posInfo.IsNG && string.IsNullOrEmpty(posInfo.hSerial))
{
return false;
}
else if(posInfo.IsNG)
{
return false;
}
else if (posInfo.singleOut)
{
return false;
}
foreach (BatchMoveBean moveBean in BatchMoveList)
{
if (moveBean.MoveInfo.MoveType.Equals(MoveType.Reset) || moveBean.MoveInfo.MoveType.Equals(MoveType.RHome))
continue;
LogUtil.debug($"{moveBean.Name} CheckStartOutPos 处理");
//LogUtil.debug($"{moveBean.Name} CheckStartOutPos 处理");
var curhSerial = moveBean.MoveInfo.MoveParam?.PosInfo?.hSerial ?? "";
if (!string.IsNullOrEmpty(curhSerial) && curhSerial != posInfo.hSerial)
{
......@@ -615,8 +626,10 @@ namespace OnlineStore.DeviceLibrary
{
InOutParam param = new InOutParam(posInfo.ToCopy());
param.ShelfType = moveBean.ShelfType;
LogInfo($"{posType}物料{param.PosInfo.ToStr()},准备出库到料串{param.ShelfType}");
StartOutstore(param);
if(StartOutstore(param))
{
LogInfo($"{posType}物料{param.PosInfo.ToStr()},准备出库到料串{param.ShelfType}");
}
return true;
}
if (moveBean.MoveInfo.MoveType == MoveType.None)
......@@ -659,7 +672,18 @@ namespace OnlineStore.DeviceLibrary
return true;
}
}
if (!posInfo.IsNG && string.IsNullOrEmpty(posInfo.hSerial))
{
return false;
}
else if (posInfo.IsNG)
{
return false;
}
else if(posInfo.singleOut)
{
return false;
}
foreach (BatchMoveBean moveBean in BatchMoveList)
{
// LogUtil.debug($"{moveBean.Name} CheckStartOutPos {moveBean.MoveInfo.MoveType}");
......@@ -682,8 +706,10 @@ namespace OnlineStore.DeviceLibrary
{
InOutParam param = new InOutParam(posInfo.ToCopy());
param.ShelfType = moveBean.ShelfType;
LogInfo($"{posType}物料{param.PosInfo.ToStr()},准备出库到料串{param.ShelfType}");
StartOutstore(param);
if(StartOutstore(param))
{
LogInfo($"{posType}物料{param.PosInfo.ToStr()},准备出库到料串{param.ShelfType}");
}
return true;
}
if (moveBean.MoveInfo.MoveType == MoveType.None)
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!