23 #include "MQTTCommunication.h"
BoxCtrl::Event doAction_waitForTransport()
main action of the waitForTransport
BoxCtrl::Event doAction_resetState()
main action of the resetState
Box class contains all relevant information about the box and its actual state.
BoxCtrl::Event doAction_readSensorVal()
main action of the readSensorVal
The BoxLevel Controll class contains the FSM for the BoxLevel.
void entryAction_waitForVehicle()
entry action of the waitForVehicle
void entryAction_publishOptVehicle()
entry action of the publishOptVehicle
String decodeState(State state)
Decodes the State-Enum and returns a description.
void entryAction_waitForAck()
entry action of the waitForAck publish state to "Box/box.id/status"
State lastStateBevorError
holds the last state of the FSM so it's possible to resume after error
unsigned long currentMillis
store current time
String req
req for handshake vehicle
Sector
Sector class holds all possible position on the gametable.
wait for available vehicle
The Box Controll class contains the FSM for the complete Box.
unsigned long previousMillisPublish
store last publish time
BoxLevelCtrl pBoxlevelctrl
instance ot BoxLevelCtrl
Sector actualSector
actual sector initialise with Sortic handover
void exitAction_calculateOptVehicle()
exit action of the calculateOptVehicle
BoxCtrl::Event doAction_publishOptVehicle()
main action of the publishOptVehicle
State currentState
holds the current state of the FSM
BoxCtrl::Event doAction_calculateOptVehicle()
main action of the calculateOptVehicle
String ack
ack for handshake vehicle
Event
Enum holds all possible events.
Transit - Wait for Gateway Transfer.
void publishState(State state)
Publish actual state via communication.
bool checkForError()
Check if the last message was an error.
void entryAction_readSensorVal()
entry action of the readSensorVal
State
Enum holds all possible state's.
void process(Event e)
changes the state of the FSM based on the event
BoxCtrl()
Construct a new Box Ctrl object.
void exitAction_readSensorVal()
exit action of the readSensorVal
void exitAction_waitForVehicle()
exit action of the waitForVehicle
Error - Used to throw parseerror.
Sortic - Wait for Gateway.
Wait for Transport from vehicle.
Transfer - wait for Gateway.
void exitAction_waitForTransport()
exit action of the waitForTransport
Reset after Error occured.
Transit - Wait for Gateway Sortic.
void entryAction_errorState()
entry action of the errorState
Calculate desired vehicle.
void exitAction_errorState()
exit action of the errorState
Calculated Optimum Value.
String decodeEvent(Event event)
Decodes the Event-Enum and returns a description.
Resume after Error occured.
String status
status of the Box FSM
contains the default configuration for the smartbox
void exitAction_resetState()
exit action of the resetState
String decodeSector(Sector sector)
Decodes the Sector-Enum and returns a description.
BoxCtrl::Event doAction_errorState()
main action of the errorState
Communication pComm
instance of Communication with Box.id/hostname
#define DEFAULT_HOSTNAME
Hostname used for identification of SV.
The BoxLevel Controll class contains the FSM for the BoxLevel.
void entryAction_calculateOptVehicle()
entry action of the calculateOptVehicle
Wait for ack. from vehicle.
void entryAction_resetState()
entry action of the resetState
BoxCtrl::Event doAction_waitForAck()
main action of the waitForAck
SB is ready for transport.
int actualLine
actual line
void publishPosition()
publish actual position via communication
void entryAction_waitForTransport()
entry action of the waitForTransport
unsigned long previousMillis
store last time
void loop()
Calls the do-function of the active state and hence generates Events.
const int DEFAUL_HOSTNAME_NUMBER
Number of the Vehicle. Used to dermine startline and for GUI.
BoxCtrl::Event doAction_waitForVehicle()
main action of the waitForVehicle
void exitAction_publishOptVehicle()
exit action of the publishOptVehicle
Publishe desired vehicle.
void exitAction_waitForAck()
exit action of the waitForAck
void clearGui()
clear all box related gui entrys
Event(BoxCtrl::* doActionFPtr)(void)
Functionpointer to call the current states do-function.
Event currentEvent
holds the current event of the FSM