#ifndef Pump_h #define Pump_h #include "Arduino.h" #include "../Temperature/Temperature.h" #define DEFAULT_PUMP_MAX_OPETATION_TEMPERARTURE 90 #define DEFAULT_PUMP_PRIMING_TIME_IN_SECONDS 10 //#define HEATING_ELEMENT_MAX_HEAT_PWM_INTEGER 5 //#define HEATING_ELEMENT_MAX_HEAT_PWM_FLOAT 5.0 class Pump { public: Pump( int iOutputPin, int iOffValue, int iMaxValue, int iMaxTemperature, int iPrimingTimeInSeconds ); Pump( int iOutputPin, int iOffValue, int iMaxValue ); void shutDown(); void forcePumpSelfPrime(); bool process(); bool process( int iTargetPumpSpeed ); bool isPumpOn(); void setCheckTemperatureFunction( Temperature *temperature ); int getTargetPumpSpeed(); void setTargetPumpSpeed( int iTargetPumpSpeed ); int getNullSpeed(); int getOneSixthSpeed(); int getOneThirdSpeed(); int getHalfSpeed(); int getTwoThirdSpeed(); int getMaxSpeed(); bool setTesting( bool testing ); private: int _iOutputPin; int _iOffValue; int _iMaxValue; int _testing; boolean _selfPrimingMode; boolean _hasBeenPrimedSinceStartup; unsigned long _millisAtPrimingStart; int _iPrimingTimeInSeconds; int _iMaxTemperature; int _iActualPumpSpeed; // Time frame to operate in int _iTargetPumpSpeed; Temperature *_temperature; // Private functions int calculateSpeedFraction( double fraction ); int modeSet( int value ); }; #endif