Handle boost exceptions. (From Coverity scan.)

This commit is contained in:
Jeff Young 2020-01-11 00:04:01 +00:00
parent 33da81cd27
commit 7bb9551801
9 changed files with 316 additions and 319 deletions

View File

@ -80,13 +80,6 @@ static const wxChar UsePinFunction[] = wxT( "UsePinFunction" );
*/ */
static const wxChar RealtimeConnectivity[] = wxT( "RealtimeConnectivity" ); static const wxChar RealtimeConnectivity[] = wxT( "RealtimeConnectivity" );
/**
* Allow legacy canvas to be shown in GTK3. Legacy canvas is generally pretty
* broken, but this avoids code in an ifdef where it could become broken
* on other platforms
*/
static const wxChar AllowLegacyCanvasInGtk3[] = wxT( "AllowLegacyCanvasInGtk3" );
/** /**
* Configure the coroutine stack size in bytes. This should be allocated in multiples of * Configure the coroutine stack size in bytes. This should be allocated in multiples of
* the system page size (n*4096 is generally safe) * the system page size (n*4096 is generally safe)
@ -172,7 +165,6 @@ ADVANCED_CFG::ADVANCED_CFG()
// then the values will remain as set here. // then the values will remain as set here.
m_EnableUsePadProperty = false; m_EnableUsePadProperty = false;
m_EnableUsePinFunction = false; m_EnableUsePinFunction = false;
m_allowLegacyCanvasInGtk3 = false;
m_realTimeConnectivity = true; m_realTimeConnectivity = true;
m_coroutineStackSize = AC_STACK::default_stack; m_coroutineStackSize = AC_STACK::default_stack;
@ -208,21 +200,25 @@ void ADVANCED_CFG::loadSettings( wxConfigBase& aCfg )
{ {
PARAM_CFG_ARRAY configParams; PARAM_CFG_ARRAY configParams;
configParams.push_back( try
new PARAM_CFG_BOOL( true, AC_KEYS::UsePadProperty, &m_EnableUsePadProperty, false ) ); {
configParams.push_back(
new PARAM_CFG_BOOL( true, AC_KEYS::UsePadProperty, &m_EnableUsePadProperty, false ) );
configParams.push_back( configParams.push_back(
new PARAM_CFG_BOOL( true, AC_KEYS::UsePinFunction, &m_EnableUsePinFunction, false ) ); new PARAM_CFG_BOOL( true, AC_KEYS::UsePinFunction, &m_EnableUsePinFunction, false ) );
configParams.push_back( new PARAM_CFG_BOOL( configParams.push_back(
true, AC_KEYS::AllowLegacyCanvasInGtk3, &m_allowLegacyCanvasInGtk3, false ) ); new PARAM_CFG_BOOL( true, AC_KEYS::RealtimeConnectivity, &m_realTimeConnectivity, false ) );
configParams.push_back( configParams.push_back(
new PARAM_CFG_BOOL( true, AC_KEYS::RealtimeConnectivity, &m_realTimeConnectivity, false ) ); new PARAM_CFG_INT( true, AC_KEYS::CoroutineStackSize, &m_coroutineStackSize,
AC_STACK::default_stack, AC_STACK::min_stack, AC_STACK::max_stack ) );
configParams.push_back( }
new PARAM_CFG_INT( true, AC_KEYS::CoroutineStackSize, &m_coroutineStackSize, catch( boost::bad_pointer& )
AC_STACK::default_stack, AC_STACK::min_stack, AC_STACK::max_stack ) ); {
// Out of memory? Ship's going down anyway....
}
wxConfigLoadSetups( &aCfg, configParams ); wxConfigLoadSetups( &aCfg, configParams );
@ -230,15 +226,3 @@ void ADVANCED_CFG::loadSettings( wxConfigBase& aCfg )
} }
bool ADVANCED_CFG::AllowLegacyCanvas() const
{
// default is to allow
bool allow = true;
// on GTK3, check the config
#ifdef __WXGTK3__
allow = m_allowLegacyCanvasInGtk3;
#endif
return allow;
}

View File

@ -430,11 +430,18 @@ void PART_LIBS::LibNamesAndPaths( PROJECT* aProject, bool doSave,
PARAM_CFG_ARRAY ca; PARAM_CFG_ARRAY ca;
if( aPaths ) try
ca.push_back( new PARAM_CFG_FILENAME( "LibDir", aPaths ) ); {
if( aPaths )
ca.push_back( new PARAM_CFG_FILENAME( "LibDir", aPaths ) );
if( aNames ) if( aNames )
ca.push_back( new PARAM_CFG_LIBNAME_LIST( wxT( "LibName" ), aNames, GROUP_SCH_LIBS ) ); ca.push_back( new PARAM_CFG_LIBNAME_LIST( wxT( "LibName" ), aNames, GROUP_SCH_LIBS ) );
}
catch( boost::bad_pointer& )
{
// Out of memory? Ship's going down anyway....
}
if( doSave ) if( doSave )
{ {

View File

@ -187,45 +187,52 @@ PARAM_CFG_ARRAY& SCH_EDIT_FRAME::GetProjectFileParameters()
if( !m_projectFileParams.empty() ) if( !m_projectFileParams.empty() )
return m_projectFileParams; return m_projectFileParams;
m_projectFileParams.push_back( new PARAM_CFG_FILENAME( wxT( "PageLayoutDescrFile" ), try
&BASE_SCREEN::m_PageLayoutDescrFileName ) ); {
m_projectFileParams.push_back( new PARAM_CFG_FILENAME( wxT( "PageLayoutDescrFile" ),
&BASE_SCREEN::m_PageLayoutDescrFileName ) );
m_projectFileParams.push_back( new PARAM_CFG_FILENAME( wxT( "PlotDirectoryName" ), m_projectFileParams.push_back( new PARAM_CFG_FILENAME( wxT( "PlotDirectoryName" ),
&m_plotDirectoryName ) ); &m_plotDirectoryName ) );
m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "SubpartIdSeparator" ), m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "SubpartIdSeparator" ),
LIB_PART::SubpartIdSeparatorPtr(), 0, 0, 126 ) ); LIB_PART::SubpartIdSeparatorPtr(), 0, 0, 126 ) );
m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "SubpartFirstId" ), m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "SubpartFirstId" ),
LIB_PART::SubpartFirstIdPtr(), 'A', '1', 'z' ) ); LIB_PART::SubpartFirstIdPtr(), 'A', '1', 'z' ) );
m_projectFileParams.push_back( new PARAM_CFG_WXSTRING( wxT( "NetFmtName" ), m_projectFileParams.push_back( new PARAM_CFG_WXSTRING( wxT( "NetFmtName" ),
&m_netListFormat) ); &m_netListFormat) );
m_projectFileParams.push_back( new PARAM_CFG_BOOL( wxT( "SpiceAjustPassiveValues" ), m_projectFileParams.push_back( new PARAM_CFG_BOOL( wxT( "SpiceAjustPassiveValues" ),
&m_spiceAjustPassiveValues, false ) ); &m_spiceAjustPassiveValues, false ) );
m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "LabSize" ), m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "LabSize" ),
&s_defaultTextSize, DEFAULT_SIZE_TEXT, 5, 1000 ) ); &s_defaultTextSize, DEFAULT_SIZE_TEXT, 5, 1000 ) );
m_projectFileParams.push_back( new PARAM_CFG_BOOL( wxT( "ERC_WriteFile" ), m_projectFileParams.push_back( new PARAM_CFG_BOOL( wxT( "ERC_WriteFile" ),
&m_ercSettings.write_erc_file, false ) ); &m_ercSettings.write_erc_file, false ) );
m_projectFileParams.push_back( new PARAM_CFG_BOOL( wxT( "ERC_TestSimilarLabels" ), m_projectFileParams.push_back( new PARAM_CFG_BOOL( wxT( "ERC_TestSimilarLabels" ),
&m_ercSettings.check_similar_labels, true ) ); &m_ercSettings.check_similar_labels, true ) );
m_projectFileParams.push_back( new PARAM_CFG_BOOL( wxT( "ERC_CheckUniqueGlobalLabels" ), m_projectFileParams.push_back( new PARAM_CFG_BOOL( wxT( "ERC_CheckUniqueGlobalLabels" ),
&m_ercSettings.check_unique_global_labels, true ) ); &m_ercSettings.check_unique_global_labels, true ) );
m_projectFileParams.push_back( new PARAM_CFG_BOOL( wxT( "ERC_CheckBusDriverConflicts" ), m_projectFileParams.push_back( new PARAM_CFG_BOOL( wxT( "ERC_CheckBusDriverConflicts" ),
&m_ercSettings.check_bus_driver_conflicts, true ) ); &m_ercSettings.check_bus_driver_conflicts, true ) );
m_projectFileParams.push_back( new PARAM_CFG_BOOL( wxT( "ERC_CheckBusEntryConflicts" ), m_projectFileParams.push_back( new PARAM_CFG_BOOL( wxT( "ERC_CheckBusEntryConflicts" ),
&m_ercSettings.check_bus_entry_conflicts, true ) ); &m_ercSettings.check_bus_entry_conflicts, true ) );
m_projectFileParams.push_back( new PARAM_CFG_BOOL( wxT( "ERC_CheckBusToBusConflicts" ), m_projectFileParams.push_back( new PARAM_CFG_BOOL( wxT( "ERC_CheckBusToBusConflicts" ),
&m_ercSettings.check_bus_to_bus_conflicts, true ) ); &m_ercSettings.check_bus_to_bus_conflicts, true ) );
m_projectFileParams.push_back( new PARAM_CFG_BOOL( wxT( "ERC_CheckBusToNetConflicts" ), m_projectFileParams.push_back( new PARAM_CFG_BOOL( wxT( "ERC_CheckBusToNetConflicts" ),
&m_ercSettings.check_bus_to_net_conflicts, true ) ); &m_ercSettings.check_bus_to_net_conflicts, true ) );
}
catch( boost::bad_pointer& )
{
// Out of memory? Ship's going down anyway....
}
return m_projectFileParams; return m_projectFileParams;
} }
@ -343,24 +350,32 @@ PARAM_CFG_ARRAY& SCH_EDIT_FRAME::GetConfigurationSettings()
if( !m_configSettings.empty() ) if( !m_configSettings.empty() )
return m_configSettings; return m_configSettings;
m_configSettings.push_back( new PARAM_CFG_BOOL( true, ShowPageLimitsEntry, try
&m_showPageLimits, true ) ); {
m_configSettings.push_back( new PARAM_CFG_INT( m_configSettings.push_back( new PARAM_CFG_BOOL( true, ShowPageLimitsEntry,
true, UnitsEntry, (int*) &m_userUnits, (int) EDA_UNITS::MILLIMETRES ) ); &m_showPageLimits, true ) );
m_configSettings.push_back( new PARAM_CFG_INT(
true, UnitsEntry, (int*) &m_userUnits, (int) EDA_UNITS::MILLIMETRES ) );
m_configSettings.push_back( new PARAM_CFG_BOOL( true, PrintMonochromeEntry, m_configSettings.push_back( new PARAM_CFG_BOOL( true, PrintMonochromeEntry,
&m_printMonochrome, true ) ); &m_printMonochrome, true ) );
m_configSettings.push_back( new PARAM_CFG_BOOL( true, PrintSheetRefEntry, m_configSettings.push_back( new PARAM_CFG_BOOL( true, PrintSheetRefEntry,
&m_printSheetReference, true ) ); &m_printSheetReference, true ) );
m_configSettings.push_back( new PARAM_CFG_INT( true, RepeatLabelIncrementEntry,
&m_repeatDeltaLabel, DEFAULT_REPEAT_LABEL_INC,
-10, +10 ) );
m_configSettings.push_back( new PARAM_CFG_BOOL( true, ShowIllegalSymboLibDialog,
&m_showIllegalSymbolLibDialog, true ) );
m_configSettings.push_back( new PARAM_CFG_BOOL( true, showSheetFileNameCaseSensitivityDlg,
&m_showSheetFileNameCaseSensitivityDlg,
true ) );
}
catch( boost::bad_pointer& )
{
// Out of memory? Ship's going down anyway....
}
m_configSettings.push_back( new PARAM_CFG_INT( true, RepeatLabelIncrementEntry,
&m_repeatDeltaLabel, DEFAULT_REPEAT_LABEL_INC,
-10, +10 ) );
m_configSettings.push_back( new PARAM_CFG_BOOL( true, ShowIllegalSymboLibDialog,
&m_showIllegalSymbolLibDialog, true ) );
m_configSettings.push_back( new PARAM_CFG_BOOL( true, showSheetFileNameCaseSensitivityDlg,
&m_showSheetFileNameCaseSensitivityDlg,
true ) );
return m_configSettings; return m_configSettings;
} }

View File

@ -554,21 +554,11 @@ void SCH_TEXT::GetMsgPanelInfo( EDA_UNITS aUnits, MSG_PANEL_ITEMS& aList )
switch( GetLabelSpinStyle() ) switch( GetLabelSpinStyle() )
{ {
case LABEL_SPIN_STYLE::LEFT: case LABEL_SPIN_STYLE::LEFT: msg = _( "Horizontal left" ); break;
msg = _( "Horizontal left" ); case LABEL_SPIN_STYLE::UP: msg = _( "Vertical up" ); break;
break; case LABEL_SPIN_STYLE::RIGHT: msg = _( "Horizontal right" ); break;
case LABEL_SPIN_STYLE::UP: case LABEL_SPIN_STYLE::BOTTOM: msg = _( "Vertical down" ); break;
msg = _( "Vertical up" ); default: msg = wxT( "???" ); break;
break;
case LABEL_SPIN_STYLE::RIGHT:
msg = _( "Horizontal right" );
break;
case LABEL_SPIN_STYLE::BOTTOM:
msg = _( "Vertical down" );
break;
default:
msg = wxT( "???" );
break;
} }
aList.push_back( MSG_PANEL_ITEM( _( "Orientation" ), msg, BROWN ) ); aList.push_back( MSG_PANEL_ITEM( _( "Orientation" ), msg, BROWN ) );
@ -589,24 +579,12 @@ void SCH_TEXT::GetMsgPanelInfo( EDA_UNITS aUnits, MSG_PANEL_ITEMS& aList )
{ {
switch( GetShape() ) switch( GetShape() )
{ {
case PINSHEETLABEL_SHAPE::PS_INPUT: case PINSHEETLABEL_SHAPE::PS_INPUT: msg = _( "Input" ); break;
msg = _( "Input" ); case PINSHEETLABEL_SHAPE::PS_OUTPUT: msg = _( "Output" ); break;
break; case PINSHEETLABEL_SHAPE::PS_BIDI: msg = _( "Bidirectional" ); break;
case PINSHEETLABEL_SHAPE::PS_OUTPUT: case PINSHEETLABEL_SHAPE::PS_TRISTATE: msg = _( "Tri-State" ); break;
msg = _( "Output" ); case PINSHEETLABEL_SHAPE::PS_UNSPECIFIED: msg = _( "Passive" ); break;
break; default: msg = wxT( "???" ); break;
case PINSHEETLABEL_SHAPE::PS_BIDI:
msg = _( "Bidirectional" );
break;
case PINSHEETLABEL_SHAPE::PS_TRISTATE:
msg = _( "Tri-State" );
break;
case PINSHEETLABEL_SHAPE::PS_UNSPECIFIED:
msg = _( "Passive" );
break;
default:
msg = wxT( "???" );
break;
} }
aList.push_back( MSG_PANEL_ITEM( _( "Type" ), msg, BLUE ) ); aList.push_back( MSG_PANEL_ITEM( _( "Type" ), msg, BLUE ) );

View File

@ -52,26 +52,33 @@ PARAM_CFG_ARRAY& GERBVIEW_FRAME::GetConfigurationSettings()
if( !m_configSettings.empty() ) if( !m_configSettings.empty() )
return m_configSettings; return m_configSettings;
m_configSettings.push_back( new PARAM_CFG_INT( true, wxT( "DrawModeOption" ), try
&m_displayMode, 2, 0, 2 ) ); {
m_configSettings.push_back( new PARAM_CFG_SETCOLOR( m_configSettings.push_back( new PARAM_CFG_INT( true, wxT( "DrawModeOption" ),
true, wxT( "DCodeColorEx" ), &m_displayMode, 2, 0, 2 ) );
&g_ColorsSettings.m_LayersColors[LAYER_DCODES], WHITE ) ); m_configSettings.push_back( new PARAM_CFG_SETCOLOR(
m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "DCodeColorEx" ),
true, wxT( "NegativeObjectsColorEx" ), &g_ColorsSettings.m_LayersColors[LAYER_DCODES], WHITE ) );
&g_ColorsSettings.m_LayersColors[LAYER_NEGATIVE_OBJECTS], DARKGRAY ) ); m_configSettings.push_back( new PARAM_CFG_SETCOLOR(
m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "NegativeObjectsColorEx" ),
true, wxT( "GridColorEx" ), &g_ColorsSettings.m_LayersColors[LAYER_NEGATIVE_OBJECTS], DARKGRAY ) );
&g_ColorsSettings.m_LayersColors[LAYER_GERBVIEW_GRID], DARKGRAY ) ); m_configSettings.push_back( new PARAM_CFG_SETCOLOR(
m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "GridColorEx" ),
true, wxT( "WorksheetColorEx" ), &g_ColorsSettings.m_LayersColors[LAYER_GERBVIEW_GRID], DARKGRAY ) );
&g_ColorsSettings.m_LayersColors[ LAYER_WORKSHEET], DARKRED ) ); m_configSettings.push_back( new PARAM_CFG_SETCOLOR(
m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "WorksheetColorEx" ),
true, wxT( "BackgroundColorEx" ), &g_ColorsSettings.m_LayersColors[ LAYER_WORKSHEET], DARKRED ) );
&g_ColorsSettings.m_LayersColors[LAYER_PCB_BACKGROUND], BLACK ) ); m_configSettings.push_back( new PARAM_CFG_SETCOLOR(
m_configSettings.push_back( new PARAM_CFG_BOOL( true, wxT( "BackgroundColorEx" ),
true, wxT( "DisplayPolarCoordinates" ), &g_ColorsSettings.m_LayersColors[LAYER_PCB_BACKGROUND], BLACK ) );
&m_PolarCoords, false ) ); m_configSettings.push_back( new PARAM_CFG_BOOL(
true, wxT( "DisplayPolarCoordinates" ),
&m_PolarCoords, false ) );
}
catch( boost::bad_pointer& )
{
// Out of memory? Ship's going down anyway....
}
// Default colors for layers 0 to 31 // Default colors for layers 0 to 31
static const COLOR4D color_default[] = { static const COLOR4D color_default[] = {

View File

@ -88,21 +88,6 @@ public:
*/ */
int m_coroutineStackSize; int m_coroutineStackSize;
/**
* Helper to determine if legacy canvas is allowed (according to platform
* and config)
* @return true if legacy canvas should be shown
*/
bool AllowLegacyCanvas() const;
private:
/*
* These settings are private, as there is extra logic provide by helper
* functions above.
*/
bool m_allowLegacyCanvasInGtk3;
private: private:
ADVANCED_CFG(); ADVANCED_CFG();

