MotorControlModuleSDFM_TMS3.../Projects/EFC_Communication/UMLibrary/processing/acs/ManagedPiControlProcess.hh
2024-06-07 11:12:56 +03:00

88 lines
2.3 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* 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<Regulator> 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<Regulator> apply_params;
};
}}
#endif /* UMLIBRARY_PROCESSING_ACS_MANAGEDPICONTROLPROCESS_HH_ */