- Program.cs : 에러창 바로 띄우게 수정

- (버그수정)품목명 20byte 제한하도록 수정
 - (버그수정)기능설정 Backup 누르면 파일 리스트 모두 백업되게 수정
 - (버그수정)품목명 표시되는 부분 버그 수정(Transfer_22_Modbus_Read_TCP, RTU)
master V3.3.4
DESKTOP-999R8N3\CJY 2024-08-09 15:04:54 +09:00
parent 9f3b2fad32
commit 66045b3716
7 changed files with 79 additions and 58 deletions

View File

@ -536,8 +536,7 @@ namespace ITC81DB_2H.Controls
foreach (FileInfo file in files) foreach (FileInfo file in files)
{ {
if (file.Name.EndsWith(".txt") == true || file.Name.EndsWith(".jpg") == true) this.listBoxDataList.Items.Add(file.Name);
this.listBoxDataList.Items.Add(file.Name);
} }
this.labelFileCount1.Text = this.listBoxDataList.Items.Count.ToString(); this.labelFileCount1.Text = this.listBoxDataList.Items.Count.ToString();
@ -679,13 +678,17 @@ namespace ITC81DB_2H.Controls
} }
else else
{ {
after = this.labelEquipmentID.Text = myKeyPad.StringValue; if (int.Parse(this.labelEquipmentID.Text) != myKeyPad.IntValue)
{
this.ParentForm.ParentForm.Update30000ModbusItem();
after = this.labelEquipmentID.Text = myKeyPad.StringValue;
this.ParentForm.ParentForm.SystemConfig1.EquipmentID = myKeyPad.IntValue; this.ParentForm.ParentForm.SystemConfig1.EquipmentID = myKeyPad.IntValue;
this.ParentForm.ParentForm.SaveSystemConfigurationFile1(this.ParentForm.ParentForm.SystemConfig1); this.ParentForm.ParentForm.SaveSystemConfigurationFile1(this.ParentForm.ParentForm.SystemConfig1);
if (before != after) if (before != after)
this.ParentForm.ParentForm.SetTrackingHistoryData(Define.E_TrackingParameter.EquipmentID, "", before, after); this.ParentForm.ParentForm.SetTrackingHistoryData(Define.E_TrackingParameter.EquipmentID, "", before, after);
}
} }
} }
} }
@ -1115,22 +1118,10 @@ namespace ITC81DB_2H.Controls
foreach (FileInfo file in files) foreach (FileInfo file in files)
{ {
if (file.Name.Contains("Exception") == false) this.FileCopy(file, filePath + file.Name);
{
if (file.Name.EndsWith(".txt") == true || file.Name.EndsWith(".jpg") == true)
{
this.FileCopy(file, filePath + file.Name);
this.listBoxDataList.Items.Remove(file.Name); this.listBoxDataList.Items.Remove(file.Name);
file.Delete(); file.Delete();
}
//else if (file.Name.Contains("Checklog") == true)
//{
// this.FileCopy(file, filePath + file.Name);
// file.Delete();
//}
}
} }
this.labelFileCount1.Text = this.listBoxDataList.Items.Count.ToString(); this.labelFileCount1.Text = this.listBoxDataList.Items.Count.ToString();

View File

