48 aFields.emplace_back( aSymbol.GetReferenceField() );
49 aFields.emplace_back( aSymbol.GetValueField() );
58 &modelParams, &pinMap ) );
62 if( !modelType.IsEmpty() )
69 wxString original = valueField->
GetText();
70 valueField->
SetText( wxT(
"${SIM.PARAMS}" ) );
80 auto symbol = std::make_unique<LIB_SYMBOL>(
"symbol",
nullptr );
81 symbol->AddDrawItem(
new SCH_PIN( symbol.get() ) );
82 symbol->AddDrawItem(
new SCH_PIN( symbol.get() ) );
83 symbol->GetReferenceField().SetText(
"R1" );
84 symbol->GetValueField().SetText(
"3R3" );
86 std::vector<SCH_PIN*> pins = symbol->GetPins();
87 std::vector<SCH_FIELD> fields;
94 model->SetIsStoredInValue(
false );
95 model->WriteFields( fields );
97 model->IsStoredInValue() );
105 auto symbol = std::make_unique<LIB_SYMBOL>(
"symbol",
nullptr );
106 symbol->AddDrawItem(
new SCH_PIN( symbol.get() ) );
107 symbol->AddDrawItem(
new SCH_PIN( symbol.get() ) );
108 symbol->GetReferenceField().SetText(
"R1" );
109 symbol->GetValueField().SetText(
"3R3" );
111 std::vector<SCH_PIN*> pins = symbol->GetPins();
112 std::vector<SCH_FIELD> fields;
120 model->SetIsStoredInValue(
true );
121 model->WriteFields( fields );
123 model->IsStoredInValue() );
127 "Value left as placeholder when parameters stored in Value" );
128 BOOST_CHECK( !value.IsEmpty() );
static void RestoreInferredValue(std::vector< SCH_FIELD > &aFields, const wxString &aOriginalValue, bool aOverwritten, bool aStoredInValue)
Restore an inferred passive's Value field after WriteFields().
Define a library symbol object.
virtual const wxString & GetText() const override
Return the string associated with the text object.
void SetText(const wxString &aText) override
static bool InferSimModel(T &aSymbol, std::vector< SCH_FIELD > *aFields, bool aResolve, int aDepth, SIM_VALUE_GRAMMAR::NOTATION aNotation, wxString *aDeviceType, wxString *aModelType, wxString *aModelParams, wxString *aPinMap)
static std::unique_ptr< SIM_MODEL > Create(TYPE aType, const std::vector< SCH_PIN * > &aPins, REPORTER &aReporter)
A wrapper for reporting to a wxString object.
void SetFieldValue(std::vector< SCH_FIELD > &aFields, const wxString &aFieldName, const std::string &aValue, bool aIsVisible=true, const SCH_SHEET_PATH *aSheetPath=nullptr, const wxString &aVariantName=wxEmptyString)
wxString GetFieldValue(const std::vector< SCH_FIELD > *aFields, FIELD_T aFieldType)
const SCH_FIELD * FindField(const std::vector< SCH_FIELD > &aFields, FIELD_T aFieldId)
#define SIM_DEVICE_SUBTYPE_FIELD
@ VALUE
Field Value of part, i.e. "3.3K".
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_CASE(ValuePreservedWhenNotStored)
static wxString buildDialogFields(LIB_SYMBOL &aSymbol, std::vector< SCH_FIELD > &aFields)
Regression coverage for https://gitlab.com/kicad/code/kicad/-/issues/23687.
IbisParser parser & reporter
BOOST_CHECK_MESSAGE(totalMismatches==0, std::to_string(totalMismatches)+" board(s) with strategy disagreements")
BOOST_CHECK_EQUAL(result, "25.4")