flag,error 항목 정리,

This commit is contained in:
ChiKyun Kim
2025-12-17 15:53:18 +09:00
parent 1f37871336
commit cef2fa8095
11 changed files with 249 additions and 171 deletions

View File

@@ -240,17 +240,17 @@ namespace Project.Device
data[5] = (byte)((VAR.BOOL[eVarBool.FLAG_CHARGEONA] || VAR.BOOL[eVarBool.FLAG_CHARGEONM]) ? 1 : 0);
// CartSt
if (PUB.AGV.signal.cart_detect1 && PUB.AGV.signal.cart_detect2)
if (PUB.AGV.signal2.cart_detect1 && PUB.AGV.signal2.cart_detect2)
data[6] = 1; // 센서두개가 모두 감지되는 경우
else if (PUB.AGV.signal.cart_detect1 == false && PUB.AGV.signal.cart_detect2 == false)
else if (PUB.AGV.signal2.cart_detect1 == false && PUB.AGV.signal2.cart_detect2 == false)
data[6] = 0; // 센서두개가 모두 감지되지 않는 경우
else
data[6] = 2; // 센서하나만 감지되는 경우
// LiftSt
if (PUB.AGV.signal.lift_up)
if (PUB.AGV.signal1.lift_up)
data[7] = 1; // 위로 올라가는 경우
else if (PUB.AGV.signal.lift_down)
else if (PUB.AGV.signal1.lift_down)
data[7] = 0; // 아래로 내려가는 경우
else
data[7] = 2; // unknown (기본값)

View File

@@ -53,7 +53,7 @@ namespace Project
var agv_chg = PUB.AGV.system1.Battery_charging;
var agv_stp = PUB.AGV.system1.agv_stop;
var agv_run = PUB.AGV.system1.agv_run;
var agv_mrk = PUB.AGV.signal.mark_sensor;
var agv_mrk = PUB.AGV.signal1.mark_sensor;
//if (chg_run && PUB.AGV.system1.agv_run) PUB.Speak("이동을 시작 합니다");
@@ -129,10 +129,10 @@ namespace Project
}
//마크센서 상태가 변경이 되었다면
if (VAR.BOOL[eVarBool.MARK_SENSOR] != PUB.AGV.signal.mark_sensor)
if (VAR.BOOL[eVarBool.MARK_SENSOR] != PUB.AGV.signal1.mark_sensor)
{
PUB.logagv.Add($"MARK_SENSOR 변경({PUB.AGV.signal.mark_sensor})");
VAR.BOOL[eVarBool.MARK_SENSOR] = PUB.AGV.signal.mark_sensor;
PUB.logagv.Add($"MARK_SENSOR 변경({PUB.AGV.signal1.mark_sensor})");
VAR.BOOL[eVarBool.MARK_SENSOR] = PUB.AGV.signal1.mark_sensor;
//AGV가 멈췄고 마크센서가 ON되었다면 마지막 RFID 위치가 확정된경우이다
if (agv_stp && VAR.BOOL[eVarBool.MARK_SENSOR])

View File

@@ -649,7 +649,7 @@ namespace Project
stMsg = Lang.;
//else if (PUB.PLC.GetValueI(arDev.FakePLC.DIName.PINI_EMG))
// stMsg = Lang.비상정지신호가감지되었습니다;
else if (PUB.AGV.signal.front_gate_out == true)
else if (PUB.AGV.signal1.front_gate_out == true)
stMsg = Lang.;
else if (PUB.AGV.error.runerror_by_no_magent_line)
stMsg = "마그네틱 라인을 벗어났습니다";

View File

@@ -30,17 +30,18 @@
{
this.components = new System.ComponentModel.Container();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.richTextBox1 = new System.Windows.Forms.RichTextBox();
this.richTextBox2 = new System.Windows.Forms.RichTextBox();
this.richTextBox3 = new System.Windows.Forms.RichTextBox();
this.richTextBox4 = new System.Windows.Forms.RichTextBox();
this.rtSystem0 = new System.Windows.Forms.RichTextBox();
this.rtSystem1 = new System.Windows.Forms.RichTextBox();
this.rtSignal1 = new System.Windows.Forms.RichTextBox();
this.rtError = new System.Windows.Forms.RichTextBox();
this.label1 = new System.Windows.Forms.Label();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.panel1 = new System.Windows.Forms.Panel();
this.lbIP = new System.Windows.Forms.Label();
this.button7 = new System.Windows.Forms.Button();
this.button6 = new System.Windows.Forms.Button();
this.button5 = new System.Windows.Forms.Button();
this.button17 = new System.Windows.Forms.Button();
this.lbIP = new System.Windows.Forms.Label();
this.button3 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.button1 = new System.Windows.Forms.Button();
@@ -56,7 +57,8 @@
this.button13 = new System.Windows.Forms.Button();
this.button10 = new System.Windows.Forms.Button();
this.button16 = new System.Windows.Forms.Button();
this.button17 = new System.Windows.Forms.Button();
this.rtData = new System.Windows.Forms.RichTextBox();
this.rtSignal2 = new System.Windows.Forms.RichTextBox();
this.tableLayoutPanel1.SuspendLayout();
this.panel1.SuspendLayout();
this.panel2.SuspendLayout();
@@ -69,11 +71,13 @@
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F));
this.tableLayoutPanel1.Controls.Add(this.richTextBox1, 0, 0);
this.tableLayoutPanel1.Controls.Add(this.richTextBox2, 1, 0);
this.tableLayoutPanel1.Controls.Add(this.richTextBox3, 2, 0);
this.tableLayoutPanel1.Controls.Add(this.richTextBox4, 3, 0);
this.tableLayoutPanel1.Controls.Add(this.rtSignal2, 2, 1);
this.tableLayoutPanel1.Controls.Add(this.rtSystem0, 0, 0);
this.tableLayoutPanel1.Controls.Add(this.rtSystem1, 1, 0);
this.tableLayoutPanel1.Controls.Add(this.rtSignal1, 2, 0);
this.tableLayoutPanel1.Controls.Add(this.rtError, 3, 0);
this.tableLayoutPanel1.Controls.Add(this.label1, 0, 2);
this.tableLayoutPanel1.Controls.Add(this.rtData, 3, 1);
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel1.Location = new System.Drawing.Point(3, 3);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
@@ -84,45 +88,47 @@
this.tableLayoutPanel1.Size = new System.Drawing.Size(1050, 461);
this.tableLayoutPanel1.TabIndex = 6;
//
// richTextBox1
// rtSystem0
//
this.richTextBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.richTextBox1.Location = new System.Drawing.Point(3, 3);
this.richTextBox1.Name = "richTextBox1";
this.tableLayoutPanel1.SetRowSpan(this.richTextBox1, 2);
this.richTextBox1.Size = new System.Drawing.Size(256, 404);
this.richTextBox1.TabIndex = 1;
this.richTextBox1.Text = "";
this.rtSystem0.Dock = System.Windows.Forms.DockStyle.Fill;
this.rtSystem0.Font = new System.Drawing.Font("Calibri", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(2)));
this.rtSystem0.Location = new System.Drawing.Point(3, 3);
this.rtSystem0.Name = "rtSystem0";
this.tableLayoutPanel1.SetRowSpan(this.rtSystem0, 2);
this.rtSystem0.Size = new System.Drawing.Size(256, 404);
this.rtSystem0.TabIndex = 1;
this.rtSystem0.Text = "test2\ntest3\nteat\nasdfjalsdf\nasdjfklasdfj\nkalsdjfalksdjfa\nsdjfklasdjfklasjdf\n";
//
// richTextBox2
// rtSystem1
//
this.richTextBox2.Dock = System.Windows.Forms.DockStyle.Fill;
this.richTextBox2.Location = new System.Drawing.Point(265, 3);
this.richTextBox2.Name = "richTextBox2";
this.tableLayoutPanel1.SetRowSpan(this.richTextBox2, 2);
this.richTextBox2.Size = new System.Drawing.Size(256, 404);
this.richTextBox2.TabIndex = 1;
this.richTextBox2.Text = "";
this.rtSystem1.Dock = System.Windows.Forms.DockStyle.Fill;
this.rtSystem1.Font = new System.Drawing.Font("Calibri", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(2)));
this.rtSystem1.Location = new System.Drawing.Point(265, 3);
this.rtSystem1.Name = "rtSystem1";
this.tableLayoutPanel1.SetRowSpan(this.rtSystem1, 2);
this.rtSystem1.Size = new System.Drawing.Size(256, 404);
this.rtSystem1.TabIndex = 1;
this.rtSystem1.Text = "test2\ntest3\nteat\nasdfjalsdf\nasdjfklasdfj\nkalsdjfalksdjfa\nsdjfklasdjfklasjdf\n";
//
// richTextBox3
// rtSignal1
//
this.richTextBox3.Dock = System.Windows.Forms.DockStyle.Fill;
this.richTextBox3.Location = new System.Drawing.Point(527, 3);
this.richTextBox3.Name = "richTextBox3";
this.tableLayoutPanel1.SetRowSpan(this.richTextBox3, 2);
this.richTextBox3.Size = new System.Drawing.Size(256, 404);
this.richTextBox3.TabIndex = 1;
this.richTextBox3.Text = "";
this.rtSignal1.Dock = System.Windows.Forms.DockStyle.Fill;
this.rtSignal1.Font = new System.Drawing.Font("Calibri", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(2)));
this.rtSignal1.Location = new System.Drawing.Point(527, 3);
this.rtSignal1.Name = "rtSignal1";
this.rtSignal1.Size = new System.Drawing.Size(256, 199);
this.rtSignal1.TabIndex = 1;
this.rtSignal1.Text = "test2\ntest3\nteat\nasdfjalsdf\nasdjfklasdfj\nkalsdjfalksdjfa\nsdjfklasdjfklasjdf\n";
//
// richTextBox4
// rtError
//
this.richTextBox4.Dock = System.Windows.Forms.DockStyle.Fill;
this.richTextBox4.Location = new System.Drawing.Point(789, 3);
this.richTextBox4.Name = "richTextBox4";
this.tableLayoutPanel1.SetRowSpan(this.richTextBox4, 2);
this.richTextBox4.Size = new System.Drawing.Size(258, 404);
this.richTextBox4.TabIndex = 1;
this.richTextBox4.Text = "";
this.rtError.Dock = System.Windows.Forms.DockStyle.Fill;
this.rtError.Font = new System.Drawing.Font("Calibri", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(2)));
this.rtError.Location = new System.Drawing.Point(789, 3);
this.rtError.Name = "rtError";
this.rtError.Size = new System.Drawing.Size(258, 199);
this.rtError.TabIndex = 1;
this.rtError.Text = "test2\ntest3\nteat\nasdfjalsdf\nasdjfklasdfj\nkalsdjfalksdjfa\nsdjfklasdjfklasjdf\n";
//
// label1
//
@@ -159,18 +165,6 @@
this.panel1.Size = new System.Drawing.Size(1050, 58);
this.panel1.TabIndex = 7;
//
// lbIP
//
this.lbIP.Dock = System.Windows.Forms.DockStyle.Fill;
this.lbIP.Font = new System.Drawing.Font("Tahoma", 20F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
this.lbIP.ForeColor = System.Drawing.Color.White;
this.lbIP.Location = new System.Drawing.Point(252, 0);
this.lbIP.Name = "lbIP";
this.lbIP.Size = new System.Drawing.Size(638, 58);
this.lbIP.TabIndex = 8;
this.lbIP.Text = "000.000.000.000";
this.lbIP.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// button7
//
this.button7.Dock = System.Windows.Forms.DockStyle.Right;
@@ -204,6 +198,29 @@
this.button5.UseVisualStyleBackColor = true;
this.button5.Click += new System.EventHandler(this.button5_Click);
//
// button17
//
this.button17.Dock = System.Windows.Forms.DockStyle.Right;
this.button17.Location = new System.Drawing.Point(810, 0);
this.button17.Name = "button17";
this.button17.Size = new System.Drawing.Size(80, 58);
this.button17.TabIndex = 9;
this.button17.Text = "Run(Bwd)";
this.button17.UseVisualStyleBackColor = true;
this.button17.Click += new System.EventHandler(this.button17_Click);
//
// lbIP
//
this.lbIP.Dock = System.Windows.Forms.DockStyle.Fill;
this.lbIP.Font = new System.Drawing.Font("Tahoma", 20F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
this.lbIP.ForeColor = System.Drawing.Color.White;
this.lbIP.Location = new System.Drawing.Point(252, 0);
this.lbIP.Name = "lbIP";
this.lbIP.Size = new System.Drawing.Size(638, 58);
this.lbIP.TabIndex = 8;
this.lbIP.Text = "000.000.000.000";
this.lbIP.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// button3
//
this.button3.Dock = System.Windows.Forms.DockStyle.Left;
@@ -376,16 +393,25 @@
this.button16.UseVisualStyleBackColor = true;
this.button16.Click += new System.EventHandler(this.button16_Click);
//
// button17
// rtData
//
this.button17.Dock = System.Windows.Forms.DockStyle.Right;
this.button17.Location = new System.Drawing.Point(810, 0);
this.button17.Name = "button17";
this.button17.Size = new System.Drawing.Size(80, 58);
this.button17.TabIndex = 9;
this.button17.Text = "Run(Bwd)";
this.button17.UseVisualStyleBackColor = true;
this.button17.Click += new System.EventHandler(this.button17_Click);
this.rtData.Dock = System.Windows.Forms.DockStyle.Fill;
this.rtData.Font = new System.Drawing.Font("Calibri", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(2)));
this.rtData.Location = new System.Drawing.Point(789, 208);
this.rtData.Name = "rtData";
this.rtData.Size = new System.Drawing.Size(258, 199);
this.rtData.TabIndex = 3;
this.rtData.Text = "test2\ntest3\nteat\nasdfjalsdf\nasdjfklasdfj\nkalsdjfalksdjfa\nsdjfklasdjfklasjdf\n";
//
// rtSignal2
//
this.rtSignal2.Dock = System.Windows.Forms.DockStyle.Fill;
this.rtSignal2.Font = new System.Drawing.Font("Calibri", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(2)));
this.rtSignal2.Location = new System.Drawing.Point(527, 208);
this.rtSignal2.Name = "rtSignal2";
this.rtSignal2.Size = new System.Drawing.Size(256, 199);
this.rtSignal2.TabIndex = 4;
this.rtSignal2.Text = "test2\ntest3\nteat\nasdfjalsdf\nasdjfklasdfj\nkalsdjfalksdjfa\nsdjfklasdjfklasjdf\n";
//
// fAgv
//
@@ -412,10 +438,10 @@
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
private System.Windows.Forms.Timer timer1;
private System.Windows.Forms.RichTextBox richTextBox1;
private System.Windows.Forms.RichTextBox richTextBox2;
private System.Windows.Forms.RichTextBox richTextBox3;
private System.Windows.Forms.RichTextBox richTextBox4;
private System.Windows.Forms.RichTextBox rtSystem0;
private System.Windows.Forms.RichTextBox rtSystem1;
private System.Windows.Forms.RichTextBox rtSignal1;
private System.Windows.Forms.RichTextBox rtError;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
@@ -438,5 +464,7 @@
private System.Windows.Forms.Button button13;
private System.Windows.Forms.Label lbPortName;
private System.Windows.Forms.Button button17;
private System.Windows.Forms.RichTextBox rtData;
private System.Windows.Forms.RichTextBox rtSignal2;
}
}

View File

@@ -38,10 +38,12 @@ namespace Project.ViewForm
lbIP.Text = PUB.IP;
label1.Text = PUB.AGV.LastSTS;
richTextBox1.Rtf = PUB.AGV.system0.ToRtfString();
richTextBox2.Rtf = PUB.AGV.system1.ToRtfString();
richTextBox3.Rtf = CombineRtfStrings(PUB.AGV.signal.ToRtfString(), PUB.AGV.data.ToRtfString());
richTextBox4.Rtf = PUB.AGV.error.ToRtfString();
rtSystem0.Rtf = PUB.AGV.system0.ToRtfString();
rtSystem1.Rtf = PUB.AGV.system1.ToRtfString();
rtSignal1.Rtf = PUB.AGV.signal1.ToRtfString();
rtSignal2.Rtf = PUB.AGV.signal2.ToRtfString();
rtData.Rtf = PUB.AGV.data.ToRtfString();
rtError.Rtf = PUB.AGV.error.ToRtfString();
lbPortName.Text = $"AGV:{PUB.setting.Port_AGV}\nBMS:{PUB.setting.Port_BAT}";
timer1.Start();
}

View File

@@ -234,8 +234,8 @@ namespace Project.ViewForm
//마크정보
guideSensor1.SensorValue = PUB.AGV.data.guidesensor;
guideSensor1.LMark = PUB.AGV.signal.mark_sensor_1;
guideSensor1.RMark = PUB.AGV.signal.mark_sensor_2;
guideSensor1.LMark = PUB.AGV.signal1.mark_sensor_1;
guideSensor1.RMark = PUB.AGV.signal1.mark_sensor_2;
guideSensor1.Invalidate();
if (PUB.AGV.system1.agv_run || PUB.AGV.system1.agv_run_manual)

