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.
This commit is contained in:
Reece R. Pollack 2020-07-04 15:39:58 -04:00 committed by Seth Hillbrand
parent 2895d664e6
commit b483fd32a6
1 changed files with 13 additions and 0 deletions

View File

@ -175,6 +175,16 @@ PCBNEW_SETTINGS::PCBNEW_SETTINGS()
&m_Display.m_ZoneDisplayMode, ZONE_DISPLAY_MODE::SHOW_FILLED, &m_Display.m_ZoneDisplayMode, ZONE_DISPLAY_MODE::SHOW_FILLED,
ZONE_DISPLAY_MODE::SHOW_OUTLINED, ZONE_DISPLAY_MODE::SHOW_FILLED ) ); ZONE_DISPLAY_MODE::SHOW_OUTLINED, ZONE_DISPLAY_MODE::SHOW_FILLED ) );
m_params.emplace_back( new PARAM<int>( "pcb_display.origin_mode",
reinterpret_cast<int*>( &m_Display.m_DisplayOrigin ),
PCB_DISPLAY_OPTIONS::PCB_ORIGIN_PAGE ) );
m_params.emplace_back(
new PARAM<bool>( "pcb_display.origin_invert_x_axis", &m_Display.m_DisplayInvertXAxis, false ) );
m_params.emplace_back(
new PARAM<bool>( "pcb_display.origin_invert_y_axis", &m_Display.m_DisplayInvertYAxis, false ) );
m_params.emplace_back( m_params.emplace_back(
new PARAM<double>( "plot.line_width", &m_PlotLineWidth, 0.1, 0.01, 5.0 ) ); new PARAM<double>( "plot.line_width", &m_PlotLineWidth, 0.1, 0.01, 5.0 ) );
@ -497,6 +507,9 @@ bool PCBNEW_SETTINGS::MigrateFromLegacy( wxConfigBase* aCfg )
ret &= fromLegacy<bool>( aCfg, "ModAffC", "pcb_display.footprint_edge_fill" ); ret &= fromLegacy<bool>( aCfg, "ModAffC", "pcb_display.footprint_edge_fill" );
ret &= fromLegacy<bool>( aCfg, "ModAffT", "pcb_display.footprint_text_fill" ); ret &= fromLegacy<bool>( aCfg, "ModAffT", "pcb_display.footprint_text_fill" );
ret &= fromLegacy<int>( aCfg, "ShowNetNamesMode", "pcb_display.net_names_mode" ); ret &= fromLegacy<int>( aCfg, "ShowNetNamesMode", "pcb_display.net_names_mode" );
ret &= fromLegacy<int>( aCfg, "PcbDisplayOrigin", "pcb_display.origin_mode" );
ret &= fromLegacy<bool>( aCfg, "PcbInvertXAxis", "pcb_display.origin_invert_x_axis" );
ret &= fromLegacy<bool>( aCfg, "PcbInvertYAxis", "pcb_display.origin_invert_y_axis" );
ret &= fromLegacy<bool>( aCfg, "PadAffG", "pcb_display.pad_clearance" ); ret &= fromLegacy<bool>( aCfg, "PadAffG", "pcb_display.pad_clearance" );
ret &= fromLegacy<bool>( aCfg, "PadFill", "pcb_display.pad_fill" ); ret &= fromLegacy<bool>( aCfg, "PadFill", "pcb_display.pad_fill" );
ret &= fromLegacy<bool>( aCfg, "PadSNum", "pcb_display.pad_numbers" ); ret &= fromLegacy<bool>( aCfg, "PadSNum", "pcb_display.pad_numbers" );