-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlab_wizard.hpp
More file actions
40 lines (32 loc) · 1.77 KB
/
Copy pathlab_wizard.hpp
File metadata and controls
40 lines (32 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// SPDX-License-Identifier: Apache-2.0
#pragma once
/// @file
/// The demo's wizard and app-shell descriptors, built entirely from the
/// actions already declared in lab_model.hpp. `IntakeWizard` sequences
/// `RegisterSample` (returns a new sample's id) into `RecordMeasurement`
/// (prefilled with that id), demonstrating the shared flow draft. `LabApp`
/// is the app-shell descriptor the QML reference renderer's AppShell.qml
/// loads as its navigation root.
#include <morph/forms/app.hpp>
#include <morph/forms/flows.hpp>
#include <tuple>
#include "lab_model.hpp"
namespace lab {
/// @brief Register a sample, then record its first measurement — the
/// `RegisterSample` result's `id` prefills `RecordMeasurement.sampleId`.
using IntakeWizard =
morph::flows::Wizard<"Register & measure a sample", morph::flows::WizardStep<RegisterSample, "New sample">,
morph::flows::WizardStep<RecordMeasurement, "First measurement",
morph::flows::Bind<"sampleId", "RegisterSample.id">>>;
/// @brief The demo's app shell: a density calculator, a standalone measurement
/// form, and the intake wizard.
using LabApp =
morph::app::App<"Lab console",
std::tuple<morph::app::MenuEntry<"Density", "density">,
morph::app::MenuEntry<"Measure", "measure">, morph::app::MenuEntry<"Intake", "intake">>,
std::tuple<morph::app::FormScreen<"density", ComputeDryDensity>,
morph::app::FormScreen<"measure", RecordMeasurement>,
morph::app::WizardScreen<"intake", IntakeWizard>>>;
} // namespace lab
BRIDGE_REGISTER_WIZARD(lab::IntakeWizard, "IntakeWizard")
BRIDGE_REGISTER_APP(lab::LabApp, "LabApp")