| | |
| | | import com.flightfeather.uav.socket.bean.AirData |
| | | import com.flightfeather.uav.socket.eunm.FactorType |
| | | import com.flightfeather.uav.socket.eunm.FactorType.* |
| | | import java.time.LocalDateTime |
| | | import java.time.ZoneId |
| | | import java.util.* |
| | | import kotlin.math.atan |
| | | import kotlin.math.cos |
| | | import kotlin.math.round |
| | |
| | | list.add("纬度") |
| | | val values = GsonUtils.parserJsonToArrayBeans(factors, AirData::class.java) |
| | | values.forEach { |
| | | if (FactorType.outputFactor(it.factorName)) { |
| | | if (FactorType.isOutputFactor(it.factorName)) { |
| | | val name = it.factorName ?: "" |
| | | list.add(name) |
| | | // list.add("$name(物理量)") |
| | |
| | | } |
| | | val values = GsonUtils.parserJsonToArrayBeans(factors, AirData::class.java) |
| | | values.forEach { |
| | | if (FactorType.outputFactor(it.factorName)) { |
| | | if (FactorType.isOutputFactor(it.factorName)) { |
| | | row.add(it.factorData ?: -1.0) |
| | | // row.add(it.physicalQuantity ?: -1.0) |
| | | } |
| | |
| | | VELOCITY -> TODO("no such factor") |
| | | TIME -> TODO("no such factor") |
| | | HEIGHT -> TODO("no such factor") |
| | | else -> TODO("no such factor") |
| | | } |
| | | } |
| | | |
| | | fun GridDataDetail.getByFactorType(type: FactorType?): Float? { |
| | | return when (type) { |
| | | NO2 -> no2 |
| | | CO -> co |
| | | H2S -> h2s |
| | | SO2 -> so2 |
| | | O3 -> o3 |
| | | PM25 -> pm25 |
| | | PM10 -> pm10 |
| | | TEMPERATURE -> temperature |
| | | HUMIDITY -> humidity |
| | | VOC -> voc |
| | | NOI -> noi |
| | | WIND_SPEED -> windSpeed |
| | | WIND_DIRECTION -> windDirection |
| | | NO -> no |
| | | else -> null |
| | | } |
| | | } |
| | | |