#ifndef P_CONTROLLER_H #define P_CONTROLLER_H class P_controller { protected: double Kp; double default_Kp; // Gildið úr constructornum, notað af restore_defaults() public: P_controller(double Kp); virtual ~P_controller() {} virtual double update(double ref, double actual); virtual void reset() {} virtual void restore_defaults(); // virtual double get_Kp() const { return Kp; } virtual double get_Ti() const { return 0.0; } virtual void set_Kp(double value) { Kp = value; } virtual bool set_Ti(double value) { // P controller does not use Ti (void)value; return true; } }; #endif