@ -25,8 +25,8 @@ namespace ITC81DB_2H.Forms
public partial class FormMain : Form public partial class FormMain : Form
{ {
#region Field #region Field
public static string DisplayVersion = "3.3.3"; public static string DisplayVersion = "3.3.4";
public static string ReleaseDate = "2024.08.06"; public static string ReleaseDate = "2024.08.09";
private SmartSplash SmartSplashProgramLoad; private SmartSplash SmartSplashProgramLoad;
public bool IsCommunicationLogOpen; public bool IsCommunicationLogOpen;
@ -5485,23 +5485,17 @@ namespace ITC81DB_2H.Forms
madeData[madeDataIndex + i] = length4Value[1 - i]; madeData[madeDataIndex + i] = length4Value[1 - i];
break; break;
case _30000_ModbusAddress._41_ProductName: case _30000_ModbusAddress._41_ProductName:
case _30000_ModbusAddress._42_ProductName: for (int i = 0; i < productName.Length; i++)
case _30000_ModbusAddress._43_ProductName:
case _30000_ModbusAddress._44_ProductName:
case _30000_ModbusAddress._45_ProductName:
case _30000_ModbusAddress._46_ProductName:
case _30000_ModbusAddress._47_ProductName:
case _30000_ModbusAddress._48_ProductName:
case _30000_ModbusAddress._49_ProductName:
case _30000_ModbusAddress._50_ProductName:
for (int i = 0; i < 20; i++)
madeData[madeDataIndex + i] = productName[i]; madeData[madeDataIndex + i] = productName[i];
break; break;
default: default:
break; break;
#endregion #endregion
} }
madeDataIndex += 2; if (j == (int)_30000_ModbusAddress._41_ProductName)
madeDataIndex += 20;
else
madeDataIndex += 2;
} }
#endregion #endregion
} }
@ -5892,23 +5886,17 @@ namespace ITC81DB_2H.Forms
madeData[madeDataIndex + i] = length4Value[1 - i]; madeData[madeDataIndex + i] = length4Value[1 - i];
break; break;
case _30000_ModbusAddress._41_ProductName: case _30000_ModbusAddress._41_ProductName:
case _30000_ModbusAddress._42_ProductName: for (int i = 0; i < productName.Length; i++)
case _30000_ModbusAddress._43_ProductName:
case _30000_ModbusAddress._44_ProductName:
case _30000_ModbusAddress._45_ProductName:
case _30000_ModbusAddress._46_ProductName:
case _30000_ModbusAddress._47_ProductName:
case _30000_ModbusAddress._48_ProductName:
case _30000_ModbusAddress._49_ProductName:
case _30000_ModbusAddress._50_ProductName:
for (int i = 0; i < 20; i++)
madeData[madeDataIndex + i] = productName[i]; madeData[madeDataIndex + i] = productName[i];
break; break;
default: default:
break; break;
#endregion #endregion
} }
madeDataIndex += 2; if (j == (int)_30000_ModbusAddress._41_ProductName)
madeDataIndex += 20;
else
madeDataIndex += 2;
} }
#endregion #endregion
} }
@ -7110,7 +7098,7 @@ namespace ITC81DB_2H.Forms
if (this.IsOPCModbusUsing == false) if (this.IsOPCModbusUsing == false)
return; return;
byte[] productName; //byte[] productName;
if (this.UpdateValue > 999999999) if (this.UpdateValue > 999999999)
this.UpdateValue = 0; this.UpdateValue = 0;
@ -7183,18 +7171,41 @@ namespace ITC81DB_2H.Forms
this.Current30000ModbusData.Speed = this.CurrentWeightData.ProductionSpeed; this.Current30000ModbusData.Speed = this.CurrentWeightData.ProductionSpeed;
this.Current30000ModbusData.MetalDetectionCount = (UInt32)this.CurrentWeightData.MetalDetectionCount; this.Current30000ModbusData.MetalDetectionCount = (UInt32)this.CurrentWeightData.MetalDetectionCount;
this.Current30000ModbusData.DoubleEntryCount = (UInt32)this.CurrentWeightData.DoubleEntryCount; this.Current30000ModbusData.DoubleEntryCount = (UInt32)this.CurrentWeightData.DoubleEntryCount;
try try
{ {
productName = new UTF8Encoding().GetBytes(this.CurrentProductItem.Name); byte[] productName = new UTF8Encoding().GetBytes(this.CurrentProductItem.Name);
for (int i = 0; i < productName.Length; i++) // 로그
this.Current30000ModbusData.ProductName[i] = productName[i]; //if (this.IsCommunicationLogOpen == true)
//{
// this.smartFileCommunicationLog.WriteString(string.Format("Update30000ModbusItem ({0:yyyy-MM-dd HH:mm:ss}): {1}, {2}", DateTime.Now, BitConverter.ToString(productName), productName.Length));
//}
if (productName.Length > 20)
{
for (int i = 0; i < 20; i++)
this.Current30000ModbusData.ProductName[i] = productName[i];
}
else
{
for (int i = 0; i < productName.Length; i++)
this.Current30000ModbusData.ProductName[i] = productName[i];
for (int i = productName.Length; i < 20; i++)
this.Current30000ModbusData.ProductName[i] = 0x20;
}
// 로그
//if (this.IsCommunicationLogOpen == true)
//{
// this.smartFileCommunicationLog.WriteString(string.Format("Update30000ModbusItem ({0:yyyy-MM-dd HH:mm:ss}): {1}, {2}", DateTime.Now, BitConverter.ToString(this.Current30000ModbusData.ProductName), this.Current30000ModbusData.ProductName.Length));
//}
} }
catch catch
{ {
productName = new UTF8Encoding().GetBytes(this.SystemConfig1.ProductNumber.ToString() + "_Name"); byte[] productName = new UTF8Encoding().GetBytes(this.SystemConfig1.ProductNumber.ToString() + "_Name");
for (int i = 0; i < productName.Length; i++) for (int i = 0; i < productName.Length; i++)
this.Current30000ModbusData.ProductName[i] = productName[i]; this.Current30000ModbusData.ProductName[i] = productName[i];
for (int i = productName.Length; i < 20; i++)
this.Current30000ModbusData.ProductName[i] = 0x20;
} }
this.ChildFormMainDisplay.MainModbus.UpdateData(this.Current30000ModbusData); this.ChildFormMainDisplay.MainModbus.UpdateData(this.Current30000ModbusData);
@ -7952,7 +7963,7 @@ namespace ITC81DB_2H.Forms
cpClientThread.Start(); cpClientThread.Start();
this.IsUsingTimerEthernetPing(true); //this.IsUsingTimerEthernetPing(true);
} }
catch catch
{ {
@ -8201,11 +8212,21 @@ namespace ITC81DB_2H.Forms
} }
public void EthernetServerSendMessage(SmartTCPMultiServer.CLIENTSINFOS client, string msg) public void EthernetServerSendMessage(SmartTCPMultiServer.CLIENTSINFOS client, string msg)
{ {
this.smartTCPMultiServer.SendStringASCIIID(client.strID, msg); if (this.smartTCPMultiServer.SendStringASCIIID(client.strID, msg) == true)
{
// 로그
if (this.IsCommunicationLogOpen == true)
this.smartFileCommunicationLog.WriteString(string.Format("Ethernet Send ({0:yyyy-MM-dd HH:mm:ss}): {1}", DateTime.Now, msg));
}
} }
public void EthernetServerSendMessage(SmartTCPMultiServer.CLIENTSINFOS client, byte[] bytes) public void EthernetServerSendMessage(SmartTCPMultiServer.CLIENTSINFOS client, byte[] bytes)
{ {
this.smartTCPMultiServer.SendByteByClientID(client.strID, bytes); if (this.smartTCPMultiServer.SendByteByClientID(client.strID, bytes) == true)
{
// 로그
if (this.IsCommunicationLogOpen == true)
this.smartFileCommunicationLog.WriteString(string.Format("Ethernet Send ({0:yyyy-MM-dd HH:mm:ss}): {1}", DateTime.Now, Encoding.Default.GetString(bytes, 0, bytes.Length)));
}
} }
#endregion #endregion

