232 BOOST_CHECK( converter.
ParseFileHeader(
"!PADS-POWERPCB-V9.0-BASIC!" ) );
239 BOOST_CHECK( converter.
ParseFileHeader(
"!PADS-POWERPCB-V9.0-basic!" ) );
249 BOOST_CHECK( converter.
ParseFileHeader(
"!PADS-POWERPCB-V9.5-MILS!" ) );
260 BOOST_CHECK( converter.
ParseFileHeader(
"!PADS-POWERPCB-V9.5-METRIC!" ) );
271 BOOST_CHECK( converter.
ParseFileHeader(
"!PADS-POWERPCB-V9.5-INCHES!" ) );
308 BOOST_CHECK(
result.has_value() );
313 BOOST_CHECK(
result.has_value() );
318 BOOST_CHECK(
result.has_value() );
323 BOOST_CHECK(
result.has_value() );
332 BOOST_CHECK(
result.has_value() );
337 BOOST_CHECK(
result.has_value() );
342 BOOST_CHECK(
result.has_value() );
351 BOOST_CHECK(
result.has_value() );
356 BOOST_CHECK(
result.has_value() );
361 BOOST_CHECK(
result.has_value() );
370 BOOST_CHECK( !
result.has_value() );
374 BOOST_CHECK( !
result.has_value() );
378 BOOST_CHECK( !
result.has_value() );
381 BOOST_CHECK( !
result.has_value() );
Converts PADS file format units to KiCad internal units (nanometers).
static constexpr double MILS_TO_NM
double GetBasicUnitsScale() const
Get the current BASIC units scale.
static constexpr double INCHES_TO_NM
bool IsBasicUnitsMode() const
Check if BASIC units mode is enabled.
size_t GetOverrideDepth() const
Get the current override depth.
void SetBaseUnits(PADS_UNIT_TYPE aUnitType)
Set the base units for conversion.
bool PushUnitOverride(const std::string &aUnitCode)
Push a unit override onto the stack.
static constexpr double BASIC_TO_NM
void SetBasicUnitsMode(bool aEnabled)
Enable or disable BASIC units mode.
int64_t ToNanometersSize(double aValue) const
Convert a size value to nanometers.
bool ParseFileHeader(const std::string &aHeader)
Parse a PADS file header string and configure units accordingly.
static std::optional< PADS_UNIT_TYPE > ParseUnitCode(const std::string &aUnitCode)
Parse a PADS unit code and return the corresponding unit type.
PADS_UNIT_TYPE GetUnitType() const
Get the current unit type.
static constexpr double MM_TO_NM
void SetBasicUnitsScale(double aScale)
Set a custom scale for BASIC units.
void PopUnitOverride()
Pop the most recent unit override from the stack.
int64_t ToNanometers(double aValue) const
Convert a coordinate value to nanometers.
bool HasUnitOverride() const
Check if any unit overrides are currently active.
PADS_UNIT_TYPE
Unit types supported by PADS file formats.
@ MILS
Thousandths of an inch (1 mil = 0.001 inch)
PADS_UNIT_CONVERTER_FIXTURE()
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_AUTO_TEST_SUITE_END()
std::ostream & operator<<(std::ostream &os, PADS_UNIT_TYPE aType)
BOOST_AUTO_TEST_CASE(DefaultsToMils)
wxString result
Test unit parsing edge cases and error handling.
BOOST_CHECK_EQUAL(result, "25.4")