..
This commit is contained in:
@@ -23,7 +23,7 @@ namespace Test_ACS
|
||||
LoadPortList();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private void InitializeProtocol()
|
||||
{
|
||||
@@ -61,6 +61,14 @@ namespace Test_ACS
|
||||
case AGVCommandEH.Status:
|
||||
UpdateAGVStatus(e.ReceivedPacket.Data);
|
||||
break;
|
||||
case AGVCommandEH.Error:
|
||||
var errorcode = (AGVErrorCode)e.ReceivedPacket.Data[0];
|
||||
var errorMessage = System.Text.Encoding.UTF8.GetString(e.ReceivedPacket.Data, 1, e.ReceivedPacket.Data.Length - 1);
|
||||
AddLog($"Error Received : {errorcode} ID:{e.ReceivedPacket.ID} MSG:{errorMessage}", LogType.Info);
|
||||
break;
|
||||
default:
|
||||
AddLog($"unknown command:{command}", LogType.Error);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -153,6 +161,7 @@ namespace Test_ACS
|
||||
serialPort.Close();
|
||||
btnConnect.Text = "연결";
|
||||
AddLog("포트 닫힘", LogType.Info);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -163,6 +172,7 @@ namespace Test_ACS
|
||||
serialPort.Open();
|
||||
btnConnect.Text = "해제";
|
||||
AddLog($"{serialPort.PortName}:{serialPort.BaudRate} 연결됨", LogType.Info);
|
||||
SaveSettings();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -178,22 +188,22 @@ namespace Test_ACS
|
||||
|
||||
private void cmbPort_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
SaveSettings();
|
||||
//SaveSettings();
|
||||
}
|
||||
|
||||
private void txtBaudRate_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
SaveSettings();
|
||||
//SaveSettings();
|
||||
}
|
||||
|
||||
private void txtRFID_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
SaveSettings();
|
||||
//SaveSettings();
|
||||
}
|
||||
|
||||
private void txtAlias_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
SaveSettings();
|
||||
//SaveSettings();
|
||||
}
|
||||
|
||||
private void rbAGV1_CheckedChanged(object sender, EventArgs e)
|
||||
@@ -201,7 +211,7 @@ namespace Test_ACS
|
||||
if (rbAGV1.Checked)
|
||||
{
|
||||
selectedAGV = 11;
|
||||
SaveSettings();
|
||||
//SaveSettings();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -210,7 +220,7 @@ namespace Test_ACS
|
||||
if (rbAGV2.Checked)
|
||||
{
|
||||
selectedAGV = 12;
|
||||
SaveSettings();
|
||||
//SaveSettings();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -250,6 +260,7 @@ namespace Test_ACS
|
||||
var aliasHex = string.Join("", aliasBytes.Select(b => b.ToString("X2")));
|
||||
var dataStr = targetID + aliasHex;
|
||||
SendCommand(AGVCommandHE.GotoAlias, dataStr);
|
||||
SaveSettings();
|
||||
}
|
||||
|
||||
private void btnStop_Click(object sender, EventArgs e)
|
||||
@@ -524,9 +535,6 @@ namespace Test_ACS
|
||||
|
||||
protected override void OnFormClosing(FormClosingEventArgs e)
|
||||
{
|
||||
// 설정 저장
|
||||
SaveSettings();
|
||||
|
||||
if (serialPort != null && serialPort.IsOpen)
|
||||
{
|
||||
serialPort.Close();
|
||||
|
||||
Reference in New Issue
Block a user