MotorControlModuleSDFM_TMS3.../Projects/EFC_Communication/UMLibrary/processing/acs/PiControllerProcess.hh

87 lines
2.0 KiB
C++
Raw Normal View History

2024-06-07 11:12:56 +03:00
/*
* PiControllerProcess.hh
*
* Created on: 5 июн. 2020 г.
* Author: LeonidTitov
*/
#ifndef UMLIBRARY_PROCESSING_ACS_PICONTROLLERPROCESS_HH_
#define UMLIBRARY_PROCESSING_ACS_PICONTROLLERPROCESS_HH_
#include "ControlSystemInterface.hh"
#include "../../systemic/ISignal.hh"
#include "../../systemic/IProcess.hh"
#include "../../common/ShadowGuard.hh"
#include "../../control/regulator/PiController.hh"
namespace processing { namespace acs {
//!Процесс выполнения ПИ-Регулятора.
class PiControllerProcess : public ValueToValueUnitInterface, public systemic::IProcess {
public:
typedef control::regulator::PiController Regulator;
//!Установить ошибку регулирования.
void set( TypeInput );
TypeOutput get() const;
void set_output( SetInterface * );
vector::ITechValue & getLimit();
void setSampleTime( float ts_in_second );
void process();
void reset();
vector::ITechValue & getTrackingTract();
PiControllerProcess( Regulator & regulator, systemic::ISignal & current_value );
private:
Regulator & regulator;
systemic::ISignal & current_value;
struct Limit : vector::ITechValue {
void set( float limit ) {
regulator.setOutputLimit(limit);
}
float get() const {
return regulator.getOutputLimit();
}
Regulator & regulator;
Limit(Regulator & regulator) : regulator(regulator) {}
} limit;
struct TrackingTract : vector::ITechValue {
void set( float tracked_value ) {
value = tracked_value;
}
float get() const {
return value;
}
control::Value value;
TrackingTract() : value(0.0f) {}
} tracking;
bool proc_enable;
bool isConnected() const;
SetInterface * output;
control::Value value_error; //!<Вход: ошибка регулятора.
control::Value value_output;
};
}}
#endif /* UMLIBRARY_PROCESSING_ACS_PICONTROLLERPROCESS_HH_ */