This commit is contained in:
backuppc
2026-01-06 17:35:34 +09:00
parent 649d87cae3
commit 90340f4a7d
39 changed files with 2127 additions and 685 deletions

View File

@@ -34,6 +34,9 @@
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>icons8-robot-80.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="arControl.Net4">
<HintPath>..\Cs_HMI\DLL\arControl.Net4.dll</HintPath>
@@ -136,5 +139,8 @@
<Name>ENIGProtocol</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="icons8-robot-80.ico" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@@ -61,29 +61,52 @@ namespace AGVEmulator
/// </summary>
public void SendGotoTag(byte id, uint tag)
{
var idSTR = id.ToString("X2");
var tagSTR = tag.ToString("0000");
var dataStr = $"{idSTR}{tagSTR}";
Send(ENIGProtocol.AGVCommandHE.Goto, dataStr);
//var idSTR = id.ToString("X2");
//var tagSTR = tag.ToString("0000");
//var dataStr = $"{idSTR}{tagSTR}";
var data = new List<byte>();
data.Add(id);
data.AddRange(System.Text.Encoding.Default.GetBytes(tag.ToString("0000")));
Send(ENIGProtocol.AGVCommandHE.Goto, data.ToArray());
}
/// <summary>
/// 카트를 가지러 들어간다
/// </summary>
/// <param name="id"></param>
public void SendPickOn(byte id)
{
var data = new List<byte>();
data.Add(id);
Send(ENIGProtocol.AGVCommandHE.PickOn, data.ToArray());
}
/// <summary>
/// 카트를 내려놓는다
/// </summary>
/// <param name="id"></param>
public void SendPickOff(byte id)
{
var data = new List<byte>();
data.Add(id);
Send(ENIGProtocol.AGVCommandHE.PickOff, data.ToArray());
}
public void SendCurrentPos(byte id, uint tag)
{
var idSTR = id.ToString("X2");
var tagSTR = tag.ToString("0000");
var dataStr = $"{idSTR}{tagSTR}";
Send(ENIGProtocol.AGVCommandHE.SetCurrent, dataStr);
var data = new List<byte>();
data.Add(id);
data.AddRange(System.Text.Encoding.Default.GetBytes(tag.ToString("0000")));
Send(ENIGProtocol.AGVCommandHE.SetCurrent, data.ToArray());
}
private void Send(ENIGProtocol.AGVCommandHE Command, string datastr)
private void Send(ENIGProtocol.AGVCommandHE Command, byte[] data)
{
byte id = 0;
byte cmd = (byte)Command; //move to target
byte[] data = null;
if (datastr != null && string.IsNullOrEmpty(datastr) == false)
data = System.Text.Encoding.Default.GetBytes(datastr);
var packet = proto.CreatePacket(id, cmd, data);
if (WriteData(packet, false))
{
var hexstr = System.Text.Encoding.Default.GetString(data);
var hexstr =(data == null || data.Any()==false) ? string.Empty : System.Text.Encoding.Default.GetString(data);
RaiseMessage(MessageType.Send, $"ID:{id},CMD:{cmd},DATA:{hexstr}");
}
}

View File

