API
stateCodes.cpp
Go to the documentation of this file.
1 /** \file stateCodes.cpp
2  * \brief MagAO-X Application States
3  * \author Jared R. Males (jaredmales@gmail.com)
4  *
5  *
6  * \ingroup app_files
7  */
8 
9 #include "stateCodes.hpp"
10 
11 namespace MagAOX
12 {
13 namespace app
14 {
15 
16 std::string stateCodes::codeText( stateCodeT stateCode )
17 {
18  switch(stateCode)
19  {
21  return "FAILURE";
22  case stateCodes::ERROR:
23  return "ERROR";
25  return "UNINITIALIZED";
27  return "INITIALIZED";
29  return "NODEVICE";
31  return "POWEROFF";
33  return "POWERON";
35  return "NOTCONNECTED";
37  return "CONNECTED";
39  return "LOGGEDIN";
41  return "CONFIGURING";
43  return "NOTHOMED";
44  case stateCodes::HOMING:
45  return "HOMING";
47  return "OPERATING";
48  case stateCodes::READY:
49  return "READY";
51  return "SHUTDOWN";
52  default:
53  return "UNKNOWN";
54  }
55 
56  return "UNKNOWN";
57 }
58 
59 } //namespace app
60 } //namespace MagAOX
61 
@ 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
MagAO-X Application States.
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