View File

@ -672,6 +672,8 @@ namespace ITC81DB_2H.Forms
value = pItem.LotNo; value = pItem.LotNo;
if (this.labelLotNo.Text != value) if (this.labelLotNo.Text != value)
this.labelLotNo.Text = value; this.labelLotNo.Text = value;
this.ParentForm.Update30000ModbusItem();
} }
public void UpdateEquipmentStatusDisplay(Define.E_EquipmentStatus status) public void UpdateEquipmentStatusDisplay(Define.E_EquipmentStatus status)
{ {

View File

@ -24,10 +24,9 @@ namespace ITC81DB_2H
} }
catch (Exception ex) catch (Exception ex)
{ {
FormMain.Exception(ex); MessageBox.Show(ex.ToString());
DialogFormMessage myMsg = new DialogFormMessage(1); FormMain.Exception(ex);
myMsg.ShowDialog();
} }
} }
} }

View File

@ -13,6 +13,14 @@
기본형 컨베어 고정밀센서 계량기 기본형 컨베어 고정밀센서 계량기
*/ */
@ Ver 3.3.4 by CJY
- 2024.08.09
- Ver 3.3.3 Modify
- Program.cs : 에러창 바로 띄우게 수정
- (버그수정)품목명 20byte 제한하도록 수정
- (버그수정)기능설정 Backup 누르면 파일 리스트 모두 백업되게 수정
- (버그수정)품목명 표시되는 부분 버그 수정(Transfer_22_Modbus_Read_TCP, RTU)
@ Ver 3.3.3 by CJY @ Ver 3.3.3 by CJY
- 2024.08.07 - 2024.08.07
- Ver 3.3.2 Modify - Ver 3.3.2 Modify