This commit is contained in:
backuppc
2026-01-30 16:58:14 +09:00
parent 3a8cbd3283
commit faf13f5c37
22 changed files with 1137 additions and 417 deletions

View File

@@ -68,6 +68,7 @@
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="RemoteStatus.cs" />
<Compile Include="RS232.cs" />
<Compile Include="RunCode\_AGV.cs">
<SubType>Form</SubType>

View File

@@ -0,0 +1,37 @@
using System.Text;
namespace AGVEmulator
{
public class RemoteStatus
{
public byte Mode { get; set; } // 0=manual, 1=auto
public byte RunSt { get; set; } // 0=stop, 1=run, 2=error
public byte RunStep { get; set; }
public byte RunStepSeq { get; set; }
public byte MotorDir { get; set; } // 0=F, 1=B
public byte MagnetDir { get; set; } // 0=S, 1=L, 2=R
public byte ChargeSt { get; set; } // 0=off, 1=on
public byte CartSt { get; set; } // 0=off, 1=on, 2=unknown
public byte LiftSt { get; set; } // 0=down, 1=up, 2=unknown
public byte ErrorCode { get; set; }
public string LastTag { get; set; }
public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.AppendLine($"Mode: {(Mode == 1 ? "Auto" : "Manual")}");
sb.AppendLine($"RunSt: {(RunSt == 0 ? "Stop" : (RunSt == 1 ? "Run" : "Error"))}");
sb.AppendLine($"Step: {RunStep}, Seq: {RunStepSeq}");
sb.AppendLine($"Dir: {(MotorDir == 1 ? "B" : "F")}, Mag: {(MagnetDir == 1 ? "L" : (MagnetDir == 2 ? "R" : "S"))}");
sb.AppendLine($"Charge: {(ChargeSt == 1 ? "ON" : "OFF")}");
sb.AppendLine($"Cart: {(CartSt == 1 ? "ON" : (CartSt == 0 ? "OFF" : "Unk"))}");
sb.AppendLine($"Lift: {(LiftSt == 1 ? "UP" : (LiftSt == 0 ? "DOWN" : "Unk"))}");
sb.Append($"Tag: {LastTag}");
return sb.ToString();
}
}
}

View File

@@ -80,6 +80,7 @@ namespace AGVEmulator
}
break;
}
UpdateUIStatus();
}
private void Agv_ValueChanged(object sender, DevAGV.ValueChangedArgs e)

View File

@@ -24,15 +24,41 @@ namespace AGVEmulator
}
private void CAL_ProtocReceived(object sender, ENIG.EEProtocol.DataEventArgs e)
{
//throw new NotImplementedException();
var dev = (DeviceType)e.ReceivedPacket.ID;
if (dev == DeviceType.AGV1 || dev == DeviceType.AGV2)
// HMI(Host)에서 호스트로 취급되는 HMI가 보낸 패킷은 ID가 0(ACS)임.
// 하지만 xbee.cs에서 CreatePacket 시 PUB.setting.XBE_ID를 사용함.
// 에뮬레이터에서는 이 패킷들을 수신하여 상태를 업데이트함.
var cmd = (ENIGProtocol.AGVCommandEH)e.ReceivedPacket.Command;
var data = e.ReceivedPacket.Data;
if (cmd == ENIGProtocol.AGVCommandEH.Status)
{
//agv에서 들어오는 데이터
var cmd = e.ReceivedPacket.Command;
if(cmd == 3)
if (data.Length >= 14)
{
//status
_remoteStatus.Mode = data[0];
_remoteStatus.RunSt = data[1];
_remoteStatus.RunStep = data[2];
_remoteStatus.RunStepSeq = data[3];
_remoteStatus.MotorDir = data[4];
_remoteStatus.MagnetDir = data[5];
_remoteStatus.ChargeSt = data[6];
_remoteStatus.CartSt = data[7];
_remoteStatus.LiftSt = data[8];
_remoteStatus.ErrorCode = data[9];
_remoteStatus.LastTag = Encoding.ASCII.GetString(data, 10, 4);
UpdateUIStatus();
}
}
else if (cmd == ENIGProtocol.AGVCommandEH.Error)
{
if (data.Length >= 1)
{
_remoteErrorCode = (ENIGProtocol.AGVErrorCode)data[0];
// _remoteErrorMessage = ... Error 메시지 자체는 패킷에 포함되지 않으므로 유틸리티 사용 가능
_remoteErrorMessage = ENIGProtocol.AGVUtility.GetAGVErrorMessage(_remoteErrorCode);
UpdateUIStatus();
}
}
}

