Merge branch 'master' into SJ_Branch
# Conflicts: # INT69DC_7C/Forms/FormInformation.cs # INT69DC_7C/Version.txtmaster
						commit
						33c01ae072
					
				|  | @ -142,7 +142,8 @@ namespace INT69DC_7C.Forms | |||
|         } | ||||
|         private void DefaultSetting() | ||||
|         { | ||||
|             this.labelDisplayVer.Text = "12.2.3"; | ||||
|             this.labelDisplayVer.Text = "12.3.0"; | ||||
| 
 | ||||
|             if(this.ParentForm.SystemConfig.EquipmentMode == 7) | ||||
|                 this.labelTitleMainboardName.Text = "INT68M-2A"; | ||||
|             else | ||||
|  |  | |||
|  | @ -515,14 +515,16 @@ namespace INT69DC_7C.Forms | |||
| 
 | ||||
| 
 | ||||
|             // DllSerial 사용여부 설정 | ||||
|             this.FlagDllSerial = false; | ||||
|             this.FlagDllSerial = true; | ||||
|             if (this.FlagDllSerial == true) | ||||
|             { | ||||
|                 // SerialDll Initialize | ||||
|                 this.ComPortMainToLCD = "COM2:"; | ||||
|                 SerialMgrComm.IntializeSerialManager(); | ||||
|                 SerialMgrComm.SerialPortMessageReceive += this.SerialPort_MessageReceive; | ||||
|                 SerialMgrComm.SerialPortErrMessageReceive += this.SerialPort_ErrMessageReceive; | ||||
|                 //SerialMgrComm.SerialPortMessageReceive += this.SerialPort_MessageReceive; | ||||
|                 //SerialMgrComm.SerialPortErrMessageReceive += this.SerialPort_ErrMessageReceive; | ||||
|                 SerialMgrComm.SerialPortStrMessageReceive += this.SerialPort_StrMessageReceive; | ||||
|                 SerialMgrComm.SerialPortErrStrMessageReceive += this.SerialPort_ErrStrMessageReceive; | ||||
|                 SerialMgrComm.SerialPortGetVersionDataEvent += this.Serialport_GetVersionDataEvent; | ||||
|             } | ||||
|         } | ||||
|  | @ -590,6 +592,13 @@ namespace INT69DC_7C.Forms | |||
|                 this.Serialport_ReceiveDataEvent(data.ToString()); | ||||
|             }); | ||||
|         } | ||||
|         private void SerialPort_StrMessageReceive(object data) | ||||
|         { | ||||
|             this.UI_Invoke(delegate | ||||
|            { | ||||
|                this.Serialport_ReceiveDataEvent(data.ToString()); | ||||
|            }); | ||||
|         } | ||||
|         private void SerialPort_ErrMessageReceive(object data) | ||||
|         { | ||||
|             this.UI_Invoke(delegate | ||||
|  | @ -598,6 +607,14 @@ namespace INT69DC_7C.Forms | |||
|                     this.smartFileCommunicationLog.WriteString(string.Format("Receive ({0:yyyy-MM-dd HH:mm:ss}): {1} : Dll(Err MSG)", DateTime.Now, data)); | ||||
|             }); | ||||
|         } | ||||
|         private void SerialPort_ErrStrMessageReceive(object data) | ||||
|         { | ||||
|             this.UI_Invoke(delegate | ||||
|             { | ||||
|                 if (this.IsCommunicationLogOpen == true) | ||||
|                     this.smartFileCommunicationLog.WriteString(string.Format("Receive ({0:yyyy-MM-dd HH:mm:ss}): {1} : Dll(Err MSG)", DateTime.Now, data)); | ||||
|             }); | ||||
|         } | ||||
| 
 | ||||
