chore: fix regressions in the release (#4398)

Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
This commit is contained in:
James Rich 2026-02-01 17:18:06 -06:00 committed by GitHub
parent 6eb42cc180
commit 221e774471
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 71 additions and 32 deletions

View file

@ -236,11 +236,16 @@ private fun DeviceMetricsChart(
/* Series for Left Axis (0-100%) */
lineSeries {
series(x = telemetries.map { it.time }, y = telemetries.map { it.deviceMetrics.batteryLevel })
series(x = telemetries.map { it.time }, y = telemetries.map { it.deviceMetrics.channelUtilization })
series(x = telemetries.map { it.time }, y = telemetries.map { it.deviceMetrics.airUtilTx })
val chUtilData = telemetries.filter { !it.deviceMetrics.channelUtilization.isNaN() }
series(x = chUtilData.map { it.time }, y = chUtilData.map { it.deviceMetrics.channelUtilization })
val airUtilData = telemetries.filter { !it.deviceMetrics.airUtilTx.isNaN() }
series(x = airUtilData.map { it.time }, y = airUtilData.map { it.deviceMetrics.airUtilTx })
}
/* Series for Right Axis (Voltage) */
lineSeries { series(x = telemetries.map { it.time }, y = telemetries.map { it.deviceMetrics.voltage }) }
lineSeries {
val voltageData = telemetries.filter { !it.deviceMetrics.voltage.isNaN() }
series(x = voltageData.map { it.time }, y = voltageData.map { it.deviceMetrics.voltage })
}
}
}

View file

@ -134,12 +134,14 @@ fun EnvironmentMetricsChart(
/* Pressure on its own layer/axis */
if (shouldPlot[Environment.BAROMETRIC_PRESSURE.ordinal]) {
lineSeries {
val pressureData =
telemetries.filter {
val v = Environment.BAROMETRIC_PRESSURE.getValue(it)
v != null && !v.isNaN()
}
series(
x =
telemetries.mapNotNull { t ->
Environment.BAROMETRIC_PRESSURE.getValue(t)?.let { t.time }
},
y = telemetries.mapNotNull { t -> Environment.BAROMETRIC_PRESSURE.getValue(t) },
x = pressureData.map { it.time },
y = pressureData.map { Environment.BAROMETRIC_PRESSURE.getValue(it)!! },
)
}
}
@ -147,10 +149,12 @@ fun EnvironmentMetricsChart(
Environment.entries.forEach { metric ->
if (metric != Environment.BAROMETRIC_PRESSURE && shouldPlot[metric.ordinal]) {
lineSeries {
series(
x = telemetries.mapNotNull { t -> metric.getValue(t)?.let { t.time } },
y = telemetries.mapNotNull { t -> metric.getValue(t) },
)
val metricData =
telemetries.filter {
val v = metric.getValue(it)
v != null && !v.isNaN()
}
series(x = metricData.map { it.time }, y = metricData.map { metric.getValue(it)!! })
}
}
}

View file

@ -253,15 +253,17 @@ private fun PowerMetricsChart(
LaunchedEffect(telemetries, selectedChannel) {
modelProducer.runTransaction {
lineSeries {
val currentData = telemetries.filter { !retrieveCurrent(selectedChannel, it).isNaN() }
series(
x = telemetries.map { it.time },
y = telemetries.map { retrieveCurrent(selectedChannel, it) },
x = currentData.map { it.time },
y = currentData.map { retrieveCurrent(selectedChannel, it) },
)
}
lineSeries {
val voltageData = telemetries.filter { !retrieveVoltage(selectedChannel, it).isNaN() }
series(
x = telemetries.map { it.time },
y = telemetries.map { retrieveVoltage(selectedChannel, it) },
x = voltageData.map { it.time },
y = voltageData.map { retrieveVoltage(selectedChannel, it) },
)
}
}

View file

@ -139,8 +139,14 @@ private fun SignalMetricsChart(
LaunchedEffect(meshPackets) {
modelProducer.runTransaction {
/* Use separate lineSeries calls to associate them with different vertical axes */
lineSeries { series(x = meshPackets.map { it.rxTime }, y = meshPackets.map { it.rxRssi }) }
lineSeries { series(x = meshPackets.map { it.rxTime }, y = meshPackets.map { it.rxSnr }) }
lineSeries {
val rssiData = meshPackets.filter { it.rxRssi != 0 && !it.rxRssi.toFloat().isNaN() }
series(x = rssiData.map { it.rxTime }, y = rssiData.map { it.rxRssi })
}
lineSeries {
val snrData = meshPackets.filter { !it.rxSnr.isNaN() }
series(x = snrData.map { it.rxTime }, y = snrData.map { it.rxSnr })
}
}
}