Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
DuringFindTrack (private)
Receives event, returns ReturnEvent
If ES_Entry
call StartFindTrackSM
If ES_Exit
call RunFindTrackSM
Else
call RunFindTrackSM (returns to ReturnEvent)
End
DuringFollowTrack (private)
Receives event, returns ReturnEvent
If ES_Entry
call StartFollowTrackSM
If ES_Exit
call RunFollowTrackSM
Else
call RunFollowTrackSM (returns to ReturnEvent)
End
DuringTakeStation (private)
Receives event, returns ReturnEvent
If ES_Entry
call StartTakeStationSM
If ES_Exit
call RunTakeStationSM
Else
call RunTakeStationSM (returns to ReturnEvent)
End
FindTrack SM
Module Variable: LastIR, CurrentState, AlignComplete
Timer: FindRotateTimer, FindForwardTimer (maybe can just use 1?)
StartFindTrackSM
Receives CurrentEvent, returns nothing
Init LastIR to 0
Set CurrentState to FindRotate
Set AlignComplete to 0
Call RunFindTrackSM
End
RunFindTrackSM
Receives CurrentEvent, returns ReturnEvent
Init MakeTransition, NextState, EntryEventKind, ReturnEvent
If CurrentState is FindRotate
If AlignComplete is 0
Call DuringFindRotateCW (returns to CurrentEvent)
If CurrentEvent is (ES_IRDetected && param is not LastIR)
or (ES_TIMEOUT for FindRotateTimer)
MakeTransition is True
NextState is FindMoveForward
If CurrentEvent is ES_IRDetected
Set LastIR to param
If CurrentState is FindMoveForward
Call DuringFindMoveForward (returns to CurrentEvent)
If MakeTransition is True
Recursion with ES_Exit
Set CurrentState to NextState
Recursion with EntryEventKind
End
DuringTakeRequest (Private)
Receives event, returns ReturnEvent
If ES_Entry
Get station frequency, construct request param
Post ES_Command w/param
Increase TakeCount by 1
Returns event
End
DuringTakeQuery (Private)
If ES_Entry
Post ES_Command w/query param
Start TakeQueryTimer for 50 ms
Else
If ES_TIMEOUT for TakeQueryTimer
Post ES_Command w/query param
Start TakeQueryTimer for 50 ms
Returns event
End
DuringTakeShooting (Private)
If ES_Entry
Post ES_Shoot w/param
Start ShootTimer for xxx (~shooting time)
Decrease NumShooting by 1
Returns event
End