forked from fritob/Camper-Monitor
Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8401f62d91 | ||
|
|
c45cf36920 | ||
|
|
47ead9b006 |
@@ -39,7 +39,7 @@ enum VehicleGraphicStyle: String, CaseIterable, Identifiable, Codable, Sendable
|
||||
var sideAspect: Double {
|
||||
switch self {
|
||||
case .vanster: return VehicleTilt.sideAspect
|
||||
case .california: return 1
|
||||
case .california: return 1212.0 / 790.0
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -92,6 +92,10 @@ struct WatchDevice: Codable, Equatable, Identifiable, Sendable {
|
||||
/// den Neigungsmesser selbst an und braucht die Zuordnung deshalb auch –
|
||||
/// eingestellt wird sie weiterhin nur am iPhone.
|
||||
var orientation: SensorOrientation?
|
||||
/// Ebenfalls nur beim Neigungsmesser: welche Fahrzeuggrafik die
|
||||
/// Fahrzeug-Ansicht zeigt. Ausgewählt wird sie nur am iPhone, die Uhr
|
||||
/// übernimmt nur die Anzeige.
|
||||
var vehicleGraphicStyle: VehicleGraphicStyle?
|
||||
/// Nur bei der Kühlbox belegt.
|
||||
var fridge: WatchFridge?
|
||||
|
||||
|
||||
+4
-3
@@ -1190,13 +1190,14 @@ let watchPayload = WatchPayload(
|
||||
devices: [
|
||||
WatchDevice(id: watchLevelID, name: "Nivellierung", role: .leveling,
|
||||
link: .live, snapshot: watchLevelSnapshot,
|
||||
level: watchLevel, orientation: watchOrientation, fridge: nil),
|
||||
level: watchLevel, orientation: watchOrientation,
|
||||
vehicleGraphicStyle: .vanster, fridge: nil),
|
||||
WatchDevice(id: watchBoosterID, name: "Ladebooster", role: .chargeBooster,
|
||||
link: .failed("Nicht gefunden"), snapshot: boosterSnapshot,
|
||||
level: nil, orientation: nil, fridge: nil),
|
||||
level: nil, orientation: nil, vehicleGraphicStyle: nil, fridge: nil),
|
||||
WatchDevice(id: watchFridgeID, name: "Kühlbox", role: .fridge,
|
||||
link: .live, snapshot: nil, level: nil,
|
||||
orientation: nil, fridge: watchFridge),
|
||||
orientation: nil, vehicleGraphicStyle: nil, fridge: watchFridge),
|
||||
])
|
||||
|
||||
// Der ganze Weg: verpacken, als WatchConnectivity-Wörterbuch lesen, vergleichen.
|
||||
|
||||
@@ -501,7 +501,7 @@
|
||||
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
||||
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
CURRENT_PROJECT_VERSION = 2;
|
||||
DEVELOPMENT_ASSET_PATHS = "";
|
||||
DEVELOPMENT_TEAM = V5C6Q86XJR;
|
||||
ENABLE_PREVIEWS = YES;
|
||||
@@ -509,6 +509,7 @@
|
||||
INFOPLIST_FILE = "Config/VanControl-Info.plist";
|
||||
INFOPLIST_KEY_CFBundleDisplayName = "VanControl Pro";
|
||||
INFOPLIST_KEY_ITSAppUsesNonExemptEncryption = NO;
|
||||
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities";
|
||||
INFOPLIST_KEY_NSBluetoothAlwaysUsageDescription = "Zum Auslesen von Victron-Geraeten und dem Daly BMS per Bluetooth.";
|
||||
INFOPLIST_KEY_NSSupportsLiveActivities = YES;
|
||||
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
|
||||
@@ -536,7 +537,7 @@
|
||||
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
||||
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
CURRENT_PROJECT_VERSION = 2;
|
||||
DEVELOPMENT_ASSET_PATHS = "";
|
||||
DEVELOPMENT_TEAM = V5C6Q86XJR;
|
||||
ENABLE_PREVIEWS = YES;
|
||||
@@ -544,6 +545,7 @@
|
||||
INFOPLIST_FILE = "Config/VanControl-Info.plist";
|
||||
INFOPLIST_KEY_CFBundleDisplayName = "VanControl Pro";
|
||||
INFOPLIST_KEY_ITSAppUsesNonExemptEncryption = NO;
|
||||
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities";
|
||||
INFOPLIST_KEY_NSBluetoothAlwaysUsageDescription = "Zum Auslesen von Victron-Geraeten und dem Daly BMS per Bluetooth.";
|
||||
INFOPLIST_KEY_NSSupportsLiveActivities = YES;
|
||||
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
|
||||
@@ -569,7 +571,7 @@
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
CURRENT_PROJECT_VERSION = 3;
|
||||
DEVELOPMENT_TEAM = V5C6Q86XJR;
|
||||
ENABLE_PREVIEWS = YES;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
@@ -601,7 +603,7 @@
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
CURRENT_PROJECT_VERSION = 3;
|
||||
DEVELOPMENT_TEAM = V5C6Q86XJR;
|
||||
ENABLE_PREVIEWS = YES;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
@@ -631,7 +633,7 @@
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
CURRENT_PROJECT_VERSION = 2;
|
||||
DEVELOPMENT_TEAM = V5C6Q86XJR;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
INFOPLIST_FILE = "Config/VanControlComplication-Info.plist";
|
||||
@@ -660,7 +662,7 @@
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
CURRENT_PROJECT_VERSION = 2;
|
||||
DEVELOPMENT_TEAM = V5C6Q86XJR;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
INFOPLIST_FILE = "Config/VanControlComplication-Info.plist";
|
||||
@@ -691,7 +693,7 @@
|
||||
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
||||
ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
CURRENT_PROJECT_VERSION = 2;
|
||||
DEVELOPMENT_TEAM = V5C6Q86XJR;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
INFOPLIST_FILE = VanControlLiveActivity/Info.plist;
|
||||
@@ -720,7 +722,7 @@
|
||||
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
||||
ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
CURRENT_PROJECT_VERSION = 2;
|
||||
DEVELOPMENT_TEAM = V5C6Q86XJR;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
INFOPLIST_FILE = VanControlLiveActivity/Info.plist;
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 323 KiB After Width: | Height: | Size: 311 KiB |
@@ -135,6 +135,7 @@ final class PhoneWatchLink: NSObject {
|
||||
snapshot: bluetooth.snapshots[device.id],
|
||||
level: device.role == .leveling ? bluetooth.levelStates[device.id] : nil,
|
||||
orientation: device.role == .leveling ? device.sensorOrientation : nil,
|
||||
vehicleGraphicStyle: device.role == .leveling ? device.vehicleGraphicStyle : nil,
|
||||
fridge: device.role == .fridge ? fridgeState(for: device) : nil)
|
||||
}
|
||||
return WatchPayload(generatedAt: Date(),
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 1.1 MiB |
Binary file not shown.
|
After Width: | Height: | Size: 326 KiB |
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "CaliforniaRear.png",
|
||||
"idiom" : "universal"
|
||||
}
|
||||
],
|
||||
"info" : { "author" : "xcode", "version" : 1 },
|
||||
"properties" : { "template-rendering-intent" : "template" }
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 311 KiB |
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "CaliforniaSide.png",
|
||||
"idiom" : "universal"
|
||||
}
|
||||
],
|
||||
"info" : { "author" : "xcode", "version" : 1 },
|
||||
"properties" : { "template-rendering-intent" : "template" }
|
||||
}
|
||||
@@ -50,7 +50,8 @@ struct LevelReadingPage: View {
|
||||
ScrollView {
|
||||
VStack(spacing: 8) {
|
||||
if showsVehicle {
|
||||
WatchVehicleView(pitch: reading.state.pitch, roll: reading.state.roll)
|
||||
WatchVehicleView(pitch: reading.state.pitch, roll: reading.state.roll,
|
||||
style: link.payload?.levelDevice?.vehicleGraphicStyle ?? .vanster)
|
||||
} else {
|
||||
WatchBubble(pitch: reading.state.pitch, roll: reading.state.roll)
|
||||
.frame(maxWidth: 110)
|
||||
|
||||
@@ -9,15 +9,18 @@ import SwiftUI
|
||||
struct WatchVehicleView: View {
|
||||
let pitch: Double?
|
||||
let roll: Double?
|
||||
/// Vom iPhone übernommen – ausgewählt wird sie nur dort, siehe
|
||||
/// `WatchDevice.vehicleGraphicStyle`.
|
||||
var style: VehicleGraphicStyle = .vanster
|
||||
|
||||
/// Wie am iPhone dreifach überhöht – zwei Grad wären sonst kaum zu sehen.
|
||||
/// Die angeschriebenen Gradzahlen bleiben echt.
|
||||
var body: some View {
|
||||
VStack(spacing: 8) {
|
||||
panel(image: "VansterSide", angle: pitch, title: "Längs",
|
||||
lower: "Front", upper: "Heck", aspect: VehicleTilt.sideAspect)
|
||||
panel(image: "VansterRear", angle: roll, title: "Quer",
|
||||
lower: "links", upper: "rechts", aspect: VehicleTilt.rearAspect)
|
||||
panel(image: style.sideImageName, angle: pitch, title: "Längs",
|
||||
lower: "Front", upper: "Heck", aspect: style.sideAspect)
|
||||
panel(image: style.rearImageName, angle: roll, title: "Quer",
|
||||
lower: "links", upper: "rechts", aspect: style.rearAspect)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -63,15 +63,17 @@ enum WatchDemo {
|
||||
devices: [
|
||||
WatchDevice(id: levelID, name: "Nivellierung", role: .leveling,
|
||||
link: .live, snapshot: level.snapshot(deviceID: levelID, rssi: -70),
|
||||
level: level, orientation: .identity, fridge: nil),
|
||||
level: level, orientation: .identity,
|
||||
vehicleGraphicStyle: .vanster, fridge: nil),
|
||||
WatchDevice(id: batteryID, name: "Bulltron 200 Ah", role: .bms,
|
||||
link: .live, snapshot: battery, level: nil,
|
||||
orientation: nil, fridge: nil),
|
||||
orientation: nil, vehicleGraphicStyle: nil, fridge: nil),
|
||||
WatchDevice(id: victronSolarID, name: "Solar Dach", role: .victronSolarCharger,
|
||||
link: .live, snapshot: victronSolar, level: nil,
|
||||
orientation: nil, fridge: nil),
|
||||
orientation: nil, vehicleGraphicStyle: nil, fridge: nil),
|
||||
WatchDevice(id: fridgeID, name: "Kühlbox", role: .fridge,
|
||||
link: .live, snapshot: fridge, level: nil, orientation: nil,
|
||||
vehicleGraphicStyle: nil,
|
||||
fridge: WatchFridge(isLive: true, updated: now,
|
||||
isPoweredOn: true, isEco: true, isLocked: false,
|
||||
isDualZone: false, unitSymbol: "°C",
|
||||
|
||||
Reference in New Issue
Block a user