Sim: Add tuner param virtual getter

This commit is contained in:
Mikolaj Wielgus 2022-10-24 03:11:52 +02:00
parent d14de1ce78
commit 78b193af5f
3 changed files with 6 additions and 0 deletions

View File

@ -582,6 +582,8 @@ public:
int GetParamCount() const { return static_cast<int>( m_params.size() ); } int GetParamCount() const { return static_cast<int>( m_params.size() ); }
virtual const PARAM& GetParam( unsigned aParamIndex ) const; // Return base parameter unless it's overridden. virtual const PARAM& GetParam( unsigned aParamIndex ) const; // Return base parameter unless it's overridden.
virtual const PARAM* GetTunerParam() const { return nullptr; }
const PARAM* FindParam( const std::string& aParamName ) const; const PARAM* FindParam( const std::string& aParamName ) const;
std::vector<std::reference_wrapper<const PARAM>> GetParams() const; std::vector<std::reference_wrapper<const PARAM>> GetParams() const;

View File

@ -47,6 +47,8 @@ public:
void WriteDataSchFields( std::vector<SCH_FIELD>& aFields ) const override; void WriteDataSchFields( std::vector<SCH_FIELD>& aFields ) const override;
void WriteDataLibFields( std::vector<LIB_FIELD>& aFields ) const override; void WriteDataLibFields( std::vector<LIB_FIELD>& aFields ) const override;
const PARAM* GetTunerParam() const override { return &GetParam( 0 ); }
private: private:
template <typename T> template <typename T>
void inferredWriteDataFields( std::vector<T>& aFields ) const; void inferredWriteDataFields( std::vector<T>& aFields ) const;

View File

@ -46,6 +46,8 @@ public:
void WriteDataSchFields( std::vector<SCH_FIELD>& aFields ) const override; void WriteDataSchFields( std::vector<SCH_FIELD>& aFields ) const override;
void WriteDataLibFields( std::vector<LIB_FIELD>& aFields ) const override; void WriteDataLibFields( std::vector<LIB_FIELD>& aFields ) const override;
const PARAM* GetTunerParam() const override { return FindParam( "pos" ); }
private: private:
template <typename T> template <typename T>
void inferredWriteDataFields( std::vector<T>& aFields ) const; void inferredWriteDataFields( std::vector<T>& aFields ) const;