@@ -32,7 +32,6 @@ namespace AGVEmulator
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(fMain));
AGVEmulator.UC.AgvViewer.ptdata ptdata57 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata58 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata59 = new AGVEmulator.UC.AgvViewer.ptdata();
@@ -61,6 +60,7 @@ namespace AGVEmulator
AGVEmulator.UC.AgvViewer.ptdata ptdata82 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata83 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata84 = 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();
this.panel1 = new System.Windows.Forms.Panel();
@@ -86,6 +86,7 @@ namespace AGVEmulator
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.trackBar1 = new System.Windows.Forms.TrackBar();
this.serBMS = new AGVEmulator.SerialConn();
this.rtAGV = new arCtl.LogTextBox();
this.panel4 = new System.Windows.Forms.Panel();
this.groupBox9 = new System.Windows.Forms.GroupBox();
@@ -127,6 +128,7 @@ namespace AGVEmulator
this.button4 = new System.Windows.Forms.Button();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.rtCAL = new arCtl.LogTextBox();
this.serCAL = new AGVEmulator.SerialConn();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage4 = new System.Windows.Forms.TabPage();
@@ -134,6 +136,8 @@ namespace AGVEmulator
this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel();
this.rtAGVPro = new arCtl.LogTextBox();
this.panel12 = new System.Windows.Forms.Panel();
this.agvViewer1 = new AGVEmulator.UC.AgvViewer();
this.serAGV = new AGVEmulator.SerialConn();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.tabPage3 = new System.Windows.Forms.TabPage();
this.panel3 = new System.Windows.Forms.Panel();
@@ -152,6 +156,10 @@ namespace AGVEmulator
this.toolStrip1 = new System.Windows.Forms.ToolStrip();
this.toolStripButton1 = new System.Windows.Forms.ToolStripButton();
this.toolStripButton2 = new System.Windows.Forms.ToolStripButton();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.toolStripButton3 = new System.Windows.Forms.ToolStripButton();
this.toolStripButton4 = new System.Windows.Forms.ToolStripButton();
this.toolStripButton5 = new System.Windows.Forms.ToolStripButton();
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
this.toolStripStatusLabel8 = new System.Windows.Forms.ToolStripStatusLabel();
this.sbAGV = new System.Windows.Forms.ToolStripStatusLabel();
@@ -159,14 +167,8 @@ namespace AGVEmulator
this.sbBMS = new System.Windows.Forms.ToolStripStatusLabel();
this.toolStripStatusLabel2 = new System.Windows.Forms.ToolStripStatusLabel();
this.sbCAL = new System.Windows.Forms.ToolStripStatusLabel();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.toolStripButton3 = new System.Windows.Forms.ToolStripButton();
this.agvViewer1 = new AGVEmulator.UC.AgvViewer();
this.serAGV = new AGVEmulator.SerialConn();
this.serBMS = new AGVEmulator.SerialConn();
this.serCAL = new AGVEmulator.SerialConn();
this.toolStripButton4 = new System.Windows.Forms.ToolStripButton();
this.toolStripButton5 = new System.Windows.Forms.ToolStripButton();
this.button2 = new System.Windows.Forms.Button();
this.button3 = new System.Windows.Forms.Button();
this.groupBox1.SuspendLayout();
this.panel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.trbT2)).BeginInit();
@@ -501,6 +503,18 @@ namespace AGVEmulator
this.trackBar1.Value = 7000;
this.trackBar1.Scroll += new System.EventHandler(this.trackBar1_Scroll);
//
// serBMS
//
this.serBMS.BaudRate = 9600;
this.serBMS.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.serBMS.dev = null;
this.serBMS.Dock = System.Windows.Forms.DockStyle.Top;
this.serBMS.Location = new System.Drawing.Point(3, 17);
this.serBMS.Name = "serBMS";
this.serBMS.PortName = "COM31";
this.serBMS.Size = new System.Drawing.Size(1134, 84);
this.serBMS.TabIndex = 1;
//
// rtAGV
//
this.rtAGV.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(24)))), ((int)(((byte)(24)))), ((int)(((byte)(24)))));
@@ -984,6 +998,18 @@ namespace AGVEmulator
this.rtCAL.TabIndex = 2;
this.rtCAL.Text = "";
//
// serCAL
//
this.serCAL.BaudRate = 9600;
this.serCAL.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.serCAL.dev = null;
this.serCAL.Dock = System.Windows.Forms.DockStyle.Top;
this.serCAL.Location = new System.Drawing.Point(3, 17);
this.serCAL.Name = "serCAL";
this.serCAL.PortName = "COM41";
this.serCAL.Size = new System.Drawing.Size(776, 84);
this.serCAL.TabIndex = 1;
//
// timer1
//
this.timer1.Interval = 200;
@@ -1069,6 +1095,149 @@ namespace AGVEmulator
this.panel12.Size = new System.Drawing.Size(1140, 120);
this.panel12.TabIndex = 5;
//
// agvViewer1
//
this.agvViewer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.agvViewer1.FontMrk = new System.Drawing.Font("Microsoft Sans Serif", 7F);
this.agvViewer1.FontTag = new System.Drawing.Font("Microsoft Sans Serif", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.agvViewer1.lastmark = "";
this.agvViewer1.lastmarkdir = "";
this.agvViewer1.lasttag = "";
this.agvViewer1.lasttagdir = "";
ptdata57.active = false;
ptdata57.data = "NOT";
ptdata57.pos = 30F;
ptdata58.active = false;
ptdata58.data = "QA";
ptdata58.pos = 200F;
ptdata59.active = false;
ptdata59.data = "CHG";
ptdata59.pos = 300F;
ptdata60.active = false;
ptdata60.data = "QC";
ptdata60.pos = 400F;
ptdata61.active = false;
ptdata61.data = "#FVI-1";
ptdata61.pos = 500F;
ptdata62.active = false;
ptdata62.data = "#FVI-2";
ptdata62.pos = 600F;
ptdata63.active = false;
ptdata63.data = "#FVI-3";
ptdata63.pos = 700F;
ptdata64.active = false;
ptdata64.data = "#FVI-4";
ptdata64.pos = 800F;
ptdata65.active = false;
ptdata65.data = "#FVI-5";
ptdata65.pos = 900F;
ptdata66.active = false;
ptdata66.data = "POT";
ptdata66.pos = 970F;
this.agvViewer1.listMRK = new AGVEmulator.UC.AgvViewer.ptdata[] {
ptdata57,
ptdata58,
ptdata59,
ptdata60,
ptdata61,
ptdata62,
ptdata63,
ptdata64,
ptdata65,
ptdata66};
ptdata67.active = false;
ptdata67.data = "9000";
ptdata67.pos = 80F;
ptdata68.active = false;
ptdata68.data = "9001";
ptdata68.pos = 120F;
ptdata69.active = false;
ptdata69.data = "9010";
ptdata69.pos = 180F;
ptdata70.active = false;
ptdata70.data = "9011";
ptdata70.pos = 220F;
ptdata71.active = false;
ptdata71.data = "9020";
ptdata71.pos = 280F;
ptdata72.active = false;
ptdata72.data = "9021";
ptdata72.pos = 320F;
ptdata73.active = false;
ptdata73.data = "9030";
ptdata73.pos = 380F;
ptdata74.active = false;
ptdata74.data = "9031";
ptdata74.pos = 420F;
ptdata75.active = false;
ptdata75.data = "9040";
ptdata75.pos = 480F;
ptdata76.active = false;
ptdata76.data = "9041";
ptdata76.pos = 520F;
ptdata77.active = false;
ptdata77.data = "9050";
ptdata77.pos = 580F;
ptdata78.active = false;
ptdata78.data = "9051";
ptdata78.pos = 620F;
ptdata79.active = false;
ptdata79.data = "9060";
ptdata79.pos = 680F;
ptdata80.active = false;
ptdata80.data = "9061";
ptdata80.pos = 720F;
ptdata81.active = false;
ptdata81.data = "9070";
ptdata81.pos = 780F;
ptdata82.active = false;
ptdata82.data = "9071";
ptdata82.pos = 820F;
ptdata83.active = false;
ptdata83.data = "9000";
ptdata83.pos = 10F;
ptdata84.active = false;
ptdata84.data = "9001";
ptdata84.pos = 50F;
this.agvViewer1.listTAG = new AGVEmulator.UC.AgvViewer.ptdata[] {
ptdata67,
ptdata68,
ptdata69,
ptdata70,
ptdata71,
ptdata72,
ptdata73,
ptdata74,
ptdata75,
ptdata76,
ptdata77,
ptdata78,
ptdata79,
ptdata80,
ptdata81,
ptdata82,
ptdata83,
ptdata84};
this.agvViewer1.Location = new System.Drawing.Point(241, 0);
this.agvViewer1.Name = "agvViewer1";
this.agvViewer1.Size = new System.Drawing.Size(899, 120);
this.agvViewer1.StopbyMark = false;
this.agvViewer1.TabIndex = 0;
this.agvViewer1.Text = "agvViewer1";
this.agvViewer1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.agvViewer1_MouseDown);
//
// serAGV
//
this.serAGV.BaudRate = 9600;
this.serAGV.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.serAGV.dev = null;
this.serAGV.Dock = System.Windows.Forms.DockStyle.Left;
this.serAGV.Location = new System.Drawing.Point(0, 0);
this.serAGV.Name = "serAGV";
this.serAGV.PortName = "COM21";
this.serAGV.Size = new System.Drawing.Size(241, 120);
this.serAGV.TabIndex = 0;
//
// tabPage2
//
this.tabPage2.Controls.Add(this.groupBox1);
@@ -1093,6 +1262,8 @@ namespace AGVEmulator
//
// panel3
//
this.panel3.Controls.Add(this.button3);
this.panel3.Controls.Add(this.button2);
this.panel3.Controls.Add(this.nudIDAgv);
this.panel3.Controls.Add(this.label7);
this.panel3.Controls.Add(this.numericUpDown2);
@@ -1288,6 +1459,38 @@ namespace AGVEmulator
this.toolStripButton2.Text = "All Close";
this.toolStripButton2.Click += new System.EventHandler(this.toolStripButton2_Click);
//
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(6, 25);
//
// toolStripButton3
//
this.toolStripButton3.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton3.Image")));
this.toolStripButton3.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButton3.Name = "toolStripButton3";
this.toolStripButton3.Size = new System.Drawing.Size(84, 22);
this.toolStripButton3.Text = "Open Map";
this.toolStripButton3.Click += new System.EventHandler(this.toolStripButton3_Click);
//
// toolStripButton4
//
this.toolStripButton4.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton4.Image")));
this.toolStripButton4.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButton4.Name = "toolStripButton4";
this.toolStripButton4.Size = new System.Drawing.Size(117, 22);
this.toolStripButton4.Text = "Change Rotation";
this.toolStripButton4.Click += new System.EventHandler(this.toolStripButton4_Click);
//
// toolStripButton5
//
this.toolStripButton5.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton5.Image")));
this.toolStripButton5.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButton5.Name = "toolStripButton5";
this.toolStripButton5.Size = new System.Drawing.Size(87, 22);
this.toolStripButton5.Text = "SetPosition";
this.toolStripButton5.Click += new System.EventHandler(this.toolStripButton5_Click);
//
// statusStrip1
//
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
@@ -1339,204 +1542,27 @@ namespace AGVEmulator
this.sbCAL.Size = new System.Drawing.Size(19, 17);
this.sbCAL.Text = "●";
//
// toolStripSeparator1
// button2
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(6, 25);
this.button2.Location = new System.Drawing.Point(246, 295);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(86, 38);
this.button2.TabIndex = 14;
this.button2.Tag = "--";
this.button2.Text = "Pick On";
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// toolStripButton3
// button3
//
this.toolStripButton3.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton3.Image")));
this.toolStripButton3.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButton3.Name = "toolStripButton3";
this.toolStripButton3.Size = new System.Drawing.Size(84, 22);
this.toolStripButton3.Text = "Open Map";
this.toolStripButton3.Click += new System.EventHandler(this.toolStripButton3_Click);
//
// agvViewer1
//
this.agvViewer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.agvViewer1.FontMrk = new System.Drawing.Font("Microsoft Sans Serif", 7F);
this.agvViewer1.FontTag = new System.Drawing.Font("Microsoft Sans Serif", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.agvViewer1.lastmark = "";
this.agvViewer1.lastmarkdir = "";
this.agvViewer1.lasttag = "";
this.agvViewer1.lasttagdir = "";
ptdata57.active = false;
ptdata57.data = "NOT";
ptdata57.pos = 30F;
ptdata58.active = false;
ptdata58.data = "QA";
ptdata58.pos = 200F;
ptdata59.active = false;
ptdata59.data = "CHG";
ptdata59.pos = 300F;
ptdata60.active = false;
ptdata60.data = "QC";
ptdata60.pos = 400F;
ptdata61.active = false;
ptdata61.data = "#FVI-1";
ptdata61.pos = 500F;
ptdata62.active = false;
ptdata62.data = "#FVI-2";
ptdata62.pos = 600F;
ptdata63.active = false;
ptdata63.data = "#FVI-3";
ptdata63.pos = 700F;
ptdata64.active = false;
ptdata64.data = "#FVI-4";
ptdata64.pos = 800F;
ptdata65.active = false;
ptdata65.data = "#FVI-5";
ptdata65.pos = 900F;
ptdata66.active = false;
ptdata66.data = "POT";
ptdata66.pos = 970F;
this.agvViewer1.listMRK = new AGVEmulator.UC.AgvViewer.ptdata[] {
ptdata57,
ptdata58,
ptdata59,
ptdata60,
ptdata61,
ptdata62,
ptdata63,
ptdata64,
ptdata65,
ptdata66};
ptdata67.active = false;
ptdata67.data = "9000";
ptdata67.pos = 80F;
ptdata68.active = false;
ptdata68.data = "9001";
ptdata68.pos = 120F;
ptdata69.active = false;
ptdata69.data = "9010";
ptdata69.pos = 180F;
ptdata70.active = false;
ptdata70.data = "9011";
ptdata70.pos = 220F;
ptdata71.active = false;
ptdata71.data = "9020";
ptdata71.pos = 280F;
ptdata72.active = false;
ptdata72.data = "9021";
ptdata72.pos = 320F;
ptdata73.active = false;
ptdata73.data = "9030";
ptdata73.pos = 380F;
ptdata74.active = false;
ptdata74.data = "9031";
ptdata74.pos = 420F;
ptdata75.active = false;
ptdata75.data = "9040";
ptdata75.pos = 480F;
ptdata76.active = false;
ptdata76.data = "9041";
ptdata76.pos = 520F;
ptdata77.active = false;
ptdata77.data = "9050";
ptdata77.pos = 580F;
ptdata78.active = false;
ptdata78.data = "9051";
ptdata78.pos = 620F;
ptdata79.active = false;
ptdata79.data = "9060";
ptdata79.pos = 680F;
ptdata80.active = false;
ptdata80.data = "9061";
ptdata80.pos = 720F;
ptdata81.active = false;
ptdata81.data = "9070";
ptdata81.pos = 780F;
ptdata82.active = false;
ptdata82.data = "9071";
ptdata82.pos = 820F;
ptdata83.active = false;
ptdata83.data = "9000";
ptdata83.pos = 10F;
ptdata84.active = false;
ptdata84.data = "9001";
ptdata84.pos = 50F;
this.agvViewer1.listTAG = new AGVEmulator.UC.AgvViewer.ptdata[] {
ptdata67,
ptdata68,
ptdata69,
ptdata70,
ptdata71,
ptdata72,
ptdata73,
ptdata74,
ptdata75,
ptdata76,
ptdata77,
ptdata78,
ptdata79,
ptdata80,
ptdata81,
ptdata82,
ptdata83,
ptdata84};
this.agvViewer1.Location = new System.Drawing.Point(241, 0);
this.agvViewer1.Name = "agvViewer1";
this.agvViewer1.Size = new System.Drawing.Size(899, 120);
this.agvViewer1.StopbyMark = false;
this.agvViewer1.TabIndex = 0;
this.agvViewer1.Text = "agvViewer1";
this.agvViewer1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.agvViewer1_MouseDown);
//
// serAGV
//
this.serAGV.BaudRate = 9600;
this.serAGV.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.serAGV.dev = null;
this.serAGV.Dock = System.Windows.Forms.DockStyle.Left;
this.serAGV.Location = new System.Drawing.Point(0, 0);
this.serAGV.Name = "serAGV";
this.serAGV.PortName = "COM20";
this.serAGV.Size = new System.Drawing.Size(241, 120);
this.serAGV.TabIndex = 0;
//
// serBMS
//
this.serBMS.BaudRate = 9600;
this.serBMS.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.serBMS.dev = null;
this.serBMS.Dock = System.Windows.Forms.DockStyle.Top;
this.serBMS.Location = new System.Drawing.Point(3, 17);
this.serBMS.Name = "serBMS";
this.serBMS.PortName = "COM40";
this.serBMS.Size = new System.Drawing.Size(1134, 84);
this.serBMS.TabIndex = 1;
//
// serCAL
//
this.serCAL.BaudRate = 9600;
this.serCAL.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.serCAL.dev = null;
this.serCAL.Dock = System.Windows.Forms.DockStyle.Top;
this.serCAL.Location = new System.Drawing.Point(3, 17);
this.serCAL.Name = "serCAL";
this.serCAL.PortName = "COM50";
this.serCAL.Size = new System.Drawing.Size(776, 84);
this.serCAL.TabIndex = 1;
//
// toolStripButton4
//
this.toolStripButton4.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton4.Image")));
this.toolStripButton4.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButton4.Name = "toolStripButton4";
this.toolStripButton4.Size = new System.Drawing.Size(117, 22);
this.toolStripButton4.Text = "Change Rotation";
this.toolStripButton4.Click += new System.EventHandler(this.toolStripButton4_Click);
//
// toolStripButton5
//
this.toolStripButton5.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton5.Image")));
this.toolStripButton5.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButton5.Name = "toolStripButton5";
this.toolStripButton5.Size = new System.Drawing.Size(87, 22);
this.toolStripButton5.Text = "SetPosition";
this.toolStripButton5.Click += new System.EventHandler(this.toolStripButton5_Click);
this.button3.Location = new System.Drawing.Point(246, 339);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(86, 38);
this.button3.TabIndex = 15;
this.button3.Tag = "--";
this.button3.Text = "Pick Off";
this.button3.UseVisualStyleBackColor = true;
this.button3.Click += new System.EventHandler(this.button3_Click);
//
// fMain
//
@@ -1706,6 +1732,8 @@ namespace AGVEmulator
private ToolStripButton toolStripButton3;
private ToolStripButton toolStripButton4;
private ToolStripButton toolStripButton5;
private Button button3;
private Button button2;
}
}

