3. States and possible state switches#
The TOPOFLIGHT universal protocol has two control interfaces: a web browser-based graphical user interface and a TCP-based interface. The web interface allows the operator to invoke all state-switching methods. Therefore, from the TOPOFLIGHT perspective, it cannot be assumed that the system state changes only in response to TCP requests.
Current implementations of the TOPOFLIGHT universal protocol will have these possible states:
State ID |
State |
Description |
|---|---|---|
|
“CONNECTED” |
The TOPOFLIGHT universal protocol is activated, the TCP server is running and ready to listen for requests. It is awaiting the |
|
“STARTING” |
This state indicates that there was a recent request for the TOPOFLIGHT universal protocol to perform |
|
“NOT_LOGGING” |
The TOPOFLIGHT universal protocol is ready for data collection. Once |
|
“LOGGING” |
The TOPOFLIGHT universal protocol is currently collecting data. Once |
|
“STOPPING” |
This state indicates that a recent request for the TOPOFLIGHT universal protocol to perform |
|
undefined |
reserved for later use |
|
“ERROR” |
Some error has occurred in the TOPOFLIGHT universal protocol, and the self-diagnostics have identified the issue. The TOPOFLIGHT universal protocol is unable to continue functioning. Transitioning to this state can occur at any point during the workflow. |
The following simplified state diagram excludes the ERROR state for visual clarity. The complete version is provided at the end of the chapter.
When the first connection using TOPOFLIGHT universal protocol is made, the system is generally expected to be in the CONNECTED state.
While in the CONNECTED state, the only request that can be made is "SystemStart", which switches the state to STARTING. Once the sensor startup sequence is complete, the state will transition to NOT_LOGGING.
When the NOT_LOGGING state is active, calling "StartLogging" will transition it to LOGGING and initiate data collection with minimal delay (the exact delay should be determined through testing). Additionally, while in the NOT_LOGGING state, invoking "SystemStop" will switch the system to STOPPING, and, once the stopping sequence is complete, subsequently to CONNECTED.
When the LOGGING state is active, "StopLogging" can be called to swiftly halt data collection and transition the state to NOT_LOGGING with minimal delay. This action does not initiate any stopping sequence for the sensors, allowing them to remain prepared for a quick return to LOGGING.
When ending work with the TOPOFLIGHT universal protocol, the "SystemStop" should be issued. This can be done from both the LOGGING and NOT_LOGGING states. The system will transition to STOPPING, execute the sensor shutdown sequence and then return to CONNECTED.
The following full state diagram includes the ERROR state, which can be transitioned to from any state. This state will be visible to TOPOFLIGHT through the "GetState" request and error details will be provided in the "message" field.