Commit 90ed9115 张东亮

添加呼叫AGV按钮状态、更改上报出入库状态、添加校准库位缓存(FixBuffInfo)以在启动时进行检查状态

1 个父辈 ab64b6d5
...@@ -31,5 +31,9 @@ namespace OnlineStore.Common ...@@ -31,5 +31,9 @@ namespace OnlineStore.Common
public static string QRCodeCount = "QRCodeCount"; public static string QRCodeCount = "QRCodeCount";
public static string CodeTimeOut = "CodeTimeOut"; public static string CodeTimeOut = "CodeTimeOut";
/// <summary>
/// 校准库位的料盘信息
/// </summary>
public static string FixBuffInfo = "FixBuffInfo";
} }
} }
...@@ -291,5 +291,22 @@ namespace OnlineStore.Common ...@@ -291,5 +291,22 @@ namespace OnlineStore.Common
public static string disable = "disable"; public static string disable = "disable";
public static string queueTaskCount="queueTaskCount"; public static string queueTaskCount="queueTaskCount";
/// <summary>
/// 贴标机交互按钮,出口 满料串取出
/// </summary>
public static string SendFullShelf = "SendFullShelf";
/// <summary>
/// 贴标机交互按钮,出口 空料串送入
/// </summary>
public static string NeedEmptySHelf = "NeedEmptySHelf";
/// <summary>
/// 贴标机交互按钮,入口 满料串送入
/// </summary>
public static string NeedFullShelf = "NeedFullShelf";
/// <summary>
/// 贴标机交互按钮,入口 空料串取出
/// </summary>
public static string SendEmptyShelf = "SendEmptyShelf";
} }
} }
...@@ -14,10 +14,12 @@ namespace DeviceLibrary ...@@ -14,10 +14,12 @@ namespace DeviceLibrary
partial class ServerCommunication partial class ServerCommunication
{ {
volatile StoreStatus _storeStatus = StoreStatus.Debugging; volatile StoreStatus _storeStatus = StoreStatus.Debugging;
public StoreStatus storeStatus { public StoreStatus storeStatus
{
get => _storeStatus; get => _storeStatus;
set { set
if (_storeStatus!= value) {
if (_storeStatus != value)
LogUtil.info($"set storeStatus to {value}"); LogUtil.info($"set storeStatus to {value}");
_storeStatus = value; _storeStatus = value;
} }
...@@ -25,13 +27,14 @@ namespace DeviceLibrary ...@@ -25,13 +27,14 @@ namespace DeviceLibrary
static string server = ConfigHelper.Config.Get("http_server"); static string server = ConfigHelper.Config.Get("http_server");
static string CID = ConfigHelper.Config.Get("CID"); static string CID = ConfigHelper.Config.Get("CID");
int StoreID = 1; int StoreID = 1;
string StoreName=""; string StoreName = "";
string WarnMsg = ""; string WarnMsg = "";
private System.Timers.Timer serverConnectTimer = new System.Timers.Timer(); private System.Timers.Timer serverConnectTimer = new System.Timers.Timer();
object serverclock = new object(); object serverclock = new object();
public ServerCommunication() { public ServerCommunication()
{
serverConnectTimer.Interval = 1000; serverConnectTimer.Interval = 1000;
serverConnectTimer.AutoReset = true; serverConnectTimer.AutoReset = true;
serverConnectTimer.Enabled = true; serverConnectTimer.Enabled = true;
...@@ -65,17 +68,22 @@ namespace DeviceLibrary ...@@ -65,17 +68,22 @@ namespace DeviceLibrary
{ {
LogUtil.info($"ServerConnectTimer_Elapsed:{ex}"); LogUtil.info($"ServerConnectTimer_Elapsed:{ex}");
} }
finally { finally
{
//Monitor.Exit(serverConnectTimer); //Monitor.Exit(serverConnectTimer);
} }
} }
public void StartConnectServer() { public void StartConnectServer()
{
//serverConnectTimer.Enabled = true; //serverConnectTimer.Enabled = true;
}public void StopConnectServer() { }
public void StopConnectServer()
{
//serverConnectTimer.Enabled = false; //serverConnectTimer.Enabled = false;
} }
public void ProcessMsg(List<Msg> msg) { public void ProcessMsg(List<Msg> msg)
{
WarnMsg = string.Join(",", msg.Select(x => WarnMsg = string.Join(",", msg.Select(x =>
{ {
if (x.msgLevel == MsgLevel.warning || x.msgLevel == MsgLevel.alarm) if (x.msgLevel == MsgLevel.warning || x.msgLevel == MsgLevel.alarm)
...@@ -84,9 +92,10 @@ namespace DeviceLibrary ...@@ -84,9 +92,10 @@ namespace DeviceLibrary
} }
return null; return null;
} }
).Where(x=>!string.IsNullOrEmpty(x))); ).Where(x => !string.IsNullOrEmpty(x)));
} }
public void SendInStoreRequest(string[] codelist, ReelParam reel,bool printlog=false) { public void SendInStoreRequest(string[] codelist, ReelParam reel, bool printlog = false)
{
if (RobotManage.InoutDebugMode) if (RobotManage.InoutDebugMode)
return; return;
...@@ -97,7 +106,7 @@ namespace DeviceLibrary ...@@ -97,7 +106,7 @@ namespace DeviceLibrary
operation.op = 1; operation.op = 1;
operation.data = new Dictionary<string, string>() { { "code", code }, { "boxId", StoreID.ToString() }, { "doorReelSignal", "1" } }; operation.data = new Dictionary<string, string>() { { "code", code }, { "boxId", StoreID.ToString() }, { "doorReelSignal", "1" } };
if (reel.PlateH==100 && ConfigHelper.Config.Get("Device_SingleInSingleOut",false)) if (reel.PlateH == 100 && ConfigHelper.Config.Get("Device_SingleInSingleOut", false))
{ {
//singleIn 单盘入库 //singleIn 单盘入库
operation.data.Add("singleIn", "true"); operation.data.Add("singleIn", "true");
...@@ -123,8 +132,13 @@ namespace DeviceLibrary ...@@ -123,8 +132,13 @@ namespace DeviceLibrary
Operation operation = getLineBoxStatus(); Operation operation = getLineBoxStatus();
if (!string.IsNullOrEmpty(posid)) if (!string.IsNullOrEmpty(posid))
operation.boxStatus[StoreID].data.Add(ParamDefine.posId, posid); operation.boxStatus[StoreID].data.Add(ParamDefine.posId, posid);
if (storeStatus == StoreStatus.OutStoreEnd ||
operation.boxStatus[StoreID].status = (int)storeStatus; storeStatus == StoreStatus.OutStoreBoxEnd ||
storeStatus == StoreStatus.InStoreEnd)
{
}
else
operation.boxStatus[StoreID].status = (int)storeStatus;
LogUtil.info(JsonHelper.SerializeObject(operation)); LogUtil.info(JsonHelper.SerializeObject(operation));
if (RobotManage.InoutDebugMode) if (RobotManage.InoutDebugMode)
...@@ -136,7 +150,8 @@ namespace DeviceLibrary ...@@ -136,7 +150,8 @@ namespace DeviceLibrary
LogUtil.info($"SendStoreState error,posid:{posid}, storeStatus:{storeStatus}"); LogUtil.info($"SendStoreState error,posid:{posid}, storeStatus:{storeStatus}");
return false; return false;
} }
if (operation.seq != resultOperation.seq) { if (operation.seq != resultOperation.seq)
{
LogUtil.info($"SendStoreState seq error,posid:{posid}, storeStatus:{storeStatus}"); LogUtil.info($"SendStoreState seq error,posid:{posid}, storeStatus:{storeStatus}");
return false; return false;
} }
...@@ -144,26 +159,29 @@ namespace DeviceLibrary ...@@ -144,26 +159,29 @@ namespace DeviceLibrary
LogUtil.info($"SendStoreState success,posid:{posid}, storeStatus:{storeStatus}"); LogUtil.info($"SendStoreState success,posid:{posid}, storeStatus:{storeStatus}");
ResultProcess(resultOperation); ResultProcess(resultOperation);
if (storeStatus == StoreStatus.OutStoreEnd || //if (storeStatus == StoreStatus.OutStoreEnd ||
storeStatus == StoreStatus.OutStoreBoxEnd || // storeStatus == StoreStatus.OutStoreBoxEnd ||
storeStatus == StoreStatus.InStoreEnd) // storeStatus == StoreStatus.InStoreEnd)
//{
// this.storeStatus = StoreStatus.StoreOnline;
//}
if (RobotManage.mainMachine.StringMoveInfo.MoveStep == MoveStep.StringOut_Released)
{ {
this.storeStatus = StoreStatus.StoreOnline; this.storeStatus = StoreStatus.StoreOnline;
} }
} }
return true; return true;
} }
public string spiltStr = "##"; public string spiltStr = "##";
private string ProcessCode(string[] codeList,int reelw,int reelh) private string ProcessCode(string[] codeList, int reelw, int reelh)
{ {
string message = ""; string message = "";
//= 7x12 = CODE //= 7x12 = CODE
foreach (string str in codeList) foreach (string str in codeList)
{ {
string code = str.Replace("\r",""); string code = str.Replace("\r", "");
code = code.Replace("\n",""); code = code.Replace("\n", "");
//根据二维码开头获取固定尺寸 //根据二维码开头获取固定尺寸
string codeSize = $"{reelw}x{reelh}"; string codeSize = $"{reelw}x{reelh}";
message = message + "=" + "1+0x0-" + codeSize + "=" + code + spiltStr; message = message + "=" + "1+0x0-" + codeSize + "=" + code + spiltStr;
...@@ -185,7 +203,7 @@ namespace DeviceLibrary ...@@ -185,7 +203,7 @@ namespace DeviceLibrary
lineOperation.status = 1; lineOperation.status = 1;
lineOperation.data = new Dictionary<string, string>(); lineOperation.data = new Dictionary<string, string>();
lineOperation.data=lineOperation.data.Concat(GetBtnStatus()).ToDictionary(x=>x.Key,v=>v.Value); lineOperation.data = lineOperation.data.Concat(GetBtnStatus()).ToDictionary(x => x.Key, v => v.Value);
lineOperation.data = lineOperation.data.Concat(AgvStatus()).ToDictionary(x => x.Key, v => v.Value); lineOperation.data = lineOperation.data.Concat(AgvStatus()).ToDictionary(x => x.Key, v => v.Value);
lineOperation.status = (int)storeStatus; lineOperation.status = (int)storeStatus;
...@@ -220,14 +238,15 @@ namespace DeviceLibrary ...@@ -220,14 +238,15 @@ namespace DeviceLibrary
else if (!string.IsNullOrEmpty(WarnMsg)) else if (!string.IsNullOrEmpty(WarnMsg))
{ {
sendmsg = string.Join(",", new string[] { WarnMsg }); sendmsg = string.Join(",", new string[] { WarnMsg });
//lineOperation.msgData["zh"] = lineOperation.msg; //lineOperation.msgData["zh"] = lineOperation.msg;
//lineOperation.msgData["en"] = lineOperation.msg; //lineOperation.msgData["en"] = lineOperation.msg;
//lineOperation.msgData["jp"] = lineOperation.msg; //lineOperation.msgData["jp"] = lineOperation.msg;
//lineOperation.status = (int)StoreStatus.Warning; //lineOperation.status = (int)StoreStatus.Warning;
} }
else if (!RobotManage.isRunning){ else if (!RobotManage.isRunning)
sendmsg = crc.GetString("Res0001","设备未启动"); {
sendmsg = crc.GetString("Res0001", "设备未启动");
} }
lineOperation.msg = sendmsg; lineOperation.msg = sendmsg;
...@@ -293,13 +312,14 @@ namespace DeviceLibrary ...@@ -293,13 +312,14 @@ namespace DeviceLibrary
} }
} }
if (lineOperation.status != laststatus) { if (lineOperation.status != laststatus)
{
laststatus = lineOperation.status; laststatus = lineOperation.status;
printlog = true; printlog = true;
} }
Operation resultOperation = HttpHelper.Post(GetPostApi(), lineOperation,700, printlog); Operation resultOperation = HttpHelper.Post(GetPostApi(), lineOperation, 700, printlog);
if (resultOperation != null) if (resultOperation != null)
getthtime = 0; getthtime = 0;
//LogUtil.info(JsonHelper.SerializeObject(resultOperation.data)); //LogUtil.info(JsonHelper.SerializeObject(resultOperation.data));
...@@ -311,7 +331,7 @@ namespace DeviceLibrary ...@@ -311,7 +331,7 @@ namespace DeviceLibrary
} }
} }
} }
public int queueTaskCount=-1; public int queueTaskCount = -1;
ConcurrentQueue<string> commandResultMsg = new ConcurrentQueue<string>(); ConcurrentQueue<string> commandResultMsg = new ConcurrentQueue<string>();
void ResultProcess(Operation resultOperation) void ResultProcess(Operation resultOperation)
{ {
...@@ -344,7 +364,7 @@ namespace DeviceLibrary ...@@ -344,7 +364,7 @@ namespace DeviceLibrary
AgvProcess(dataMap); AgvProcess(dataMap);
string result = ""; string result = "";
if (dataMap.ContainsKey(ParamDefine.queueTaskCount)) if (dataMap.ContainsKey(ParamDefine.queueTaskCount))
{ {
...@@ -406,8 +426,8 @@ namespace DeviceLibrary ...@@ -406,8 +426,8 @@ namespace DeviceLibrary
} }
...@@ -421,7 +441,7 @@ namespace DeviceLibrary ...@@ -421,7 +441,7 @@ namespace DeviceLibrary
map.Add(ParamDefine.confirmReelOut, ParamDefine.disable); map.Add(ParamDefine.confirmReelOut, ParamDefine.disable);
map.Add(ParamDefine.singleReelIn, ParamDefine.disable); map.Add(ParamDefine.singleReelIn, ParamDefine.disable);
if (storeStatus == StoreStatus.ResetMove if (storeStatus == StoreStatus.ResetMove
|| storeStatus == StoreStatus.SuddenStop || storeStatus == StoreStatus.SuddenStop
|| storeStatus == StoreStatus.Debugging || storeStatus == StoreStatus.Debugging
) )
...@@ -429,7 +449,7 @@ namespace DeviceLibrary ...@@ -429,7 +449,7 @@ namespace DeviceLibrary
if (//RobotManage.mainMachine.IOValue(IO_Type.StringDoor_Close).Equals(IO_VALUE.HIGH) && if (//RobotManage.mainMachine.IOValue(IO_Type.StringDoor_Close).Equals(IO_VALUE.HIGH) &&
(RobotManage.mainMachine.StringMoveInfo.MoveStep == MoveStep.StringOut_Released (RobotManage.mainMachine.StringMoveInfo.MoveStep == MoveStep.StringOut_Released
|| RobotManage.mainMachine.StringMoveInfo.MoveStep == MoveStep.Wait)) || RobotManage.mainMachine.StringMoveInfo.MoveStep == MoveStep.Wait))
{ {
//map.Add(ParamDefine.doorStatus, "料串门关闭"); //map.Add(ParamDefine.doorStatus, "料串门关闭");
...@@ -440,7 +460,7 @@ namespace DeviceLibrary ...@@ -440,7 +460,7 @@ namespace DeviceLibrary
map[ParamDefine.closeLock] = ParamDefine.enable; map[ParamDefine.closeLock] = ParamDefine.enable;
//map.Add(ParamDefine.doorStatus, "料串门打开"); //map.Add(ParamDefine.doorStatus, "料串门打开");
} }
if (RobotManage.mainMachine.StringMoveInfo.MoveStep >= MoveStep.StringLoad_04 if (RobotManage.mainMachine.StringMoveInfo.MoveStep >= MoveStep.StringLoad_04
&& RobotManage.mainMachine.StringMoveInfo.MoveStep < MoveStep.StringOut_01) && RobotManage.mainMachine.StringMoveInfo.MoveStep < MoveStep.StringOut_01)
map[ParamDefine.takeOutReel] = ParamDefine.enable; map[ParamDefine.takeOutReel] = ParamDefine.enable;
...@@ -449,9 +469,31 @@ namespace DeviceLibrary ...@@ -449,9 +469,31 @@ namespace DeviceLibrary
map[ParamDefine.confirmReelOut] = ParamDefine.enable; map[ParamDefine.confirmReelOut] = ParamDefine.enable;
} }
if (RobotManage.mainMachine.StringType== MainMachine.StringTypeE.Out || RobotManage.mainMachine.StringMoveInfo.MoveStep==MoveStep.Wait) { if (RobotManage.mainMachine.StringType == MainMachine.StringTypeE.Out || RobotManage.mainMachine.StringMoveInfo.MoveStep == MoveStep.Wait)
{
map[ParamDefine.singleReelIn] = ParamDefine.enable; map[ParamDefine.singleReelIn] = ParamDefine.enable;
} }
//mimo呼叫agv按钮
map.Add(ParamDefine.SendEmptyShelf, ParamDefine.disable);
map.Add(ParamDefine.SendFullShelf, ParamDefine.disable);
map.Add(ParamDefine.NeedEmptySHelf, ParamDefine.disable);
map.Add(ParamDefine.NeedFullShelf, ParamDefine.disable);
if (RobotManage.mainMachine.StringState == MainMachine.StringStateE.None)
{
map[ParamDefine.NeedEmptySHelf] = ParamDefine.enable;
map[ParamDefine.NeedFullShelf] = ParamDefine.enable;
}
if (RobotManage.mainMachine.StringMoveInfo.MoveStep == MoveStep.StringOut_Released)
{
if (RobotManage.mainMachine.StringState == MainMachine.StringStateE.Full)
{
map[ParamDefine.SendFullShelf] = ParamDefine.enable;
}
else
{
map[ParamDefine.SendEmptyShelf] = ParamDefine.enable;
}
}
return map; return map;
} }
...@@ -486,7 +528,7 @@ namespace DeviceLibrary ...@@ -486,7 +528,7 @@ namespace DeviceLibrary
{ {
//出入库没有找到服务器发送的库位,需要打印日志方便查询原因 //出入库没有找到服务器发送的库位,需要打印日志方便查询原因
//SetWarnMsg(ResourceControl.InStoreNoPosition, message, posId); //SetWarnMsg(ResourceControl.InStoreNoPosition, message, posId);
WarnMsg = crc.GetString(L.in_store_nothave_position,"入库未找到库位:") + posId;//0505 WarnMsg = crc.GetString(L.in_store_nothave_position, "入库未找到库位:") + posId;//0505
LogUtil.info("收到服务器入库命令:入库未找到库位:二维码【" + message + "】库位【" + posId + "】"); LogUtil.info("收到服务器入库命令:入库未找到库位:二维码【" + message + "】库位【" + posId + "】");
return; return;
} }
...@@ -512,10 +554,11 @@ namespace DeviceLibrary ...@@ -512,10 +554,11 @@ namespace DeviceLibrary
SendStoreState("", StoreStatus.InStoreError); SendStoreState("", StoreStatus.InStoreError);
//RobotManage.mainMachine.ClampMoveInfo.NextMoveStep(MoveStep.NGOUT_01); //RobotManage.mainMachine.ClampMoveInfo.NextMoveStep(MoveStep.NGOUT_01);
RobotManage.mainMachine.NGPuted(msg); RobotManage.mainMachine.NGPuted(msg);
LogUtil.info("服务器没有正确返回库位. msg="+ msg); LogUtil.info("服务器没有正确返回库位. msg=" + msg);
} }
else { else
{
} }
} }
...@@ -535,13 +578,13 @@ namespace DeviceLibrary ...@@ -535,13 +578,13 @@ namespace DeviceLibrary
{ {
string maxHumidity = data[ParamDefine.maxHumidity]; string maxHumidity = data[ParamDefine.maxHumidity];
string maxTemp = data[ParamDefine.maxTemperature]; string maxTemp = data[ParamDefine.maxTemperature];
LogUtil.info( "收到服务器温湿度预警值:maxHumidity=" + maxHumidity + ",maxTemperature=" + maxTemp); LogUtil.info("收到服务器温湿度预警值:maxHumidity=" + maxHumidity + ",maxTemperature=" + maxTemp);
try try
{ {
this.Max_Humidity = (float)Convert.ToDouble(maxHumidity); this.Max_Humidity = (float)Convert.ToDouble(maxHumidity);
this.Max_Temperature = (float)Convert.ToDouble(maxTemp); this.Max_Temperature = (float)Convert.ToDouble(maxTemp);
LogUtil.info( "保存温湿度预警值:Max_Humidity=" + Max_Humidity + ",Max_Temperature=" + Max_Temperature); LogUtil.info("保存温湿度预警值:Max_Humidity=" + Max_Humidity + ",Max_Temperature=" + Max_Temperature);
} }
catch (Exception ex) catch (Exception ex)
{ {
...@@ -585,13 +628,13 @@ namespace DeviceLibrary ...@@ -585,13 +628,13 @@ namespace DeviceLibrary
{ {
//出入库没有找到服务器发送的库位,需要打印日志方便查询原因 //出入库没有找到服务器发送的库位,需要打印日志方便查询原因
WarnMsg = StoreName + "出库未找库位:【" + posId + "】"; WarnMsg = StoreName + "出库未找库位:【" + posId + "】";
LogUtil.error( "收到服务器出库命令:未找到【" + posId + "】的库位信息"); LogUtil.error("收到服务器出库命令:未找到【" + posId + "】的库位信息");
continue; continue;
} }
else else
{ {
if (isSingleOut) if (isSingleOut)
RobotManage.mainMachine.AddSingleStoreTask(posId,plateW,plateH); RobotManage.mainMachine.AddSingleStoreTask(posId, plateW, plateH);
else else
RobotManage.mainMachine.AddOutStoreTask(posId, plateW, plateH); RobotManage.mainMachine.AddOutStoreTask(posId, plateW, plateH);
} }
...@@ -730,6 +773,6 @@ namespace DeviceLibrary ...@@ -730,6 +773,6 @@ namespace DeviceLibrary
/// 扫码入库失败 /// 扫码入库失败
/// </summary> /// </summary>
InStoreError = 14, InStoreError = 14,
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -210,6 +210,7 @@ namespace DeviceLibrary ...@@ -210,6 +210,7 @@ namespace DeviceLibrary
break; break;
case MoveStep.StoreFIX04: case MoveStep.StoreFIX04:
MoveInfo.NextMoveStep(MoveStep.StoreFIX05); MoveInfo.NextMoveStep(MoveStep.StoreFIX05);
RobotManage.PutReelInFixPos(MoveInfo.MoveParam);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000)); MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
break; break;
case MoveStep.StoreFIX05: case MoveStep.StoreFIX05:
...@@ -226,6 +227,7 @@ namespace DeviceLibrary ...@@ -226,6 +227,7 @@ namespace DeviceLibrary
break; break;
case MoveStep.StoreTS10: case MoveStep.StoreTS10:
MoveInfo.NextMoveStep(MoveStep.StoreTS11); MoveInfo.NextMoveStep(MoveStep.StoreTS11);
RobotManage.ClearReelInFixPos();
Middle_Axis.AbsMove(MoveInfo, To.Middle_P2, Config.Middle_P2_speed); Middle_Axis.AbsMove(MoveInfo, To.Middle_P2, Config.Middle_P2_speed);
MoveInfo.log($"{storeMoveType}:行走机构到达目的地:{To.Middle_P2}"); MoveInfo.log($"{storeMoveType}:行走机构到达目的地:{To.Middle_P2}");
UpDown_Axis.AbsMove(MoveInfo, To.UpDown_PH, Config.UpDown_P1_speed); UpDown_Axis.AbsMove(MoveInfo, To.UpDown_PH, Config.UpDown_P1_speed);
......
...@@ -535,6 +535,17 @@ namespace DeviceLibrary ...@@ -535,6 +535,17 @@ namespace DeviceLibrary
ServerCM.storeStatus = StoreStatus.OutStoreExecute; ServerCM.storeStatus = StoreStatus.OutStoreExecute;
CloseFlipDoor(StoreMoveInfo); CloseFlipDoor(StoreMoveInfo);
} }
else if((RobotManage.HasReelInFixPos(out ReelParam reelParam)) && boxTransport.IsComplateOrFree && ClampMoveInfo.MoveStep == MoveStep.Wait && ConfigHelper.Config.Get("Device_Use_Fixpos", false))
{
StoreMoveInfo.NewMove(MoveStep.StoreOut_NGPre);
StoreMoveInfo.MoveParam=reelParam.clone();
StoreMoveInfo.MoveParam.PosID = "NG";
StoreMoveInfo.MoveParam.IsNg = true;
StoreMoveInfo.MoveParam.NgMsg = "检测到校准库位有料盘信息,请人工确认";
StoreMoveInfo.log($"开始校准库位料盘出库");
ServerCM.storeStatus = StoreStatus.OutStoreExecute;
CloseFlipDoor(StoreMoveInfo);
}
runStatus = RunStatus.Running; runStatus = RunStatus.Running;
ServerCM.storeStatus = StoreStatus.StoreOnline; ServerCM.storeStatus = StoreStatus.StoreOnline;
break; break;
......
...@@ -16,8 +16,9 @@ namespace DeviceLibrary ...@@ -16,8 +16,9 @@ namespace DeviceLibrary
StoreJobList OutStoreJobList = new StoreJobList($"批量"); StoreJobList OutStoreJobList = new StoreJobList($"批量");
StoreJobList OutSingleJobList = new StoreJobList($"单盘"); StoreJobList OutSingleJobList = new StoreJobList($"单盘");
public void AddOutStoreTask(string posId,int plateW,int plateH) { public void AddOutStoreTask(string posId, int plateW, int plateH)
JobInfo jobInfo = new JobInfo("", posId,plateW,plateH); {
JobInfo jobInfo = new JobInfo("", posId, plateW, plateH);
OutStoreJobList.Enqueue(jobInfo); OutStoreJobList.Enqueue(jobInfo);
LogUtil.info($"添加出库任务队列: {posId},当前任务数量: {OutStoreJobList.Count}"); LogUtil.info($"添加出库任务队列: {posId},当前任务数量: {OutStoreJobList.Count}");
} }
...@@ -63,11 +64,11 @@ namespace DeviceLibrary ...@@ -63,11 +64,11 @@ namespace DeviceLibrary
if (!boxTransport.IgnoreX09 && IOMonitor.IODebound(IO_Type.TrayCheck_Fixture, Config, IO_VALUE.HIGH, 1000)) if (!boxTransport.IgnoreX09 && IOMonitor.IODebound(IO_Type.TrayCheck_Fixture, Config, IO_VALUE.HIGH, 1000))
{ {
Msg.add(crc.GetString("Res0004","收到出库任务,但料叉上有料,无法启动,请检查"), MsgLevel.alarm, ErrInfo.X09_BoxNotDetect); Msg.add(crc.GetString("Res0004", "收到出库任务,但料叉上有料,无法启动,请检查"), MsgLevel.alarm, ErrInfo.X09_BoxNotDetect);
//RobotManage.UserPause("收到出库任务,但料叉上有料,无法启动,请检查"); //RobotManage.UserPause("收到出库任务,但料叉上有料,无法启动,请检查");
} }
else else
Msg.add(crc.GetString("Res0004","收到出库任务,但料叉上有料,无法启动,请检查"), MsgLevel.warning); Msg.add(crc.GetString("Res0004", "收到出库任务,但料叉上有料,无法启动,请检查"), MsgLevel.warning);
return; return;
} }
else else
...@@ -87,18 +88,18 @@ namespace DeviceLibrary ...@@ -87,18 +88,18 @@ namespace DeviceLibrary
} }
} }
//判断有没有出库任务, 需要入库空闲, 出口空闲 //判断有没有出库任务, 需要入库空闲, 出口空闲
else if (OutStoreJobList.Count>0 && boxTransport.IsComplateOrFree) else if (OutStoreJobList.Count > 0 && boxTransport.IsComplateOrFree)
{ {
if (!boxTransport.IgnoreX09 && IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH)) if (!boxTransport.IgnoreX09 && IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH))
{ {
if (!boxTransport.IgnoreX09 && IOMonitor.IODebound(IO_Type.TrayCheck_Fixture, Config, IO_VALUE.HIGH, 1000)) if (!boxTransport.IgnoreX09 && IOMonitor.IODebound(IO_Type.TrayCheck_Fixture, Config, IO_VALUE.HIGH, 1000))
{ {
Msg.add(crc.GetString("Res0004","收到出库任务,但料叉上有料,无法启动,请检查"), MsgLevel.alarm, ErrInfo.X09_BoxNotDetect); Msg.add(crc.GetString("Res0004", "收到出库任务,但料叉上有料,无法启动,请检查"), MsgLevel.alarm, ErrInfo.X09_BoxNotDetect);
//RobotManage.UserPause("收到出库任务,但料叉上有料,无法启动,请检查"); //RobotManage.UserPause("收到出库任务,但料叉上有料,无法启动,请检查");
} }
else else
Msg.add(crc.GetString("Res0004","收到出库任务,但料叉上有料,无法启动,请检查"), MsgLevel.warning); Msg.add(crc.GetString("Res0004", "收到出库任务,但料叉上有料,无法启动,请检查"), MsgLevel.warning);
return; return;
} }
else else
...@@ -110,7 +111,7 @@ namespace DeviceLibrary ...@@ -110,7 +111,7 @@ namespace DeviceLibrary
StoreMoveInfo.MoveParam.PosID = jobInfo.PosId; StoreMoveInfo.MoveParam.PosID = jobInfo.PosId;
StoreMoveInfo.MoveParam.PlateH = jobInfo.plateH; StoreMoveInfo.MoveParam.PlateH = jobInfo.plateH;
StoreMoveInfo.MoveParam.PlateW = jobInfo.plateW; StoreMoveInfo.MoveParam.PlateW = jobInfo.plateW;
StoreMoveInfo.log($"开始出库任务:"+ jobInfo.ToStr()); StoreMoveInfo.log($"开始出库任务:" + jobInfo.ToStr());
ServerCM.storeStatus = StoreStatus.OutStoreExecute; ServerCM.storeStatus = StoreStatus.OutStoreExecute;
} }
} }
...@@ -118,13 +119,13 @@ namespace DeviceLibrary ...@@ -118,13 +119,13 @@ namespace DeviceLibrary
case MoveStep.StoreIn01: case MoveStep.StoreIn01:
if (!ServerCM.SendStoreState(StoreMoveInfo.MoveParam.PosID, StoreStatus.InStoreExecute)) if (!ServerCM.SendStoreState(StoreMoveInfo.MoveParam.PosID, StoreStatus.InStoreExecute))
{ {
Msg.add(crc.GetString("Res0008","服务器连接异常"),MsgLevel.warning); Msg.add(crc.GetString("Res0008", "服务器连接异常"), MsgLevel.warning);
return; return;
} }
StoreMoveInfo.NextMoveStep(MoveStep.StoreIn03); StoreMoveInfo.NextMoveStep(MoveStep.StoreIn03);
var ac = CSVPositionReader<ACStorePosition>.GetPositon(StoreMoveInfo.MoveParam.PosID); var ac = CSVPositionReader<ACStorePosition>.GetPositon(StoreMoveInfo.MoveParam.PosID);
boxTransport.Start(new BoxStorePosition(Config, StoreSide.NGDoor, StoreMoveInfo.MoveParam), new BoxStorePosition(Config, ac, StoreMoveInfo.MoveParam), StoreMoveType.InStore, true); boxTransport.Start(new BoxStorePosition(Config, StoreSide.NGDoor, StoreMoveInfo.MoveParam), new BoxStorePosition(Config, ac, StoreMoveInfo.MoveParam), StoreMoveType.InStore, true);
StoreMoveInfo.log($"开始转运料盘"); StoreMoveInfo.log($"开始转运料盘");
break; break;
case MoveStep.StoreIn02: case MoveStep.StoreIn02:
break; break;
...@@ -145,12 +146,12 @@ namespace DeviceLibrary ...@@ -145,12 +146,12 @@ namespace DeviceLibrary
{ {
if (!ServerCM.SendStoreState(StoreMoveInfo.MoveParam.PosID, StoreStatus.InStoreEnd)) if (!ServerCM.SendStoreState(StoreMoveInfo.MoveParam.PosID, StoreStatus.InStoreEnd))
{ {
Msg.add(crc.GetString("Res0008","服务器连接异常"), MsgLevel.warning); Msg.add(crc.GetString("Res0008", "服务器连接异常"), MsgLevel.warning);
return; return;
} }
StoreMoveInfo.log($"料盘已到达目的地"); StoreMoveInfo.log($"料盘已到达目的地");
StoreMoveInfo.EndMove(); StoreMoveInfo.EndMove();
} }
break; break;
case MoveStep.StoreOut_NGPre: case MoveStep.StoreOut_NGPre:
...@@ -159,18 +160,18 @@ namespace DeviceLibrary ...@@ -159,18 +160,18 @@ namespace DeviceLibrary
case MoveStep.StoreOut10: case MoveStep.StoreOut10:
if (!ServerCM.SendStoreState(StoreMoveInfo.MoveParam.PosID, StoreStatus.OutStoreExecute)) if (!ServerCM.SendStoreState(StoreMoveInfo.MoveParam.PosID, StoreStatus.OutStoreExecute))
{ {
Msg.add(crc.GetString("Res0008","服务器连接异常"), MsgLevel.warning); Msg.add(crc.GetString("Res0008", "服务器连接异常"), MsgLevel.warning);
return; return;
} }
StoreMoveInfo.NextMoveStep(MoveStep.StoreOut11); StoreMoveInfo.NextMoveStep(MoveStep.StoreOut11);
var outFrom = CSVPositionReader<ACStorePosition>.GetPositon(StoreMoveInfo.MoveParam.PosID); var outFrom = CSVPositionReader<ACStorePosition>.GetPositon(StoreMoveInfo.MoveParam.PosID);
BoxStorePosition outTo; BoxStorePosition outTo;
if (StoreMoveInfo.MoveParam.IsNg) if (StoreMoveInfo.MoveParam.IsNg)
outTo = new BoxStorePosition(Config, StoreSide.NGDoor, StoreMoveInfo.MoveParam); outTo = new BoxStorePosition(Config, StoreSide.NGDoor, StoreMoveInfo.MoveParam);
else else
outTo = new BoxStorePosition(Config, StoreSide.String, StoreMoveInfo.MoveParam); outTo = new BoxStorePosition(Config, StoreSide.String, StoreMoveInfo.MoveParam);
boxTransport.Start(outFrom == null ? null : new BoxStorePosition(Config, outFrom, StoreMoveInfo.MoveParam), outTo, StoreMoveType.OutStore); boxTransport.Start(outFrom == null ? null : new BoxStorePosition(Config, outFrom, StoreMoveInfo.MoveParam), outTo, StoreMoveType.OutStore);
StoreMoveInfo.log($"开始转运料盘{(StoreMoveInfo.MoveParam.IsNg ? "单料口" : "料串")}"); StoreMoveInfo.log($"开始转运料盘{(StoreMoveInfo.MoveParam.IsNg ? "单料口" : "料串")}");
break; break;
case MoveStep.StoreOut11: case MoveStep.StoreOut11:
...@@ -178,7 +179,7 @@ namespace DeviceLibrary ...@@ -178,7 +179,7 @@ namespace DeviceLibrary
{ {
if (!ServerCM.SendStoreState(StoreMoveInfo.MoveParam.PosID, StoreStatus.OutStoreBoxEnd)) if (!ServerCM.SendStoreState(StoreMoveInfo.MoveParam.PosID, StoreStatus.OutStoreBoxEnd))
{ {
Msg.add(crc.GetString("Res0008","服务器连接异常"), MsgLevel.warning); Msg.add(crc.GetString("Res0008", "服务器连接异常"), MsgLevel.warning);
return; return;
} }
StoreMoveInfo.NextMoveStep(MoveStep.StoreOut12); StoreMoveInfo.NextMoveStep(MoveStep.StoreOut12);
...@@ -194,13 +195,13 @@ namespace DeviceLibrary ...@@ -194,13 +195,13 @@ namespace DeviceLibrary
{ {
if (!ServerCM.SendStoreState(StoreMoveInfo.MoveParam.PosID, StoreStatus.OutStoreEnd)) if (!ServerCM.SendStoreState(StoreMoveInfo.MoveParam.PosID, StoreStatus.OutStoreEnd))
{ {
Msg.add(crc.GetString("Res0008","服务器连接异常"), MsgLevel.warning); Msg.add(crc.GetString("Res0008", "服务器连接异常"), MsgLevel.warning);
return; return;
} }
StoreMoveInfo.log($"料盘已到达目的地"); StoreMoveInfo.log($"料盘已到达目的地");
if (StoreMoveInfo.MoveParam.IsNg) if (StoreMoveInfo.MoveParam.IsNg)
{ {
NGPuted(StoreMoveInfo.MoveParam.NgMsg); NGPuted(StoreMoveInfo.MoveParam.NgMsg);
OutSingleJobList.ClearLastPosid(StoreMoveInfo.MoveParam.PosID); OutSingleJobList.ClearLastPosid(StoreMoveInfo.MoveParam.PosID);
} }
...@@ -209,7 +210,7 @@ namespace DeviceLibrary ...@@ -209,7 +210,7 @@ namespace DeviceLibrary
ReelPutted(StoreMoveInfo.MoveParam.PlateH); ReelPutted(StoreMoveInfo.MoveParam.PlateH);
OutStoreJobList.ClearLastPosid(StoreMoveInfo.MoveParam.PosID); OutStoreJobList.ClearLastPosid(StoreMoveInfo.MoveParam.PosID);
} }
StoreMoveInfo.EndMove(); StoreMoveInfo.EndMove();
} }
break; break;
...@@ -218,8 +219,9 @@ namespace DeviceLibrary ...@@ -218,8 +219,9 @@ namespace DeviceLibrary
break; break;
} }
} }
string StoreState() { string StoreState()
string state = crc.GetString(L.free,"空闲中"); {
string state = crc.GetString(L.free, "空闲中");
if (StoreMoveInfo.MoveStep >= MoveStep.StoreOut10) if (StoreMoveInfo.MoveStep >= MoveStep.StoreOut10)
{ {
state = $"{crc.GetString(L.reel_outting, "出库中")},{crc.GetString(L.posnum, "出库中")}:{StoreMoveInfo.MoveParam.PosID}"; state = $"{crc.GetString(L.reel_outting, "出库中")},{crc.GetString(L.posnum, "出库中")}:{StoreMoveInfo.MoveParam.PosID}";
......
...@@ -183,6 +183,34 @@ namespace DeviceLibrary ...@@ -183,6 +183,34 @@ namespace DeviceLibrary
else else
LogUtil.info("用户取消忽略安全光栅"); LogUtil.info("用户取消忽略安全光栅");
} }
#region 校准库位缓存
public static bool HasReelInFixPos(out ReelParam reelParam)
{
reelParam = null;
try
{
string fix = ConfigHelper.Config.Get(Setting_Init.FixBuffInfo,"");
if(!string.IsNullOrEmpty(fix))
{
reelParam=JsonHelper.DeserializeJsonToObject<ReelParam>(fix);
return true;
}
}
catch (Exception e)
{
LogUtil.error("解析校准库位缓存异常",e);
}
return false;
}
public static void PutReelInFixPos(ReelParam reelParam)
{
ConfigHelper.Config.Set(Setting_Init.FixBuffInfo,JsonHelper.SerializeObject(reelParam));
}
public static void ClearReelInFixPos()
{
ConfigHelper.Config.Set(Setting_Init.FixBuffInfo,"");
}
#endregion
} }
public enum StoreType { public enum StoreType {
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!