acs test 프로그램에 pick on ,off 기능 추가

This commit is contained in:
ChiKyun Kim
2026-02-05 17:18:01 +09:00
parent ba542beaff
commit ddaab0b5da
13 changed files with 174 additions and 52 deletions

1
.gitignore vendored
View File

@@ -15,3 +15,4 @@ packages
*.bak
/Cs_HMI/Data/*.agvmap
/Cs_HMI/AGVLogic/AGVMapEditor/Data/*.agvmap
/Document/~$PICkit 프로그램 다운로드 매뉴얼.pptx

View File

@@ -70,15 +70,11 @@
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="RemoteStatus.cs" />
<Compile Include="RS232.cs" />
<Compile Include="RunCode\_AGV.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="RunCode\_AGV.cs" />
<Compile Include="RunCode\_XBEE.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="RunCode\_BMS.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="RunCode\_BMS.cs" />
<Compile Include="UC\SerialConn.cs">
<SubType>UserControl</SubType>
</Compile>

View File

@@ -9,6 +9,7 @@ using AR;
using System.Windows.Media.Animation;
using System.Net.Security;
using AGVNavigationCore.Models;
using static arDev.Narumi;
namespace Project
{
@@ -56,7 +57,21 @@ namespace Project
}
else if (PUB.sm.RunStepSeq == idx++)
{
//모션 전후진 제어
//라이다끄기
var ret = PUB.AGV.AGVMoveSet(new arDev.Narumi.BunkiData
{
Bunki = arDev.Narumi.eBunki.Strate,
Direction = arDev.Narumi.eMoveDir.Backward,
PBSSensor = 0, //라이다를끈다
Speed = arDev.Narumi.eMoveSpd.Low,
});
PUB.log.AddAT("라이다를 끈다, 재시도 코드 필요함");
PUB.sm.UpdateRunStepSeq();
return false;
}
else if (PUB.sm.RunStepSeq == idx++)
{
//턴확인
if (PUB._virtualAGV.Turn != AGVNavigationCore.Models.AGVTurn.L90)
{
//동작중이면 동작을 멈춘다

View File

@@ -7,6 +7,7 @@ using Project.StateMachine;
using COMM;
using AR;
using AGVNavigationCore.Models;
using static arDev.Narumi;
namespace Project
{

View File

@@ -7,6 +7,7 @@ using Project.StateMachine;
using COMM;
using AR;
using AGVNavigationCore.Models;
using static arDev.Narumi;
namespace Project
{

View File

@@ -7,6 +7,7 @@ using Project.StateMachine;
using COMM;
using AR;
using AGVNavigationCore.Models;
using static arDev.Narumi;
namespace Project
{

View File

@@ -59,16 +59,16 @@ namespace Project
}
//대기모드에서는 움직이지 않게 한다
if(PUB.AGV.system1.agv_run)
{
var ts = VAR.TIME.RUN(eVarTime.IdleStopTime);
if(ts.TotalSeconds > 1)
{
PUB.log.Add($"대기상태에서는 정차");
PUB.AGV.AGVMoveStop("대기상태에서는 정차");
VAR.TIME.Update(eVarTime.IdleStopTime);
}
}
//if(PUB.AGV.system1.agv_run)
//{
// var ts = VAR.TIME.RUN(eVarTime.IdleStopTime);
// if(ts.TotalSeconds > 1)
// {
// PUB.log.Add($"대기상태에서는 정차");
// PUB.AGV.AGVMoveStop("대기상태에서는 정차");
// VAR.TIME.Update(eVarTime.IdleStopTime);
// }
//}
return false;

View File

@@ -354,7 +354,7 @@ namespace Project
break;
case ENIGProtocol.AGVCommandHE.LiftControl: //Lift Control
var LiftCommand = (LiftCommand)data[1];
var LiftCommand = ( arDev.Narumi.LiftCommand)data[1];
PUB.log.Add($"[{logPrefix}-LiftControl] {LiftCommand}");
PUB.AGV.LiftControl(LiftCommand); //리프트제어
break;

View File

@@ -9,6 +9,7 @@ using System.Threading.Tasks;
using System.Windows.Forms;
using AGVNavigationCore.Models;
using COMM;
using static arDev.Narumi;
namespace Project.ViewForm
{

View File

@@ -8,6 +8,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static arDev.Narumi;
namespace Project.ViewForm
{

View File

@@ -11,6 +11,7 @@ using AGVNavigationCore.Models;
using AR;
using arDev;
using COMM;
using static arDev.Narumi;
namespace Project.ViewForm
{

View File

@@ -67,7 +67,7 @@ namespace Test_ACS
this.btnGotoAlias = new System.Windows.Forms.Button();
this.btnGoto = new System.Windows.Forms.Button();
this.btnSetCurrent = new System.Windows.Forms.Button();
this.txtAlias = new System.Windows.Forms.TextBox();
this.txtAlias = new System.Windows.Forms.ComboBox();
this.lblAlias = new System.Windows.Forms.Label();
this.txtRFID = new System.Windows.Forms.NumericUpDown();
this.lblRFID = new System.Windows.Forms.Label();
@@ -84,10 +84,14 @@ namespace Test_ACS
this.tabPage1 = new System.Windows.Forms.TabPage();
this.richTextBox1 = new System.Windows.Forms.RichTextBox();
this.grpAGVStatus = new System.Windows.Forms.GroupBox();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.rtStatus = new System.Windows.Forms.TextBox();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.tbErCode = new System.Windows.Forms.TextBox();
this.tbErmsg = new System.Windows.Forms.TextBox();
this.button13 = new System.Windows.Forms.Button();
this.button14 = new System.Windows.Forms.Button();
this.button15 = new System.Windows.Forms.Button();
this.button16 = new System.Windows.Forms.Button();
this.grpConnection.SuspendLayout();
this.grpAGV.SuspendLayout();
this.grpCommands.SuspendLayout();
@@ -218,12 +222,7 @@ namespace Test_ACS
//
// grpCommands
//
this.grpCommands.Controls.Add(this.button11);
this.grpCommands.Controls.Add(this.button12);
this.grpCommands.Controls.Add(this.btnLiftStop);
this.grpCommands.Controls.Add(this.button8);
this.grpCommands.Controls.Add(this.btnLiftDown);
this.grpCommands.Controls.Add(this.btnLiftUp);
this.grpCommands.Controls.Add(this.button10);
this.grpCommands.Controls.Add(this.button7);
this.grpCommands.Controls.Add(this.button9);
@@ -241,14 +240,14 @@ namespace Test_ACS
this.grpCommands.Controls.Add(this.lblRFID);
this.grpCommands.Location = new System.Drawing.Point(12, 98);
this.grpCommands.Name = "grpCommands";
this.grpCommands.Size = new System.Drawing.Size(535, 307);
this.grpCommands.Size = new System.Drawing.Size(433, 307);
this.grpCommands.TabIndex = 2;
this.grpCommands.TabStop = false;
this.grpCommands.Text = "ACS 명령";
//
// button11
//
this.button11.Location = new System.Drawing.Point(431, 198);
this.button11.Location = new System.Drawing.Point(451, 200);
this.button11.Name = "button11";
this.button11.Size = new System.Drawing.Size(100, 43);
this.button11.TabIndex = 18;
@@ -258,7 +257,7 @@ namespace Test_ACS
//
// button12
//
this.button12.Location = new System.Drawing.Point(431, 153);
this.button12.Location = new System.Drawing.Point(451, 155);
this.button12.Name = "button12";
this.button12.Size = new System.Drawing.Size(100, 43);
this.button12.TabIndex = 17;
@@ -268,7 +267,7 @@ namespace Test_ACS
//
// btnLiftStop
//
this.btnLiftStop.Location = new System.Drawing.Point(431, 108);
this.btnLiftStop.Location = new System.Drawing.Point(451, 110);
this.btnLiftStop.Name = "btnLiftStop";
this.btnLiftStop.Size = new System.Drawing.Size(100, 43);
this.btnLiftStop.TabIndex = 2;
@@ -288,7 +287,7 @@ namespace Test_ACS
//
// btnLiftDown
//
this.btnLiftDown.Location = new System.Drawing.Point(431, 63);
this.btnLiftDown.Location = new System.Drawing.Point(451, 65);
this.btnLiftDown.Name = "btnLiftDown";
this.btnLiftDown.Size = new System.Drawing.Size(100, 43);
this.btnLiftDown.TabIndex = 1;
@@ -298,7 +297,7 @@ namespace Test_ACS
//
// btnLiftUp
//
this.btnLiftUp.Location = new System.Drawing.Point(431, 18);
this.btnLiftUp.Location = new System.Drawing.Point(451, 20);
this.btnLiftUp.Name = "btnLiftUp";
this.btnLiftUp.Size = new System.Drawing.Size(100, 43);
this.btnLiftUp.TabIndex = 0;
@@ -656,12 +655,17 @@ namespace Test_ACS
// txtAlias
//
this.txtAlias.Font = new System.Drawing.Font("Consolas", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txtAlias.Items.AddRange(new object[] {
"LOADER",
"UNLOADER",
"CLEANNER",
"CHARGER1",
"CHARGER2"});
this.txtAlias.Location = new System.Drawing.Point(86, 49);
this.txtAlias.Name = "txtAlias";
this.txtAlias.Size = new System.Drawing.Size(101, 26);
this.txtAlias.Size = new System.Drawing.Size(101, 27);
this.txtAlias.TabIndex = 10;
this.txtAlias.Text = "CHARGER1";
this.txtAlias.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
this.txtAlias.TextChanged += new System.EventHandler(this.txtAlias_TextChanged);
//
// lblAlias
@@ -848,11 +852,23 @@ namespace Test_ACS
this.grpAGVStatus.Controls.Add(this.rtStatus);
this.grpAGVStatus.Location = new System.Drawing.Point(12, 409);
this.grpAGVStatus.Name = "grpAGVStatus";
this.grpAGVStatus.Size = new System.Drawing.Size(535, 120);
this.grpAGVStatus.Size = new System.Drawing.Size(426, 120);
this.grpAGVStatus.TabIndex = 4;
this.grpAGVStatus.TabStop = false;
this.grpAGVStatus.Text = "AGV 상태";
//
// rtStatus
//
this.rtStatus.Dock = System.Windows.Forms.DockStyle.Fill;
this.rtStatus.Font = new System.Drawing.Font("Consolas", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.rtStatus.Location = new System.Drawing.Point(3, 17);
this.rtStatus.Multiline = true;
this.rtStatus.Name = "rtStatus";
this.rtStatus.ReadOnly = true;
this.rtStatus.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.rtStatus.Size = new System.Drawing.Size(420, 100);
this.rtStatus.TabIndex = 1;
//
// groupBox3
//
this.groupBox3.Controls.Add(this.tbErCode);
@@ -864,18 +880,6 @@ namespace Test_ACS
this.groupBox3.TabStop = false;
this.groupBox3.Text = "Error 상태";
//
// rtStatus
//
this.rtStatus.Dock = System.Windows.Forms.DockStyle.Fill;
this.rtStatus.Font = new System.Drawing.Font("Consolas", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.rtStatus.Location = new System.Drawing.Point(3, 17);
this.rtStatus.Multiline = true;
this.rtStatus.Name = "rtStatus";
this.rtStatus.ReadOnly = true;
this.rtStatus.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.rtStatus.Size = new System.Drawing.Size(529, 100);
this.rtStatus.TabIndex = 1;
//
// tbErCode
//
this.tbErCode.Location = new System.Drawing.Point(6, 20);
@@ -890,22 +894,72 @@ namespace Test_ACS
this.tbErmsg.Size = new System.Drawing.Size(523, 21);
this.tbErmsg.TabIndex = 2;
//
// button13
//
this.button13.Location = new System.Drawing.Point(447, 476);
this.button13.Name = "button13";
this.button13.Size = new System.Drawing.Size(100, 43);
this.button13.TabIndex = 22;
this.button13.Text = "Exit\r\nPick Off";
this.button13.UseVisualStyleBackColor = true;
this.button13.Click += new System.EventHandler(this.button13_Click);
//
// button14
//
this.button14.Location = new System.Drawing.Point(447, 431);
this.button14.Name = "button14";
this.button14.Size = new System.Drawing.Size(100, 43);
this.button14.TabIndex = 21;
this.button14.Text = "Exit\r\nPick On";
this.button14.UseVisualStyleBackColor = true;
this.button14.Click += new System.EventHandler(this.button14_Click);
//
// button15
//
this.button15.Location = new System.Drawing.Point(447, 386);
this.button15.Name = "button15";
this.button15.Size = new System.Drawing.Size(100, 43);
this.button15.TabIndex = 20;
this.button15.Text = "Enter\r\nPick Off";
this.button15.UseVisualStyleBackColor = true;
this.button15.Click += new System.EventHandler(this.button15_Click);
//
// button16
//
this.button16.Location = new System.Drawing.Point(447, 341);
this.button16.Name = "button16";
this.button16.Size = new System.Drawing.Size(100, 43);
this.button16.TabIndex = 19;
this.button16.Text = "Enter\r\nPick On";
this.button16.UseVisualStyleBackColor = true;
this.button16.Click += new System.EventHandler(this.button16_Click);
//
// MainForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1083, 621);
this.Controls.Add(this.button13);
this.Controls.Add(this.button14);
this.Controls.Add(this.button15);
this.Controls.Add(this.button16);
this.Controls.Add(this.button11);
this.Controls.Add(this.groupBox3);
this.Controls.Add(this.button12);
this.Controls.Add(this.grpAGVStatus);
this.Controls.Add(this.btnLiftStop);
this.Controls.Add(this.grpLogs);
this.Controls.Add(this.grpCommands);
this.Controls.Add(this.btnLiftDown);
this.Controls.Add(this.grpAGV);
this.Controls.Add(this.btnLiftUp);
this.Controls.Add(this.grpConnection);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.Name = "MainForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "ACS 시뮬레이터 - ENIG AGV 테스트";
this.Load += new System.EventHandler(this.MainForm_Load);
this.grpConnection.ResumeLayout(false);
this.grpConnection.PerformLayout();
this.grpAGV.ResumeLayout(false);
@@ -971,7 +1025,7 @@ namespace Test_ACS
private System.Windows.Forms.TextBox txtInfoLog;
private System.Windows.Forms.Button btnRefresh;
private System.Windows.Forms.Button btnGotoAlias;
private System.Windows.Forms.TextBox txtAlias;
private System.Windows.Forms.ComboBox txtAlias;
private System.Windows.Forms.Label lblAlias;
private System.Windows.Forms.GroupBox grpAGVStatus;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
@@ -1011,5 +1065,9 @@ namespace Test_ACS
private System.Windows.Forms.TextBox rtStatus;
private System.Windows.Forms.TextBox tbErCode;
private System.Windows.Forms.TextBox tbErmsg;
private System.Windows.Forms.Button button13;
private System.Windows.Forms.Button button14;
private System.Windows.Forms.Button button15;
private System.Windows.Forms.Button button16;
}
}

View File

@@ -579,5 +579,51 @@ namespace Test_ACS
{
SendLiftCommand(arDev.Narumi.LiftCommand.OFF);
}
private void button16_Click(object sender, EventArgs e)
{
//enter pickon
var targetID = selectedAGV.ToString("X2");
var dataStr = targetID;// + liftCmd.ToString("X2");
SendCommand(AGVCommandHE.PickOnEnter, dataStr);
}
private void button15_Click(object sender, EventArgs e)
{
//enter pickoff
var targetID = selectedAGV.ToString("X2");
SendCommand(AGVCommandHE.PickOffEnter, targetID);
}
private void button14_Click(object sender, EventArgs e)
{
//exit pickon
var targetID = selectedAGV.ToString("X2");
SendCommand(AGVCommandHE.PickOnExit, targetID);
}
private void button13_Click(object sender, EventArgs e)
{
//exit pickoff
var targetID = selectedAGV.ToString("X2");
SendCommand(AGVCommandHE.PickOffExit, targetID);
}
private void MainForm_Load(object sender, EventArgs e)
{
this.txtAlias.Items.AddRange(new[] {
"LOADER",
"UNLOADER",
"CLEANNER",
"CHARGER1",
"CHARGER2",
"BUFFER1",
"BUFFER2",
"BUFFER3",
"BUFFER4",
"BUFFER5",
"BUFFER6",
});
}
}
}