|
|
@ -65,7 +65,7 @@ func (the Adaptor_AXYES_GDKS) getTemplateStr(sensorData models.Source) string { |
|
|
case models.AXY_FactorType_BMWY: |
|
|
case models.AXY_FactorType_BMWY: |
|
|
templateStr = "{{.structUploadCode}}{{.sensorType}}{{.sensorCode}};{{.sensorType}};{{.sensorName}};{{.longitude}};{{.latitude}};{{.height}};" + |
|
|
templateStr = "{{.structUploadCode}}{{.sensorType}}{{.sensorCode}};{{.sensorType}};{{.sensorName}};{{.longitude}};{{.latitude}};{{.height}};" + |
|
|
"{{.x}}|{{.y}}|{{.z}}||||{{.xAcc}}|{{.yAcc}}|{{.zAcc}};{{.unit}};{{.state}};{{.time}}^" |
|
|
"{{.x}}|{{.y}}|{{.z}}||||{{.xAcc}}|{{.yAcc}}|{{.zAcc}};{{.unit}};{{.state}};{{.time}}^" |
|
|
case models.AXY_FactorType_Rain_New: |
|
|
case models.AXY_FactorType_Rain_New, models.AXY_FactorType_Rain_New_o: |
|
|
templateStr = "{{.structUploadCode}}{{.sensorType}}{{.sensorCode}};{{.sensorType}};{{.sensorName}};{{.longitude}};{{.latitude}};{{.height}};" + |
|
|
templateStr = "{{.structUploadCode}}{{.sensorType}}{{.sensorCode}};{{.sensorType}};{{.sensorName}};{{.longitude}};{{.latitude}};{{.height}};" + |
|
|
"{{.totrainfall}};{{.unit}};{{.state}};{{.time}}^" |
|
|
"{{.totrainfall}};{{.unit}};{{.state}};{{.time}}^" |
|
|
case models.AXY_FactorType_SBSPWY: |
|
|
case models.AXY_FactorType_SBSPWY: |
|
|
@ -149,7 +149,7 @@ func (the Adaptor_AXYES_GDKS) getTemplateObj(sensorData models.Source) map[strin |
|
|
templateMap["x"] = fmt.Sprintf("%.3f", sensorData.Data["x"]) |
|
|
templateMap["x"] = fmt.Sprintf("%.3f", sensorData.Data["x"]) |
|
|
templateMap["y"] = fmt.Sprintf("%.3f", sensorData.Data["y"]) |
|
|
templateMap["y"] = fmt.Sprintf("%.3f", sensorData.Data["y"]) |
|
|
templateMap["unit"] = "mm" |
|
|
templateMap["unit"] = "mm" |
|
|
case models.AXY_FactorType_Rain_New: |
|
|
case models.AXY_FactorType_Rain_New, models.AXY_FactorType_Rain_New_o: |
|
|
templateMap["totrainfall"] = fmt.Sprintf("%.3f", sensorData.Data["totrainfall"]) |
|
|
templateMap["totrainfall"] = fmt.Sprintf("%.3f", sensorData.Data["totrainfall"]) |
|
|
templateMap["unit"] = "mm" |
|
|
templateMap["unit"] = "mm" |
|
|
case models.AXY_FactorType_DXSW: |
|
|
case models.AXY_FactorType_DXSW: |
|
|
@ -179,7 +179,7 @@ func (the Adaptor_AXYES_GDKS) getJWDbySensorName(sensorData models.Source) (long |
|
|
longitude = codeArr[1] |
|
|
longitude = codeArr[1] |
|
|
latitude = codeArr[2] |
|
|
latitude = codeArr[2] |
|
|
height = codeArr[3] |
|
|
height = codeArr[3] |
|
|
case models.AXY_FactorType_Rain_New: |
|
|
case models.AXY_FactorType_Rain_New, models.AXY_FactorType_Rain_New_o: |
|
|
|
|
|
|
|
|
case models.AXY_FactorType_SBSPWY: |
|
|
case models.AXY_FactorType_SBSPWY: |
|
|
|
|
|
|
|
|
@ -199,7 +199,7 @@ func (the Adaptor_AXYES_GDKS) getSensorCodeAndType(sensorData models.Source) (co |
|
|
} |
|
|
} |
|
|
codeArr := strings.Split(v, ";") |
|
|
codeArr := strings.Split(v, ";") |
|
|
code = codeArr[0] |
|
|
code = codeArr[0] |
|
|
case models.AXY_FactorType_Rain_New: |
|
|
case models.AXY_FactorType_Rain_New, models.AXY_FactorType_Rain_New_o: |
|
|
typeCode = "0030" |
|
|
typeCode = "0030" |
|
|
v, isValid := the.RainMap[sensorData.SensorName] |
|
|
v, isValid := the.RainMap[sensorData.SensorName] |
|
|
if !isValid { |
|
|
if !isValid { |
|
|
|