From 252ad9f55e8828bcacb8ddef28c8e9ff0a62f8d6 Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期一, 27 十一月 2023 15:41:39 +0800 Subject: [PATCH] 计算工时,生产条形码 --- model/common/common.go | 28 ++++++++++++++++++++++++---- 1 files changed, 24 insertions(+), 4 deletions(-) diff --git a/model/common/common.go b/model/common/common.go index f92ae17..e47b1fd 100644 --- a/model/common/common.go +++ b/model/common/common.go @@ -78,8 +78,11 @@ Method constvar.PlcMethod `gorm:"type:varchar(191)" json:"method"` //comment:鎺ュ彛鏂瑰紡 Address string `gorm:"type:varchar(191)" json:"address"` //plc ip鍦板潃锛� method = modbusTCP鐢� Port int `gorm:"type:int(11)" json:"port"` //plc 绔彛鍙凤紝 method = modbusTCP鐢� - BaudRate int `gorm:"type:int(11)" json:"baudRate"` //涓插彛娉㈢壒鐜囷紝 method = serial鏃� 鐢� - SerialName string `gorm:"type:int(11)" json:"serialName"` //涓插彛鍚嶇О锛宮ethod = serial鏃� 鐢� + BaudRate int `gorm:"type:int(11)" json:"baudRate"` //涓插彛娉㈢壒鐜囷紝 method = serial鎴杕odbusRTU 鏃剁敤 + SerialName string `gorm:"type:int(11)" json:"serialName"` //涓插彛鍚嶇О锛宮ethod = serial鎴杕odbusRTU 鏃剁敤 + DataBit int `gorm:"type:int(11)" json:"dataBit"` //鏁版嵁浣嶏紝method = modbusRTU 鐢� + StopBit int `gorm:"type:int(11)" json:"stopBit"` //鍋滄浣嶏紝method = modbusRTU 鐢� + Parity constvar.Parity `gorm:"type:int(11)" json:"parity"` //鏍¢獙鏂瑰紡锛宮ethod = modbusRTU 鐢� IsOpen bool `gorm:"type:tinyint(1)" json:"isOpen"` Detail string `gorm:"type:varchar(2048)" json:"-"` Details []*PlcAddress `gorm:"-" json:"details"` @@ -129,6 +132,8 @@ ID string `gorm:"comment:涓婚敭ID;primaryKey;type:varchar(191);" json:"id"` DeviceProcedureAttr []*DeviceProcedureAttr `json:"deviceProcedureAttr"` // 璁惧宸ュ簭灞炴�у垪琛� ExtChannelAmount int `gorm:"type:tinyint;comment:棰濆鐨勯�氶亾鏁伴噺;default:0;" json:"extChannelAmount"` + DeviceName string `json:"deviceName"` + DeviceMac string `json:"deviceMac"` PlcAddressList []*PlcAddress PlcConfig *PlcConfig } @@ -141,8 +146,9 @@ type PullDataType string const ( - PullDataTypeProcessModel = "process_model" - PullDataTypeDevice = "device" + PullDataTypeProcessModel = "process_model" + PullDataTypeDevice = "device" + PullDataTypeProcessModelPlcAddress = "process_model_plc_address" ) // MsgPullDataRequest 鎷夊彇浜戠鏁版嵁 @@ -154,3 +160,17 @@ DataType PullDataType `json:"dataType"` //瑕佹媺鍙栫殑鏁版嵁绫诲瀷 Data interface{} //杩斿洖鐨勬暟鎹� } + +type RTUConfig struct { + BaudRate int `json:"baudRate"` //涓插彛娉㈢壒鐜囷紝 method = serial鏃� 鐢� + SerialName string `json:"serialName"` //涓插彛鍚嶇О锛宮ethod = serial鏃� 鐢� + DataBit int `gorm:"type:int(11)" json:"dataBit"` //鏁版嵁浣嶏紝method = modbusRTU 鐢� + StopBit int `gorm:"type:int(11)" json:"stopBit"` //鍋滄浣嶏紝method = modbusRTU 鐢� + Parity constvar.Parity `gorm:"type:int(11)" json:"parity"` //鏍¢獙鏂瑰紡锛宮ethod = modbusRTU 鐢� +} + +// MsgReportData 鏁版嵁涓婃姤 +type MsgReportData struct { + ReportType constvar.ReportType `json:"reportType"` //涓婃姤绫诲瀷 + Content string `json:"Content"` +} -- Gitblit v1.8.0