Skip to content

Commit

Permalink
변경 (1.4 -> 15ver)
Browse files Browse the repository at this point in the history
 1.  용량표시에 % 빠진 것 추가.
 2. error 상태일 때 소리 변경( 3초 중 2초만 삑)
 3. Restart버튼 누르는 것을 컴퓨터가 보낸 메시지로도 동작할 수 있도록 기능 추가.
  • Loading branch information
yeonSG committed Dec 10, 2021
1 parent a382fbf commit 45ca95f
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 8 deletions.
2 changes: 1 addition & 1 deletion TubeFeederProject/TubeFeeder/MemoryManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public string getUsageString()
m_memoryUsePercent = System.Math.Round(use_Kb * 100.0 / totla_Kb, 1);

return use_Mb.ToString() + "/" + total_Mb.ToString()
+ "Mb (" + m_memoryUsePercent.ToString() + ")";
+ "Mb (" + m_memoryUsePercent.ToString() + "%)";
}

public double getMemoryUseagePercent()
Expand Down
2 changes: 2 additions & 0 deletions TubeFeederProject/TubeFeeder/MessageProtocol.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public class MessageProtocol
public const byte CMD_ORDER_START = (byte)'S';
public const byte CMD_ORDER_STOP = (byte)'T';
public const byte CMD_ORDER_RESTART = (byte)'R';
public const byte CMD_ORDER_RESTARTCLICK = (byte)'R';
public const byte CMD_ORDER_ERROR = (byte)'E';

public const byte CMD_ORDER_START_BARCODE_ON = 0xF0;
Expand Down Expand Up @@ -71,6 +72,7 @@ public enum ReciveMessage
order_Start,
order_Stop,
order_Error,
order_RestartClick,
inform_Ack,
inform_Scanned,
inform_Error,
Expand Down
3 changes: 3 additions & 0 deletions TubeFeederProject/TubeFeeder/MessageReciver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ public MessageProtocol.ReciveMessage messageProcessing()
case MessageProtocol.CMD_ORDER_ERROR:
LogFunction("Recived : Order_Error");
return MessageProtocol.ReciveMessage.order_Error;
case MessageProtocol.CMD_ORDER_RESTARTCLICK:
LogFunction("Recived : Order_RestartClick");
return MessageProtocol.ReciveMessage.order_RestartClick;
}

}
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.

27 changes: 22 additions & 5 deletions TubeFeederProject/TubeFeeder/TubeFeeder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ public partial class Form1 : Form

private SettingValues m_settingValues;

RestartDialogForm restartDialog;

private Queue<byte> reciveQueue = new Queue<byte>();

public Form1()
Expand Down Expand Up @@ -528,6 +530,9 @@ public void msgRecive(MessageProtocol.ReciveMessage reciveMsg)
m_isOnError = true;
showRestartDialog(); // ysys
break;
case MessageProtocol.ReciveMessage.order_RestartClick:
closeRestartDialog();
break;
default:
break;

Expand All @@ -536,10 +541,10 @@ public void msgRecive(MessageProtocol.ReciveMessage reciveMsg)

public void showRestartDialog()
{
RestartDialogForm restartDialog = new RestartDialogForm();
DialogResult dr = restartDialog.ShowDialog();
restartDialog = new RestartDialogForm();
DialogResult result = restartDialog.ShowDialog();

if (dr == DialogResult.OK)
if (result == DialogResult.OK)
{
m_ControlBoard.SendMessage(MessageGenerator.Meesage_DeviceReStart());
setIndicatorColor(Color.Green);
Expand All @@ -552,6 +557,15 @@ public void showRestartDialog()
}
}

public void closeRestartDialog()
{
if (restartDialog != null)
{
restartDialog.DialogResult = DialogResult.OK;
restartDialog.Close();
}
}

public void btnStart_buttonUp()
{
if (this.btn_start.InvokeRequired)
Expand Down Expand Up @@ -636,7 +650,10 @@ private void smartTimer1_Tick(object sender, EventArgs e)

if(m_isOnError==true)
{
MessageBeep(64);
if ((runTime.Seconds/3) != 0) // 3초 중 2초 소리냄 ( 삑-삑-X ... )
{
MessageBeep(48);
}
if (label_indicator.BackColor == Color.Red) // 1초간격 점멸
{
setIndicatorColor(Color.Black);
Expand All @@ -662,7 +679,7 @@ private void smartTimer1_Tick(object sender, EventArgs e)

try
{
if (runTime.Seconds == 0)
if (runTime.Seconds == 10) // x분 10초마다 메모리 상태 업데이트
{
setMemoryLabelText(m_memoryManger.getUsageString());
}
Expand Down

0 comments on commit 45ca95f

Please sign in to comment.