@@ -31,17 +31,7 @@ struct ControlView: View {
|
||
| 31 | 31 |
action: { meter.previousScreen() }
|
| 32 | 32 |
) |
| 33 | 33 |
|
| 34 |
- VStack(spacing: 6) {
|
|
| 35 |
- Text(meter.currentScreenDescription) |
|
| 36 |
- .font(.subheadline.weight(.semibold)) |
|
| 37 |
- .multilineTextAlignment(.center) |
|
| 38 |
- if !meter.reportsCurrentScreenIndex {
|
|
| 39 |
- Text("The protocol allows navigation, but it does not report the active page back to the app.")
|
|
| 40 |
- .font(.caption) |
|
| 41 |
- .foregroundColor(.secondary) |
|
| 42 |
- .multilineTextAlignment(.center) |
|
| 43 |
- } |
|
| 44 |
- } |
|
| 34 |
+ currentScreenCard |
|
| 45 | 35 |
.frame(maxWidth: .infinity, minHeight: 92) |
| 46 | 36 |
.padding(.horizontal, 12) |
| 47 | 37 |
.meterCard(tint: meter.color, fillOpacity: 0.06, strokeOpacity: 0.10) |
@@ -64,6 +54,21 @@ struct ControlView: View {
|
||
| 64 | 54 |
} |
| 65 | 55 |
} |
| 66 | 56 |
|
| 57 |
+ @ViewBuilder |
|
| 58 |
+ private var currentScreenCard: some View {
|
|
| 59 |
+ if meter.reportsCurrentScreenIndex {
|
|
| 60 |
+ Text(meter.currentScreenDescription) |
|
| 61 |
+ .font(.subheadline.weight(.semibold)) |
|
| 62 |
+ .multilineTextAlignment(.center) |
|
| 63 |
+ } else {
|
|
| 64 |
+ VStack {
|
|
| 65 |
+ Image(systemName: "questionmark.square.dashed") |
|
| 66 |
+ .font(.system(size: 24, weight: .semibold)) |
|
| 67 |
+ .foregroundColor(.secondary) |
|
| 68 |
+ } |
|
| 69 |
+ } |
|
| 70 |
+ } |
|
| 71 |
+ |
|
| 67 | 72 |
private func controlButton( |
| 68 | 73 |
title: String, |
| 69 | 74 |
symbol: String, |
@@ -251,6 +251,20 @@ private struct MeterInfoView: View {
|
||
| 251 | 251 |
} |
| 252 | 252 |
} |
| 253 | 253 |
|
| 254 |
+ MeterInfoCard(title: "Screen Reporting", tint: .orange) {
|
|
| 255 |
+ if meter.reportsCurrentScreenIndex {
|
|
| 256 |
+ MeterInfoRow(label: "Current Screen", value: meter.currentScreenDescription) |
|
| 257 |
+ Text("The active screen index is reported by the meter and mapped by the app to a known label.")
|
|
| 258 |
+ .font(.footnote) |
|
| 259 |
+ .foregroundColor(.secondary) |
|
| 260 |
+ } else {
|
|
| 261 |
+ MeterInfoRow(label: "Current Screen", value: "Not Reported") |
|
| 262 |
+ Text("The current screen is not reported by the device payload, or we have not yet identified where and how the protocol announces it.")
|
|
| 263 |
+ .font(.footnote) |
|
| 264 |
+ .foregroundColor(.secondary) |
|
| 265 |
+ } |
|
| 266 |
+ } |
|
| 267 |
+ |
|
| 254 | 268 |
if meter.operationalState == .dataIsAvailable {
|
| 255 | 269 |
MeterInfoCard(title: "Live Device Details", tint: .indigo) {
|
| 256 | 270 |
if !meter.firmwareVersion.isEmpty {
|