View File

@ -531,174 +531,181 @@ BOARD_DESIGN_SETTINGS::BOARD_DESIGN_SETTINGS() :
// values are saved in mm // values are saved in mm
void BOARD_DESIGN_SETTINGS::AppendConfigs( BOARD* aBoard, PARAM_CFG_ARRAY* aResult ) void BOARD_DESIGN_SETTINGS::AppendConfigs( BOARD* aBoard, PARAM_CFG_ARRAY* aResult )
{ {
aResult->push_back( new PARAM_CFG_LAYERS( aBoard ) ); try
{
aResult->push_back( new PARAM_CFG_LAYERS( aBoard ) );
aResult->push_back( new PARAM_CFG_BOOL( wxT( "AllowMicroVias" ), aResult->push_back( new PARAM_CFG_BOOL( wxT( "AllowMicroVias" ),
&m_MicroViasAllowed, false ) ); &m_MicroViasAllowed, false ) );
aResult->push_back( new PARAM_CFG_BOOL( wxT( "AllowBlindVias" ), aResult->push_back( new PARAM_CFG_BOOL( wxT( "AllowBlindVias" ),
&m_BlindBuriedViaAllowed, false ) ); &m_BlindBuriedViaAllowed, false ) );
aResult->push_back( new PARAM_CFG_BOOL( wxT( "RequireCourtyardDefinitions" ), aResult->push_back( new PARAM_CFG_BOOL( wxT( "RequireCourtyardDefinitions" ),
&m_RequireCourtyards, false ) ); &m_RequireCourtyards, false ) );
aResult->push_back( new PARAM_CFG_BOOL( wxT( "ProhibitOverlappingCourtyards" ), aResult->push_back( new PARAM_CFG_BOOL( wxT( "ProhibitOverlappingCourtyards" ),
&m_ProhibitOverlappingCourtyards, true ) ); &m_ProhibitOverlappingCourtyards, true ) );
aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "MinTrackWidth" ), aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "MinTrackWidth" ),
&m_TrackMinWidth, &m_TrackMinWidth,
Millimeter2iu( DEFAULT_TRACKMINWIDTH ), Millimeter2iu( 0.01 ), Millimeter2iu( 25.0 ), Millimeter2iu( DEFAULT_TRACKMINWIDTH ), Millimeter2iu( 0.01 ), Millimeter2iu( 25.0 ),
nullptr, MM_PER_IU ) ); nullptr, MM_PER_IU ) );
aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "MinViaDiameter" ), aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "MinViaDiameter" ),
&m_ViasMinSize, &m_ViasMinSize,
Millimeter2iu( DEFAULT_VIASMINSIZE ), Millimeter2iu( 0.01 ), Millimeter2iu( 25.0 ), Millimeter2iu( DEFAULT_VIASMINSIZE ), Millimeter2iu( 0.01 ), Millimeter2iu( 25.0 ),
nullptr, MM_PER_IU ) ); nullptr, MM_PER_IU ) );
aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "MinViaDrill" ), aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "MinViaDrill" ),
&m_ViasMinDrill, &m_ViasMinDrill,
Millimeter2iu( DEFAULT_VIASMINDRILL ), Millimeter2iu( 0.01 ), Millimeter2iu( 25.0 ), Millimeter2iu( DEFAULT_VIASMINDRILL ), Millimeter2iu( 0.01 ), Millimeter2iu( 25.0 ),
nullptr, MM_PER_IU ) ); nullptr, MM_PER_IU ) );
aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "MinMicroViaDiameter" ), aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "MinMicroViaDiameter" ),
&m_MicroViasMinSize, &m_MicroViasMinSize,
Millimeter2iu( DEFAULT_MICROVIASMINSIZE ), Millimeter2iu( 0.01 ), Millimeter2iu( 10.0 ), Millimeter2iu( DEFAULT_MICROVIASMINSIZE ), Millimeter2iu( 0.01 ), Millimeter2iu( 10.0 ),
nullptr, MM_PER_IU ) ); nullptr, MM_PER_IU ) );
aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "MinMicroViaDrill" ), aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "MinMicroViaDrill" ),
&m_MicroViasMinDrill, &m_MicroViasMinDrill,
Millimeter2iu( DEFAULT_MICROVIASMINDRILL ), Millimeter2iu( 0.01 ), Millimeter2iu( 10.0 ), Millimeter2iu( DEFAULT_MICROVIASMINDRILL ), Millimeter2iu( 0.01 ), Millimeter2iu( 10.0 ),
nullptr, MM_PER_IU ) ); nullptr, MM_PER_IU ) );
aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "MinHoleToHole" ), aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "MinHoleToHole" ),
&m_HoleToHoleMin, &m_HoleToHoleMin,
Millimeter2iu( DEFAULT_HOLETOHOLEMIN ), Millimeter2iu( 0.0 ), Millimeter2iu( 10.0 ), Millimeter2iu( DEFAULT_HOLETOHOLEMIN ), Millimeter2iu( 0.0 ), Millimeter2iu( 10.0 ),
nullptr, MM_PER_IU ) ); nullptr, MM_PER_IU ) );
// Note: a clearance of -0.01 is a flag indicating we should use the legacy (pre-6.0) method // Note: a clearance of -0.01 is a flag indicating we should use the legacy (pre-6.0) method
// based on the edge cut thicknesses. // based on the edge cut thicknesses.
aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "CopperEdgeClearance" ), aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "CopperEdgeClearance" ),
&m_CopperEdgeClearance, &m_CopperEdgeClearance,
Millimeter2iu( LEGACY_COPPEREDGECLEARANCE ), Millimeter2iu( -0.01 ), Millimeter2iu( 25.0 ), Millimeter2iu( LEGACY_COPPEREDGECLEARANCE ), Millimeter2iu( -0.01 ), Millimeter2iu( 25.0 ),
nullptr, MM_PER_IU ) ); nullptr, MM_PER_IU ) );
aResult->push_back( new PARAM_CFG_TRACKWIDTHS( &m_TrackWidthList ) ); aResult->push_back( new PARAM_CFG_TRACKWIDTHS( &m_TrackWidthList ) );
aResult->push_back( new PARAM_CFG_VIADIMENSIONS( &m_ViasDimensionsList ) ); aResult->push_back( new PARAM_CFG_VIADIMENSIONS( &m_ViasDimensionsList ) );
aResult->push_back( new PARAM_CFG_DIFFPAIRDIMENSIONS( &m_DiffPairDimensionsList ) ); aResult->push_back( new PARAM_CFG_DIFFPAIRDIMENSIONS( &m_DiffPairDimensionsList ) );
aResult->push_back( new PARAM_CFG_NETCLASSES( wxT( "Netclasses" ), &m_NetClasses ) ); aResult->push_back( new PARAM_CFG_NETCLASSES( wxT( "Netclasses" ), &m_NetClasses ) );
aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "SilkLineWidth" ), aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "SilkLineWidth" ),
&m_LineThickness[ LAYER_CLASS_SILK ], &m_LineThickness[ LAYER_CLASS_SILK ],
Millimeter2iu( DEFAULT_SILK_LINE_WIDTH ), Millimeter2iu( 0.01 ), Millimeter2iu( 5.0 ), Millimeter2iu( DEFAULT_SILK_LINE_WIDTH ), Millimeter2iu( 0.01 ), Millimeter2iu( 5.0 ),
nullptr, MM_PER_IU, wxT( "ModuleOutlineThickness" ) ) ); nullptr, MM_PER_IU, wxT( "ModuleOutlineThickness" ) ) );
aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "SilkTextSizeV" ), aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "SilkTextSizeV" ),
&m_TextSize[ LAYER_CLASS_SILK ].y, &m_TextSize[ LAYER_CLASS_SILK ].y,
Millimeter2iu( DEFAULT_SILK_TEXT_SIZE ), TEXTS_MIN_SIZE, TEXTS_MAX_SIZE, Millimeter2iu( DEFAULT_SILK_TEXT_SIZE ), TEXTS_MIN_SIZE, TEXTS_MAX_SIZE,
nullptr, MM_PER_IU, wxT( "ModuleTextSizeV" ) ) ); nullptr, MM_PER_IU, wxT( "ModuleTextSizeV" ) ) );
aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "SilkTextSizeH" ), aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "SilkTextSizeH" ),
&m_TextSize[ LAYER_CLASS_SILK ].x, &m_TextSize[ LAYER_CLASS_SILK ].x,
Millimeter2iu( DEFAULT_SILK_TEXT_SIZE ), TEXTS_MIN_SIZE, TEXTS_MAX_SIZE, Millimeter2iu( DEFAULT_SILK_TEXT_SIZE ), TEXTS_MIN_SIZE, TEXTS_MAX_SIZE,
nullptr, MM_PER_IU, wxT( "ModuleTextSizeH" ) ) ); nullptr, MM_PER_IU, wxT( "ModuleTextSizeH" ) ) );
aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "SilkTextSizeThickness" ), aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "SilkTextSizeThickness" ),
&m_TextThickness[ LAYER_CLASS_SILK ], &m_TextThickness[ LAYER_CLASS_SILK ],
Millimeter2iu( DEFAULT_SILK_TEXT_WIDTH ), 1, TEXTS_MAX_WIDTH, Millimeter2iu( DEFAULT_SILK_TEXT_WIDTH ), 1, TEXTS_MAX_WIDTH,
nullptr, MM_PER_IU, wxT( "ModuleTextSizeThickness" ) ) ); nullptr, MM_PER_IU, wxT( "ModuleTextSizeThickness" ) ) );
aResult->push_back( new PARAM_CFG_BOOL( wxT( "SilkTextItalic" ), aResult->push_back( new PARAM_CFG_BOOL( wxT( "SilkTextItalic" ),
&m_TextItalic[ LAYER_CLASS_SILK ], false ) ); &m_TextItalic[ LAYER_CLASS_SILK ], false ) );
aResult->push_back( new PARAM_CFG_BOOL( wxT( "SilkTextUpright" ), aResult->push_back( new PARAM_CFG_BOOL( wxT( "SilkTextUpright" ),
&m_TextUpright[ LAYER_CLASS_SILK ], true ) ); &m_TextUpright[ LAYER_CLASS_SILK ], true ) );
aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "CopperLineWidth" ), aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "CopperLineWidth" ),
&m_LineThickness[ LAYER_CLASS_COPPER ], &m_LineThickness[ LAYER_CLASS_COPPER ],
Millimeter2iu( DEFAULT_SILK_LINE_WIDTH ), Millimeter2iu( 0.01 ), Millimeter2iu( 5.0 ), Millimeter2iu( DEFAULT_SILK_LINE_WIDTH ), Millimeter2iu( 0.01 ), Millimeter2iu( 5.0 ),
nullptr, MM_PER_IU, wxT( "DrawSegmentWidth" ) ) ); nullptr, MM_PER_IU, wxT( "DrawSegmentWidth" ) ) );
aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "CopperTextSizeV" ), aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "CopperTextSizeV" ),
&m_TextSize[ LAYER_CLASS_COPPER ].y, &m_TextSize[ LAYER_CLASS_COPPER ].y,
Millimeter2iu( DEFAULT_COPPER_TEXT_SIZE ), TEXTS_MIN_SIZE, TEXTS_MAX_SIZE, Millimeter2iu( DEFAULT_COPPER_TEXT_SIZE ), TEXTS_MIN_SIZE, TEXTS_MAX_SIZE,
nullptr, MM_PER_IU, wxT( "PcbTextSizeV" ) ) ); nullptr, MM_PER_IU, wxT( "PcbTextSizeV" ) ) );
aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "CopperTextSizeH" ), aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "CopperTextSizeH" ),
&m_TextSize[ LAYER_CLASS_COPPER ].x, &m_TextSize[ LAYER_CLASS_COPPER ].x,
Millimeter2iu( DEFAULT_COPPER_TEXT_SIZE ), TEXTS_MIN_SIZE, TEXTS_MAX_SIZE, Millimeter2iu( DEFAULT_COPPER_TEXT_SIZE ), TEXTS_MIN_SIZE, TEXTS_MAX_SIZE,
nullptr, MM_PER_IU, wxT( "PcbTextSizeH" ) ) ); nullptr, MM_PER_IU, wxT( "PcbTextSizeH" ) ) );
aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "CopperTextThickness" ), aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "CopperTextThickness" ),
&m_TextThickness[ LAYER_CLASS_COPPER ], &m_TextThickness[ LAYER_CLASS_COPPER ],
Millimeter2iu( DEFAULT_COPPER_TEXT_WIDTH ), Millimeter2iu( 0.01 ), Millimeter2iu( 5.0 ), Millimeter2iu( DEFAULT_COPPER_TEXT_WIDTH ), Millimeter2iu( 0.01 ), Millimeter2iu( 5.0 ),
nullptr, MM_PER_IU, wxT( "PcbTextThickness" ) ) ); nullptr, MM_PER_IU, wxT( "PcbTextThickness" ) ) );
aResult->push_back( new PARAM_CFG_BOOL( wxT( "CopperTextItalic" ), aResult->push_back( new PARAM_CFG_BOOL( wxT( "CopperTextItalic" ),
&m_TextItalic[ LAYER_CLASS_COPPER ], false ) ); &m_TextItalic[ LAYER_CLASS_COPPER ], false ) );
aResult->push_back( new PARAM_CFG_BOOL( wxT( "CopperTextUpright" ), aResult->push_back( new PARAM_CFG_BOOL( wxT( "CopperTextUpright" ),
&m_TextUpright[ LAYER_CLASS_COPPER ], true ) ); &m_TextUpright[ LAYER_CLASS_COPPER ], true ) );
aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "EdgeCutLineWidth" ), aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "EdgeCutLineWidth" ),
&m_LineThickness[ LAYER_CLASS_EDGES ], &m_LineThickness[ LAYER_CLASS_EDGES ],
Millimeter2iu( DEFAULT_SILK_LINE_WIDTH ), Millimeter2iu( 0.01 ), Millimeter2iu( 5.0 ), Millimeter2iu( DEFAULT_SILK_LINE_WIDTH ), Millimeter2iu( 0.01 ), Millimeter2iu( 5.0 ),
nullptr, MM_PER_IU, wxT( "BoardOutlineThickness" ) ) ); nullptr, MM_PER_IU, wxT( "BoardOutlineThickness" ) ) );
aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "CourtyardLineWidth" ), aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "CourtyardLineWidth" ),
&m_LineThickness[ LAYER_CLASS_COURTYARD ], &m_LineThickness[ LAYER_CLASS_COURTYARD ],
Millimeter2iu( DEFAULT_SILK_LINE_WIDTH ), Millimeter2iu( 0.01 ), Millimeter2iu( 5.0 ), Millimeter2iu( DEFAULT_SILK_LINE_WIDTH ), Millimeter2iu( 0.01 ), Millimeter2iu( 5.0 ),
nullptr, MM_PER_IU ) ); nullptr, MM_PER_IU ) );
aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "OthersLineWidth" ), aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "OthersLineWidth" ),
&m_LineThickness[ LAYER_CLASS_OTHERS ], &m_LineThickness[ LAYER_CLASS_OTHERS ],
Millimeter2iu( DEFAULT_SILK_LINE_WIDTH ), Millimeter2iu( 0.01 ), Millimeter2iu( 5.0 ), Millimeter2iu( DEFAULT_SILK_LINE_WIDTH ), Millimeter2iu( 0.01 ), Millimeter2iu( 5.0 ),
nullptr, MM_PER_IU, wxT( "ModuleOutlineThickness" ) ) ); nullptr, MM_PER_IU, wxT( "ModuleOutlineThickness" ) ) );
aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "OthersTextSizeV" ), aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "OthersTextSizeV" ),
&m_TextSize[ LAYER_CLASS_OTHERS ].x, &m_TextSize[ LAYER_CLASS_OTHERS ].x,
Millimeter2iu( DEFAULT_TEXT_SIZE ), TEXTS_MIN_SIZE, TEXTS_MAX_SIZE, Millimeter2iu( DEFAULT_TEXT_SIZE ), TEXTS_MIN_SIZE, TEXTS_MAX_SIZE,
nullptr, MM_PER_IU ) ); nullptr, MM_PER_IU ) );
aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "OthersTextSizeH" ), aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "OthersTextSizeH" ),
&m_TextSize[ LAYER_CLASS_OTHERS ].y, &m_TextSize[ LAYER_CLASS_OTHERS ].y,
Millimeter2iu( DEFAULT_TEXT_SIZE ), TEXTS_MIN_SIZE, TEXTS_MAX_SIZE, Millimeter2iu( DEFAULT_TEXT_SIZE ), TEXTS_MIN_SIZE, TEXTS_MAX_SIZE,
nullptr, MM_PER_IU ) ); nullptr, MM_PER_IU ) );
aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "OthersTextSizeThickness" ), aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "OthersTextSizeThickness" ),
&m_TextThickness[ LAYER_CLASS_OTHERS ], &m_TextThickness[ LAYER_CLASS_OTHERS ],
Millimeter2iu( DEFAULT_TEXT_WIDTH ), 1, TEXTS_MAX_WIDTH, Millimeter2iu( DEFAULT_TEXT_WIDTH ), 1, TEXTS_MAX_WIDTH,
nullptr, MM_PER_IU ) ); nullptr, MM_PER_IU ) );
aResult->push_back( new PARAM_CFG_BOOL( wxT( "OthersTextItalic" ), aResult->push_back( new PARAM_CFG_BOOL( wxT( "OthersTextItalic" ),
&m_TextItalic[ LAYER_CLASS_OTHERS ], false ) ); &m_TextItalic[ LAYER_CLASS_OTHERS ], false ) );
aResult->push_back( new PARAM_CFG_BOOL( wxT( "OthersTextUpright" ), aResult->push_back( new PARAM_CFG_BOOL( wxT( "OthersTextUpright" ),
&m_TextUpright[ LAYER_CLASS_OTHERS ], true ) ); &m_TextUpright[ LAYER_CLASS_OTHERS ], true ) );
aResult->push_back( new PARAM_CFG_INT( wxT( "DimensionUnits" ), aResult->push_back( new PARAM_CFG_INT( wxT( "DimensionUnits" ),
&m_DimensionUnits, 0, 0, 2 ) ); &m_DimensionUnits, 0, 0, 2 ) );
aResult->push_back( new PARAM_CFG_INT( wxT( "DimensionPrecision" ), aResult->push_back( new PARAM_CFG_INT( wxT( "DimensionPrecision" ),
&m_DimensionPrecision, 1, 0, 2 ) ); &m_DimensionPrecision, 1, 0, 2 ) );
aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "SolderMaskClearance" ), aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "SolderMaskClearance" ),
&m_SolderMaskMargin, &m_SolderMaskMargin,
Millimeter2iu( DEFAULT_SOLDERMASK_CLEARANCE ), Millimeter2iu( -1.0 ), Millimeter2iu( 1.0 ), Millimeter2iu( DEFAULT_SOLDERMASK_CLEARANCE ), Millimeter2iu( -1.0 ), Millimeter2iu( 1.0 ),
nullptr, MM_PER_IU ) ); nullptr, MM_PER_IU ) );
aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "SolderMaskMinWidth" ), aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "SolderMaskMinWidth" ),
&m_SolderMaskMinWidth, &m_SolderMaskMinWidth,
Millimeter2iu( DEFAULT_SOLDERMASK_MIN_WIDTH ), 0, Millimeter2iu( 1.0 ), Millimeter2iu( DEFAULT_SOLDERMASK_MIN_WIDTH ), 0, Millimeter2iu( 1.0 ),
nullptr, MM_PER_IU ) ); nullptr, MM_PER_IU ) );
aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "SolderPasteClearance" ), aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "SolderPasteClearance" ),
&m_SolderPasteMargin, &m_SolderPasteMargin,
Millimeter2iu( DEFAULT_SOLDERPASTE_CLEARANCE ), Millimeter2iu( -1.0 ), Millimeter2iu( 1.0 ), Millimeter2iu( DEFAULT_SOLDERPASTE_CLEARANCE ), Millimeter2iu( -1.0 ), Millimeter2iu( 1.0 ),
nullptr, MM_PER_IU ) ); nullptr, MM_PER_IU ) );
aResult->push_back( new PARAM_CFG_DOUBLE( wxT( "SolderPasteRatio" ), aResult->push_back( new PARAM_CFG_DOUBLE( wxT( "SolderPasteRatio" ),
&m_SolderPasteMarginRatio, &m_SolderPasteMarginRatio,
DEFAULT_SOLDERPASTE_RATIO, -0.5, 1.0 ) ); DEFAULT_SOLDERPASTE_RATIO, -0.5, 1.0 ) );
}
catch( boost::bad_pointer& )
{
// Out of memory? Ship's going down anyway....
}
} }

