You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DS402: Fix logic errors in the power state machine and generalize it. (#264)
* p402: Forbid transitions to states which only the drive can enter.
The NOT READY TO SWITCH ON and FAULT REACTION ACTIVE states can only
be reached if the drive encounters an error or is still busy with its
self-testing. Raise an exception in case these states are requested
via the property.
In extension, only the drive can trigger a transition to the FAULT
state, so that is never valid as an end goal requested by the user.
* p402: Add a test script to check DS402 State Machine transitions.
Go through all possible target states and display where the
next_state_for_enabling() function would lead to based on the original
state. Mark transitions which can happen directly because they are in
the TRANSITIONTABLE.
* p402: Extend test script to check the actual implementation.
Mock up a BaseNode402 object and compare the _next_state() behavior to
the simple lookups from the underlying transition tables.
* p402: Simplify check for intermediate states.
Don't special case the OPERATION ENABLED state, as the mechanism
formulated for it is actually usable for almost all states. Instead,
check whether there is a direct transition and return that immediately
before consulting next_state_for_enabling().
* p402: Rename NEXTSTATE2ENABLE to generalize it.
The goal is to provide automatic transition paths for any state, not
only OPERATION ENABLED. Reflect that in the naming, without changing
the actual logic yet.
* p402: Adjust automatic state transition paths.
As there is a direct transition from QUICK STOP ACTIVE to OPERATION
ENABLED, remove that from the transition paths. Instead go through
the SWITCH ON DISABLED state, closing the cycle to make it work for
anything between SWITCH ON DISABLED and OPERATION ENABLED.
Also remove the self-reference OPERATION ENABLED to itself, which is
useless. The whole state changing code will only be called if the
target state and the current state do not match.
* p402: Remove two illegal transitions from the state table.
Transitions 7 and 10 are duplicated and certainly wrong in the
quickstop context. The only transition toward QUICK STOP ACTIVE is
from OPERATION ENABLED.
* Move test_p402_states script to a subdirectory and add a docstring.
0 commit comments