- Client 시나리오 정리 완료

main V8.19.1
DESKTOP-999R8N3\CJY 2023-12-28 15:24:51 +09:00
parent dec7152427
commit ea2021197a
16 changed files with 110 additions and 106 deletions

Binary file not shown.

View File

@ -628,8 +628,15 @@ namespace ITC81DB.Controls
#region Printer
sb.Append("0001");
sb.Append(" Pass");
sb.Append(" " + Helper.StringToDecimalPlaces("1234", this.ParentForm.ParentForm.SystemConfig1.DecimalPlaces));
sb.Append(this.ParentForm.ParentForm.PadLeft(9, Helper.DoubleToString
(this.ParentForm.ParentForm.CurrentWeightData.Weight, this.ParentForm.ParentForm.SystemConfig1.DecimalPlaces)));
sb.Append(" ");
sb.Append("1234567890");
//sb.Append(Helper.StringZeroFillDigits4(this.ParentForm.ParentForm.CurrentProductItem.Number.ToString()));
//sb.Append(" Empty");
//sb.Append(this.ParentForm.ParentForm.PadLeft(10, Helper.DoubleToString
// (this.ParentForm.ParentForm.CurrentWeightData.Weight, this.ParentForm.ParentForm.SystemConfig1.DecimalPlaces)));
//sb.Append("Balance".PadLeft(10, ' '));
#endregion
break;
case 4:

View File

@ -886,7 +886,9 @@ namespace ITC81DB.Controls
#region Printer
sb.Append("0001");
sb.Append(" Pass");
sb.Append(" " + Helper.StringToDecimalPlaces("1234", this.ParentForm.ParentForm.SystemConfig1.DecimalPlaces));
sb.Append(this.ParentForm.ParentForm.PadLeft(9, Helper.DoubleToString
(this.ParentForm.ParentForm.CurrentWeightData.Weight, this.ParentForm.ParentForm.SystemConfig1.DecimalPlaces)));
sb.Append(" ");
sb.Append("1234567890");
#endregion
break;

View File

@ -79,20 +79,16 @@ namespace ITC81DB.Controls
private void buttonConnect_Click(object sender, EventArgs e)
{
// 이더넷
if (this.ParentForm.ParentForm.SystemConfig2.EthernetOperationMode == 2)
{
this.ParentForm.ParentForm.EthernetClientConnect();
}
}
private void buttonDisconnect_Click(object sender, EventArgs e)
{
// 이더넷
if (this.ParentForm.ParentForm.SystemConfig2.EthernetOperationMode == 2)
{
this.ParentForm.ParentForm.IsEthernetTransferData = false;
this.ParentForm.ParentForm.IsClientConnectTryTimerStart = false;
this.ParentForm.ParentForm.timerClientConnect.Enabled = false;
this.ParentForm.ParentForm.EthernetClientDisconnect();
}
}
private void labelTimer_Click(object sender, EventArgs e)
{
@ -116,15 +112,15 @@ namespace ITC81DB.Controls
}
private void buttonTimerON_Click(object sender, EventArgs e)
{
this.ParentForm.ParentForm.TimerEnabled(false);
this.ParentForm.ParentForm.timerClientConnect.Enabled = false;
this.ParentForm.ParentForm.timerClientConnect.Interval = int.Parse(this.labelTimer.Text);
this.ParentForm.ParentForm.TimerEnabled(true);
this.ParentForm.ParentForm.timerClientConnect.Enabled = true;
this.ParentForm.ParentForm.IsClientConnectTryTimerStart = true;
}
private void buttonTimerOFF_Click(object sender, EventArgs e)
{
this.ParentForm.ParentForm.TimerEnabled(false);
this.ParentForm.ParentForm.timerClientConnect.Enabled = false;
this.ParentForm.ParentForm.IsClientConnectTryTimerStart = false;
}
#endregion
}

View File