View File

@ -540,29 +540,36 @@ void D_PAD::AppendConfigs( PARAM_CFG_ARRAY* aResult )
// Parameters stored in config are only significant parameters // Parameters stored in config are only significant parameters
// for a template. // for a template.
// So not all parameters are stored, just few. // So not all parameters are stored, just few.
aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "PadDrill" ), try
&m_Drill.x, {
Millimeter2iu( 0.6 ), aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "PadDrill" ),
Millimeter2iu( 0.1 ), Millimeter2iu( 10.0 ), &m_Drill.x,
NULL, MM_PER_IU ) ); Millimeter2iu( 0.6 ),
Millimeter2iu( 0.1 ), Millimeter2iu( 10.0 ),
NULL, MM_PER_IU ) );
aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "PadDrillOvalY" ), aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "PadDrillOvalY" ),
&m_Drill.y, &m_Drill.y,
Millimeter2iu( 0.6 ), Millimeter2iu( 0.6 ),
Millimeter2iu( 0.1 ), Millimeter2iu( 10.0 ), Millimeter2iu( 0.1 ), Millimeter2iu( 10.0 ),
NULL, MM_PER_IU ) ); NULL, MM_PER_IU ) );
aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "PadSizeH" ), aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "PadSizeH" ),
&m_Size.x, &m_Size.x,
Millimeter2iu( 1.4 ), Millimeter2iu( 1.4 ),
Millimeter2iu( 0.1 ), Millimeter2iu( 20.0 ), Millimeter2iu( 0.1 ), Millimeter2iu( 20.0 ),
NULL, MM_PER_IU ) ); NULL, MM_PER_IU ) );
aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "PadSizeV" ), aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "PadSizeV" ),
&m_Size.y, &m_Size.y,
Millimeter2iu( 1.4 ), Millimeter2iu( 1.4 ),
Millimeter2iu( 0.1 ), Millimeter2iu( 20.0 ), Millimeter2iu( 0.1 ), Millimeter2iu( 20.0 ),
NULL, MM_PER_IU ) ); NULL, MM_PER_IU ) );
}
catch( boost::bad_pointer& )
{
// Out of memory? Ship's going down anyway....
}
} }

