Commit 5509dcbf 刘韬

设置界面左下角添加了进入高级设置入口

优化下料升降轴高度计算
1 个父辈 b0fa6453
......@@ -31,9 +31,9 @@ namespace DeviceLibrary
//public bool UserPause { get; set; }
public bool IgnoreSafecheck { get; set; }
public bool IgnoreGratingSignal { get; set; }
public int NGBox_Count { get => nGBox_Count; set { nGBox_Count = value; Properties.Settings1.Default.NGBox_Count = value; Properties.Settings1.Default.Save(); } }
public int MSDBox_Count { get => mSDBox_Count; set { mSDBox_Count = value; Properties.Settings1.Default.MSDBox_Count = value; Properties.Settings1.Default.Save(); } }
public int PaperBox_Count { get => paperBox_Count; set { mSDBox_Count = value; Properties.Settings1.Default.PaperBox_Count = value; Properties.Settings1.Default.Save(); } }
public int NGBox_Count { get => nGBox_Count; set { nGBox_Count = value; ConfigHelper.Config.Set("NGBox_Count", value); ConfigHelper.Config.SaveChange(); } }
public int MSDBox_Count { get => mSDBox_Count; set { mSDBox_Count = value; ConfigHelper.Config.Set("MSDBox_Count", value); ConfigHelper.Config.SaveChange(); } }
public int PaperBox_Count { get => paperBox_Count; set { mSDBox_Count = value; ConfigHelper.Config.Set("PaperBox_Count", value); ConfigHelper.Config.SaveChange(); } }
private int nGBox_Count = 0;
private int mSDBox_Count = 0;
......@@ -51,9 +51,9 @@ namespace DeviceLibrary
MoveInfo = new MoveInfo(DeviceName);
ResetMoveInfo = MoveInfo;
NGBox_Count = Properties.Settings1.Default.NGBox_Count;
MSDBox_Count = Properties.Settings1.Default.MSDBox_Count;
PaperBox_Count = Properties.Settings1.Default.PaperBox_Count;
NGBox_Count = ConfigHelper.Config.Get("NGBox_Count", 0);
MSDBox_Count = ConfigHelper.Config.Get("MSDBox_Count", 0);
PaperBox_Count = ConfigHelper.Config.Get("PaperBox_Count", 0);
}
catch (Exception e)
{
......
......@@ -143,7 +143,7 @@ namespace DeviceLibrary
Point qrcenter = Label_Pix_Point;
//string file = @"D:\853string\Image_20210604173619489.bmp";
//图像剪切范围矩形
var orgCrop = Rectangle.Inflate(new Rectangle(qrcenter, new Size(1, 1)), 510, 510);
var orgCrop = Rectangle.Inflate(new Rectangle(qrcenter, new Size(1, 1)), 560, 560);
//计算剪切后的二维码中心坐标点
qrcenter.X = qrcenter.X - orgCrop.X;
qrcenter.Y = qrcenter.Y - orgCrop.Y;
......
......@@ -25,6 +25,7 @@ namespace DeviceLibrary
public bool canRunning { get; set; }
public bool isBusy { get; set; }
public bool isAlarm { get; set; }
public bool DisableLabel { get; set; }
//public RunStatus runStatus { get; set; }
//public bool UserPause { get; set; }
public bool IgnoreSafecheck { get; set; }
......
......@@ -96,13 +96,35 @@ namespace DeviceLibrary
break;
case MoveStep.Lbl_02_StopUP:
if (MoveInfo.ReelParam.IsNg)
if (MoveInfo.ReelParam.IsNg || DisableLabel)
{
MoveInfo.NextMoveStep(MoveStep.Lbl_BeginOut);
CylinderMove(MoveInfo, IO_Label_Type.TrayStop_Down, IO_Label_Type.TrayStop_Up, IO_VALUE.HIGH);
CylinderMove(null, IO_Label_Type.Label_Stop_Down, IO_Label_Type.Label_Stop_Up, IO_VALUE.HIGH);
MoveInfo.log("NG盘直接通过");
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(3000));
if (RobotManage.offlinemode)
{
ReelLocation reelLocation1 = RobotManage.offlinereelLocation;
if (!string.IsNullOrEmpty(reelLocation1.isTower))
{
MoveInfo.ReelParam.ReelDest = ReelDest.String;
}
else if (!string.IsNullOrEmpty(reelLocation1.isVTTower))
{
MoveInfo.ReelParam.ReelDest = ReelDest.Paper;
}
else if (!string.IsNullOrEmpty(reelLocation1.isVacuum))
{
MoveInfo.ReelParam.ReelDest = ReelDest.MSD;
}
}
return;
}
if (IOValue(IO_Label_Type.Label_Cylinder_Check).Equals(IO_VALUE.HIGH))
{
//Msg.add(crc.GetString("label_extract_fail", "标签吸取失败"), MsgLevel.warning);
Msg.add(crc.GetString("label_tray_notempty", "接标台上有残留标签"), MsgLevel.warning);
return;
}
......@@ -154,7 +176,7 @@ namespace DeviceLibrary
}
if (RobotManage.offlinemode && !MoveInfo.ReelParam.IsNg)
{
printTask = DoPrint(MoveInfo.ReelParam, false);
printTask = DoPrint(MoveInfo.ReelParam, false);
}
//开始吸标
VacuumMoveInfo.NewMove(MoveStep.LblVacuum_01);
......@@ -236,13 +258,13 @@ namespace DeviceLibrary
case MoveStep.Lbl11:
MoveInfo.NextMoveStep(MoveStep.Lbl13);
var p5 = Config.Label_Z_P5;
p5 = p5 - (MoveInfo.ReelParam.PlateH - 8) * Config.Label_Z_Axis_ChangeValue;
p5 = p5 - (MoveInfo.ReelParam.PlateRawH - 8) * Config.Label_Z_Axis_ChangeValue;
Label_Z_Axis.AbsMove(MoveInfo, p5, Config.Label_Z_P5_speed);
IOMove(IO_Label_Type.LabelCylinder_Work, IO_VALUE.LOW);
MoveInfo.log("取标气缸下降.关闭吸气.");
MoveInfo.log($"取标气缸下降p5:{p5}.关闭吸气.");
break;
case MoveStep.Lbl12:
MoveInfo.NextMoveStep(MoveStep.Lbl13);
MoveInfo.NextMoveStep(MoveStep.Lbl13);
//MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
break;
case MoveStep.Lbl13:
......@@ -273,11 +295,11 @@ namespace DeviceLibrary
Label_X_Axis.AbsMove(null, Config.Label_X_P2, Config.Label_X_P2_speed);
Label_Y_Axis.AbsMove(null, Config.Label_Y_P2, Config.Label_Y_P2_speed);
Label_R_Axis.AbsMove(null, Config.Label_R_P2, Config.Label_R_P2_speed);
if (MoveInfo.ReelParam.IsNg)
if (MoveInfo.ReelParam.IsNg || DisableLabel)
{
RobotManage.Line1.LineRun("label", 5, "Lbl_BeginOut");
RobotManage.Line2.LineRun("label", 999, "Lbl_BeginOut");
//MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(3000));
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1500));
}
MoveInfo.log("Label_XYR转到取标点,待机");
break;
......@@ -294,17 +316,21 @@ namespace DeviceLibrary
MoveInfo.log("贴标阻挡上升.");
}
break;
case MoveStep.Lbl16:
if (SendOutMoveInfo.MoveStep==MoveStep.Wait && RobotManage.filterMachine.isWaitReel)
case MoveStep.Lbl16:
if (SendOutMoveInfo.MoveStep == MoveStep.Wait && RobotManage.filterMachine.isWaitReel)
{
MoveInfo.NextMoveStep(MoveStep.L30_LabelFinish);
RobotManage.filterMachine.preReelParam = MoveInfo.ReelParam;
SendOutMoveInfo.NewMove(MoveStep.LblSendOut_01);
MoveInfo.log("送出料盘.");
if (MoveInfo.ReelParam.IsNg)
{
RobotManage.Line2.LineRun("label", 15, "Lbl_BeginOut");
}
}
else if (MoveInfo.IsTimeOut(30))
{
Msg.add(crc.GetString("wait_xx_timeout", "等待{0}超时{1}秒",RobotManage.filterMachine.DeviceName, MoveInfo.TimeOutSeconds), MsgLevel.warning);
Msg.add(crc.GetString("wait_xx_timeout", "等待{0}超时{1}秒", RobotManage.filterMachine.DeviceName, MoveInfo.TimeOutSeconds), MsgLevel.warning);
MoveInfo.log($"等待分盘线超时,SendOutMoveInfo:{SendOutMoveInfo.MoveStep}");
}
break;
......@@ -384,10 +410,16 @@ namespace DeviceLibrary
break;
case MoveStep.LblVacuum_02:
VacuumMoveInfo.NextMoveStep(MoveStep.LblVacuum_03);
int waittime = ConfigHelper.Config.Get("Vacuum_WaitTime", 500);
VacuumMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(waittime));
VacuumMoveInfo.log($"标签吸取,等待{waittime}秒.");
break;
case MoveStep.LblVacuum_03:
VacuumMoveInfo.NextMoveStep(MoveStep.LblVacuum_04);
Label_Z_Axis.AbsMove(VacuumMoveInfo, Config.Label_Z_P2, Config.Label_Z_P2_speed);
VacuumMoveInfo.log("标签打印完毕,取标气缸上升,取起标签.");
break;
case MoveStep.LblVacuum_03:
case MoveStep.LblVacuum_04:
VacuumMoveInfo.log($"Label_Cylinder_Check:{IOValue(IO_Label_Type.Label_Cylinder_Check)}");
if (IOValue(IO_Label_Type.Label_Cylinder_Check).Equals(IO_VALUE.LOW))
{
......
......@@ -220,7 +220,8 @@ namespace DeviceLibrary
{
isOk = false;
WarnMsg = msg;
Alarm(AlarmType.AxisMoveError, WarnMsg);
if (!UserPause)
Alarm(AlarmType.AxisMoveError, WarnMsg);
Msg.add(WarnMsg, MsgLevel.warning);
break;
}
......@@ -336,7 +337,8 @@ namespace DeviceLibrary
}
LogUtil.error(WarnMsg, logType + 100, second);
//MoveInfo.errlog(WarnMsg);
Alarm(AlarmType.IoSingleTimeOut, WarnMsg);
if (!UserPause)
Alarm(AlarmType.IoSingleTimeOut, WarnMsg);
Msg.add(WarnMsg, MsgLevel.warning);
}
return true;
......
......@@ -125,6 +125,7 @@ namespace DeviceLibrary
LblVacuum_01,
LblVacuum_02,
LblVacuum_03,
LblVacuum_04,
LblVacuum_end,
LblVacuum_failure,
LblVacuum_printfail,
......
......@@ -59,21 +59,34 @@ namespace DeviceLibrary
T_TrayPos_Axis = new AxisBean(Config.T_TrayPos_Axis, DeviceName);
T_Y_Axis = new AxisBean(Config.T_Y_Axis, DeviceName);
#endregion
MoveInfo = new MoveInfo(DeviceName);
ResetMoveInfo = MoveInfo;
ShelfOutMoveInfo = new MoveInfo("出料串线体");
ShelfInMoveInfo = new MoveInfo("入料串线体");
ShelfOutLine = new LineRunMonitor("ShelfOutLine",Config.DOList[IO_T1_Type.Line_Out_Run].GetIOAddr());
ShelfInLine = new LineRunMonitor("ShelfInLine",Config.DOList[IO_T1_Type.Empty_Line_Run].GetIOAddr());
ShelfOutLine = new LineRunMonitor("ShelfOutLine", Config.DOList[IO_T1_Type.Line_Out_Run].GetIOAddr());
ShelfInLine = new LineRunMonitor("ShelfInLine", Config.DOList[IO_T1_Type.Empty_Line_Run].GetIOAddr());
RobotManage.wistonAgvClient.EmptyShelfInReady += WistonAgvClient_EmptyShelfInReady;
RobotManage.wistonAgvClient.FullShelfOutReady += WistonAgvClient_FullShelfOutReady;
CenterPos = new Point(Config.String_Center_X, Config.String_Center_Y);
LastStringCenter = CenterPos;
LedProcessInit();
IOMonitor.RegisterIO(IO_T1_Type.Empty_LineIn_Check, Config, IO_VALUE.HIGH, delegate() { EmptyStringIN(); });
IOMonitor.RegisterIO(IO_T1_Type.Empty_LineIn_Check, Config, IO_VALUE.HIGH, delegate () { EmptyStringIN(); });
IOMonitor.RegisterIO(IO_T1_Type.EmptyString_In_Check, Config, IO_VALUE.LOW, delegate () {
//if (IOValue(IO_T1_Type.Empty_LineIn_Check).Equals(IO_VALUE.LOW))
{
//RobotManage.wistonAgvClient.NeedEnter();
}
});
IOMonitor.RegisterIO(IO_T1_Type.T1_Out_Check, Config, IO_VALUE.HIGH, delegate () {
//if (IOValue(IO_T1_Type.Empty_LineIn_Check).Equals(IO_VALUE.LOW))
{
RobotManage.wistonAgvClient.NeedLeave();
}
});
}
catch (Exception e)
{
......@@ -87,15 +100,19 @@ namespace DeviceLibrary
{
this.loginfo("收到满料串Agv抵达信号");
ShelfOutLine.LineRun("FullStringOut", 40);
Thread.Sleep(1000);
IOMove(IO_T1_Type.T1_Out_Stop, IO_VALUE.HIGH, false, 2000);
WaitIo(IO_T1_Type.T1_Out_Check, IO_VALUE.LOW, 30 * 1000);
ShelfOutLine.LineRun("FullStringOut", 15);
RobotManage.wistonAgvClient.FinishLeave();
}
private void WistonAgvClient_EmptyShelfInReady(object sender, EventArgs e)
{
this.loginfo("收到空料串Agv抵达信号");
ShelfInLine.LineRun("EmptyStringIN", 40);
WaitIo(IO_T1_Type.Empty_LineIn_Check, IO_VALUE.HIGH, 30);
Thread.Sleep(2000);
ShelfInLine.LineStop("EmptyStringIN");
ShelfInLine.LineRun("EmptyStringIN_agv", 40);
WaitIo(IO_T1_Type.Empty_LineIn_Check, IO_VALUE.HIGH, 30 * 1000);
ShelfInLine.LineRun("EmptyStringIN_agv", 15);
RobotManage.wistonAgvClient.FinishEnter();
}
......@@ -117,10 +134,11 @@ namespace DeviceLibrary
continue;
if (runStatus == RunStatus.Running)
{
//IOMonitor();
IOMonitorFUNC();
WorkProcess();
ShelfOutProcess();
ShelfInProcess();
}
else if (runStatus == RunStatus.HomeReset)
{
......@@ -250,7 +268,7 @@ namespace DeviceLibrary
ResetMoveInfo.NextMoveStep(MoveStep.HEND_HomeReset);
ResetMoveInfo.log("正在回原 顶升下降, 料串叉后退");
LocationDown(ResetMoveInfo);
CylinderMove(ResetMoveInfo, IO_T1_Type.Fork_Cylinder_Bck, IO_T1_Type.Fork_Cylinder_Fwd,IO_VALUE.LOW);
CylinderMove(ResetMoveInfo, IO_T1_Type.Fork_Cylinder_Bck, IO_T1_Type.Fork_Cylinder_Fwd, IO_VALUE.LOW);
break;
case MoveStep.HEND_HomeReset:
ResetMoveInfo.log("回源完成");
......@@ -289,5 +307,19 @@ namespace DeviceLibrary
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_T1_Type.T1_Location2_Cylinder_Down, IO_VALUE.HIGH));
}
}
bool calledagv = false;
void IOMonitorFUNC()
{
if (!calledagv && IOValue(IO_T1_Type.Empty_LineIn_Check).Equals(IO_VALUE.LOW)&& IOValue(IO_T1_Type.EmptyString_In_Check).Equals(IO_VALUE.LOW))
{
calledagv = true;
RobotManage.wistonAgvClient.NeedEnter();
}
else if (IOValue(IO_T1_Type.Empty_LineIn_Check).Equals(IO_VALUE.HIGH) || IOValue(IO_T1_Type.EmptyString_In_Check).Equals(IO_VALUE.HIGH))
{
calledagv = false;
}
}
}
}
......@@ -72,7 +72,7 @@ namespace DeviceLibrary
break;
case MoveStep.T1_04_DownToReel:
MoveInfo.NextMoveStep(MoveStep.T1_05_ClampReel);
int pos = Config.UpdownAxis_P2 - (MoveInfo.ReelParam.PlateH - 8) * Config.UpdownAxis_ChangeValue;
int pos = Config.UpdownAxis_P2 - (MoveInfo.ReelParam.PlateRawH - 8) * Config.UpdownAxis_ChangeValue;
MoveInfo.log($"升降轴下降到取料位置,配置位置:{Config.UpdownAxis_P2},计算位置:{pos}");
T_Updown_Axis.AbsMove(MoveInfo, pos, Config.UpdownAxis_P2_speed);
T_TrayPos_Axis.AbsMove(null, Config.TrayPos_P1, Config.TrayPos_P1_speed);
......@@ -135,8 +135,11 @@ namespace DeviceLibrary
T_Pan_Axis.AbsMove(MoveInfo, Pan_X, Config.Pan_P2_speed);
T_Y_Axis.AbsMove(MoveInfo, Y, Config.Y_P2_speed);
MoveInfo.log($"下降到料串 CenterPos:{CenterPos}, StringCenter:{LastStringCenter}, Offset:{new Point(offset_x, offset_y)}, AXIS:{new Point(Pan_X, Y)},");
T_Updown_Axis.AbsMove(MoveInfo, Config.UpdownAxis_P3, Config.UpdownAxis_P3_speed);
int p3pos = Config.UpdownAxis_P3 - (MoveInfo.ReelParam.PlateRawH - 8) * Config.UpdownAxis_ChangeValue;
T_Updown_Axis.AbsMove(MoveInfo, p3pos, Config.UpdownAxis_P3_speed);
MoveInfo.log($"下降到料串 CenterPos:{CenterPos}, StringCenter:{LastStringCenter}, Offset:{new Point(offset_x, offset_y)}, AXIS:{new Point(Pan_X, Y)},p3pos:{p3pos}");
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
}
else if (MoveInfo.IsTimeOut(30))
......@@ -311,7 +314,7 @@ namespace DeviceLibrary
Msg.add(crc.GetString("T1_ShelfReady", "料串准备完毕,等待放入料盘"), MsgLevel.info);
break;
case MoveStep.Shelf_21_EmptyIn_TrayDown: //料盘放入后调用
var Height = ShelfInMoveInfo.ReelParam.PlateH + 3;
var Height = ShelfInMoveInfo.ReelParam.PlateRawH;
var currpos = T_Batch_Axis.GetAclPosition() - Config.BatchAxis_ChangeValue * Height;
if (currpos < Config.BatchAxis_P1 + Config.BatchAxis_ChangeValue * 20)
{
......@@ -440,6 +443,8 @@ namespace DeviceLibrary
ShelfOutMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_T1_Type.T1_Out_Check, IO_VALUE.HIGH));
break;
case MoveStep.Shelf_36_Out_OutLineRun:
ShelfOutMoveInfo.log("呼叫AGV取满料串");
RobotManage.wistonAgvClient.NeedLeave();
ShelfOutMoveInfo.EndMove();
ShelfOutLine.LineStop("n", "Shelf_35_Out_OutLineRun");
break;
......@@ -457,9 +462,9 @@ namespace DeviceLibrary
// return;
ShelfInLine.LineRun("EmptyStringIN", 30);
WaitIo(IO_T1_Type.Empty_LineIn_Check, IO_VALUE.HIGH, 10);
IOMove(IO_T1_Type.EmptyString_In_Stop, IO_VALUE.HIGH, false, 2000);
IOMove(IO_T1_Type.EmptyString_In_Stop, IO_VALUE.HIGH, false, 3000);
WaitIo(IO_T1_Type.EmptyString_In_Check, IO_VALUE.HIGH, 10);
Thread.Sleep(1000);
Thread.Sleep(3000);
ShelfInLine.LineStop("EmptyStringIN");
this.loginfo($"T1等待位进入完成");
}
......@@ -523,6 +528,7 @@ namespace DeviceLibrary
{
//return (null, 0, "调试屏蔽");
Bitmap bmap = Common.DeepClone(Camera._cam.GrabOneImage(RobotManage.t1Machine.Config.String_Camera));
//Bitmap bmap = new Bitmap(@"D:\logs\853\Image_20210921151717963.bmp");
Bitmap bitmap = new Bitmap(bmap.Width, bmap.Height);
var rectx = Config.String_Center_X - 500;
......@@ -553,7 +559,7 @@ namespace DeviceLibrary
eyemlib.EyemOcsFXYR eyemOcsFXYR = new eyemlib.EyemOcsFXYR();
int result = eyemlib.eyemMulFuncTool(eyemImage, eyemRect, "__func1", 65, 75, ref eyemOcsFXYR, out _);
int result = eyemlib.eyemMulFuncTool(eyemImage, eyemRect, "__func1", ConfigHelper.Config.Get("findcicyle_p1",95), ConfigHelper.Config.Get("findcicyle_p2", 75), ref eyemOcsFXYR, out _);
LogUtil.info($"eyemMulFuncTool:result:{result},fX:{eyemOcsFXYR.fX},fY:{eyemOcsFXYR.fY},fR:{eyemOcsFXYR.fR}");
debugtxt = $"eyemMulFuncTool:\nresult:{result}\nfX:{eyemOcsFXYR.fX}\nfY:{eyemOcsFXYR.fY}\nfR:{eyemOcsFXYR.fR}";
bmap.UnlockBits(bitmapData);
......
......@@ -30,7 +30,8 @@ namespace DeviceLibrary
FeedingMoveinfo.NextMoveStep(MoveStep.Feeding_02_Take_Picture);
FeedingMoveinfo.ReelParam.PlateW = TrayWidth;
FeedingMoveinfo.ReelParam.PlateH = TrayHight;
FeedingMoveinfo.log($"已稳定检测到料盘TrayWidth={TrayWidth},TrayHight={TrayHight}");
FeedingMoveinfo.ReelParam.PlateRawH = TrayRawHight;
FeedingMoveinfo.log($"已稳定检测到料盘TrayWidth={TrayWidth},TrayHight={TrayHight},TrayRawHight={TrayRawHight}.");
}
break;
case MoveStep.Feeding_02_Take_Picture:
......@@ -158,6 +159,7 @@ namespace DeviceLibrary
}
int TrayWidth = 0;
int TrayHight = 0;
int TrayRawHight = 0;
void TrayMonitor() {
if (IOValue(IO_XRay_Type.Tray_Check).Equals(IO_VALUE.LOW))
{
......@@ -196,6 +198,7 @@ namespace DeviceLibrary
if (v>0)
FeedingMoveinfo.log($"Sensor Tray7:{Tray7},Tray13:{Tray13},Tray15:{Tray15}");
TrayHight = CalcHight(v);
TrayRawHight = v;
}
......
......@@ -56,7 +56,7 @@ namespace DeviceLibrary
MoveInfo.NextMoveStep(MoveStep.XRay_05_GetImage);
RobotManage.XRay.Start();
MoveInfo.log($"打开X光");
//MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
break;
case MoveStep.XRay_05_GetImage:
if (GrabImage())
......@@ -211,8 +211,9 @@ namespace DeviceLibrary
int[] countStr = new int[4];
int result = 0;
int ShrinkOffset = ConfigHelper.Config.Get<int>("ShrinkOffset",100);
var type = Pn_Algo_Match.MatchPN(MoveInfo.ReelParam.PN);
MoveInfo.log($"匹配到算法.{type}");
var pps = MoveInfo.ReelParam.PN.Split('-');
var type = Pn_Algo_Match.MatchPN(pps[0]);
MoveInfo.log($"匹配到算法.{pps[0]}={type}");
if (type.StartsWith("IP_Template_PARTS"))
{
if (!File.Exists(type.Substring(17 + 1)))
......
......@@ -26,6 +26,7 @@ namespace DeviceLibrary
WareCode = wareNo;
PlateW = platew;
PlateH = plateh;
PlateRawH = plateh;
IsNg = _IsNg;
NgMsg = ngMsg;
......@@ -62,6 +63,7 @@ namespace DeviceLibrary
/// 料盘高度
/// </summary>
public int PlateH { get; set; }
public int PlateRawH { get; set; }
/// <summary>
/// 料盘宽度
/// </summary>
......@@ -116,7 +118,7 @@ namespace DeviceLibrary
public void logresult() {
if (!islog) {
islog = true;
string countfile = $"CountResult-{DateTime.Now:yyyy-MM-dd}.txt";
string countfile = $"logs\\CountResult-{DateTime.Now:yyyy-MM-dd}.txt";
if (!File.Exists(countfile)) {
var sw1 = File.AppendText(countfile);
sw1.WriteLine($"Date,ReeID,PN,WxH,ReelDest,NgMsg,QTY,LabelState,2D_Barcode");
......
......@@ -12,12 +12,17 @@ namespace DeviceLibrary
static on ondelegate;
static on offdelegate;
static bool enable = false;
public static bool Enable { get => enable;set {
public static bool Enable
{
get => enable; set
{
enable = value;
if (!value) {
if (!value)
{
OFF();
}
} }
}
}
static AlarmBuzzerState State = AlarmBuzzerState.OFF;
public static event EventHandler<bool> BuzzerStateChange;
public static void SetOnOffAction(Action ona, Action offa) {
......@@ -29,8 +34,12 @@ namespace DeviceLibrary
if (!Enable)
return;
if (State == AlarmBuzzerState.MuteOnce)
{
return;
}
if (force || (State != AlarmBuzzerState.ON && State != AlarmBuzzerState.MuteOnce))
if (force || State != AlarmBuzzerState.ON)
{
State = AlarmBuzzerState.ON;
ondelegate?.Invoke();
......
......@@ -16,10 +16,12 @@ namespace DeviceLibrary
{
Socket client;
IPEndPoint ipe;
Timer timer;
Timer timer;
static readonly ILog LOGGER = LogManager.GetLogger("WistonAgvClient");
object conn = new object();
Dictionary<string, bool> commandConfirm;
List<(DateTime, string)> OutCommandHistroy;
List<(DateTime, string)> InCommandHistroy;
public WistonAgvClient()
{
commandLoad();
......@@ -46,6 +48,7 @@ namespace DeviceLibrary
{
if (client != null && client.Connected)
{
return;
if (waitTimes > 5) {
try
{
......@@ -167,16 +170,26 @@ namespace DeviceLibrary
socket.BeginReceive(data, 0, data.Length, SocketFlags.None,
asyncResult =>
{
if (!socket.Connected) {
try
{
if (!socket.Connected)
{
CloseConnect();
log("连接断开了,稍后再次连接,AsynRecive");
return;
}
int length = socket.EndReceive(asyncResult);
var msg = Encoding.UTF8.GetString(data, 0, length);
MsgProcess(msg);
log(string.Format("收到服务器消息:{0}", msg));
AsynRecive(socket);
}
catch (Exception ex)
{
log(string.Format("异常信息:{0}", ex.Message));
CloseConnect();
log("连接断开了,稍后再次连接,AsynRecive");
return;
}
int length = socket.EndReceive(asyncResult);
var msg = Encoding.UTF8.GetString(data, 0, length);
MsgProcess(msg);
log(string.Format("收到服务器消息:{0}", msg));
AsynRecive(socket);
}, null);
}
catch (Exception ex)
......@@ -261,5 +274,10 @@ namespace DeviceLibrary
LOGGER.Info(msg);
Console.WriteLine(msg);
}
void AddOutCommandHistroy(string cmd) {
OutCommandHistroy.Add((DateTime.Now, cmd));
if (OutCommandHistroy.Count>10)
OutCommandHistroy.RemoveAt(0);
}
}
}
\ No newline at end of file

namespace AutoCountMachine
{
partial class AdvanceConfig
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.SuspendLayout();
//
// AdvanceConfig
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 450);
this.Name = "AdvanceConfig";
this.Text = "AdvanceConfig";
this.ResumeLayout(false);
}
#endregion
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace AutoCountMachine
{
public partial class AdvanceConfig : Form
{
public AdvanceConfig()
{
InitializeComponent();
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file
......@@ -67,9 +67,9 @@ namespace AutoCountMachine
crc.LanguageProcess(this, this.GetType().Name);
crc.ProcessListItem(menuStrip1.Items, "menuStrip1");
listView1.Columns[1].Text = crc.GetString("table_device", "设备");
listView1.Columns[2].Text = crc.GetString("table_info", "信息");
listView1.Columns[3].Text = crc.GetString("table_datetime", "时间");
listView1.Columns[1].Text = crc.GetString("table_device", "设备");
listView1.Columns[2].Text = crc.GetString("table_datetime", "时间");
listView1.Columns[3].Text = crc.GetString("table_info", "信息");
stateView.Columns[1].Text = crc.GetString("table_module", "模块");
stateView.Columns[2].Text = crc.GetString("table_step", "步骤");
......@@ -359,7 +359,7 @@ namespace AutoCountMachine
}
else
{
for (int i = tabControl1.TabPages.Count - 2; i > 0; i--)
for (int i = tabControl1.TabPages.Count - 1; i > 1; i--)
{
tabControl1.TabPages[i].Parent = null;
}
......@@ -471,7 +471,6 @@ namespace AutoCountMachine
RobotManage.offlinemode = true;
break;
}
}
......@@ -480,9 +479,6 @@ namespace AutoCountMachine
AlarmBuzzer.MuteOnce();
}
private void 操作员ToolStripMenuItem_Click(object sender, EventArgs e)
{
RoleManger.SetRole(Role.User);
......
......@@ -31,12 +31,14 @@ namespace AutoCountMachine
{
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.btn_line2_stop = new System.Windows.Forms.Button();
this.btn_line1_stop = new System.Windows.Forms.Button();
this.btn_line2_run = new System.Windows.Forms.Button();
this.btn_line1_run = new System.Windows.Forms.Button();
this.cylinderButton11 = new AutoCountMachine.CylinderButton();
this.cylinderButton5 = new AutoCountMachine.CylinderButton();
this.cylinderButton2 = new AutoCountMachine.CylinderButton();
this.cylinderButton3 = new AutoCountMachine.CylinderButton();
this.cylinderButton1 = new AutoCountMachine.CylinderButton();
this.cylinderButton4 = new AutoCountMachine.CylinderButton();
this.btn_Reset = new System.Windows.Forms.Button();
this.ioControl1 = new AutoCountMachine.IOControl();
this.tabPage2 = new System.Windows.Forms.TabPage();
......@@ -55,6 +57,7 @@ namespace AutoCountMachine
this.btn_LabelTest = new System.Windows.Forms.Button();
this.checkBox_saveLabelDebugBmp = new System.Windows.Forms.CheckBox();
this.button1 = new System.Windows.Forms.Button();
this.chb_disablelabel = new System.Windows.Forms.CheckBox();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
this.tabPage2.SuspendLayout();
......@@ -78,23 +81,65 @@ namespace AutoCountMachine
//
// tabPage1
//
this.tabPage1.Controls.Add(this.btn_line2_stop);
this.tabPage1.Controls.Add(this.btn_line1_stop);
this.tabPage1.Controls.Add(this.btn_line2_run);
this.tabPage1.Controls.Add(this.btn_line1_run);
this.tabPage1.Controls.Add(this.cylinderButton11);
this.tabPage1.Controls.Add(this.cylinderButton5);
this.tabPage1.Controls.Add(this.cylinderButton2);
this.tabPage1.Controls.Add(this.cylinderButton3);
this.tabPage1.Controls.Add(this.cylinderButton1);
this.tabPage1.Controls.Add(this.cylinderButton4);
this.tabPage1.Controls.Add(this.btn_Reset);
this.tabPage1.Controls.Add(this.ioControl1);
this.tabPage1.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.tabPage1.Location = new System.Drawing.Point(4, 22);
this.tabPage1.Location = new System.Drawing.Point(4, 25);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(1194, 533);
this.tabPage1.Size = new System.Drawing.Size(1194, 530);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "I/O控制";
this.tabPage1.UseVisualStyleBackColor = true;
//
// btn_line2_stop
//
this.btn_line2_stop.Location = new System.Drawing.Point(687, 378);
this.btn_line2_stop.Name = "btn_line2_stop";
this.btn_line2_stop.Size = new System.Drawing.Size(127, 35);
this.btn_line2_stop.TabIndex = 304;
this.btn_line2_stop.Text = "线体2关";
this.btn_line2_stop.UseVisualStyleBackColor = true;
this.btn_line2_stop.Click += new System.EventHandler(this.btn_line2_stop_Click);
//
// btn_line1_stop
//
this.btn_line1_stop.Location = new System.Drawing.Point(687, 337);
this.btn_line1_stop.Name = "btn_line1_stop";
this.btn_line1_stop.Size = new System.Drawing.Size(127, 35);
this.btn_line1_stop.TabIndex = 304;
this.btn_line1_stop.Text = "线体1关";
this.btn_line1_stop.UseVisualStyleBackColor = true;
this.btn_line1_stop.Click += new System.EventHandler(this.btn_line1_stop_Click);
//
// btn_line2_run
//
this.btn_line2_run.Location = new System.Drawing.Point(553, 378);
this.btn_line2_run.Name = "btn_line2_run";
this.btn_line2_run.Size = new System.Drawing.Size(127, 35);
this.btn_line2_run.TabIndex = 304;
this.btn_line2_run.Text = "线体2开";
this.btn_line2_run.UseVisualStyleBackColor = true;
this.btn_line2_run.Click += new System.EventHandler(this.btn_line2_run_Click);
//
// btn_line1_run
//
this.btn_line1_run.Location = new System.Drawing.Point(553, 337);
this.btn_line1_run.Name = "btn_line1_run";
this.btn_line1_run.Size = new System.Drawing.Size(127, 35);
this.btn_line1_run.TabIndex = 304;
this.btn_line1_run.Text = "线体1开";
this.btn_line1_run.UseVisualStyleBackColor = true;
this.btn_line1_run.Click += new System.EventHandler(this.btn_line1_run_Click);
//
// cylinderButton11
//
this.cylinderButton11.BackColor = System.Drawing.Color.White;
......@@ -109,20 +154,6 @@ namespace AutoCountMachine
this.cylinderButton11.Text = "Y18";
this.cylinderButton11.UseVisualStyleBackColor = false;
//
// cylinderButton5
//
this.cylinderButton5.BackColor = System.Drawing.Color.White;
this.cylinderButton5.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.cylinderButton5.IO_HIGH = "Line2_Run";
this.cylinderButton5.IO_LOW = "";
this.cylinderButton5.Location = new System.Drawing.Point(553, 378);
this.cylinderButton5.Name = "cylinderButton5";
this.cylinderButton5.Size = new System.Drawing.Size(261, 35);
this.cylinderButton5.TabIndex = 303;
this.cylinderButton5.Tag = "not";
this.cylinderButton5.Text = "Line2_Run";
this.cylinderButton5.UseVisualStyleBackColor = false;
//
// cylinderButton2
//
this.cylinderButton2.BackColor = System.Drawing.Color.White;
......@@ -165,20 +196,6 @@ namespace AutoCountMachine
this.cylinderButton1.Text = "TrayStop_Up";
this.cylinderButton1.UseVisualStyleBackColor = false;
//
// cylinderButton4
//
this.cylinderButton4.BackColor = System.Drawing.Color.White;
this.cylinderButton4.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.cylinderButton4.IO_HIGH = "Line1_Run";
this.cylinderButton4.IO_LOW = "";
this.cylinderButton4.Location = new System.Drawing.Point(553, 337);
this.cylinderButton4.Name = "cylinderButton4";
this.cylinderButton4.Size = new System.Drawing.Size(261, 35);
this.cylinderButton4.TabIndex = 302;
this.cylinderButton4.Tag = "not";
this.cylinderButton4.Text = "Line1_Run";
this.cylinderButton4.UseVisualStyleBackColor = false;
//
// btn_Reset
//
this.btn_Reset.Location = new System.Drawing.Point(553, 474);
......@@ -196,7 +213,7 @@ namespace AutoCountMachine
this.ioControl1.Location = new System.Drawing.Point(3, 3);
this.ioControl1.Margin = new System.Windows.Forms.Padding(4);
this.ioControl1.Name = "ioControl1";
this.ioControl1.Size = new System.Drawing.Size(1188, 527);
this.ioControl1.Size = new System.Drawing.Size(1188, 524);
this.ioControl1.TabIndex = 0;
this.ioControl1.Tag = "not";
//
......@@ -204,10 +221,10 @@ namespace AutoCountMachine
//
this.tabPage2.Controls.Add(this.panel1);
this.tabPage2.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.tabPage2.Location = new System.Drawing.Point(4, 22);
this.tabPage2.Location = new System.Drawing.Point(4, 25);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
this.tabPage2.Size = new System.Drawing.Size(1194, 533);
this.tabPage2.Size = new System.Drawing.Size(1194, 530);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "伺服配置";
this.tabPage2.UseVisualStyleBackColor = true;
......@@ -220,13 +237,14 @@ namespace AutoCountMachine
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel1.Location = new System.Drawing.Point(3, 3);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(1188, 527);
this.panel1.Size = new System.Drawing.Size(1188, 524);
this.panel1.TabIndex = 2;
//
// configControl1
//
this.configControl1.Config = null;
this.configControl1.Location = new System.Drawing.Point(558, 3);
this.configControl1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.configControl1.Name = "configControl1";
this.configControl1.Size = new System.Drawing.Size(637, 569);
this.configControl1.TabIndex = 0;
......@@ -243,15 +261,16 @@ namespace AutoCountMachine
// tabPage3
//
this.tabPage3.Controls.Add(this.panel2);
this.tabPage3.Location = new System.Drawing.Point(4, 22);
this.tabPage3.Location = new System.Drawing.Point(4, 25);
this.tabPage3.Name = "tabPage3";
this.tabPage3.Size = new System.Drawing.Size(1194, 533);
this.tabPage3.Size = new System.Drawing.Size(1194, 530);
this.tabPage3.TabIndex = 2;
this.tabPage3.Text = "标签设置";
this.tabPage3.UseVisualStyleBackColor = true;
//
// panel2
//
this.panel2.Controls.Add(this.chb_disablelabel);
this.panel2.Controls.Add(this.groupBox1);
this.panel2.Controls.Add(this.button2);
this.panel2.Controls.Add(this.btn_LabelTest);
......@@ -260,7 +279,7 @@ namespace AutoCountMachine
this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel2.Location = new System.Drawing.Point(0, 0);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(1194, 533);
this.panel2.Size = new System.Drawing.Size(1194, 530);
this.panel2.TabIndex = 6;
//
// groupBox1
......@@ -282,7 +301,7 @@ namespace AutoCountMachine
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(19, 78);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(41, 12);
this.label2.Size = new System.Drawing.Size(52, 15);
this.label2.TabIndex = 2;
this.label2.Text = "标签名";
//
......@@ -291,7 +310,7 @@ namespace AutoCountMachine
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(19, 40);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(41, 12);
this.label1.Size = new System.Drawing.Size(52, 15);
this.label1.TabIndex = 2;
this.label1.Text = "打印机";
//
......@@ -310,7 +329,7 @@ namespace AutoCountMachine
this.cb_labelselect.FormattingEnabled = true;
this.cb_labelselect.Location = new System.Drawing.Point(88, 75);
this.cb_labelselect.Name = "cb_labelselect";
this.cb_labelselect.Size = new System.Drawing.Size(198, 20);
this.cb_labelselect.Size = new System.Drawing.Size(198, 23);
this.cb_labelselect.TabIndex = 0;
this.cb_labelselect.Tag = "not";
this.cb_labelselect.SelectedIndexChanged += new System.EventHandler(this.cb_labelselect_SelectedIndexChanged);
......@@ -320,7 +339,7 @@ namespace AutoCountMachine
this.cb_printerselect.FormattingEnabled = true;
this.cb_printerselect.Location = new System.Drawing.Point(88, 37);
this.cb_printerselect.Name = "cb_printerselect";
this.cb_printerselect.Size = new System.Drawing.Size(198, 20);
this.cb_printerselect.Size = new System.Drawing.Size(198, 23);
this.cb_printerselect.TabIndex = 0;
this.cb_printerselect.Tag = "not";
this.cb_printerselect.SelectedIndexChanged += new System.EventHandler(this.cb_printerselect_SelectedIndexChanged);
......@@ -352,7 +371,7 @@ namespace AutoCountMachine
this.checkBox_saveLabelDebugBmp.CheckState = System.Windows.Forms.CheckState.Checked;
this.checkBox_saveLabelDebugBmp.Location = new System.Drawing.Point(25, 181);
this.checkBox_saveLabelDebugBmp.Name = "checkBox_saveLabelDebugBmp";
this.checkBox_saveLabelDebugBmp.Size = new System.Drawing.Size(120, 16);
this.checkBox_saveLabelDebugBmp.Size = new System.Drawing.Size(149, 19);
this.checkBox_saveLabelDebugBmp.TabIndex = 4;
this.checkBox_saveLabelDebugBmp.Text = "保存贴标调试图像";
this.checkBox_saveLabelDebugBmp.UseVisualStyleBackColor = true;
......@@ -368,6 +387,17 @@ namespace AutoCountMachine
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// chb_disablelabel
//
this.chb_disablelabel.AutoSize = true;
this.chb_disablelabel.Location = new System.Drawing.Point(375, 14);
this.chb_disablelabel.Name = "chb_disablelabel";
this.chb_disablelabel.Size = new System.Drawing.Size(89, 19);
this.chb_disablelabel.TabIndex = 6;
this.chb_disablelabel.Text = "跳过贴标";
this.chb_disablelabel.UseVisualStyleBackColor = true;
this.chb_disablelabel.CheckedChanged += new System.EventHandler(this.chb_disablelabel_CheckedChanged);
//
// LabelControl
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
......@@ -409,12 +439,15 @@ namespace AutoCountMachine
private CylinderButton cylinderButton3;
private CylinderButton cylinderButton2;
private CylinderButton cylinderButton1;
private CylinderButton cylinderButton5;
private CylinderButton cylinderButton4;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.CheckBox checkBox_saveLabelDebugBmp;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.Button btn_line2_stop;
private System.Windows.Forms.Button btn_line1_stop;
private System.Windows.Forms.Button btn_line2_run;
private System.Windows.Forms.Button btn_line1_run;
private System.Windows.Forms.CheckBox chb_disablelabel;
}
}
......@@ -54,26 +54,32 @@ namespace AutoCountMachine
{
if (!state)
return;
//this.Invoke((EventHandler)delegate
//{
cb_printerselect.Items.Clear();
cb_labelselect.Items.Clear();
foreach (string sPrint in System.Drawing.Printing.PrinterSettings.InstalledPrinters)//获取所有打印机名称
if (this.InvokeRequired)
{
this.Invoke((EventHandler)delegate
{
cb_printerselect.Items.Add(sPrint);
}
if (RobotManage.PrintBean != null)
RobotManage_LoadFinishEvent(state, msg);
});
return;
}
cb_printerselect.Items.Clear();
cb_labelselect.Items.Clear();
foreach (string sPrint in System.Drawing.Printing.PrinterSettings.InstalledPrinters)//获取所有打印机名称
{
cb_printerselect.Items.Add(sPrint);
}
if (RobotManage.PrintBean != null)
{
foreach (string labelname in RobotManage.PrintBean.GetLabelName())
{
foreach (string labelname in RobotManage.PrintBean.GetLabelName())
{
cb_labelselect.Items.Add(labelname);
}
cb_labelselect.Items.Add(labelname);
}
string PrintName = ConfigHelper.Config.Get(Setting_Init.PrinterName);
string labelName = ConfigHelper.Config.Get(Setting_Init.LabelName);
cb_printerselect.Text = PrintName;
cb_labelselect.Text = labelName;
//});
}
string PrintName = ConfigHelper.Config.Get(Setting_Init.PrinterName);
string labelName = ConfigHelper.Config.Get(Setting_Init.LabelName);
cb_printerselect.Text = PrintName;
cb_labelselect.Text = labelName;
}
private void cb_printerselect_SelectedIndexChanged(object sender, EventArgs e)
{
......@@ -141,5 +147,31 @@ namespace AutoCountMachine
}
}
private void btn_line1_run_Click(object sender, EventArgs e)
{
RobotManage.Line1.LineRun("n", 999);
}
private void btn_line1_stop_Click(object sender, EventArgs e)
{
RobotManage.Line1.LineStop ("n");
}
private void btn_line2_run_Click(object sender, EventArgs e)
{
RobotManage.Line2.LineRun("n", 999);
}
private void btn_line2_stop_Click(object sender, EventArgs e)
{
RobotManage.Line2.LineStop("n");
}
private void chb_disablelabel_CheckedChanged(object sender, EventArgs e)
{
RobotManage.labelMachine.DisableLabel = chb_disablelabel.Checked;
LogUtil.info($"手动屏蔽贴标:{chb_disablelabel.Checked}");
}
}
}
......@@ -81,6 +81,12 @@
<Reference Include="X-Ray, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
</ItemGroup>
<ItemGroup>
<Compile Include="AdvanceConfig.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="AdvanceConfig.Designer.cs">
<DependentUpon>AdvanceConfig.cs</DependentUpon>
</Compile>
<Compile Include="eyemlib.cs" />
<Compile Include="UCCOMMON\BoxResetControl.cs">
<SubType>UserControl</SubType>
......@@ -151,6 +157,9 @@
<Compile Include="XrayControl.Designer.cs">
<DependentUpon>XrayControl.cs</DependentUpon>
</Compile>
<EmbeddedResource Include="AdvanceConfig.resx">
<DependentUpon>AdvanceConfig.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UCCOMMON\BoxResetControl.resx">
<DependentUpon>BoxResetControl.cs</DependentUpon>
</EmbeddedResource>
......
......@@ -32,6 +32,7 @@ namespace AutoCountMachine
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.panel1 = new System.Windows.Forms.Panel();
this.label_count = new System.Windows.Forms.Label();
this.dateTimePicker_end = new System.Windows.Forms.DateTimePicker();
this.dateTimePicker_start = new System.Windows.Forms.DateTimePicker();
this.dataGridView1 = new System.Windows.Forms.DataGridView();
......@@ -44,7 +45,7 @@ namespace AutoCountMachine
this.btn_setadminpassword = new System.Windows.Forms.Button();
this.cb_autorun = new System.Windows.Forms.CheckBox();
this.cb_EnableBuzzer = new System.Windows.Forms.CheckBox();
this.label_count = new System.Windows.Forms.Label();
this.linkLabel1 = new System.Windows.Forms.LinkLabel();
this.tabControl1.SuspendLayout();
this.tabPage2.SuspendLayout();
this.panel1.SuspendLayout();
......@@ -93,6 +94,16 @@ namespace AutoCountMachine
this.panel1.Size = new System.Drawing.Size(758, 529);
this.panel1.TabIndex = 2;
//
// label_count
//
this.label_count.AutoSize = true;
this.label_count.Location = new System.Drawing.Point(15, 406);
this.label_count.Name = "label_count";
this.label_count.Size = new System.Drawing.Size(41, 12);
this.label_count.TabIndex = 3;
this.label_count.Tag = "not";
this.label_count.Text = "label1";
//
// dateTimePicker_end
//
this.dateTimePicker_end.CustomFormat = "yyyy/MM/dd HH:mm";
......@@ -192,6 +203,7 @@ namespace AutoCountMachine
//
// tabPage1
//
this.tabPage1.Controls.Add(this.linkLabel1);
this.tabPage1.Controls.Add(this.btn_setadminpassword);
this.tabPage1.Controls.Add(this.cb_autorun);
this.tabPage1.Controls.Add(this.cb_EnableBuzzer);
......@@ -199,14 +211,14 @@ namespace AutoCountMachine
this.tabPage1.Location = new System.Drawing.Point(4, 22);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(764, 430);
this.tabPage1.Size = new System.Drawing.Size(764, 535);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "设置";
this.tabPage1.UseVisualStyleBackColor = true;
//
// btn_setadminpassword
//
this.btn_setadminpassword.Location = new System.Drawing.Point(32, 100);
this.btn_setadminpassword.Location = new System.Drawing.Point(32, 107);
this.btn_setadminpassword.Name = "btn_setadminpassword";
this.btn_setadminpassword.Size = new System.Drawing.Size(141, 33);
this.btn_setadminpassword.TabIndex = 10;
......@@ -235,15 +247,16 @@ namespace AutoCountMachine
this.cb_EnableBuzzer.UseVisualStyleBackColor = true;
this.cb_EnableBuzzer.CheckedChanged += new System.EventHandler(this.cb_EnableBuzzer_CheckedChanged);
//
// label_count
// linkLabel1
//
this.label_count.AutoSize = true;
this.label_count.Location = new System.Drawing.Point(15, 406);
this.label_count.Name = "label_count";
this.label_count.Size = new System.Drawing.Size(41, 12);
this.label_count.TabIndex = 3;
this.label_count.Tag = "not";
this.label_count.Text = "label1";
this.linkLabel1.AutoSize = true;
this.linkLabel1.Location = new System.Drawing.Point(20, 500);
this.linkLabel1.Name = "linkLabel1";
this.linkLabel1.Size = new System.Drawing.Size(14, 14);
this.linkLabel1.TabIndex = 11;
this.linkLabel1.TabStop = true;
this.linkLabel1.Text = "_";
this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked);
//
// SettingControl
//
......@@ -281,5 +294,6 @@ namespace AutoCountMachine
private System.Windows.Forms.DateTimePicker dateTimePicker_start;
private System.Windows.Forms.RadioButton rb_datafilter_custom;
private System.Windows.Forms.Label label_count;
private System.Windows.Forms.LinkLabel linkLabel1;
}
}
......@@ -171,5 +171,10 @@ namespace AutoCountMachine
{
}
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
ConfigHelper.AdvanceConfigForm.ShowEditDialog();
}
}
}
......@@ -61,12 +61,20 @@ namespace AutoCountMachine
this.button1 = new System.Windows.Forms.Button();
this.btn_eyemMulFuncTool = new System.Windows.Forms.Button();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.tabPage4 = new System.Windows.Forms.TabPage();
this.btn_agvout = new System.Windows.Forms.Button();
this.btn_agvin = new System.Windows.Forms.Button();
this.txt_p2 = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.txt_p1 = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
this.tabPage2.SuspendLayout();
this.panel1.SuspendLayout();
this.tabPage3.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.tabPage4.SuspendLayout();
this.SuspendLayout();
//
// tabControl1
......@@ -74,6 +82,7 @@ namespace AutoCountMachine
this.tabControl1.Controls.Add(this.tabPage1);
this.tabControl1.Controls.Add(this.tabPage2);
this.tabControl1.Controls.Add(this.tabPage3);
this.tabControl1.Controls.Add(this.tabPage4);
this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tabControl1.Location = new System.Drawing.Point(0, 0);
this.tabControl1.Name = "tabControl1";
......@@ -105,10 +114,10 @@ namespace AutoCountMachine
this.tabPage1.Controls.Add(this.cylinderButton1);
this.tabPage1.Controls.Add(this.ioControl1);
this.tabPage1.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.tabPage1.Location = new System.Drawing.Point(4, 22);
this.tabPage1.Location = new System.Drawing.Point(4, 25);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(1016, 533);
this.tabPage1.Size = new System.Drawing.Size(1016, 530);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "I/O控制";
this.tabPage1.UseVisualStyleBackColor = true;
......@@ -203,6 +212,7 @@ namespace AutoCountMachine
this.cylinderButton14.Name = "cylinderButton14";
this.cylinderButton14.Size = new System.Drawing.Size(192, 35);
this.cylinderButton14.TabIndex = 303;
this.cylinderButton14.Tag = "not";
this.cylinderButton14.Text = "T1_Wait_Stop";
this.cylinderButton14.UseVisualStyleBackColor = false;
//
......@@ -216,6 +226,7 @@ namespace AutoCountMachine
this.cylinderButton13.Name = "cylinderButton13";
this.cylinderButton13.Size = new System.Drawing.Size(192, 35);
this.cylinderButton13.TabIndex = 303;
this.cylinderButton13.Tag = "not";
this.cylinderButton13.Text = "T1_Out_Stop";
this.cylinderButton13.UseVisualStyleBackColor = false;
//
......@@ -229,6 +240,7 @@ namespace AutoCountMachine
this.cylinderButton12.Name = "cylinderButton12";
this.cylinderButton12.Size = new System.Drawing.Size(192, 35);
this.cylinderButton12.TabIndex = 302;
this.cylinderButton12.Tag = "not";
this.cylinderButton12.Text = "EmptyString_Wait_Stop";
this.cylinderButton12.UseVisualStyleBackColor = false;
//
......@@ -242,6 +254,7 @@ namespace AutoCountMachine
this.cylinderButton6.Name = "cylinderButton6";
this.cylinderButton6.Size = new System.Drawing.Size(215, 35);
this.cylinderButton6.TabIndex = 301;
this.cylinderButton6.Tag = "not";
this.cylinderButton6.Text = "T1_Sliding_Run";
this.cylinderButton6.UseVisualStyleBackColor = false;
//
......@@ -255,6 +268,7 @@ namespace AutoCountMachine
this.cylinderButton5.Name = "cylinderButton5";
this.cylinderButton5.Size = new System.Drawing.Size(215, 35);
this.cylinderButton5.TabIndex = 301;
this.cylinderButton5.Tag = "not";
this.cylinderButton5.Text = "T1String_Sliding_Run";
this.cylinderButton5.UseVisualStyleBackColor = false;
//
......@@ -268,6 +282,7 @@ namespace AutoCountMachine
this.cylinderButton4.Name = "cylinderButton4";
this.cylinderButton4.Size = new System.Drawing.Size(215, 35);
this.cylinderButton4.TabIndex = 300;
this.cylinderButton4.Tag = "not";
this.cylinderButton4.Text = "EmptyString_Sliding_Run";
this.cylinderButton4.UseVisualStyleBackColor = false;
//
......@@ -281,6 +296,7 @@ namespace AutoCountMachine
this.cylinderButton11.Name = "cylinderButton11";
this.cylinderButton11.Size = new System.Drawing.Size(192, 35);
this.cylinderButton11.TabIndex = 300;
this.cylinderButton11.Tag = "not";
this.cylinderButton11.Text = "EmptyString_In_Stop";
this.cylinderButton11.UseVisualStyleBackColor = false;
//
......@@ -294,6 +310,7 @@ namespace AutoCountMachine
this.cylinderButton10.Name = "cylinderButton10";
this.cylinderButton10.Size = new System.Drawing.Size(192, 35);
this.cylinderButton10.TabIndex = 300;
this.cylinderButton10.Tag = "not";
this.cylinderButton10.Text = "Fork_Cylinder_Fwd";
this.cylinderButton10.UseVisualStyleBackColor = false;
//
......@@ -307,6 +324,7 @@ namespace AutoCountMachine
this.cylinderButton9.Name = "cylinderButton9";
this.cylinderButton9.Size = new System.Drawing.Size(192, 35);
this.cylinderButton9.TabIndex = 300;
this.cylinderButton9.Tag = "not";
this.cylinderButton9.Text = "T1_Location_Cylinder_Up";
this.cylinderButton9.UseVisualStyleBackColor = false;
//
......@@ -320,6 +338,7 @@ namespace AutoCountMachine
this.cylinderButton8.Name = "cylinderButton8";
this.cylinderButton8.Size = new System.Drawing.Size(192, 35);
this.cylinderButton8.TabIndex = 300;
this.cylinderButton8.Tag = "not";
this.cylinderButton8.Text = "T1_Lift_Up";
this.cylinderButton8.UseVisualStyleBackColor = false;
//
......@@ -333,6 +352,7 @@ namespace AutoCountMachine
this.cylinderButton7.Name = "cylinderButton7";
this.cylinderButton7.Size = new System.Drawing.Size(192, 35);
this.cylinderButton7.TabIndex = 300;
this.cylinderButton7.Tag = "not";
this.cylinderButton7.Text = "EmptyString_Lift_Up";
this.cylinderButton7.UseVisualStyleBackColor = false;
//
......@@ -346,6 +366,7 @@ namespace AutoCountMachine
this.cylinderButton1.Name = "cylinderButton1";
this.cylinderButton1.Size = new System.Drawing.Size(215, 35);
this.cylinderButton1.TabIndex = 300;
this.cylinderButton1.Tag = "not";
this.cylinderButton1.Text = "End_Lift_Cylinder_Up";
this.cylinderButton1.UseVisualStyleBackColor = false;
//
......@@ -356,17 +377,18 @@ namespace AutoCountMachine
this.ioControl1.Location = new System.Drawing.Point(3, 3);
this.ioControl1.Margin = new System.Windows.Forms.Padding(4);
this.ioControl1.Name = "ioControl1";
this.ioControl1.Size = new System.Drawing.Size(1010, 527);
this.ioControl1.Size = new System.Drawing.Size(1010, 524);
this.ioControl1.TabIndex = 0;
this.ioControl1.Tag = "not";
//
// tabPage2
//
this.tabPage2.Controls.Add(this.panel1);
this.tabPage2.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.tabPage2.Location = new System.Drawing.Point(4, 22);
this.tabPage2.Location = new System.Drawing.Point(4, 25);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
this.tabPage2.Size = new System.Drawing.Size(1016, 533);
this.tabPage2.Size = new System.Drawing.Size(1016, 530);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "伺服配置";
this.tabPage2.UseVisualStyleBackColor = true;
......@@ -379,7 +401,7 @@ namespace AutoCountMachine
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel1.Location = new System.Drawing.Point(3, 3);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(1010, 527);
this.panel1.Size = new System.Drawing.Size(1010, 524);
this.panel1.TabIndex = 2;
//
// axisMoveControl1
......@@ -388,33 +410,41 @@ namespace AutoCountMachine
this.axisMoveControl1.Name = "axisMoveControl1";
this.axisMoveControl1.Size = new System.Drawing.Size(556, 402);
this.axisMoveControl1.TabIndex = 1;
this.axisMoveControl1.Tag = "not";
//
// configControl1
//
this.configControl1.Config = null;
this.configControl1.Location = new System.Drawing.Point(562, 3);
this.configControl1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.configControl1.Name = "configControl1";
this.configControl1.Size = new System.Drawing.Size(627, 483);
this.configControl1.TabIndex = 0;
this.configControl1.Tag = "not";
//
// tabPage3
//
this.tabPage3.Controls.Add(this.label2);
this.tabPage3.Controls.Add(this.label1);
this.tabPage3.Controls.Add(this.txt_p1);
this.tabPage3.Controls.Add(this.txt_p2);
this.tabPage3.Controls.Add(this.label_eyemMulFuncTool);
this.tabPage3.Controls.Add(this.button1);
this.tabPage3.Controls.Add(this.btn_eyemMulFuncTool);
this.tabPage3.Controls.Add(this.pictureBox1);
this.tabPage3.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.tabPage3.Location = new System.Drawing.Point(4, 22);
this.tabPage3.Location = new System.Drawing.Point(4, 25);
this.tabPage3.Name = "tabPage3";
this.tabPage3.Padding = new System.Windows.Forms.Padding(3);
this.tabPage3.Size = new System.Drawing.Size(1016, 533);
this.tabPage3.Size = new System.Drawing.Size(1016, 530);
this.tabPage3.TabIndex = 2;
this.tabPage3.Text = "料串定位";
this.tabPage3.UseVisualStyleBackColor = true;
this.tabPage3.Click += new System.EventHandler(this.tabPage3_Click);
//
// label_eyemMulFuncTool
//
this.label_eyemMulFuncTool.Location = new System.Drawing.Point(831, 191);
this.label_eyemMulFuncTool.Location = new System.Drawing.Point(831, 277);
this.label_eyemMulFuncTool.Name = "label_eyemMulFuncTool";
this.label_eyemMulFuncTool.Size = new System.Drawing.Size(128, 173);
this.label_eyemMulFuncTool.TabIndex = 2;
......@@ -422,7 +452,7 @@ namespace AutoCountMachine
//
// button1
//
this.button1.Location = new System.Drawing.Point(831, 52);
this.button1.Location = new System.Drawing.Point(831, 138);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(136, 40);
this.button1.TabIndex = 1;
......@@ -432,7 +462,7 @@ namespace AutoCountMachine
//
// btn_eyemMulFuncTool
//
this.btn_eyemMulFuncTool.Location = new System.Drawing.Point(831, 6);
this.btn_eyemMulFuncTool.Location = new System.Drawing.Point(831, 92);
this.btn_eyemMulFuncTool.Name = "btn_eyemMulFuncTool";
this.btn_eyemMulFuncTool.Size = new System.Drawing.Size(136, 40);
this.btn_eyemMulFuncTool.TabIndex = 1;
......@@ -449,6 +479,71 @@ namespace AutoCountMachine
this.pictureBox1.TabIndex = 0;
this.pictureBox1.TabStop = false;
//
// tabPage4
//
this.tabPage4.Controls.Add(this.btn_agvout);
this.tabPage4.Controls.Add(this.btn_agvin);
this.tabPage4.Location = new System.Drawing.Point(4, 25);
this.tabPage4.Name = "tabPage4";
this.tabPage4.Padding = new System.Windows.Forms.Padding(3);
this.tabPage4.Size = new System.Drawing.Size(1016, 530);
this.tabPage4.TabIndex = 3;
this.tabPage4.Text = "AGV";
this.tabPage4.UseVisualStyleBackColor = true;
this.tabPage4.Click += new System.EventHandler(this.tabPage4_Click);
//
// btn_agvout
//
this.btn_agvout.Location = new System.Drawing.Point(62, 138);
this.btn_agvout.Name = "btn_agvout";
this.btn_agvout.Size = new System.Drawing.Size(122, 29);
this.btn_agvout.TabIndex = 0;
this.btn_agvout.Text = "取满料串";
this.btn_agvout.UseVisualStyleBackColor = true;
this.btn_agvout.Click += new System.EventHandler(this.btn_agvout_Click);
//
// btn_agvin
//
this.btn_agvin.Location = new System.Drawing.Point(62, 79);
this.btn_agvin.Name = "btn_agvin";
this.btn_agvin.Size = new System.Drawing.Size(122, 29);
this.btn_agvin.TabIndex = 0;
this.btn_agvin.Text = "送空料串";
this.btn_agvin.UseVisualStyleBackColor = true;
this.btn_agvin.Click += new System.EventHandler(this.btn_agvin_Click);
//
// txt_p2
//
this.txt_p2.Location = new System.Drawing.Point(860, 61);
this.txt_p2.Name = "txt_p2";
this.txt_p2.Size = new System.Drawing.Size(56, 25);
this.txt_p2.TabIndex = 3;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(831, 64);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(23, 15);
this.label1.TabIndex = 4;
this.label1.Text = "p2";
//
// txt_p1
//
this.txt_p1.Location = new System.Drawing.Point(860, 30);
this.txt_p1.Name = "txt_p1";
this.txt_p1.Size = new System.Drawing.Size(56, 25);
this.txt_p1.TabIndex = 3;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(831, 33);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(23, 15);
this.label2.TabIndex = 4;
this.label2.Text = "p1";
//
// T1Control
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
......@@ -461,7 +556,9 @@ namespace AutoCountMachine
this.tabPage2.ResumeLayout(false);
this.panel1.ResumeLayout(false);
this.tabPage3.ResumeLayout(false);
this.tabPage3.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.tabPage4.ResumeLayout(false);
this.ResumeLayout(false);
}
......@@ -500,5 +597,12 @@ namespace AutoCountMachine
private System.Windows.Forms.Button btn_Empty_Linerun;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button btn_closeclamp;
private System.Windows.Forms.TabPage tabPage4;
private System.Windows.Forms.Button btn_agvout;
private System.Windows.Forms.Button btn_agvin;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox txt_p1;
private System.Windows.Forms.TextBox txt_p2;
}
}
......@@ -39,6 +39,8 @@ namespace AutoCountMachine
InitializeComponent();
RobotManage.LoadFinishEvent += RobotManage_LoadFinishEvent;
RoleManger.RoleChange += RoleManger_RoleChange;
txt_p1.Text = ConfigHelper.Config.Get("findcicyle_p1", 95).ToString();
txt_p2.Text = ConfigHelper.Config.Get("findcicyle_p2", 75).ToString();
}
private void RoleManger_RoleChange(object sender, Role e)
......@@ -87,7 +89,11 @@ namespace AutoCountMachine
private void button1_Click(object sender, EventArgs e)
{
var (bitmap, currpos, debugtxt) = RobotManage.t1Machine.GetStringCenterA();
ConfigHelper.Config.Set("findcicyle_p1", int.Parse(txt_p1.Text));
ConfigHelper.Config.Set("findcicyle_p2", int.Parse(txt_p2.Text));
ConfigHelper.Config.SaveChange();
var (bitmap, currpos, debugtxt) = RobotManage.t1Machine.GetStringCenterA();
var distance = (int)Common.distance(RobotManage.t1Machine.CenterPos, currpos);
label_eyemMulFuncTool.Text = debugtxt + $"\ndistance:{distance}\nLocation:{(distance< RobotManage.t1Machine.Config.String_Offset_Range_Px?"OK":"NG")}";
......@@ -127,5 +133,25 @@ namespace AutoCountMachine
{
RobotManage.electricGripper.ClosePort();
}
private void tabPage4_Click(object sender, EventArgs e)
{
}
private void btn_agvin_Click(object sender, EventArgs e)
{
RobotManage.wistonAgvClient.NeedEnter();
}
private void btn_agvout_Click(object sender, EventArgs e)
{
RobotManage.wistonAgvClient.NeedLeave();
}
private void tabPage3_Click(object sender, EventArgs e)
{
}
}
}
......@@ -43,7 +43,7 @@ namespace AutoCountMachine
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(144, 6);
this.label1.Location = new System.Drawing.Point(16, 6);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(41, 12);
this.label1.TabIndex = 1;
......@@ -52,7 +52,7 @@ namespace AutoCountMachine
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(77, 6);
this.label2.Location = new System.Drawing.Point(138, 6);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(47, 12);
this.label2.TabIndex = 1;
......@@ -61,7 +61,7 @@ namespace AutoCountMachine
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(6, 6);
this.label3.Location = new System.Drawing.Point(71, 6);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(59, 12);
this.label3.TabIndex = 1;
......@@ -69,7 +69,7 @@ namespace AutoCountMachine
//
// btn_NGClear
//
this.btn_NGClear.Location = new System.Drawing.Point(143, 121);
this.btn_NGClear.Location = new System.Drawing.Point(16, 121);
this.btn_NGClear.Name = "btn_NGClear";
this.btn_NGClear.Size = new System.Drawing.Size(45, 40);
this.btn_NGClear.TabIndex = 2;
......@@ -79,7 +79,7 @@ namespace AutoCountMachine
//
// btn_MSDClear
//
this.btn_MSDClear.Location = new System.Drawing.Point(77, 121);
this.btn_MSDClear.Location = new System.Drawing.Point(141, 121);
this.btn_MSDClear.Name = "btn_MSDClear";
this.btn_MSDClear.Size = new System.Drawing.Size(45, 40);
this.btn_MSDClear.TabIndex = 2;
......@@ -89,7 +89,7 @@ namespace AutoCountMachine
//
// btn_PaperClear
//
this.btn_PaperClear.Location = new System.Drawing.Point(13, 121);
this.btn_PaperClear.Location = new System.Drawing.Point(78, 121);
this.btn_PaperClear.Name = "btn_PaperClear";
this.btn_PaperClear.Size = new System.Drawing.Size(45, 40);
this.btn_PaperClear.TabIndex = 2;
......@@ -99,14 +99,14 @@ namespace AutoCountMachine
//
// PaperCountBar
//
this.PaperCountBar.Location = new System.Drawing.Point(13, 21);
this.PaperCountBar.Location = new System.Drawing.Point(78, 21);
this.PaperCountBar.Name = "PaperCountBar";
this.PaperCountBar.Size = new System.Drawing.Size(45, 94);
this.PaperCountBar.TabIndex = 0;
//
// MsdCountBar
//
this.MsdCountBar.Location = new System.Drawing.Point(77, 21);
this.MsdCountBar.Location = new System.Drawing.Point(141, 21);
this.MsdCountBar.Name = "MsdCountBar";
this.MsdCountBar.Size = new System.Drawing.Size(45, 94);
this.MsdCountBar.TabIndex = 0;
......@@ -114,7 +114,7 @@ namespace AutoCountMachine
// NgCountBar
//
this.NgCountBar.ForeColor = System.Drawing.Color.MediumSeaGreen;
this.NgCountBar.Location = new System.Drawing.Point(143, 21);
this.NgCountBar.Location = new System.Drawing.Point(16, 21);
this.NgCountBar.MarqueeAnimationSpeed = 0;
this.NgCountBar.Name = "NgCountBar";
this.NgCountBar.Size = new System.Drawing.Size(45, 94);
......@@ -134,7 +134,7 @@ namespace AutoCountMachine
this.Controls.Add(this.MsdCountBar);
this.Controls.Add(this.NgCountBar);
this.Name = "BoxResetControl";
this.Size = new System.Drawing.Size(299, 316);
this.Size = new System.Drawing.Size(324, 316);
this.ResumeLayout(false);
this.PerformLayout();
......
......@@ -33,6 +33,12 @@ namespace AutoCountMachine
{
InitializeComponent();
this.Tag = "not";
crc.LanguageChangeEvent += Crc_LanguageChangeEvent;
}
private void Crc_LanguageChangeEvent(object sender, EventArgs e)
{
LoadPosList();
}
void LoadPosList()
......
......@@ -15,6 +15,7 @@ using System.Windows.Forms;
namespace AutoCountMachine
{
using crc = OnlineStore.CodeResourceControl;
public partial class XrayControl : UserControl
{
readonly System.Windows.Forms.Timer t1 = new System.Windows.Forms.Timer();
......@@ -96,7 +97,7 @@ namespace AutoCountMachine
LogUtil.info($"手动点料: {e}");
this.Invoke((EventHandler<string>)delegate
{
label_countstate.Text = "当前: "+e;
label_countstate.Text = crc.GetString("xmanual_current_step","当前: {0}",e);
},this,e);
}
......@@ -152,7 +153,7 @@ namespace AutoCountMachine
RobotManage.XRay.Start();
}
else {
MessageBox.Show("X光机防护门未关闭,不可开启X光");
MessageBox.Show(crc.GetString("xmanual_door_not_closed","X光机防护门未关闭,不可开启X光"));
}
}
......@@ -181,18 +182,18 @@ namespace AutoCountMachine
private void btn_ManualCount_Click(object sender, EventArgs e)
{
if (RobotManage.isRunning) {
countstate?.Invoke(this, "机器正在运行中,不能使用手动点料");
countstate?.Invoke(this, crc.GetString("xmanual_machine_is_running","机器正在运行中,不能使用手动点料"));
}
else if (CodeManager.HasRightCode(textBox_scancode.Text))
{
RobotManage.xrayMachine.MoveInfo.ReelParam = new ReelParam();
RobotManage.xrayMachine.MoveInfo.ReelParam.WareCode = textBox_scancode.Text;
countstate?.Invoke(this, $"开始点料: {textBox_scancode.Text}");
countstate?.Invoke(this, crc.GetString("xmanual_being_countting",$"开始点料:{0} ", textBox_scancode.Text));
Thread td = new Thread(new ThreadStart(Count));
td.Start();
}
else {
countstate?.Invoke(this, "扫描的二维码不符合规则,请重新扫描");
countstate?.Invoke(this, crc.GetString("xmanual_barcode_uncorrect", "扫描的二维码不符合规则,请重新扫描"));
}
}
/// <summary>
......@@ -206,7 +207,7 @@ namespace AutoCountMachine
return;
ManualCountRunning = true;
countstate?.Invoke(this, "关闭防护门");
countstate?.Invoke(this, crc.GetString("xmanual_close_door","关闭防护门"));
RobotManage.xrayMachine.CylinderMove(null, IO_XRay_Type.Entry_Close, IO_XRay_Type.Entry_Open, IO_VALUE.LOW);
RobotManage.xrayMachine.CylinderMove(null, IO_XRay_Type.Exit_Close, IO_XRay_Type.Exit_Open, IO_VALUE.LOW);
int wait = 0;
......@@ -217,9 +218,9 @@ namespace AutoCountMachine
}
wait++;
Thread.Sleep(500);
countstate?.Invoke(this, "等待关闭防护门");
countstate?.Invoke(this, crc.GetString("xmanual_wait_close_door", "等待关闭防护门"));
if (wait > 10) {
countstate?.Invoke(this, "等待关闭防护门超时");
countstate?.Invoke(this, crc.GetString("xmanual_wait_close_door_timeout", "等待关闭防护门超时"));
ManualCountRunning = false;
return;
}
......@@ -227,20 +228,20 @@ namespace AutoCountMachine
try
{
LastCountWareCode = RobotManage.xrayMachine.MoveInfo.ReelParam.WareCode;
countstate?.Invoke(this, "打开X光");
countstate?.Invoke(this, crc.GetString("xmanual_open_xray", "打开X光"));
RobotManage.xrayMachine.IOMove(IO_XRay_Type.Xray_Lock, IO_VALUE.HIGH);
Thread.Sleep(1000);
RobotManage.XRay.Start();
Thread.Sleep(1000);
countstate?.Invoke(this, "获取图像");
countstate?.Invoke(this, crc.GetString("xmanual_get_image", "获取图像"));
if (RobotManage.xrayMachine.GrabImage())
{
Task.Run(() =>
{
countstate?.Invoke(this, "开始点料");
countstate?.Invoke(this, crc.GetString("xmanual_being_countting", "开始点料"));
Process p = new Process();
p.StartInfo = new ProcessStartInfo("AlgoMatch\\AlgoMatch.exe");
p.StartInfo.Arguments =$"singlecount \"{RobotManage.xrayMachine.xrayImagePath}\"";
p.StartInfo.Arguments =$"singlecount \"{RobotManage.xrayMachine.xrayImagePath}\" {crc.CurrLanguage}";
p.StartInfo.WorkingDirectory = Application.StartupPath;
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true;
......@@ -255,25 +256,25 @@ namespace AutoCountMachine
}
else
{
countstate?.Invoke(this, "获取图像失败!");
countstate?.Invoke(this, crc.GetString("xmanual_get_image_fail", "获取图像失败!"));
}
}
catch (Exception e){
countstate?.Invoke(this, "出错:"+e.ToString());
countstate?.Invoke(this, crc.GetString("xmanual_error", "出错:{0}" ,e.ToString()));
}
finally
{
RobotManage.XRay.Stop();
Thread.Sleep(300);
RobotManage.xrayMachine.IOMove(IO_XRay_Type.Xray_Lock, IO_VALUE.LOW);
countstate?.Invoke(this, "关闭X光");
countstate?.Invoke(this, crc.GetString("xmanual_close_xray", "关闭X光"));
Thread.Sleep(100);
}
Thread.Sleep(100);
RobotManage.xrayMachine.CylinderMove(null, IO_XRay_Type.Entry_Close, IO_XRay_Type.Entry_Open, IO_VALUE.HIGH);
RobotManage.xrayMachine.CylinderMove(null, IO_XRay_Type.Exit_Close, IO_XRay_Type.Exit_Open, IO_VALUE.HIGH);
countstate?.Invoke(this, "防护门已打开");
countstate?.Invoke(this, crc.GetString("xmanual_door_opened", "防护门已打开"));
ManualCountRunning = false;
}
......@@ -290,14 +291,14 @@ namespace AutoCountMachine
var reelLocation = ServerConn.DetermineReelStorageLocation(LastCountWareCode);
if (reelLocation == null)
{
countstate?.Invoke(this, "打印标签失败");
countstate?.Invoke(this, crc.GetString("xmanual_print_label_fail","打印标签失败"));
}
else {
countstate?.Invoke(this, reelLocation.message);
}
}
else {
countstate?.Invoke(this, "上传点料结果失败");
countstate?.Invoke(this, crc.GetString("xmanual_upload_fail", "上传点料结果失败"));
}
}
......
此文件类型无法预览
此文件类型无法预览
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!