API
stateCodes.hpp
Go to the documentation of this file.
1 /** \file stateCodes.hpp
2  * \brief MagAO-X Application States
3  * \author Jared R. Males (jaredmales@gmail.com)
4  *
5  * History:
6  * - 2018-01-20 created by JRM
7  *
8  * \ingroup app_files
9  */
10 
11 #ifndef app_stateCodes_hpp
12 #define app_stateCodes_hpp
13 
14 #include <string>
15 
16 namespace MagAOX
17 {
18 namespace app
19 {
20 
21 /// Scoping struct for application state codes.
22 /** We do not use the enum class feature since it does not have automatic integer conversion.
23  * \ingroup magaoxapp
24  */
25 struct stateCodes
26 {
27 
28  /// The type of the state code.
29  /**
30  */
31  typedef int16_t stateCodeT;
32 
33 
34  /// The numeric codes descrbing an application's state
35  /** \ingroup magaoxapp
36  */
37  enum : stateCodeT { FAILURE=-20, ///< The application has failed, should be used when m_shutdown is set for an error.
38  ERROR=-10, ///< The application has encountered an error, from which it is recovering (with or without intervention)
39  UNINITIALIZED = 0, ///< The application is unitialized, the default
40  INITIALIZED = 1, ///< The application has been initialized, set just before calling appStartup().
41  NODEVICE = 2, ///< No device exists for the application to control.
42  POWEROFF = 4, ///< The device power is off.
43  POWERON = 6, ///< The device power is on.
44  NOTCONNECTED = 8, ///< The application is not connected to the device or service.
45  CONNECTED = 10, ///< The application has connected to the device or service.
46  LOGGEDIN = 15, ///< The application has logged into the device or service
47  CONFIGURING = 20, ///< The application is configuring the device.
48  NOTHOMED = 24, ///< The device has not been homed.
49  HOMING = 25, ///< The device is homing.
50  OPERATING = 30, ///< The device is operating, other than homing.
51  READY = 35, ///< The device is ready for operation, but is not operating.
52  SHUTDOWN = 10000 ///< The application has shutdown, set just after calling appShutdown().
53  };
54 
55 
56  /// Get an ASCII string corresponding to an application stateCode.
57  /**
58  * \returns a string with the text name of the stateCode
59  *
60  */
61  static std::string codeText( stateCodeT stateCode /**<[in] the stateCode for which the name is desired*/);
62 
63 }; //struct stateCodes
64 
65 
66 
67 } //namespace app
68 } //namespace MagAOX
69 
70 #endif //app_stateCodes_hpp
@ OPERATING
The device is operating, other than homing.
Definition: stateCodes.hpp:50
@ POWEROFF
The device power is off.
Definition: stateCodes.hpp:42
@ NODEVICE
No device exists for the application to control.
Definition: stateCodes.hpp:41
@ SHUTDOWN
The application has shutdown, set just after calling appShutdown().
Definition: stateCodes.hpp:52
@ NOTHOMED
The device has not been homed.
Definition: stateCodes.hpp:48
@ HOMING
The device is homing.
Definition: stateCodes.hpp:49
@ FAILURE
The application has failed, should be used when m_shutdown is set for an error.
Definition: stateCodes.hpp:37
@ CONFIGURING
The application is configuring the device.
Definition: stateCodes.hpp:47
@ ERROR
The application has encountered an error, from which it is recovering (with or without intervention)
Definition: stateCodes.hpp:38
@ READY
The device is ready for operation, but is not operating.
Definition: stateCodes.hpp:51
@ LOGGEDIN
The application has logged into the device or service.
Definition: stateCodes.hpp:46
@ CONNECTED
The application has connected to the device or service.
Definition: stateCodes.hpp:45
@ UNINITIALIZED
The application is unitialized, the default.
Definition: stateCodes.hpp:39
@ INITIALIZED
The application has been initialized, set just before calling appStartup().
Definition: stateCodes.hpp:40
@ NOTCONNECTED
The application is not connected to the device or service.
Definition: stateCodes.hpp:44
@ POWERON
The device power is on.
Definition: stateCodes.hpp:43
Definition: dm.hpp:24
Scoping struct for application state codes.
Definition: stateCodes.hpp:26
int16_t stateCodeT
The type of the state code.
Definition: stateCodes.hpp:31
static std::string codeText(stateCodeT stateCode)
Get an ASCII string corresponding to an application stateCode.
Definition: stateCodes.cpp:16