버그 수정

master V2.1.0
DESKTOP-999R8N3\CJY 2023-03-03 10:45:35 +09:00
parent a6b8faaec3
commit 18a795294d
10 changed files with 246 additions and 151 deletions

View File

@ -631,7 +631,7 @@ namespace ITC81DB_0H
int temp = 0; int temp = 0;
#region Calibration #region Calibration
this.labelBalanceWeight.Text = Helper.CommunicationWeightValueToString(item.BalanceWeight, this.ParentForm.ParentForm.SystemConfig1.DecimalPlaces); this.labelBalanceWeight.Text = Helper.StringToDecimalPlaces(item.BalanceWeight, this.ParentForm.ParentForm.SystemConfig1.DecimalPlaces);
if (this.ParentForm.ParentForm.SystemConfig1.DecimalPlaces == 1) if (this.ParentForm.ParentForm.SystemConfig1.DecimalPlaces == 1)
this.labelDecimalPoint.Text = "0.0"; this.labelDecimalPoint.Text = "0.0";
else if (this.ParentForm.ParentForm.SystemConfig1.DecimalPlaces == 2) else if (this.ParentForm.ParentForm.SystemConfig1.DecimalPlaces == 2)
@ -709,8 +709,10 @@ namespace ITC81DB_0H
this.labelIsAutoZeroUsing.Text = "OFF"; this.labelIsAutoZeroUsing.Text = "OFF";
break; break;
} }
this.labelPlusRange.Text = Helper.RemoveZeroNumberString(item.AutoZeroPlusRange); this.labelPlusRange.Text = Helper.StringToDecimalPlaces(int.Parse(item.AutoZeroPlusRange).ToString(),
this.labelMinusRange.Text = Helper.RemoveZeroNumberString(item.AutoZeroMinusRange); this.ParentForm.ParentForm.SystemConfig1.DecimalPlaces);
this.labelMinusRange.Text = Helper.StringToDecimalPlaces(int.Parse(item.AutoZeroMinusRange).ToString(),
this.ParentForm.ParentForm.SystemConfig1.DecimalPlaces);
temp = int.Parse(item.AutoZeroVariate); temp = int.Parse(item.AutoZeroVariate);
switch (temp) switch (temp)
{ {

View File

@ -107,9 +107,12 @@ namespace ITC81DB_0H
} }
} }
private string ReturnCommunicationModeName(int num) private string ReturnCommunicationModeName(int num)
{
if (this.ParentForm.ParentForm.SystemConfig2.IsCommunicationOption == true)
{ {
if (this.ParentForm.ParentForm.SystemConfig1.Language == DataStore.LanguageID.German) if (this.ParentForm.ParentForm.SystemConfig1.Language == DataStore.LanguageID.German)
{ {
#region German
switch (num) switch (num)
{ {
case 0: case 0:
@ -150,12 +153,22 @@ namespace ITC81DB_0H
return "OPT3"; return "OPT3";
case 18: case 18:
return "HP-200"; return "HP-200";
case 19:
return "Smart Jet";
case 20:
return "imaje 9410 OPT3";
case 22:
return "Modbus";
case 23:
return "STD2";
default: default:
return "Keiner"; return "Keiner";
} }
#endregion
} }
else else
{ {
#region else
switch (num) switch (num)
{ {
case 0: case 0:
@ -196,11 +209,65 @@ namespace ITC81DB_0H
return "OPT3"; return "OPT3";
case 18: case 18:
return "HP-200"; return "HP-200";
case 19:
return "Smart Jet";
case 20:
return "imaje 9410 OPT3";
case 22:
return "Modbus";
case 23:
return "STD2";
default: default:
return "None"; return "None";
} }
#endregion
} }
} }
else
{
if (this.ParentForm.ParentForm.SystemConfig1.Language == DataStore.LanguageID.German)
{
#region German
switch (num)
{
case 0:
return "Keiner";
case 1:
return "STD1";
case 2:
return "Fernzugriff";
case 3:
return "Drucker";
case 4:
return "STD2";
default:
return "Keiner";
}
#endregion
}
else
{
#region else
switch (num)
{
case 0:
return "None";
case 1:
return "STD1";
case 2:
return "Remote";
case 3:
return "Printer";
case 4:
return "STD2";
default:
return "None";
}
#endregion
}
}
}
private string ReturnBoolValue(bool bValue) private string ReturnBoolValue(bool bValue)
{ {
if (bValue == true) if (bValue == true)

View File

@ -236,10 +236,7 @@ namespace ITC81DB_0H.Controls
case DataStore.WeightStatus.CalWait: case DataStore.WeightStatus.CalWait:
// 분동중량 표시 // 분동중량 표시
this.IsCalibrationFinish = false; this.IsCalibrationFinish = false;
if (this.ParentForm.ParentForm.SystemConfig1.DecimalPlaces == 1) this.labelWeight.Text = string.Format("-{0}", this.labelBalanceWeight.Text);
this.labelWeight.Text = "-500.0";
else
this.labelWeight.Text = "-500.00";
this.labelWeight.ForeColor = this.NormalColor; this.labelWeight.ForeColor = this.NormalColor;
break; break;
case DataStore.WeightStatus.CalStandby: case DataStore.WeightStatus.CalStandby:
@ -279,11 +276,7 @@ namespace ITC81DB_0H.Controls
break; break;
case DataStore.WeightStatus.CalBalans: case DataStore.WeightStatus.CalBalans:
// 분동중량표시 // 분동중량표시
if (this.ParentForm.ParentForm.SystemConfig1.DecimalPlaces == 1) this.labelWeight.Text = string.Format("-{0}", this.labelBalanceWeight.Text);
this.labelWeight.Text = "-500.0";
else
this.labelWeight.Text = "-500.00";
this.labelWeight.ForeColor = this.NormalColor;
this.CalibrationButtonEnable(false, false, true); this.CalibrationButtonEnable(false, false, true);
this.CalibrationPictureBoxVisible(false, false, true); this.CalibrationPictureBoxVisible(false, false, true);
break; break;
@ -364,7 +357,7 @@ namespace ITC81DB_0H.Controls
{ {
string value = ""; string value = "";
value = Helper.CommunicationWeightValueToString(item.BalanceWeight, this.ParentForm.ParentForm.SystemConfig1.DecimalPlaces); value = Helper.StringToDecimalPlaces(item.BalanceWeight, this.ParentForm.ParentForm.SystemConfig1.DecimalPlaces);
if (this.labelBalanceWeight.Text != value) if (this.labelBalanceWeight.Text != value)
this.labelBalanceWeight.Text = value; this.labelBalanceWeight.Text = value;
} }

View File

@ -532,7 +532,7 @@ namespace ITC81DB_0H.Controls
catch catch
{ {
this.ParentForm.ParentForm.smartConfigs.IPSettings.DeviceIP = "192.168.3.10"; this.ParentForm.ParentForm.smartConfigs.IPSettings.DeviceIP = "192.168.3.10";
this.ParentForm.ParentForm.smartConfigs.IPSettings.SubNetMask = "255.255.255.255"; this.ParentForm.ParentForm.smartConfigs.IPSettings.SubNetMask = "255.255.255.0";
this.ParentForm.ParentForm.smartConfigs.IPSettings.GateWay = "192.168.3.1"; this.ParentForm.ParentForm.smartConfigs.IPSettings.GateWay = "192.168.3.1";
this.UpdateLocalIPAddressDisplay(); this.UpdateLocalIPAddressDisplay();

View File

@ -2762,7 +2762,7 @@ namespace ITC81DB_0H
this.IsCommunicationOption = false; this.IsCommunicationOption = false;
this.IsPingTimerUsing = true; this.IsPingTimerUsing = true;
this.IsEthernetPingTimer = false; this.IsEthernetPingTimer = true;
this.ModbusTCPStartAddress = 10; this.ModbusTCPStartAddress = 10;
this.ModbusRTUStartAddressCOM1 = 10; this.ModbusRTUStartAddressCOM1 = 10;
this.ModbusRTUStartAddressCOM3 = 10; this.ModbusRTUStartAddressCOM3 = 10;
@ -5712,21 +5712,21 @@ namespace ITC81DB_0H
#region Method #region Method
public void Initialization() public void Initialization()
{ {
this.BalanceWeight = "0"; this.BalanceWeight = "2000";
this.Filter = "8"; this.Filter = "4";
this.JudgmentDelay = "1000"; this.JudgmentDelay = "350";
this.DoubleDelay = "900"; this.DoubleDelay = "200";
this.JudgmentNumber = "10"; this.JudgmentNumber = "10";
this.Speed = "60"; this.Speed = "70";
this.Dynamic = "1000000"; this.Dynamic = "1000000";
this.SorterAMode = "0"; this.SorterAMode = "0";
this.SorterADelay = "1"; this.SorterADelay = "100";
this.SorterAOperation = "1000"; this.SorterAOperation = "100";
this.SorterBMode = "0"; this.SorterBMode = "0";
this.SorterBDelay = "1"; this.SorterBDelay = "100";
this.SorterBOperation = "1000"; this.SorterBOperation = "100";
this.DoubleEntry = "0"; this.DoubleEntry = "0";
this.ExternalInput = "0"; this.ExternalInput = "0";
this.ETCNG = "0"; this.ETCNG = "0";
@ -5737,23 +5737,23 @@ namespace ITC81DB_0H
this.TareRange = "0"; this.TareRange = "0";
this.ExternalOutput1Mode = "0"; this.ExternalOutput1Mode = "0";
this.ExternalOutput1Delay = "500"; this.ExternalOutput1Delay = "100";
this.ExternalOutput1Operation = "1000"; this.ExternalOutput1Operation = "100";
this.ExternalOutput2Mode = "0"; this.ExternalOutput2Mode = "0";
this.ExternalOutput2Delay = "500"; this.ExternalOutput2Delay = "100";
this.ExternalOutput2Operation = "1000"; this.ExternalOutput2Operation = "100";
this.ExternalOutput3Mode = "0"; this.ExternalOutput3Mode = "0";
this.ExternalOutput3Delay = "500"; this.ExternalOutput3Delay = "100";
this.ExternalOutput3Operation = "1000"; this.ExternalOutput3Operation = "100";
this.ExternalOutput4Mode = "0"; this.ExternalOutput4Mode = "0";
this.ExternalOutput4Delay = "500"; this.ExternalOutput4Delay = "100";
this.ExternalOutput4Operation = "1000"; this.ExternalOutput4Operation = "100";
this.ExternalOutput5Mode = "0"; this.ExternalOutput5Mode = "0";
this.ExternalOutput5Delay = "500"; this.ExternalOutput5Delay = "100";
this.ExternalOutput5Operation = "1000"; this.ExternalOutput5Operation = "100";
this.ExternalOutput6Mode = "0"; this.ExternalOutput6Mode = "0";
this.ExternalOutput6Delay = "500"; this.ExternalOutput6Delay = "100";
this.ExternalOutput6Operation = "1000"; this.ExternalOutput6Operation = "100";
this.PhotoB = "1"; this.PhotoB = "1";
this.PI3 = "3"; this.PI3 = "3";

View File

@ -42,6 +42,7 @@ 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 int PingFalseCount;
private byte[] ClientSendDatabyteArray; private byte[] ClientSendDatabyteArray;
@ -335,6 +336,7 @@ 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.PingFalseCount = 0;
this.PingTrueCount = 0; this.PingTrueCount = 0;
@ -1335,8 +1337,8 @@ namespace ITC81DB_0H.Forms
#region Test 용 통신 로그 #region Test 용 통신 로그
fullPath = this.PathDataBackupFolder + "Communicationlog.txt"; fullPath = this.PathDataBackupFolder + "Communicationlog.txt";
this.smartFileCommunicationLog.FilePathName = fullPath; this.smartFileCommunicationLog.FilePathName = fullPath;
this.smartFileCommunicationLog.Open(); //this.smartFileCommunicationLog.Open();
this.IsCommunicationLogOpen = true; //this.IsCommunicationLogOpen = true;
#endregion #endregion
#region Error Check 용 통신 로그 #region Error Check 용 통신 로그
@ -7901,9 +7903,6 @@ namespace ITC81DB_0H.Forms
if (null != this.EthernetTcpClient) if (null != this.EthernetTcpClient)
this.EthernetTcpClient.Close(); this.EthernetTcpClient.Close();
if (this.IsCommunicationLogOpen == true)
this.smartFileCommunicationLog.WriteString(string.Format("Client ({0:yyyy-MM-dd HH:mm:ss}): Disconnect", DateTime.Now));
} }
private void EthernetClientReceiveThread() private void EthernetClientReceiveThread()
@ -7938,7 +7937,11 @@ namespace ITC81DB_0H.Forms
while (this.IsEthernetThreadStop == false) while (this.IsEthernetThreadStop == false)
{ {
string strRecvMsg = this.EthernetStmReader.ReadLine(); string strRecvMsg = "";
char[] datas = new char[12];
int sum = 0;
//string strRecvMsg = this.EthernetStmReader.ReadLine();
this.TimerWaitResponseEnabled(false); this.TimerWaitResponseEnabled(false);
this.TimerPingDisabled(); this.TimerPingDisabled();
@ -7946,8 +7949,18 @@ namespace ITC81DB_0H.Forms
if (this.ResponseFailCount > 0) if (this.ResponseFailCount > 0)
this.ResponseFailCount = 0; this.ResponseFailCount = 0;
try
{
this.EthernetStmReader.Read(datas, 0, datas.Length);
for (int i = 0; i < datas.Length; i++)
sum += datas[i];
if (sum == 0)
return;
strRecvMsg = BitConverter.ToString(Encoding.UTF8.GetBytes(datas));
if (this.IsCommunicationLogOpen == true) if (this.IsCommunicationLogOpen == true)
this.smartFileCommunicationLog.WriteString(string.Format("Client Receive ({0:yyyy-MM-dd HH:mm:ss}): {1}", DateTime.Now, strRecvMsg)); this.smartFileCommunicationLog.WriteString(string.Format("EthernetClientReceiveThread Receive ({0:yyyy-MM-dd HH:mm:ss}): {1}", DateTime.Now, strRecvMsg));
if (null == strRecvMsg) if (null == strRecvMsg)
{ {
@ -7958,6 +7971,12 @@ namespace ITC81DB_0H.Forms
this.DelegateTextStatusOut(strRecvMsg); this.DelegateTextStatusOut(strRecvMsg);
} }
catch
{
this.DelegateTextStatusOut(">Server Out");
this.IsEthernetThreadStop = true;
}
}
} }
catch catch
{ {
@ -8019,8 +8038,11 @@ namespace ITC81DB_0H.Forms
{ {
try try
{ {
this.EthernetStmWriter.WriteLine(msg); this.EthernetStmWriter.Write(msg);
this.EthernetStmWriter.Flush(); this.EthernetStmWriter.Flush();
if (this.IsCommunicationLogOpen == true)
this.smartFileCommunicationLog.WriteString(string.Format("EthernetSendMessage Send string ({0:yyyy-MM-dd HH:mm:ss}): {1}", DateTime.Now, msg));
} }
catch catch
{ {
@ -8032,8 +8054,11 @@ namespace ITC81DB_0H.Forms
{ {
try try
{ {
this.EthernetStmWriter.WriteLine(msg); this.EthernetStmWriter.BaseStream.Write(msg, 0, msg.Length);
this.EthernetStmWriter.Flush(); this.EthernetStmWriter.Flush();
if (this.IsCommunicationLogOpen == true)
this.smartFileCommunicationLog.WriteString(string.Format("EthernetSendMessage Send byte[] ({0:yyyy-MM-dd HH:mm:ss}): {1}", DateTime.Now, BitConverter.ToString(msg)));
} }
catch catch
{ {
@ -8045,8 +8070,11 @@ namespace ITC81DB_0H.Forms
{ {
try try
{ {
this.EthernetStmWriter.WriteLine(msg); this.EthernetStmWriter.Write(msg);
this.EthernetStmWriter.Flush(); this.EthernetStmWriter.Flush();
if (this.IsCommunicationLogOpen == true)
this.smartFileCommunicationLog.WriteString(string.Format("EthernetSendMessage Send byte ({0:yyyy-MM-dd HH:mm:ss}): {1}", DateTime.Now, msg));
} }
catch catch
{ {
@ -12147,6 +12175,15 @@ namespace ITC81DB_0H.Forms
} }
this.ThreadEthernetPing.Join(); this.ThreadEthernetPing.Join();
//if (this.GCCount > 1800)
//{
// System.GC.Collect();
// System.GC.WaitForPendingFinalizers();
// this.GCCount = 0;
//}
//else
// this.GCCount++;
} }
#endregion #endregion
#endregion #endregion

View File

@ -25,6 +25,8 @@ namespace ITC81DB_0H.Forms
ThreadStart ThreadDelegate; ThreadStart ThreadDelegate;
Thread ThreadClientConnected; Thread ThreadClientConnected;
private int GCCount;
private DataStore.MainDisplayStore CurrentDisplay; private DataStore.MainDisplayStore CurrentDisplay;
public ControlMainDisplayWeightBigScreen MainDisplayWeightBigScreen; public ControlMainDisplayWeightBigScreen MainDisplayWeightBigScreen;
@ -205,6 +207,8 @@ 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()
{ {
@ -1037,6 +1041,15 @@ namespace ITC81DB_0H.Forms
} }
this.ThreadClientConnected.Join(); this.ThreadClientConnected.Join();
//if (this.GCCount > 1800)
//{
// System.GC.Collect();
// System.GC.WaitForPendingFinalizers();
// this.GCCount = 0;
//}
//else
// this.GCCount++;
} }
} }
catch (Exception ex) catch (Exception ex)

View File

@ -137,23 +137,6 @@ namespace ITC81DB_0H
} }
} }
/// <summary>
/// 통신으로 받은 중량 값(소수점 미포함)을 소수점 자리수에 마추어 찍어주는 함수
/// </summary>
/// <param name="value"></param>
/// <param name="decimalPlaces"></param>
/// <returns></returns>
public static string CommunicationWeightValueToString(string value, int decimalPlaces)
{
string sValue = "";
double dValue = 0.0;
dValue = Helper.StringToWeight(value, decimalPlaces);
sValue = Helper.DoubleToString(dValue, decimalPlaces);
return sValue;
}
public static DataStore.JudgmentStatus StringToJudgmentStatus(string value) public static DataStore.JudgmentStatus StringToJudgmentStatus(string value)
{ {
if (value.Length != 2) if (value.Length != 2)