commit 987e2378299291d8f6ca01e0308555054befbf46
parent 909b4676ab1c65a9acdc7fd0e3f8f351df63a0fb
Author: Jean Schurger <jean@schurger.org>
Date: Fri, 13 Nov 2026 15:33:54 -0500
0.13: simulation goes straight to the camera, ⓘ screen with Back, Disconnect only when connected
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K7deYGSNhtY1AmBH7DQGNs
Diffstat:
5 files changed, 26 insertions(+), 10 deletions(-)
diff --git a/OpenMerou/Housing/HousingClient.swift b/OpenMerou/Housing/HousingClient.swift
@@ -49,6 +49,12 @@ final class HousingClient: NSObject {
/// Vrai entre notre ordre de marche et notre ordre d'arrêt.
private(set) var pumpRequested = false
+ /// Vrai quand un vrai boîtier est connecté.
+ var isConnected: Bool {
+ if case .connected = status { return !simulated }
+ return false
+ }
+
var canPump: Bool { pumpCharacteristic != nil || simulation != nil }
/// Seuil d'arrêt observé avec l'app officielle : premier échantillon sous 80 kPa.
@@ -84,6 +90,7 @@ final class HousingClient: NSObject {
simulated = true
vacuum = VacuumSequence()
vacuum.testDuration = 20 // démonstration : test raccourci
+ vacuum.bypass() // droit à la caméra ; appui long à droite pour montrer la mise sous vide
readings = HousingReadings()
status = .connected("boîtier simulé")
deviceInfo = ["Modèle": "Boîtier simulé"]
diff --git a/OpenMerou/UI/CameraScreen.swift b/OpenMerou/UI/CameraScreen.swift
@@ -154,7 +154,7 @@ struct CameraScreen: View {
let (text, color): (String, Color) = switch housing.vacuum.step {
case .sealed: ("Étanche", .green)
case .testing: ("Test en cours", .orange)
- case .bypassed: ("À sec", .yellow)
+ case .bypassed: (housing.simulated ? "Simulation" : "À sec", .yellow)
case .failed: ("Alerte", .red)
default: ("Non vérifié", .gray)
}
diff --git a/OpenMerou/UI/HousingView.swift b/OpenMerou/UI/HousingView.swift
@@ -3,6 +3,7 @@ import SwiftUI
/// Écran de diagnostic du prototype : tout ce que le boîtier envoie, en direct.
struct HousingView: View {
let housing: HousingClient
+ @Environment(\.dismiss) private var dismiss
var body: some View {
NavigationStack {
@@ -38,14 +39,16 @@ struct HousingView: View {
}
}
- Section {
- if housing.released {
- Button("Se reconnecter") { housing.reconnect() }
- } else {
+ if housing.simulated {
+ Section { Button("Quitter la simulation") { housing.stopSimulation() } }
+ } else if housing.released {
+ Section { Button("Se reconnecter") { housing.reconnect() } }
+ } else if housing.isConnected {
+ Section {
Button("Se déconnecter du boîtier", role: .destructive) { housing.release() }
+ } footer: {
+ Text("Une fois déconnecté, maintenez le bouton droit du boîtier 2 secondes pour l'éteindre.")
}
- } footer: {
- Text("L'app officielle n'envoie pas d'ordre d'extinction : elle se déconnecte. À vérifier : le boîtier s'éteint-il alors tout seul ?")
}
if !housing.deviceInfo.isEmpty {
@@ -78,6 +81,12 @@ struct HousingView: View {
}
}
.navigationTitle("Open Mérou")
+ .navigationBarTitleDisplayMode(.inline)
+ .toolbar {
+ ToolbarItem(placement: .cancellationAction) {
+ Button { dismiss() } label: { Label("Retour", systemImage: "chevron.left").labelStyle(.titleAndIcon) }
+ }
+ }
}
}
diff --git a/fastlane/Fastfile b/fastlane/Fastfile
@@ -122,9 +122,9 @@ platform :ios do
end
texts = {
"fr-CA" => ["App libre et gratuite pour boîtier de plongée compatible : boutons, pompe à vide, capteurs, caméra.",
- "0.12 : « Essai à sec » retiré, « Simuler un boîtier » est un vrai bouton. Menu → Informations (remplace le bouton ⓘ sous l'eau) ; menu compact qui défile (lisible en paysage) ; batteries du boîtier et de l'iPhone affichées séparément ; toutes les autorisations (caméra, micro, photothèque) demandées au lancement, avant de fermer le boîtier. Correction des couleurs par le capteur. Réglages → Couleurs : iPhone, sous l'eau automatique (par défaut), ou calibrées. Appui long sur le bouton bas : calibrer sur ce que l'on vise (sable, ardoise blanche). Témoin « ROUGE MAX » quand le capteur est au bout de sa correction. À essayer dans l'eau avec le mode développement."],
+ "0.13 : la simulation va droit à la caméra ; écran ⓘ avec bouton Retour et « Se déconnecter » seulement si un boîtier est connecté ; « Essai à sec » retiré, « Simuler un boîtier » est un vrai bouton. Menu → Informations (remplace le bouton ⓘ sous l'eau) ; menu compact qui défile (lisible en paysage) ; batteries du boîtier et de l'iPhone affichées séparément ; toutes les autorisations (caméra, micro, photothèque) demandées au lancement, avant de fermer le boîtier. Correction des couleurs par le capteur. Réglages → Couleurs : iPhone, sous l'eau automatique (par défaut), ou calibrées. Appui long sur le bouton bas : calibrer sur ce que l'on vise (sable, ardoise blanche). Témoin « ROUGE MAX » quand le capteur est au bout de sa correction. À essayer dans l'eau avec le mode développement."],
"en-CA" => ["Free, open-source app for compatible dive housings: buttons, vacuum pump, sensors, camera.",
- "0.12: Dry run removed, Simulate a housing is now a proper button. Menu → Information (replaces the ⓘ button underwater); compact scrolling menu (readable in landscape); housing and iPhone batteries shown separately; all permissions (camera, microphone, photo library) requested at launch, before closing the housing. On-sensor color correction. Settings → Colors: iPhone, underwater automatic (default), or calibrated. Long press on the down button: calibrate on what you aim at (sand, white slate). RED MAX indicator when the sensor reaches its limit. Please try in water with developer mode on."],
+ "0.13: simulation goes straight to the camera; ⓘ screen has a Back button and shows Disconnect only when a housing is connected; Dry run removed, Simulate a housing is now a proper button. Menu → Information (replaces the ⓘ button underwater); compact scrolling menu (readable in landscape); housing and iPhone batteries shown separately; all permissions (camera, microphone, photo library) requested at launch, before closing the housing. On-sensor color correction. Settings → Colors: iPhone, underwater automatic (default), or calibrated. Long press on the down button: calibrate on what you aim at (sand, white slate). RED MAX indicator when the sensor reaches its limit. Please try in water with developer mode on."],
}
_, locs = asc(:get, "/v1/apps/#{app.id}/betaAppLocalizations")
texts.each do |locale, (description, _)|
diff --git a/project.yml b/project.yml
@@ -9,7 +9,7 @@ settings:
base:
DEVELOPMENT_TEAM: CM5RQKJH56
CODE_SIGN_STYLE: Automatic
- MARKETING_VERSION: "0.12"
+ MARKETING_VERSION: "0.13"
CURRENT_PROJECT_VERSION: "1"
SWIFT_VERSION: "6.0"
targets: