| | |
| | | for (Map.Entry<String, Object> entry : dataMap.entrySet()) {
|
| | | for (Sensor sensor : sensors) {
|
| | | if (sensor.getSensorKey().equals(entry.getKey())) {
|
| | | dataMap.put(entry.getKey(), new BigDecimal(entry.getValue().toString().replace("\"", "")).stripTrailingZeros().toPlainString() + sensor.getUnit());
|
| | | if (entry.getValue() != null) {
|
| | | dataMap.put(entry.getKey(), new BigDecimal(entry.getValue().toString().replace("\"", "")).stripTrailingZeros().toPlainString() + sensor.getUnit());
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | Map<String, Object> map = sensorMapper.getSensorBySensorKey(parameters.get("sensorKey").toString());
|
| | | parameters.put("unit",map.get("unit"));
|
| | | parameters.put("description",map.get("description"));
|
| | | parameters.put("unit", map.get("unit"));
|
| | | parameters.put("description", map.get("description"));
|
| | | return uavSensorData;
|
| | | }
|
| | |
|