@ -338,7 +338,7 @@ namespace ITC81DB
}
else if (this.ParentForm.ParentForm.SystemConfig2.EthernetOperationMode == 2)
{
if (this.ParentForm.ParentForm.IsEthernetThreadStart == true)
if (this.ParentForm.ParentForm.IsEthernetClientConnect == true)
{
this.pictureBoxEthernetDisconnection.Visible = false;
this.pictureBoxEthernetConnection.Visible = true;

View File

@ -339,7 +339,7 @@ namespace ITC81DB.Controls
}
else if (this.ParentForm.ParentForm.SystemConfig2.EthernetOperationMode == 2)
{
if (this.ParentForm.ParentForm.IsEthernetThreadStart == true)
if (this.ParentForm.ParentForm.IsEthernetClientConnect == true)
{
this.pictureBoxEthernetDisconnection.Visible = false;
this.pictureBoxEthernetConnection.Visible = true;

View File

@ -215,7 +215,7 @@
//
// timerClientConnect
//
this.timerClientConnect.Interval = 3000;
this.timerClientConnect.Interval = 1000;
this.timerClientConnect.Tick += new System.EventHandler(this.timerClientConnect_Tick);
//
// smartFile1

View File

@ -24,8 +24,8 @@ namespace ITC81DB.Forms
public partial class FormMain : Form
{
#region Field
public static string DisplayVersion = "8.19.0";
public static string ReleaseDate = "2023.12.06";
public static string DisplayVersion = "8.19.1";
public static string ReleaseDate = "2023.12.18";
public SmartSplash SmartSplashProgramLoad;
public bool IsCommunicationLogOpen;
@ -212,11 +212,11 @@ namespace ITC81DB.Forms
private int HMEthernet_Step;
// Ethernet
public bool IsEthernetThreadStart = false;
public bool IsEthernetClientConnect = false;
public bool IsEthernetClientThreadStart = false;
public bool IsEthernetTransferData;
public bool IsEthernetStartMenu = false;
public object EthernetTransferData;
public bool IsClientConnectTryTimerStart;
private TcpClient EthernetTcpClient;
@ -230,6 +230,7 @@ namespace ITC81DB.Forms
private delegate void TextStatusCallback(string strText);
private delegate void UIControlCallback(bool bEnable);
private delegate void UIServerStatusCallback(bool bEnable);
private delegate void UITimerWorkCallback(bool bEnable);
#endregion
#region Constructor
@ -389,6 +390,7 @@ namespace ITC81DB.Forms
this.FlagComRetry3th = 0;
this.MissingCommIDCount = 0;
this.CommID = 0;
this.IsClientConnectTryTimerStart = false;
this.QueueCommunicationRecive = new Queue<string>();
this.CurrentAlarmList = new AlarmList();
@ -579,7 +581,8 @@ namespace ITC81DB.Forms
}
else if (this.SystemConfig2.EthernetOperationMode == 2)
{
this.TimerEnabled(true);
this.EthernetClientDisconnect();
this.UITimerWork(true);
}
if (this.SystemConfig2.EthernetCommMode != (int)DataStore.EthernetMode.f0_None)
@ -2573,10 +2576,10 @@ namespace ITC81DB.Forms
this.IsBootingComplete = true;
this.TransferDataStream(CommunicationCommand.Read, CommunicationID.MainBoard, CommunicationAddress.ParameterCount, "");
if (this.SystemConfig2.EthernetOperationMode == 2)
{
this.TimerEnabled(true);
}
//if (this.SystemConfig2.EthernetOperationMode == 2)
//{
// this.TimerEnabled(true);
//}
}
else
{
@ -4808,10 +4811,11 @@ namespace ITC81DB.Forms
sb.Append(string.Format("{0,8}", weight.JudgmentStatus));
if (isFillZero == true)
sb.Append(Helper.StringZeroFillDigits10(Helper.DoubleToString(weight.Weight, this.SystemConfig1.DecimalPlaces)));
sb.Append(Helper.StringZeroFillDigits9(Helper.DoubleToString(weight.Weight, this.SystemConfig1.DecimalPlaces)));
else
sb.Append(this.PadLeft(10, Helper.DoubleToString(weight.Weight, this.SystemConfig1.DecimalPlaces)));
sb.Append(this.PadLeft(9, Helper.DoubleToString(weight.Weight, this.SystemConfig1.DecimalPlaces)));
sb.Append(" ");
sValue = weight.TotalCount.ToString();
sb.Append(sValue.PadLeft(10, ' '));
@ -8465,28 +8469,20 @@ namespace ITC81DB.Forms
}
#region Client
public void TimerEnabled(bool bValue)
{
// if (this.CurrentSystemStatus.CurrentDisplay == DataStore.DisplayStore.MainDisplay)
// if (this.IsEthernetStartMenu == false)
this.timerClientConnect.Enabled = bValue;
}
public void EthernetClientConnect()
{
if (this.IsEthernetThreadStart == true)
return; // Online 경우
if (this.SystemConfig2.IsEthernetEnable == false)
{
this.TextStatusOut("<Disable");
return;
}
if (string.Compare(this.SystemConfig2.EthernetAddress, "0.0.0.0") == 0)
{
this.TextStatusOut("<Addr Err");
return;
}
if (this.IsEthernetClientConnect == true || this.IsEthernetClientThreadStart == true)
return; // Online 경우
try
{
@ -8496,18 +8492,22 @@ namespace ITC81DB.Forms
cpClientThread.Start();
this.IsUsingTimerEthernetPing(true);
//this.IsUsingTimerEthernetPing(true);
}
catch
{
TextStatusOut(">Thread Error");
this.DelegateUISeverStatus(false);
this.DelegateTextStatusOut(">Thread Error");
this.EthernetClientDisconnect();
}
}
public void EthernetClientDisconnect()
{
this.IsUsingTimerEthernetPing(false);
//this.IsUsingTimerEthernetPing(false);
this.DelegateUISeverStatus(false);
this.DelegateTextStatusOut(">Disconnected");
if (null != this.EthernetStmReader)
this.EthernetStmReader.Close();
@ -8519,11 +8519,6 @@ namespace ITC81DB.Forms
if (null != this.EthernetTcpClient)
this.EthernetTcpClient.Close();
this.DelegateTextStatusOut(">Disconnected");
this.IsEthernetThreadStart = false;
this.TimerEnabled(true);
}
private void EthernetClientReceiveThread()
@ -8531,6 +8526,8 @@ namespace ITC81DB.Forms
int nConnectPort = Convert.ToInt32(this.SystemConfig2.EthernetHostPort);
try
{
this.IsEthernetClientThreadStart = true;
this.DelegateTextStatusOut(">Now Connecting..");
this.EthernetTcpClient = new TcpClient(this.SystemConfig2.EthernetAddress, nConnectPort);
@ -8540,9 +8537,7 @@ namespace ITC81DB.Forms
this.DelegateUISeverStatus(true);
this.DelegateTextStatusOut(">Connected Server");
this.IsEthernetThreadStart = true;
this.TimerEnabled(false);
this.DelegateUITimerWork(false);
// 판정 데이터 전송
if (this.IsEthernetTransferData == true)
@ -8557,50 +8552,55 @@ namespace ITC81DB.Forms
this.DelegateTransferData((byte)this.EthernetTransferData);
}
while (this.IsEthernetThreadStart == true)
while (this.IsEthernetClientConnect == true)
{
string strRecvMsg = this.EthernetStmReader.ReadLine();
if (null == strRecvMsg)
{
this.DelegateTextStatusOut(">Server Out");
this.IsEthernetThreadStart = false;
this.TimerEnabled(true);
break;
}
this.DelegateTextStatusOut(strRecvMsg);
}
this.DelegateTextStatusOut(">Server Out");
this.EthernetClientDisconnect();
this.DelegateUITimerWork(true);
}
catch
{
this.DelegateTextStatusOut(">Connect Fail !");
}
finally
{
this.DelegateUISeverStatus(false);
this.DelegateTextStatusOut(">Disconnected");
if (null != this.EthernetStmReader)
this.EthernetStmReader.Close();
if (null != this.EthernetStmWriter)
this.EthernetStmWriter.Close();
this.DelegateTextStatusOut(">Connect Fail !");
if (null != this.EthernetNetStream)
this.EthernetNetStream.Close();
if (null != this.EthernetTcpClient)
this.EthernetTcpClient.Close();
this.IsEthernetThreadStart = false;
this.TimerEnabled(true);
this.EthernetClientDisconnect();
this.DelegateUITimerWork(true);
}
this.IsEthernetClientThreadStart = false;
return;
}
public void UITimerWork(bool status)
{
if (this.CurrentSystemStatus.CurrentDisplay == DataStore.DisplayStore.MainDisplay
&& this.ChildFormMainDisplay.CurrentDisplay != DataStore.MainDisplayStore.StartMenu)
{
if (this.IsClientConnectTryTimerStart != status)
{
this.timerClientConnect.Enabled = status;
this.IsClientConnectTryTimerStart = status;
//Console.Write("\n" + string.Format("{0:yyyy-MM-dd HH:mm:ss}: {1}", DateTime.Now, status.ToString()));
}
}
}
private void DelegateUITimerWork(bool status)
{
this.Invoke(new UITimerWorkCallback(this.UITimerWork), status);
}
private void UIServerStatus(bool status)
{
this.ChildFormMainDisplay.UpdateEthernetStatusDisplay(status);
@ -8612,8 +8612,15 @@ namespace ITC81DB.Forms
private void TextStatusOut(string value)
{
if (value.Contains(">Connected Server") == true)
this.IsEthernetClientConnect = true;
else
this.IsEthernetClientConnect = false;
if (this.ChildFormMenu.CenterConfiEthernet != null)
this.ChildFormMenu.CenterConfiEthernet.UpdateEthernetStatusDisplay(value);
//Console.Write("\n" + string.Format("{0:yyyy-MM-dd HH:mm:ss}: {1}", DateTime.Now, value));
}
private void DelegateTextStatusOut(string value)
{
@ -8642,7 +8649,6 @@ namespace ITC81DB.Forms
catch
{
this.DelegateUISeverStatus(false);
this.DelegateTextStatusOut("> Disconnect");
}
}
public void EthernetSendMessage(byte[] msg)
@ -8655,7 +8661,6 @@ namespace ITC81DB.Forms
catch
{
this.DelegateUISeverStatus(false);
this.DelegateTextStatusOut("> Disconnect");
}
}
public void EthernetSendMessage(byte msg)
@ -8668,7 +8673,6 @@ namespace ITC81DB.Forms
catch
{
this.DelegateUISeverStatus(false);
this.DelegateTextStatusOut("> Disconnect");
}
}
public void EthernetWeightData(string strTemp)
@ -8678,12 +8682,9 @@ namespace ITC81DB.Forms
try
{
if (this.IsEthernetThreadStart == false)
{
if (this.IsEthernetClientConnect == false)
this.EthernetClientConnect();
this.EthernetSendMessage((string)this.EthernetTransferData);
}
else
this.EthernetSendMessage((string)this.EthernetTransferData);
}
catch
@ -8698,12 +8699,9 @@ namespace ITC81DB.Forms
try
{
if (this.IsEthernetThreadStart == false)
{
if (this.IsEthernetClientConnect == false)
this.EthernetClientConnect();
this.EthernetSendMessage(bytes);
}
else
this.EthernetSendMessage(bytes);
}
catch
@ -8718,12 +8716,9 @@ namespace ITC81DB.Forms
try
{
if (this.IsEthernetThreadStart == false)
{
if (this.IsEthernetClientConnect == false)
this.EthernetClientConnect();
this.EthernetSendMessage(bytes);
}
else
this.EthernetSendMessage(bytes);
}
catch
@ -16186,9 +16181,14 @@ namespace ITC81DB.Forms
private void timerClientConnect_Tick(object sender, EventArgs e)
{
if (this.IsEthernetThreadStart == false)
this.timerClientConnect.Enabled = false;
this.IsClientConnectTryTimerStart = false;
if (this.IsEthernetClientConnect == false)
{
this.EthernetClientConnect();
//Console.Write("\n" + string.Format("{0:yyyy-MM-dd HH:mm:ss}: {1}", DateTime.Now, "timerClientConnect - Try connect"));
}
}