|         private void TrasferSystemParameter(SystemConfigurationItem item) | ||||
|         { | ||||
|  |  | |||
|  | @ -27,9 +27,15 @@ namespace INT69DC_7C.SerialManger | |||
|         public delegate void fnSerialMgrRcvPacketCB(StringBuilder commPort, IntPtr pData, int length); | ||||
|         public static fnSerialMgrRcvPacketCB fnSerialMgrRcvPacketCallback; | ||||
| 
 | ||||
|         public delegate void fnSerialMgrRcvPacketStrCB(StringBuilder commPort, StringBuilder pMessage, int length); | ||||
|         public static fnSerialMgrRcvPacketStrCB fnSerialMgrRcvPacketStrCallback; | ||||
| 
 | ||||
|         public delegate void fnSerialMgrRcvErrPacketCB(StringBuilder commPort, IntPtr pData, int length); | ||||
|         public static fnSerialMgrRcvErrPacketCB fnSerialMgrRcvErrPacketCallback; | ||||
| 
 | ||||
|         public delegate void fnSerialMgrRcvErrPacketStrCB(StringBuilder commPort, StringBuilder pMessage, int length); | ||||
|         public static fnSerialMgrRcvErrPacketStrCB fnSerialMgrRcvErrPacketStrCallback; | ||||
| 
 | ||||
|         [DllImport(PathDll, CallingConvention = CallingConvention.Winapi)] | ||||
|         public static extern void DLL_SerialMgr_Register_DebugCB(fnSerialMgrDebugCB func); | ||||
| 
 | ||||
|  | @ -42,9 +48,15 @@ namespace INT69DC_7C.SerialManger | |||
|         [DllImport(PathDll, CallingConvention = CallingConvention.Winapi)] | ||||
|         public static extern void DLL_SerialMgr_Register_RcvPacketCB(fnSerialMgrRcvPacketCB func); | ||||
| 
 | ||||
|         [DllImport(PathDll, CallingConvention = CallingConvention.Winapi)] | ||||
|         public static extern void DLL_SerialMgr_Register_RcvPacketStrCB(fnSerialMgrRcvPacketStrCB func); | ||||
| 
 | ||||
|         [DllImport(PathDll, CallingConvention = CallingConvention.Winapi)] | ||||
|         public static extern void DLL_SerialMgr_Register_RcvErrPacketCB(fnSerialMgrRcvErrPacketCB func); | ||||
| 
 | ||||
|         [DllImport(PathDll, CallingConvention = CallingConvention.Winapi)] | ||||
|         public static extern void DLL_SerialMgr_Register_RcvErrPacketStrCB(fnSerialMgrRcvErrPacketStrCB func); | ||||
| 
 | ||||
|         [DllImport(PathDll, CallingConvention = CallingConvention.Winapi)] | ||||
|         public static extern void DLL_SerialMgr_HelloWorld(); | ||||
| 
 | ||||
|  |  | |||
|  | @ -14,7 +14,9 @@ namespace INT69DC_7C.SerialManger | |||
|     { | ||||
|         public delegate void ObjectEventHandler(object data); | ||||
|         public static event ObjectEventHandler SerialPortMessageReceive; | ||||
|         public static event ObjectEventHandler SerialPortStrMessageReceive; | ||||
|         public static event ObjectEventHandler SerialPortErrMessageReceive; | ||||
|         public static event ObjectEventHandler SerialPortErrStrMessageReceive; | ||||
|         public static event ObjectEventHandler SerialPortGetVersionDataEvent; | ||||
| 
 | ||||
|         public static void IntializeSerialManager() | ||||
|  | @ -31,11 +33,17 @@ namespace INT69DC_7C.SerialManger | |||
|             fnSerialVersionCallback = serialVersionCallback; | ||||
|             DLL_SerialMgr_Register_VersionCB(fnSerialVersionCallback); | ||||
| 
 | ||||
|             fnSerialMgrRcvPacketCallback = serialRcvPacketMsgCallback; | ||||
|             DLL_SerialMgr_Register_RcvPacketCB(fnSerialMgrRcvPacketCallback); | ||||
|             //fnSerialMgrRcvPacketCallback = serialRcvPacketMsgCallback; | ||||
|             //DLL_SerialMgr_Register_RcvPacketCB(fnSerialMgrRcvPacketCallback); | ||||
| 
 | ||||
|             fnSerialMgrRcvErrPacketCallback = serialRcvErrPacketMsgCallback; | ||||
|             DLL_SerialMgr_Register_RcvErrPacketCB(fnSerialMgrRcvErrPacketCallback); | ||||
|             fnSerialMgrRcvPacketStrCallback = serialRcvPacketStrMsgCallback; | ||||
|             DLL_SerialMgr_Register_RcvPacketStrCB(fnSerialMgrRcvPacketStrCallback); | ||||
| 
 | ||||
|             //fnSerialMgrRcvErrPacketCallback = serialRcvErrPacketMsgCallback; | ||||
|             //DLL_SerialMgr_Register_RcvErrPacketCB(fnSerialMgrRcvErrPacketCallback); | ||||
| 
 | ||||
|             fnSerialMgrRcvErrPacketStrCallback = serialRcvErrPacketStrMsgCallback; | ||||
|             DLL_SerialMgr_Register_RcvErrPacketStrCB(fnSerialMgrRcvErrPacketStrCallback); | ||||
| 
 | ||||
|             // test | ||||
|             //DLL_SerialMgr_HelloWorld(); | ||||
|  | @ -90,7 +98,6 @@ namespace INT69DC_7C.SerialManger | |||
|             } | ||||
|         } | ||||
| 
 | ||||
