Project

General

Profile

Command States

The automatic setting of command states has different rules. For a controller, we suppose that only one command (different from "read" and "status") can run at once.
The possible states are INACTIVE, STARTING, ACTIVE, PAUSED, PAUSING, PAUSE, STOPPING, STOPPED, RESUMING.

When the controller does nothing, every command has the state INACTIVE.
  • if the "start" command is started and the command is running, the state of the "start" command is ACTIVE.
    • the function isStarted() returns true
  • if the "stop" command is requested, the state of the "start" command becomes STOPPING.
    • in the function stop(), isStopping() returns true
    • after the function stop() executed, isStopped() returns true, the state of the "start" command becomes STOPPED.
    • in the function start(), isStopped() returns true (after the execution of the stop() command in parallel)
  • if the "pause" command is requested, the state of the "start" command becomes PAUSING.
    • in the function pause(), isPausing() returns true
    • after the function pause() executed, isPaused() returns true, the state of the "start" command becomes PAUSED.
    • in the function start(), isPaused() returns true (after the execution of the pause() command in parallel)
  • if the "resume" command is requested, the state of the "start" command becomes RESUMING.
    • in the function resume(), isResuming() returns true
    • in the function start(), isStarted() returns true (after the execution of the resume() command in parallel)
    • after the function resume() executed, the state of the "start" command becomes ACTIVE.
  • after the start() function executed, the state of the "start" command becomes INACTIVE.
When the controller does nothing its state is invariant :
  • if the "stop" command is requested, the state of the "start" command remains INACTIVE.
    • in the function stop(), isStarted() and isStopping() return false
  • if the "pause" command is requested, the state of the "start" command remains INACTIVE.
    • in the function pause(), isStarted() and isPausing() return false
  • if the "resume" command is requested, the state of the "start" command remains INACTIVE.
    • in the function resume(), isStarted() and isResuming() return false
Notice that the behaviour is the same for commands different from "read" and "status".
But there are differences for some functions:
  • isStarted() : one command is not INACTIVE (true also for commands different from "read" and "status")
  • Start::getState() != common::INACTIVE : only the start command is not active
  • ManualMove::getState() != common::INACTIVE : only the manual move command is not active
  • isStopping() : one command is STOPPING (true also for commands different from "read" and "status")
  • Start::getState() = common::STOPPING : only the start command is stopping
  • ManualMove::getState() = common::STOPPING : only the manual move command is stopping
  • isPausing() : one command is PAUSING (true also for commands different from "read" and "status")
  • Start::getState() = common::PAUSING : only the start command is pausing
  • ManualMove::getState() = common::PAUSING : only the manual move command is pausing
  • isResuming() : one command is RESUMING (true also for commands different from "read" and "status")
  • Start::getState() = common::RESUMING : only the start command is resuming
  • ManualMove::getState() = common::RESUMING : only the manual move command is resuming