|
|
@ -69,23 +69,23 @@ func (the *InfoHandler) getFormulaInfo(p *common_models.ProcessData) { |
|
|
|
if err != nil { |
|
|
|
panic(err) |
|
|
|
} |
|
|
|
//for i2, device := range p.Stations[i].Info.Devices {
|
|
|
|
// 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) |
|
|
|
for i2, device := range p.Stations[i].Info.Devices { |
|
|
|
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 {
|
|
|
|
// p.Stations[i].Info.Devices[i2].FormulaInfo = formulaInfo
|
|
|
|
// p.Stations[i].Info.Devices[i2].DeviceFactorProto = deviceFactorProto
|
|
|
|
// }
|
|
|
|
//}
|
|
|
|
// #TEST END
|
|
|
|
} |
|
|
|
} |
|
|
|