Commit 07796b6e 刘韬

1

1 个父辈 79e944f8
此文件类型无法预览
此文件类型无法预览
......@@ -6,6 +6,7 @@ using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Windows.Forms.Layout;
......@@ -179,7 +180,8 @@ namespace OnlineStore
if ((strCurLanguage == null || strCurLanguage.Equals("")) && (!defaultStr.Equals("")))
{
strCurLanguage = defaultStr;
NoIdLog(id, defaultStr);
if (HasChinese(defaultStr))
NoIdLog(id, defaultStr);
}
}
catch (Exception ex)
......@@ -220,6 +222,10 @@ namespace OnlineStore
}
}
static bool HasChinese(string txt)
{
return Regex.IsMatch(txt.ToString(), @"[\u4E00-\u9FA5]+");
}
private static bool checkInterid(string id) {
return true;
string[] interstring = new string[] { "_txt", "_lbl" };
......
......@@ -105,8 +105,14 @@ namespace DeviceLibrary
MoveInfo.WaitList.Add(WaitResultInfo.WaitAxis(Config, true));
var HomeLowSpeed = Config.HomeLowSpeed > 0 ? Config.HomeLowSpeed : Config.HomeHighSpeed / 10;
var HomeAddSpeed = Config.HomeAddSpeed > 0 ? Config.HomeAddSpeed : Config.HomeHighSpeed * 5;
AxisManager.HomeMove(Config.DeviceName, (short)Config.GetAxisValue(), Config.HomeHighSpeed, HomeLowSpeed, HomeAddSpeed);
for (int i = 0; i < 3; i++)
{
AxisManager.SuddenStop(Config);
var r=AxisManager.HomeMove(Config.DeviceName, (short)Config.GetAxisValue(), Config.HomeHighSpeed, HomeLowSpeed, HomeAddSpeed);
if (r)
break;
Thread.Sleep(100);
}
}
/// <summary>
......@@ -141,7 +147,50 @@ namespace DeviceLibrary
AxisManager.AbsMove(Config.DeviceName, Config.GetAxisValue(), targetPosition, targetSpeed, AddSpeed, DelSpeed);// Config.AddSpeed, Config.DelSpeed);
}
}
public Task<bool> AbsMoveASYNC(int targetPosition, int targetSpeed,int waitsecond=5)
{
return Task.Run(new Func<bool>(()=> {
if (IsInPosition(targetPosition))
{
LogUtil.info(AxisName + $" 已在目标点:{targetPosition}");
return true;
}
if (ForceSafeCheck && !IsSafe(targetPosition, out string msg))
{
Msg.add(msg, MsgLevel.alarm);
LogUtil.info(AxisName + $" 不在安全点无法运行:{msg}");
RobotManage.UserPause(msg);
return false;
}
var AddSpeed = Config.AddSpeed > 0 ? Config.AddSpeed : targetSpeed * 4;
var DelSpeed = Config.DelSpeed > 0 ? Config.DelSpeed : targetSpeed * 4;
if (IsBusy) {
return false;
}
int retrytime = 0;
retry:
DateTime start = DateTime.Now;
AxisManager.AbsMove(Config.DeviceName, Config.GetAxisValue(), targetPosition, targetSpeed, AddSpeed, DelSpeed);// Config.AddSpeed, Config.DelSpeed);
while (!IsBusy) {
Task.Delay(100).Wait();
if ((DateTime.Now - start).TotalSeconds > waitsecond)
{
AxisManager.SuddenStop(Config);
break;
}
}
if (Math.Abs(targetPosition- GetAclPosition())>100) {
retrytime++;
if (retrytime >= 4)
return false;
LogUtil.error(AxisName+$"目标位置{targetPosition}当前位置{GetAclPosition()},误差过大,重新开始运动,第{retrytime}次");
goto retry;
}
return true;
}));
}
public void SpeedMove(int targetSpeed)
{
AxisManager.SpeedMove(Config.DeviceName, Config.GetAxisValue(), targetSpeed, targetSpeed * 4, targetSpeed * 4);
......
......@@ -49,9 +49,9 @@ namespace DeviceLibrary
{
instance.RelMove(portName, slvAddr, position, targetSpeed, ptpAcc, ptpDec);
}
public static void HomeMove(string portName, short slvAddr, int highVel, int lowVel, int acc)
public static bool HomeMove(string portName, short slvAddr, int highVel, int lowVel, int acc)
{
instance.HomeMove(portName, slvAddr, highVel, lowVel, acc);
return instance.HomeMove(portName, slvAddr, highVel, lowVel, acc);
}
public static void SpeedMove(string portName, short slvAddr, int speed,int acc,int dec)
......
......@@ -74,9 +74,9 @@ namespace DeviceLibrary
return (int)HCBoardManager.GetAxisPrfPos(slvAddr);
}
public void HomeMove(string portName, short slvAddr, int highVel, int lowVel, int acc)
public bool HomeMove(string portName, short slvAddr, int highVel, int lowVel, int acc)
{
HCBoardManager.StartHomeMove(slvAddr,(uint) highVel, (uint)lowVel, (uint)acc);
return HCBoardManager.StartHomeMove(slvAddr,(uint) highVel, (uint)lowVel, (uint)acc);
}
public bool IsHomeMoveEnd(string portName, short slvAddr)
{
......
......@@ -24,7 +24,7 @@ namespace DeviceLibrary
void ServoOn(string portName, short slvAddr);
void ServoOff(string portName, short slvAddr);
void RelMove(string portName, short slvAddr, int position, int targetSpeed , int ptpAcc , int ptpDec );
void HomeMove(string portName, short slvAddr, int highVel, int lowVel, int acc);
bool HomeMove(string portName, short slvAddr, int highVel, int lowVel, int acc);
void SpeedMove(string portName, short slvAddr, int speed,int acc,int dec);
void SuddenStop(string portName, short slvAddr);
......
......@@ -70,13 +70,21 @@ namespace DeviceLibrary
try
{
if (needclamp)
{
{
RobotManage.mainMachine.CylinderMove(null, IO_Type.Tin_Dock_Rotate_Release, IO_Type.Tin_Dock_Rotate_Clamp, IO_VALUE.HIGH);
while (!IOManager.IOValue(IO_Type.Tin_Dock_Rotate_Clamp).Equals(IO_VALUE.HIGH)) {
while (!IOManager.IOValue(IO_Type.Tin_Dock_Rotate_Clamp).Equals(IO_VALUE.HIGH))
{
Task.Delay(100).Wait();
}
}
else {
RobotManage.mainMachine.CylinderMove(null, IO_Type.Tin_Dock_Rotate_Release, IO_Type.Tin_Dock_Rotate_Clamp, IO_VALUE.LOW);
while (!IOManager.IOValue(IO_Type.Tin_Dock_Rotate_Clamp).Equals(IO_VALUE.LOW))
{
Task.Delay(100).Wait();
}
}
var len = (int)(StrokeLength * 1.3);
var len = (int)(StrokeLength * 1.6);
if (isHorizontal)
len = len * -1;
if (!axisBean.IsServeoOn)
......@@ -97,6 +105,9 @@ namespace DeviceLibrary
Pause();
return true;
}
if (!axisBean.IsBusy) {
axisBean.RelMove(len, (double)upspeed);
}
}
Task.Delay(100).Wait();
axisBean.SuddenStop();
......@@ -246,10 +257,14 @@ namespace DeviceLibrary
var len = (int)(StrokeLength / 90 * degree);
if (Math.Abs(degreeAdd + degree) > 90)
{
RobotManage.mainMachine.CylinderMove(null, IO_Type.Tin_Dock_Rotate_Release, IO_Type.Tin_Dock_Rotate_Clamp, IO_VALUE.LOW);
while (!IOManager.IOValue(IO_Type.Tin_Dock_Rotate_Clamp).Equals(IO_VALUE.HIGH))
{
Task.Delay(30).Wait();
}
if (len > 0)
{
TurnToEnd(true).Wait();
TurnToEnd(true).Wait();
}
else if (len < 0)
{
......@@ -262,7 +277,7 @@ namespace DeviceLibrary
Task.Delay(30).Wait();
}
//moveInfo.log($"len:{len}");
axisBean.RelMove(len * -1, (double)upspeed);
axisBean.RelMove(len, (double)upspeed);
Task.Delay(50).Wait();
while (axisBean.IsBusy)
{
......
......@@ -15,7 +15,7 @@ namespace DeviceLibrary
string Port;
public PrinterHelper() {
print = new Asa.PrintLabel(Application.StartupPath + "\\Label",300);
print = new Asa.PrintLabel(Application.StartupPath + "\\Label",200);
}
......
......@@ -232,7 +232,7 @@ namespace DeviceLibrary
}
else if (!RobotManage.isRunning)
{
sendmsg = "设备未启动";
sendmsg = crc.GetString("Res0059","设备未启动");
}
lineOperation.msg = sendmsg;
......@@ -652,7 +652,8 @@ namespace DeviceLibrary
public string msg { get; set; }
public Dictionary<string, object> data { get; set; }
//public Dictionary<string, object> data { get; set; }
public object data { get; set; }
}
/// <summary>
///1=设备联机(正常就绪)(入库后,BOX恢复原始状态)(出库后,移载装置恢复原始状态),
......@@ -721,4 +722,4 @@ namespace DeviceLibrary
InStoreError = 14,
}
}
}
\ No newline at end of file
......@@ -218,8 +218,15 @@ namespace DeviceLibrary
{
MoveInfo.NextMoveStep(MoveStep.StoreTS29);
MoveInfo.log("LabelP=>RFIDP 直接结束");
}
else if (To.posid == MainMachine.RFIDP)
{
MoveInfo.NextMoveStep(MoveStep.StoreTS29);
Z_Axis.AbsMove(MoveInfo, To.Z_Axis_P3, Config.Z_Axis_P1_speed);
MoveInfo.log($"{storeMoveType}:Z轴到达目的地低点:{To.Z_Axis_P3}");
MoveInfo.log("???=>RFIDP 升降轴直接到P3 直接结束");
}
else
else if (To.posid != MainMachine.LabelP)
{
var zp2 = To.Z_Axis_P3 - 205000;
if (zp2 < 0)
......
......@@ -7,6 +7,7 @@ using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Runtime.ExceptionServices;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
......@@ -82,15 +83,15 @@ namespace DeviceLibrary
}
break;
case TestStorePointPort.上层左侧:
startindex = RobotManage.AllPositionMapNumList.IndexOf("LA1");
startindex = RobotManage.AllPositionMapNumList.IndexOf("SA1");
haslistindex = TestStorePoint(RobotManage.CameraA.GetImage(2), TestStorePointPort.上层左侧);
break;
case TestStorePointPort.上层右侧:
startindex = RobotManage.AllPositionMapNumList.IndexOf("LA1");
startindex = RobotManage.AllPositionMapNumList.IndexOf("SA1");
haslistindex = TestStorePoint(RobotManage.CameraA.GetImage(3), TestStorePointPort.上层右侧);
break;
case TestStorePointPort.下层左侧:
startindex = RobotManage.AllPositionMapNumList.IndexOf("LA1");
startindex = RobotManage.AllPositionMapNumList.IndexOf("SH1");
haslistindex = TestStorePoint(RobotManage.CameraA.GetImage(2), TestStorePointPort.下层左侧);
break;
case TestStorePointPort.下层右侧:
......@@ -122,7 +123,7 @@ namespace DeviceLibrary
return new List<string>();
}
}
[HandleProcessCorruptedStateExceptions]
public static List<int> TestStorePoint(Bitmap bmp, TestStorePointPort tp)
{
......@@ -137,11 +138,12 @@ namespace DeviceLibrary
List<Point> points = CameraData[Name].ObjectPoint;
if (bmp == null)
return new List<int>(points.Count);
List<int> haslist = new List<int>();
var bd = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height), ImageLockMode.ReadOnly, bmp.PixelFormat);
BitmapData bd=null;
try
{
bd = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height), ImageLockMode.ReadOnly, bmp.PixelFormat);
for (int i = 0; i < points.Count; i++)
{
var p = points[i];
......@@ -166,27 +168,39 @@ namespace DeviceLibrary
var s = cl.Average(cc => cc.S);
var v = cl.Average(cc => cc.V);
var has = s > CameraData[Name].S && h > 80 && h < 150;
var has = s > CameraData[Name].S && h > 60 && h < 200;
haslist.Add(has ? 1 : 0);
}
}
catch (Exception ex)
catch (AccessViolationException ex)
{
LogUtil.error("TestStorePoint AccessViolationException:" + ex.ToString());
}catch (Exception ex)
{
LogUtil.error("TestStorePoint:" + ex.ToString());
}
finally
{
bmp.UnlockBits(bd);
if (bd!=null)
bmp.UnlockBits(bd);
}
//Size pointsize = new Size(30, 30);
SolidBrush red = new SolidBrush(Color.Red);
SolidBrush gray = new SolidBrush(Color.Gray);
var g = Graphics.FromImage(bmp);
for (int i = 0; i < CameraData[Name].ObjectPoint.Count; i++) {
g.FillEllipse(haslist[i]==1?red:gray, GetCR(CameraData[Name].ObjectPoint[i], 30));
try
{
var g = Graphics.FromImage(bmp);
for (int i = 0; i < CameraData[Name].ObjectPoint.Count; i++)
{
g.FillEllipse(haslist[i] == 1 ? red : gray, GetCR(CameraData[Name].ObjectPoint[i], 30));
}
g.Save();
bmp.Save(tp.ToString() + ".bmp");
}
catch (Exception ex)
{
LogUtil.error("TestStorePoint:" + ex.ToString());
}
g.Save();
bmp.Save(tp.ToString() + ".bmp");
TestStorePointEvent?.Invoke(tp, bmp);
return haslist;
}
......
......@@ -75,7 +75,7 @@ namespace DeviceLibrary
public string Batch { get; set; }
public bool ReelOnFixture { get; internal set; } = false;
public string OutPosID { get; internal set; }
public DateTime dateTime = DateTime.Now;
public int HeightPos = 0;
public ReelParam clone()
{
......
......@@ -77,8 +77,9 @@ namespace DeviceLibrary
{
isOk = false;
WarnMsg = msg;
Alarm(AlarmType.AxisMoveError, WarnMsg);
///Alarm(AlarmType.AxisMoveError, WarnMsg);
Msg.add(WarnMsg, MsgLevel.alarm);
RobotManage.UserPause(WarnMsg);
break;
}
}
......
......@@ -73,6 +73,7 @@ namespace DeviceLibrary
public bool isInSuddenDown = false;
public List<ReelParam> NGInfoList = new List<ReelParam>();
public MainMachine(Robot_Config _config) {
Config = _config;
......@@ -206,6 +207,8 @@ namespace DeviceLibrary
boxTransport.Process();
if (RobotManage.InoutDebugMode)
AutoInOutTestProcess();
else if (DemoTestMode)
TFIDSelfTestProcess();
else
StoreDemoProcess();
......@@ -218,8 +221,9 @@ namespace DeviceLibrary
}
catch (Exception ex)
{
LogUtil.error("Mainprocess:" + ex);
Msg.add(ex.ToString(), MsgLevel.warning);
Msg.setlogones();
//Msg.setlogones();
}
finally {
var m = Msg.get();
......@@ -324,8 +328,9 @@ namespace DeviceLibrary
ResetMoveInfo.NextMoveStep(MoveStep.H02_HomeReset_01);
ResetMoveInfo.log("锁定抽屉");
IOMove(IO_Type.Entry_Drawer_Lock, IO_VALUE.HIGH);
//IOMove(IO_Type.Entry_Drawer_Lock, IO_VALUE.HIGH);
IOMove(IO_Type.Out_Drawer_Lock, IO_VALUE.HIGH);
CylinderMove(ResetMoveInfo, IO_Type.Tin_Dock_Rotate_Release, IO_Type.Tin_Dock_Rotate_Clamp, IO_VALUE.LOW);
Msg.add("", MsgLevel.info, ErrInfo.X09_Clear);
break;
case MoveStep.H02_HomeReset_01:
......@@ -367,8 +372,8 @@ namespace DeviceLibrary
StoreMoveInfo.log("检测到上次正在贴标:" + Setting_Init.Runtime_Step + "," + Setting_Init.Runtime_Posid);
//LabelingMoveInfo.NextMoveStep(MoveStep.Labeling01);
//StoreMoveInfo.NextMoveStep(MoveStep.StoreIn03);
Msg.add("重置前物料正在贴标,无法继续,请手动处理", MsgLevel.warning, ErrInfo.LabelInPaste);
RobotManage.UserPause("重置前物料正在贴标,无法继续,请手动处理");
Msg.add(crc.GetString("Res0133","重置前物料正在贴标,无法继续,请手动处理"), MsgLevel.warning, ErrInfo.LabelInPaste);
RobotManage.UserPause(crc.GetString("Res0133","重置前物料正在贴标,无法继续,请手动处理"));
}
}
break;
......@@ -408,7 +413,7 @@ namespace DeviceLibrary
ok = false;
DeviceSuddenStop();
}
Msg.add("打印机维护门未关闭" + (ok ? ignorestring : ""), MsgLevel.alarm);
Msg.add(crc.GetString("Res0134","打印机维护门未关闭") + (ok ? ignorestring : ""), MsgLevel.alarm);
}
if (IOValue(IO_Type.LeftDoor_Check).Equals(IO_VALUE.HIGH))
{
......@@ -431,7 +436,7 @@ namespace DeviceLibrary
if (IOValue(IO_Type.SafeDoor_Disable).Equals(IO_VALUE.LOW) && IOValue(IO_Type.DoorLock_Check).Equals(IO_VALUE.LOW))
{
Msg.add("防护门没有锁定", MsgLevel.warning);
Msg.add(crc.GetString("Res0135","防护门没有锁定"), MsgLevel.warning);
DeviceSuddenStop();
ok = false;
......@@ -509,7 +514,7 @@ namespace DeviceLibrary
if (span.TotalSeconds > RobotManage.Config.AirCheckSeconds)
{
ok = false;
Msg.add(crc.GetString("Res0103","气压不足"), MsgLevel.warning);
Msg.add(crc.GetString("Res0103","气压不足"), MsgLevel.alarm);
}
}
else {
......
......@@ -42,17 +42,17 @@ namespace DeviceLibrary
LabelingMoveInfo.MoveParam = new ReelParam();
break;
//case MoveStep.Labeling03:
// LabelingMoveInfo.NextMoveStep(MoveStep.Labeling04);
// RotateEquip.LockAndTurnDegree(-20);
// break;
case MoveStep.Labeling03:
LabelingMoveInfo.NextMoveStep(MoveStep.Labeling04);
RotateEquip.LockAndTurnDegree(-20);
break;
case MoveStep.Labeling04:
if (RotateEquip.TurnWork.IsCompleted) {
LabelingMoveInfo.NextMoveStep(MoveStep.Labeling04a);
if (RotateEquip.TurnWork==null || RotateEquip.TurnWork.IsCompleted) {
LabelingMoveInfo.NextMoveStep(MoveStep.Labeling04);
TakePicture();
}
break;
case MoveStep.Labeling04a:
case MoveStep.Labeling04:
if (IsTackPictureFinish)
{
if (TakePictureTask.Result)
......@@ -62,7 +62,7 @@ namespace DeviceLibrary
ScanCode();
}
else {
LabelingMoveInfo.NextMoveStep(MoveStep.Labeling04);
LabelingMoveInfo.NextMoveStep(MoveStep.Labeling03);
LabelingMoveInfo.log("拍照失败,重试");
}
}
......@@ -76,8 +76,7 @@ namespace DeviceLibrary
CodeList.AddRange(xx);
if (HasRightCode(CodeList.ToArray(), LabelingMoveInfo.MoveParam))
{
{
LabelingMoveInfo.MoveParam.IsNg = false;
LabelingMoveInfo.NextMoveStep(MoveStep.Labeling06);
LabelingMoveInfo.MoveParam.PlateH = 50;
......@@ -93,20 +92,20 @@ namespace DeviceLibrary
ScanTimes++;
if (ScanTimes >= 18*2)
{
LabelingMoveInfo.NextMoveStep(MoveStep.Labeling06);
LabelingMoveInfo.NextMoveStep(MoveStep.Labeling08);
LabelingMoveInfo.log($"未识别到有效二维码,送到NG口");
LabelingMoveInfo.MoveParam.IsNg = true;
LabelingMoveInfo.MoveParam.NgMsg = crc.GetString(L.not_detect_reel_code, "未识别到有效二维码");
}
else {
LabelingMoveInfo.NextMoveStep(MoveStep.Labeling04);
LabelingMoveInfo.NextMoveStep(MoveStep.Labeling03);
LabelingMoveInfo.log("继续扫码");
}
}
break;
case MoveStep.Labeling06:
LabelingMoveInfo.NextMoveStep(MoveStep.Labeling07);
RotateEquip.TurnDegree(-45);
RotateEquip.TurnDegree(-75);
//LabelingMoveInfo.log("滚动锡膏");
break;
case MoveStep.Labeling07:
......@@ -124,7 +123,7 @@ namespace DeviceLibrary
LabelingMoveInfo.log("未找到绿色区域");
LabelingMoveInfo.NextMoveStep(MoveStep.Labeling08);
LabelingMoveInfo.MoveParam.IsNg = true;
LabelingMoveInfo.MoveParam.NgMsg = "未找到绿色区域";
LabelingMoveInfo.MoveParam.NgMsg = crc.GetString("Res0136","未找到绿色区域");
ServerCM.cancelPutInTask("",LabelingMoveInfo.MoveParam.WareCode);
}//else
//LabelingMoveInfo.log("本次未找到绿色区域,转动后再次查找,"+ ScanTimes);
......@@ -241,6 +240,9 @@ namespace DeviceLibrary
Setting_Init.Runtime_Step = Runtime_StepE.LabelPasteFinish;
LabelingMoveInfo.log("贴标完成");
RotateEquip.TurnToEnd(false);
if (LabelingMoveInfo.MoveParam.IsNg)
Setting_Init.Runtime_Posid = "NG";
}
break;
case MoveStep.Labeling57:
......
......@@ -15,6 +15,7 @@ namespace DeviceLibrary
{
partial class MainMachine
{
public bool DemoTestMode = false;
List<string> DemoTestList;
int DemoTestIndex = 0;
int DemoTestCount = 0;
......@@ -28,7 +29,11 @@ namespace DeviceLibrary
case MoveStep.Wait:
break;
case MoveStep.StoreIn01:
DemoTestList = CameraPointTest.GetThingStoreName(TestStorePointPort.上层左侧);
StoreMoveInfo.NextMoveStep(MoveStep.StoreOut10);
if (IOManager.IOValue(IO_Type.Tside_Right).Equals(IO_VALUE.HIGH))
DemoTestList = CameraPointTest.GetThingStoreName(TestStorePointPort.上层右侧);
else
DemoTestList = CameraPointTest.GetThingStoreName(TestStorePointPort.上层左侧);
if (DemoTestList.Count == 0)
return;
......@@ -46,7 +51,7 @@ namespace DeviceLibrary
}
else if (IOValue(IO_Type.Out_Drawer).Equals(IO_VALUE.LOW))
{
Msg.add("出库任务正在执行,请关好抽屉", MsgLevel.warning);
Msg.add(crc.GetString("Res0137","出库任务正在执行,请关好抽屉"), MsgLevel.warning);
}
else {
IOMove(IO_Type.Out_Drawer_Lock, IO_VALUE.HIGH);
......@@ -56,7 +61,8 @@ namespace DeviceLibrary
StoreMoveInfo.NextMoveStep(MoveStep.StoreOut12);
var from = CSVPositionReader<ACStorePosition>.GetPositon(DemoTestList[DemoTestIndex]);
var to = CSVPositionReader<ACStorePosition>.GetPositon(RFIDP);
boxTransport.Start(new BoxStorePosition(Config, from, StoreMoveInfo.MoveParam), new BoxStorePosition(Config, to, StoreMoveInfo.MoveParam), StoreMoveType.OutStore, true);
StoreMoveInfo.MoveParam.ReelOnFixture = false;
boxTransport.Start(new BoxStorePosition(Config, from, StoreMoveInfo.MoveParam), new BoxStorePosition(Config, to, StoreMoveInfo.MoveParam), StoreMoveType.OutStore, true);
StoreMoveInfo.log($"开始转运出库");
break;
case MoveStep.StoreOut12:
......@@ -71,7 +77,7 @@ namespace DeviceLibrary
if (data[0] != 0xFF)
{
ds = Encoding.ASCII.GetString(data).Trim();
if (StoreMoveInfo.MoveParam.WareCode.IndexOf(ds)>-1)
//if (StoreMoveInfo.MoveParam.WareCode.IndexOf(ds)>-1)
{
StoreMoveInfo.MoveParam.RFID = ds;
StoreMoveInfo.log("读取到 RFID:" + ds + " , "+ RobotManage.RFID.HexBuff(data));
......
......@@ -115,7 +115,6 @@ namespace DeviceLibrary
Labeling02,
Labeling03,
Labeling04,
Labeling04a,
Labeling05,
Labeling06,
Labeling07,
......
......@@ -129,8 +129,8 @@ namespace DeviceLibrary
}
CodeManager.LoadConfig();
CodeManager.CameraScan(CodeManager.hikNameList);
mainMachine = new MainMachine(RobotManage.Config);
//mainMachine.ScanCode();
//Thread.Sleep(5000);
if (!IOManager.ConnectionIOList(new List<string>()))
......@@ -148,7 +148,7 @@ namespace DeviceLibrary
{
CameraA.Open();
}
mainMachine = new MainMachine(RobotManage.Config);
if (!dauxiKS107.OpenPort(Setting_Init.Device_DauxiKS107_Port, out _)) {
IsLoadOk = false;
msg += crc.GetString("Res0119","液位传感器初始化失败,端口:") + $"{Setting_Init.Device_DauxiKS107_Port}\n";
......@@ -168,7 +168,7 @@ namespace DeviceLibrary
if (!RFID.IsConn)
{
IsLoadOk = false;
msg += "RFID连接失败,IP:" + $"{Setting_Init.Device_RFID_IP}\n";
msg += crc.GetString("Res0142","RFID连接失败,IP:") + $"{Setting_Init.Device_RFID_IP}\n";
}
else
LogUtil.info("RFID连接成功,IP:"+ Setting_Init.Device_RFID_IP);
......
此文件的差异太大,无法显示。
......@@ -127,6 +127,31 @@ namespace TheMachine
stateView.ColumnWidthChanging += listView_ColumnWidthChanging;
#endregion
#region 状态信息ngview初始化
NgInfoView.View = View.Details;
ColumnHeader n1 = new ColumnHeader();
n1.Text = "";
n1.Width = 0;
ColumnHeader n2 = new ColumnHeader();
n2.Text = crc.GetString("Res0002","时间");
n2.Width = 120;
ColumnHeader n3 = new ColumnHeader();
n3.Text = "SerialNumber";
n3.Width = 120;
ColumnHeader n4 = new ColumnHeader();
n4.Text = crc.GetString("Res0145","放置库位");
n4.Width = 120;
ColumnHeader n5 = new ColumnHeader();
n5.Text = crc.GetString("Res0146","NG原因");
n5.Width = 370;
NgInfoView.Columns.Add(n1);
NgInfoView.Columns.Add(n2);
NgInfoView.Columns.Add(n3);
NgInfoView.Columns.Add(n4);
NgInfoView.Columns.Add(n5);
NgInfoView.ColumnWidthChanging += listView_ColumnWidthChanging;
#endregion
LogUtil.info("开始初始化");
cb_EnableBuzzer.Checked = Setting_Init.Device_EnableBuzzer;
AlarmBuzzer.BuzzerStateChange += AlarmBuzzer_BuzzerStateChange;
......@@ -221,6 +246,12 @@ namespace TheMachine
stateView.Items.Add(lvi);
}
//NgInfoView.Items.Clear();
//foreach (var moveInfo in RobotManage.mainMachine.NGInfoList)
//{
// ListViewItem lvi = new ListViewItem(new string[] { "", moveInfo.dateTime.ToString("hh:mm:ss"), moveInfo.ReeID, moveInfo.PosID, moveInfo.NgMsg });
// NgInfoView.Items.Add(lvi);
//}
this.ResumeLayout(true);
}
......@@ -266,7 +297,7 @@ namespace TheMachine
addTablePage();
RobotManage.LoadDebug();
//cb_IgnoreGratingSignal.Visible = true;
cb_IgnoreSafecheck.Visible = true;
//cb_IgnoreSafecheck.Visible = true;
}
else
{
......@@ -399,7 +430,7 @@ namespace TheMachine
}
else if (msg.errInfo == ErrInfo.LabelInPaste)
{
if (FrmAlarm.ShowAlarmDialog("贴标区内可能有物料未完成贴标,请手动取出") == DialogResult.OK)
if (FrmAlarm.ShowAlarmDialog(crc.GetString("Res0143","贴标区内可能有物料未完成贴标,请手动取出")) == DialogResult.OK)
{
LogUtil.info("用户确认已处理");
Setting_Init.Runtime_Step = Runtime_StepE.None;
......@@ -630,6 +661,10 @@ namespace TheMachine
stateView.Columns[2].Text = crc.GetString("Res0004","步骤");
stateView.Columns[3].Text = crc.GetString("Res0001","信息");
NgInfoView.Columns[1].Text = crc.GetString("Res0002","时间");
NgInfoView.Columns[3].Text = crc.GetString("Res0145","放置库位");
NgInfoView.Columns[4].Text = crc.GetString("Res0146","NG原因");
启用调试模式ToolStripMenuItem.Text = !RobotManage.IsConfigMode ? crc.GetString("Res0012","启用配置模式") : crc.GetString("Res0013","停用配置模式");
btn_run.Text = crc.GetString("Res0017","启动");
......@@ -719,5 +754,15 @@ namespace TheMachine
IOManager.IOMove(IO_Type.PrinterDoor_Lock, IO_VALUE.LOW);
RobotManage.mainMachine.PrintDoorOpen = true;
}
private void cb_cycledemo_CheckedChanged(object sender, EventArgs e)
{
RobotManage.mainMachine.DemoTestMode = cb_cycledemo.Checked;
if (cb_cycledemo.Checked && RobotManage.mainMachine.StoreMoveInfo.MoveStep == MoveStep.Wait)
RobotManage.mainMachine.StoreMoveInfo.NextMoveStep(MoveStep.StoreIn01);
else if (!cb_cycledemo.Checked)
RobotManage.mainMachine.StoreMoveInfo.NextMoveStep(MoveStep.Wait);
}
}
}
\ No newline at end of file
using DeviceLibrary;
using DeviceLibrary;
using OnlineStore;
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
......@@ -110,9 +110,9 @@ namespace TheMachine
var result = RobotManage.RFID.WriteEPC(Encoding.ASCII.GetBytes(epc));
if (result)
{
MessageBox.Show("写入成功");
MessageBox.Show(crc.GetString("Res0144","写入成功"));
return;
}
}
}
}
}
\ No newline at end of file
......@@ -51,6 +51,7 @@ namespace TheMachine.UC
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(537, 234);
this.tableLayoutPanel1.TabIndex = 0;
this.tableLayoutPanel1.Tag = "not";
//
// button_reset
//
......
......@@ -21,12 +21,14 @@ namespace TheMachine.UC
InitializeComponent();
this.Tag = "not";
crc.LanguageChangeEvent += Crc_LanguageChangeEvent;
crc.LanguageProcess(this);
}
private void Crc_LanguageChangeEvent(object sender, EventArgs e)
{
if (Config == null)
return;
LoadLedList();
crc.LanguageProcess(this);
}
private DeviceConfig _Config;
public DeviceConfig Config
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!