parent
e7c63b8a07
commit
dde0d636d1
|
@ -1236,8 +1236,6 @@ namespace ITC81DB_0H.Controls
|
||||||
|
|
||||||
if (this.timerServer.Enabled != true)
|
if (this.timerServer.Enabled != true)
|
||||||
this.timerServer.Enabled = true;
|
this.timerServer.Enabled = true;
|
||||||
|
|
||||||
this.ParentForm.ParentForm.ChildFormMainDisplay.TimerDetectConnected(false);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (this.ParentForm.ParentForm.SystemConfig2.EthernetOperationMode == 2)
|
else if (this.ParentForm.ParentForm.SystemConfig2.EthernetOperationMode == 2)
|
||||||
|
@ -1257,8 +1255,6 @@ namespace ITC81DB_0H.Controls
|
||||||
|
|
||||||
if (this.labelServerStatus.Text != ">Stop")
|
if (this.labelServerStatus.Text != ">Stop")
|
||||||
this.labelServerStatus.Text = ">Stop";
|
this.labelServerStatus.Text = ">Stop";
|
||||||
|
|
||||||
this.ParentForm.ParentForm.ChildFormMainDisplay.TimerDetectConnected(false);
|
|
||||||
}
|
}
|
||||||
else if (this.ParentForm.ParentForm.SystemConfig2.EthernetOperationMode == 2)
|
else if (this.ParentForm.ParentForm.SystemConfig2.EthernetOperationMode == 2)
|
||||||
{
|
{
|
||||||
|
@ -1279,11 +1275,13 @@ namespace ITC81DB_0H.Controls
|
||||||
{
|
{
|
||||||
this.ParentForm.ParentForm.SystemConfig2.IsDisconnectDetection = true;
|
this.ParentForm.ParentForm.SystemConfig2.IsDisconnectDetection = true;
|
||||||
this.buttonDisconnectDetection.Text = "Disconnect Detection OFF";
|
this.buttonDisconnectDetection.Text = "Disconnect Detection OFF";
|
||||||
|
this.ParentForm.ParentForm.IsUsingTimerEthernetPing(true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this.ParentForm.ParentForm.SystemConfig2.IsDisconnectDetection = false;
|
this.ParentForm.ParentForm.SystemConfig2.IsDisconnectDetection = false;
|
||||||
this.buttonDisconnectDetection.Text = "Disconnect Detection ON";
|
this.buttonDisconnectDetection.Text = "Disconnect Detection ON";
|
||||||
|
this.ParentForm.ParentForm.IsUsingTimerEthernetPing(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.ParentForm.ParentForm.SaveSystemConfigurationFile2(this.ParentForm.ParentForm.SystemConfig2);
|
this.ParentForm.ParentForm.SaveSystemConfigurationFile2(this.ParentForm.ParentForm.SystemConfig2);
|
||||||
|
|
|
@ -66,7 +66,7 @@ namespace ITC81DB_0H.Controls
|
||||||
private void DefaultSetting()
|
private void DefaultSetting()
|
||||||
{
|
{
|
||||||
this.labelSerialNo.Text = this.ParentForm.ParentForm.SystemConfig1.SerialNumber;
|
this.labelSerialNo.Text = this.ParentForm.ParentForm.SystemConfig1.SerialNumber;
|
||||||
this.labelDisplayVer.Text = "2.1.3";
|
this.labelDisplayVer.Text = "2.2.0";
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UpdateMainBoardVersionDisplay(string version)
|
public void UpdateMainBoardVersionDisplay(string version)
|
||||||
|
|
|
@ -44,7 +44,6 @@
|
||||||
this.timeOut = new System.Windows.Forms.Timer();
|
this.timeOut = new System.Windows.Forms.Timer();
|
||||||
this.smartTimerUpdate = new SmartX.SmartTimer(this.components);
|
this.smartTimerUpdate = new SmartX.SmartTimer(this.components);
|
||||||
this.timerEthernetPing = new System.Windows.Forms.Timer();
|
this.timerEthernetPing = new System.Windows.Forms.Timer();
|
||||||
this.timerWaitResponse = new System.Windows.Forms.Timer();
|
|
||||||
((System.ComponentModel.ISupportInitialize)(this.smartForm)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)(this.smartForm)).BeginInit();
|
||||||
this.SuspendLayout();
|
this.SuspendLayout();
|
||||||
//
|
//
|
||||||
|
@ -194,11 +193,6 @@
|
||||||
this.timerEthernetPing.Interval = 2000;
|
this.timerEthernetPing.Interval = 2000;
|
||||||
this.timerEthernetPing.Tick += new System.EventHandler(this.timerEthernetPing_Tick);
|
this.timerEthernetPing.Tick += new System.EventHandler(this.timerEthernetPing_Tick);
|
||||||
//
|
//
|
||||||
// timerWaitResponse
|
|
||||||
//
|
|
||||||
this.timerWaitResponse.Interval = 150;
|
|
||||||
this.timerWaitResponse.Tick += new System.EventHandler(this.timerWaitResponse_Tick);
|
|
||||||
//
|
|
||||||
// FormMain
|
// FormMain
|
||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
|
||||||
|
@ -230,7 +224,6 @@
|
||||||
private System.Windows.Forms.Timer timeOut;
|
private System.Windows.Forms.Timer timeOut;
|
||||||
private SmartX.SmartTimer smartTimerUpdate;
|
private SmartX.SmartTimer smartTimerUpdate;
|
||||||
private System.Windows.Forms.Timer timerEthernetPing;
|
private System.Windows.Forms.Timer timerEthernetPing;
|
||||||
private System.Windows.Forms.Timer timerWaitResponse;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,15 +42,10 @@ namespace ITC81DB_0H.Forms
|
||||||
public bool IsAlarmOccured;
|
public bool IsAlarmOccured;
|
||||||
public int UpdateValue; // Modbus - Update 될 때마다 +1
|
public int UpdateValue; // Modbus - Update 될 때마다 +1
|
||||||
public bool IsOPCModbusUsing;
|
public bool IsOPCModbusUsing;
|
||||||
private int GCCount;
|
|
||||||
|
|
||||||
private int PingFalseCount;
|
|
||||||
private byte[] ClientSendDatabyteArray;
|
private byte[] ClientSendDatabyteArray;
|
||||||
private string ClientSendDataString;
|
private string ClientSendDataString;
|
||||||
private int PingTrueCount;
|
|
||||||
private int ResponseFailCount;
|
|
||||||
private bool IsTimerPingEnableTrue;
|
|
||||||
private bool IsTimerWaitResponseEnableTrue;
|
|
||||||
|
|
||||||
#region 통신관련
|
#region 통신관련
|
||||||
// OPT2
|
// OPT2
|
||||||
|
@ -190,10 +185,6 @@ namespace ITC81DB_0H.Forms
|
||||||
private delegate void TextStatusCallback(string strtext);
|
private delegate void TextStatusCallback(string strtext);
|
||||||
private delegate void UIControlCallback(bool bEnable);
|
private delegate void UIControlCallback(bool bEnable);
|
||||||
private delegate void UIServerStatusCallback(bool bEnable);
|
private delegate void UIServerStatusCallback(bool bEnable);
|
||||||
|
|
||||||
// Ethernet Connect단 Thread 처리
|
|
||||||
ThreadStart ThreadDelegate;
|
|
||||||
Thread ThreadEthernetPing;
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Constructor
|
#region Constructor
|
||||||
|
@ -336,15 +327,6 @@ namespace ITC81DB_0H.Forms
|
||||||
this.IsAlarmOccured = false;
|
this.IsAlarmOccured = false;
|
||||||
this.UpdateValue = 0;
|
this.UpdateValue = 0;
|
||||||
this.IsOPCModbusUsing = false;
|
this.IsOPCModbusUsing = false;
|
||||||
this.GCCount = 0;
|
|
||||||
|
|
||||||
this.PingFalseCount = 0;
|
|
||||||
this.PingTrueCount = 0;
|
|
||||||
this.ResponseFailCount = 0;
|
|
||||||
this.IsTimerPingEnableTrue = false;
|
|
||||||
this.IsTimerWaitResponseEnableTrue = false;
|
|
||||||
|
|
||||||
this.ThreadDelegate = new ThreadStart(this.EthernetPing);
|
|
||||||
|
|
||||||
this.Modbus = new Modbus();
|
this.Modbus = new Modbus();
|
||||||
this.Current30000ModbusData = new _30000_ModbusData();
|
this.Current30000ModbusData = new _30000_ModbusData();
|
||||||
|
@ -1864,7 +1846,10 @@ namespace ITC81DB_0H.Forms
|
||||||
|
|
||||||
// 이더넷
|
// 이더넷
|
||||||
if (this.SystemConfig2.EthernetOperationMode == 2)
|
if (this.SystemConfig2.EthernetOperationMode == 2)
|
||||||
|
{
|
||||||
|
this.IsEthernetTransferData = false;
|
||||||
this.EthernetClientDisconnect();
|
this.EthernetClientDisconnect();
|
||||||
|
}
|
||||||
|
|
||||||
if (this.CurrentSystemStatus.CurrentDisplay == DataStore.DisplayStore.MainDisplay)
|
if (this.CurrentSystemStatus.CurrentDisplay == DataStore.DisplayStore.MainDisplay)
|
||||||
{
|
{
|
||||||
|
@ -2204,6 +2189,9 @@ namespace ITC81DB_0H.Forms
|
||||||
if (this.SystemConfig1.IsBarcodeEnable == true && this.CurrentSystemStatus.Equipment == DataStore.EquipmentStatus.Start)
|
if (this.SystemConfig1.IsBarcodeEnable == true && this.CurrentSystemStatus.Equipment == DataStore.EquipmentStatus.Start)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
if (this.SystemConfig2.EthernetOperationMode == 1 && this.smartTCPMultiServer.IsStart == true)
|
||||||
|
this.ChildFormMainDisplay.TimerDetectConnected(true);
|
||||||
|
|
||||||
// Save System File
|
// Save System File
|
||||||
this.SaveSystemConfigurationFile1(this.SystemConfig1);
|
this.SaveSystemConfigurationFile1(this.SystemConfig1);
|
||||||
// 생산속도 Clear
|
// 생산속도 Clear
|
||||||
|
@ -7799,63 +7787,14 @@ namespace ITC81DB_0H.Forms
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Ethernet
|
#region Ethernet
|
||||||
public void ThreadCloseClientIP(string address)
|
public void IsUsingTimerEthernetPing(bool bValue)
|
||||||
{
|
{
|
||||||
this.smartTCPMultiServer.CloseClientIP(address);
|
if (this.SystemConfig2.IsDisconnectDetection == true)
|
||||||
}
|
|
||||||
public void TimerPingEnabled(int interval, bool bValue)
|
|
||||||
{
|
{
|
||||||
if (this.SystemConfig2.IsDisconnectDetection == false)
|
this.timerEthernetPing.Enabled = bValue;
|
||||||
return;
|
|
||||||
|
|
||||||
if (bValue == true)
|
|
||||||
{
|
|
||||||
if (this.IsTimerPingEnableTrue == false)
|
|
||||||
{
|
|
||||||
this.timerEthernetPing.Enabled = false;
|
|
||||||
this.timerEthernetPing.Interval = interval;
|
|
||||||
if (this.PingFalseCount > 0)
|
|
||||||
this.PingFalseCount = 0;
|
|
||||||
this.timerEthernetPing.Enabled = true;
|
|
||||||
|
|
||||||
this.IsTimerPingEnableTrue = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
|
||||||
this.TimerPingDisabled();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public void TimerPingDisabled()
|
|
||||||
{
|
|
||||||
if (this.SystemConfig2.IsDisconnectDetection == false)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (this.IsTimerPingEnableTrue == true)
|
|
||||||
{
|
|
||||||
this.timerEthernetPing.Enabled = false;
|
this.timerEthernetPing.Enabled = false;
|
||||||
this.IsTimerPingEnableTrue = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public void TimerWaitResponseEnabled(bool bValue)
|
|
||||||
{
|
|
||||||
if (this.SystemConfig2.IsDisconnectDetection == false)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (bValue == true)
|
|
||||||
{
|
|
||||||
if (this.IsTimerWaitResponseEnableTrue == false)
|
|
||||||
{
|
|
||||||
this.timerWaitResponse.Enabled = false;
|
|
||||||
this.timerWaitResponse.Enabled = true;
|
|
||||||
this.IsTimerWaitResponseEnableTrue = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.timerWaitResponse.Enabled = false;
|
|
||||||
this.IsTimerWaitResponseEnableTrue = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Client
|
#region Client
|
||||||
|
@ -7882,6 +7821,8 @@ namespace ITC81DB_0H.Forms
|
||||||
cpClientThread.IsBackground = true;
|
cpClientThread.IsBackground = true;
|
||||||
|
|
||||||
cpClientThread.Start();
|
cpClientThread.Start();
|
||||||
|
|
||||||
|
this.IsUsingTimerEthernetPing(true);
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
|
@ -7890,6 +7831,8 @@ namespace ITC81DB_0H.Forms
|
||||||
}
|
}
|
||||||
public void EthernetClientDisconnect()
|
public void EthernetClientDisconnect()
|
||||||
{
|
{
|
||||||
|
this.IsUsingTimerEthernetPing(false);
|
||||||
|
|
||||||
this.IsEthernetThreadStop = true;
|
this.IsEthernetThreadStop = true;
|
||||||
this.DelegateUISeverStatus(false);
|
this.DelegateUISeverStatus(false);
|
||||||
if (null != this.EthernetStmReader)
|
if (null != this.EthernetStmReader)
|
||||||
|
@ -7941,16 +7884,6 @@ namespace ITC81DB_0H.Forms
|
||||||
char[] datas = new char[12];
|
char[] datas = new char[12];
|
||||||
int sum = 0;
|
int sum = 0;
|
||||||
|
|
||||||
//string strRecvMsg = this.EthernetStmReader.ReadLine();
|
|
||||||
|
|
||||||
this.TimerWaitResponseEnabled(false);
|
|
||||||
this.TimerPingDisabled();
|
|
||||||
|
|
||||||
if (this.ResponseFailCount > 0)
|
|
||||||
this.ResponseFailCount = 0;
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
this.EthernetStmReader.Read(datas, 0, datas.Length);
|
this.EthernetStmReader.Read(datas, 0, datas.Length);
|
||||||
for (int i = 0; i < datas.Length; i++)
|
for (int i = 0; i < datas.Length; i++)
|
||||||
sum += datas[i];
|
sum += datas[i];
|
||||||
|
@ -7971,12 +7904,6 @@ namespace ITC81DB_0H.Forms
|
||||||
|
|
||||||
this.DelegateTextStatusOut(strRecvMsg);
|
this.DelegateTextStatusOut(strRecvMsg);
|
||||||
}
|
}
|
||||||
catch
|
|
||||||
{
|
|
||||||
this.DelegateTextStatusOut(">Server Out");
|
|
||||||
this.IsEthernetThreadStop = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
|
@ -8092,7 +8019,6 @@ namespace ITC81DB_0H.Forms
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this.EthernetSendMessage((string)this.EthernetTransferData);
|
this.EthernetSendMessage((string)this.EthernetTransferData);
|
||||||
this.TimerWaitResponseEnabled(true);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void EthernetWeightData(byte[] bytes)
|
public void EthernetWeightData(byte[] bytes)
|
||||||
|
@ -8105,7 +8031,6 @@ namespace ITC81DB_0H.Forms
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this.EthernetSendMessage((byte[])this.EthernetTransferData);
|
this.EthernetSendMessage((byte[])this.EthernetTransferData);
|
||||||
this.TimerWaitResponseEnabled(true);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void EthernetWeightData(byte temp)
|
public void EthernetWeightData(byte temp)
|
||||||
|
@ -8118,7 +8043,6 @@ namespace ITC81DB_0H.Forms
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this.EthernetSendMessage((byte)this.EthernetTransferData);
|
this.EthernetSendMessage((byte)this.EthernetTransferData);
|
||||||
this.TimerWaitResponseEnabled(true);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void EthernetWeightDataForModbus(byte[] bytes)
|
public void EthernetWeightDataForModbus(byte[] bytes)
|
||||||
|
@ -8131,7 +8055,6 @@ namespace ITC81DB_0H.Forms
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this.EthernetSendMessage(bytes);
|
this.EthernetSendMessage(bytes);
|
||||||
this.TimerWaitResponseEnabled(true);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -8141,6 +8064,7 @@ namespace ITC81DB_0H.Forms
|
||||||
{
|
{
|
||||||
if (this.smartTCPMultiServer.IsStart == false)
|
if (this.smartTCPMultiServer.IsStart == false)
|
||||||
{
|
{
|
||||||
|
this.IsUsingTimerEthernetPing(true);
|
||||||
this.ChildFormMenu.CenterConfiEthernet.DisplayLabelLocalPort(false);
|
this.ChildFormMenu.CenterConfiEthernet.DisplayLabelLocalPort(false);
|
||||||
this.smartTCPMultiServer.Port = this.SystemConfig2.EthernetLocalPort;
|
this.smartTCPMultiServer.Port = this.SystemConfig2.EthernetLocalPort;
|
||||||
this.smartTCPMultiServer.Start();
|
this.smartTCPMultiServer.Start();
|
||||||
|
@ -8150,6 +8074,7 @@ namespace ITC81DB_0H.Forms
|
||||||
{
|
{
|
||||||
if (this.smartTCPMultiServer.IsStart == true)
|
if (this.smartTCPMultiServer.IsStart == true)
|
||||||
{
|
{
|
||||||
|
this.IsUsingTimerEthernetPing(false);
|
||||||
this.ChildFormMenu.CenterConfiEthernet.DisplayLabelLocalPort(true);
|
this.ChildFormMenu.CenterConfiEthernet.DisplayLabelLocalPort(true);
|
||||||
this.smartTCPMultiServer.Stop();
|
this.smartTCPMultiServer.Stop();
|
||||||
}
|
}
|
||||||
|
@ -12083,109 +12008,6 @@ namespace ITC81DB_0H.Forms
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Thread
|
|
||||||
private void EthernetPing()
|
|
||||||
{
|
|
||||||
bool disconnect = false;
|
|
||||||
string address = "";
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
CIPSetting.PINGRESULTINFO pingResultInfo = new CIPSetting.PINGRESULTINFO();
|
|
||||||
if (this.SystemConfig2.EthernetOperationMode == 1) // 중량선별기 : Server
|
|
||||||
{
|
|
||||||
#region Server
|
|
||||||
address = this.smartTCPMultiServer.ClientInfoList[0].strIPAddress;
|
|
||||||
bool bValue = this.smartConfigs.IPSettings.PingIP(address, ref pingResultInfo);
|
|
||||||
if (bValue == false)
|
|
||||||
{
|
|
||||||
// 로그
|
|
||||||
if (this.IsCommunicationLogOpen == true)
|
|
||||||
this.smartFileCommunicationLog.WriteString(string.Format("EthernetPing 'Server' ({0:yyyy-MM-dd HH:mm:ss}): {1}_Count {2}", DateTime.Now, bValue.ToString(), this.PingFalseCount.ToString()));
|
|
||||||
|
|
||||||
if (this.PingFalseCount >= 2)
|
|
||||||
{
|
|
||||||
this.PingFalseCount = 0;
|
|
||||||
|
|
||||||
if (address != "")
|
|
||||||
disconnect = this.smartTCPMultiServer.CloseClientIP(address);
|
|
||||||
|
|
||||||
this.DelegateUISeverStatus(false);
|
|
||||||
this.ChildFormMenu.CenterConfiEthernet.DelegateConnectedIPStatusOut("-");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.PingFalseCount++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
this.PingFalseCount = 0;
|
|
||||||
#endregion
|
|
||||||
}
|
|
||||||
else // 중량선별기 : Client
|
|
||||||
{
|
|
||||||
#region Client
|
|
||||||
bool bValue = this.smartConfigs.IPSettings.PingIP(this.SystemConfig2.EthernetAddress, ref pingResultInfo);
|
|
||||||
if (bValue == true)
|
|
||||||
{
|
|
||||||
// 로그
|
|
||||||
if (this.IsCommunicationLogOpen == true)
|
|
||||||
this.smartFileCommunicationLog.WriteString(string.Format("EthernetPing 'Client' ({0:yyyy-MM-dd HH:mm:ss}): {1}_Count {2}", DateTime.Now, bValue.ToString(), this.PingTrueCount.ToString()));
|
|
||||||
|
|
||||||
if (this.PingTrueCount >= 2)
|
|
||||||
{
|
|
||||||
this.TimerPingDisabled();
|
|
||||||
this.EthernetClientConnect();
|
|
||||||
this.PingTrueCount = 0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.PingTrueCount++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// 로그
|
|
||||||
if (this.IsCommunicationLogOpen == true)
|
|
||||||
this.smartFileCommunicationLog.WriteString(string.Format("EthernetPing 'Client' ({0:yyyy-MM-dd HH:mm:ss}): Ping False", DateTime.Now));
|
|
||||||
|
|
||||||
this.DelegateUISeverStatus(false);
|
|
||||||
this.ChildFormMenu.CenterConfiEthernet.DelegateConnectedIPStatusOut("-");
|
|
||||||
|
|
||||||
this.PingTrueCount = 0;
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
#region Catch
|
|
||||||
// 로그
|
|
||||||
if (this.IsCommunicationLogOpen == true)
|
|
||||||
this.smartFileCommunicationLog.WriteString(string.Format("EthernetPing ({0:yyyy-MM-dd HH:mm:ss}): Catch", DateTime.Now));
|
|
||||||
|
|
||||||
this.DelegateUISeverStatus(false);
|
|
||||||
this.ChildFormMenu.CenterConfiEthernet.DelegateConnectedIPStatusOut("-");
|
|
||||||
|
|
||||||
if (this.SystemConfig2.EthernetOperationMode == 1) // 중량선별기 : Server
|
|
||||||
this.TimerPingDisabled();
|
|
||||||
else // 중량선별기 : Client
|
|
||||||
this.EthernetClientDisconnect();
|
|
||||||
#endregion
|
|
||||||
}
|
|
||||||
|
|
||||||
this.ThreadEthernetPing.Join();
|
|
||||||
|
|
||||||
//if (this.GCCount > 1800)
|
|
||||||
//{
|
|
||||||
// System.GC.Collect();
|
|
||||||
// System.GC.WaitForPendingFinalizers();
|
|
||||||
// this.GCCount = 0;
|
|
||||||
//}
|
|
||||||
//else
|
|
||||||
// this.GCCount++;
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Override Member
|
#region Override Member
|
||||||
|
@ -13574,34 +13396,72 @@ namespace ITC81DB_0H.Forms
|
||||||
this.CollectionBufferWeightData.Clear();
|
this.CollectionBufferWeightData.Clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private void timerWaitResponse_Tick(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
// 로그
|
|
||||||
if (this.IsCommunicationLogOpen == true)
|
|
||||||
this.smartFileCommunicationLog.WriteString(string.Format("Respons fail ({0:yyyy-MM-dd HH:mm:ss}): Count_{1}", DateTime.Now, this.ResponseFailCount));
|
|
||||||
|
|
||||||
if (this.ResponseFailCount >= 2)
|
|
||||||
{
|
|
||||||
this.ResponseFailCount = 0;
|
|
||||||
this.TimerWaitResponseEnabled(false);
|
|
||||||
this.EthernetClientDisconnect();
|
|
||||||
this.TimerPingEnabled(1000, true);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.ResponseFailCount++;
|
|
||||||
|
|
||||||
if (this.SystemConfig2.EthernetCommMode == (int)DataStore.EthernetMode.f22_Modbus_TCP)
|
|
||||||
this.EthernetWeightDataForModbus(this.ClientSendDatabyteArray);
|
|
||||||
else
|
|
||||||
this.EthernetWeightData(this.ClientSendDataString);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
private void timerEthernetPing_Tick(object sender, EventArgs e)
|
private void timerEthernetPing_Tick(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
this.ThreadEthernetPing = new Thread(this.ThreadDelegate);
|
try
|
||||||
this.ThreadEthernetPing.Priority = ThreadPriority.Highest;
|
{
|
||||||
this.ThreadEthernetPing.Start();
|
CIPSetting.PINGRESULTINFO pingResultInfo = new CIPSetting.PINGRESULTINFO();
|
||||||
|
if (this.SystemConfig2.EthernetOperationMode == 1) // 중량선별기 : Server
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
bool bValue = this.smartConfigs.IPSettings.PingIP(this.smartTCPMultiServer.ClientInfoList[0].strIPAddress, ref pingResultInfo);
|
||||||
|
if (bValue == false)
|
||||||
|
{
|
||||||
|
this.ChildFormMainDisplay.UpdateEthernetStatusDisplay(false);
|
||||||
|
this.ChildFormMenu.CenterConfiEthernet.DelegateConnectedIPStatusOut("-");
|
||||||
|
bool disconnect = this.smartTCPMultiServer.CloseClientIP(this.smartTCPMultiServer.ClientInfoList[0].strIPAddress);
|
||||||
|
|
||||||
|
// 로그
|
||||||
|
if (this.IsCommunicationLogOpen == true)
|
||||||
|
this.smartFileCommunicationLog.WriteString(string.Format("CloseClientIP ({0:yyyy-MM-dd HH:mm:ss}): {1}_{2}", DateTime.Now, disconnect.ToString()));
|
||||||
|
|
||||||
|
this.EthernetServerStart();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 로그
|
||||||
|
if (this.IsCommunicationLogOpen == true)
|
||||||
|
this.smartFileCommunicationLog.WriteString(string.Format("Connection ({0:yyyy-MM-dd HH:mm:ss}): {1}", DateTime.Now, bValue.ToString()));
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
this.ChildFormMainDisplay.UpdateEthernetStatusDisplay(false);
|
||||||
|
this.ChildFormMenu.CenterConfiEthernet.DelegateConnectedIPStatusOut("-");
|
||||||
|
|
||||||
|
// 로그
|
||||||
|
if (this.IsCommunicationLogOpen == true)
|
||||||
|
this.smartFileCommunicationLog.WriteString(string.Format("Error ({0:yyyy-MM-dd HH:mm:ss}): Catch", DateTime.Now));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else // 중량선별기 : Client
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (this.smartConfigs.IPSettings.PingIP(this.SystemConfig2.EthernetAddress, ref pingResultInfo) == false)
|
||||||
|
{
|
||||||
|
this.EthernetClientDisconnect();
|
||||||
|
this.EthernetClientConnect();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
this.DelegateUISeverStatus(false);
|
||||||
|
this.ChildFormMenu.CenterConfiEthernet.DelegateConnectedIPStatusOut("-");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
if (this.SystemConfig2.EthernetOperationMode == 1) // 중량선별기 : Server
|
||||||
|
{
|
||||||
|
this.ChildFormMainDisplay.UpdateEthernetStatusDisplay(false);
|
||||||
|
}
|
||||||
|
else // 중량선별기 : Client
|
||||||
|
{
|
||||||
|
this.DelegateUISeverStatus(false);
|
||||||
|
this.EthernetClientDisconnect();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 전송지연시간 관련
|
// 전송지연시간 관련
|
||||||
|
|
|
@ -159,9 +159,6 @@
|
||||||
<metadata name="timerEthernetPing.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
<metadata name="timerEthernetPing.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
<value>399, 58</value>
|
<value>399, 58</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
<metadata name="timerWaitResponse.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
|
||||||
<value>580, 59</value>
|
|
||||||
</metadata>
|
|
||||||
<metadata name="$this.FormFactorShadowProperty" xml:space="preserve">
|
<metadata name="$this.FormFactorShadowProperty" xml:space="preserve">
|
||||||
<value>WEBPAD</value>
|
<value>WEBPAD</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
|
|
|
@ -21,12 +21,6 @@ namespace ITC81DB_0H.Forms
|
||||||
#region Field
|
#region Field
|
||||||
private FormMain m_ParentForm;
|
private FormMain m_ParentForm;
|
||||||
|
|
||||||
// Ethernet Connect단 Thread 처리
|
|
||||||
ThreadStart ThreadDelegate;
|
|
||||||
Thread ThreadClientConnected;
|
|
||||||
|
|
||||||
private int GCCount;
|
|
||||||
|
|
||||||
private DataStore.MainDisplayStore CurrentDisplay;
|
private DataStore.MainDisplayStore CurrentDisplay;
|
||||||
|
|
||||||
public ControlMainDisplayWeightBigScreen MainDisplayWeightBigScreen;
|
public ControlMainDisplayWeightBigScreen MainDisplayWeightBigScreen;
|
||||||
|
@ -207,8 +201,6 @@ namespace ITC81DB_0H.Forms
|
||||||
this.labelUserLevel.Visible = false;
|
this.labelUserLevel.Visible = false;
|
||||||
this.buttonUser.Visible = false;
|
this.buttonUser.Visible = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.GCCount = 0;
|
|
||||||
}
|
}
|
||||||
private void DefaultSetting()
|
private void DefaultSetting()
|
||||||
{
|
{
|
||||||
|
@ -227,8 +219,6 @@ namespace ITC81DB_0H.Forms
|
||||||
this.MainDisplayAlarm.Visible = false;
|
this.MainDisplayAlarm.Visible = false;
|
||||||
this.MainDisplayAlarm.BringToFront();
|
this.MainDisplayAlarm.BringToFront();
|
||||||
|
|
||||||
this.ThreadDelegate = new ThreadStart(this.ClientConnectCheck);
|
|
||||||
|
|
||||||
this.buttonPrint.Visible = this.ParentForm.SystemConfig1.IsPrinterEnable;
|
this.buttonPrint.Visible = this.ParentForm.SystemConfig1.IsPrinterEnable;
|
||||||
if (this.ParentForm.SystemConfig1.IsPrintPerProductEnable == true)
|
if (this.ParentForm.SystemConfig1.IsPrintPerProductEnable == true)
|
||||||
this.buttonPrint.ButtonDown();
|
this.buttonPrint.ButtonDown();
|
||||||
|
@ -400,11 +390,13 @@ namespace ITC81DB_0H.Forms
|
||||||
{
|
{
|
||||||
if (bValue == true)
|
if (bValue == true)
|
||||||
{
|
{
|
||||||
this.timerClientConnectCheck.Enabled = false;
|
//this.timerClientConnectCheck.Enabled = false;
|
||||||
|
if (this.timerClientConnectCheck.Enabled == false)
|
||||||
this.timerClientConnectCheck.Enabled = true;
|
this.timerClientConnectCheck.Enabled = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (this.timerClientConnectCheck.Enabled == true)
|
||||||
this.timerClientConnectCheck.Enabled = false;
|
this.timerClientConnectCheck.Enabled = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -696,17 +688,6 @@ namespace ITC81DB_0H.Forms
|
||||||
this.MainDisplayWeightBigScreen.UpdateEthernetStatusDisplay(status);
|
this.MainDisplayWeightBigScreen.UpdateEthernetStatusDisplay(status);
|
||||||
if (this.MainDisplayWeightSmall != null)
|
if (this.MainDisplayWeightSmall != null)
|
||||||
this.MainDisplayWeightSmall.UpdateEthernetStatusDisplay(status);
|
this.MainDisplayWeightSmall.UpdateEthernetStatusDisplay(status);
|
||||||
|
|
||||||
if (status == true)
|
|
||||||
{
|
|
||||||
if (this.ParentForm.SystemConfig2.EthernetOperationMode == 1) // 중량선별기 : Server
|
|
||||||
this.ParentForm.TimerPingEnabled(2000, true);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (this.ParentForm.SystemConfig2.EthernetOperationMode == 1) // 중량선별기 : Server
|
|
||||||
this.ParentForm.TimerPingDisabled();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UpdateModbusScreen()
|
public void UpdateModbusScreen()
|
||||||
|
@ -1016,90 +997,57 @@ namespace ITC81DB_0H.Forms
|
||||||
//this.buttonPrint.Enabled = true;
|
//this.buttonPrint.Enabled = true;
|
||||||
//this.buttonClear.Enabled = true;
|
//this.buttonClear.Enabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ClientConnectCheck()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if (this.ParentForm.smartTCPMultiServer.IsStart == true)
|
|
||||||
{
|
|
||||||
if (this.ParentForm.smartTCPMultiServer.ClientInfoList == null)
|
|
||||||
{
|
|
||||||
this.ParentForm.DelegateUISeverStatus(false);
|
|
||||||
|
|
||||||
// 로그
|
|
||||||
if (this.ParentForm.IsCommunicationLogOpen == true)
|
|
||||||
this.ParentForm.smartFileCommunicationLog.WriteString(string.Format("ClientConnectCheck ({0:yyyy-MM-dd HH:mm:ss}): false", DateTime.Now));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.ParentForm.DelegateUISeverStatus(true);
|
|
||||||
|
|
||||||
// 로그
|
|
||||||
if (this.ParentForm.IsCommunicationLogOpen == true)
|
|
||||||
this.ParentForm.smartFileCommunicationLog.WriteString(string.Format("ClientConnectCheck ({0:yyyy-MM-dd HH:mm:ss}): true", DateTime.Now));
|
|
||||||
}
|
|
||||||
|
|
||||||
this.ThreadClientConnected.Join();
|
|
||||||
|
|
||||||
//if (this.GCCount > 1800)
|
|
||||||
//{
|
|
||||||
// System.GC.Collect();
|
|
||||||
// System.GC.WaitForPendingFinalizers();
|
|
||||||
// this.GCCount = 0;
|
|
||||||
//}
|
|
||||||
//else
|
|
||||||
// this.GCCount++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
FormMain.Exception(ex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
private void timerClientConnectCheck_Tick(object sender, EventArgs e)
|
private void timerClientConnectCheck_Tick(object sender, EventArgs e)
|
||||||
{
|
|
||||||
//this.ThreadClientConnected = new Thread(this.ThreadDelegate);
|
|
||||||
//this.ThreadClientConnected.Priority = ThreadPriority.Highest;
|
|
||||||
//this.ThreadClientConnected.Start();
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
if (this.ParentForm.smartTCPMultiServer.IsStart == true)
|
if (this.ParentForm.smartTCPMultiServer.IsStart == true)
|
||||||
{
|
{
|
||||||
if (this.ParentForm.smartTCPMultiServer.ClientInfoList == null)
|
if (this.ParentForm.smartTCPMultiServer.ClientInfoList == null)
|
||||||
{
|
{
|
||||||
this.ParentForm.DelegateUISeverStatus(false);
|
this.UpdateEthernetStatusDisplay(false);
|
||||||
|
|
||||||
// 로그
|
|
||||||
if (this.ParentForm.IsCommunicationLogOpen == true)
|
|
||||||
this.ParentForm.smartFileCommunicationLog.WriteString(string.Format("ClientConnectCheck ({0:yyyy-MM-dd HH:mm:ss}): false", DateTime.Now));
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this.ParentForm.DelegateUISeverStatus(true);
|
this.UpdateEthernetStatusDisplay(true);
|
||||||
|
}
|
||||||
// 로그
|
|
||||||
if (this.ParentForm.IsCommunicationLogOpen == true)
|
|
||||||
this.ParentForm.smartFileCommunicationLog.WriteString(string.Format("ClientConnectCheck ({0:yyyy-MM-dd HH:mm:ss}): true", DateTime.Now));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//this.ThreadClientConnected.Join();
|
//try
|
||||||
|
|
||||||
//if (this.GCCount > 1800)
|
|
||||||
//{
|
//{
|
||||||
// System.GC.Collect();
|
// if (this.ParentForm.smartTCPMultiServer.IsStart == true)
|
||||||
// System.GC.WaitForPendingFinalizers();
|
// {
|
||||||
// this.GCCount = 0;
|
// if (this.ParentForm.smartTCPMultiServer.ClientInfoList == null)
|
||||||
|
// {
|
||||||
|
// this.ParentForm.DelegateUISeverStatus(false);
|
||||||
|
|
||||||
|
// // 로그
|
||||||
|
// if (this.ParentForm.IsCommunicationLogOpen == true)
|
||||||
|
// this.ParentForm.smartFileCommunicationLog.WriteString(string.Format("ClientConnectCheck ({0:yyyy-MM-dd HH:mm:ss}): false", DateTime.Now));
|
||||||
// }
|
// }
|
||||||
// else
|
// else
|
||||||
// this.GCCount++;
|
// {
|
||||||
}
|
// this.ParentForm.DelegateUISeverStatus(true);
|
||||||
}
|
|
||||||
catch (Exception ex)
|
// // 로그
|
||||||
{
|
// if (this.ParentForm.IsCommunicationLogOpen == true)
|
||||||
FormMain.Exception(ex);
|
// this.ParentForm.smartFileCommunicationLog.WriteString(string.Format("ClientConnectCheck ({0:yyyy-MM-dd HH:mm:ss}): true", DateTime.Now));
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
// //this.ThreadClientConnected.Join();
|
||||||
|
|
||||||
|
// //if (this.GCCount > 1800)
|
||||||
|
// //{
|
||||||
|
// // System.GC.Collect();
|
||||||
|
// // System.GC.WaitForPendingFinalizers();
|
||||||
|
// // this.GCCount = 0;
|
||||||
|
// //}
|
||||||
|
// //else
|
||||||
|
// // this.GCCount++;
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
//catch (Exception ex)
|
||||||
|
//{
|
||||||
|
// FormMain.Exception(ex);
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void pictureBoxIconAlarm_Click(object sender, EventArgs e)
|
private void pictureBoxIconAlarm_Click(object sender, EventArgs e)
|
||||||
|
|
|
@ -12,6 +12,11 @@
|
||||||
기본형 컨베어 고정밀센서 계량기
|
기본형 컨베어 고정밀센서 계량기
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ Ver 2.2.0 by CJY
|
||||||
|
- 2023.03.06
|
||||||
|
- Ver 2.1.3 Modify
|
||||||
|
- 끊김감지기능 관련 코드 삭제
|
||||||
|
|
||||||
@ Ver 2.1.3 by CJY
|
@ Ver 2.1.3 by CJY
|
||||||
- 2023.03.04
|
- 2023.03.04
|
||||||
- Ver 2.1.2 Modify
|
- Ver 2.1.2 Modify
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue