Actuator.h

Go to the documentation of this file.
00001 /*
00002 
00003 MegaPlusPlus a C++ implementation for the MegaSquirt-II
00004 Copyright (C) 2006  Keith Ballantyne
00005 
00006 This program is free software; you can redistribute it and/or
00007 modify it under the terms of the GNU General Public License
00008 version 2 as published by the Free Software Foundation.
00009 
00010 This program is distributed in the hope that it will be useful,
00011 but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 GNU General Public License for more details.
00014 
00015 You should have received a copy of the GNU General Public License
00016 along with this program; if not, write to the Free Software
00017 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00018 
00019 */
00020 
00032 #ifndef ACTUATOR_H
00033     #define ACTUATOR_H
00034 
00035  class Actuator {
00036  public:
00037      enum ActuatorType {
00039          INJECTOR,
00041          IDLE_AIR_CONTROLLER,
00043          FUEL_PUMP,
00045          INDICATOR,
00047          COIL
00048       };
00049 
00050       enum Status {
00052           OK,
00054           FAILED
00055       };
00056 
00062       inline ActuatorType getType() { return type; }
00063 
00069       inline char getChannel() { return channel; }
00070  
00081       virtual Status setState(int state)=0;
00082 
00088       virtual int getState()=0;
00089 
00093       virtual ~Actuator() {}
00094  protected:
00102      Actuator(ActuatorType  t, char ch):type(t),channel(ch) {
00103      }
00104 
00108      const ActuatorType type;
00109 
00113      const char channel;
00114 };
00115 
00116  #endif

Generated on Tue Sep 19 14:04:30 2006 for MegaPlusPlus by  doxygen 1.4.6