3. States and possible state switches#

The TOPOFLIGHT universal protocol offers two control interfaces: a web browser-based graphical user interface and a TCP-based interface. The web interface will enable the operator to invoke all state-switching methods. As a result, from TOPOFLIGHT side, it should not be assumed that the state cannot change unless requested via TCP.

Current implementations of the TOPOFLIGHT universal protocol will have these possible states:

1

“CONNECTED”

The TOPOFLIGHT universal protocol is activated, the TCP server is running and ready to listen for requests. It is awaiting the "SystemStart" request.

2

“STARTING”

This state indicates that there was a recent request for the TOPOFLIGHT universal protocol to perform "SystemStart", but the process is not yet complete. The connected sensors are currently undergoing the startup sequence, self-diagnostics, and other related tasks. The duration of this transitional state is not strictly deterministic, as it depends on various external factors. Since this procedure cannot be interrupted, the TOPOFLIGHT universal protocol will ignore any further state-switching requests until the startup sequence is finished. Once completed, the TOPOFLIGHT universal protocol will switch to NOT_LOGGING.

3

“NOT_LOGGING”

The TOPOFLIGHT universal protocol is ready for data collection. Once "StartLogging" is called, it will switch to LOGGING. If "SystemStop" is invoked, the TOPOFLIGHT universal protocol will switch to STOPPING and then, after completing the stopping sequence, transition to CONNECTED.

4

“LOGGING”

The TOPOFLIGHT universal protocol is currently collecting data. Once "StopLogging" or "SystemStop" is called, data collection will cease. If "StopLogging" is invoked, the TOPOFLIGHT universal protocol will switch to NOT_LOGGING. If "SystemStop" is called, it will switch to STOPPING, and after the stopping sequence is complete, it will transition to CONNECTED.

5

“STOPPING”

This state indicates that a recent request for the TOPOFLIGHT universal protocol to perform "SystemStop" has been initiated but is not yet complete. All active sensors are currently undergoing the stopping sequence. Similar to the STARTING state, the duration of this transitional state is not strictly deterministic. Since this procedure cannot be interrupted, the TOPOFLIGHT universal protocol will ignore any further state-switching requests until the stopping sequence is finished. Once completed, the TOPOFLIGHT universal protocol will switch to CONNECTED.

6-9

undefined

reserved for later use

10

“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.

../_images/TF_protocol_state_diagram.png

When TOPOFLIGHT first connects to the TOPOFLIGHT universal protocol, it 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 TOPOFLIGHT universal protocol will transition to NOT_LOGGING.

When the TOPOFLIGHT universal protocol is in the NOT_LOGGING state, "StartLogging" can be called, which will transition it to LOGGING and initiate data collection with minimal delay (the exact delay will need to be determined through testing). Additionally, "SystemStop" can be invoked while in the NOT_LOGGING state, which will switch the TOPOFLIGHT universal protocol to STOPPING, and subsequently to CONNECTED.

When the TOPOFLIGHT universal protocol is in the LOGGING state, "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, "SystemStop" should be called. This can be done from both the LOGGING and NOT_LOGGING states. It will transition the state to STOPPING, initiate the sensor stopping sequence, and then switch back 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.

../_images/TF_protocol_state_diagram_full.png