Commit 233ceb77 刘韬

1

1 个父辈 115ebfb3
此文件类型无法预览
...@@ -204,7 +204,7 @@ namespace DeviceLibrary ...@@ -204,7 +204,7 @@ namespace DeviceLibrary
bool ok = true; bool ok = true;
isInSuddenDown = IOValue(IO_Type.SuddenStop_BTN).Equals(IO_VALUE.LOW); isInSuddenDown = IOValue(IO_Type.SuddenStop_BTN).Equals(IO_VALUE.LOW);
if (IOValue(IO_Type.AutoRun_Single).Equals(IO_VALUE.LOW)) { if (IOValue(IO_Type.AutoRun_Single).Equals(IO_VALUE.LOW)) {
Msg.add("自动运行开关未开", MsgLevel.warning); Msg.add(crc.GetString("Res0001","自动运行开关未开"), MsgLevel.warning);
DeviceSuddenStop(); DeviceSuddenStop();
lastSafeCheckStatus = false; lastSafeCheckStatus = false;
ok = false; ok = false;
......
using OnlineStore.Common; using OnlineStore;
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary; using OnlineStore.LoadCSVLibrary;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
...@@ -133,23 +134,23 @@ namespace DeviceLibrary ...@@ -133,23 +134,23 @@ namespace DeviceLibrary
public static Dictionary<TrayTypeE, string> TrayTypeDesc = new Dictionary<TrayTypeE, string>(); public static Dictionary<TrayTypeE, string> TrayTypeDesc = new Dictionary<TrayTypeE, string>();
public static Dictionary<int, string> AddrDesc = new Dictionary<int, string>(); public static Dictionary<int, string> AddrDesc = new Dictionary<int, string>();
static TrayManager() { static TrayManager() {
LoadTypeDesc.Add(LoadTypeE.None, "空"); LoadTypeDesc.Add(LoadTypeE.None, crc.GetString("Res0002","空"));
LoadTypeDesc.Add(LoadTypeE.MTP2, "流水线治具托盘"); LoadTypeDesc.Add(LoadTypeE.MTP2, crc.GetString("Res0003","流水线治具托盘"));
LoadTypeDesc.Add(LoadTypeE.MTP1, "流水线料盘托盘"); LoadTypeDesc.Add(LoadTypeE.MTP1, crc.GetString("Res0004","流水线料盘托盘"));
LoadTypeDesc.Add(LoadTypeE.S007, "料串"); LoadTypeDesc.Add(LoadTypeE.S007, crc.GetString("Res0005","料串"));
LoadTypeDesc.Add(LoadTypeE.M03, "Tray料格"); LoadTypeDesc.Add(LoadTypeE.M03, crc.GetString("Res0006","Tray料格"));
LoadTypeDesc.Add(LoadTypeE.M02, "PCB料格"); LoadTypeDesc.Add(LoadTypeE.M02, crc.GetString("Res0007","PCB料格"));
LoadTypeDesc.Add(LoadTypeE.M01, "PizzaBOX料格"); LoadTypeDesc.Add(LoadTypeE.M01, crc.GetString("Res0008","PizzaBOX料格"));
LoadTypeDesc.Add(LoadTypeE.M04, "ShoeBOX料格"); LoadTypeDesc.Add(LoadTypeE.M04, crc.GetString("Res0009","ShoeBOX料格"));
TrayTypeDesc.Add(TrayTypeE.C01, "PCB治具"); TrayTypeDesc.Add(TrayTypeE.C01, crc.GetString("Res0010","PCB治具"));
TrayTypeDesc.Add(TrayTypeE.C02, "Pizza治具"); TrayTypeDesc.Add(TrayTypeE.C02, crc.GetString("Res0011","Pizza治具"));
TrayTypeDesc.Add(TrayTypeE.C03, "Tray治具"); TrayTypeDesc.Add(TrayTypeE.C03, crc.GetString("Res0012","Tray治具"));
TrayTypeDesc.Add(TrayTypeE.C04, "ShoeBOX治具"); TrayTypeDesc.Add(TrayTypeE.C04, crc.GetString("Res0013","ShoeBOX治具"));
} }
public static void Init(Dictionary<string, DeviceGroup> deviceGroup) { public static void Init(Dictionary<string, DeviceGroup> deviceGroup) {
foreach (var dg in deviceGroup) { foreach (var dg in deviceGroup) {
AddrDesc.Add(-1, "未知"); AddrDesc.Add(-1, crc.GetString("Res0014","未知"));
if (dg.Value.addr_2 >= 0) if (dg.Value.addr_2 >= 0)
{ {
AddrDesc.Add(dg.Value.addr_1, dg.Value.GroupName + "-1"); AddrDesc.Add(dg.Value.addr_1, dg.Value.GroupName + "-1");
...@@ -161,4 +162,4 @@ namespace DeviceLibrary ...@@ -161,4 +162,4 @@ namespace DeviceLibrary
} }
} }
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -206,7 +206,7 @@ namespace DeviceLibrary ...@@ -206,7 +206,7 @@ namespace DeviceLibrary
case MoveStep.SideMove_01: case MoveStep.SideMove_01:
Minfo.NextMoveStep(MoveStep.SideMove_01); Minfo.NextMoveStep(MoveStep.SideMove_01);
if (lsb.MoveStep >= MoveStep.SideMove_10) { if (lsb.MoveStep >= MoveStep.SideMove_10) {
Msg.add(sideb+"侧穿越中", MsgLevel.info); Msg.add(sideb+crc.GetString("Res0015","侧穿越中"), MsgLevel.info);
} }
else if (IOValue(Ls_A_Front_Check).Equals(IO_VALUE.HIGH)) else if (IOValue(Ls_A_Front_Check).Equals(IO_VALUE.HIGH))
{ {
...@@ -247,7 +247,7 @@ namespace DeviceLibrary ...@@ -247,7 +247,7 @@ namespace DeviceLibrary
{ {
Minfo.CanWhileCount--; Minfo.CanWhileCount--;
Minfo.log($"RFid读取失败,重试第{3- Minfo.CanWhileCount}次"); Minfo.log($"RFid读取失败,重试第{3- Minfo.CanWhileCount}次");
Minfo.WaitList.Add(WaitResultInfo.WaitMsg("RFid读取失败",MsgLevel.warning)); Minfo.WaitList.Add(WaitResultInfo.WaitMsg(crc.GetString("Res0016","RFid读取失败"),MsgLevel.warning));
} }
else { else {
Minfo.log("RFid读取失败,直接通过"); Minfo.log("RFid读取失败,直接通过");
...@@ -258,6 +258,7 @@ namespace DeviceLibrary ...@@ -258,6 +258,7 @@ namespace DeviceLibrary
case MoveStep.SideMove_04: case MoveStep.SideMove_04:
Minfo.NextMoveStep(MoveStep.SideMove_05); Minfo.NextMoveStep(MoveStep.SideMove_05);
IOMove(Ls_A_Stop, IO_VALUE.HIGH, StopDelayMS); IOMove(Ls_A_Stop, IO_VALUE.HIGH, StopDelayMS);
Minfo.log($"{Ls_A_Stop}阻挡放行");
break; break;
case MoveStep.SideMove_05: case MoveStep.SideMove_05:
Minfo.NextMoveStep(MoveStep.SideMove_06); Minfo.NextMoveStep(MoveStep.SideMove_06);
...@@ -266,6 +267,7 @@ namespace DeviceLibrary ...@@ -266,6 +267,7 @@ namespace DeviceLibrary
case MoveStep.SideMove_06: case MoveStep.SideMove_06:
Minfo.NextMoveStep(MoveStep.SideMove_01); Minfo.NextMoveStep(MoveStep.SideMove_01);
Minfo.WaitList.Add(WaitResultInfo.WaitTime(500)); Minfo.WaitList.Add(WaitResultInfo.WaitTime(500));
Minfo.log($"放行结束");
break; break;
///横移流程 ///横移流程
case MoveStep.SideMove_10: case MoveStep.SideMove_10:
...@@ -288,11 +290,13 @@ namespace DeviceLibrary ...@@ -288,11 +290,13 @@ namespace DeviceLibrary
Location_A.ToHigh(Minfo); Location_A.ToHigh(Minfo);
Location_B.ToHigh(Minfo); Location_B.ToHigh(Minfo);
IOMove(Ls_B_BufStop_Fwd, IO_VALUE.HIGH, StopBufDelayMS); IOMove(Ls_B_BufStop_Fwd, IO_VALUE.HIGH, StopBufDelayMS);
Minfo.log($"2侧顶升升起");
break; break;
case MoveStep.SideMove_12: case MoveStep.SideMove_12:
Minfo.NextMoveStep(MoveStep.SideMove_06); Minfo.NextMoveStep(MoveStep.SideMove_06);
Line.LineRun("n", false, 999); Line.LineRun("n", false, 999);
Minfo.WaitList.Add(WaitResultInfo.WaitIO(Ls_B_Tray_Check, IO_VALUE.HIGH)); Minfo.WaitList.Add(WaitResultInfo.WaitIO(Ls_B_Tray_Check, IO_VALUE.HIGH));
Minfo.log($"横移线体运行");
break; break;
case MoveStep.SideMove_13: case MoveStep.SideMove_13:
Minfo.NextMoveStep(MoveStep.SideMove_07); Minfo.NextMoveStep(MoveStep.SideMove_07);
...@@ -303,6 +307,7 @@ namespace DeviceLibrary ...@@ -303,6 +307,7 @@ namespace DeviceLibrary
Line.LineStop("n"); Line.LineStop("n");
Location_A.ToLow(Minfo); Location_A.ToLow(Minfo);
Location_B.ToLow(Minfo); Location_B.ToLow(Minfo);
Minfo.log($"顶升下降横移线体停止");
break; break;
case MoveStep.SideMove_15: case MoveStep.SideMove_15:
Minfo.NextMoveStep(MoveStep.SideMove_09); Minfo.NextMoveStep(MoveStep.SideMove_09);
...@@ -317,6 +322,7 @@ namespace DeviceLibrary ...@@ -317,6 +322,7 @@ namespace DeviceLibrary
Minfo.WaitList.Add(WaitResultInfo.WaitTime(500)); Minfo.WaitList.Add(WaitResultInfo.WaitTime(500));
break; break;
case MoveStep.SideMove_18: case MoveStep.SideMove_18:
Minfo.log($"通过完成");
Minfo.NewMove(MoveStep.SideMove_01); Minfo.NewMove(MoveStep.SideMove_01);
break; break;
} }
...@@ -348,8 +354,8 @@ namespace DeviceLibrary ...@@ -348,8 +354,8 @@ namespace DeviceLibrary
LSAMoveInfo.EndMove(); LSAMoveInfo.EndMove();
} }
else if (LS_Type == LS_TypeE.NoRfid) else if (LS_Type == LS_TypeE.NoRfid)
{ {
LSAMoveInfo.log($"无Rfid横移");
} }
else if (trayAstate) else if (trayAstate)
{ {
...@@ -370,22 +376,25 @@ namespace DeviceLibrary ...@@ -370,22 +376,25 @@ namespace DeviceLibrary
Location_A.ToHigh(LSAMoveInfo); Location_A.ToHigh(LSAMoveInfo);
Location_B.ToHigh(LSAMoveInfo); Location_B.ToHigh(LSAMoveInfo);
IOMove(IO_Type.Ls_B_BufStop_Fwd, IO_VALUE.HIGH,StopBufDelayMS); IOMove(IO_Type.Ls_B_BufStop_Fwd, IO_VALUE.HIGH,StopBufDelayMS);
LSAMoveInfo.log($"顶升顶起");
break; break;
case MoveStep.H03_HomeReset: case MoveStep.H03_HomeReset:
LSAMoveInfo.NextMoveStep(MoveStep.H04_HomeReset); LSAMoveInfo.NextMoveStep(MoveStep.H04_HomeReset);
Line.LineRun("n", false, 10); Line.LineRun("n", false, 10);
LSAMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000)); LSAMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
LSAMoveInfo.log($"横移点击运行");
break; break;
case MoveStep.H04_HomeReset: case MoveStep.H04_HomeReset:
LSAMoveInfo.NextMoveStep(MoveStep.H05_HomeReset); LSAMoveInfo.NextMoveStep(MoveStep.H05_HomeReset);
Location_A.ToLow(LSAMoveInfo); Location_A.ToLow(LSAMoveInfo);
Location_B.ToLow(LSAMoveInfo); Location_B.ToLow(LSAMoveInfo);
LSAMoveInfo.log($"顶升下降");
break; break;
case MoveStep.H05_HomeReset: case MoveStep.H05_HomeReset:
LSAMoveInfo.NextMoveStep(MoveStep.H06_HomeReset); LSAMoveInfo.NextMoveStep(MoveStep.H06_HomeReset);
IOMove(IO_Type.Ls_B_Stop, IO_VALUE.HIGH, StopDelayMS); IOMove(IO_Type.Ls_B_Stop, IO_VALUE.HIGH, StopDelayMS);
LSAMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000)); LSAMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
LSAMoveInfo.log($"缓冲回退");
break; break;
case MoveStep.H06_HomeReset: case MoveStep.H06_HomeReset:
LSAMoveInfo.log("回原完成"); LSAMoveInfo.log("回原完成");
......
...@@ -100,6 +100,7 @@ namespace DeviceLibrary ...@@ -100,6 +100,7 @@ namespace DeviceLibrary
IOMove(IO_Type.AMH_Front_Stop, IO_VALUE.HIGH, StopDelayMS); IOMove(IO_Type.AMH_Front_Stop, IO_VALUE.HIGH, StopDelayMS);
MoveInfo.CanWhileCount = 3; MoveInfo.CanWhileCount = 3;
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.MI_In_Check, IO_VALUE.HIGH)); MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.MI_In_Check, IO_VALUE.HIGH));
MoveInfo.log($"前阻挡放行");
break; break;
case MoveStep.TransplantMove_02: case MoveStep.TransplantMove_02:
if (RFID_1.ReadByte(0x20, 16, out byte[] data)) if (RFID_1.ReadByte(0x20, 16, out byte[] data))
...@@ -118,7 +119,7 @@ namespace DeviceLibrary ...@@ -118,7 +119,7 @@ namespace DeviceLibrary
{ {
MoveInfo.CanWhileCount--; MoveInfo.CanWhileCount--;
MoveInfo.log($"RFid读取失败,重试第{3 - MoveInfo.CanWhileCount}次"); MoveInfo.log($"RFid读取失败,重试第{3 - MoveInfo.CanWhileCount}次");
MoveInfo.WaitList.Add(WaitResultInfo.WaitMsg("RFid读取失败", MsgLevel.warning)); MoveInfo.WaitList.Add(WaitResultInfo.WaitMsg(crc.GetString("Res0016","RFid读取失败"), MsgLevel.warning));
} }
else else
{ {
...@@ -130,6 +131,7 @@ namespace DeviceLibrary ...@@ -130,6 +131,7 @@ namespace DeviceLibrary
MoveInfo.NextMoveStep(MoveStep.TransplantMove_04); MoveInfo.NextMoveStep(MoveStep.TransplantMove_04);
IOMove(IO_Type.AMH_Tray_Stop, IO_VALUE.HIGH, StopDelayMS); IOMove(IO_Type.AMH_Tray_Stop, IO_VALUE.HIGH, StopDelayMS);
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.MI_In_Check, IO_VALUE.LOW)); MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.MI_In_Check, IO_VALUE.LOW));
MoveInfo.log($"后阻挡放行");
break; break;
case MoveStep.TransplantMove_04: case MoveStep.TransplantMove_04:
MoveInfo.NextMoveStep(MoveStep.Wait); MoveInfo.NextMoveStep(MoveStep.Wait);
...@@ -145,8 +147,10 @@ namespace DeviceLibrary ...@@ -145,8 +147,10 @@ namespace DeviceLibrary
break; break;
case MoveStep.TransplantMove_11: case MoveStep.TransplantMove_11:
MoveInfo.NextMoveStep(MoveStep.TransplantMove_12); MoveInfo.NextMoveStep(MoveStep.TransplantMove_12);
axis.AbsMove(MoveInfo, Config.AMH_TS_P2, Config.AMH_TS_P1_speed); var AMH_TS_P2 = Config.AMH_TS_P2 - (MoveInfo.MoveParam.PlateH - 8) * Config.AMH_TS_PoToMM;
axis.AbsMove(MoveInfo, AMH_TS_P2, Config.AMH_TS_P1_speed);
IOMove(IO_Type.AMH_Sucker, IO_VALUE.HIGH); IOMove(IO_Type.AMH_Sucker, IO_VALUE.HIGH);
MoveInfo.log($"PlateH:{MoveInfo.MoveParam.PlateH},AMH_TS_P2:{AMH_TS_P2}");
break; break;
case MoveStep.TransplantMove_12: case MoveStep.TransplantMove_12:
MoveInfo.NextMoveStep(MoveStep.TransplantMove_13); MoveInfo.NextMoveStep(MoveStep.TransplantMove_13);
...@@ -160,6 +164,7 @@ namespace DeviceLibrary ...@@ -160,6 +164,7 @@ namespace DeviceLibrary
MoveInfo.NextMoveStep(MoveStep.TransplantMove_15); MoveInfo.NextMoveStep(MoveStep.TransplantMove_15);
MoveInfo2.NewMove(MoveStep.TransplantMove_01); MoveInfo2.NewMove(MoveStep.TransplantMove_01);
Location.ToLow(MoveInfo); Location.ToLow(MoveInfo);
MoveInfo.log("料盘已取走,放行托盘, 子流程开始移栽入库");
break; break;
case MoveStep.TransplantMove_15: case MoveStep.TransplantMove_15:
MoveInfo.NextMoveStep(MoveStep.TransplantMove_16); MoveInfo.NextMoveStep(MoveStep.TransplantMove_16);
...@@ -167,16 +172,13 @@ namespace DeviceLibrary ...@@ -167,16 +172,13 @@ namespace DeviceLibrary
break; break;
case MoveStep.TransplantMove_16: case MoveStep.TransplantMove_16:
MoveInfo.NextMoveStep(MoveStep.TransplantMove_17); MoveInfo.NextMoveStep(MoveStep.TransplantMove_17);
IOMove(IO_Type.AMH_Sucker, IO_VALUE.LOW); MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
break; break;
case MoveStep.TransplantMove_17: case MoveStep.TransplantMove_17:
MoveInfo.NextMoveStep(MoveStep.TransplantMove_18);
axis.AbsMove(MoveInfo, Config.AMH_TS_P1, Config.AMH_TS_P1_speed);
break;
case MoveStep.TransplantMove_18:
MoveInfo.NewMove(MoveStep.Wait); MoveInfo.NewMove(MoveStep.Wait);
MoveInfo.log("从线体到料仓移栽结束"); MoveInfo.log("托盘放行结束");
break; break;
case MoveStep.TransplantMove_30: case MoveStep.TransplantMove_30:
MoveInfo.NextMoveStep(MoveStep.Wait); MoveInfo.NextMoveStep(MoveStep.Wait);
Location.ToLow(MoveInfo); Location.ToLow(MoveInfo);
...@@ -196,10 +198,13 @@ namespace DeviceLibrary ...@@ -196,10 +198,13 @@ namespace DeviceLibrary
case MoveStep.TransplantMove_01: case MoveStep.TransplantMove_01:
MoveInfo2.NextMoveStep(MoveStep.TransplantMove_02); MoveInfo2.NextMoveStep(MoveStep.TransplantMove_02);
Transplant.ToHigh(MoveInfo); Transplant.ToHigh(MoveInfo);
MoveInfo2.log("移栽气缸的前进");
break; break;
case MoveStep.TransplantMove_02: case MoveStep.TransplantMove_02:
MoveInfo2.NextMoveStep(MoveStep.TransplantMove_03); MoveInfo2.NextMoveStep(MoveStep.TransplantMove_03);
axis.AbsMove(MoveInfo2, Config.AMH_TS_P2, Config.AMH_TS_P2_speed); var AMH_TS_P2 = Config.AMH_TS_P2 - (MoveInfo.MoveParam.PlateH - 8) * Config.AMH_TS_PoToMM;
axis.AbsMove(MoveInfo2, AMH_TS_P2, Config.AMH_TS_P2_speed);
MoveInfo2.log($"PlateH:{MoveInfo.MoveParam.PlateH},AMH_TS_P2:{AMH_TS_P2}");
break; break;
case MoveStep.TransplantMove_03: case MoveStep.TransplantMove_03:
MoveInfo2.NextMoveStep(MoveStep.TransplantMove_04); MoveInfo2.NextMoveStep(MoveStep.TransplantMove_04);
......
...@@ -35,7 +35,7 @@ namespace DeviceLibrary ...@@ -35,7 +35,7 @@ namespace DeviceLibrary
DeviceGroup = device; DeviceGroup = device;
GroupName = DeviceGroup.GroupName; GroupName = DeviceGroup.GroupName;
Msg = new MsgService(GroupName); Msg = new MsgService(GroupName);
MoveInfo = new MoveInfo(device.GroupName); MoveInfo = new MoveInfo(GroupName);
if (!string.IsNullOrEmpty(DeviceGroup.RFID_1)) if (!string.IsNullOrEmpty(DeviceGroup.RFID_1))
{ {
RFID_1 = new PuYueRFID_C2S(DeviceGroup.RFID_1); RFID_1 = new PuYueRFID_C2S(DeviceGroup.RFID_1);
...@@ -115,7 +115,7 @@ namespace DeviceLibrary ...@@ -115,7 +115,7 @@ namespace DeviceLibrary
{ {
MoveInfo.CanWhileCount--; MoveInfo.CanWhileCount--;
MoveInfo.log($"RFid读取失败,重试第{3 - MoveInfo.CanWhileCount}次"); MoveInfo.log($"RFid读取失败,重试第{3 - MoveInfo.CanWhileCount}次");
MoveInfo.WaitList.Add(WaitResultInfo.WaitMsg("RFid读取失败", MsgLevel.warning)); MoveInfo.WaitList.Add(WaitResultInfo.WaitMsg(crc.GetString("Res0016","RFid读取失败"), MsgLevel.warning));
} }
else else
{ {
......
...@@ -187,7 +187,7 @@ namespace DeviceLibrary ...@@ -187,7 +187,7 @@ namespace DeviceLibrary
this.checkBox_fixtureheight.Name = "checkBox_fixtureheight"; this.checkBox_fixtureheight.Name = "checkBox_fixtureheight";
this.checkBox_fixtureheight.Size = new System.Drawing.Size(156, 16); this.checkBox_fixtureheight.Size = new System.Drawing.Size(156, 16);
this.checkBox_fixtureheight.TabIndex = 5; this.checkBox_fixtureheight.TabIndex = 5;
this.checkBox_fixtureheight.Text = "使用治具物理高度(毫米)"; this.checkBox_fixtureheight.Text = "使用治具实测厚度(毫米)";
this.checkBox_fixtureheight.UseVisualStyleBackColor = true; this.checkBox_fixtureheight.UseVisualStyleBackColor = true;
// //
// num_actualheight // num_actualheight
......
...@@ -98,7 +98,7 @@ namespace DeviceLibrary ...@@ -98,7 +98,7 @@ namespace DeviceLibrary
public override string ToString() public override string ToString()
{ {
return $"[{StartCode}]={Width}x{Height}"+ (UseActualHeight?$", "+crc.GetString("Res0195","物理厚度")+$":{ActualHeight}":"") + (AbandonCode? ", "+crc.GetString("Res0196","自动弃用") : ""); return $"[{StartCode}]={Width}x{Height}"+ (UseActualHeight?$", "+crc.GetString("Res0195","实测厚度")+$":{ActualHeight}":"") + (AbandonCode? ", "+crc.GetString("Res0196","自动弃用") : "");
} }
public static bool GetFixtureHeight(int poswidth,int posheight, out int FixtureHeight) { public static bool GetFixtureHeight(int poswidth,int posheight, out int FixtureHeight) {
FixtureHeight = 0; FixtureHeight = 0;
......
 
namespace TheMachine namespace TheMachine
{ {
partial class CycleHYControl<T1> partial class DeviceControl<T1>
{ {
/// <summary> /// <summary>
/// 必需的设计器变量。 /// 必需的设计器变量。
...@@ -64,9 +64,9 @@ namespace TheMachine ...@@ -64,9 +64,9 @@ namespace TheMachine
// groupBox1 // groupBox1
// //
this.groupBox1.Controls.Add(this.stateView); this.groupBox1.Controls.Add(this.stateView);
this.groupBox1.Location = new System.Drawing.Point(45, 57); this.groupBox1.Location = new System.Drawing.Point(6, 6);
this.groupBox1.Name = "groupBox1"; this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(598, 244); this.groupBox1.Size = new System.Drawing.Size(561, 316);
this.groupBox1.TabIndex = 2; this.groupBox1.TabIndex = 2;
this.groupBox1.TabStop = false; this.groupBox1.TabStop = false;
this.groupBox1.Text = "运行状态"; this.groupBox1.Text = "运行状态";
...@@ -80,20 +80,21 @@ namespace TheMachine ...@@ -80,20 +80,21 @@ namespace TheMachine
this.stateView.Location = new System.Drawing.Point(3, 22); this.stateView.Location = new System.Drawing.Point(3, 22);
this.stateView.MultiSelect = false; this.stateView.MultiSelect = false;
this.stateView.Name = "stateView"; this.stateView.Name = "stateView";
this.stateView.Size = new System.Drawing.Size(592, 219); this.stateView.Size = new System.Drawing.Size(555, 291);
this.stateView.TabIndex = 0; this.stateView.TabIndex = 0;
this.stateView.UseCompatibleStateImageBehavior = false; this.stateView.UseCompatibleStateImageBehavior = false;
// //
// timer1 // timer1
// //
this.timer1.Interval = 1000;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick); this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
// //
// CycleHYControl // DeviceControl
// //
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.Controls.Add(this.tabControl1); this.Controls.Add(this.tabControl1);
this.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Name = "CycleHYControl"; this.Name = "DeviceControl";
this.Size = new System.Drawing.Size(602, 519); this.Size = new System.Drawing.Size(602, 519);
this.tabControl1.ResumeLayout(false); this.tabControl1.ResumeLayout(false);
this.tabPage2.ResumeLayout(false); this.tabPage2.ResumeLayout(false);
......
...@@ -12,9 +12,9 @@ using System.Windows.Forms; ...@@ -12,9 +12,9 @@ using System.Windows.Forms;
namespace TheMachine namespace TheMachine
{ {
public partial class CycleHYControl<T1> : UserControl where T1: UserControl, Idevicetab,new() public partial class DeviceControl<T1> : UserControl where T1: UserControl, Idevicetab,new()
{ {
public CycleHYControl() public DeviceControl()
{ {
InitializeComponent(); InitializeComponent();
...@@ -28,6 +28,7 @@ namespace TheMachine ...@@ -28,6 +28,7 @@ namespace TheMachine
} }
List<T1> hYControls = new List<T1>(); List<T1> hYControls = new List<T1>();
List<MoveInfo> MoveInfos = new List<MoveInfo>();
public string DeviceName = ""; public string DeviceName = "";
public void Init(string devicegroup) { public void Init(string devicegroup) {
//tabControl1.TabPages.Clear(); //tabControl1.TabPages.Clear();
...@@ -38,6 +39,7 @@ namespace TheMachine ...@@ -38,6 +39,7 @@ namespace TheMachine
if (string.IsNullOrEmpty(DeviceName)) if (string.IsNullOrEmpty(DeviceName))
DeviceName = dg.Name; DeviceName = dg.Name;
MoveInfos.AddRange(MoveInfo.List.FindAll(m => m.Name.StartsWith(dg.GroupName)));
var hy = new T1(); var hy = new T1();
hy.Init(dg.GroupName); hy.Init(dg.GroupName);
hYControls.Add(hy); hYControls.Add(hy);
...@@ -65,6 +67,7 @@ namespace TheMachine ...@@ -65,6 +67,7 @@ namespace TheMachine
stateView.Columns.Add(c3); stateView.Columns.Add(c3);
stateView.Columns.Add(c4); stateView.Columns.Add(c4);
#endregion #endregion
timer1.Start();
crc.LanguageChangeEvent += Crc_LanguageChangeEvent; crc.LanguageChangeEvent += Crc_LanguageChangeEvent;
} }
...@@ -112,7 +115,7 @@ namespace TheMachine ...@@ -112,7 +115,7 @@ namespace TheMachine
private void timer1_Tick(object sender, EventArgs e) private void timer1_Tick(object sender, EventArgs e)
{ {
if (Visible) if (Visible)
SetState(MoveInfo.List); SetState(MoveInfos);
} }
} }
} }
...@@ -41,8 +41,6 @@ namespace TheMachine ...@@ -41,8 +41,6 @@ namespace TheMachine
this.tabc = new System.Windows.Forms.TabControl(); this.tabc = new System.Windows.Forms.TabControl();
this.tabP1 = new System.Windows.Forms.TabPage(); this.tabP1 = new System.Windows.Forms.TabPage();
this.pnl = new System.Windows.Forms.Panel(); this.pnl = new System.Windows.Forms.Panel();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.stateView = new TheMachine.DoubleBufferListView();
this.listView1 = new TheMachine.DoubleBufferListView(); this.listView1 = new TheMachine.DoubleBufferListView();
this.cb_EnableBuzzer = new System.Windows.Forms.CheckBox(); this.cb_EnableBuzzer = new System.Windows.Forms.CheckBox();
this.btn_PauseBuzzer = new System.Windows.Forms.Button(); this.btn_PauseBuzzer = new System.Windows.Forms.Button();
...@@ -52,7 +50,6 @@ namespace TheMachine ...@@ -52,7 +50,6 @@ namespace TheMachine
this.tabc.SuspendLayout(); this.tabc.SuspendLayout();
this.tabP1.SuspendLayout(); this.tabP1.SuspendLayout();
this.pnl.SuspendLayout(); this.pnl.SuspendLayout();
this.groupBox1.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// menuStrip1 // menuStrip1
...@@ -160,7 +157,6 @@ namespace TheMachine ...@@ -160,7 +157,6 @@ namespace TheMachine
// //
// pnl // pnl
// //
this.pnl.Controls.Add(this.groupBox1);
this.pnl.Controls.Add(this.listView1); this.pnl.Controls.Add(this.listView1);
this.pnl.Dock = System.Windows.Forms.DockStyle.Fill; this.pnl.Dock = System.Windows.Forms.DockStyle.Fill;
this.pnl.Location = new System.Drawing.Point(0, 0); this.pnl.Location = new System.Drawing.Point(0, 0);
...@@ -168,29 +164,6 @@ namespace TheMachine ...@@ -168,29 +164,6 @@ namespace TheMachine
this.pnl.Size = new System.Drawing.Size(1000, 576); this.pnl.Size = new System.Drawing.Size(1000, 576);
this.pnl.TabIndex = 273; this.pnl.TabIndex = 273;
// //
// groupBox1
//
this.groupBox1.Controls.Add(this.stateView);
this.groupBox1.Location = new System.Drawing.Point(776, 336);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(598, 244);
this.groupBox1.TabIndex = 1;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "运行状态";
//
// stateView
//
this.stateView.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.stateView.Dock = System.Windows.Forms.DockStyle.Fill;
this.stateView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
this.stateView.HideSelection = false;
this.stateView.Location = new System.Drawing.Point(3, 25);
this.stateView.MultiSelect = false;
this.stateView.Name = "stateView";
this.stateView.Size = new System.Drawing.Size(592, 216);
this.stateView.TabIndex = 0;
this.stateView.UseCompatibleStateImageBehavior = false;
//
// listView1 // listView1
// //
this.listView1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) this.listView1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
...@@ -276,7 +249,6 @@ namespace TheMachine ...@@ -276,7 +249,6 @@ namespace TheMachine
this.tabc.ResumeLayout(false); this.tabc.ResumeLayout(false);
this.tabP1.ResumeLayout(false); this.tabP1.ResumeLayout(false);
this.pnl.ResumeLayout(false); this.pnl.ResumeLayout(false);
this.groupBox1.ResumeLayout(false);
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();
...@@ -294,8 +266,6 @@ namespace TheMachine ...@@ -294,8 +266,6 @@ namespace TheMachine
private System.Windows.Forms.Button btn_stop; private System.Windows.Forms.Button btn_stop;
private System.Windows.Forms.Button btn_run; private System.Windows.Forms.Button btn_run;
private System.Windows.Forms.TabPage tabP1; private System.Windows.Forms.TabPage tabP1;
private DoubleBufferListView stateView;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.ToolStripMenuItem 关于ToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem 关于ToolStripMenuItem;
private System.Windows.Forms.CheckBox cb_EnableBuzzer; private System.Windows.Forms.CheckBox cb_EnableBuzzer;
private System.Windows.Forms.Button btn_PauseBuzzer; private System.Windows.Forms.Button btn_PauseBuzzer;
......
...@@ -63,9 +63,9 @@ namespace TheMachine ...@@ -63,9 +63,9 @@ namespace TheMachine
//LogControl lc = new LogControl(); //LogControl lc = new LogControl();
IOControls ioc = new IOControls(); IOControls ioc = new IOControls();
TrayManagerControl tmc = new TrayManagerControl(); TrayManagerControl tmc = new TrayManagerControl();
CycleHYControl<HYControl> hy = new CycleHYControl<HYControl>(); DeviceControl<HYControl> hy = new DeviceControl<HYControl>();
CycleHYControl<TransplantControl> yz = new CycleHYControl<TransplantControl>(); DeviceControl<TransplantControl> yz = new DeviceControl<TransplantControl>();
CycleHYControl<TrayStopControl> ts = new CycleHYControl<TrayStopControl>(); DeviceControl<TrayStopControl> ts = new DeviceControl<TrayStopControl>();
AxisControl ac = new AxisControl(); AxisControl ac = new AxisControl();
SettingControl sc = new SettingControl(); SettingControl sc = new SettingControl();
...@@ -99,7 +99,7 @@ namespace TheMachine ...@@ -99,7 +99,7 @@ namespace TheMachine
timecol.Text = crc.GetString("Res0197","时间"); timecol.Text = crc.GetString("Res0197","时间");
timecol.Width = 100; timecol.Width = 100;
ColumnHeader devicecol = new ColumnHeader(); ColumnHeader devicecol = new ColumnHeader();
devicecol.Text = "模块"; devicecol.Text = crc.GetString("Res0198","模块");
devicecol.Width = 100; devicecol.Width = 100;
listView1.Columns.Add(emptycol); listView1.Columns.Add(emptycol);
listView1.Columns.Add(timecol); listView1.Columns.Add(timecol);
...@@ -149,7 +149,7 @@ namespace TheMachine ...@@ -149,7 +149,7 @@ namespace TheMachine
const int tabpagecount = 5; const int tabpagecount = 5;
void addTablePage() { void addTablePage() {
AddForm("tab_io","I/O", ioc); AddForm("tab_io","I/O", ioc);
AddForm("tab_tmc","托盘", tmc); AddForm("tab_tmc",crc.GetString("Form1_tabc_tab_tmc_Text","托盘"), tmc);
AddForm("tab_sidemove", hy.DeviceName, hy); AddForm("tab_sidemove", hy.DeviceName, hy);
AddForm("tab_transmove", yz.DeviceName, yz); AddForm("tab_transmove", yz.DeviceName, yz);
AddForm("tab_traystop", ts.DeviceName, ts); AddForm("tab_traystop", ts.DeviceName, ts);
...@@ -353,13 +353,13 @@ namespace TheMachine ...@@ -353,13 +353,13 @@ namespace TheMachine
{ {
if (RobotManage.mainMachine.IOValue(IO_Type.SuddenStop_BTN).Equals(IO_VALUE.LOW)) if (RobotManage.mainMachine.IOValue(IO_Type.SuddenStop_BTN).Equals(IO_VALUE.LOW))
{ {
RobotManage.mainMachine.Msg.add("急停中,无法启动", MsgLevel.warning); RobotManage.mainMachine.Msg.add(crc.GetString("Res0017","急停中,无法启动"), MsgLevel.warning);
RobotManage.mainMachine.Msg.Show(); RobotManage.mainMachine.Msg.Show();
return; return;
} }
if (RobotManage.mainMachine.IOValue(IO_Type.AutoRun_Single).Equals(IO_VALUE.LOW)) if (RobotManage.mainMachine.IOValue(IO_Type.AutoRun_Single).Equals(IO_VALUE.LOW))
{ {
RobotManage.mainMachine.Msg.add("运行开关没有打开,无法启动", MsgLevel.warning); RobotManage.mainMachine.Msg.add(crc.GetString("Res0018","运行开关没有打开,无法启动"), MsgLevel.warning);
RobotManage.mainMachine.Msg.Show(); RobotManage.mainMachine.Msg.Show();
return; return;
} }
...@@ -510,7 +510,7 @@ namespace TheMachine ...@@ -510,7 +510,7 @@ namespace TheMachine
crc.ProcessListItem(menuStrip1.Items, "menuStrip1"); crc.ProcessListItem(menuStrip1.Items, "menuStrip1");
listView1.Columns[1].Text = crc.GetString("Res0197","时间"); listView1.Columns[1].Text = crc.GetString("Res0197","时间");
listView1.Columns[2].Text = "模块"; listView1.Columns[2].Text = crc.GetString("Res0198","模块");
listView1.Columns[3].Text = crc.GetString("Form1_tabc_tabP1_Text","信息"); listView1.Columns[3].Text = crc.GetString("Form1_tabc_tabP1_Text","信息");
......
...@@ -91,11 +91,11 @@ ...@@ -91,11 +91,11 @@
<Compile Include="AxisControl.Designer.cs"> <Compile Include="AxisControl.Designer.cs">
<DependentUpon>AxisControl.cs</DependentUpon> <DependentUpon>AxisControl.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="CycleHYControl.cs"> <Compile Include="DeviceControl.cs">
<SubType>UserControl</SubType> <SubType>UserControl</SubType>
</Compile> </Compile>
<Compile Include="CycleHYControl.Designer.cs"> <Compile Include="DeviceControl.Designer.cs">
<DependentUpon>CycleHYControl.cs</DependentUpon> <DependentUpon>DeviceControl.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="device\HYControl.cs"> <Compile Include="device\HYControl.cs">
<SubType>UserControl</SubType> <SubType>UserControl</SubType>
...@@ -191,8 +191,8 @@ ...@@ -191,8 +191,8 @@
<DependentUpon>AxisControl.cs</DependentUpon> <DependentUpon>AxisControl.cs</DependentUpon>
<SubType>Designer</SubType> <SubType>Designer</SubType>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="CycleHYControl.resx"> <EmbeddedResource Include="DeviceControl.resx">
<DependentUpon>CycleHYControl.cs</DependentUpon> <DependentUpon>DeviceControl.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="device\HYControl.resx"> <EmbeddedResource Include="device\HYControl.resx">
<DependentUpon>HYControl.cs</DependentUpon> <DependentUpon>HYControl.cs</DependentUpon>
......
...@@ -42,32 +42,30 @@ namespace TheMachine ...@@ -42,32 +42,30 @@ namespace TheMachine
// //
// listView1 // listView1
// //
this.listView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) this.listView1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Left)));
| System.Windows.Forms.AnchorStyles.Right)));
this.listView1.HideSelection = false; this.listView1.HideSelection = false;
this.listView1.Location = new System.Drawing.Point(3, 34); this.listView1.Location = new System.Drawing.Point(0, 0);
this.listView1.Name = "listView1"; this.listView1.Name = "listView1";
this.listView1.Size = new System.Drawing.Size(683, 412); this.listView1.Size = new System.Drawing.Size(574, 446);
this.listView1.TabIndex = 0; this.listView1.TabIndex = 0;
this.listView1.UseCompatibleStateImageBehavior = false; this.listView1.UseCompatibleStateImageBehavior = false;
// //
// label_Statistics // label_Statistics
// //
this.label_Statistics.AutoSize = true; this.label_Statistics.AutoSize = true;
this.label_Statistics.Location = new System.Drawing.Point(706, 34); this.label_Statistics.Location = new System.Drawing.Point(629, 16);
this.label_Statistics.Name = "label_Statistics"; this.label_Statistics.Name = "label_Statistics";
this.label_Statistics.Size = new System.Drawing.Size(49, 14); this.label_Statistics.Size = new System.Drawing.Size(56, 16);
this.label_Statistics.TabIndex = 1; this.label_Statistics.TabIndex = 1;
this.label_Statistics.Text = "label1"; this.label_Statistics.Text = "label1";
// //
// TrayManagerControl // TrayManagerControl
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.label_Statistics); this.Controls.Add(this.label_Statistics);
this.Controls.Add(this.listView1); this.Controls.Add(this.listView1);
this.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Name = "TrayManagerControl"; this.Name = "TrayManagerControl";
this.Size = new System.Drawing.Size(846, 449); this.Size = new System.Drawing.Size(846, 449);
this.Load += new System.EventHandler(this.TrayManagerControl_Load); this.Load += new System.EventHandler(this.TrayManagerControl_Load);
......
using DeviceLibrary; using OnlineStore;
using DeviceLibrary;
using OnlineStore.LoadCSVLibrary; using OnlineStore.LoadCSVLibrary;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
...@@ -36,7 +37,7 @@ namespace TheMachine ...@@ -36,7 +37,7 @@ namespace TheMachine
void Init() { void Init() {
#region listview初始化 #region listview初始化
var ColList = new string[] { "RFID", "上次地址", "更新时间", "托盘类型", "载荷","目的地" }; var ColList = new string[] { "RFID", crc.GetString("Res0019", "上次地址"), crc.GetString("Res0020", "更新时间"), crc.GetString("Res0021", "托盘类型"), crc.GetString("Res0022", "载荷"), crc.GetString("Res0023", "目的地") };
listView1.View = View.Details; listView1.View = View.Details;
foreach (var coltxt in ColList) foreach (var coltxt in ColList)
{ {
...@@ -57,11 +58,11 @@ namespace TheMachine ...@@ -57,11 +58,11 @@ namespace TheMachine
var traylist = TrayManager.Traylist.Values.ToList(); var traylist = TrayManager.Traylist.Values.ToList();
foreach (var ti in traylist) { foreach (var ti in traylist) {
var timego = (DateTime.Now - ti.LastUpdateTime); var timego = (DateTime.Now - ti.LastUpdateTime);
var lasttime = timego.Seconds + "秒前"; var lasttime = timego.Seconds + crc.GetString("Res0024","秒前");
if (timego.Minutes > 0) if (timego.Minutes > 0)
lasttime = timego.Minutes + "分 " + lasttime; lasttime = timego.Minutes + crc.GetString("Res0025","分 ") + lasttime;
if (timego.Hours > 0) if (timego.Hours > 0)
lasttime = timego.Hours + "时 " + lasttime; lasttime = timego.Hours + crc.GetString("Res0026","时 ") + lasttime;
var traydesc = TrayManager.TrayTypeDesc[ti.TrayType]; var traydesc = TrayManager.TrayTypeDesc[ti.TrayType];
var loaddesc = TrayManager.LoadTypeDesc[ti.LoadType]; var loaddesc = TrayManager.LoadTypeDesc[ti.LoadType];
var lastaddrdesc = TrayManager.AddrDesc[ti.LastAddr]; var lastaddrdesc = TrayManager.AddrDesc[ti.LastAddr];
...@@ -78,12 +79,12 @@ namespace TheMachine ...@@ -78,12 +79,12 @@ namespace TheMachine
listviewitem.SubItems.AddRange(items); listviewitem.SubItems.AddRange(items);
} }
label_Statistics.Text = "托盘统计"+":" + "\n" label_Statistics.Text = crc.GetString("Res0027","托盘统计")+":" + "\n"
+ "离线总数" + ": " + TrayManager.OfflineCount + "\n" + crc.GetString("Res0028","离线总数") + ": " + TrayManager.OfflineCount + "\n"
+ "在线总数" + ": " + TrayManager.TotalCount + "\n" + crc.GetString("Res0029","在线总数") + ": " + TrayManager.TotalCount + "\n"
+ "空托盘" + ": " + TrayManager.EmptyCount + "\n" + crc.GetString("Res0030","空托盘") + ": " + TrayManager.EmptyCount + "\n"
+ "入库托盘" + ": " + TrayManager.InStoreCount + "\n" + crc.GetString("Res0031","入库托盘") + ": " + TrayManager.InStoreCount + "\n"
+ "出库托盘" + ": " + TrayManager.OutStoreCount + "\n"; + crc.GetString("Res0032","出库托盘") + ": " + TrayManager.OutStoreCount + "\n";
} }
} }
} }
\ No newline at end of file \ No newline at end of file
using System; using OnlineStore;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
using System.Data; using System.Data;
...@@ -29,9 +30,9 @@ namespace TheMachine.UC ...@@ -29,9 +30,9 @@ namespace TheMachine.UC
if (rFID_C2S1.ReadByte(0x20, 16, out byte[] data)) { if (rFID_C2S1.ReadByte(0x20, 16, out byte[] data)) {
textBox_rfidlabel.Text = Encoding.ASCII.GetString(data).Trim(); textBox_rfidlabel.Text = Encoding.ASCII.GetString(data).Trim();
} else { } else {
textBox_rfidlabel.Text = "读取失败"; textBox_rfidlabel.Text = crc.GetString("Res0033","读取失败");
} }
} }
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -115,7 +115,7 @@ namespace TheMachine.UC ...@@ -115,7 +115,7 @@ namespace TheMachine.UC
foreach (var led in Led.LedColors.Keys) foreach (var led in Led.LedColors.Keys)
{ {
List<lightitem> lightitems = new List<lightitem>(); List<lightitem> lightitems = new List<lightitem>();
lightitems.Add(new lightitem(crc.GetString("Res0216","无动作"), LedState.none)); lightitems.Add(new lightitem(crc.GetString("Res0216","待机"), LedState.none));
lightitems.Add(new lightitem(crc.GetString("Res0217","关"), LedState.off)); lightitems.Add(new lightitem(crc.GetString("Res0217","关"), LedState.off));
lightitems.Add(new lightitem(crc.GetString("Res0218","开"), LedState.on)); lightitems.Add(new lightitem(crc.GetString("Res0218","开"), LedState.on));
lightitems.Add(new lightitem(crc.GetString("Res0219","闪烁"), LedState.blink)); lightitems.Add(new lightitem(crc.GetString("Res0219","闪烁"), LedState.blink));
......
...@@ -47,32 +47,38 @@ namespace TheMachine ...@@ -47,32 +47,38 @@ namespace TheMachine
// //
// btn_linerun // btn_linerun
// //
this.btn_linerun.BackColor = System.Drawing.Color.White;
this.btn_linerun.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btn_linerun.Location = new System.Drawing.Point(540, 367); this.btn_linerun.Location = new System.Drawing.Point(540, 367);
this.btn_linerun.Name = "btn_linerun"; this.btn_linerun.Name = "btn_linerun";
this.btn_linerun.Size = new System.Drawing.Size(151, 35); this.btn_linerun.Size = new System.Drawing.Size(151, 35);
this.btn_linerun.TabIndex = 2; this.btn_linerun.TabIndex = 2;
this.btn_linerun.Text = "横移电机正转"; this.btn_linerun.Text = "横移电机正转";
this.btn_linerun.UseVisualStyleBackColor = true; this.btn_linerun.UseVisualStyleBackColor = false;
this.btn_linerun.Click += new System.EventHandler(this.btn_linerun_Click); this.btn_linerun.Click += new System.EventHandler(this.btn_linerun_Click);
// //
// btn_linerev // btn_linerev
// //
this.btn_linerev.BackColor = System.Drawing.Color.White;
this.btn_linerev.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btn_linerev.Location = new System.Drawing.Point(711, 367); this.btn_linerev.Location = new System.Drawing.Point(711, 367);
this.btn_linerev.Name = "btn_linerev"; this.btn_linerev.Name = "btn_linerev";
this.btn_linerev.Size = new System.Drawing.Size(151, 35); this.btn_linerev.Size = new System.Drawing.Size(151, 35);
this.btn_linerev.TabIndex = 2; this.btn_linerev.TabIndex = 2;
this.btn_linerev.Text = "横移电机反转"; this.btn_linerev.Text = "横移电机反转";
this.btn_linerev.UseVisualStyleBackColor = true; this.btn_linerev.UseVisualStyleBackColor = false;
this.btn_linerev.Click += new System.EventHandler(this.btn_linerev_Click); this.btn_linerev.Click += new System.EventHandler(this.btn_linerev_Click);
// //
// btn_linestop // btn_linestop
// //
this.btn_linestop.BackColor = System.Drawing.Color.White;
this.btn_linestop.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btn_linestop.Location = new System.Drawing.Point(540, 417); this.btn_linestop.Location = new System.Drawing.Point(540, 417);
this.btn_linestop.Name = "btn_linestop"; this.btn_linestop.Name = "btn_linestop";
this.btn_linestop.Size = new System.Drawing.Size(322, 35); this.btn_linestop.Size = new System.Drawing.Size(322, 35);
this.btn_linestop.TabIndex = 2; this.btn_linestop.TabIndex = 2;
this.btn_linestop.Text = "横移电机停止"; this.btn_linestop.Text = "横移电机停止";
this.btn_linestop.UseVisualStyleBackColor = true; this.btn_linestop.UseVisualStyleBackColor = false;
this.btn_linestop.Click += new System.EventHandler(this.btn_linestop_Click); this.btn_linestop.Click += new System.EventHandler(this.btn_linestop_Click);
// //
// cylinderButton8 // cylinderButton8
...@@ -206,7 +212,7 @@ namespace TheMachine ...@@ -206,7 +212,7 @@ namespace TheMachine
// rfidControl1 // rfidControl1
// //
this.rfidControl1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.rfidControl1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.rfidControl1.Location = new System.Drawing.Point(20, 367); this.rfidControl1.Location = new System.Drawing.Point(19, 506);
this.rfidControl1.Name = "rfidControl1"; this.rfidControl1.Name = "rfidControl1";
this.rfidControl1.Size = new System.Drawing.Size(207, 109); this.rfidControl1.Size = new System.Drawing.Size(207, 109);
this.rfidControl1.TabIndex = 3; this.rfidControl1.TabIndex = 3;
...@@ -215,7 +221,7 @@ namespace TheMachine ...@@ -215,7 +221,7 @@ namespace TheMachine
// rfidControl2 // rfidControl2
// //
this.rfidControl2.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.rfidControl2.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.rfidControl2.Location = new System.Drawing.Point(285, 367); this.rfidControl2.Location = new System.Drawing.Point(282, 506);
this.rfidControl2.Name = "rfidControl2"; this.rfidControl2.Name = "rfidControl2";
this.rfidControl2.Size = new System.Drawing.Size(207, 109); this.rfidControl2.Size = new System.Drawing.Size(207, 109);
this.rfidControl2.TabIndex = 3; this.rfidControl2.TabIndex = 3;
......
...@@ -23,55 +23,66 @@ namespace TheMachine ...@@ -23,55 +23,66 @@ namespace TheMachine
return; return;
this.Tag = "not"; this.Tag = "not";
crc.OpenResourceLog = true; crc.OpenResourceLog = true;
crc.LanguageChangeEvent += (s,o)=> crc.LanguageProcess(this); crc.LanguageChangeEvent += Crc_LanguageChangeEvent;
crc.CurrLanguage = Setting_Init.Device_Default_Language; crc.CurrLanguage = Setting_Init.Device_Default_Language;
} }
private void Crc_LanguageChangeEvent(object sender, EventArgs e)
{
crc.LanguageProcess(this);
btn_linerun.Text = RobotManage.Config.DOList[DeviceGroupName][IO_Type.Ls_A_LineRun].ElectricalDefinition+" " + btn_linerun.Text;
btn_linestop.Text = RobotManage.Config.DOList[DeviceGroupName][IO_Type.Ls_A_LineRun].ElectricalDefinition+" " + btn_linestop.Text;
if (RobotManage.Config.DOList[DeviceGroupName].ContainsKey(IO_Type.Ls_A_LineRwd))
btn_linerev.Text = RobotManage.Config.DOList[DeviceGroupName][IO_Type.Ls_A_LineRwd].ElectricalDefinition+" " + btn_linerev.Text;
}
public void Init(string _deviceGroup) public void Init(string _deviceGroup)
{ {
this.deviceGroup = _deviceGroup; this.DeviceGroupName = _deviceGroup;
foreach (var c in this.Controls) { foreach (var c in this.Controls) {
if (!(c is CylinderButton)) if (!(c is CylinderButton))
continue; continue;
var cc = (c as CylinderButton); var cc = (c as CylinderButton);
cc.DeviceType = deviceGroup; cc.DeviceType = DeviceGroupName;
if (!RobotManage.Config.DOList[deviceGroup].ContainsKey(cc.IO_HIGH)) if (!RobotManage.Config.DOList[DeviceGroupName].ContainsKey(cc.IO_HIGH))
cc.Visible = false; cc.Visible = false;
} }
ioControl1.Init(RobotManage.Config, deviceGroup); ioControl1.Init(RobotManage.Config, DeviceGroupName);
if (!RobotManage.Config.DOList[deviceGroup].ContainsKey(IO_Type.Ls_A_LineRun)) { if (!RobotManage.Config.DOList[DeviceGroupName].ContainsKey(IO_Type.Ls_A_LineRun)) {
btn_linerun.Visible = false; btn_linerun.Visible = false;
btn_linerev.Visible = false; btn_linerev.Visible = false;
btn_linestop.Visible = false; btn_linestop.Visible = false;
} }
if (!RobotManage.Config.DOList[deviceGroup].ContainsKey(IO_Type.Ls_A_LineRwd)) if (!RobotManage.Config.DOList[DeviceGroupName].ContainsKey(IO_Type.Ls_A_LineRwd))
{ {
btn_linerev.Visible = false; btn_linerev.Visible = false;
} }
if (SideMove.DeviceList[deviceGroup].RFID_2 != null) if (SideMove.DeviceList[DeviceGroupName].RFID_2 != null)
{ {
rfidControl1.Init(deviceGroup+"-1", SideMove.DeviceList[deviceGroup].RFID_1); rfidControl1.Init(DeviceGroupName+"-1", SideMove.DeviceList[DeviceGroupName].RFID_1);
rfidControl2.Init(deviceGroup + "-2", SideMove.DeviceList[deviceGroup].RFID_2); rfidControl2.Init(DeviceGroupName + "-2", SideMove.DeviceList[DeviceGroupName].RFID_2);
} }
else if (SideMove.DeviceList[deviceGroup].RFID_1 != null) else if (SideMove.DeviceList[DeviceGroupName].RFID_1 != null)
rfidControl1.Init(deviceGroup, SideMove.DeviceList[deviceGroup].RFID_1); rfidControl1.Init(DeviceGroupName, SideMove.DeviceList[DeviceGroupName].RFID_1);
crc.LanguageProcess(this); crc.LanguageProcess(this);
} }
string deviceGroup; public string DeviceGroupName { get; set; }
private void btn_linerun_Click(object sender, EventArgs e) private void btn_linerun_Click(object sender, EventArgs e)
{ {
SideMove.DeviceList[deviceGroup].Line.LineRun("n", false, 999); SideMove.DeviceList[DeviceGroupName].Line.LineRun("n", false, 999);
} }
private void btn_linerev_Click(object sender, EventArgs e) private void btn_linerev_Click(object sender, EventArgs e)
{ {
SideMove.DeviceList[deviceGroup].Line.LineRun("n", true, 999); SideMove.DeviceList[DeviceGroupName].Line.LineRun("n", true, 999);
} }
private void btn_linestop_Click(object sender, EventArgs e) private void btn_linestop_Click(object sender, EventArgs e)
{ {
SideMove.DeviceList[deviceGroup].Line.LineStop("n"); SideMove.DeviceList[DeviceGroupName].Line.LineStop("n");
} }
} }
} }
...@@ -8,6 +8,8 @@ namespace TheMachine ...@@ -8,6 +8,8 @@ namespace TheMachine
{ {
public interface Idevicetab public interface Idevicetab
{ {
string DeviceGroupName { get; set; }
void Init(string devicegroup); void Init(string devicegroup);
} }
} }
...@@ -48,7 +48,7 @@ namespace TheMachine ...@@ -48,7 +48,7 @@ namespace TheMachine
rfidControl1.Init(deviceGroupName, TransplantMove.DeviceList[deviceGroupName].RFID_1); rfidControl1.Init(deviceGroupName, TransplantMove.DeviceList[deviceGroupName].RFID_1);
crc.LanguageProcess(this); crc.LanguageProcess(this);
} }
string DeviceGroupName = "root"; public string DeviceGroupName { get; set; }
private void button1_Click(object sender, EventArgs e) private void button1_Click(object sender, EventArgs e)
{ {
......
...@@ -48,7 +48,7 @@ namespace TheMachine ...@@ -48,7 +48,7 @@ namespace TheMachine
crc.LanguageProcess(this); crc.LanguageProcess(this);
} }
string DeviceGroupName = "root"; public string DeviceGroupName { get; set; }
private void button1_Click(object sender, EventArgs e) private void button1_Click(object sender, EventArgs e)
{ {
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!