View File

@ -21,7 +21,7 @@ namespace ITC81DB.Forms
#region Field
private FormMain m_ParentForm;
private DataStore.MainDisplayStore CurrentDisplay;
public DataStore.MainDisplayStore CurrentDisplay;
public ControlMainAlarm MainAlarm;
public ControlMainAverageTracking MainAverageTracking;
@ -1095,8 +1095,6 @@ namespace ITC81DB.Forms
}
public void DisplayBottomMain(DataStore.MainDisplayStore main)
{
this.ParentForm.IsEthernetStartMenu = false;
switch (main)
{
case DataStore.MainDisplayStore.SubMenu:
@ -1106,7 +1104,6 @@ namespace ITC81DB.Forms
this.MainWeightSmallScreen.BringToFront();
break;
case DataStore.MainDisplayStore.StartMenu:
this.ParentForm.IsEthernetStartMenu = true;
this.UpdateDisplayMenuButton(DataStore.MainDisplayStore.StartMenu);
this.MainStartMenu.DisplayRefresh(this.ParentForm.CurrentSystemStatus);
this.MainStartMenu.BringToFront();
@ -1239,7 +1236,8 @@ namespace ITC81DB.Forms
this.DisplayBottomMain(this.CurrentDisplay);
this.ParentForm.TimerEnabled(true);
if (this.ParentForm.SystemConfig2.EthernetOperationMode == 2)
this.ParentForm.UITimerWork(true);
//this.CurrentDisplay = DataStore.MainDisplayStore.DisplayStartBarGraph;
//this.DisplayBottomMain(this.CurrentDisplay);
@ -1569,7 +1567,8 @@ namespace ITC81DB.Forms
{
if (this.ParentForm.CurrentSystemStatus.Equipment == DataStore.EquipmentStatus.Stop)
{
this.ParentForm.TimerEnabled(false);
if (this.ParentForm.SystemConfig2.EthernetOperationMode == 2)
this.ParentForm.UITimerWork(false);
this.ParentForm.ChildFormMenu.DisplayRefresh(this.ParentForm.CurrentSystemStatus);
((FormMain)(Owner)).smartForm.Show((int)DataStore.FormStore.FormMenu);

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.