View File

@ -34,30 +34,37 @@ PCB_GENERAL_SETTINGS::PCB_GENERAL_SETTINGS( FRAME_T aFrameType ) :
m_frameType( aFrameType ), m_frameType( aFrameType ),
m_colorsSettings( aFrameType ) m_colorsSettings( aFrameType )
{ {
switch( m_frameType ) try
{ {
case FRAME_PCB_EDITOR: switch( m_frameType )
Add( "Use45DegreeGraphicSegments", &m_Use45DegreeGraphicSegments, false); {
Add( "MagneticPads", reinterpret_cast<int*>( &m_MagneticPads ), CAPTURE_CURSOR_IN_TRACK_TOOL ); case FRAME_PCB_EDITOR:
Add( "MagneticTracks", reinterpret_cast<int*>( &m_MagneticTracks ), CAPTURE_CURSOR_IN_TRACK_TOOL ); Add( "Use45DegreeGraphicSegments", &m_Use45DegreeGraphicSegments, false);
Add( "MagneticGraphics", &m_MagneticGraphics, true ); Add( "MagneticPads", reinterpret_cast<int*>( &m_MagneticPads ), CAPTURE_CURSOR_IN_TRACK_TOOL );
Add( "FlipLeftRight", &m_FlipLeftRight, false ); Add( "MagneticTracks", reinterpret_cast<int*>( &m_MagneticTracks ), CAPTURE_CURSOR_IN_TRACK_TOOL );
break; Add( "MagneticGraphics", &m_MagneticGraphics, true );
Add( "FlipLeftRight", &m_FlipLeftRight, false );
break;
case FRAME_FOOTPRINT_EDITOR: case FRAME_FOOTPRINT_EDITOR:
m_params.push_back( new PARAM_CFG_BOOL( "FpEditorUse45DegreeGraphicSegments", m_params.push_back( new PARAM_CFG_BOOL( "FpEditorUse45DegreeGraphicSegments",
&m_Use45DegreeGraphicSegments, false, &m_Use45DegreeGraphicSegments, false,
nullptr, "Use45DegreeGraphicSegments" ) ); // legacy location nullptr, "Use45DegreeGraphicSegments" ) ); // legacy location
m_params.push_back( new PARAM_CFG_INT( "FpEditorMagneticPads", m_params.push_back( new PARAM_CFG_INT( "FpEditorMagneticPads",
reinterpret_cast<int*>( &m_MagneticPads ), reinterpret_cast<int*>( &m_MagneticPads ),
CAPTURE_CURSOR_IN_TRACK_TOOL, // default CAPTURE_CURSOR_IN_TRACK_TOOL, // default
NO_EFFECT, // min NO_EFFECT, // min
CAPTURE_ALWAYS, // max CAPTURE_ALWAYS, // max
nullptr, "MagneticPads" ) ); // legacy location nullptr, "MagneticPads" ) ); // legacy location
break; break;
default: default:
break; break;
}
}
catch( boost::bad_pointer& )
{
// Out of memory? Ship's going down anyway....
} }
} }