Try to make gcc happy.
This commit is contained in:
parent
b95b21dbd1
commit
5433684d3c
|
@ -475,86 +475,6 @@ void DRC_ENGINE::loadImplicitRules()
|
|||
}
|
||||
|
||||
|
||||
static wxString formatConstraint( const DRC_CONSTRAINT& constraint )
|
||||
{
|
||||
struct FORMATTER
|
||||
{
|
||||
DRC_CONSTRAINT_T type;
|
||||
wxString name;
|
||||
std::function<wxString(const DRC_CONSTRAINT&)> formatter;
|
||||
};
|
||||
|
||||
auto formatMinMax =
|
||||
[]( const DRC_CONSTRAINT& c ) -> wxString
|
||||
{
|
||||
wxString str;
|
||||
const auto value = c.GetValue();
|
||||
|
||||
if ( value.HasMin() )
|
||||
str += wxString::Format( " min: %d", value.Min() );
|
||||
|
||||
if ( value.HasOpt() )
|
||||
str += wxString::Format( " opt: %d", value.Opt() );
|
||||
|
||||
if ( value.HasMax() )
|
||||
str += wxString::Format( " max: %d", value.Max() );
|
||||
|
||||
return str;
|
||||
};
|
||||
|
||||
auto formatMin =
|
||||
[]( const DRC_CONSTRAINT& c ) -> wxString
|
||||
{
|
||||
wxString str;
|
||||
const auto value = c.GetValue();
|
||||
|
||||
if ( value.HasMin() )
|
||||
str += wxString::Format( " min: %d", value.Min() );
|
||||
|
||||
return str;
|
||||
};
|
||||
|
||||
std::vector<FORMATTER> formats =
|
||||
{
|
||||
{ CLEARANCE_CONSTRAINT, "clearance", formatMinMax },
|
||||
{ HOLE_CLEARANCE_CONSTRAINT, "hole_clearance", formatMinMax },
|
||||
{ HOLE_TO_HOLE_CONSTRAINT, "hole_to_hole", formatMinMax },
|
||||
{ EDGE_CLEARANCE_CONSTRAINT, "edge_clearance", formatMinMax },
|
||||
{ HOLE_SIZE_CONSTRAINT, "hole_size", formatMinMax },
|
||||
{ COURTYARD_CLEARANCE_CONSTRAINT, "courtyard_clearance", formatMinMax },
|
||||
{ SILK_CLEARANCE_CONSTRAINT, "silk_clearance", formatMinMax },
|
||||
{ TEXT_HEIGHT_CONSTRAINT, "text_height", formatMinMax },
|
||||
{ TEXT_THICKNESS_CONSTRAINT, "text_thickness", formatMinMax },
|
||||
{ TRACK_WIDTH_CONSTRAINT, "track_width", formatMinMax },
|
||||
{ ANNULAR_WIDTH_CONSTRAINT, "annular_width", formatMinMax },
|
||||
{ ZONE_CONNECTION_CONSTRAINT, "zone_connection", nullptr },
|
||||
{ THERMAL_RELIEF_GAP_CONSTRAINT, "thermal_relief_gap", formatMinMax },
|
||||
{ THERMAL_SPOKE_WIDTH_CONSTRAINT, "thermal_spoke_width", formatMinMax },
|
||||
{ MIN_RESOLVED_SPOKES_CONSTRAINT, "min_resolved_spokes", formatMin },
|
||||
{ DISALLOW_CONSTRAINT, "disallow", nullptr },
|
||||
{ VIA_DIAMETER_CONSTRAINT, "via_diameter", formatMinMax },
|
||||
{ LENGTH_CONSTRAINT, "length", formatMinMax },
|
||||
{ SKEW_CONSTRAINT, "skew", formatMinMax },
|
||||
{ VIA_COUNT_CONSTRAINT, "via_count", formatMinMax }
|
||||
};
|
||||
|
||||
for( FORMATTER& fmt : formats )
|
||||
{
|
||||
if( fmt.type == constraint.m_Type )
|
||||
{
|
||||
wxString rv = fmt.name + " ";
|
||||
|
||||
if( fmt.formatter )
|
||||
rv += fmt.formatter( constraint );
|
||||
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
|
||||
return "?";
|
||||
}
|
||||
|
||||
|
||||
void DRC_ENGINE::loadRules( const wxFileName& aPath )
|
||||
{
|
||||
if( aPath.FileExists() )
|
||||
|
|
Loading…
Reference in New Issue