View File

@@ -351,8 +351,8 @@ namespace AGVEmulator
private void AgvViewer1_TagTouched(object sender, UC.AgvViewer.TagArgs e)
{
logAGV.Add($"tag touch:{e.Data}");
numericUpDown1.Text = e.Data;// decimal.Parse(e.Data);
button18.PerformClick();
//numericUpDown1.Text = e.Data;// decimal.Parse(e.Data);
//button18.PerformClick();
UpdateVisualAgvPosition(e.Data);
}
@@ -559,7 +559,7 @@ namespace AGVEmulator
private void UpdateVisualAGV()
private void UpdateVisualAGV()
{
if (_visualAgv != null)
{
@@ -619,18 +619,18 @@ private void UpdateVisualAGV()
// Send Tag
if (node.Id != numericUpDown1.Text)
{
if (int.TryParse(node.Id, out int tag))
{
AGV.SendTag(node.Id);
numericUpDown1.Text = node.Id;
if (int.TryParse(node.Id, out int tag))
{
//AGV.SendTag(node.Id);
numericUpDown1.Text = node.Id;
// Snap to node
_currentPosF = node.Position;
_visualAgv.CurrentPosition = node.Position;
// Snap to node
_currentPosF = node.Position;
_visualAgv.CurrentPosition = node.Position;
// Decide Next Move (Turn/Straight)
DecideNextMove(node);
}
// Decide Next Move (Turn/Straight)
DecideNextMove(node);
}
}
}
}
@@ -793,7 +793,7 @@ private void UpdateVisualAGV()
private void toolStripButton3_Click(object sender, EventArgs e)
{
var file = @"C:\Data\Amkor\AGV4\route\NewMap.agvmap";
if(System.IO.File.Exists(file)==false)
if (System.IO.File.Exists(file) == false)
{
var od = new OpenFileDialog();
od.Filter = "json|*.json";
@@ -916,6 +916,19 @@ private void UpdateVisualAGV()
}
}
}
private void button2_Click(object sender, EventArgs e)
{
var target = (byte)nudIDAgv.Value;
this.XBE.SendPickOn(target);
}
private void button3_Click(object sender, EventArgs e)
{
var target = (byte)nudIDAgv.Value;
this.XBE.SendPickOff(target);
}
private void trbT2_Scroll(object sender, EventArgs e)
{
Temp2 = (UInt16)trbT2.Value;

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB