/* * ManagedPiControlProcess.hh * * Created on: 14 янв. 2022 г. * Author: titov */ #ifndef UMLIBRARY_PROCESSING_ACS_MANAGEDPICONTROLPROCESS_HH_ #define UMLIBRARY_PROCESSING_ACS_MANAGEDPICONTROLPROCESS_HH_ #include "ControlSystemInterface.hh" #include "../../systemic/ISignal.hh" #include "../../systemic/IStatus.hh" #include "../../systemic/IProcess.hh" #include "../../systemic/FlagStiker.hh" #include "../../systemic/ApplyParameter.hpp" #include "../../common/ShadowGuard.hh" #include "../../control/regulator/ManagedPiController.hh" namespace processing { namespace acs { //!Процесс выполнения управляемого ПИ-Регулятора, с разрешением интегрирования и возможностью сброса интегральной суммы. class ManagedPiControlProcess : public ValueToValueUnitInterface, public systemic::IProcess { public: typedef control::regulator::ManagedPiController Regulator; //!Установить ошибку регулирования. void set( TypeInput ); TypeOutput get() const; void set_output( SetInterface * ); vector::ITechValue & getLimit(); void setSampleTime( float ts_in_second ); void process(); void reset(); void apply(); ManagedPiControlProcess( Regulator & regulator, systemic::ISignal & reset_value, systemic::IStatus & operate, systemic::Parameter params ); private: Regulator & regulator; systemic::ISignal & reset_value; systemic::IStatus & operate; 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; bool need_reset; bool proc_enable; bool isConnected() const; void do_reset(); SetInterface * output; control::Value value_error; //!<Вход: ошибка регулятора. control::Value value_output; std::atomic_flag update_lock; systemic::ApplyParameter apply_params; }; }} #endif /* UMLIBRARY_PROCESSING_ACS_MANAGEDPICONTROLPROCESS_HH_ */