open-merou

Open Mérou, a free iOS app for the Oceanic+ underwater iPhone housing
git clone https://git.schurger.org/open-merou.git
Log | Files | Refs | README | LICENSE

commit 7da8992ed36c032e21e2012e3834c5b18579fb5c
parent ce3b45287e71dd3e497c6783884ff919ac478882
Author: Jean Schurger <jean@schurger.org>
Date:   Fri, 13 Nov 2026 15:46:16 -0500

0.15: home screen with two choices (simulate, or use the housing as soon as it is detected)

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K7deYGSNhtY1AmBH7DQGNs

Diffstat:
MOpenMerou/UI/CameraScreen.swift | 73++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------
Mfastlane/Fastfile | 4++--
Mproject.yml | 2+-
3 files changed, 63 insertions(+), 16 deletions(-)

diff --git a/OpenMerou/UI/CameraScreen.swift b/OpenMerou/UI/CameraScreen.swift @@ -54,22 +54,11 @@ struct CameraScreen: View { if !model.camera.authorized { card { Text("Autorisez l'appareil photo dans Réglages → Open Mérou.") } + } else if housing.vacuum.step == .prepare, !housing.simulated { + card { HomeView(model: model) } } else if !housing.vacuum.cameraHasButtons { card { VacuumView(vacuum: housing.vacuum) - ForEach(model.camera.denied, id: \.self) { item in - Label("Autorisation refusée : \(item). Réglages → Open Mérou.", systemImage: "exclamationmark.triangle.fill") - .font(.footnote).foregroundStyle(.orange) - } - if housing.vacuum.step == .prepare, !housing.simulated { - Button { housing.startSimulation() } label: { - Label("Simuler un boîtier", systemImage: "play.rectangle.fill") - } - .buttonStyle(.borderedProminent) - .tint(.yellow) - .foregroundStyle(.black) - .padding(.top, 4) - } Text(housing.status.label).font(.footnote).foregroundStyle(.secondary) } } else if model.showingInfo { @@ -340,3 +329,61 @@ struct InfoPanel: View { .padding(8) } } + +/// Accueil : simuler un boîtier, ou utiliser le vrai dès qu'il est détecté. +struct HomeView: View { + let model: AppModel + + var body: some View { + let housing = model.housing + VStack(alignment: .leading, spacing: 12) { + Text("Open Mérou").font(.title2.bold()) + + Button { housing.startSimulation() } label: { + Label("Simuler un boîtier", systemImage: "play.rectangle.fill").frame(maxWidth: .infinity) + } + .buttonStyle(.borderedProminent) + .tint(.yellow) + .foregroundStyle(.black) + .disabled(housing.isConnected) + + if housing.isConnected { + VStack(alignment: .leading, spacing: 6) { + Label("Boîtier détecté", systemImage: "checkmark.circle.fill").font(.headline).foregroundStyle(.green) + if let p = housing.vacuum.pressurePa, p < VacuumSequence.alreadyUnderVacuumPa { + Text("Il est déjà sous vide : le test d'étanchéité va démarrer directement.") + } else { + Text("Placez l'iPhone (mode avion conseillé, Bluetooth allumé), fermez le boîtier et verrouillez le verrou.") + } + Text("Appuyez sur le bouton droit du boîtier pour continuer").font(.headline) + } + } else { + // Pas un vrai bouton : il se « valide » tout seul quand le boîtier répond. + Button {} label: { + HStack { + Image(systemName: "dot.radiowaves.left.and.right") + if case .bluetoothUnavailable(let why) = housing.status { + Text("Utiliser un boîtier · Bluetooth \(why)") + } else { + TimelineView(.periodic(from: .now, by: 0.5)) { context in + let dots = Int(context.date.timeIntervalSinceReferenceDate * 2) % 3 + 1 + Text("Utiliser un boîtier · recherche" + String(repeating: ".", count: dots) + + String(repeating: " ", count: 3 - dots)) + .monospaced() + } + } + } + .frame(maxWidth: .infinity) + } + .buttonStyle(.bordered) + .disabled(true) + Text("Allumez le boîtier : il sera détecté tout seul.").font(.footnote).foregroundStyle(.secondary) + } + + ForEach(model.camera.denied, id: \.self) { item in + Label("Autorisation refusée : \(item). Réglages → Open Mérou.", systemImage: "exclamationmark.triangle.fill") + .font(.footnote).foregroundStyle(.orange) + } + } + } +} 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.14 : à chaque photo, l'image clignote comme un obturateur et le compteur augmente une fois la photo enregistrée ; les messages s'effacent seuls. 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."], + "0.15 : nouvel accueil (simuler un boîtier, ou utiliser le vrai dès qu'il est détecté). À chaque photo, l'image clignote comme un obturateur et le compteur augmente une fois la photo enregistrée ; les messages s'effacent seuls. 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.14: on each photo the image blinks like a shutter and the counter goes up once saved; messages clear by themselves. 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."], + "0.15: new home screen (simulate a housing, or use the real one once detected). On each photo the image blinks like a shutter and the counter goes up once saved; messages clear by themselves. 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.14" + MARKETING_VERSION: "0.15" CURRENT_PROJECT_VERSION: "1" SWIFT_VERSION: "6.0" targets: