Skip to content

Commit

Permalink
refactor: group power metrics by channel
Browse files Browse the repository at this point in the history
  • Loading branch information
andrekir committed Jan 6, 2025
1 parent 3a68b5d commit 7bb0d42
Showing 1 changed file with 36 additions and 36 deletions.
72 changes: 36 additions & 36 deletions app/src/main/java/com/geeksville/mesh/ui/NodeDetail.kt
Original file line number Diff line number Diff line change
Expand Up @@ -558,46 +558,46 @@ private fun PowerMetrics(node: Node) = with(node.powerMetrics) {
verticalArrangement = Arrangement.SpaceEvenly,
) {
if (ch1Voltage != 0f) {
InfoCard(
icon = Icons.Default.Bolt,
text = "Channel 1",
value = "%.2fV".format(ch1Voltage)
)
}
if (ch1Current != 0f) {
InfoCard(
icon = Icons.Default.Power,
text = "Channel 1",
value = "%.1fmA".format(ch1Current)
)
Column {
InfoCard(
icon = Icons.Default.Bolt,
text = "Channel 1",
value = "%.2fV".format(ch1Voltage)
)
InfoCard(
icon = Icons.Default.Power,
text = "Channel 1",
value = "%.1fmA".format(ch1Current)
)
}
}
if (ch2Voltage != 0f) {
InfoCard(
icon = Icons.Default.Bolt,
text = "Channel 2",
value = "%.2fV".format(ch2Voltage)
)
}
if (ch2Current != 0f) {
InfoCard(
icon = Icons.Default.Power,
text = "Channel 2",
value = "%.1fmA".format(ch2Current)
)
Column {
InfoCard(
icon = Icons.Default.Bolt,
text = "Channel 2",
value = "%.2fV".format(ch2Voltage)
)
InfoCard(
icon = Icons.Default.Power,
text = "Channel 2",
value = "%.1fmA".format(ch2Current)
)
}
}
if (ch3Voltage != 0f) {
InfoCard(
icon = Icons.Default.Bolt,
text = "Channel 3",
value = "%.2fV".format(ch3Voltage)
)
}
if (ch3Current != 0f) {
InfoCard(
icon = Icons.Default.Power,
text = "Channel 3",
value = "%.1fmA".format(ch3Current)
)
Column {
InfoCard(
icon = Icons.Default.Bolt,
text = "Channel 3",
value = "%.2fV".format(ch3Voltage)
)
InfoCard(
icon = Icons.Default.Power,
text = "Channel 3",
value = "%.1fmA".format(ch3Current)
)
}
}
}
}
Expand Down

0 comments on commit 7bb0d42

Please sign in to comment.