View File

@@ -8,6 +8,7 @@ using System.Threading.Tasks;
using System.Collections;
using COMM;
using AR;
using System.Xml;
namespace arDev
{
@@ -220,7 +221,8 @@ namespace arDev
public SystemFlag1 system1 = new SystemFlag1();
public ErrorFlag error = new ErrorFlag();
public AgvData data = new AgvData();
public Signal signal = new Signal();
public Signal1 signal1 = new Signal1();
public Signal2 signal2 = new Signal2();
#region [] STS(AGV상태정보)
public string LastSTS { get; set; } = string.Empty;
@@ -263,42 +265,11 @@ namespace arDev
data.guidesensor = int.Parse(rcvdNow.Substring(idx, 1)); idx += 1; //가이드 좌측부터 1~9
nDataTemp = Convert.ToByte(rcvdNow.Substring(idx, 2), 16);
signal.SetValue(nDataTemp);
signal1.SetValue(nDataTemp); idx += 2;
//data.Sts = encoding.GetString(bRcvData, 19, 3); //20210311 김정만 - SmartX FrameWork 사용 안함으로 주석처리
//nDataTemp = Convert.ToByte(rcvdNow.Substring(idx, 2), 16);
//signal2.SetValue(nDataTemp);
//var Sts_cSpeed = encoding.GetString(bRcvData, 19, 1)[0];
//var Sts_cDirection = encoding.GetString(bRcvData, 20, 1)[0];
//var Sts_cFB = encoding.GetString(bRcvData, 21, 1)[0];
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////가이드센서 정보 (22)//////////////////////////////////////////////////////////////////////////////////////////////////////////
//var Sts_nGuide = 0;
//if (bRcvData[22] > 47 && bRcvData[22] < 58) { Sts_nGuide = Convert.ToInt32(encoding.GetString(bRcvData, 22, 1)); }
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////마크센서 & 포토센서 정보 (23~24)////////////////////////////////////////////////////////////////////////////////////////////////////
//nDataTemp = Convert.ToInt32(encoding.GetString(bRcvData, 23, 2), 16);
//data.Sts_bMark1 = Convert.ToBoolean(nDataTemp & 0x4);
//data.Sts_bMark2 = Convert.ToBoolean(nDataTemp & 0x8);
//data.Sts_bCargo = Convert.ToBoolean(nDataTemp & 0x10);
////포토센서
//if (Sts_cFB == 'F')
//{
// system.Sts_nSenser = Convert.ToInt32(encoding.GetString(bRcvData, 26, 1));
//}
//else if (Sts_cFB == 'B')
//{
// system.Sts_nSenser = Convert.ToInt32(encoding.GetString(bRcvData, 27, 1));
//}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//AGV 속도/분기/방향 (19~21)//////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
DataReceive?.Invoke(this, new DataEventArgs(DataType.STS));
}

