Commit 4b497d99 刘韬

1

1 个父辈 3a88735d
...@@ -58,6 +58,12 @@ namespace OnlineStore.Common ...@@ -58,6 +58,12 @@ namespace OnlineStore.Common
[MyConfigComment("出库时料串检测料盘高度")] [MyConfigComment("出库时料串检测料盘高度")]
public static MyConfig<bool> Device_OutStoreStringReelCheck = false; public static MyConfig<bool> Device_OutStoreStringReelCheck = false;
[MyConfigComment("是否启用库位屏蔽")]
public static MyConfig<bool> Device_DisableStorePosition = false;
[MyConfigComment("管理员密码")] [MyConfigComment("管理员密码")]
public static MyConfig<string> User_AdminPassword = "123456"; public static MyConfig<string> User_AdminPassword = "123456";
[MyConfigComment("启用管理员密码")] [MyConfigComment("启用管理员密码")]
......
...@@ -11,7 +11,7 @@ using System.Threading.Tasks; ...@@ -11,7 +11,7 @@ using System.Threading.Tasks;
namespace DeviceLibrary namespace DeviceLibrary
{ {
class ServerCommunication public class ServerCommunication
{ {
volatile StoreStatus _storeStatus = StoreStatus.Debugging; volatile StoreStatus _storeStatus = StoreStatus.Debugging;
public StoreStatus storeStatus { public StoreStatus storeStatus {
...@@ -625,6 +625,40 @@ namespace DeviceLibrary ...@@ -625,6 +625,40 @@ namespace DeviceLibrary
} }
return msg; return msg;
} }
public string DisabledPos(string posId, string barcode)
{
string msg = "";
try
{
Dictionary<string, string> paramMap = new Dictionary<string, string>();
paramMap.Add("posId", posId);
paramMap.Add("barcode", barcode);
string server = GetAddr("/service/store/disabledPos", paramMap);
DateTime startTime = DateTime.Now;
string resultStr = HttpHelper.Post(server, "");
LogUtil.info("DisabledPos " + FormUtil.GetSpanStr(DateTime.Now - startTime) + " 【" + server + "】【" + resultStr + "】");
ResultData data = JsonHelper.DeserializeJsonToObject<ResultData>(resultStr);
if (data == null)
{
return msg = " DisabledPos【 " + posId + "】 没有收到服务器反馈";
}
else if (data.code.Equals(0).Equals(false))
{
return msg = " DisabledPos【 " + posId + "】 :" + data.msg;
}
return "";
}
catch (Exception ex)
{
LogUtil.error("DisabledPos: " + ex.ToString());
}
return msg;
}
private static string GetAddr(string addr, Dictionary<string, string> paramsMap) private static string GetAddr(string addr, Dictionary<string, string> paramsMap)
{ {
if (server.EndsWith("/")) if (server.EndsWith("/"))
......
...@@ -93,11 +93,13 @@ namespace DeviceLibrary ...@@ -93,11 +93,13 @@ namespace DeviceLibrary
if (i == 0) if (i == 0)
return false; return false;
var recv = Encoding.ASCII.GetString(buff, 0, i); var recv = Encoding.ASCII.GetString(buff, 0, i);
LogUtil.info("收到扫码数据:"+recv);
var m = Regex.Match(recv, pattern); var m = Regex.Match(recv, pattern);
if (m.Success) if (m.Success)
{ {
var index = m.Groups.Count - 1; var index = m.Groups.Count - 1;
result = m.Groups[index].Value; result = m.Groups[index].Value;
LogUtil.info("匹配规则后返回:" + result);
return true; return true;
} }
return false; return false;
......
...@@ -202,19 +202,26 @@ namespace DeviceLibrary ...@@ -202,19 +202,26 @@ namespace DeviceLibrary
RobotManage.CameraA.CameraGrabOne(RobotManage.CameraA.GetFixtureStateFilename(From.posid, WareCode, storeMoveType, FixtureState.FromOut)); RobotManage.CameraA.CameraGrabOne(RobotManage.CameraA.GetFixtureStateFilename(From.posid, WareCode, storeMoveType, FixtureState.FromOut));
if (!ignoreFixtureCheck && !IgnoreX09 && IOManager.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.LOW)) if (!ignoreFixtureCheck && !IgnoreX09 && IOManager.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.LOW))
{ {
Msg.add(crc.GetString(L.out_store_not_detect_material, "出库时料叉X30没有检测到有物料无法继续,请检查."), MsgLevel.alarm, ErrInfo.X09_BoxNotDetect); Msg.add(crc.GetString(L.out_store_not_detect_material, "出库时料叉X23没有检测到有物料无法继续,请检查."), MsgLevel.alarm, ErrInfo.X09_BoxNotDetect);
//RobotManage.UserPause("出库时料叉X30没有检测到有物料无法继续,请检查"); //RobotManage.UserPause("出库时料叉X30没有检测到有物料无法继续,请检查");
} }
else else
{ {
if (!ignoreFixtureCheck && IOManager.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.LOW)) {
MoveInfo.log($"忽略物料:Device_DisableStorePosition:{Setting_Init.Device_DisableStorePosition.Val},库位:{From.posid},{WareCode}");
if (Setting_Init.Device_DisableStorePosition && From.posid != BoxStorePosition.strings && From.posid != BoxStorePosition.ngdoor && From.posid != BoxStorePosition.clamp)
{
MoveInfo.log($"料叉未检测到物料,屏蔽库位:{From.posid},{WareCode}");
RobotManage.mainMachine.ServerCM.DisabledPos(From.posid, WareCode);
}
}
Msg.add("", MsgLevel.info, ErrInfo.X09_Clear); Msg.add("", MsgLevel.info, ErrInfo.X09_Clear);
IgnoreX09 = false; IgnoreX09 = false;
if (To.posid == BoxStorePosition.strings && Setting_Init.Device_Use_Fixpos && Fix != null) if (To.posid == BoxStorePosition.strings && Setting_Init.Device_Use_Fixpos && Fix != null)
MoveInfo.NextMoveStep(MoveStep.StoreFIX01); MoveInfo.NextMoveStep(MoveStep.StoreFIX01);
else else
MoveInfo.NextMoveStep(MoveStep.StoreTS10); MoveInfo.NextMoveStep(MoveStep.StoreTS10);
MoveInfo.log($"{storeMoveType}:X30取到料"); MoveInfo.log($"{storeMoveType}:X23取到料");
InOutEndProcess(StoreMoveType.OutStore, From.posid); InOutEndProcess(StoreMoveType.OutStore, From.posid);
} }
break; break;
...@@ -309,7 +316,9 @@ namespace DeviceLibrary ...@@ -309,7 +316,9 @@ namespace DeviceLibrary
// //RobotManage.UserPause("入库后料叉X30上任然检测到物料,请检查"); // //RobotManage.UserPause("入库后料叉X30上任然检测到物料,请检查");
//} //}
//else //else
{ {
if (To.posid != BoxStorePosition.strings && To.posid != BoxStorePosition.ngdoor && To.posid != BoxStorePosition.clamp)
Comp_Axis.HomeMove(MoveInfo, true);
Msg.add("", MsgLevel.info, ErrInfo.X09_Clear); Msg.add("", MsgLevel.info, ErrInfo.X09_Clear);
IgnoreX09 = false; IgnoreX09 = false;
MoveInfo.NextMoveStep(MoveStep.StoreTS16); MoveInfo.NextMoveStep(MoveStep.StoreTS16);
......
...@@ -85,7 +85,7 @@ namespace DeviceLibrary ...@@ -85,7 +85,7 @@ namespace DeviceLibrary
else if (wait.WaitType.Equals(WaitEnum.W002_IOValue)) else if (wait.WaitType.Equals(WaitEnum.W002_IOValue))
{ {
ConfigIO io = RobotManage.Config.getWaitIO(wait.IoType); ConfigIO io = RobotManage.Config.getWaitIO(wait.IoType);
NotOkMsg = MoveInfo.Name + $" {crc.GetString(L.wait, "等待")}【" + io.DisplayStr + "】=【" + wait.IoValue + "】"; NotOkMsg = MoveInfo.Name + $" {crc.GetString(L.wait, "等待")}【" + io.ElectricalDefinition + " " + crc.GetString(io.ProName, io.Explain) + "】=【" + wait.IoValue + "】";
wait.IsEnd = IOManager.IOValue(wait.IoType).Equals(wait.IoValue); wait.IsEnd = IOManager.IOValue(wait.IoType).Equals(wait.IoValue);
if (!wait.IsEnd) if (!wait.IsEnd)
{ {
...@@ -93,7 +93,7 @@ namespace DeviceLibrary ...@@ -93,7 +93,7 @@ namespace DeviceLibrary
if (span.TotalMilliseconds > timeOutMs && NoAlarm()) if (span.TotalMilliseconds > timeOutMs && NoAlarm())
{ {
WarnMsg = MoveInfo.Name + "[" + MoveInfo.MoveStep + $"] {crc.GetString(L.wait, "等待")}(" + io.DisplayStr + "=" + wait.IoValue + $") {crc.GetString(L.timeout, "超时")}"; WarnMsg = MoveInfo.Name + "[" + MoveInfo.MoveStep + $"] {crc.GetString(L.wait, "等待")}(" + io.ElectricalDefinition + " " + crc.GetString(io.ProName, io.Explain) + "=" + wait.IoValue + $") {crc.GetString(L.timeout, "超时")}";
Msg.add(WarnMsg, MsgLevel.alarm); Msg.add(WarnMsg, MsgLevel.alarm);
if (NoAlarm()) if (NoAlarm())
......
...@@ -57,7 +57,7 @@ namespace DeviceLibrary ...@@ -57,7 +57,7 @@ namespace DeviceLibrary
public bool boxTransportIsFree { get => boxTransport.IsComplateOrFree; } public bool boxTransportIsFree { get => boxTransport.IsComplateOrFree; }
public event Action<string, StoreMoveType, bool> InOutEndProcessEvent; public event Action<string, StoreMoveType, bool> InOutEndProcessEvent;
ServerCommunication ServerCM = new ServerCommunication(); public ServerCommunication ServerCM = new ServerCommunication();
/// <summary> /// <summary>
/// 开始运行的时间 /// 开始运行的时间
/// </summary> /// </summary>
......
...@@ -427,6 +427,7 @@ namespace DeviceLibrary ...@@ -427,6 +427,7 @@ namespace DeviceLibrary
if (Setting_Init.SocketScanner_enable) { if (Setting_Init.SocketScanner_enable) {
LastCodeList = new List<CodeInfo>(); LastCodeList = new List<CodeInfo>();
if (RobotManage.socketScanner.Scan(Setting_Init.SocketScanner_trigger_code, Setting_Init.SocketScanner_pattern_code, out string code)) { if (RobotManage.socketScanner.Scan(Setting_Init.SocketScanner_trigger_code, Setting_Init.SocketScanner_pattern_code, out string code)) {
LastCodeList.Add(new CodeInfo(code, 0, 0)); LastCodeList.Add(new CodeInfo(code, 0, 0));
} }
} }
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!