From b483fd32a6af3e7b9a6359f8faa96f46812ac8f9 Mon Sep 17 00:00:00 2001 From: "Reece R. Pollack" Date: Sat, 4 Jul 2020 15:39:58 -0400 Subject: [PATCH] Support save/restore/upgrade of PCB Display Origin Transforms settings This commit modifies PCBNEW_SETTINGS to add support for saving and restoring the user's display origin transform settings. It also adds support for converting these settings from the 5.x format to the current format, for anyone who used the tech demo of this feature. --- pcbnew/pcbnew_settings.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pcbnew/pcbnew_settings.cpp b/pcbnew/pcbnew_settings.cpp index fc6ce6a0ea..bf0c58373d 100644 --- a/pcbnew/pcbnew_settings.cpp +++ b/pcbnew/pcbnew_settings.cpp @@ -175,6 +175,16 @@ PCBNEW_SETTINGS::PCBNEW_SETTINGS() &m_Display.m_ZoneDisplayMode, ZONE_DISPLAY_MODE::SHOW_FILLED, ZONE_DISPLAY_MODE::SHOW_OUTLINED, ZONE_DISPLAY_MODE::SHOW_FILLED ) ); + m_params.emplace_back( new PARAM( "pcb_display.origin_mode", + reinterpret_cast( &m_Display.m_DisplayOrigin ), + PCB_DISPLAY_OPTIONS::PCB_ORIGIN_PAGE ) ); + + m_params.emplace_back( + new PARAM( "pcb_display.origin_invert_x_axis", &m_Display.m_DisplayInvertXAxis, false ) ); + + m_params.emplace_back( + new PARAM( "pcb_display.origin_invert_y_axis", &m_Display.m_DisplayInvertYAxis, false ) ); + m_params.emplace_back( new PARAM( "plot.line_width", &m_PlotLineWidth, 0.1, 0.01, 5.0 ) ); @@ -497,6 +507,9 @@ bool PCBNEW_SETTINGS::MigrateFromLegacy( wxConfigBase* aCfg ) ret &= fromLegacy( aCfg, "ModAffC", "pcb_display.footprint_edge_fill" ); ret &= fromLegacy( aCfg, "ModAffT", "pcb_display.footprint_text_fill" ); ret &= fromLegacy( aCfg, "ShowNetNamesMode", "pcb_display.net_names_mode" ); + ret &= fromLegacy( aCfg, "PcbDisplayOrigin", "pcb_display.origin_mode" ); + ret &= fromLegacy( aCfg, "PcbInvertXAxis", "pcb_display.origin_invert_x_axis" ); + ret &= fromLegacy( aCfg, "PcbInvertYAxis", "pcb_display.origin_invert_y_axis" ); ret &= fromLegacy( aCfg, "PadAffG", "pcb_display.pad_clearance" ); ret &= fromLegacy( aCfg, "PadFill", "pcb_display.pad_fill" ); ret &= fromLegacy( aCfg, "PadSNum", "pcb_display.pad_numbers" );