|
@ -29,6 +29,11 @@ func (the *InfoHandler) GetStage() stages.Stage { |
|
|
|
|
|
|
|
|
func (the *InfoHandler) getStationInfo(p *common_models.ProcessData) *common_models.ProcessData { |
|
|
func (the *InfoHandler) getStationInfo(p *common_models.ProcessData) *common_models.ProcessData { |
|
|
|
|
|
|
|
|
|
|
|
// TODO 测试 DeviceId = 22c76344-1eb2-4508-8aa6-4550c010e8f7 ,sensorId=18
|
|
|
|
|
|
//if p.DeviceData.DeviceId != "22c76344-1eb2-4508-8aa6-4550c010e8f7" {
|
|
|
|
|
|
// return &common_models.ProcessData{}
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
s, err := the.configHelper.GetDeviceStationObjs(p.DeviceData.DeviceId) |
|
|
s, err := the.configHelper.GetDeviceStationObjs(p.DeviceData.DeviceId) |
|
|
if err == nil && s != nil { |
|
|
if err == nil && s != nil { |
|
|
p.Stations = s |
|
|
p.Stations = s |
|
@ -64,15 +69,24 @@ func (the *InfoHandler) getFormulaInfo(p *common_models.ProcessData) { |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
panic(err) |
|
|
panic(err) |
|
|
} |
|
|
} |
|
|
for i2, device := range p.Stations[i].Info.Devices { |
|
|
//for i2, device := range p.Stations[i].Info.Devices {
|
|
|
formulaInfo, err := the.configHelper.GetFormulaInfo(device.FormulaId) |
|
|
// formulaInfo, err := the.configHelper.GetFormulaInfo(device.FormulaId)
|
|
|
|
|
|
// if err == nil {
|
|
|
|
|
|
// p.Stations[i].Info.Devices[i2].FormulaInfo = formulaInfo
|
|
|
|
|
|
// p.Stations[i].Info.Devices[i2].DeviceFactorProto = deviceFactorProto
|
|
|
|
|
|
// }
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
// TODO #TEST BEGIN 2024-10-01 测点设备没有公式信息,测试时先从设备监测原型中获取
|
|
|
|
|
|
for i2, _ := range p.Stations[i].Info.Devices { |
|
|
|
|
|
p.Stations[i].Info.Devices[i2].FormulaId = deviceFactorProto.Formula |
|
|
|
|
|
formulaInfo, err := the.configHelper.GetFormulaInfo(deviceFactorProto.Formula) |
|
|
if err == nil { |
|
|
if err == nil { |
|
|
p.Stations[i].Info.Devices[i2].FormulaInfo = formulaInfo |
|
|
p.Stations[i].Info.Devices[i2].FormulaInfo = formulaInfo |
|
|
p.Stations[i].Info.Devices[i2].DeviceFactorProto = deviceFactorProto |
|
|
p.Stations[i].Info.Devices[i2].DeviceFactorProto = deviceFactorProto |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
// #TEST END
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|