rllib  1
rlstatemachine.h
Go to the documentation of this file.
00001 /***************************************************************************
00002 *                                                                         *
00003 *   This library is free software; you can redistribute it and/or modify  *
00004 *   it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE as        *
00005 *   published by the Free Software Foundation                             *
00006 *                                                                         *
00007 ***************************************************************************/
00008 #ifndef _RL_STATEMACHINE_H_
00009 #define _RL_STATEMACHINE_H_
00010 
00011 #include "rldefine.h"
00012 #include "rlplc.h"
00013 
00063 class rlStatemachine
00064 {
00065   public:
00066     rlStatemachine(int numStates, int numProcessVariables);
00067     virtual ~rlStatemachine();
00068     int    setPlcStateInt(int index, int val);
00069     float  setPlcStateFloat(int index, float val);
00070     double setPlcStateDouble(int index, double val);
00071     virtual void doState();                                  // implement in your subclass
00072     virtual void enterState(int newState, int whichEntry=0); // implement in your subclass
00073     virtual void exitState(int whichExit=0);                 // implement in your subclass
00074     int    getPlcStateInt(int index);
00075     float  getPlcStateFloat(int index);
00076     double getPlcStateDouble(int index);
00077     int    getState();
00078     rlPlcState *getVar();
00079   protected:  
00080     int num_states, num_process_variables;
00081     int state;
00082     rlPlcState *var;
00083 };
00084 
00085 #endif
00086 
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines