From 7d207c5d2f28c6187bed4cd0152011e66868bf7e Mon Sep 17 00:00:00 2001 From: Mikolaj Wielgus Date: Wed, 30 Nov 2022 17:36:49 +0100 Subject: [PATCH] Sim Ibis: Change some strings for consistency --- eeschema/sim/sim_model.cpp | 8 ++++---- eeschema/sim/sim_model_kibis.cpp | 30 +++++++++++++++--------------- eeschema/sim/sim_model_kibis.h | 11 +++-------- 3 files changed, 22 insertions(+), 27 deletions(-) diff --git a/eeschema/sim/sim_model.cpp b/eeschema/sim/sim_model.cpp index d5eafc3818..d776962a2c 100644 --- a/eeschema/sim/sim_model.cpp +++ b/eeschema/sim/sim_model.cpp @@ -215,10 +215,10 @@ SIM_MODEL::INFO SIM_MODEL::TypeInfo( TYPE aType ) case TYPE::SUBCKT: return { DEVICE_TYPE_::SUBCKT, "", "" }; case TYPE::XSPICE: return { DEVICE_TYPE_::XSPICE, "", "" }; - case TYPE::KIBIS_DEVICE: return { DEVICE_TYPE_::KIBIS, "IBISDEVICE", "Device" }; - case TYPE::KIBIS_DRIVER_DC: return { DEVICE_TYPE_::KIBIS, "IBISDRIVERDC", "DC driver" }; - case TYPE::KIBIS_DRIVER_RECT: return { DEVICE_TYPE_::KIBIS, "IBISDRIVERRECT", "Rectangular wave driver" }; - case TYPE::KIBIS_DRIVER_PRBS: return { DEVICE_TYPE_::KIBIS, "IBISDRIVERPRBS", "PRBS driver" }; + case TYPE::KIBIS_DEVICE: return { DEVICE_TYPE_::KIBIS, "DEVICE", "Device" }; + case TYPE::KIBIS_DRIVER_DC: return { DEVICE_TYPE_::KIBIS, "DCDRIVER", "DC driver" }; + case TYPE::KIBIS_DRIVER_RECT: return { DEVICE_TYPE_::KIBIS, "RECTDRIVER", "Rectangular wave driver" }; + case TYPE::KIBIS_DRIVER_PRBS: return { DEVICE_TYPE_::KIBIS, "PRBSDRIVER", "PRBS driver" }; case TYPE::RAWSPICE: return { DEVICE_TYPE_::SPICE, "", "" }; diff --git a/eeschema/sim/sim_model_kibis.cpp b/eeschema/sim/sim_model_kibis.cpp index e0afa33616..f2d553186a 100644 --- a/eeschema/sim/sim_model_kibis.cpp +++ b/eeschema/sim/sim_model_kibis.cpp @@ -353,40 +353,40 @@ std::vector SIM_MODEL_KIBIS::makeParamInfos( TYPE aType paramInfo.type = SIM_VALUE::TYPE_STRING; paramInfo.unit = ""; paramInfo.category = PARAM::CATEGORY::PRINCIPAL; - paramInfo.defaultValue = "TYP"; + paramInfo.defaultValue = "typ"; paramInfo.description = _( "Power supply" ); paramInfo.spiceModelName = ""; - paramInfo.enumValues = { "TYP", "MIN", "MAX" }; + paramInfo.enumValues = { "typ", "min", "max" }; paramInfos.push_back( paramInfo ); paramInfo.name = "rpin"; paramInfo.type = SIM_VALUE::TYPE_STRING; paramInfo.unit = ""; paramInfo.category = PARAM::CATEGORY::PRINCIPAL; - paramInfo.defaultValue = "TYP"; - paramInfo.description = _( "Parasitic Resistance" ); + paramInfo.defaultValue = "typ"; + paramInfo.description = _( "Parasitic pin resistance" ); paramInfo.spiceModelName = ""; - paramInfo.enumValues = { "TYP", "MIN", "MAX" }; + paramInfo.enumValues = { "typ", "min", "max" }; paramInfos.push_back( paramInfo ); paramInfo.name = "lpin"; paramInfo.type = SIM_VALUE::TYPE_STRING; paramInfo.unit = ""; paramInfo.category = PARAM::CATEGORY::PRINCIPAL; - paramInfo.defaultValue = "TYP"; - paramInfo.description = _( "Parasitic Pin Inductance" ); + paramInfo.defaultValue = "typ"; + paramInfo.description = _( "Parasitic pin inductance" ); paramInfo.spiceModelName = ""; - paramInfo.enumValues = { "TYP", "MIN", "MAX" }; + paramInfo.enumValues = { "typ", "min", "max" }; paramInfos.push_back( paramInfo ); paramInfo.name = "cpin"; paramInfo.type = SIM_VALUE::TYPE_STRING; paramInfo.unit = ""; paramInfo.category = PARAM::CATEGORY::PRINCIPAL; - paramInfo.defaultValue = "TYP"; - paramInfo.description = _( "Parasitic Pin Capacitance" ); + paramInfo.defaultValue = "typ"; + paramInfo.description = _( "Parasitic pin capacitance" ); paramInfo.spiceModelName = ""; - paramInfo.enumValues = { "TYP", "MIN", "MAX" }; + paramInfo.enumValues = { "typ", "min", "max" }; paramInfos.push_back( paramInfo ); std::vector dc = makeDcWaveformParamInfos(); @@ -457,7 +457,7 @@ std::vector SIM_MODEL_KIBIS::makeRectWaveformParamInfos( paramInfo.description = _( "OFF time" ); paramInfos.push_back( paramInfo ); - paramInfo.name = "delay"; + paramInfo.name = "td"; paramInfo.type = SIM_VALUE::TYPE_FLOAT; paramInfo.unit = "s"; paramInfo.category = PARAM::CATEGORY::WAVEFORM; @@ -465,12 +465,12 @@ std::vector SIM_MODEL_KIBIS::makeRectWaveformParamInfos( paramInfo.description = _( "Delay" ); paramInfos.push_back( paramInfo ); - paramInfo.name = "cycles"; + paramInfo.name = "n"; paramInfo.type = SIM_VALUE::TYPE_FLOAT; paramInfo.unit = ""; paramInfo.category = PARAM::CATEGORY::WAVEFORM; paramInfo.defaultValue = "1"; - paramInfo.description = _( "cycles" ); + paramInfo.description = _( "Number of cycles" ); paramInfos.push_back( paramInfo ); return paramInfos; @@ -490,7 +490,7 @@ std::vector SIM_MODEL_KIBIS::makePrbsWaveformParamInfos( paramInfo.description = _( "Bitrate" ); paramInfos.push_back( paramInfo ); - paramInfo.name = "bits"; + paramInfo.name = "n"; paramInfo.type = SIM_VALUE::TYPE_FLOAT; paramInfo.unit = ""; paramInfo.category = PARAM::CATEGORY::WAVEFORM; diff --git a/eeschema/sim/sim_model_kibis.h b/eeschema/sim/sim_model_kibis.h index 8874b40492..729a70e0f6 100644 --- a/eeschema/sim/sim_model_kibis.h +++ b/eeschema/sim/sim_model_kibis.h @@ -52,12 +52,6 @@ class SIM_MODEL_KIBIS : public SIM_MODEL { friend class SIM_LIBRARY_KIBIS; - static constexpr auto DRIVER_RECT = "rect"; - static constexpr auto DRIVER_STUCKH = "stuck high"; - static constexpr auto DRIVER_STUCKL = "stuck low"; - static constexpr auto DRIVER_HIGHZ = "high Z"; - static constexpr auto DRIVER_PRBS = "prbs"; - public: SIM_MODEL_KIBIS( TYPE aType ); @@ -86,8 +80,9 @@ public: return m_params.at( aParamIndex ); }; - /** @brief update the list of available models based on the pin number. - * */ + /** + * @brief update the list of available models based on the pin number. + */ bool ChangePin( const SIM_LIBRARY_KIBIS& aLib, std::string aPinNumber ); void SetBaseModel( const SIM_MODEL& aBaseModel ) override;