Performance improvements.

This commit is contained in:
Jeff Young 2023-05-21 11:23:56 +01:00
parent cbf83c4161
commit 502da2d03c
4 changed files with 64 additions and 50 deletions

View File

@ -399,8 +399,8 @@ const std::vector<SIM_MODEL::PARAM::INFO>& SIM_MODEL_SOURCE::makeParamInfos( TYP
} }
std::vector<SIM_MODEL::PARAM::INFO> SIM_MODEL_SOURCE::makeDcParamInfos( std::string aPrefix, std::vector<SIM_MODEL::PARAM::INFO> SIM_MODEL_SOURCE::makeDcParamInfos( const std::string& aPrefix,
std::string aUnit ) const std::string& aUnit )
{ {
std::vector<PARAM::INFO> paramInfos; std::vector<PARAM::INFO> paramInfos;
PARAM::INFO paramInfo; PARAM::INFO paramInfo;
@ -418,8 +418,8 @@ std::vector<SIM_MODEL::PARAM::INFO> SIM_MODEL_SOURCE::makeDcParamInfos( std::str
} }
std::vector<SIM_MODEL::PARAM::INFO> SIM_MODEL_SOURCE::makeSinParamInfos( std::string aPrefix, std::vector<SIM_MODEL::PARAM::INFO> SIM_MODEL_SOURCE::makeSinParamInfos( const std::string& aPrefix,
std::string aUnit ) const std::string& aUnit )
{ {
std::vector<PARAM::INFO> paramInfos; std::vector<PARAM::INFO> paramInfos;
PARAM::INFO paramInfo; PARAM::INFO paramInfo;
@ -477,8 +477,8 @@ std::vector<SIM_MODEL::PARAM::INFO> SIM_MODEL_SOURCE::makeSinParamInfos( std::st
} }
std::vector<SIM_MODEL::PARAM::INFO> SIM_MODEL_SOURCE::makePulseParamInfos( std::string aPrefix, std::vector<SIM_MODEL::PARAM::INFO> SIM_MODEL_SOURCE::makePulseParamInfos( const std::string& aPrefix,
std::string aUnit ) const std::string& aUnit )
{ {
std::vector<PARAM::INFO> paramInfos; std::vector<PARAM::INFO> paramInfos;
PARAM::INFO paramInfo; PARAM::INFO paramInfo;
@ -552,8 +552,8 @@ std::vector<SIM_MODEL::PARAM::INFO> SIM_MODEL_SOURCE::makePulseParamInfos( std::
} }
std::vector<SIM_MODEL::PARAM::INFO> SIM_MODEL_SOURCE::makeExpParamInfos( std::string aPrefix, std::vector<SIM_MODEL::PARAM::INFO> SIM_MODEL_SOURCE::makeExpParamInfos( const std::string& aPrefix,
std::string aUnit ) const std::string& aUnit )
{ {
std::vector<PARAM::INFO> paramInfos; std::vector<PARAM::INFO> paramInfos;
PARAM::INFO paramInfo; PARAM::INFO paramInfo;
@ -611,7 +611,7 @@ std::vector<SIM_MODEL::PARAM::INFO> SIM_MODEL_SOURCE::makeExpParamInfos( std::st
} }
/*std::vector<SIM_MODEL::PARAM::INFO> SIM_MODEL_SOURCE::makeSfamParamInfos( std::string aPrefix, std::string aUnit ) /*std::vector<SIM_MODEL::PARAM::INFO> SIM_MODEL_SOURCE::makeSfamParamInfos( const std::string& aPrefix, const std::string& aUnit )
{ {
std::vector<PARAM::INFO> paramInfos; std::vector<PARAM::INFO> paramInfos;
PARAM::INFO paramInfo; PARAM::INFO paramInfo;
@ -660,7 +660,7 @@ std::vector<SIM_MODEL::PARAM::INFO> SIM_MODEL_SOURCE::makeExpParamInfos( std::st
} }
std::vector<SIM_MODEL::PARAM::INFO> SIM_MODEL_SOURCE::makeSffmParamInfos( std::string aPrefix, std::string aUnit ) std::vector<SIM_MODEL::PARAM::INFO> SIM_MODEL_SOURCE::makeSffmParamInfos( const std::string& aPrefix, const std::string& aUnit )
{ {
std::vector<PARAM::INFO> paramInfos; std::vector<PARAM::INFO> paramInfos;
PARAM::INFO paramInfo; PARAM::INFO paramInfo;
@ -726,7 +726,7 @@ std::vector<SIM_MODEL::PARAM::INFO> SIM_MODEL_SOURCE::makeSffmParamInfos( std::s
}*/ }*/
std::vector<SIM_MODEL::PARAM::INFO> SIM_MODEL_SOURCE::makeCcParamInfos( std::string aGainUnit ) std::vector<SIM_MODEL::PARAM::INFO> SIM_MODEL_SOURCE::makeCcParamInfos( const std::string& aGainUnit )
{ {
std::vector<PARAM::INFO> paramInfos; std::vector<PARAM::INFO> paramInfos;
PARAM::INFO paramInfo; PARAM::INFO paramInfo;
@ -748,7 +748,7 @@ std::vector<SIM_MODEL::PARAM::INFO> SIM_MODEL_SOURCE::makeCcParamInfos( std::str
} }
std::vector<SIM_MODEL::PARAM::INFO> SIM_MODEL_SOURCE::makeVcParamInfos( std::string aGainUnit ) std::vector<SIM_MODEL::PARAM::INFO> SIM_MODEL_SOURCE::makeVcParamInfos( const std::string& aGainUnit )
{ {
std::vector<PARAM::INFO> paramInfos; std::vector<PARAM::INFO> paramInfos;
PARAM::INFO paramInfo; PARAM::INFO paramInfo;
@ -771,9 +771,9 @@ std::vector<SIM_MODEL::PARAM::INFO> SIM_MODEL_SOURCE::makeVcParamInfos( std::str
} }
std::vector<SIM_MODEL::PARAM::INFO> SIM_MODEL_SOURCE::makePwlParamInfos( std::string aPrefix, std::vector<SIM_MODEL::PARAM::INFO> SIM_MODEL_SOURCE::makePwlParamInfos( const std::string& aPrefix,
std::string aQuantity, const std::string& aQuantity,
std::string aUnit ) const std::string& aUnit )
{ {
std::vector<PARAM::INFO> paramInfos; std::vector<PARAM::INFO> paramInfos;
PARAM::INFO paramInfo; PARAM::INFO paramInfo;
@ -845,8 +845,8 @@ std::vector<SIM_MODEL::PARAM::INFO> SIM_MODEL_SOURCE::makePwlParamInfos( std::st
} }
std::vector<SIM_MODEL::PARAM::INFO> SIM_MODEL_SOURCE::makeWhiteNoiseParamInfos( std::string aPrefix, std::vector<SIM_MODEL::PARAM::INFO> SIM_MODEL_SOURCE::makeWhiteNoiseParamInfos( const std::string& aPrefix,
std::string aUnit ) const std::string& aUnit )
{ {
std::vector<PARAM::INFO> paramInfos; std::vector<PARAM::INFO> paramInfos;
PARAM::INFO paramInfo; PARAM::INFO paramInfo;
@ -872,8 +872,8 @@ std::vector<SIM_MODEL::PARAM::INFO> SIM_MODEL_SOURCE::makeWhiteNoiseParamInfos(
} }
std::vector<SIM_MODEL::PARAM::INFO> SIM_MODEL_SOURCE::makePinkNoiseParamInfos( std::string aPrefix, std::vector<SIM_MODEL::PARAM::INFO> SIM_MODEL_SOURCE::makePinkNoiseParamInfos( const std::string& aPrefix,
std::string aUnit ) const std::string& aUnit )
{ {
std::vector<PARAM::INFO> paramInfos; std::vector<PARAM::INFO> paramInfos;
PARAM::INFO paramInfo; PARAM::INFO paramInfo;
@ -907,8 +907,8 @@ std::vector<SIM_MODEL::PARAM::INFO> SIM_MODEL_SOURCE::makePinkNoiseParamInfos( s
} }
std::vector<SIM_MODEL::PARAM::INFO> SIM_MODEL_SOURCE::makeBurstNoiseParamInfos( std::string aPrefix, std::vector<SIM_MODEL::PARAM::INFO> SIM_MODEL_SOURCE::makeBurstNoiseParamInfos( const std::string& aPrefix,
std::string aUnit ) const std::string& aUnit )
{ {
std::vector<PARAM::INFO> paramInfos; std::vector<PARAM::INFO> paramInfos;
PARAM::INFO paramInfo; PARAM::INFO paramInfo;
@ -942,8 +942,8 @@ std::vector<SIM_MODEL::PARAM::INFO> SIM_MODEL_SOURCE::makeBurstNoiseParamInfos(
} }
std::vector<SIM_MODEL::PARAM::INFO> SIM_MODEL_SOURCE::makeRandomUniformParamInfos( std::string aPrefix, std::vector<SIM_MODEL::PARAM::INFO> SIM_MODEL_SOURCE::makeRandomUniformParamInfos( const std::string& aPrefix,
std::string aUnit ) const std::string& aUnit )
{ {
std::vector<PARAM::INFO> paramInfos; std::vector<PARAM::INFO> paramInfos;
PARAM::INFO paramInfo; PARAM::INFO paramInfo;
@ -985,8 +985,8 @@ std::vector<SIM_MODEL::PARAM::INFO> SIM_MODEL_SOURCE::makeRandomUniformParamInfo
} }
std::vector<SIM_MODEL::PARAM::INFO> SIM_MODEL_SOURCE::makeRandomNormalParamInfos( std::string aPrefix, std::vector<SIM_MODEL::PARAM::INFO> SIM_MODEL_SOURCE::makeRandomNormalParamInfos( const std::string& aPrefix,
std::string aUnit ) const std::string& aUnit )
{ {
std::vector<PARAM::INFO> paramInfos; std::vector<PARAM::INFO> paramInfos;
PARAM::INFO paramInfo; PARAM::INFO paramInfo;
@ -1028,8 +1028,8 @@ std::vector<SIM_MODEL::PARAM::INFO> SIM_MODEL_SOURCE::makeRandomNormalParamInfos
} }
std::vector<SIM_MODEL::PARAM::INFO> SIM_MODEL_SOURCE::makeRandomExpParamInfos( std::string aPrefix, std::vector<SIM_MODEL::PARAM::INFO> SIM_MODEL_SOURCE::makeRandomExpParamInfos( const std::string& aPrefix,
std::string aUnit ) const std::string& aUnit )
{ {
std::vector<PARAM::INFO> paramInfos; std::vector<PARAM::INFO> paramInfos;
PARAM::INFO paramInfo; PARAM::INFO paramInfo;
@ -1071,8 +1071,8 @@ std::vector<SIM_MODEL::PARAM::INFO> SIM_MODEL_SOURCE::makeRandomExpParamInfos( s
} }
std::vector<SIM_MODEL::PARAM::INFO> SIM_MODEL_SOURCE::makeRandomPoissonParamInfos( std::string aPrefix, std::vector<SIM_MODEL::PARAM::INFO> SIM_MODEL_SOURCE::makeRandomPoissonParamInfos( const std::string& aPrefix,
std::string aUnit ) const std::string& aUnit )
{ {
std::vector<PARAM::INFO> paramInfos; std::vector<PARAM::INFO> paramInfos;
PARAM::INFO paramInfo; PARAM::INFO paramInfo;
@ -1113,7 +1113,7 @@ std::vector<SIM_MODEL::PARAM::INFO> SIM_MODEL_SOURCE::makeRandomPoissonParamInfo
return paramInfos; return paramInfos;
} }
void SIM_MODEL_SOURCE::appendAcParamInfos( std::vector<PARAM::INFO>& aParamInfos, std::string aUnit ) void SIM_MODEL_SOURCE::appendAcParamInfos( std::vector<PARAM::INFO>& aParamInfos, const std::string& aUnit )
{ {
PARAM::INFO paramInfo; PARAM::INFO paramInfo;

View File

@ -82,25 +82,39 @@ protected:
private: private:
static const std::vector<PARAM::INFO>& makeParamInfos( TYPE aType ); static const std::vector<PARAM::INFO>& makeParamInfos( TYPE aType );
static std::vector<PARAM::INFO> makeDcParamInfos( std::string aPrefix, std::string aUnit ); static std::vector<PARAM::INFO> makeDcParamInfos( const std::string& aPrefix,
static std::vector<PARAM::INFO> makeSinParamInfos( std::string aPrefix, std::string aUnit ); const std::string& aUnit );
static std::vector<PARAM::INFO> makePulseParamInfos( std::string aPrefix, std::string aUnit ); static std::vector<PARAM::INFO> makeSinParamInfos( const std::string& aPrefix,
static std::vector<PARAM::INFO> makeExpParamInfos( std::string aPrefix, std::string aUnit ); const std::string& aUnit );
//static std::vector<PARAM::INFO> makeSfamParamInfos( std::string aPrefix, std::string aUnit ); static std::vector<PARAM::INFO> makePulseParamInfos( const std::string& aPrefix,
//static std::vector<PARAM::INFO> makeSffmParamInfos( std::string aPrefix, std::string aUnit ); const std::string& aUnit );
static std::vector<SIM_MODEL::PARAM::INFO> makeVcParamInfos( std::string aGainUnit ); static std::vector<PARAM::INFO> makeExpParamInfos( const std::string& aPrefix,
static std::vector<SIM_MODEL::PARAM::INFO> makeCcParamInfos( std::string aGainUnit ); const std::string& aUnit );
static std::vector<PARAM::INFO> makePwlParamInfos( std::string aPrefix, std::string aQuantity, //static std::vector<PARAM::INFO> makeSfamParamInfos( const std::string& aPrefix,
std::string aUnit ); // const std::string& aUnit );
static std::vector<PARAM::INFO> makeWhiteNoiseParamInfos( std::string aPrefix, std::string aUnit ); //static std::vector<PARAM::INFO> makeSffmParamInfos( const std::string& aPrefix,
static std::vector<PARAM::INFO> makePinkNoiseParamInfos( std::string aPrefix, std::string aUnit ); // const std::string& aUnit );
static std::vector<PARAM::INFO> makeBurstNoiseParamInfos( std::string aPrefix, std::string aUnit ); static std::vector<SIM_MODEL::PARAM::INFO> makeVcParamInfos( const std::string& aGainUnit );
static std::vector<PARAM::INFO> makeRandomUniformParamInfos( std::string aPrefix, std::string aUnit ); static std::vector<SIM_MODEL::PARAM::INFO> makeCcParamInfos( const std::string& aGainUnit );
static std::vector<PARAM::INFO> makeRandomNormalParamInfos( std::string aPrefix, std::string aUnit ); static std::vector<PARAM::INFO> makePwlParamInfos( const std::string& aPrefix,
static std::vector<PARAM::INFO> makeRandomExpParamInfos( std::string aPrefix, std::string aUnit ); const std::string& aQuantity,
static std::vector<PARAM::INFO> makeRandomPoissonParamInfos( std::string aPrefix, std::string aUnit ); const std::string& aUnit );
static std::vector<PARAM::INFO> makeWhiteNoiseParamInfos( const std::string& aPrefix,
const std::string& aUnit );
static std::vector<PARAM::INFO> makePinkNoiseParamInfos( const std::string& aPrefix,
const std::string& aUnit );
static std::vector<PARAM::INFO> makeBurstNoiseParamInfos( const std::string& aPrefix,
const std::string& aUnit );
static std::vector<PARAM::INFO> makeRandomUniformParamInfos( const std::string& aPrefix,
const std::string& aUnit );
static std::vector<PARAM::INFO> makeRandomNormalParamInfos( const std::string& aPrefix,
const std::string& aUnit );
static std::vector<PARAM::INFO> makeRandomExpParamInfos( const std::string& aPrefix,
const std::string& aUnit );
static std::vector<PARAM::INFO> makeRandomPoissonParamInfos( const std::string& aPrefix,
const std::string& aUnit );
static void appendAcParamInfos( std::vector<PARAM::INFO>& aParamInfos, std::string aUnit ); static void appendAcParamInfos( std::vector<PARAM::INFO>& aParamInfos, const std::string& aUnit );
}; };
#endif // SIM_MODEL_SOURCE_H #endif // SIM_MODEL_SOURCE_H

View File

@ -82,7 +82,7 @@ public:
m_progressReporter( aProgressReporter ), m_progressReporter( aProgressReporter ),
m_lastProgressTime( std::chrono::steady_clock::now() ), m_lastProgressTime( std::chrono::steady_clock::now() ),
m_lineCount( aLineCount ), m_lineCount( aLineCount ),
m_queryUserCallback( aQueryUserCallback ) m_queryUserCallback( std::move( aQueryUserCallback ) )
{ {
init(); init();
} }

View File

@ -277,7 +277,7 @@ public:
void SetQueryUserCallback( std::function<bool( wxString aTitle, int aIcon, wxString aMessage, void SetQueryUserCallback( std::function<bool( wxString aTitle, int aIcon, wxString aMessage,
wxString aOKButtonTitle )> aCallback ) override wxString aOKButtonTitle )> aCallback ) override
{ {
m_queryUserCallback = aCallback; m_queryUserCallback = std::move( aCallback );
} }
void Save( const wxString& aFileName, BOARD* aBoard, void Save( const wxString& aFileName, BOARD* aBoard,