Skip to content

Commit

Permalink
변경 (1.6 -> 1.7)
Browse files Browse the repository at this point in the history
 1. 기능 추가
  - start한 상태일 때 10초마다 상태를 보드로 보냄.
  • Loading branch information
yeonSG committed Apr 26, 2022
1 parent cb11fe3 commit 1d92ddc
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions TubeFeederProject/TubeFeeder/MessageProtocol.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public class MessageProtocol
public const byte CMD_INFORM_ACK = (byte)'A';
public const byte CMD_INFORM_ERROR = (byte)'E';
public const byte CMD_INFORM_SETTING_CLOSE = (byte)'C';
public const byte CMD_INFORM_STARTED = (byte)'D';

// 에러코드
public const Byte ERRORCODE_SOMETHING_WRONG = 0x01;
Expand Down
4 changes: 2 additions & 2 deletions TubeFeederProject/TubeFeeder/TubeFeeder.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions TubeFeederProject/TubeFeeder/TubeFeeder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public partial class Form1 : Form
private bool m_isShowRestart = false;
private bool m_isBarcodeReadMode_On = false; // 바코드 읽기모드 On
private bool m_isAutoStopMode_On = false; // AutoStopMode On
private bool m_isStarted = false;

private SettingValues m_settingValues;

Expand Down Expand Up @@ -346,6 +347,7 @@ private void btn_start_Click(object sender, EventArgs e)
SendSettingValues(m_settingValues); // setting값 보냄

m_ControlBoard.SendMessage(MessageGenerator.Meesage_DeviceStart(m_isBarcodeReadMode_On, m_isAutoStopMode_On));
m_isStarted = true;
setIndicatorColor(Color.Green);
btn_barcodeOnEnable(false);
btn_barcodeOffEnable(false);
Expand All @@ -358,6 +360,7 @@ private void btn_start_Click(object sender, EventArgs e)
private void btn_stop_Click(object sender, EventArgs e)
{
m_ControlBoard.SendMessage(MessageGenerator.Meesage_DeviceStop());
m_isStarted = false;
btn_barcodeOnEnable(true);
btn_barcodeOffEnable(true);
btn_autoStopModeOnEnable(true);
Expand Down Expand Up @@ -693,6 +696,14 @@ private void smartTimer1_Tick(object sender, EventArgs e)
;
}

// 10초마다 start/stop 상태 업데이트신호 보냄.
if (runTime.Seconds % 10 == 0)
{
if (m_isStarted)
{
m_ControlBoard.SendMessage(MessageGenerator.Meesage_Infom(MessageProtocol.CMD_INFORM_STARTED));
}
}

if (m_isShowRestart == true && restartDialog == null)
{
Expand Down

0 comments on commit 1d92ddc

Please sign in to comment.