123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128 |
- package protocol
- import (
- "context"
- "github.com/gogf/gf/v2/frame/g"
- )
- type WaterSystem struct {
- WaterHeaderStatus
- WaterCollector
- OutdoorUnit
- }
- type WaterHeaderStatus struct {
- Power1 int `json:"power_1"` // 分水器-1开关 1关 0开
- Power2 int `json:"power_2"` // 分水器-2开关 1关 0开
- Power3 int `json:"power_3"` // 分水器-3开关 1关 0开
- Power4 int `json:"power_4"` // 分水器-4开关 1关 0开
- Power5 int `json:"power_5"` // 分水器-5开关 1关 0开
- Power6 int `json:"power_6"` // 分水器-6开关 1关 0开
- Power7 int `json:"power_7"` // 分水器-7开关 1关 0开
- Power8 int `json:"power_8"` // 分水器-8开关 1关 0开
- HeaderPower int `json:"header_power"` // 运行状态 1开 0关
- InletPressure float32 `json:"inlet_pressure"` // 进水压力
- OutletPressure float32 `json:"outlet_pressure"` // 出水压力
- PressureDifference float32 `json:"pressure_difference"` // 压力差
- FaultCode int `json:"fault_code"` // 故障码
- FillValve int `json:"fill_valve"` // 补水阀 0-关阀; 1-打开
- /*
- 0-第 0 档(全关)
- 1-第 1 档(30%)
- 2-第 2 挡(40%)
- 3-第 3 挡(50%)
- 4-第 4 挡(60%)
- 5-第 5 挡(70%)
- 6-第 6 档(80%)
- 7-第 7 档(全开)
- */
- BypassValve int `json:"bypass_valve"` // 旁通阀
- SetInletWaterPre float32 `json:"set_inlet_water_pre"` // 设定出水压力值
- SetMaxDifferencePre float32 `json:"set_max_difference_pre"` // 设定最大压差值
- SetMinDifferencePre float32 `json:"set_min_difference_pre"` // 设定最小压差值
- HeaderMode int `json:"header_mode"` // 模式 0-手动; 1-自动; 2-调试;
- PrimaryPumpStatus int `json:"primary_pump_status"` // 一级泵运行状态 0-关闭; 1-打开;
- SecondaryPumpStatus int `json:"secondary_pump_status"` // 二级泵运行状态 0-关闭; 1-打开;
- PrimaryPumpFrequency float32 `json:"primary_pump_frequency"` // 一级泵运行频率
- SecondaryPumpFrequency float32 `json:"secondary_pump_frequency"` // 二级泵运行频率
- WetNodeInput1 int `json:"wet_node_input_1"` // 湿节点信号输入1 0-断开; 1-闭合;
- WetNodeInput2 int `json:"wet_node_input_2"` // 湿节点信号输入2 0-断开; 1-闭合;
- WetNodeInput int `json:"wet_node_input"` // 湿节点信号输入 0-断开; 1-闭合;
- DryNodeInput int `json:"dry_node_input"` // 干节点信号输入 0-断开; 1-闭合;
- PrimaryOutletTemp float32 `json:"primary_outlet_temp"` // 一级出水温度
- PrimaryReturnTemp float32 `json:"primary_return_temp"` // 一级回水温度
- SecondaryOutletTemp float32 `json:"secondary_outlet_temp"` // 二级出水温度
- SecondaryReturnTemp float32 `json:"secondary_return_temp"` // 二级回水温度
- }
- type WaterCollector struct {
- CollectorPower int `json:"collector_power"` // 开关机设定
- PumpStationPower int `json:"pump_station_power"` // 泵站开关设定
- DeviceReset int `json:"device_reset"` // 设备软件复位
- CollectorMode int `json:"collector_mode"` // 模式
- SetTargetOutletPressure float32 `json:"set_target_outlet_pressure"` // 目标出水压力设定
- SetMaxiPressureDifference float32 `json:"set_maxi_pressure_difference"` // 最大压差设定
- SetMiniPressureDifference float32 `json:"set_mini_pressure_difference"` // 最小压差设定
- SetBypassPipeDiameter int `json:"set_bypass_pipe_diameter"` // 旁通管径设定 0 表征 25 管径; 1 表征 50 管径; 2 表征 32 管径;注:出厂已配置完成
- FillValvePower int `json:"fill_valve_power"` // 补水阀开关 0-关闭; 1-打开
- PrimaryPumpTypeConf int `json:"primary_pump_type_conf"` // 一级泵类型配置 0-定频泵;(出厂默认) 1-PWM 变频泵(定流量); 2-PWM 变频泵(变流量); 3-0-10V 变频泵(定流量); 4-0-10V 变频泵(变流量);
- SecondaryPumpTypeConf int `json:"secondary_pump_type_conf"` // 二级泵类型配置 0-定频泵; 1-PWM 变频泵(定流量); 2-PWM 变频泵(变流量);(出厂默认) 3-0-10V 变频泵(定流量); 4-0-10V 变频泵(变流量)
- PrimaryPumpControlMethod int `json:"primary_pump_control_method"` // 一级泵控制方式 0-恒压控制; 1-温差控制
- SecondaryPumpControlMethod int `json:"secondary_pump_control_method"` // 二级泵控制方式 0-恒压控制; 1-温差控制
- SetPrimaryPumpConstantPressure float32 `json:"set_primary_pump_constant_pressure"` // 一级泵恒压设定值
- SetSecondaryPumpConstantPressure float32 `json:"set_secondary_pump_constant_pressure"` // 二级泵恒压设定值
- SetPrimaryPumpConstantTempDifference float32 `json:"set_primary_pump_constant_temp_difference"` // 一级泵恒温差设定值
- SetSecondaryPumpConstantTempDifference float32 `json:"set_secondary_pump_constant_temp_difference"` // 二级泵恒温差设定值
- PrimaryPumpFrequencyLowerLimit float32 `json:"primary_pump_frequency_lower_limit"` // 一级泵泵频率下限
- PrimaryPumpFrequencyUpperLimit float32 `json:"primary_pump_frequency_upper_limit"` // 一级泵泵频率上限
- PumpPWMControlTypeConf int `json:"pump_pwm_control_type_conf"` // 泵 PWM 控类型配置 0-表征正序; 1-表征逆序
- SecondaryPumpFrequencyLowerLimit float32 `json:"secondary_pump_frequency_lower_limit"` // 二级泵泵频率下限
- SecondaryPumpFrequencyUpperLimit float32 `json:"secondary_pump_frequency_upper_limit"` // 二级泵泵频率上限
- AntiJammingFunction int `json:"anti_jamming_function"` // 防卡功能
- /*
- 0-第 0 档(全关)
- 1-第 1 档(30%)
- 2-第 2 挡(40%)
- 3-第 3 挡(50%)
- 4-第 4 挡(60%)
- 5-第 5 挡(70%)
- 6-第 6 档(80%)
- 7-第 7 档(全开)
- */
- BypassValvePower int `json:"bypass_valve_power"` // 旁通阀手动开关
- OperatingMode int `json:"operating_mode"` // 运行方式 0-单品联动;(出厂默认) 1-管家联动;
- }
- type OutdoorUnit struct {
- OutdoorMode int `json:"outdoor_mode"` // 工作模式(1制冷 2制热)
- RefrigerationWaterTemp float32 `json:"refrigeration_water_temp"` // 制冷水温设置温度
- HeatingWaterTemp float32 `json:"heating_water_temp"` // 制热水温设置温度
- OutdoorCirculationTemp float32 `json:"outdoor_circulation_temp"` // 室外循环温度
- InletWaterTemp float32 `json:"inlet_water_temp"` // 出水温度
- OutletWaterTemp float32 `json:"outlet_water_temp"` // 进水温度
- OutdoorPower int `json:"outdoor_power"` // 开关机 (1开 0关)
- Auxiliary int `json:"auxiliary"` // 辅热开关 (1开 0关)
- FaultMark int `json:"fault_mark"` // 故障标志
- }
- type TempControlCenter struct {
- PrimaryInletTemp float32 `json:"primary_inlet_temp"` // 一级进水温度
- PrimaryOutletTemp float32 `json:"primary_outlet_temp"` // 一级出水温度
- SecondaryInletTemp float32 `json:"secondary_inlet_temp"` // 二级进水温度
- SecondaryOutletTemp float32 `json:"secondary_outlet_temp"` // 二级出水温度
- DewPointTemp float32 `json:"dew_point_temp"` // 环境露点温度
- Mode int `json:"mode"` // 模式
- }
- type ControlArgs struct {
- Address int `json:"address"`
- Value interface{} `json:"value"`
- }
- func GetConfig(key string) *g.Var {
- ret, err := g.Cfg().Get(context.Background(), key)
- if err != nil {
- }
- return ret
- }
|