|         // https://stackoverflow.com/questions/22938756/how-to-marshal-c-array-to-c-sharp-via-intptr | ||||
|         public static void serialRcvPacketMsgCallback(StringBuilder commPort, IntPtr pData, int length) | ||||
|         { | ||||
|             try | ||||
|  | @ -108,39 +115,29 @@ namespace INT69DC_7C.SerialManger | |||
| 
 | ||||
|                 if (SerialPortMessageReceive != null) | ||||
|                     SerialPortMessageReceive(sdata); | ||||
| 
 | ||||
| #if TEST_CB | ||||
|                 String commPortStr = commPort.ToString(); | ||||
| 
 | ||||
|                 serialPortMessageByte(commPortStr, data, length); | ||||
| #endif | ||||
| 
 | ||||
| 
 | ||||
|                 //Console.Write("comm port : " + commPort + ", length = " + length.ToString() + "\n"); | ||||
| #if TEST_DEBUG | ||||
|                 // https://stackoverflow.com/questions/1342922/console-writeline-as-hexadecimal | ||||
|                 int index = 0; | ||||
|                 foreach (byte temp in data) | ||||
|                 { | ||||
|                     Console.Write(temp.ToString("X2") + " "); | ||||
|                     index++; | ||||
| 
 | ||||
|                     if (index % 16 == 0) Console.Write("\n"); | ||||
|                 } | ||||
| 
 | ||||
|                 Console.Write("\n"); | ||||
| #endif | ||||
| 
 | ||||
|                 //data = null; | ||||
| 
 | ||||
|                 //GC.Collect(); | ||||
|                 //GC.WaitForPendingFinalizers(); | ||||
|             } | ||||
|             catch (Exception e) | ||||
|             { | ||||
|                 throw (e); | ||||
|             } | ||||
|         } | ||||
|         public static void serialRcvPacketStrMsgCallback(StringBuilder commPort, StringBuilder pMessage, int length) | ||||
|         { | ||||
|             try | ||||
|             { | ||||
|                 if (commPort.Length == 0) | ||||
|                     return; | ||||
| 
 | ||||
|                 if (length == 0) | ||||
|                     return; | ||||
| 
 | ||||
|                 if (SerialPortStrMessageReceive != null) | ||||
|                     SerialPortStrMessageReceive(pMessage); | ||||
|             } | ||||
|             catch  | ||||
|             { | ||||
|             } | ||||
|         } | ||||
| 
 | ||||
|         public static void serialRcvErrPacketMsgCallback(StringBuilder commPort, IntPtr pData, int length) | ||||
|         { | ||||
|  | @ -159,41 +156,29 @@ namespace INT69DC_7C.SerialManger | |||
| 
 | ||||
|                 if (SerialPortErrMessageReceive != null) | ||||
|                     SerialPortErrMessageReceive(sdata); | ||||
| 
 | ||||
|                 //String commPortStr = commPort.ToString(); | ||||
|                 //serialPortMessageByte(commPortStr, data, length); | ||||
| 
 | ||||
|                 //Console.Write("Err : comm port : " + commPort + ", length = " + length.ToString() + "\n"); | ||||
| 
 | ||||
| #if (TEST_DEBUG1) | ||||
|                 // https://stackoverflow.com/questions/1342922/console-writeline-as-hexadecimal | ||||
|                 int index = 0; | ||||
|                 foreach (byte temp in data) | ||||
|                 { | ||||
|                     Console.Write(temp.ToString("X2") + " "); | ||||
|                     index++; | ||||
| 
 | ||||
|                     if (index == 5) break; | ||||
| 
 | ||||
|                     if (index % 16 == 0) Console.Write("\n"); | ||||
|                 } | ||||
| 
 | ||||
|                 Console.Write("\n"); | ||||
| #endif | ||||
| 
 | ||||
|                 // https://dhshin94.tistory.com/135 | ||||
|                 //data = null; | ||||
| 
 | ||||
|                 //GC.Collect(); | ||||
|                 //GC.WaitForPendingFinalizers(); | ||||
| 
 | ||||
|             } | ||||
|             catch (Exception e) | ||||
|             { | ||||
|                 throw (e); | ||||
|             } | ||||
|         } | ||||
|         public static void serialRcvErrPacketStrMsgCallback(StringBuilder commPort, StringBuilder pMessage, int length) | ||||
|         { | ||||
|             try | ||||
|             { | ||||
|                 if (commPort.Length == 0) | ||||
|                     return; | ||||
| 
 | ||||
|                 if (length == 0) | ||||
|                     return; | ||||
| 
 | ||||
|                 if (SerialPortErrStrMessageReceive != null) | ||||
|                     SerialPortErrStrMessageReceive(pMessage); | ||||
|             } | ||||
|             catch  | ||||
|             { | ||||
|             } | ||||
|         } | ||||
|         #endregion  // DLL_CALLBACK | ||||
| 
 | ||||
