87 lines
1.9 KiB
C++
87 lines
1.9 KiB
C++
/*
|
|
* 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_ */
|