View File

@@ -24,20 +24,26 @@ namespace arDev
Charger_pos_error,
line_out_error = 4,
spare_5 ,
spare_6 ,
spare_7 ,
spare_8 ,
spare_9 ,
/// <summary>
/// 기동시 자석 감지 에러
/// </summary>
runerror_by_no_magent_line,
runerror_by_no_magent_line=5,
/// <summary>
/// 호출제어기 통신 오류
/// </summary>
controller_comm_error = 11,
controller_comm_error =6,
/// <summary>
/// 배터리 저전압
/// </summary>
battery_low_voltage=7,
spare08=8,
lift_timeout=9,
lift_driver_overcurrent=10,
lift_driver_emergency = 11,
/// <summary>
/// 도착경보기 통신 오류
/// </summary>

View File

@@ -4,10 +4,27 @@ namespace arDev
{
public partial class Narumi
{
public class Signal
public enum eSignal1
{
private COMM.Flag _value { get; set; } = new COMM.Flag(16);
front_gate_out = 0,
rear_gte_out,
mark_sensor_1,
mark_sensor_2,
lift_down_sensor,
lift_up_sensor,
magnet_relay,
charger_align_sensor,
}
public enum eSignal2
{
cart_detect1 = 0,
cart_detect2,
}
public class Signal1
{
private COMM.Flag _value { get; set; } = new COMM.Flag(8);
public void SetValue(Int16 value) { this._value.writeValue(value); }
public UInt16 Value
{
@@ -16,60 +33,37 @@ namespace arDev
return (UInt16)_value.Value;
}
}
public enum eflag
{
front_gate_out = 0,
rear_gte_out,
mark_sensor_1,
mark_sensor_2,
front_left_sensor,
front_right_sensor,
front_center_sensor,
charger_align_sensor,
lift_down,
lift_up,
magnet_on,
ChargetSensor,
cart_detect1,
cart_detect2,
Spare1,
Spare2
}
public bool GetValue(eflag idx)
public bool GetValue(eSignal1 idx)
{
return _value.Get((int)idx);
}
public bool GetChanged(eflag idx)
public bool GetChanged(eSignal1 idx)
{
return _value.GetChanged((int)idx);
}
public Boolean front_gate_out { get { return GetValue(eflag.front_gate_out); } }
public Boolean rear_sensor_out { get { return GetValue(eflag.rear_gte_out); } }
public Boolean mark_sensor_1 { get { return GetValue(eflag.mark_sensor_1); } }
public Boolean mark_sensor_2 { get { return GetValue(eflag.mark_sensor_2); } }
public Boolean front_gate_out { get { return GetValue(eSignal1.front_gate_out); } }
public Boolean rear_sensor_out { get { return GetValue(eSignal1.rear_gte_out); } }
public Boolean mark_sensor_1 { get { return GetValue(eSignal1.mark_sensor_1); } }
public Boolean mark_sensor_2 { get { return GetValue(eSignal1.mark_sensor_2); } }
public Boolean mark_sensor { get { return mark_sensor_1 || mark_sensor_2; } }
public Boolean front_left_sensor { get { return GetValue(eflag.front_left_sensor); } }
public Boolean front_right_sensor { get { return GetValue(eflag.front_right_sensor); } }
public Boolean front_center_sensor { get { return GetValue(eflag.front_center_sensor); } }
public Boolean charger_align_sensor { get { return GetValue(eflag.charger_align_sensor); } }
public Boolean lift_up { get { return GetValue(eflag.lift_up); } }
public Boolean lift_down { get { return GetValue(eflag.lift_down); } }
public Boolean magnet_on { get { return GetValue(eflag.magnet_on); } }
public Boolean cart_detect1 { get { return GetValue(eflag.cart_detect1); } }
public Boolean cart_detect2 { get { return GetValue(eflag.cart_detect2); } }
public Boolean charger_align_sensor { get { return GetValue(eSignal1.charger_align_sensor); } }
public Boolean lift_up { get { return GetValue(eSignal1.lift_up_sensor); } }
public Boolean lift_down { get { return GetValue(eSignal1.lift_down_sensor); } }
public Boolean magnet_on { get { return GetValue(eSignal1.magnet_relay); } }
public override string ToString()
{
//모든사태값을 탭으로 구분하여 문자를 생성한다
var sb = new System.Text.StringBuilder();
for (int i = 0; i < 16; i++)
{
var def = Enum.IsDefined(typeof(eflag), i);
var def = Enum.IsDefined(typeof(eSignal1), i);
if (def)
{
var flag = (eflag)i;
var flag = (eSignal1)i;
var value = _value.Get(i);
sb.AppendLine($"[{i:00}][{flag}] : {value}");
}
@@ -86,10 +80,87 @@ namespace arDev
for (int i = 0; i < 16; i++)
{
var def = Enum.IsDefined(typeof(eflag), i);
var def = Enum.IsDefined(typeof(eSignal1), i);
if (def)
{
var flag = (eflag)i;
var flag = (eSignal1)i;
var value = _value.Get(i);
string line = $"[{i:00}][{flag}] : {value}";
// : true가 포함된 줄은 파란색
if (value == true)
{
sb.AppendLine(@"\cf1 " + line + @"\cf0\line");
}
else
{
sb.AppendLine(line + @"\line");
}
}
}
sb.AppendLine("}");
return sb.ToString();
}
}
public class Signal2
{
private COMM.Flag _value { get; set; } = new COMM.Flag(8);
public void SetValue(Int16 value) { this._value.writeValue(value); }
public UInt16 Value
{
get
{
return (UInt16)_value.Value;
}
}
public bool GetValue(eSignal2 idx)
{
return _value.Get((int)idx);
}
public bool GetChanged(eSignal2 idx)
{
return _value.GetChanged((int)idx);
}
public Boolean cart_detect1 { get { return GetValue(eSignal2.cart_detect1); } }
public Boolean cart_detect2 { get { return GetValue(eSignal2.cart_detect2); } }
public override string ToString()
{
//모든사태값을 탭으로 구분하여 문자를 생성한다
var sb = new System.Text.StringBuilder();
for (int i = 0; i < 16; i++)
{
var def = Enum.IsDefined(typeof(eSignal2), i);
if(def)
{
var flag = (eSignal2)i;
var value = _value.Get(i);
sb.AppendLine($"[{i:00}][{flag}] : {value}");
}
}
return sb.ToString();
}
public string ToRtfString()
{
var sb = new System.Text.StringBuilder();
sb.AppendLine(@"{\rtf1\ansi\deff0");
sb.AppendLine(@"{\colortbl ;\red0\green0\blue255;}"); // Color 1 = Blue
for (int i = 0; i < 16; i++)
{
var def = Enum.IsDefined(typeof(eSignal2), i);
if (def)
{
var flag = (eSignal2)i;
var value = _value.Get(i);
string line = $"[{i:00}][{flag}] : {value}";

Submodule Cs_HMI/SubProject/CommUtil updated: ed05439991...632b087c5b

Submodule Cs_HMI/SubProject/EnigProtocol updated: 283910459e...14ff055fa9