|         #region DLL_COMMAND | ||||
|  | @ -204,7 +189,6 @@ namespace INT69DC_7C.SerialManger | |||
| 
 | ||||
|             DLL_SerialMgr_PortOpen(pCommPort, BaudRate, stopBit, parity, dataBit); | ||||
|         } | ||||
| 
 | ||||
|         public static void serialPortClose(String commPort) | ||||
|         { | ||||
|             IntPtr pCommPort = Marshal.StringToBSTR(commPort.ToString()); | ||||
|  | @ -212,7 +196,6 @@ namespace INT69DC_7C.SerialManger | |||
|             DLL_SerialMgr_PortClose(pCommPort); | ||||
|         } | ||||
| 
 | ||||
| 
 | ||||
|         public static void serialPortMessageByte(String commport, byte[] data, int length) | ||||
|         { | ||||
|             IntPtr pCommPort = Marshal.StringToBSTR(commport.ToString()); | ||||
|  | @ -229,9 +212,6 @@ namespace INT69DC_7C.SerialManger | |||
|           //  if (SerialPortMessageReceive != null) | ||||
|           //      SerialPortMessageReceive(sdata); | ||||
|         } | ||||
| 
 | ||||
| 
 | ||||
|         //https://stackoverflow.com/questions/13418795/convert-byte-array-to-structure-in-the-compact-framework | ||||
|         public static void serialPortMessage(String commPort, String Message) | ||||
|         { | ||||
|             IntPtr pCommPort = Marshal.StringToBSTR(commPort.ToString()); | ||||
|  |  | |||
|  | @ -23,6 +23,15 @@ | |||
| 	멀티형 8,10,12열 컨베어/스틱 계량기 | ||||
| */ | ||||
| 
 | ||||
| @ Ver 12.3.0 by LSJ | ||||
| 	- 2025.02.27 | ||||
| 	- Ver 12.2.1 Modify | ||||
| 	- Framework : SmartX Framework V3.2.4(update: 2021.01.20) | ||||
| 	- SerialDll 사용 | ||||
| 	  Serial callback 수정(string) | ||||
| 	  serialRcvPacketStrMsgCallback | ||||
| 	  serialRcvErrPacketStrMsgCallback | ||||
| 
 | ||||
| @ Ver 12.2.3 by LSJ | ||||
| 	- 2025.03.13 | ||||
| 	- Ver 12.2.2 Modify | ||||
|  | @ -32,7 +41,7 @@ | |||
| 	  중량 설정값 추가 | ||||
| 	  OPT6 : STX[1],ID[5],NO[4],PASS CNT[7],NG CNT[7],TOTAL CNT[9],{GRD[1],WEIGHT[6]} * n,ETX[1] | ||||
| 	  --> STX[1],ID[5],NO[4],UNDER[6],PASS[6],OVER[6],TARE[6],PASS CNT[7],NG CNT[7],TOTAL CNT[9],{GRD[1],WEIGHT[6]} * n,ETX[1] | ||||
| 
 | ||||
| 	   | ||||
| @ Ver 12.2.2 by LSJ | ||||
| 	- 2025.03.04 | ||||
| 	- Ver 12.2.1 Modify | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue