rllib  1
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
rlstatemachine.h
Go to the documentation of this file.
1 /***************************************************************************
2 * *
3 * This library is free software; you can redistribute it and/or modify *
4 * it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE as *
5 * published by the Free Software Foundation *
6 * *
7 ***************************************************************************/
8 #ifndef _RL_STATEMACHINE_H_
9 #define _RL_STATEMACHINE_H_
10 
11 #include "rldefine.h"
12 #include "rlplc.h"
13 
64 {
65  public:
66  rlStatemachine(int numStates, int numProcessVariables, rlPlcState *state=NULL);
67  virtual ~rlStatemachine();
68  int setPlcStateInt(int index, int val);
69  float setPlcStateFloat(int index, float val);
70  double setPlcStateDouble(int index, double val);
71  virtual void doState(); // implement in your subclass
72  virtual void enterState(int newState, int whichEntry=0); // implement in your subclass
73  virtual void exitState(int whichExit=0); // implement in your subclass
74  int getPlcStateInt(int index);
75  float getPlcStateFloat(int index);
76  double getPlcStateDouble(int index);
77  int getState();
78  rlPlcState *getVar();
79  protected:
81  int state;
84 };
85 
86 #endif
87