Commit 4d385d15 张东亮

已修改,待测试

1 个父辈 1991b45f
...@@ -142,6 +142,7 @@ namespace OnlineStore.Common ...@@ -142,6 +142,7 @@ namespace OnlineStore.Common
system_running_cantmove, system_running_cantmove,
before_FrmPositionTool_stopmuchine, before_FrmPositionTool_stopmuchine,
temp, temp,
outstore_abnormal_reel outstore_abnormal_reel,
instore_abnormal_reel
} }
} }
此文件类型无法预览
...@@ -684,6 +684,12 @@ namespace DeviceLibrary ...@@ -684,6 +684,12 @@ namespace DeviceLibrary
} }
private static string Addr_cancelPutInTask = "/service/store/cancelPutInTask"; private static string Addr_cancelPutInTask = "/service/store/cancelPutInTask";
/// <summary>
/// 取消入库任务
/// </summary>
/// <param name="deviceName"></param>
/// <param name="barcode"></param>
/// <returns></returns>
public string cancelPutInTask(string deviceName, string barcode) public string cancelPutInTask(string deviceName, string barcode)
{ {
string msg = ""; string msg = "";
...@@ -733,6 +739,63 @@ namespace DeviceLibrary ...@@ -733,6 +739,63 @@ namespace DeviceLibrary
return path; return path;
} }
/// <summary>
/// 屏蔽库位接口
/// </summary>
private static string Addr_disabledPos = "/service/store/disabledPos";
/// <summary>
/// 屏蔽库位
/// </summary>
/// <param name="deviceName"></param>
/// <param name="barcode"></param>
/// <param name="poid"></param>
/// <returns></returns>
public static string DisablePos(string deviceName, string barcode, string poid, string reason = "")
{
string msg = "";
try
{
if (String.IsNullOrEmpty(barcode))
{
return msg;
}
//if (string.IsNullOrEmpty(serverAddr))
//{
// LogUtil.error(deviceName + "DisablePos [" + barcode + "] [" + poid + "] :未找到服务器地址");
// return msg;
//}
Dictionary<string, string> paramMap = new Dictionary<string, string>();
paramMap.Add("posId", poid);//posId:库位号
paramMap.Add("barcode", barcode); // barcode = 料盘的条码
paramMap.Add("msg", reason);
string server = GetAddr(Addr_disabledPos, paramMap);
DateTime startTime = DateTime.Now;
string resultStr = HttpHelper.Post(server, "");
LogUtil.info("DisablePos " + FormUtil.GetSpanStr(DateTime.Now - startTime) + " 【" + server + "】【" + resultStr + "】");
// 返回: { "code": 0, "msg":"ok", "data":""}
ResultData serverResult = JsonHelper.DeserializeJsonToObject<ResultData>(resultStr);
if (serverResult == null)
{
msg = deviceName + "DisablePos【 " + barcode + "】【" + poid + "】没有收到服务器反馈";
}
else if (serverResult.code.Equals(0).Equals(false))
{
// code: 0为正常,其他为异常, msg: 消息, data: 为空
msg = deviceName + " DisablePos【 " + barcode + "】【" + poid + "】:" + "[" + serverResult.code + "]" + serverResult.msg;
}
if (!msg.Equals(""))
{
LogUtil.error(msg);
}
}
catch (Exception ex)
{
LogUtil.error(deviceName + " ", ex);
}
return msg;
}
} }
public class ResultData public class ResultData
......
...@@ -16,24 +16,26 @@ namespace DeviceLibrary ...@@ -16,24 +16,26 @@ namespace DeviceLibrary
public StoreJobList(string jn) { public StoreJobList(string jn) {
jobname = jn; jobname = jn;
} }
public void Enqueue(JobInfo jobInfo) public bool Enqueue(JobInfo jobInfo)
{ {
lock (jobInfos) lock (jobInfos)
{ {
if (lastoutpos == jobInfo.PosId) if (lastoutpos == jobInfo.PosId)
{ {
LogUtil.info($"[{jobname}] 出库任务正在执行:" + jobInfo.ToStr()); LogUtil.info($"[{jobname}] 出库任务正在执行:" + jobInfo.ToStr());
return; return false;
} }
var l = jobInfos.ToList().Find((x) => { return x.PosId == jobInfo.PosId; }); var l = jobInfos.ToList().Find((x) => { return x.PosId == jobInfo.PosId; });
if (l == null) if (l == null)
{ {
jobInfos.Enqueue(jobInfo); jobInfos.Enqueue(jobInfo);
LogUtil.info($"[{jobname}] 出库任务加入队列:" + jobInfo.ToStr()); LogUtil.info($"[{jobname}] 出库任务加入队列:" + jobInfo.ToStr());
return true;
} }
else else
LogUtil.info($"[{jobname}] 出库任务已存在队列中:" + jobInfo.ToStr()); LogUtil.info($"[{jobname}] 出库任务已存在队列中:" + jobInfo.ToStr());
} }
return false;
} }
public bool Dequeue(out JobInfo jobInfo) public bool Dequeue(out JobInfo jobInfo)
{ {
......
...@@ -330,6 +330,7 @@ namespace DeviceLibrary ...@@ -330,6 +330,7 @@ namespace DeviceLibrary
} }
} }
LogUtil.info("主线程已退出."); LogUtil.info("主线程已退出.");
RobotManage.isRunning = false;
} }
public void Start() public void Start()
{ {
......
...@@ -81,11 +81,22 @@ namespace DeviceLibrary ...@@ -81,11 +81,22 @@ namespace DeviceLibrary
switch (ClampMoveInfo.MoveStep) switch (ClampMoveInfo.MoveStep)
{ {
case MoveStep.Wait: case MoveStep.Wait:
if (Common.IsManualHandleReelInFix())
{
if (IsGetReelReady && StoreMoveInfo.MoveStep == MoveStep.Wait && OutSingleJobList.Count == 0)
{
ClampMoveInfo.NewMove(MoveStep.ReelClamp_01);
OpenFlipDoor(ClampMoveInfo);
}
}
else
{
if (IsGetReelReady && StoreMoveInfo.MoveStep < MoveStep.StoreOut10 && OutSingleJobList.Count == 0) if (IsGetReelReady && StoreMoveInfo.MoveStep < MoveStep.StoreOut10 && OutSingleJobList.Count == 0)
{ {
ClampMoveInfo.NewMove(MoveStep.ReelClamp_01); ClampMoveInfo.NewMove(MoveStep.ReelClamp_01);
OpenFlipDoor(ClampMoveInfo); OpenFlipDoor(ClampMoveInfo);
} }
}
break; break;
case MoveStep.ReelClamp_01: case MoveStep.ReelClamp_01:
ClampMoveInfo.NextMoveStep(MoveStep.ReelClamp_02); ClampMoveInfo.NextMoveStep(MoveStep.ReelClamp_02);
...@@ -280,7 +291,7 @@ namespace DeviceLibrary ...@@ -280,7 +291,7 @@ namespace DeviceLibrary
{ {
Msg.add(crc.GetString(L.x29_low_no_reel, "传感器X29未检测到单料口料盘."), MsgLevel.alarm); Msg.add(crc.GetString(L.x29_low_no_reel, "传感器X29未检测到单料口料盘."), MsgLevel.alarm);
Msg.add(ClampMoveInfo.MoveParam.NgMsg, MsgLevel.warning); Msg.add(ClampMoveInfo.MoveParam.NgMsg, MsgLevel.warning);
RobotManage.UserPause(crc.GetString("Res0005", "传感器X29未检测到单料口料盘")); //RobotManage.UserPause(crc.GetString("Res0005", "传感器X29未检测到单料口料盘"));
} }
} }
SingleDoor.ToHigh(ClampMoveInfo); SingleDoor.ToHigh(ClampMoveInfo);
...@@ -394,7 +405,7 @@ namespace DeviceLibrary ...@@ -394,7 +405,7 @@ namespace DeviceLibrary
get get
{ {
if (ConfigHelper.Config.Get("CamTestReel_Ability", false)) if (ConfigHelper.Config.Get("CamTestReel_Ability", false))
return CodeManager.TestHasReel(CodeManager.hikNameList[0],out _,out _); return CodeManager.TestHasReel(CodeManager.hikNameList[0], out _, out _);
else else
return IOValue(IO_Type.NGDoor_Tray_Check).Equals(IO_VALUE.HIGH); return IOValue(IO_Type.NGDoor_Tray_Check).Equals(IO_VALUE.HIGH);
} }
...@@ -465,7 +476,7 @@ namespace DeviceLibrary ...@@ -465,7 +476,7 @@ namespace DeviceLibrary
List<CodeInfo> LastCodeList; List<CodeInfo> LastCodeList;
LastCodeList = CodeManager.CameraScan(CodeManager.hikNameList); LastCodeList = CodeManager.CameraScan(CodeManager.hikNameList);
if (LastCodeList.Count==0) if (LastCodeList.Count == 0)
LastCodeList = CodeManager.CameraScan(CodeManager.hikNameList); LastCodeList = CodeManager.CameraScan(CodeManager.hikNameList);
//BoxParam labelParam = new BoxParam(); //BoxParam labelParam = new BoxParam();
//labelParam.codeInfos = new List<CodeInfo>(LastCodeList); //labelParam.codeInfos = new List<CodeInfo>(LastCodeList);
......
...@@ -19,14 +19,14 @@ namespace DeviceLibrary ...@@ -19,14 +19,14 @@ namespace DeviceLibrary
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); if (OutStoreJobList.Enqueue(jobInfo))
LogUtil.info($"添加出库任务队列: {posId},当前任务数量: {OutStoreJobList.Count}"); LogUtil.info($"批量出库任务当前任务数量: {OutStoreJobList.Count}");
} }
public void AddSingleStoreTask(string posId, int plateW, int plateH) public void AddSingleStoreTask(string posId, int plateW, int plateH)
{ {
JobInfo jobInfo = new JobInfo("", posId, plateW, plateH); JobInfo jobInfo = new JobInfo("", posId, plateW, plateH);
OutSingleJobList.Enqueue(jobInfo); if (OutSingleJobList.Enqueue(jobInfo))
LogUtil.info($"添加单盘出库任务队列: {posId},当前任务数量: {OutSingleJobList.Count}"); LogUtil.info($"单盘出库任务队列任务数量: {OutSingleJobList.Count}");
} }
void StoreProcess() void StoreProcess()
{ {
...@@ -62,15 +62,7 @@ namespace DeviceLibrary ...@@ -62,15 +62,7 @@ namespace DeviceLibrary
{ {
if (!boxTransport.IgnoreX09 && IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH)) if (!boxTransport.IgnoreX09 && IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH))
{ {
Msg.add(crc.GetString("Res0004", "收到出库任务,但料叉上有料,无法启动,请检查"), MsgLevel.alarm, ErrInfo.X09_BoxNotDetect);
//if (!boxTransport.IgnoreX09 && IOMonitor.IODebound(IO_Type.TrayCheck_Fixture, Config, IO_VALUE.HIGH, 1000))
//{
// Msg.add(crc.GetString("Res0004", "收到出库任务,但料叉上有料,无法启动,请检查"), MsgLevel.alarm, ErrInfo.X09_BoxNotDetect);
// //RobotManage.UserPause(crc.GetString("Res0004", "收到出库任务,但料叉上有料,无法启动,请检查"));
//}
//else
Msg.add(crc.GetString("Res0004", "收到出库任务,但料叉上有料,无法启动,请检查"), MsgLevel.alarm);
RobotManage.UserPause(crc.GetString("Res0004", "收到出库任务,但料叉上有料,无法启动,请检查"));
return; return;
} }
else else
...@@ -94,15 +86,9 @@ namespace DeviceLibrary ...@@ -94,15 +86,9 @@ namespace DeviceLibrary
{ {
if (!boxTransport.IgnoreX09 && IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH)) if (!boxTransport.IgnoreX09 && IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH))
{ {
//Msg.add(crc.GetString("Res0004", "收到出库任务,但料叉上有料,无法启动,请检查"), MsgLevel.alarm);
//if (!boxTransport.IgnoreX09 && IOMonitor.IODebound(IO_Type.TrayCheck_Fixture, Config, IO_VALUE.HIGH, 1000)) //RobotManage.UserPause(crc.GetString("Res0004", "收到出库任务,但料叉上有料,无法启动,请检查"));
//{ Msg.add(crc.GetString("Res0004", "收到出库任务,但料叉上有料,无法启动,请检查"), MsgLevel.alarm, ErrInfo.X09_BoxNotDetect);
// Msg.add(crc.GetString("Res0004", "收到出库任务,但料叉上有料,无法启动,请检查"), MsgLevel.alarm, ErrInfo.X09_BoxNotDetect);
// //RobotManage.UserPause("收到出库任务,但料叉上有料,无法启动,请检查");
//}
//else
Msg.add(crc.GetString("Res0004", "收到出库任务,但料叉上有料,无法启动,请检查"), MsgLevel.alarm);
RobotManage.UserPause(crc.GetString("Res0004", "收到出库任务,但料叉上有料,无法启动,请检查"));
return; return;
} }
else else
...@@ -133,8 +119,15 @@ namespace DeviceLibrary ...@@ -133,8 +119,15 @@ namespace DeviceLibrary
case MoveStep.StoreIn02: case MoveStep.StoreIn02:
break; break;
case MoveStep.StoreIn03: case MoveStep.StoreIn03:
if (boxTransport.IsTakedReel) if (boxTransport.IsNGReel)
{
StoreMoveInfo.NextMoveStep(MoveStep.StoreInNG_01);
boxTransport.IsNGReel = false;
StoreMoveInfo.log($"入库料盘被判定为NG,准备送往单料口");
}
else if (boxTransport.IsTakedReel)
{ {
boxTransport.IsNGReel = false;
ReelTaked(); ReelTaked();
StoreMoveInfo.NextMoveStep(MoveStep.StoreIn04); StoreMoveInfo.NextMoveStep(MoveStep.StoreIn04);
StoreMoveInfo.log($"料盘已取走"); StoreMoveInfo.log($"料盘已取走");
...@@ -145,7 +138,13 @@ namespace DeviceLibrary ...@@ -145,7 +138,13 @@ namespace DeviceLibrary
} }
break; break;
case MoveStep.StoreIn04: case MoveStep.StoreIn04:
if (boxTransport.IsComplateOrFree) if (boxTransport.IsNGReel)
{
StoreMoveInfo.NextMoveStep(MoveStep.StoreInNG_01);
boxTransport.IsNGReel = false;
StoreMoveInfo.log($"入库料盘被判定为NG,准备送往单料口");
}
else if (boxTransport.IsComplateOrFree)
{ {
if (!ServerCM.SendStoreState(StoreMoveInfo.MoveParam.PosID, StoreStatus.InStoreEnd)) if (!ServerCM.SendStoreState(StoreMoveInfo.MoveParam.PosID, StoreStatus.InStoreEnd))
{ {
...@@ -157,6 +156,35 @@ namespace DeviceLibrary ...@@ -157,6 +156,35 @@ namespace DeviceLibrary
} }
break; break;
case MoveStep.StoreInNG_01:
string msg = ServerCM.cancelPutInTask(Name, StoreMoveInfo.MoveParam.WareCode);
if (string.IsNullOrEmpty(msg))
{
StoreMoveInfo.NextMoveStep(MoveStep.StoreInNG_02);
StoreMoveInfo.log($"取消[{StoreMoveInfo.MoveParam.WareCode}]入库任务");
}
break;
case MoveStep.StoreInNG_02:
StoreMoveInfo.NextMoveStep(MoveStep.StoreInNG_03);
// var outFrom = CSVPositionReader<ACStorePosition>.GetPositon(StoreMoveInfo.MoveParam.PosID);
BoxStorePosition tar = new BoxStorePosition(Config, StoreSide.NGDoor, StoreMoveInfo.MoveParam);
boxTransport.Start(null, tar, StoreMoveType.InStore);
StoreMoveInfo.log($"开始转运料盘到单料口");
break;
case MoveStep.StoreInNG_03:
if (boxTransport.IsPutOnOut)
{
StoreMoveInfo.log($"料盘已到达单料口");
NGPuted(crc.GetString(L.instore_abnormal_reel, "入库过程中料叉检测料盘异常"));
StoreMoveInfo.EndMove();
}
break;
case MoveStep.StoreInNG_04:
break;
case MoveStep.StoreInNG_05:
break;
case MoveStep.StoreOut_NGPre: case MoveStep.StoreOut_NGPre:
StoreMoveInfo.NextMoveStep(MoveStep.StoreOut10); StoreMoveInfo.NextMoveStep(MoveStep.StoreOut10);
break; break;
......
...@@ -115,6 +115,12 @@ namespace DeviceLibrary ...@@ -115,6 +115,12 @@ namespace DeviceLibrary
StoreIn07, StoreIn07,
StoreIn08, StoreIn08,
StoreIn09, StoreIn09,
StoreInNG_01,
StoreInNG_02,
StoreInNG_03,
StoreInNG_04,
StoreInNG_05,
StoreOut10, //出库 StoreOut10, //出库
StoreOut_NGPre, StoreOut_NGPre,
StoreOut11, StoreOut11,
......
...@@ -148,7 +148,6 @@ namespace DeviceLibrary ...@@ -148,7 +148,6 @@ namespace DeviceLibrary
mainMachine.Stop(); mainMachine.Stop();
mainMachine.UserPause = false; mainMachine.UserPause = false;
} }
isRunning = false;
} }
public static void ShutDown() public static void ShutDown()
{ {
......
...@@ -402,3 +402,4 @@ r_flipDoor_no_work 右侧翻板水平信号未亮 The right flap horizontal sign ...@@ -402,3 +402,4 @@ r_flipDoor_no_work 右侧翻板水平信号未亮 The right flap horizontal sign
reel_not_in_right_status 料盘放置异常 The reel is placed abnormally reel_not_in_right_status 料盘放置异常 The reel is placed abnormally
confirm_no_reel_in_com 请确保料盘已从库位中取出 Make sure that the reel has been removed from the location confirm_no_reel_in_com 请确保料盘已从库位中取出 Make sure that the reel has been removed from the location
outstore_abnormal_reel The material tray is not successfully put into the string, please check outstore_abnormal_reel The material tray is not successfully put into the string, please check
instore_abnormal_reel During the warehousing process, the fork detects the abnormality of the tray
\ No newline at end of file \ No newline at end of file
...@@ -404,3 +404,4 @@ r_flipDoor_no_work 右侧翻板水平信号未亮 右フラップ水平信号が ...@@ -404,3 +404,4 @@ r_flipDoor_no_work 右侧翻板水平信号未亮 右フラップ水平信号が
reel_not_in_right_status 料盘放置异常 リールが異常に配置されている reel_not_in_right_status 料盘放置异常 リールが異常に配置されている
confirm_no_reel_in_com 请确保料盘已从库位中取出 リールがその場所から取り外されていることを確認してください confirm_no_reel_in_com 请确保料盘已从库位中取出 リールがその場所から取り外されていることを確認してください
outstore_abnormal_reel 倉庫を出るとき、材料トレイがひもにうまく入れられていません、確認してください outstore_abnormal_reel 倉庫を出るとき、材料トレイがひもにうまく入れられていません、確認してください
instore_abnormal_reel 倉庫プロセス中に、フォークはトレイの異常を検出します
\ No newline at end of file \ No newline at end of file
...@@ -377,9 +377,9 @@ tray_detect_reel_01 料叉传感器X30感应到有料,请人工确认 料叉传 ...@@ -377,9 +377,9 @@ tray_detect_reel_01 料叉传感器X30感应到有料,请人工确认 料叉传
system_running_cantmove 系统正在运行,不能手动控制伺服 system_running_cantmove 系统正在运行,不能手动控制伺服
before_FrmPositionTool_stopmuchine 运行库位校准程序前,需要先停止料仓的运行 before_FrmPositionTool_stopmuchine 运行库位校准程序前,需要先停止料仓的运行
outstore_abnormal_reel 出库时料盘未成功放入料串,请检查 outstore_abnormal_reel 出库时料盘未成功放入料串,请检查
instore_abnormal_reel 入库过程中料叉检测料盘异常
Res0004 收到出库任务,但料叉上有料,无法启动,请检查 收到出库任务,但料叉上有料,无法启动,请检查
selCamera 请先选择相机 请先选择相机 selCamera 请先选择相机 请先选择相机
selImage 请先选择图片 请先选择图片 selImage 请先选择图片 请先选择图片
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!