37struct BDS_TEST_FIXTURE
40 m_board( new
BOARD() )
43 SETTINGS_MANAGER m_settingsManager;
44 std::unique_ptr<BOARD> m_board;
53 JSON_SETTINGS(
"bds_test_parent",
SETTINGS_LOC::
NONE, 0, false, false, false )
60BOOST_FIXTURE_TEST_SUITE( BoardDesignSettings, BDS_TEST_FIXTURE )
104 const int ruleClearance =
pcbIUScale.mmToIU( 4.0 );
106 auto rule = std::make_shared<DRC_RULE>( wxT(
"NPTH Hole to Track Clearance" ) );
110 rule->AddConstraint( constraint );
112 auto engine = std::make_shared<DRC_ENGINE>( m_board.get(), &bds );
113 engine->InitEngine( rule );
142 for(
int step = 2; step <= lastReal; ++step )
156 for(
int step = lastReal - 1; step >= 1; --step )
165 for(
int step = 0; step < lastReal * 3; ++step )
167 BOOST_CHECK_GE( idx, 1 );
291 BDS_TEST_PARENT parent;
293 ( *parent.Internals() )[
"/board/design_settings"_json_pointer] =
294 nlohmann::json{ {
"meta", { {
"version", 2 } } } };
296 const int negativeValue =
pcbIUScale.mmToIU( -0.1 );
319 nlohmann::json js = nlohmann::json::array();
321 for(
int i = 0; i < 3; ++i )
323 nlohmann::json entry = {};
324 entry[
"name"] =
"preset" + std::to_string( i );
325 entry[
"start_layer"] = (int)
F_Cu;
326 entry[
"end_layer"] = (int)
In1_Cu;
329 entry[
"via_size"] = ( i == 1 ) ? nlohmann::json(
"0.25" ) : nlohmann::json( 0.25 );
330 js.push_back( entry );
333 bds.
Set(
"via_stack_presets", js );
351 nlohmann::json entry = {};
352 entry[
"name"] =
"silly";
353 entry[
"start_layer"] = (int)
F_Cu;
354 entry[
"end_layer"] = (int)
In1_Cu;
355 entry[
"staggered"] =
true;
356 entry[
"pitch"] = 100000.0;
358 nlohmann::json js = nlohmann::json::array();
359 js.push_back( entry );
361 bds.
Set(
"via_stack_presets", js );
constexpr EDA_IU_SCALE pcbIUScale
#define MAX_MICROVIA_STACK_PITCH_MM
Container for design settings for a BOARD object.
void UseCustomTrackViaSize(bool aEnabled)
Enables/disables custom track/via size settings.
int GetNextDiffPairIndex(int aIndex, bool aForward) const
Compute the next diff pair dimensions list index when cycling predefined sizes, skipping the index-0 ...
void SetViaSizeIndex(int aIndex)
Set the current via size list index to aIndex.
std::shared_ptr< DRC_ENGINE > m_DRCEngine
int GetTrackWidthIndex() const
int GetViaSizeIndex() const
int GetDiffPairIndex() const
std::vector< DIFF_PAIR_DIMENSION > m_DiffPairDimensionsList
void SetDiffPairIndex(int aIndex)
int GetNextTrackWidthIndex(int aIndex, bool aForward) const
Compute the next track width list index when cycling predefined sizes, skipping the index-0 netclass ...
int GetBiggestClearanceValue() const
int GetCurrentTrackWidth() const
bool LoadFromFile(const wxString &aDirectory="") override
Loads the backing file from disk and then calls Load()
void SetTrackWidthIndex(int aIndex)
Set the current track width list index to aIndex.
int GetNextViaSizeIndex(int aIndex, bool aForward) const
Compute the next via size list index when cycling predefined sizes, skipping the index-0 netclass pla...
std::vector< int > m_TrackWidthList
std::vector< VIA_STACK_PRESET > m_ViaStackPresets
std::vector< VIA_DIMENSION > m_ViasDimensionsList
MINOPTMAX< int > & Value()
void Set(const std::string &aPath, ValueType aVal)
Stores a value into the JSON document Will throw an exception if ValueType isn't something that the l...
virtual void Load()
Updates the parameters of this object based on the current JSON document contents.
virtual bool Store()
Stores the current parameters into the JSON document represented by this object Note: this doesn't do...
bool SaveToFile(const wxString &aDirectory="", bool aForce=false) override
Calls Store() and then saves the JSON document contents into the parent JSON_SETTINGS.
@ PHYSICAL_HOLE_CLEARANCE_CONSTRAINT
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_AUTO_TEST_CASE(NegativeSilkClearanceRoundTrip)
Regression test for https://gitlab.com/kicad/code/kicad/-/issues/23327.
BOOST_AUTO_TEST_SUITE_END()
BOOST_CHECK_EQUAL(result, "25.4")