Commit 043fa856 刘韬

SO1540 FAC_OPL修正

1 个父辈 5d993d2e
......@@ -76,9 +76,15 @@ namespace OnlineStore.Common
[MyConfigComment("超声波传感器液位距离")]
public static MyConfig<int> Device_Liquid_level_distance = 180;
[MyConfigComment("超声波传感器桶底距离")]
public static MyConfig<int> Device_Liquid_Max_distance = 380;
[MyConfigComment("取料检测位置,取料低点p3-偏移量")]
public static MyConfig<int> Device_TinDetect_Offset = 205000;
[MyConfigComment("step by step mode")]
public static MyConfig<bool> Device_step_by_step_mode = false;
[MyConfigComment("打印机IP地址")]
public static MyConfig<string> Printer_IP = "192.168.4.21";
[MyConfigComment("打印机标签模版")]
......
......@@ -295,11 +295,21 @@ namespace OnlineStore.Common
public static string selfAuditException = "selfAuditException";
public static string inDoorStatus= "inDoorStatus";
public static string outDoorStatus= "outDoorStatus";
public static string pauseBuzzer = "pauseBuzzer";
public static string open= "open";
public static string close= "close";
public static string openInLock= "openInLock";
public static string closeInLock = "closeInLock";
public static string closeOutLock = "closeOutLock";
public static string openOutLock = "openOutLock";
public static string D01Status = "D01Status";
public static string D02Status = "D02Status";
public static string D03Status = "D03Status";
public static string openD01 = "openD01";
public static string openD02 = "openD02";
public static string openD03 = "openD03";
public static string closeD01 = "closeD01";
public static string closeD02 = "closeD02";
public static string closeD03 = "closeD03";
}
}
......@@ -23,6 +23,9 @@ namespace DeviceLibrary
}
}
}
public static bool IsOn { get => State == AlarmBuzzerState.ON; }
static AlarmBuzzerState State = AlarmBuzzerState.OFF;
public static event EventHandler<bool> BuzzerStateChange;
public static void SetOnOffAction(Action ona, Action offa)
......
......@@ -6,9 +6,7 @@ using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace DeviceLibrary
{
......@@ -25,6 +23,9 @@ namespace DeviceLibrary
_storeStatus = value;
}
}
public string RfidMsg { get; set; }
static string server = Setting_Init.Device_Server_Address;
static string CID = Setting_Init.Device_CID;
int StoreID = 1;
......@@ -86,16 +87,33 @@ namespace DeviceLibrary
public void ProcessMsg(List<Msg> msg)
{
WarnMsg = string.Join(",", msg.Select(x =>
if (msg == null)
return;
WarnMsg = string.Join("\r\n", msg.Select(x =>
{
if (x.msgLevel == MsgLevel.warning || x.msgLevel == MsgLevel.alarm)
//if (x.msgLevel >= MsgLevel.warning)
{
return x.msgtxt;
return GetMsgPrefix(x.msgLevel) + x.msgtxt;
}
return null;
}
).Where(x => !string.IsNullOrEmpty(x)));
}
string GetMsgPrefix(MsgLevel msgLevel)
{
switch (msgLevel)
{
case MsgLevel.info:
return "I=";
case MsgLevel.warning:
return "W=";
case MsgLevel.alarm:
return "A=";
//case MsgLevel.crtical:
// return "C=";
}
return "";
}
public void SendInStoreRequest(string[] codelist, ReelParam reel, bool printlog = false)
{
......@@ -203,8 +221,17 @@ namespace DeviceLibrary
lineOperation.data = GetBtnStatus();
lineOperation.data.Add("inArea", CameraPointTest.inArea);
lineOperation.data.Add("outArea", CameraPointTest.outArea);
var c = RobotManage.dauxiKS107?.Distance - Setting_Init.Device_Liquid_level_distance;
if (c > Setting_Init.Device_Liquid_Max_distance)
c = Setting_Init.Device_Liquid_Max_distance;
lineOperation.data.Add("waterCurrValue", c);
lineOperation.data.Add("waterMaxValue", Setting_Init.Device_Liquid_Max_distance);
lineOperation.data.Add("rfidMsg", RfidMsg);
lineOperation.status = (int)storeStatus;
if (IOManager.IOValue(IO_Type.SuddenStop_BTN).Equals(IO_VALUE.LOW))
lineOperation.status = (int)StoreStatus.SuddenStop;
//判断如果是等待料盘拿走超时,状态改为4Warning
//if (alarmType.Equals(StoreAlarmType.IoSingleTimeOut) && StoreMove.MoveType.Equals(StoreMoveType.OutStore))
//{
......@@ -219,7 +246,7 @@ namespace DeviceLibrary
boxStatus.humidity = HumitureController.LastData.Humidity.ToString();
boxStatus.temperature = HumitureController.LastData.Temperate.ToString();
//状态
boxStatus.status = (int)storeStatus;
boxStatus.status = lineOperation.status;
string sendmsg = "";
......@@ -228,16 +255,20 @@ namespace DeviceLibrary
{
if (commandResultMsg.TryDequeue(out string msg))
{
sendmsg = msg.Trim().Trim(',');
sendmsg = "I="+msg.Trim().Trim(',');
}
}
else if (!string.IsNullOrEmpty(WarnMsg))
{
sendmsg = string.Join(",", new string[] { WarnMsg });
sendmsg = WarnMsg;
}
else if (IOManager.IOValue(IO_Type.SuddenStop_BTN).Equals(IO_VALUE.LOW))
{
sendmsg = "A=" + crc.GetString("Res0100", "急停中");
}
else if (!RobotManage.isRunning)
{
sendmsg = crc.GetString("Res0059","设备未启动");
sendmsg = "I=" + crc.GetString("Res0059", "设备未启动");
}
lineOperation.msg = sendmsg;
......@@ -360,7 +391,7 @@ namespace DeviceLibrary
selfAudit = false;
if (dataMap.ContainsKey(ParamDefine.selfAuditException))
{
if (dataMap[ParamDefine.selfAuditException].ToString()=="true")
if (dataMap[ParamDefine.selfAuditException].ToString() == "true")
selfAuditException = true;
}
else
......@@ -369,7 +400,7 @@ namespace DeviceLibrary
if (dataMap.ContainsKey(ParamDefine.openInLock) && dataMap[ParamDefine.openInLock].Equals(ParamDefine.doit))
{
LogUtil.info(StoreName + "收到服务器命令:openInLock=doit");
IOManager.IOMove(IO_Type.Entry_Drawer_Lock,IO_VALUE.LOW);
IOManager.IOMove(IO_Type.Entry_Drawer_Lock, IO_VALUE.LOW);
result = "";
}
else if (dataMap.ContainsKey(ParamDefine.closeInLock) && dataMap[ParamDefine.closeInLock].Equals(ParamDefine.doit))
......@@ -387,7 +418,7 @@ namespace DeviceLibrary
else
{
RobotManage.mainMachine.StoreMoveInfo.log(StoreName + " 服务器锁定抽屉,有自检错误,不允许入库");
result = crc.GetString("Res0171.14f1eca7","有自检错误,仅锁入库抽屉");
result = crc.GetString("Res0171.14f1eca7", "有自检错误,仅锁入库抽屉");
}
}
......@@ -403,6 +434,78 @@ namespace DeviceLibrary
IOManager.IOMove(IO_Type.Out_Drawer_Lock, IO_VALUE.HIGH);
result = "";
}
if (dataMap.ContainsKey(ParamDefine.pauseBuzzer) && dataMap[ParamDefine.pauseBuzzer].Equals(ParamDefine.doit))
{
LogUtil.info(StoreName + "收到服务器命令:pauseBuzzer=doit");
AlarmBuzzer.MuteOnce();
result = "";
}
if (dataMap.ContainsKey(ParamDefine.closeD01) && dataMap[ParamDefine.closeD01].Equals(ParamDefine.doit))
{
LogUtil.info(StoreName + "收到服务器命令:closeD01=doit");
if (IOManager.IOValue(IO_Type.LeftDoor_Check).Equals(IO_VALUE.HIGH))
{
result = "D01" + crc.GetString("Res0188.d613f80c", "已上锁");
IOManager.IOMove(IO_Type.LeftDoor_Lock, IO_VALUE.HIGH);
}
else
{
result = "D01" + crc.GetString("Res0189.64eaf95f", "未关闭,无法上锁");
}
LogUtil.info(result);
}
if (dataMap.ContainsKey(ParamDefine.closeD02) && dataMap[ParamDefine.closeD02].Equals(ParamDefine.doit))
{
LogUtil.info(StoreName + "收到服务器命令:closeD02=doit");
if (IOManager.IOValue(IO_Type.RightDoor_Check).Equals(IO_VALUE.HIGH))
{
result = "D02" + crc.GetString("Res0188.d613f80c", "已上锁");
IOManager.IOMove(IO_Type.RightDoor_Lock, IO_VALUE.HIGH);
}
else
{
result = "D02" + crc.GetString("Res0189.64eaf95f", "未关闭,无法上锁");
}
LogUtil.info(result);
}
if (dataMap.ContainsKey(ParamDefine.closeD03) && dataMap[ParamDefine.closeD03].Equals(ParamDefine.doit))
{
LogUtil.info(StoreName + "收到服务器命令:closeD03=doit");
if (IOManager.IOValue(IO_Type.PrinterDoor_Check).Equals(IO_VALUE.HIGH))
{
result = "D03" + crc.GetString("Res0188.d613f80c", "已上锁");
IOManager.IOMove(IO_Type.PrinterDoor_Lock, IO_VALUE.HIGH);
}
else
{
result = "D03" + crc.GetString("Res0189.64eaf95f", "未关闭,无法上锁");
}
LogUtil.info(result);
}
if (dataMap.ContainsKey(ParamDefine.openD01) && dataMap[ParamDefine.openD01].Equals(ParamDefine.doit))
{
LogUtil.info(StoreName + "收到服务器命令:openD01=doit");
IOManager.IOMove(IO_Type.LeftDoor_Lock, IO_VALUE.LOW);
result = "D01" + crc.GetString("Res0190.9377bdb2", "已解锁");
}
if (dataMap.ContainsKey(ParamDefine.openD02) && dataMap[ParamDefine.openD02].Equals(ParamDefine.doit))
{
LogUtil.info(StoreName + "收到服务器命令:openD02=doit");
IOManager.IOMove(IO_Type.RightDoor_Lock, IO_VALUE.LOW);
result = "D02" + crc.GetString("Res0190.9377bdb2", "已解锁");
}
if (dataMap.ContainsKey(ParamDefine.openD03) && dataMap[ParamDefine.openD03].Equals(ParamDefine.doit))
{
LogUtil.info(StoreName + "收到服务器命令:openD03=doit");
IOManager.IOMove(IO_Type.PrinterDoor_Lock, IO_VALUE.LOW);
result = "D03" + crc.GetString("Res0190.9377bdb2", "已解锁");
}
if (!result.Equals(""))
{
LogUtil.info(StoreName + "收到服务器命令:执行返回:" + result);
......@@ -423,6 +526,10 @@ namespace DeviceLibrary
Dictionary<string, object> map = new Dictionary<string, object>();
map.Add(ParamDefine.inDoorStatus, ParamDefine.disable);
map.Add(ParamDefine.outDoorStatus, ParamDefine.disable);
map.Add(ParamDefine.pauseBuzzer, ParamDefine.disable);
map.Add(ParamDefine.D01Status, ParamDefine.disable);
map.Add(ParamDefine.D02Status, ParamDefine.disable);
map.Add(ParamDefine.D03Status, ParamDefine.disable);
if (storeStatus == StoreStatus.ResetMove
|| storeStatus == StoreStatus.SuddenStop
......@@ -430,21 +537,23 @@ namespace DeviceLibrary
)
return map;
if (IOManager.IOValue(IO_Type.Entry_Drawer).Equals(IO_VALUE.LOW)) {
map[ParamDefine.inDoorStatus]=ParamDefine.disable;
if (IOManager.IOValue(IO_Type.Entry_Drawer).Equals(IO_VALUE.LOW))
{
map[ParamDefine.inDoorStatus] = ParamDefine.disable;
}
else if (IOManager.IOValue(IO_Type.Entry_Drawer_Lock).Equals(IO_VALUE.HIGH)
&& RobotManage.mainMachine.StoreMoveInfo.MoveStep == MoveStep.Wait)
{
map[ParamDefine.inDoorStatus] = ParamDefine.close;
}else if ((RobotManage.mainMachine.newDrawer || IOManager.IOValue(IO_Type.Entry_Drawer_Lock).Equals(IO_VALUE.LOW))
}
else if ((RobotManage.mainMachine.newDrawer || IOManager.IOValue(IO_Type.Entry_Drawer_Lock).Equals(IO_VALUE.LOW))
&& RobotManage.mainMachine.StoreMoveInfo.MoveStep == MoveStep.Wait)
{
map[ParamDefine.inDoorStatus] = ParamDefine.open;
}
if (IOManager.IOValue(IO_Type.Out_Drawer).Equals(IO_VALUE.LOW))
{
map[ParamDefine.outDoorStatus]= ParamDefine.disable;
map[ParamDefine.outDoorStatus] = ParamDefine.disable;
}
else if (IOManager.IOValue(IO_Type.Out_Drawer_Lock).Equals(IO_VALUE.HIGH)
&& RobotManage.mainMachine.StoreMoveInfo.MoveStep == MoveStep.Wait)
......@@ -456,7 +565,34 @@ namespace DeviceLibrary
{
map[ParamDefine.outDoorStatus] = ParamDefine.open;
}
if (AlarmBuzzer.IsOn)
{
map[ParamDefine.pauseBuzzer] = ParamDefine.enable;
}
if (IOManager.IOValue(IO_Type.LeftDoor_Lock).Equals(IO_VALUE.LOW))
{
map[ParamDefine.D01Status] = ParamDefine.open;
}
else
{
map[ParamDefine.D01Status] = ParamDefine.close;
}
if (IOManager.IOValue(IO_Type.RightDoor_Lock).Equals(IO_VALUE.LOW))
{
map[ParamDefine.D02Status] = ParamDefine.open;
}
else
{
map[ParamDefine.D02Status] = ParamDefine.close;
}
if (IOManager.IOValue(IO_Type.PrinterDoor_Lock).Equals(IO_VALUE.LOW))
{
map[ParamDefine.D03Status] = ParamDefine.open;
}
else
{
map[ParamDefine.D03Status] = ParamDefine.close;
}
return map;
}
......@@ -473,8 +609,8 @@ namespace DeviceLibrary
//服务器返回时有:posId库位编号,plateW:料盘宽度,plateH:料盘高度,
//postId格式BoxId#位置
string posId = data[ParamDefine.posId].ToString();
string usedCountstr= data["usedCount"].ToString();
string expireDate= data["expiredDate"].ToString();
string usedCountstr = data["usedCount"].ToString();
string expireDate = data["expiredDate"].ToString();
string exposureStartDate = data["exposureStartDate"].ToString();
string stabilizationEndDate = data["stabilizationEndDate"].ToString();
//int storeId = int.Parse(posArray[0]);
......@@ -498,13 +634,13 @@ namespace DeviceLibrary
RobotManage.mainMachine.LabelingMoveInfo.MoveParam.Time2 = stabilizationEndDate;
RobotManage.mainMachine.LabelingMoveInfo.MoveParam.Time3 = expireDate;
//如果当前正在出入库中,需要记录下来,等待空闲时执行
LogUtil.info(StoreName + " 收到服务器入库命令:库位号【" + posId + ",usedCount" + usedCount + ",exposureStartDate="+ exposureStartDate + ",stabilizationEndDate="+ stabilizationEndDate + ",expireDate"+ expireDate + "】二维码【" + message + "】 开始入库!");
LogUtil.info(StoreName + " 收到服务器入库命令:库位号【" + posId + ",usedCount" + usedCount + ",exposureStartDate=" + exposureStartDate + ",stabilizationEndDate=" + stabilizationEndDate + ",expireDate" + expireDate + "】二维码【" + message + "】 开始入库!");
}
else
{
string msg = crc.CurrLanguage != "zh-CN"? resultOperation.msgEn: resultOperation.msg;
string msg = crc.CurrLanguage != "zh-CN" ? resultOperation.msgEn : resultOperation.msg;
SendStoreState("", StoreStatus.InStoreError);
RobotManage.mainMachine.LabelingMoveInfo.MoveParam.IsNg = true;
RobotManage.mainMachine.LabelingMoveInfo.MoveParam.NgMsg = msg;
......@@ -740,7 +876,8 @@ namespace DeviceLibrary
j.batchNo = batchNo;
return j;
}
catch (Exception ex) {
catch (Exception ex)
{
LogUtil.info("SelfAudit:" + data.data.ToString());
return null;
}
......@@ -776,7 +913,7 @@ namespace DeviceLibrary
return msg;
}
public string SelfAudit_posSelfAuditEnd(string posName,string barcode,string actualBarcode)
public string SelfAudit_posSelfAuditEnd(string posName, string barcode, string actualBarcode)
{
string msg = "";
try
......
......@@ -4,6 +4,7 @@ using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
......@@ -29,6 +30,7 @@ namespace DeviceLibrary
}
int logType = 1000;
string WarnMsg = "";
Dictionary<DateTime, WaitResultInfo> delaymsg = new Dictionary<DateTime, WaitResultInfo>();
public bool CheckWait(MoveInfo MoveInfo)
{
//当等待超过一分钟时,需要打印提示
......@@ -44,11 +46,26 @@ namespace DeviceLibrary
{
isOk = false;
}
foreach (var d in delaymsg.Keys.ToArray())
{
if (d > DateTime.Now)
{
var w = delaymsg[d];
Msg.add("WaitType." + w.WaitType, w.ActionMsg, w.Data);
}
else
{
delaymsg.Remove(d);
}
}
MoveInfo.WaitList.ForEach((w) => {
if (w.WaitType.Equals(WaitEnum.W014_Msg)) {
w.IsEnd = true;
Msg.add("WaitType."+ w.WaitType, w.ActionMsg, w.Data);
if (w.TimeMSeconds > 0)
{
delaymsg.Add(DateTime.Now.AddSeconds(w.TimeMSeconds/1000), w);
}
}
});
foreach (WaitResultInfo wait in MoveInfo.WaitList.ToArray())
......
......@@ -59,12 +59,12 @@ namespace DeviceLibrary
//}
if (RobotManage.dauxiKS107.Distance < Setting_Init.Device_Liquid_level_distance) {
Msg.add(crc.GetString("Res0163.f6ad5099","冷凝液回收桶已满"), MsgLevel.warning);
Msg.add(crc.GetString("Res0163.f6ad5099","冷凝液回收桶已满"), MsgLevel.alarm);
}
if (IOValue(IO_Type.Airpressure_Check).Equals(IO_VALUE.LOW)) {
Msg.add(crc.GetString("Res0079","未检测到气压信号."), MsgLevel.warning);
Msg.add(crc.GetString("Res0079","未检测到气压信号."), MsgLevel.alarm);
}
//airprocess();
......
......@@ -248,6 +248,10 @@ namespace DeviceLibrary
{
return false;
}
if (IOValue(IO_Type.ElecDoor_Check).Equals(IO_VALUE.LOW))
{
return false;
}
if (IOValue(IO_Type.LeftDoor_Check).Equals(IO_VALUE.HIGH))
{
return false;
......@@ -372,6 +376,7 @@ namespace DeviceLibrary
public void Stop() {
mstart = false;
AutoInOutTest = false;
ServerCM.storeStatus = StoreStatus.None;
ServerCM.StopConnectServer();
Thread.Sleep(300);
Alarm(AlarmType.None);
......@@ -506,7 +511,22 @@ namespace DeviceLibrary
ok = false;
DeviceSuddenStop();
}
Msg.add("printdoor",crc.GetString("Res0134","打印机维护门未关闭") + (ok ? ignorestring : ""), MsgLevel.alarm);
if (Setting_Init.Module_No == Module_SO.SO21637)
Msg.add("printdoor", "D03" + crc.GetString("Res0183.781c71a4","未关闭") + (ok ? ignorestring : ""), MsgLevel.alarm);
else
Msg.add("printdoor", crc.GetString("Res0134", "打印机维护门未关闭") + (ok ? ignorestring : ""), MsgLevel.alarm);
}
if (IOValue(IO_Type.ElecDoor_Check).Equals(IO_VALUE.LOW))
{
if (!IgnoreSafecheck)
{
ok = false;
DeviceSuddenStop();
}
if (Setting_Init.Module_No == Module_SO.SO21637)
Msg.add("printdoor", "D04" + crc.GetString("Res0183.781c71a4","未关闭") + (ok ? ignorestring : ""), MsgLevel.alarm);
else
Msg.add("printdoor", crc.GetString("Res0134", "打印机维护门未关闭") + (ok ? ignorestring : ""), MsgLevel.alarm);
}
if (IOValue(IO_Type.LeftDoor_Check).Equals(IO_VALUE.HIGH))
{
......@@ -515,6 +535,9 @@ namespace DeviceLibrary
ok = false;
DeviceSuddenStop();
}
if (Setting_Init.Module_No == Module_SO.SO21637)
Msg.add("printdoor", "D01" + crc.GetString("Res0183.781c71a4","未关闭") + (ok ? ignorestring : ""), MsgLevel.alarm);
else
Msg.add("leftsafedoor",crc.GetString("Res0097","左侧防护门没有关闭") + (ok ? ignorestring : ""), MsgLevel.alarm);
}
if (IOValue(IO_Type.RightDoor_Check).Equals(IO_VALUE.HIGH))
......@@ -524,11 +547,17 @@ namespace DeviceLibrary
ok = false;
DeviceSuddenStop();
}
if (Setting_Init.Module_No == Module_SO.SO21637)
Msg.add("printdoor", "D02" + crc.GetString("Res0183.781c71a4","未关闭") + (ok ? ignorestring : ""), MsgLevel.alarm);
else
Msg.add("rightsafedoor", crc.GetString("Res0098","右侧防护门没有关闭") + (ok ? ignorestring : ""), MsgLevel.alarm);
}
if (IOValue(IO_Type.SafeDoor_Disable).Equals(IO_VALUE.LOW) && IOValue(IO_Type.DoorLock_Check).Equals(IO_VALUE.LOW))
{
if (Setting_Init.Module_No == Module_SO.SO21637)
Msg.add("printdoor", "D01,D02" + crc.GetString("Res0184.9246169f","上锁失败") + (ok ? ignorestring : ""), MsgLevel.alarm);
else
Msg.add(crc.GetString("Res0135","防护门没有锁定"), MsgLevel.warning);
DeviceSuddenStop();
ok = false;
......@@ -536,12 +565,18 @@ namespace DeviceLibrary
if (StoreMoveInfo.MoveStep != MoveStep.Wait && IOValue(IO_Type.Entry_Drawer_Lock).Equals(IO_VALUE.LOW))
{
if (Setting_Init.Module_No == Module_SO.SO21637)
Msg.add("printdoor", "P01" + crc.GetString("Res0183.781c71a4","未关闭") + (ok ? ignorestring : ""), MsgLevel.alarm);
else
Msg.add(crc.GetString("Res0164.37b8d13a","出入库时请关好入库抽屉"), MsgLevel.alarm);
DeviceSuddenStop();
ok = false;
}
if (StoreMoveInfo.MoveStep != MoveStep.Wait && StoreMoveInfo.MoveStep < MoveStep.StoreOut14 && IOValue(IO_Type.Out_Drawer_Lock).Equals(IO_VALUE.LOW))
{
if (Setting_Init.Module_No == Module_SO.SO21637)
Msg.add("printdoor", "P02" + crc.GetString("Res0183.781c71a4","未关闭") + (ok ? ignorestring : ""), MsgLevel.alarm);
else
Msg.add(crc.GetString("Res0165.970b4edb","出入库时请关好出库抽屉"), MsgLevel.alarm);
DeviceSuddenStop();
ok = false;
......
......@@ -206,6 +206,8 @@ namespace DeviceLibrary
LabelingMoveInfo.NextMoveStep(MoveStep.Labeling09);
RotateEquip.TurnToEnd(false);
LabelingMoveInfo.log("滚动回位");
if (Setting_Init.Device_step_by_step_mode)
RobotManage.UserPause();
break;
case MoveStep.Labeling09:
if (RotateEquip.WaitStatus(null))
......
......@@ -177,6 +177,8 @@ namespace DeviceLibrary
StoreMoveInfo.NextMoveStep(MoveStep.StoreIn03);
LabelingMoveInfo.NewMove(MoveStep.Labeling01);
StoreMoveInfo.log($"等待贴标完成");
if (Setting_Init.Device_step_by_step_mode)
RobotManage.UserPause();
}
else
{
......@@ -214,6 +216,8 @@ namespace DeviceLibrary
StoreMoveInfo.NextMoveStep(MoveStep.StoreIn04);
StoreMoveInfo.log($"收到完成贴标");
ServerCM.SendStoreState(StoreMoveInfo.MoveParam.PosID, StoreStatus.InStoreExecute);
if (Setting_Init.Device_step_by_step_mode)
RobotManage.UserPause();
}
}
else
......@@ -239,11 +243,16 @@ namespace DeviceLibrary
case MoveStep.StoreIn05:
if (!boxTransport.IsComplateOrFree)
break;
Setting_Init.Runtime_Step = Runtime_StepE.None;
if (StoreMoveInfo.MoveParam.usedCount == 0 && !Setting_Init.Device_Disable_RFID_Check || Setting_Init.Module_No.Val == Module_SO.SO21637)
{
if (StoreMoveInfo.MoveParam.RFID.Length > 16)
StoreMoveInfo.MoveParam.RFID = StoreMoveInfo.MoveParam.RFID.Substring(0, 16);
StoreMoveInfo.Msg(crc.GetString("Res0185.7b3d057f","正在写入RFID"), MsgLevel.info);
ServerCM.RfidMsg = crc.GetString("Res0185.7b3d057f", "正在写入RFID");
bool writeok = false;
var r=RobotManage.RFID.ReOpen();
var r1=RobotManage.RFID2?.ReOpen();
......@@ -300,7 +309,7 @@ namespace DeviceLibrary
if (!writeok)
{
var of = i * 2000 * (i % 2 == 0 ? 1 : -1);
var of = i * 3000 * (i % 2 == 0 ? 1 : -1);
var zp = Z_Axis.GetAclPosition() + of;
var yp = Y_Axis.GetAclPosition() + of;
var zt = Z_Axis.AbsMoveASYNC(zp, Config.Z_Axis_P1_speed);
......@@ -309,7 +318,8 @@ namespace DeviceLibrary
}
//Thread.Sleep(100);
}
if (!writeok) {
if (!writeok)
{
StoreMoveInfo.NextMoveStep(MoveStep.StoreIn08);
StoreMoveInfo.MoveParam.ReelOnFixture = true;
StoreMoveInfo.MoveParam.IsNg = true;
......@@ -317,8 +327,18 @@ namespace DeviceLibrary
StoreMoveInfo.log($"RFID 写入失败 NG");
ServerCM.cancelPutInTask("", StoreMoveInfo.MoveParam.WareCode);
Z_Axis.AbsMove(StoreMoveInfo, Config.Z_Axis_P1, Config.Z_Axis_P1_speed);
StoreMoveInfo.Msg(crc.GetString("Res0186.7faa6f6b","RFID 写入失败"), MsgLevel.info, 5);
ServerCM.RfidMsg = crc.GetString("Res0186.7faa6f6b", "RFID 写入失败");
if (Setting_Init.Device_step_by_step_mode)
RobotManage.UserPause();
return;
}
else
{
StoreMoveInfo.Msg(crc.GetString("Res0187.6b2d7028","RFID 写入成功"), MsgLevel.info, 5);
ServerCM.RfidMsg = crc.GetString("Res0187.6b2d7028", "RFID 写入成功");
}
}
StoreMoveInfo.NextMoveStep(MoveStep.StoreIn09);
from = CSVPositionReader<ACStorePosition>.GetPositon(RFIDP);
......@@ -327,6 +347,9 @@ namespace DeviceLibrary
StoreMoveInfo.MoveParam.ReelOnFixture = true;
boxTransport.Start(new BoxStorePosition(Config, from, StoreMoveInfo.MoveParam), new BoxStorePosition(Config, to, StoreMoveInfo.MoveParam), StoreMoveType.InStore, true);
StoreMoveInfo.log($"开始转运到入库位置");
if (Setting_Init.Device_step_by_step_mode)
RobotManage.UserPause();
break;
case MoveStep.StoreIn06:
StoreMoveInfo.NextMoveStep(MoveStep.StoreIn07);
......@@ -409,6 +432,8 @@ namespace DeviceLibrary
StoreMoveInfo.NewMove(MoveStep.StoreIn01);
else
StoreMoveInfo.NewMove(MoveStep.Wait);
ServerCM.RfidMsg = "";
break;
case MoveStep.StoreOut10:
if (IOValue(IO_Type.Out_Drawer).Equals(IO_VALUE.HIGH) && IOValue(IO_Type.Out_Drawer_Lock).Equals(IO_VALUE.HIGH))
......@@ -566,7 +591,8 @@ namespace DeviceLibrary
StoreMoveInfo.MoveParam.ReelOnFixture = true;
boxTransport.Start(new BoxStorePosition(Config, from, StoreMoveInfo.MoveParam), new BoxStorePosition(Config, to, StoreMoveInfo.MoveParam), StoreMoveType.OutStore, true);
if (Setting_Init.Device_step_by_step_mode)
RobotManage.UserPause();
}
break;
case MoveStep.StoreOut12:
......
......@@ -136,9 +136,9 @@ namespace DeviceLibrary
LogUtil.error(msg);
}
}
public void Msg(string msg, MsgLevel msgLevel)
public void Msg(string msg, MsgLevel msgLevel, int keepsec = 0)
{
WaitList.Add(WaitResultInfo.WaitMsg(msg, msgLevel));
WaitList.Add(WaitResultInfo.WaitMsg(msg, msgLevel, keepsec));
}
}
......@@ -222,11 +222,12 @@ namespace DeviceLibrary
wait.ActionMsg = msg;
return wait;
}
public static WaitResultInfo WaitMsg(string msg, MsgLevel msgLevel)
public static WaitResultInfo WaitMsg(string msg, MsgLevel msgLevel, int keepsec=0)
{
WaitResultInfo wait = new WaitResultInfo();
wait.WaitType = WaitEnum.W014_Msg;
wait.ActionMsg = msg;
wait.TimeMSeconds = keepsec*1000;
wait.IsEnd = true;
wait.Data = msgLevel;
return wait;
......
......@@ -150,7 +150,7 @@ namespace OnlineStore.LoadCSVLibrary
for (int i = 0; i < array.Length; i++)
{
string title = array[i];
if (cvsTitleList.Contains(title))
//if (cvsTitleList.Contains(title))
{
titleIndex.Add(title, i);
}
......
......@@ -52,6 +52,7 @@ DI,0,锡膏定位翻转水平端,Tin_Dock_Flip_Horizontal,28,HC,X28,,,,,,,,,,
DI,0,锡膏定位翻转垂直端,Tin_Dock_Flip_Vertical,29,HC,X29,,,,,,,,,,
DI,0,锡膏定位旋转水平端,Tin_Dock_Rotate_Horizontal,30,HC,X30,,,,,,,,,,
DI,0,锡膏定位旋转垂直端,Tin_Dock_Rotate_Vertical,31,HC,X31,,,,,,,,,,
DI,0,电器柜门禁,ElecDoor_Check,32,HC,X32,,,,,,,,,,
,,,,,,,,,,,,,,,,
DO,0,自动指示灯,AuroRun_Led,0,HC,Y00,,,,,,,,,,
DO,0,故障指示灯,Alarm_Led,1,HC,Y01,,,,,,,,,,
......
......@@ -263,7 +263,7 @@ namespace OnlineStore.LoadCSVLibrary
string value = array[csvIndex];
if (value.Equals(position.PositionNum))
{
string newValue = PostionToString(position, titleIndex, proTitleMap);
string newValue = PostionToString(position, titleIndex, proTitleMap, array);
lines[index] = newValue;
return WriteCSVFile(filePath, lines);
}
......@@ -274,13 +274,13 @@ namespace OnlineStore.LoadCSVLibrary
return true;
}
private static string PostionToString(StorePostionBase position, Dictionary<string, int> titleIndex, Dictionary<string, string> proTitleMap)
private static string PostionToString(StorePostionBase position, Dictionary<string, int> titleIndex, Dictionary<string, string> proTitleMap, string[] oldline)
{
//取得属性集合
PropertyInfo[] props = typeof(T).GetProperties();
List<string> cvsTitleList = new List<string>(proTitleMap.Values);
List<string> propertyList = new List<string>(proTitleMap.Keys);
String[] array = new String[titleIndex.Count];
String[] array = oldline.ToArray();
foreach (string proName in proTitleMap.Keys)
{
PropertyInfo prop = props.First(c => c.Name == proName);//获取同名属性
......
......@@ -52,6 +52,10 @@ namespace OnlineStore.LoadCSVLibrary
/// </summary>
public static string RightDoor_Check = "RightDoor_Check";
/// <summary>
/// DI,0,电器柜门禁,RightDoor_Check,32,HC,X32,,,,,,,,,,
/// </summary>
public static string ElecDoor_Check = "ElecDoor_Check";
/// <summary>
/// DI,0,门禁锁定监控,DoorLock_Check,6,HC,X06,,,,,,,,,,
/// </summary>
public static string DoorLock_Check = "DoorLock_Check";
......
......@@ -74,12 +74,14 @@ namespace TheMachine
private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{
LogUtil.error(e.ToString());
LogUtil.error("CurrentDomain_UnhandledException:" + e.ToString());
LogUtil.error("CurrentDomain_UnhandledException:" + e.ExceptionObject.ToString());
}
private static void Application_ThreadException(object sender, ThreadExceptionEventArgs e)
{
LogUtil.error(e.ToString());
LogUtil.error("Application_ThreadException:" + e.ToString());
LogUtil.error("Application_ThreadException:" + e.Exception.ToString());
}
......
......@@ -33,28 +33,28 @@ namespace TheMachine
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage_set = new System.Windows.Forms.TabPage();
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
this.panel1 = new System.Windows.Forms.Panel();
this.tp = new System.Windows.Forms.TableLayoutPanel();
this.chbAutoRun = new System.Windows.Forms.CheckBox();
this.lbl_Liquidstatus = new System.Windows.Forms.Label();
this.cb_labelingtestmoce = new System.Windows.Forms.CheckBox();
this.btn_testlabeling = new System.Windows.Forms.Button();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.label2 = new System.Windows.Forms.Label();
this.btn_printertest = new System.Windows.Forms.Button();
this.btn_labeledit = new System.Windows.Forms.Button();
this.cb_labelselect = new System.Windows.Forms.ComboBox();
this.btn_testlabeling = new System.Windows.Forms.Button();
this.uC_SetUserPassword1 = new TheMachine.UC_SetUserPassword();
this.tp = new System.Windows.Forms.TableLayoutPanel();
this.chbAutoRun = new System.Windows.Forms.CheckBox();
this.lbl_Liquidstatus = new System.Windows.Forms.Label();
this.tabPage_ledtower = new System.Windows.Forms.TabPage();
this.uC_LedConfig1 = new TheMachine.UC.UC_LedConfig();
this.panel1 = new System.Windows.Forms.Panel();
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
this.tabControl1.SuspendLayout();
this.tabPage_set.SuspendLayout();
this.groupBox1.SuspendLayout();
this.flowLayoutPanel1.SuspendLayout();
this.panel1.SuspendLayout();
this.tp.SuspendLayout();
this.groupBox1.SuspendLayout();
this.tabPage_ledtower.SuspendLayout();
this.panel1.SuspendLayout();
this.flowLayoutPanel1.SuspendLayout();
this.SuspendLayout();
//
// timer1
......@@ -85,6 +85,75 @@ namespace TheMachine
this.tabPage_set.UseVisualStyleBackColor = true;
this.tabPage_set.Click += new System.EventHandler(this.tabPage_set_Click);
//
// flowLayoutPanel1
//
this.flowLayoutPanel1.Controls.Add(this.panel1);
this.flowLayoutPanel1.Controls.Add(this.uC_SetUserPassword1);
this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.flowLayoutPanel1.Location = new System.Drawing.Point(3, 3);
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
this.flowLayoutPanel1.Size = new System.Drawing.Size(1010, 708);
this.flowLayoutPanel1.TabIndex = 16;
//
// panel1
//
this.panel1.Controls.Add(this.tp);
this.panel1.Controls.Add(this.cb_labelingtestmoce);
this.panel1.Controls.Add(this.groupBox1);
this.panel1.Controls.Add(this.btn_testlabeling);
this.panel1.Location = new System.Drawing.Point(3, 3);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(473, 460);
this.panel1.TabIndex = 15;
//
// tp
//
this.tp.AutoSize = true;
this.tp.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.tp.ColumnCount = 2;
this.tp.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tp.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tp.Controls.Add(this.chbAutoRun, 0, 7);
this.tp.Controls.Add(this.lbl_Liquidstatus, 0, 4);
this.tp.Location = new System.Drawing.Point(6, 13);
this.tp.Name = "tp";
this.tp.RowCount = 9;
this.tp.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tp.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tp.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tp.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tp.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tp.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tp.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tp.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tp.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tp.Size = new System.Drawing.Size(136, 68);
this.tp.TabIndex = 6;
//
// chbAutoRun
//
this.chbAutoRun.AutoSize = true;
this.tp.SetColumnSpan(this.chbAutoRun, 2);
this.chbAutoRun.Location = new System.Drawing.Point(10, 42);
this.chbAutoRun.Margin = new System.Windows.Forms.Padding(10);
this.chbAutoRun.Name = "chbAutoRun";
this.chbAutoRun.Size = new System.Drawing.Size(84, 16);
this.chbAutoRun.TabIndex = 1;
this.chbAutoRun.Text = "开机自启动";
this.chbAutoRun.UseVisualStyleBackColor = true;
//
// lbl_Liquidstatus
//
this.lbl_Liquidstatus.AutoSize = true;
this.tp.SetColumnSpan(this.lbl_Liquidstatus, 2);
this.lbl_Liquidstatus.Location = new System.Drawing.Point(10, 10);
this.lbl_Liquidstatus.Margin = new System.Windows.Forms.Padding(10);
this.lbl_Liquidstatus.Name = "lbl_Liquidstatus";
this.lbl_Liquidstatus.Size = new System.Drawing.Size(53, 12);
this.lbl_Liquidstatus.TabIndex = 5;
this.lbl_Liquidstatus.Tag = "not";
this.lbl_Liquidstatus.Text = "当前状态";
//
// cb_labelingtestmoce
//
this.cb_labelingtestmoce.AutoSize = true;
......@@ -96,17 +165,6 @@ namespace TheMachine
this.cb_labelingtestmoce.UseVisualStyleBackColor = true;
this.cb_labelingtestmoce.CheckedChanged += new System.EventHandler(this.cb_labelingtestmoce_CheckedChanged);
//
// btn_testlabeling
//
this.btn_testlabeling.Enabled = false;
this.btn_testlabeling.Location = new System.Drawing.Point(6, 362);
this.btn_testlabeling.Name = "btn_testlabeling";
this.btn_testlabeling.Size = new System.Drawing.Size(201, 38);
this.btn_testlabeling.TabIndex = 13;
this.btn_testlabeling.Text = "Test the labeling once";
this.btn_testlabeling.UseVisualStyleBackColor = true;
this.btn_testlabeling.Click += new System.EventHandler(this.btn_testlabeling_Click);
//
// groupBox1
//
this.groupBox1.Controls.Add(this.label2);
......@@ -157,6 +215,17 @@ namespace TheMachine
this.cb_labelselect.Size = new System.Drawing.Size(198, 20);
this.cb_labelselect.TabIndex = 0;
//
// btn_testlabeling
//
this.btn_testlabeling.Enabled = false;
this.btn_testlabeling.Location = new System.Drawing.Point(6, 362);
this.btn_testlabeling.Name = "btn_testlabeling";
this.btn_testlabeling.Size = new System.Drawing.Size(201, 38);
this.btn_testlabeling.TabIndex = 13;
this.btn_testlabeling.Text = "Test the labeling once";
this.btn_testlabeling.UseVisualStyleBackColor = true;
this.btn_testlabeling.Click += new System.EventHandler(this.btn_testlabeling_Click);
//
// uC_SetUserPassword1
//
this.uC_SetUserPassword1.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
......@@ -166,54 +235,6 @@ namespace TheMachine
this.uC_SetUserPassword1.Size = new System.Drawing.Size(482, 309);
this.uC_SetUserPassword1.TabIndex = 7;
//
// tp
//
this.tp.AutoSize = true;
this.tp.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.tp.ColumnCount = 2;
this.tp.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tp.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tp.Controls.Add(this.chbAutoRun, 0, 7);
this.tp.Controls.Add(this.lbl_Liquidstatus, 0, 4);
this.tp.Location = new System.Drawing.Point(6, 13);
this.tp.Name = "tp";
this.tp.RowCount = 9;
this.tp.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tp.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tp.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tp.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tp.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tp.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tp.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tp.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tp.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tp.Size = new System.Drawing.Size(136, 68);
this.tp.TabIndex = 6;
//
// chbAutoRun
//
this.chbAutoRun.AutoSize = true;
this.tp.SetColumnSpan(this.chbAutoRun, 2);
this.chbAutoRun.Location = new System.Drawing.Point(10, 42);
this.chbAutoRun.Margin = new System.Windows.Forms.Padding(10);
this.chbAutoRun.Name = "chbAutoRun";
this.chbAutoRun.Size = new System.Drawing.Size(84, 16);
this.chbAutoRun.TabIndex = 1;
this.chbAutoRun.Text = "开机自启动";
this.chbAutoRun.UseVisualStyleBackColor = true;
//
// lbl_Liquidstatus
//
this.lbl_Liquidstatus.AutoSize = true;
this.tp.SetColumnSpan(this.lbl_Liquidstatus, 2);
this.lbl_Liquidstatus.Location = new System.Drawing.Point(10, 10);
this.lbl_Liquidstatus.Margin = new System.Windows.Forms.Padding(10);
this.lbl_Liquidstatus.Name = "lbl_Liquidstatus";
this.lbl_Liquidstatus.Size = new System.Drawing.Size(53, 12);
this.lbl_Liquidstatus.TabIndex = 5;
this.lbl_Liquidstatus.Tag = "not";
this.lbl_Liquidstatus.Text = "当前状态";
//
// tabPage_ledtower
//
this.tabPage_ledtower.Controls.Add(this.uC_LedConfig1);
......@@ -235,27 +256,6 @@ namespace TheMachine
this.uC_LedConfig1.TabIndex = 7;
this.uC_LedConfig1.Tag = "not";
//
// panel1
//
this.panel1.Controls.Add(this.tp);
this.panel1.Controls.Add(this.cb_labelingtestmoce);
this.panel1.Controls.Add(this.groupBox1);
this.panel1.Controls.Add(this.btn_testlabeling);
this.panel1.Location = new System.Drawing.Point(3, 3);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(473, 460);
this.panel1.TabIndex = 15;
//
// flowLayoutPanel1
//
this.flowLayoutPanel1.Controls.Add(this.panel1);
this.flowLayoutPanel1.Controls.Add(this.uC_SetUserPassword1);
this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.flowLayoutPanel1.Location = new System.Drawing.Point(3, 3);
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
this.flowLayoutPanel1.Size = new System.Drawing.Size(1010, 708);
this.flowLayoutPanel1.TabIndex = 16;
//
// SettingControl
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
......@@ -265,13 +265,13 @@ namespace TheMachine
this.Load += new System.EventHandler(this.SettingControl_Load);
this.tabControl1.ResumeLayout(false);
this.tabPage_set.ResumeLayout(false);
this.groupBox1.ResumeLayout(false);
this.flowLayoutPanel1.ResumeLayout(false);
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
this.tp.ResumeLayout(false);
this.tp.PerformLayout();
this.groupBox1.ResumeLayout(false);
this.tabPage_ledtower.ResumeLayout(false);
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
this.flowLayoutPanel1.ResumeLayout(false);
this.ResumeLayout(false);
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!