diff --git a/INT69DC_7C/Forms/FormInformation.cs b/INT69DC_7C/Forms/FormInformation.cs index eb41f75..f5a6aed 100644 --- a/INT69DC_7C/Forms/FormInformation.cs +++ b/INT69DC_7C/Forms/FormInformation.cs @@ -142,7 +142,7 @@ namespace INT69DC_7C.Forms } private void DefaultSetting() { - this.labelDisplayVer.Text = "12.0.0"; + this.labelDisplayVer.Text = "12.1.0"; if(this.ParentForm.SystemConfig.EquipmentMode == 7) this.labelTitleMainboardName.Text = "INT68M-2A"; else @@ -393,7 +393,9 @@ namespace INT69DC_7C.Forms { this.ParentForm.SystemConfig.CurrentForm = DataStore.FormStore.FormInformation; this.ParentForm.TransferDataStream(CommunicationCommand.Read, CommunicationID.MainBoard, CommunicationAddress._1500_ProgramVersion, ""); - SerialMgrComm.serialPort_GetVersion(); + + if (this.ParentForm.FlagDllSerial == true) + SerialMgrComm.serialPort_GetVersion(); if (this.ParentForm.SystemConfig.IsLogin == true) UserManager.UserManager_GetVersion(); diff --git a/INT69DC_7C/Forms/FormMain.Designer.cs b/INT69DC_7C/Forms/FormMain.Designer.cs index b97d9b1..0b1c00c 100644 --- a/INT69DC_7C/Forms/FormMain.Designer.cs +++ b/INT69DC_7C/Forms/FormMain.Designer.cs @@ -48,6 +48,7 @@ this.smartTCPMultiServer = new SmartX.SmartTCPMultiServer(); this.timerTimeOutTransmission = new System.Windows.Forms.Timer(); this.timerUserList = new System.Windows.Forms.Timer(); + this.smartSerialPortLink = new SmartX.SmartSerialPort(); ((System.ComponentModel.ISupportInitialize)(this.smartForm)).BeginInit(); this.SuspendLayout(); // @@ -177,6 +178,27 @@ this.timerUserList.Interval = 1000; this.timerUserList.Tick += new System.EventHandler(this.timerUserList_Tick); // + // smartSerialPortLink + // + this.smartSerialPortLink.Baud_Rate = SmartX.SmartSerialPort.BAUDRATE._115200bps; + this.smartSerialPortLink.ErrorCheckCodeType = SmartX.SmartSerialPort.ERRORCHECKCODETYPES.ASCIICODE; + this.smartSerialPortLink.ErrorCheckMode = SmartX.SmartSerialPort.ERRORCHECK.NONE; + this.smartSerialPortLink.ErrorCode_Location = SmartX.SmartSerialPort.ERRORCODELOCATION.HEADER; + this.smartSerialPortLink.ETXCode = ((byte)(3)); + this.smartSerialPortLink.ETXCodes = null; + this.smartSerialPortLink.FrameBufferSize = ((uint)(4096u)); + this.smartSerialPortLink.FrameSeparationType = SmartX.SmartSerialPort.FRAMESEPARATIONTYPES.STXANDETX; + this.smartSerialPortLink.HeadErrorCodeOffset = 0; + this.smartSerialPortLink.PortNo = SmartX.SmartSerialPort.COMPORTNO.COM2; + this.smartSerialPortLink.ReadTimeout = -1; + this.smartSerialPortLink.ReceiveDetect = SmartX.SmartSerialPort.RECEIVEDETECTTYPE.EVENT_QUEUE; + this.smartSerialPortLink.ReceiveFrameDebugMode = false; + this.smartSerialPortLink.RS485SoftwareDetection = false; + this.smartSerialPortLink.STXCode = ((byte)(2)); + this.smartSerialPortLink.STXCodes = null; + this.smartSerialPortLink.TailErrorCodeOffset = 0; + this.smartSerialPortLink.OnReadQueueEvent += new SmartX.SmartSerialPort.ReceiveDataHandler(this.smartSerialPortLink_OnReadQueueEvent); + // // FormMain // this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); @@ -212,5 +234,6 @@ public SmartX.SmartTCPMultiServer smartTCPMultiServer; public System.Windows.Forms.Timer timerTimeOutTransmission; private System.Windows.Forms.Timer timerUserList; + private SmartX.SmartSerialPort smartSerialPortLink; } } \ No newline at end of file diff --git a/INT69DC_7C/Forms/FormMain.cs b/INT69DC_7C/Forms/FormMain.cs index 61fc0eb..a771f81 100644 --- a/INT69DC_7C/Forms/FormMain.cs +++ b/INT69DC_7C/Forms/FormMain.cs @@ -36,6 +36,8 @@ namespace INT69DC_7C.Forms private bool IsModbusCommonDataSend; // Modbus 공통 데이터 Start 시 한번 전송용 public int FlagAutomaticLogoutWarningTime; //Part11 Auto Logout private string ComPortMainToLCD; // DllSerial Port + public bool FlagDllSerial; // DllSerial 사용여부 + private string TransferNum; // 수신데이터 ID저장 (재전송 시 사용) // OPC private static int ModbusTotalBytes = 232; // 전체 bytes @@ -413,6 +415,7 @@ namespace INT69DC_7C.Forms this.BufferSmartUart = 1000000; // 1MB this.FlagThreadMessage1 = false; this.IsModbusCommonDataSend = false; + this.TransferNum = "-"; this.PathLaunchFolder = "SD Card\\"; this.PathSystemFileFolder = this.PathLaunchFolder + "SystemFile\\"; @@ -510,12 +513,18 @@ namespace INT69DC_7C.Forms this.CurrentAlarmTotalPassCnt = new Counter(this.SystemConfig.EquipmentColumns, this.SystemConfig.AlarmTotalPassCnt); - // SerialDll Initialize - this.ComPortMainToLCD = "COM2:"; - SerialMgrComm.IntializeSerialManager(); - SerialMgrComm.SerialPortMessageReceive += this.SerialPort_MessageReceive; - SerialMgrComm.SerialPortErrMessageReceive += this.SerialPort_ErrMessageReceive; - SerialMgrComm.SerialPortGetVersionDataEvent += this.Serialport_GetVersionDataEvent; + + // DllSerial 사용여부 설정 + this.FlagDllSerial = false; + if (this.FlagDllSerial == true) + { + // SerialDll Initialize + this.ComPortMainToLCD = "COM2:"; + SerialMgrComm.IntializeSerialManager(); + SerialMgrComm.SerialPortMessageReceive += this.SerialPort_MessageReceive; + SerialMgrComm.SerialPortErrMessageReceive += this.SerialPort_ErrMessageReceive; + SerialMgrComm.SerialPortGetVersionDataEvent += this.Serialport_GetVersionDataEvent; + } } private bool UI_Invoke(ThreadStart invoker) { @@ -703,7 +712,13 @@ namespace INT69DC_7C.Forms try { - SerialMgrComm.serialPortOpen(this.ComPortMainToLCD, 115200, 0, 0, 8); + if (this.FlagDllSerial == true) + SerialMgrComm.serialPortOpen(this.ComPortMainToLCD, 115200, 0, 0, 8); + else + { + if (this.smartSerialPortLink.IsOpen == false) + this.smartSerialPortLink.Open(); + } } catch { @@ -723,7 +738,10 @@ namespace INT69DC_7C.Forms } public void CloseSmartUartLink() { - SerialMgrComm.serialPortClose(this.ComPortMainToLCD); + if (this.FlagDllSerial == true) + SerialMgrComm.serialPortClose(this.ComPortMainToLCD); + else + this.smartSerialPortLink.Close(); } private bool SizeCheck(string cmd, string strTemp) @@ -884,7 +902,14 @@ namespace INT69DC_7C.Forms sb.Append(chkSum); - SerialMgrComm.serialPortMessage(this.ComPortMainToLCD, sb.ToString()); + // Serial Write + if (this.FlagDllSerial == true) + SerialMgrComm.serialPortMessage(this.ComPortMainToLCD, sb.ToString()); + else + { + if (this.smartSerialPortLink.IsOpen == true) + this.smartSerialPortLink.WriteFrame(sb.ToString(), SmartSerialPort.CODETYPES.ASCIICODE); + } // 통신 확인 로그 if (this.IsCommunicationLogOpen == true) @@ -931,7 +956,14 @@ namespace INT69DC_7C.Forms for (int i = 0; i < byteCollection.Count; i++) byteData[i] = byteCollection[i]; - SerialMgrComm.serialPortMessageByte(this.ComPortMainToLCD, byteData, byteData.Length); + // Serial Write + if (this.FlagDllSerial == true) + SerialMgrComm.serialPortMessageByte(this.ComPortMainToLCD, byteData, byteData.Length); + else + { + if (this.smartSerialPortLink.IsOpen == true) + this.smartSerialPortLink.WriteFrame(byteData); + } // 통신 확인 로그 if (this.IsCommunicationLogOpen == true) @@ -962,7 +994,14 @@ namespace INT69DC_7C.Forms sb.Append(chkSum); - SerialMgrComm.serialPortMessage(this.ComPortMainToLCD, sb.ToString()); + // Serial Write + if (this.FlagDllSerial == true) + SerialMgrComm.serialPortMessage(this.ComPortMainToLCD, sb.ToString()); + else + { + if (this.smartSerialPortLink.IsOpen == true) + this.smartSerialPortLink.WriteFrame(sb.ToString(), SmartSerialPort.CODETYPES.ASCIICODE); + } // 통신 확인 로그 if (this.IsCommunicationLogOpen == true) @@ -998,6 +1037,46 @@ namespace INT69DC_7C.Forms { } } + private void ReceiveData() + { + int ret = 0; + string strTemp = ""; + byte[] readByte; + + SmartSerialPort.FRAMEDATAREADSTATUS receiveDataState = SmartSerialPort.FRAMEDATAREADSTATUS.EMPTY; + + receiveDataState = this.smartSerialPortLink.ReadQueue(out readByte); + strTemp = Encoding.Default.GetString(readByte, 0, readByte.Length); + + if ((receiveDataState == SmartSerialPort.FRAMEDATAREADSTATUS.EMPTY) || (receiveDataState == SmartSerialPort.FRAMEDATAREADSTATUS.FAILDATA)) + { + return; + } + + try + { + switch (strTemp[0]) + { + case 'C': + if ((ret = this.ReceiveCommandC(strTemp)) != 0) + return; + break; + case 'P': + if ((ret = this.ReceiveCommandP(strTemp)) != 0) + return; + break; + case 'S': + if ((ret = this.ReceiveCommandS(strTemp)) != 0) + return; + break; + default: + break; + } + } + catch + { + } + } private int ReceiveCommandC(string strTemp) { @@ -1169,6 +1248,7 @@ namespace INT69DC_7C.Forms { int ret = 0; string cmd = "", lane = "", receiveData = ""; + string transferNum = ""; // SIZE 확인 if (this.SizeCheck("S", strTemp) == false) @@ -1192,6 +1272,7 @@ namespace INT69DC_7C.Forms this.smartFileCommunicationLog.WriteString(string.Format("Receive ({0:yyyy-MM-dd HH:mm:ss}): {1}", DateTime.Now, strTemp)); cmd = strTemp.Substring(0, 3); + transferNum = strTemp.Substring(3, 1); lane = strTemp.Substring(5, 1); receiveData = strTemp.Substring(10, strTemp.Length - 12); @@ -1202,6 +1283,11 @@ namespace INT69DC_7C.Forms return ret; break; case "SR0": + if (this.TransferNum != transferNum) + this.TransferNum = transferNum; + else + return ret = -1; + if ((ret = this.ReceiveCommandSR0(lane, receiveData)) != 0) return ret; break; @@ -5062,6 +5148,7 @@ namespace INT69DC_7C.Forms { if (this.SystemConfig.IsWeightViewForward == true) { + #region Forward DataStore.JudgmentStatus jStatus = DataStore.JudgmentStatus.Empty; bool result1 = false; @@ -5096,10 +5183,12 @@ namespace INT69DC_7C.Forms if (this.SystemConfig.EthernetOperationMode == 3) this.Update30000ModbusData(i); - } + } + #endregion } else { + #region Reverse DataStore.JudgmentStatus jStatus = DataStore.JudgmentStatus.Empty; bool result1 = false; @@ -5119,8 +5208,8 @@ namespace INT69DC_7C.Forms { for (int i = 1; i <= this.SystemConfig.EquipmentColumns; i++) { - if (this.CollJudgmentStatus[i] == DataStore.JudgmentStatus.Pass) - this.CollJudgmentStatus[i] = DataStore.JudgmentStatus.EXNg; + if (this.CollJudgmentStatus[this.SystemConfig.EquipmentColumns - i] == DataStore.JudgmentStatus.Pass) + this.CollJudgmentStatus[this.SystemConfig.EquipmentColumns - i] = DataStore.JudgmentStatus.EXNg; } } } @@ -5134,7 +5223,8 @@ namespace INT69DC_7C.Forms if (this.SystemConfig.EthernetOperationMode == 3) this.Update30000ModbusData(this.CollectionWeightData.Count - i); - } + } + #endregion } } else if (this.SystemConfig.CurrentForm == DataStore.FormStore.FormEquipmentTest) @@ -7970,41 +8060,20 @@ namespace INT69DC_7C.Forms sb.Append(string.Format("IN{0:D3}", system.EquipmentID)); sb.Append(string.Format("{0:D4}", system.ProductNumber)); - if (system.IsWeightViewForward == true) + for (int i = 0; i < system.EquipmentColumns; i++) { - for (int i = 0; i < system.EquipmentColumns; i++) - { - if (datas[i].JudgmentStatus == DataStore.JudgmentStatus.Under) - sb.Append("U"); - else if (datas[i].JudgmentStatus == DataStore.JudgmentStatus.Pass) - sb.Append("P"); - else if (datas[i].JudgmentStatus == DataStore.JudgmentStatus.Over) - sb.Append("O"); - else if (datas[i].JudgmentStatus == DataStore.JudgmentStatus.Double) - sb.Append("D"); - else - sb.Append("E"); + if (datas[i].JudgmentStatus == DataStore.JudgmentStatus.Under) + sb.Append("U"); + else if (datas[i].JudgmentStatus == DataStore.JudgmentStatus.Pass) + sb.Append("P"); + else if (datas[i].JudgmentStatus == DataStore.JudgmentStatus.Over) + sb.Append("O"); + else if (datas[i].JudgmentStatus == DataStore.JudgmentStatus.Double) + sb.Append("D"); + else + sb.Append("E"); - sb.Append(Helper.StringBlankFillDigits6(Helper.DoubleToString(datas[i].Weight, system.DecimalPlaces))); - } - } - else - { - for (int i = 1; i <= system.EquipmentColumns; i++) - { - if (datas[datas.Count - i].JudgmentStatus == DataStore.JudgmentStatus.Under) - sb.Append("U"); - else if (datas[datas.Count - i].JudgmentStatus == DataStore.JudgmentStatus.Pass) - sb.Append("P"); - else if (datas[datas.Count - i].JudgmentStatus == DataStore.JudgmentStatus.Over) - sb.Append("O"); - else if (datas[datas.Count - i].JudgmentStatus == DataStore.JudgmentStatus.Double) - sb.Append("D"); - else - sb.Append("E"); - - sb.Append(Helper.StringBlankFillDigits6(Helper.DoubleToString(datas[datas.Count - i].Weight, system.DecimalPlaces))); - } + sb.Append(Helper.StringBlankFillDigits6(Helper.DoubleToString(datas[i].Weight, system.DecimalPlaces))); } return sb.ToString(); @@ -8016,29 +8085,11 @@ namespace INT69DC_7C.Forms sb.Append(string.Format("IN{0:D3}", system.EquipmentID)); sb.Append(string.Format("{0:D4}", system.ProductNumber)); - if (system.IsWeightViewForward == true) + for (int i = 0; i < system.EquipmentColumns; i++) { - for (int i = 0; i < system.EquipmentColumns; i++) + if (system.EquipmentMode == 2) { - if (this.SystemConfig.EquipmentMode == 2) - { - if (datas[i].IsUpdate == true) - { - if (datas[i].JudgmentStatus == DataStore.JudgmentStatus.Under) - sb.Append("U"); - else if (datas[i].JudgmentStatus == DataStore.JudgmentStatus.Pass) - sb.Append("P"); - else if (datas[i].JudgmentStatus == DataStore.JudgmentStatus.Over) - sb.Append("O"); - else if (datas[i].JudgmentStatus == DataStore.JudgmentStatus.Double) - sb.Append("D"); - else - sb.Append("E"); - } - else - sb.Append("E"); - } - else + if (datas[i].IsUpdate == true) { if (datas[i].JudgmentStatus == DataStore.JudgmentStatus.Under) sb.Append("U"); @@ -8051,48 +8102,24 @@ namespace INT69DC_7C.Forms else sb.Append("E"); } - - sb.Append(Helper.StringBlankFillDigits6(Helper.DoubleToString(datas[i].Weight, system.DecimalPlaces))); - } - } - else - { - for (int i = 1; i <= system.EquipmentColumns; i++) - { - if (this.SystemConfig.EquipmentMode == 2) - { - if (datas[datas.Count - i].IsUpdate == true) - { - if (datas[datas.Count - i].JudgmentStatus == DataStore.JudgmentStatus.Under) - sb.Append("U"); - else if (datas[datas.Count - i].JudgmentStatus == DataStore.JudgmentStatus.Pass) - sb.Append("P"); - else if (datas[datas.Count - i].JudgmentStatus == DataStore.JudgmentStatus.Over) - sb.Append("O"); - else if (datas[datas.Count - i].JudgmentStatus == DataStore.JudgmentStatus.Double) - sb.Append("D"); - else - sb.Append("E"); - } - else - sb.Append("E"); - } else - { - if (datas[datas.Count - i].JudgmentStatus == DataStore.JudgmentStatus.Under) - sb.Append("U"); - else if (datas[datas.Count - i].JudgmentStatus == DataStore.JudgmentStatus.Pass) - sb.Append("P"); - else if (datas[datas.Count - i].JudgmentStatus == DataStore.JudgmentStatus.Over) - sb.Append("O"); - else if (datas[datas.Count - i].JudgmentStatus == DataStore.JudgmentStatus.Double) - sb.Append("D"); - else - sb.Append("E"); - } - - sb.Append(Helper.StringBlankFillDigits6(Helper.DoubleToString(datas[datas.Count - i].Weight, system.DecimalPlaces))); + sb.Append("E"); } + else + { + if (datas[i].JudgmentStatus == DataStore.JudgmentStatus.Under) + sb.Append("U"); + else if (datas[i].JudgmentStatus == DataStore.JudgmentStatus.Pass) + sb.Append("P"); + else if (datas[i].JudgmentStatus == DataStore.JudgmentStatus.Over) + sb.Append("O"); + else if (datas[i].JudgmentStatus == DataStore.JudgmentStatus.Double) + sb.Append("D"); + else + sb.Append("E"); + } + + sb.Append(Helper.StringBlankFillDigits6(Helper.DoubleToString(datas[i].Weight, system.DecimalPlaces))); } return sb.ToString(); @@ -8147,44 +8174,22 @@ namespace INT69DC_7C.Forms sb.Append(string.Format("IN{0:D3}", system.EquipmentID)); sb.Append(string.Format("{0:D4}", system.ProductNumber)); - sb.Append(Helper.StringBlankFillDigits6(Helper.StringToDecimalPlaces(pItem.PassRange, system.DecimalPlaces))); - if (this.SystemConfig.IsWeightViewForward == true) + for (int i = 0; i < system.EquipmentColumns; i++) { - for (int i = 0; i < this.SystemConfig.EquipmentColumns; i++) - { - if (datas[i].JudgmentStatus == DataStore.JudgmentStatus.Under) - sb.Append("U"); - else if (datas[i].JudgmentStatus == DataStore.JudgmentStatus.Pass) - sb.Append("P"); - else if (datas[i].JudgmentStatus == DataStore.JudgmentStatus.Over) - sb.Append("O"); - else if (datas[i].JudgmentStatus == DataStore.JudgmentStatus.Double) - sb.Append("D"); - else - sb.Append("E"); + if (datas[i].JudgmentStatus == DataStore.JudgmentStatus.Under) + sb.Append("U"); + else if (datas[i].JudgmentStatus == DataStore.JudgmentStatus.Pass) + sb.Append("P"); + else if (datas[i].JudgmentStatus == DataStore.JudgmentStatus.Over) + sb.Append("O"); + else if (datas[i].JudgmentStatus == DataStore.JudgmentStatus.Double) + sb.Append("D"); + else + sb.Append("E"); - sb.Append(Helper.StringBlankFillDigits6(Helper.DoubleToString(datas[i].Weight, system.DecimalPlaces))); - } - } - else - { - for (int i = 1; i <= this.SystemConfig.EquipmentColumns; i++) - { - if (datas[datas.Count - i].JudgmentStatus == DataStore.JudgmentStatus.Under) - sb.Append("U"); - else if (datas[datas.Count - i].JudgmentStatus == DataStore.JudgmentStatus.Pass) - sb.Append("P"); - else if (datas[datas.Count - i].JudgmentStatus == DataStore.JudgmentStatus.Over) - sb.Append("O"); - else if (datas[datas.Count - i].JudgmentStatus == DataStore.JudgmentStatus.Double) - sb.Append("D"); - else - sb.Append("E"); - - sb.Append(Helper.StringBlankFillDigits6(Helper.DoubleToString(datas[datas.Count - i].Weight, system.DecimalPlaces))); - } + sb.Append(Helper.StringBlankFillDigits6(Helper.DoubleToString(datas[i].Weight, system.DecimalPlaces))); } return sb.ToString(); @@ -8195,32 +8200,13 @@ namespace INT69DC_7C.Forms sb.Append(string.Format("IN{0:D3}", system.EquipmentID)); sb.Append(string.Format("{0:D4}", system.ProductNumber)); - sb.Append(Helper.StringBlankFillDigits6(Helper.StringToDecimalPlaces(pItem.PassRange, system.DecimalPlaces))); - if (this.SystemConfig.IsWeightViewForward == true) + for (int i = 0; i < system.EquipmentColumns; i++) { - for (int i = 0; i < this.SystemConfig.EquipmentColumns; i++) + if (system.EquipmentMode == 2) { - if (this.SystemConfig.EquipmentMode == 2) - { - if (datas[i].IsUpdate == true) - { - if (datas[i].JudgmentStatus == DataStore.JudgmentStatus.Under) - sb.Append("U"); - else if (datas[i].JudgmentStatus == DataStore.JudgmentStatus.Pass) - sb.Append("P"); - else if (datas[i].JudgmentStatus == DataStore.JudgmentStatus.Over) - sb.Append("O"); - else if (datas[i].JudgmentStatus == DataStore.JudgmentStatus.Double) - sb.Append("D"); - else - sb.Append("E"); - } - else - sb.Append("E"); - } - else + if (datas[i].IsUpdate == true) { if (datas[i].JudgmentStatus == DataStore.JudgmentStatus.Under) sb.Append("U"); @@ -8233,48 +8219,24 @@ namespace INT69DC_7C.Forms else sb.Append("E"); } - - sb.Append(Helper.StringBlankFillDigits6(Helper.DoubleToString(datas[i].Weight, system.DecimalPlaces))); - } - } - else - { - for (int i = 1; i <= this.SystemConfig.EquipmentColumns; i++) - { - if (this.SystemConfig.EquipmentMode == 2) - { - if (datas[datas.Count - i].IsUpdate == true) - { - if (datas[datas.Count - i].JudgmentStatus == DataStore.JudgmentStatus.Under) - sb.Append("U"); - else if (datas[datas.Count - i].JudgmentStatus == DataStore.JudgmentStatus.Pass) - sb.Append("P"); - else if (datas[datas.Count - i].JudgmentStatus == DataStore.JudgmentStatus.Over) - sb.Append("O"); - else if (datas[datas.Count - i].JudgmentStatus == DataStore.JudgmentStatus.Double) - sb.Append("D"); - else - sb.Append("E"); - } - else - sb.Append("E"); - } else - { - if (datas[datas.Count - i].JudgmentStatus == DataStore.JudgmentStatus.Under) - sb.Append("U"); - else if (datas[datas.Count - i].JudgmentStatus == DataStore.JudgmentStatus.Pass) - sb.Append("P"); - else if (datas[datas.Count - i].JudgmentStatus == DataStore.JudgmentStatus.Over) - sb.Append("O"); - else if (datas[datas.Count - i].JudgmentStatus == DataStore.JudgmentStatus.Double) - sb.Append("D"); - else - sb.Append("E"); - } - - sb.Append(Helper.StringBlankFillDigits6(Helper.DoubleToString(datas[datas.Count - i].Weight, system.DecimalPlaces))); + sb.Append("E"); } + else + { + if (datas[i].JudgmentStatus == DataStore.JudgmentStatus.Under) + sb.Append("U"); + else if (datas[i].JudgmentStatus == DataStore.JudgmentStatus.Pass) + sb.Append("P"); + else if (datas[i].JudgmentStatus == DataStore.JudgmentStatus.Over) + sb.Append("O"); + else if (datas[i].JudgmentStatus == DataStore.JudgmentStatus.Double) + sb.Append("D"); + else + sb.Append("E"); + } + + sb.Append(Helper.StringBlankFillDigits6(Helper.DoubleToString(datas[i].Weight, system.DecimalPlaces))); } return sb.ToString(); @@ -8337,41 +8299,20 @@ namespace INT69DC_7C.Forms sb.Append(Helper.StringBlankFillDigits6(Helper.StringToDecimalPlaces(pItem.OverRange, system.DecimalPlaces))); sb.Append(Helper.StringBlankFillDigits6(Helper.StringToDecimalPlaces(pItem.TareRange, system.DecimalPlaces))); - if (this.SystemConfig.IsWeightViewForward == true) + for (int i = 0; i < system.EquipmentColumns; i++) { - for (int i = 0; i < this.SystemConfig.EquipmentColumns; i++) - { - if (datas[i].JudgmentStatus == DataStore.JudgmentStatus.Under) - sb.Append("U"); - else if (datas[i].JudgmentStatus == DataStore.JudgmentStatus.Pass) - sb.Append("P"); - else if (datas[i].JudgmentStatus == DataStore.JudgmentStatus.Over) - sb.Append("O"); - else if (datas[i].JudgmentStatus == DataStore.JudgmentStatus.Double) - sb.Append("D"); - else - sb.Append("E"); + if (datas[i].JudgmentStatus == DataStore.JudgmentStatus.Under) + sb.Append("U"); + else if (datas[i].JudgmentStatus == DataStore.JudgmentStatus.Pass) + sb.Append("P"); + else if (datas[i].JudgmentStatus == DataStore.JudgmentStatus.Over) + sb.Append("O"); + else if (datas[i].JudgmentStatus == DataStore.JudgmentStatus.Double) + sb.Append("D"); + else + sb.Append("E"); - sb.Append(Helper.StringBlankFillDigits6(Helper.DoubleToString(datas[i].Weight, system.DecimalPlaces))); - } - } - else - { - for (int i = 1; i <= this.SystemConfig.EquipmentColumns; i++) - { - if (datas[datas.Count - i].JudgmentStatus == DataStore.JudgmentStatus.Under) - sb.Append("U"); - else if (datas[datas.Count - i].JudgmentStatus == DataStore.JudgmentStatus.Pass) - sb.Append("P"); - else if (datas[datas.Count - i].JudgmentStatus == DataStore.JudgmentStatus.Over) - sb.Append("O"); - else if (datas[datas.Count - i].JudgmentStatus == DataStore.JudgmentStatus.Double) - sb.Append("D"); - else - sb.Append("E"); - - sb.Append(Helper.StringBlankFillDigits6(Helper.DoubleToString(datas[datas.Count - i].Weight, system.DecimalPlaces))); - } + sb.Append(Helper.StringBlankFillDigits6(Helper.DoubleToString(datas[i].Weight, system.DecimalPlaces))); } return sb.ToString(); @@ -8388,29 +8329,11 @@ namespace INT69DC_7C.Forms sb.Append(Helper.StringBlankFillDigits6(Helper.StringToDecimalPlaces(pItem.OverRange, system.DecimalPlaces))); sb.Append(Helper.StringBlankFillDigits6(Helper.StringToDecimalPlaces(pItem.TareRange, system.DecimalPlaces))); - if (this.SystemConfig.IsWeightViewForward == true) + for (int i = 0; i < system.EquipmentColumns; i++) { - for (int i = 0; i < this.SystemConfig.EquipmentColumns; i++) + if (system.EquipmentMode == 2) { - if (this.SystemConfig.EquipmentMode == 2) - { - if (datas[i].IsUpdate == true) - { - if (datas[i].JudgmentStatus == DataStore.JudgmentStatus.Under) - sb.Append("U"); - else if (datas[i].JudgmentStatus == DataStore.JudgmentStatus.Pass) - sb.Append("P"); - else if (datas[i].JudgmentStatus == DataStore.JudgmentStatus.Over) - sb.Append("O"); - else if (datas[i].JudgmentStatus == DataStore.JudgmentStatus.Double) - sb.Append("D"); - else - sb.Append("E"); - } - else - sb.Append("E"); - } - else + if (datas[i].IsUpdate == true) { if (datas[i].JudgmentStatus == DataStore.JudgmentStatus.Under) sb.Append("U"); @@ -8423,48 +8346,24 @@ namespace INT69DC_7C.Forms else sb.Append("E"); } - - sb.Append(Helper.StringBlankFillDigits6(Helper.DoubleToString(datas[i].Weight, system.DecimalPlaces))); - } - } - else - { - for (int i = 1; i <= this.SystemConfig.EquipmentColumns; i++) - { - if (this.SystemConfig.EquipmentMode == 2) - { - if (datas[datas.Count - i].IsUpdate == true) - { - if (datas[datas.Count - i].JudgmentStatus == DataStore.JudgmentStatus.Under) - sb.Append("U"); - else if (datas[datas.Count - i].JudgmentStatus == DataStore.JudgmentStatus.Pass) - sb.Append("P"); - else if (datas[datas.Count - i].JudgmentStatus == DataStore.JudgmentStatus.Over) - sb.Append("O"); - else if (datas[datas.Count - i].JudgmentStatus == DataStore.JudgmentStatus.Double) - sb.Append("D"); - else - sb.Append("E"); - } - else - sb.Append("E"); - } else - { - if (datas[datas.Count - i].JudgmentStatus == DataStore.JudgmentStatus.Under) - sb.Append("U"); - else if (datas[datas.Count - i].JudgmentStatus == DataStore.JudgmentStatus.Pass) - sb.Append("P"); - else if (datas[datas.Count - i].JudgmentStatus == DataStore.JudgmentStatus.Over) - sb.Append("O"); - else if (datas[datas.Count - i].JudgmentStatus == DataStore.JudgmentStatus.Double) - sb.Append("D"); - else - sb.Append("E"); - } - - sb.Append(Helper.StringBlankFillDigits6(Helper.DoubleToString(datas[datas.Count - i].Weight, system.DecimalPlaces))); + sb.Append("E"); } + else + { + if (datas[i].JudgmentStatus == DataStore.JudgmentStatus.Under) + sb.Append("U"); + else if (datas[i].JudgmentStatus == DataStore.JudgmentStatus.Pass) + sb.Append("P"); + else if (datas[i].JudgmentStatus == DataStore.JudgmentStatus.Over) + sb.Append("O"); + else if (datas[i].JudgmentStatus == DataStore.JudgmentStatus.Double) + sb.Append("D"); + else + sb.Append("E"); + } + + sb.Append(Helper.StringBlankFillDigits6(Helper.DoubleToString(datas[i].Weight, system.DecimalPlaces))); } return sb.ToString(); @@ -11758,6 +11657,20 @@ namespace INT69DC_7C.Forms this.timerTimeoutOPT4_OnlineCheck.Enabled = false; this.ChildFormMainDisplay.UpdateFeedbackBoardStatusDisplay(false); } + private void timerTimeOutTransmission_Tick(object sender, EventArgs e) + { + this.timerTimeOutTransmission.Enabled = false; + + this.IntegratedTransmission(this.CollectionWeightData); + + foreach (WeightData data in this.CollectionWeightData) + data.IsUpdate = false; + } + private void timerUserList_Tick(object sender, EventArgs e) + { + this.timerUserList.Enabled = false; + UserManager.UserManager_GetUserListName(); + } private void smartThread_UIThreadFunction(ThreadArgs args) { @@ -11922,47 +11835,21 @@ namespace INT69DC_7C.Forms } } - private void smartTimer1_Tick(object sender, EventArgs e) + private void smartSerialPortLink_OnReadQueueEvent() { - this.smartTimer1.Stop(); + this.ReceiveData(); - this.DefaultSetting2(); - this.Update30000ModbusData(); - for (int i = 0; i < this.SystemConfig.EquipmentColumns; i++) - this.Update30000ModbusData(i); - - this.smartForm.Show((int)DataStore.FormStore.FormMainDisplay); - - // 통신 OPEN - this.OpenSmartUartLink(); - - // Serial3 통신 Open - this.UartCom3Open(); - - Thread.Sleep(100); - // 초기 파라미터 전송 - this.TransferDataStream(CommunicationCommand.Read, CommunicationID.MainBoard, CommunicationAddress._6901_ParameterRead, ""); - - if (this.SystemConfig.IsOptFeedbackBoardUse == true && this.SystemConfig.Serial3Mode == 4) - this.UartCom3FeedbackBoardBooting(); - - // UserManager_GetUserListName - this.timerUserList.Enabled = true; - } - - private void timerTimeOutTransmission_Tick(object sender, EventArgs e) - { - this.timerTimeOutTransmission.Enabled = false; - - this.IntegratedTransmission(this.CollectionWeightData); - - foreach (WeightData data in this.CollectionWeightData) - data.IsUpdate = false; - } - private void timerUserList_Tick(object sender, EventArgs e) - { - this.timerUserList.Enabled = false; - UserManager.UserManager_GetUserListName(); + // 통신 확인 + if (this.CommunicationCheckCount / 3 == 1) + { + this.ChildFormMainDisplay.pictureBoxCommunicationStatus.Visible = true; + this.CommunicationCheckCount = 0; + } + else + { + this.ChildFormMainDisplay.pictureBoxCommunicationStatus.Visible = false; + this.CommunicationCheckCount += 1; + } } #region DLL_SerialportEvent @@ -12238,6 +12125,34 @@ namespace INT69DC_7C.Forms this.ChildFormInformation.UpdatePart11AesEncryptionVersionDisplay(data.ToString()); } #endregion + + private void smartTimer1_Tick(object sender, EventArgs e) + { + this.smartTimer1.Stop(); + + this.DefaultSetting2(); + this.Update30000ModbusData(); + for (int i = 0; i < this.SystemConfig.EquipmentColumns; i++) + this.Update30000ModbusData(i); + + this.smartForm.Show((int)DataStore.FormStore.FormMainDisplay); + + // 통신 OPEN + this.OpenSmartUartLink(); + + // Serial3 통신 Open + this.UartCom3Open(); + + Thread.Sleep(100); + // 초기 파라미터 전송 + this.TransferDataStream(CommunicationCommand.Read, CommunicationID.MainBoard, CommunicationAddress._6901_ParameterRead, ""); + + if (this.SystemConfig.IsOptFeedbackBoardUse == true && this.SystemConfig.Serial3Mode == 4) + this.UartCom3FeedbackBoardBooting(); + + // UserManager_GetUserListName + this.timerUserList.Enabled = true; + } #endregion } } \ No newline at end of file diff --git a/INT69DC_7C/Forms/FormMain.resx b/INT69DC_7C/Forms/FormMain.resx index c1974ed..1f3d031 100644 --- a/INT69DC_7C/Forms/FormMain.resx +++ b/INT69DC_7C/Forms/FormMain.resx @@ -171,6 +171,9 @@ 17, 93 + + 342, 93 + WEBPAD diff --git a/INT69DC_7C/Version.txt b/INT69DC_7C/Version.txt index 006230d..95c878a 100644 --- a/INT69DC_7C/Version.txt +++ b/INT69DC_7C/Version.txt @@ -21,6 +21,16 @@ Ƽ 8,10,12 /ƽ 跮 */ +@ Ver 12.1.0 by LSJ + - 2024.12.09 + - Ver 12.0.0 Modify + - Framework : SmartX Framework V3.2.4(update: 2021.01.20) + - SerialDll ̻ + SmartSerialPort + - ߷ ǥ Reverse , ǵ + ٲ㼭 ߴµ, Ҷ ٲ㼭 . + ȭ ǥö, ۵Ͷ ȸ. + @ Ver 12.0.0 by LSJ - 2024.10.29 - Ver 11.4.5 Modify