View File

@@ -32,34 +32,34 @@ namespace AGVEmulator
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
AGVEmulator.UC.AgvViewer.ptdata ptdata113 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata114 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata115 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata116 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata117 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata118 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata119 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata120 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata121 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata122 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata123 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata124 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata125 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata126 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata127 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata128 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata129 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata130 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata131 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata132 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata133 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata134 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata135 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata136 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata137 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata138 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata139 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata140 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata29 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata30 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata31 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata32 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata33 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata34 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata35 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata36 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata37 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata38 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata39 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata40 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata41 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata42 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata43 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata44 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata45 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata46 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata47 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata48 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata49 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata50 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata51 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata52 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata53 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata54 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata55 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata56 = new AGVEmulator.UC.AgvViewer.ptdata();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(fMain));
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.rtBMS = new arCtl.LogTextBox();
@@ -142,6 +142,10 @@ namespace AGVEmulator
this.tabPage2 = new System.Windows.Forms.TabPage();
this.tabPage3 = new System.Windows.Forms.TabPage();
this.panel3 = new System.Windows.Forms.Panel();
this.label13 = new System.Windows.Forms.Label();
this.button6 = new System.Windows.Forms.Button();
this.button13 = new System.Windows.Forms.Button();
this.label12 = new System.Windows.Forms.Label();
this.button3 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.nudIDAgv = new System.Windows.Forms.NumericUpDown();
@@ -170,10 +174,11 @@ namespace AGVEmulator
this.sbBMS = new System.Windows.Forms.ToolStripStatusLabel();
this.toolStripStatusLabel2 = new System.Windows.Forms.ToolStripStatusLabel();
this.sbCAL = new System.Windows.Forms.ToolStripStatusLabel();
this.label12 = new System.Windows.Forms.Label();
this.label13 = new System.Windows.Forms.Label();
this.button6 = new System.Windows.Forms.Button();
this.button13 = new System.Windows.Forms.Button();
this.groupBox12 = new System.Windows.Forms.GroupBox();
this.groupBox13 = new System.Windows.Forms.GroupBox();
this.tbErmsg = new System.Windows.Forms.TextBox();
this.tbErCode = new System.Windows.Forms.TextBox();
this.rtStatus = new System.Windows.Forms.RichTextBox();
this.groupBox1.SuspendLayout();
this.panel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.trbT2)).BeginInit();
@@ -205,6 +210,8 @@ namespace AGVEmulator
((System.ComponentModel.ISupportInitialize)(this.nudTagNo)).BeginInit();
this.toolStrip1.SuspendLayout();
this.statusStrip1.SuspendLayout();
this.groupBox12.SuspendLayout();
this.groupBox13.SuspendLayout();
this.SuspendLayout();
//
// groupBox1
@@ -1119,120 +1126,120 @@ namespace AGVEmulator
this.agvViewer1.lastmarkdir = "";
this.agvViewer1.lasttag = "";
this.agvViewer1.lasttagdir = "";
ptdata113.active = false;
ptdata113.data = "NOT";
ptdata113.pos = 30F;
ptdata114.active = false;
ptdata114.data = "QA";
ptdata114.pos = 200F;
ptdata115.active = false;
ptdata115.data = "CHG";
ptdata115.pos = 300F;
ptdata116.active = false;
ptdata116.data = "QC";
ptdata116.pos = 400F;
ptdata117.active = false;
ptdata117.data = "#FVI-1";
ptdata117.pos = 500F;
ptdata118.active = false;
ptdata118.data = "#FVI-2";
ptdata118.pos = 600F;
ptdata119.active = false;
ptdata119.data = "#FVI-3";
ptdata119.pos = 700F;
ptdata120.active = false;
ptdata120.data = "#FVI-4";
ptdata120.pos = 800F;
ptdata121.active = false;
ptdata121.data = "#FVI-5";
ptdata121.pos = 900F;
ptdata122.active = false;
ptdata122.data = "POT";
ptdata122.pos = 970F;
ptdata29.active = false;
ptdata29.data = "NOT";
ptdata29.pos = 30F;
ptdata30.active = false;
ptdata30.data = "QA";
ptdata30.pos = 200F;
ptdata31.active = false;
ptdata31.data = "CHG";
ptdata31.pos = 300F;
ptdata32.active = false;
ptdata32.data = "QC";
ptdata32.pos = 400F;
ptdata33.active = false;
ptdata33.data = "#FVI-1";
ptdata33.pos = 500F;
ptdata34.active = false;
ptdata34.data = "#FVI-2";
ptdata34.pos = 600F;
ptdata35.active = false;
ptdata35.data = "#FVI-3";
ptdata35.pos = 700F;
ptdata36.active = false;
ptdata36.data = "#FVI-4";
ptdata36.pos = 800F;
ptdata37.active = false;
ptdata37.data = "#FVI-5";
ptdata37.pos = 900F;
ptdata38.active = false;
ptdata38.data = "POT";
ptdata38.pos = 970F;
this.agvViewer1.listMRK = new AGVEmulator.UC.AgvViewer.ptdata[] {
ptdata113,
ptdata114,
ptdata115,
ptdata116,
ptdata117,
ptdata118,
ptdata119,
ptdata120,
ptdata121,
ptdata122};
ptdata123.active = false;
ptdata123.data = "9000";
ptdata123.pos = 80F;
ptdata124.active = false;
ptdata124.data = "9001";
ptdata124.pos = 120F;
ptdata125.active = false;
ptdata125.data = "9010";
ptdata125.pos = 180F;
ptdata126.active = false;
ptdata126.data = "9011";
ptdata126.pos = 220F;
ptdata127.active = false;
ptdata127.data = "9020";
ptdata127.pos = 280F;
ptdata128.active = false;
ptdata128.data = "9021";
ptdata128.pos = 320F;
ptdata129.active = false;
ptdata129.data = "9030";
ptdata129.pos = 380F;
ptdata130.active = false;
ptdata130.data = "9031";
ptdata130.pos = 420F;
ptdata131.active = false;
ptdata131.data = "9040";
ptdata131.pos = 480F;
ptdata132.active = false;
ptdata132.data = "9041";
ptdata132.pos = 520F;
ptdata133.active = false;
ptdata133.data = "9050";
ptdata133.pos = 580F;
ptdata134.active = false;
ptdata134.data = "9051";
ptdata134.pos = 620F;
ptdata135.active = false;
ptdata135.data = "9060";
ptdata135.pos = 680F;
ptdata136.active = false;
ptdata136.data = "9061";
ptdata136.pos = 720F;
ptdata137.active = false;
ptdata137.data = "9070";
ptdata137.pos = 780F;
ptdata138.active = false;
ptdata138.data = "9071";
ptdata138.pos = 820F;
ptdata139.active = false;
ptdata139.data = "9000";
ptdata139.pos = 10F;
ptdata140.active = false;
ptdata140.data = "9001";
ptdata140.pos = 50F;
ptdata29,
ptdata30,
ptdata31,
ptdata32,
ptdata33,
ptdata34,
ptdata35,
ptdata36,
ptdata37,
ptdata38};
ptdata39.active = false;
ptdata39.data = "9000";
ptdata39.pos = 80F;
ptdata40.active = false;
ptdata40.data = "9001";
ptdata40.pos = 120F;
ptdata41.active = false;
ptdata41.data = "9010";
ptdata41.pos = 180F;
ptdata42.active = false;
ptdata42.data = "9011";
ptdata42.pos = 220F;
ptdata43.active = false;
ptdata43.data = "9020";
ptdata43.pos = 280F;
ptdata44.active = false;
ptdata44.data = "9021";
ptdata44.pos = 320F;
ptdata45.active = false;
ptdata45.data = "9030";
ptdata45.pos = 380F;
ptdata46.active = false;
ptdata46.data = "9031";
ptdata46.pos = 420F;
ptdata47.active = false;
ptdata47.data = "9040";
ptdata47.pos = 480F;
ptdata48.active = false;
ptdata48.data = "9041";
ptdata48.pos = 520F;
ptdata49.active = false;
ptdata49.data = "9050";
ptdata49.pos = 580F;
ptdata50.active = false;
ptdata50.data = "9051";
ptdata50.pos = 620F;
ptdata51.active = false;
ptdata51.data = "9060";
ptdata51.pos = 680F;
ptdata52.active = false;
ptdata52.data = "9061";
ptdata52.pos = 720F;
ptdata53.active = false;
ptdata53.data = "9070";
ptdata53.pos = 780F;
ptdata54.active = false;
ptdata54.data = "9071";
ptdata54.pos = 820F;
ptdata55.active = false;
ptdata55.data = "9000";
ptdata55.pos = 10F;
ptdata56.active = false;
ptdata56.data = "9001";
ptdata56.pos = 50F;
this.agvViewer1.listTAG = new AGVEmulator.UC.AgvViewer.ptdata[] {
ptdata123,
ptdata124,
ptdata125,
ptdata126,
ptdata127,
ptdata128,
ptdata129,
ptdata130,
ptdata131,
ptdata132,
ptdata133,
ptdata134,
ptdata135,
ptdata136,
ptdata137,
ptdata138,
ptdata139,
ptdata140};
ptdata39,
ptdata40,
ptdata41,
ptdata42,
ptdata43,
ptdata44,
ptdata45,
ptdata46,
ptdata47,
ptdata48,
ptdata49,
ptdata50,
ptdata51,
ptdata52,
ptdata53,
ptdata54,
ptdata55,
ptdata56};
this.agvViewer1.Location = new System.Drawing.Point(241, 0);
this.agvViewer1.Name = "agvViewer1";
this.agvViewer1.Size = new System.Drawing.Size(899, 120);
@@ -1277,6 +1284,8 @@ namespace AGVEmulator
//
// panel3
//
this.panel3.Controls.Add(this.groupBox13);
this.panel3.Controls.Add(this.groupBox12);
this.panel3.Controls.Add(this.label13);
this.panel3.Controls.Add(this.button6);
this.panel3.Controls.Add(this.button13);
@@ -1301,6 +1310,46 @@ namespace AGVEmulator
this.panel3.Size = new System.Drawing.Size(364, 622);
this.panel3.TabIndex = 15;
//
// label13
//
this.label13.AutoSize = true;
this.label13.Location = new System.Drawing.Point(17, 362);
this.label13.Name = "label13";
this.label13.Size = new System.Drawing.Size(26, 12);
this.label13.TabIndex = 19;
this.label13.Text = "Exit";
//
// button6
//
this.button6.Location = new System.Drawing.Point(204, 349);
this.button6.Name = "button6";
this.button6.Size = new System.Drawing.Size(133, 38);
this.button6.TabIndex = 18;
this.button6.Tag = "--";
this.button6.Text = "Pick Off";
this.button6.UseVisualStyleBackColor = true;
this.button6.Click += new System.EventHandler(this.button6_Click_1);
//
// button13
//
this.button13.Location = new System.Drawing.Point(65, 349);
this.button13.Name = "button13";
this.button13.Size = new System.Drawing.Size(133, 38);
this.button13.TabIndex = 17;
this.button13.Tag = "--";
this.button13.Text = "Pick On";
this.button13.UseVisualStyleBackColor = true;
this.button13.Click += new System.EventHandler(this.button13_Click);
//
// label12
//
this.label12.AutoSize = true;
this.label12.Location = new System.Drawing.Point(17, 318);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(34, 12);
this.label12.TabIndex = 16;
this.label12.Text = "Enter";
//
// button3
//
this.button3.Location = new System.Drawing.Point(204, 305);
@@ -1583,45 +1632,50 @@ namespace AGVEmulator
this.sbCAL.Size = new System.Drawing.Size(19, 17);
this.sbCAL.Text = "●";
//
// label12
// groupBox12
//
this.label12.AutoSize = true;
this.label12.Location = new System.Drawing.Point(17, 318);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(34, 12);
this.label12.TabIndex = 16;
this.label12.Text = "Enter";
this.groupBox12.Controls.Add(this.rtStatus);
this.groupBox12.Location = new System.Drawing.Point(6, 393);
this.groupBox12.Name = "groupBox12";
this.groupBox12.Size = new System.Drawing.Size(355, 147);
this.groupBox12.TabIndex = 20;
this.groupBox12.TabStop = false;
this.groupBox12.Text = "status";
//
// label13
// groupBox13
//
this.label13.AutoSize = true;
this.label13.Location = new System.Drawing.Point(17, 362);
this.label13.Name = "label13";
this.label13.Size = new System.Drawing.Size(26, 12);
this.label13.TabIndex = 19;
this.label13.Text = "Exit";
this.groupBox13.Controls.Add(this.tbErCode);
this.groupBox13.Controls.Add(this.tbErmsg);
this.groupBox13.Dock = System.Windows.Forms.DockStyle.Bottom;
this.groupBox13.Location = new System.Drawing.Point(0, 546);
this.groupBox13.Name = "groupBox13";
this.groupBox13.Size = new System.Drawing.Size(364, 76);
this.groupBox13.TabIndex = 21;
this.groupBox13.TabStop = false;
this.groupBox13.Text = "error";
//
// button6
// tbErmsg
//
this.button6.Location = new System.Drawing.Point(204, 349);
this.button6.Name = "button6";
this.button6.Size = new System.Drawing.Size(133, 38);
this.button6.TabIndex = 18;
this.button6.Tag = "--";
this.button6.Text = "Pick Off";
this.button6.UseVisualStyleBackColor = true;
this.button6.Click += new System.EventHandler(this.button6_Click_1);
this.tbErmsg.Location = new System.Drawing.Point(13, 45);
this.tbErmsg.Name = "tbErmsg";
this.tbErmsg.Size = new System.Drawing.Size(287, 21);
this.tbErmsg.TabIndex = 0;
//
// button13
// tbErCode
//
this.button13.Location = new System.Drawing.Point(65, 349);
this.button13.Name = "button13";
this.button13.Size = new System.Drawing.Size(133, 38);
this.button13.TabIndex = 17;
this.button13.Tag = "--";
this.button13.Text = "Pick On";
this.button13.UseVisualStyleBackColor = true;
this.button13.Click += new System.EventHandler(this.button13_Click);
this.tbErCode.Location = new System.Drawing.Point(12, 18);
this.tbErCode.Name = "tbErCode";
this.tbErCode.Size = new System.Drawing.Size(287, 21);
this.tbErCode.TabIndex = 1;
//
// rtStatus
//
this.rtStatus.Dock = System.Windows.Forms.DockStyle.Fill;
this.rtStatus.Location = new System.Drawing.Point(3, 17);
this.rtStatus.Name = "rtStatus";
this.rtStatus.Size = new System.Drawing.Size(349, 127);
this.rtStatus.TabIndex = 0;
this.rtStatus.Text = "";
//
// fMain
//
@@ -1678,6 +1732,9 @@ namespace AGVEmulator
this.toolStrip1.PerformLayout();
this.statusStrip1.ResumeLayout(false);
this.statusStrip1.PerformLayout();
this.groupBox12.ResumeLayout(false);
this.groupBox13.ResumeLayout(false);
this.groupBox13.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
@@ -1798,6 +1855,11 @@ namespace AGVEmulator
private Label label13;
private Button button6;
private Button button13;
private GroupBox groupBox13;
private GroupBox groupBox12;
private TextBox tbErCode;
private TextBox tbErmsg;
private RichTextBox rtStatus;
}
}

View File

@@ -8,7 +8,6 @@ using System.Globalization;
using System.IO;
using System.Linq;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Windows.Forms;
using System.Windows.Forms.VisualStyles;
using static AGVEmulator.DevAGV;
@@ -24,6 +23,10 @@ namespace AGVEmulator
DevAGV AGV;
DevXBE XBE;
public RemoteStatus _remoteStatus = new RemoteStatus();
public ENIGProtocol.AGVErrorCode _remoteErrorCode = ENIGProtocol.AGVErrorCode.None;
public string _remoteErrorMessage = "";
// Map Control
private UnifiedAGVCanvas _agvCanvas;
private VirtualAGV _visualAgv;
@@ -980,6 +983,30 @@ namespace AGVEmulator
var target = (byte)nudIDAgv.Value;
this.XBE.SendPickOffExit(target);
}
public void UpdateUIStatus()
{
if (this.InvokeRequired)
{
this.BeginInvoke(new Action(UpdateUIStatus));
return;
}
rtStatus.Text = _remoteStatus.ToString();
tbErCode.Text = _remoteErrorCode.ToString();
tbErmsg.Text = _remoteErrorMessage;
if (_remoteErrorCode != ENIGProtocol.AGVErrorCode.None)
{
tbErCode.BackColor = Color.Red;
tbErCode.ForeColor = Color.White;
}
else
{
tbErCode.BackColor = SystemColors.Window;
tbErCode.ForeColor = SystemColors.WindowText;
}
}
}
}