10 #include <fmt/format.h>
18 using Seconds = std::chrono::duration<double, std::ratio<1>>;
22 : ocmif::StateAcquiring);
24 status.setError(rhs.
error);
26 std::chrono::time_point_cast<Seconds>(rhs.
timestamp).time_since_epoch().count());
27 status.setMessage(
"");
35 case State::NotStarted:
36 return ocmif::NotStarted;
38 return ocmif::Starting;
39 case State::Acquiring:
40 return ocmif::Acquiring;
42 return ocmif::Stopping;
44 return ocmif::Stopped;
46 return ocmif::Aborting;
48 return ocmif::Aborted;
51 return ocmif::Undefined;
59 case ocmif::NotStarted:
60 return State::NotStarted;
62 return State::Starting;
63 case ocmif::Acquiring:
64 return State::Acquiring;
66 return State::Stopping;
68 return State::Stopped;
70 return State::Aborting;
72 return State::Aborted;
74 throw std::invalid_argument(fmt::format(
"Invalid ocmif::DaqSubState value {:d}", state));
78 std::string_view
ToString(ocmif::DaqState state) noexcept {
79 using namespace std::string_view_literals;
81 case ocmif::StateAcquiring:
82 return "StateAcquiring";
83 case ocmif::StateMerging:
84 return "StateMerging";
85 case ocmif::StateCompleted:
86 return "StateCompleted";
87 case ocmif::DaqState::StateUndefined:
94 std::string_view
ToString(ocmif::DaqSubState state) noexcept {
95 using namespace std::string_view_literals;
97 case ocmif::DaqSubState::NotStarted:
99 case ocmif::DaqSubState::Starting:
101 case ocmif::DaqSubState::Acquiring:
103 case ocmif::DaqSubState::Stopping:
105 case ocmif::DaqSubState::Stopped:
107 case ocmif::DaqSubState::Aborting:
109 case ocmif::DaqSubState::Aborted:
111 case ocmif::DaqSubState::NotScheduled:
112 return "NotScheduled";
113 case ocmif::DaqSubState::Scheduled:
115 case ocmif::DaqSubState::Transferring:
116 return "Transferring";
117 case ocmif::DaqSubState::Merging:
119 case ocmif::DaqSubState::Releasing:
121 case ocmif::DaqSubState::Completed:
123 case ocmif::DaqSubState::Undefined: