wxT() and some cleanup in DRC.

This commit is contained in:
Jeff Young 2022-03-11 21:16:52 +00:00
parent eec528ae48
commit 6f555b6258
22 changed files with 124 additions and 124 deletions

View File

@ -1,7 +1,7 @@
/* /*
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2020-2021 KiCad Developers, see AUTHORS.txt for contributors. * Copyright (C) 2020-2022 KiCad Developers, see AUTHORS.txt for contributors.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -67,7 +67,7 @@ void DRC_TEST_PROVIDER::Init()
} }
const wxString DRC_TEST_PROVIDER::GetName() const { return "<no name test>"; } const wxString DRC_TEST_PROVIDER::GetName() const { return wxT( "<no name test>" ); }
const wxString DRC_TEST_PROVIDER::GetDescription() const { return ""; } const wxString DRC_TEST_PROVIDER::GetDescription() const { return ""; }
@ -140,13 +140,13 @@ void DRC_TEST_PROVIDER::reportRuleStatistics()
if( !m_isRuleDriven ) if( !m_isRuleDriven )
return; return;
m_drcEngine->ReportAux( "Rule hit statistics: " ); m_drcEngine->ReportAux( wxT( "Rule hit statistics: " ) );
for( const std::pair<const DRC_RULE* const, int>& stat : m_stats ) for( const std::pair<const DRC_RULE* const, int>& stat : m_stats )
{ {
if( stat.first ) if( stat.first )
{ {
m_drcEngine->ReportAux( wxString::Format( " - rule '%s': %d hits ", m_drcEngine->ReportAux( wxString::Format( wxT( " - rule '%s': %d hits " ),
stat.first->m_Name, stat.first->m_Name,
stat.second ) ); stat.second ) );
} }

View File

@ -1,7 +1,7 @@
/* /*
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2004-2020 KiCad Developers. * Copyright (C) 2004-2022 KiCad Developers.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -54,12 +54,12 @@ public:
virtual const wxString GetName() const override virtual const wxString GetName() const override
{ {
return "annular_width"; return wxT( "annular_width" );
}; };
virtual const wxString GetDescription() const override virtual const wxString GetDescription() const override
{ {
return "Tests pad/via annular rings"; return wxT( "Tests pad/via annular rings" );
} }
}; };
@ -68,7 +68,7 @@ bool DRC_TEST_PROVIDER_ANNULAR_WIDTH::Run()
{ {
if( m_drcEngine->IsErrorLimitExceeded( DRCE_ANNULAR_WIDTH ) ) if( m_drcEngine->IsErrorLimitExceeded( DRCE_ANNULAR_WIDTH ) )
{ {
reportAux( "Annular width violations ignored. Skipping check." ); reportAux( wxT( "Annular width violations ignored. Skipping check." ) );
return true; // continue with other tests return true; // continue with other tests
} }
@ -76,7 +76,7 @@ bool DRC_TEST_PROVIDER_ANNULAR_WIDTH::Run()
if( !m_drcEngine->HasRulesForConstraintType( ANNULAR_WIDTH_CONSTRAINT ) ) if( !m_drcEngine->HasRulesForConstraintType( ANNULAR_WIDTH_CONSTRAINT ) )
{ {
reportAux( "No annular width constraints found. Tests not run." ); reportAux( wxT( "No annular width constraints found. Tests not run." ) );
return true; // continue with other tests return true; // continue with other tests
} }

View File

@ -1,7 +1,7 @@
/* /*
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2004-2020 KiCad Developers. * Copyright (C) 2004-2022 KiCad Developers.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -56,12 +56,12 @@ public:
virtual const wxString GetName() const override virtual const wxString GetName() const override
{ {
return "connectivity"; return wxT( "connectivity" );
}; };
virtual const wxString GetDescription() const override virtual const wxString GetDescription() const override
{ {
return "Tests board connectivity"; return wxT( "Tests board connectivity" );
} }
}; };

View File

@ -1,7 +1,7 @@
/* /*
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2004-2021 KiCad Developers. * Copyright (C) 2004-2022 KiCad Developers.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -70,12 +70,12 @@ public:
virtual const wxString GetName() const override virtual const wxString GetName() const override
{ {
return "clearance"; return wxT( "clearance" );
}; };
virtual const wxString GetDescription() const override virtual const wxString GetDescription() const override
{ {
return "Tests copper item clearance"; return wxT( "Tests copper item clearance" );
} }
private: private:
@ -113,7 +113,7 @@ bool DRC_TEST_PROVIDER_COPPER_CLEARANCE::Run()
if( m_largestClearance <= 0 ) if( m_largestClearance <= 0 )
{ {
reportAux( "No Clearance constraints found. Tests not run." ); reportAux( wxT( "No Clearance constraints found. Tests not run." ) );
return true; // continue with other tests return true; // continue with other tests
} }
@ -145,7 +145,7 @@ bool DRC_TEST_PROVIDER_COPPER_CLEARANCE::Run()
} }
} }
reportAux( "Worst clearance : %d nm", m_largestClearance ); reportAux( wxT( "Worst clearance : %d nm" ), m_largestClearance );
// This is the number of tests between 2 calls to the progress bar // This is the number of tests between 2 calls to the progress bar
size_t delta = 50; size_t delta = 50;
@ -201,7 +201,7 @@ bool DRC_TEST_PROVIDER_COPPER_CLEARANCE::Run()
forEachGeometryItem( itemTypes, LSET::AllCuMask(), countItems ); forEachGeometryItem( itemTypes, LSET::AllCuMask(), countItems );
forEachGeometryItem( itemTypes, LSET::AllCuMask(), addToCopperTree ); forEachGeometryItem( itemTypes, LSET::AllCuMask(), addToCopperTree );
reportAux( "Testing %d copper items and %d zones...", count, m_copperZones.size() ); reportAux( wxT( "Testing %d copper items and %d zones..." ), count, m_copperZones.size() );
if( !m_drcEngine->IsErrorLimitExceeded( DRCE_CLEARANCE ) ) if( !m_drcEngine->IsErrorLimitExceeded( DRCE_CLEARANCE ) )
{ {
@ -509,7 +509,7 @@ void DRC_TEST_PROVIDER_COPPER_CLEARANCE::testTrackClearances()
const int delta = 100; const int delta = 100;
int ii = 0; int ii = 0;
reportAux( "Testing %d tracks & vias...", m_board->Tracks().size() ); reportAux( wxT( "Testing %d tracks & vias..." ), m_board->Tracks().size() );
std::map< std::pair<BOARD_ITEM*, BOARD_ITEM*>, int> checkedPairs; std::map< std::pair<BOARD_ITEM*, BOARD_ITEM*>, int> checkedPairs;
@ -785,7 +785,7 @@ void DRC_TEST_PROVIDER_COPPER_CLEARANCE::testPadClearances( )
for( FOOTPRINT* footprint : m_board->Footprints() ) for( FOOTPRINT* footprint : m_board->Footprints() )
count += footprint->Pads().size(); count += footprint->Pads().size();
reportAux( "Testing %d pads...", count ); reportAux( wxT( "Testing %d pads..." ), count );
int ii = 0; int ii = 0;
std::map< std::pair<BOARD_ITEM*, BOARD_ITEM*>, int> checkedPairs; std::map< std::pair<BOARD_ITEM*, BOARD_ITEM*>, int> checkedPairs;

View File

@ -1,7 +1,7 @@
/* /*
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2004-2020 KiCad Developers. * Copyright (C) 2004-2022 KiCad Developers.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -56,12 +56,12 @@ public:
virtual const wxString GetName() const override virtual const wxString GetName() const override
{ {
return "courtyard_clearance"; return wxT( "courtyard_clearance" );
} }
virtual const wxString GetDescription() const override virtual const wxString GetDescription() const override
{ {
return "Tests footprints' courtyard clearance"; return wxT( "Tests footprints' courtyard clearance" );
} }
private: private:
@ -89,7 +89,7 @@ bool DRC_TEST_PROVIDER_COURTYARD_CLEARANCE::testFootprintCourtyardDefinitions()
} }
else else
{ {
reportAux( "All courtyard violations ignored. Tests not run." ); reportAux( wxT( "All courtyard violations ignored. Tests not run." ) );
return true; // continue with other tests return true; // continue with other tests
} }
@ -315,7 +315,7 @@ bool DRC_TEST_PROVIDER_COURTYARD_CLEARANCE::Run()
if( m_drcEngine->QueryWorstConstraint( COURTYARD_CLEARANCE_CONSTRAINT, constraint ) ) if( m_drcEngine->QueryWorstConstraint( COURTYARD_CLEARANCE_CONSTRAINT, constraint ) )
m_largestClearance = constraint.GetValue().Min(); m_largestClearance = constraint.GetValue().Min();
reportAux( "Worst courtyard clearance : %d nm", m_largestClearance ); reportAux( wxT( "Worst courtyard clearance : %d nm" ), m_largestClearance );
if( !testFootprintCourtyardDefinitions() ) if( !testFootprintCourtyardDefinitions() )
return false; return false;

View File

@ -1,7 +1,7 @@
/* /*
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2004-2020 KiCad Developers. * Copyright (C) 2004-2022 KiCad Developers.
* *
* This program is free software: you can redistribute it and/or modify it * This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the * under the terms of the GNU General Public License as published by the
@ -66,12 +66,12 @@ public:
virtual const wxString GetName() const override virtual const wxString GetName() const override
{ {
return "diff_pair_coupling"; return wxT( "diff_pair_coupling" );
}; };
virtual const wxString GetDescription() const override virtual const wxString GetDescription() const override
{ {
return "Tests differential pair coupling"; return wxT( "Tests differential pair coupling" );
} }
private: private:
@ -282,7 +282,7 @@ bool test::DRC_TEST_PROVIDER_DIFF_PAIR_COUPLING::Run()
if( refNet && DRC_ENGINE::IsNetADiffPair( m_board, refNet, key.netP, key.netN ) ) if( refNet && DRC_ENGINE::IsNetADiffPair( m_board, refNet, key.netP, key.netN ) )
{ {
drc_dbg( 10, "eval dp %p\n", item ); drc_dbg( 10, wxT( "eval dp %p\n" ), item );
const DRC_CONSTRAINT_T constraintsToCheck[] = { const DRC_CONSTRAINT_T constraintsToCheck[] = {
DIFF_PAIR_GAP_CONSTRAINT, DIFF_PAIR_GAP_CONSTRAINT,
@ -297,7 +297,7 @@ bool test::DRC_TEST_PROVIDER_DIFF_PAIR_COUPLING::Run()
if( constraint.IsNull() || constraint.GetSeverity() == RPT_SEVERITY_IGNORE ) if( constraint.IsNull() || constraint.GetSeverity() == RPT_SEVERITY_IGNORE )
continue; continue;
drc_dbg( 10, "cns %d item %p\n", constraintsToCheck[i], item ); drc_dbg( 10, wxT( "cns %d item %p\n" ), constraintsToCheck[i], item );
key.parentRule = constraint.GetParentRule(); key.parentRule = constraint.GetParentRule();
@ -316,7 +316,7 @@ bool test::DRC_TEST_PROVIDER_DIFF_PAIR_COUPLING::Run()
forEachGeometryItem( { PCB_TRACE_T, PCB_VIA_T, PCB_ARC_T }, LSET::AllCuMask(), forEachGeometryItem( { PCB_TRACE_T, PCB_VIA_T, PCB_ARC_T }, LSET::AllCuMask(),
evaluateDpConstraints ); evaluateDpConstraints );
drc_dbg( 10, "dp rule matches %d\n", (int) dpRuleMatches.size() ); drc_dbg( 10, wxT( "dp rule matches %d\n" ), (int) dpRuleMatches.size() );
DRC_RTREE copperTree; DRC_RTREE copperTree;
@ -350,8 +350,10 @@ bool test::DRC_TEST_PROVIDER_DIFF_PAIR_COUPLING::Run()
wxString nameP = niP->GetNetname(); wxString nameP = niP->GetNetname();
wxString nameN = niN->GetNetname(); wxString nameN = niN->GetNetname();
reportAux( wxString::Format( "Rule '%s', DP: (+) %s - (-) %s", reportAux( wxString::Format( wxT( "Rule '%s', DP: (+) %s - (-) %s" ),
it.first.parentRule->m_Name, nameP, nameN ) ); it.first.parentRule->m_Name,
nameP,
nameN ) );
extractDiffPairCoupledItems( it.second, copperTree ); extractDiffPairCoupledItems( it.second, copperTree );
@ -359,7 +361,7 @@ bool test::DRC_TEST_PROVIDER_DIFF_PAIR_COUPLING::Run()
it.second.totalLengthN = 0; it.second.totalLengthN = 0;
it.second.totalLengthP = 0; it.second.totalLengthP = 0;
drc_dbg(10, " coupled prims : %d\n", (int) it.second.coupled.size() ); drc_dbg(10, wxT( " coupled prims : %d\n" ), (int) it.second.coupled.size() );
OPT<DRC_CONSTRAINT> gapConstraint = OPT<DRC_CONSTRAINT> gapConstraint =
it.first.parentRule->FindConstraint( DIFF_PAIR_GAP_CONSTRAINT ); it.first.parentRule->FindConstraint( DIFF_PAIR_GAP_CONSTRAINT );
@ -403,7 +405,9 @@ bool test::DRC_TEST_PROVIDER_DIFF_PAIR_COUPLING::Run()
overlay->Line( cpair.coupledN ); overlay->Line( cpair.coupledN );
} }
drc_dbg( 10, " len %d gap %d l %d\n", length, gap, drc_dbg( 10, wxT( " len %d gap %d l %d\n" ),
length,
gap,
cpair.parentP->GetLayer() ); cpair.parentP->GetLayer() );
if( gapConstraint ) if( gapConstraint )
@ -429,8 +433,7 @@ bool test::DRC_TEST_PROVIDER_DIFF_PAIR_COUPLING::Run()
} }
int totalLen = std::max( it.second.totalLengthN, it.second.totalLengthP ); int totalLen = std::max( it.second.totalLengthN, it.second.totalLengthP );
reportAux( wxString::Format( " - coupled length: %s, total length: %s", reportAux( wxString::Format( wxT( " - coupled length: %s, total length: %s" ),
MessageTextFromValue( userUnits(), it.second.totalCoupled ), MessageTextFromValue( userUnits(), it.second.totalCoupled ),
MessageTextFromValue( userUnits(), totalLen ) ) ); MessageTextFromValue( userUnits(), totalLen ) ) );
@ -477,8 +480,8 @@ bool test::DRC_TEST_PROVIDER_DIFF_PAIR_COUPLING::Run()
auto val = gapConstraint->GetValue(); auto val = gapConstraint->GetValue();
auto drcItem = DRC_ITEM::Create( DRCE_DIFF_PAIR_GAP_OUT_OF_RANGE ); auto drcItem = DRC_ITEM::Create( DRCE_DIFF_PAIR_GAP_OUT_OF_RANGE );
m_msg = drcItem->GetErrorText() + " (" + m_msg = drcItem->GetErrorText() + wxT( " (" ) +
gapConstraint->GetParentRule()->m_Name + " "; gapConstraint->GetParentRule()->m_Name + wxS( " " );
if( val.HasMin() ) if( val.HasMin() )
m_msg += wxString::Format( _( "minimum gap: %s; " ), m_msg += wxString::Format( _( "minimum gap: %s; " ),

View File

@ -56,12 +56,12 @@ public:
virtual const wxString GetName() const override virtual const wxString GetName() const override
{ {
return "disallow"; return wxT( "disallow" );
}; };
virtual const wxString GetDescription() const override virtual const wxString GetDescription() const override
{ {
return "Tests for disallowed items (e.g. keepouts)"; return wxT( "Tests for disallowed items (e.g. keepouts)" );
} }
}; };

View File

@ -1,7 +1,7 @@
/* /*
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2004-2021 KiCad Developers. * Copyright (C) 2004-2022 KiCad Developers.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -60,12 +60,12 @@ public:
virtual const wxString GetName() const override virtual const wxString GetName() const override
{ {
return "edge_clearance"; return wxT( "edge_clearance" );
} }
virtual const wxString GetDescription() const override virtual const wxString GetDescription() const override
{ {
return "Tests items vs board edge clearance"; return wxT( "Tests items vs board edge clearance" );
} }
private: private:
@ -129,7 +129,7 @@ bool DRC_TEST_PROVIDER_EDGE_CLEARANCE::Run()
} }
else else
{ {
reportAux( "Edge clearance violations ignored. Tests not run." ); reportAux( wxT( "Edge clearance violations ignored. Tests not run." ) );
return true; // continue with other tests return true; // continue with other tests
} }
@ -140,7 +140,7 @@ bool DRC_TEST_PROVIDER_EDGE_CLEARANCE::Run()
if( m_drcEngine->QueryWorstConstraint( EDGE_CLEARANCE_CONSTRAINT, worstClearanceConstraint ) ) if( m_drcEngine->QueryWorstConstraint( EDGE_CLEARANCE_CONSTRAINT, worstClearanceConstraint ) )
m_largestClearance = worstClearanceConstraint.GetValue().Min(); m_largestClearance = worstClearanceConstraint.GetValue().Min();
reportAux( "Worst clearance : %d nm", m_largestClearance ); reportAux( wxT( "Worst clearance : %d nm" ), m_largestClearance );
std::vector<std::unique_ptr<PCB_SHAPE>> edges; // we own these std::vector<std::unique_ptr<PCB_SHAPE>> edges; // we own these
DRC_RTREE edgesTree; DRC_RTREE edgesTree;
@ -217,8 +217,9 @@ bool DRC_TEST_PROVIDER_EDGE_CLEARANCE::Run()
wxString val; wxString val;
wxGetEnv( "WXTRACE", &val ); wxGetEnv( "WXTRACE", &val );
drc_dbg( 2, "outline: %d items, board: %d items\n", drc_dbg( 2, wxT( "outline: %d items, board: %d items\n" ),
(int) edges.size(), (int) boardItems.size() ); (int) edges.size(),
(int) boardItems.size() );
// This is the number of tests between 2 calls to the progress bar // This is the number of tests between 2 calls to the progress bar
const int delta = 50; const int delta = 50;
@ -274,7 +275,7 @@ bool DRC_TEST_PROVIDER_EDGE_CLEARANCE::Run()
reportRuleStatistics(); reportRuleStatistics();
return true; return !m_drcEngine->IsCancelled();
} }

View File

@ -1,7 +1,7 @@
/* /*
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2004-2020 KiCad Developers. * Copyright (C) 2004-2022 KiCad Developers.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -52,12 +52,12 @@ public:
virtual const wxString GetName() const override virtual const wxString GetName() const override
{ {
return "hole_size"; return wxT( "hole_size" );
}; };
virtual const wxString GetDescription() const override virtual const wxString GetDescription() const override
{ {
return "Tests sizes of drilled holes (via/pad drills)"; return wxT( "Tests sizes of drilled holes (via/pad drills)" );
} }
private: private:
@ -124,7 +124,7 @@ bool DRC_TEST_PROVIDER_HOLE_SIZE::Run()
reportRuleStatistics(); reportRuleStatistics();
return true; return !m_drcEngine->IsCancelled();
} }

View File

@ -1,7 +1,7 @@
/* /*
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2004-2020 KiCad Developers. * Copyright (C) 2004-2022 KiCad Developers.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -58,12 +58,12 @@ public:
virtual const wxString GetName() const override virtual const wxString GetName() const override
{ {
return "hole_to_hole_clearance"; return wxT( "hole_to_hole_clearance" );
}; };
virtual const wxString GetDescription() const override virtual const wxString GetDescription() const override
{ {
return "Tests hole to hole spacing"; return wxT( "Tests hole to hole spacing" );
} }
private: private:
@ -96,7 +96,7 @@ bool DRC_TEST_PROVIDER_HOLE_TO_HOLE::Run()
if( m_drcEngine->IsErrorLimitExceeded( DRCE_DRILLED_HOLES_TOO_CLOSE ) if( m_drcEngine->IsErrorLimitExceeded( DRCE_DRILLED_HOLES_TOO_CLOSE )
&& m_drcEngine->IsErrorLimitExceeded( DRCE_DRILLED_HOLES_COLOCATED ) ) && m_drcEngine->IsErrorLimitExceeded( DRCE_DRILLED_HOLES_COLOCATED ) )
{ {
reportAux( "Hole to hole violations ignored. Tests not run." ); reportAux( wxT( "Hole to hole violations ignored. Tests not run." ) );
return true; // continue with other tests return true; // continue with other tests
} }
@ -107,11 +107,11 @@ bool DRC_TEST_PROVIDER_HOLE_TO_HOLE::Run()
if( m_drcEngine->QueryWorstConstraint( HOLE_TO_HOLE_CONSTRAINT, worstClearanceConstraint ) ) if( m_drcEngine->QueryWorstConstraint( HOLE_TO_HOLE_CONSTRAINT, worstClearanceConstraint ) )
{ {
m_largestClearance = worstClearanceConstraint.GetValue().Min(); m_largestClearance = worstClearanceConstraint.GetValue().Min();
reportAux( "Worst hole to hole : %d nm", m_largestClearance ); reportAux( wxT( "Worst hole to hole : %d nm" ), m_largestClearance );
} }
else else
{ {
reportAux( "No hole to hole constraints found. Skipping check." ); reportAux( wxT( "No hole to hole constraints found. Skipping check." ) );
return true; // continue with other tests return true; // continue with other tests
} }

View File

@ -59,12 +59,12 @@ public:
virtual const wxString GetName() const override virtual const wxString GetName() const override
{ {
return "library_parity"; return wxT( "library_parity" );
}; };
virtual const wxString GetDescription() const override virtual const wxString GetDescription() const override
{ {
return "Performs board footprint vs library integity checks"; return wxT( "Performs board footprint vs library integity checks" );
} }
}; };
@ -505,7 +505,7 @@ bool DRC_TEST_PROVIDER_LIBRARY_PARITY::Run()
if( !m_drcEngine->IsErrorLimitExceeded( DRCE_LIB_FOOTPRINT_ISSUES ) ) if( !m_drcEngine->IsErrorLimitExceeded( DRCE_LIB_FOOTPRINT_ISSUES ) )
{ {
std::shared_ptr<DRC_ITEM> drcItem = DRC_ITEM::Create( DRCE_LIB_FOOTPRINT_ISSUES ); std::shared_ptr<DRC_ITEM> drcItem = DRC_ITEM::Create( DRCE_LIB_FOOTPRINT_ISSUES );
msg.Printf( "Footprint '%s' not found in library '%s'.", msg.Printf( _( "Footprint '%s' not found in library '%s'." ),
fpName, fpName,
libName ); libName );
drcItem->SetErrorMessage( msg ); drcItem->SetErrorMessage( msg );
@ -518,7 +518,7 @@ bool DRC_TEST_PROVIDER_LIBRARY_PARITY::Run()
if( !m_drcEngine->IsErrorLimitExceeded( DRCE_LIB_FOOTPRINT_MISMATCH ) ) if( !m_drcEngine->IsErrorLimitExceeded( DRCE_LIB_FOOTPRINT_MISMATCH ) )
{ {
std::shared_ptr<DRC_ITEM> drcItem = DRC_ITEM::Create( DRCE_LIB_FOOTPRINT_MISMATCH ); std::shared_ptr<DRC_ITEM> drcItem = DRC_ITEM::Create( DRCE_LIB_FOOTPRINT_MISMATCH );
msg.Printf( "Footprint '%s' does not match copy in library '%s'.", msg.Printf( _( "Footprint '%s' does not match copy in library '%s'." ),
fpName, fpName,
libName ); libName );
drcItem->SetErrorMessage( msg ); drcItem->SetErrorMessage( msg );

View File

@ -1,7 +1,7 @@
/* /*
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2004-2020 KiCad Developers. * Copyright (C) 2004-2022 KiCad Developers.
* *
* This program is free software: you can redistribute it and/or modify it * This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the * under the terms of the GNU General Public License as published by the
@ -59,12 +59,12 @@ public:
virtual const wxString GetName() const override virtual const wxString GetName() const override
{ {
return "length"; return wxT( "length" );
}; };
virtual const wxString GetDescription() const override virtual const wxString GetDescription() const override
{ {
return "Tests matched track lengths."; return wxT( "Tests matched track lengths." );
} }
DRC_LENGTH_REPORT BuildLengthReport() const; DRC_LENGTH_REPORT BuildLengthReport() const;
@ -338,15 +338,15 @@ bool DRC_TEST_PROVIDER_MATCHED_LENGTH::runInternal( bool aDelayReportMode )
return a.netname < b.netname; return a.netname < b.netname;
} ); } );
reportAux( wxString::Format( "Length-constrained traces for rule '%s':", reportAux( wxString::Format( wxT( "Length-constrained traces for rule '%s':" ),
it.first->m_Name ) ); it.first->m_Name ) );
for( auto& ent : matchedConnections ) for( auto& ent : matchedConnections )
{ {
reportAux(wxString::Format( " - net: %s, from: %s, to: %s, " reportAux(wxString::Format( wxT( " - net: %s, from: %s, to: %s, "
"%d matching items, " "%d matching items, "
"total: %s (tracks: %s, vias: %s, pad-to-die: %s), " "total: %s (tracks: %s, vias: %s, pad-to-die: %s), "
"vias: %d", "vias: %d" ),
ent.netname, ent.netname,
ent.from, ent.from,
ent.to, ent.to,
@ -378,7 +378,7 @@ bool DRC_TEST_PROVIDER_MATCHED_LENGTH::runInternal( bool aDelayReportMode )
reportRuleStatistics(); reportRuleStatistics();
} }
return true; return !m_drcEngine->IsCancelled();
} }

View File

@ -1,7 +1,7 @@
/* /*
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2021 KiCad Developers. * Copyright (C) 2021-2022 KiCad Developers.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -62,12 +62,12 @@ public:
virtual const wxString GetName() const override virtual const wxString GetName() const override
{ {
return "mechanical_clearance"; return wxT( "mechanical_clearance" );
}; };
virtual const wxString GetDescription() const override virtual const wxString GetDescription() const override
{ {
return "Tests item clearances irrespective of nets"; return wxT( "Tests item clearances irrespective of nets" );
} }
private: private:
@ -106,7 +106,7 @@ bool DRC_TEST_PROVIDER_MECHANICAL_CLEARANCE::Run()
if( m_largestClearance <= 0 ) if( m_largestClearance <= 0 )
{ {
reportAux( "No Clearance constraints found. Tests not run." ); reportAux( wxT( "No Clearance constraints found. Tests not run." ) );
return true; // continue with other tests return true; // continue with other tests
} }
@ -134,7 +134,7 @@ bool DRC_TEST_PROVIDER_MECHANICAL_CLEARANCE::Run()
} }
} }
reportAux( "Worst clearance : %d nm", m_largestClearance ); reportAux( wxT( "Worst clearance : %d nm" ), m_largestClearance );
// This is the number of tests between 2 calls to the progress bar // This is the number of tests between 2 calls to the progress bar
size_t delta = 50; size_t delta = 50;

View File

@ -1,7 +1,7 @@
/* /*
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2004-2021 KiCad Developers. * Copyright (C) 2004-2022 KiCad Developers.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -59,12 +59,12 @@ public:
virtual const wxString GetName() const override virtual const wxString GetName() const override
{ {
return "miscellaneous"; return wxT( "miscellaneous" );
}; };
virtual const wxString GetDescription() const override virtual const wxString GetDescription() const override
{ {
return "Misc checks (board outline, missing textvars)"; return wxT( "Misc checks (board outline, missing textvars)" );
} }
private: private:
@ -304,11 +304,11 @@ void DRC_TEST_PROVIDER_MISC::testTextVars()
return; return;
drawItems.SetMilsToIUfactor( IU_PER_MILS ); drawItems.SetMilsToIUfactor( IU_PER_MILS );
drawItems.SetPageNumber( "1" ); drawItems.SetPageNumber( wxT( "1" ) );
drawItems.SetSheetCount( 1 ); drawItems.SetSheetCount( 1 );
drawItems.SetFileName( "dummyFilename" ); drawItems.SetFileName( wxT( "dummyFilename" ) );
drawItems.SetSheetName( "dummySheet" ); drawItems.SetSheetName( wxT( "dummySheet" ) );
drawItems.SetSheetLayer( "dummyLayer" ); drawItems.SetSheetLayer( wxT( "dummyLayer" ) );
drawItems.SetProject( m_board->GetProject() ); drawItems.SetProject( m_board->GetProject() );
drawItems.BuildDrawItemsList( drawingSheet->GetPageInfo(), drawingSheet->GetTitleBlock() ); drawItems.BuildDrawItemsList( drawingSheet->GetPageInfo(), drawingSheet->GetTitleBlock() );

View File

@ -1,7 +1,7 @@
/* /*
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2004-2021 KiCad Developers. * Copyright (C) 2004-2022 KiCad Developers.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -60,12 +60,12 @@ public:
virtual const wxString GetName() const override virtual const wxString GetName() const override
{ {
return "schematic_parity"; return wxT( "schematic_parity" );
}; };
virtual const wxString GetDescription() const override virtual const wxString GetDescription() const override
{ {
return "Performs layout-vs-schematics integity check"; return wxT( "Performs layout-vs-schematics integity check" );
} }
private: private:
@ -218,7 +218,7 @@ bool DRC_TEST_PROVIDER_SCHEMATIC_PARITY::Run()
if( !netlist ) if( !netlist )
{ {
reportAux( _( "No netlist provided, skipping schematic parity tests." ) ); reportAux( wxT( "No netlist provided, skipping schematic parity tests." ) );
return true; return true;
} }
@ -227,7 +227,7 @@ bool DRC_TEST_PROVIDER_SCHEMATIC_PARITY::Run()
reportRuleStatistics(); reportRuleStatistics();
} }
return true; return !m_drcEngine->IsCancelled();
} }

View File

@ -1,7 +1,7 @@
/* /*
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2004-2020 KiCad Developers. * Copyright (C) 2004-2022 KiCad Developers.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -25,15 +25,11 @@
#include <board.h> #include <board.h>
#include <footprint.h> #include <footprint.h>
#include <pcb_shape.h> #include <pcb_shape.h>
#include <geometry/seg.h> #include <geometry/seg.h>
#include <geometry/shape_segment.h>
#include <drc/drc_engine.h> #include <drc/drc_engine.h>
#include <drc/drc_item.h> #include <drc/drc_item.h>
#include <drc/drc_rule.h> #include <drc/drc_rule.h>
#include <drc/drc_test_provider_clearance_base.h> #include <drc/drc_test_provider_clearance_base.h>
#include <drc/drc_rtree.h> #include <drc/drc_rtree.h>
/* /*
@ -60,12 +56,12 @@ public:
virtual const wxString GetName() const override virtual const wxString GetName() const override
{ {
return "silk_clearance"; return wxT( "silk_clearance" );
}; };
virtual const wxString GetDescription() const override virtual const wxString GetDescription() const override
{ {
return "Tests for overlapping silkscreen features."; return wxT( "Tests for overlapping silkscreen features." );
} }
private: private:
@ -82,7 +78,7 @@ bool DRC_TEST_PROVIDER_SILK_CLEARANCE::Run()
if( m_drcEngine->IsErrorLimitExceeded( DRCE_OVERLAPPING_SILK ) ) if( m_drcEngine->IsErrorLimitExceeded( DRCE_OVERLAPPING_SILK ) )
{ {
reportAux( "Overlapping silk violations ignored. Tests not run." ); reportAux( wxT( "Overlapping silk violations ignored. Tests not run." ) );
return true; // continue with other tests return true; // continue with other tests
} }
@ -94,7 +90,7 @@ bool DRC_TEST_PROVIDER_SILK_CLEARANCE::Run()
if( m_drcEngine->QueryWorstConstraint( SILK_CLEARANCE_CONSTRAINT, worstClearanceConstraint ) ) if( m_drcEngine->QueryWorstConstraint( SILK_CLEARANCE_CONSTRAINT, worstClearanceConstraint ) )
m_largestClearance = worstClearanceConstraint.m_Value.Min(); m_largestClearance = worstClearanceConstraint.m_Value.Min();
reportAux( "Worst clearance : %d nm", m_largestClearance ); reportAux( wxT( "Worst clearance : %d nm" ), m_largestClearance );
if( !reportPhase( _( "Checking silkscreen for overlapping items..." ) ) ) if( !reportPhase( _( "Checking silkscreen for overlapping items..." ) ) )
return false; // DRC cancelled return false; // DRC cancelled
@ -150,7 +146,7 @@ bool DRC_TEST_PROVIDER_SILK_CLEARANCE::Run()
LSET::FrontMask() | LSET::BackMask() | LSET( 2, Edge_Cuts, Margin ), LSET::FrontMask() | LSET::BackMask() | LSET( 2, Edge_Cuts, Margin ),
addToTargetTree ); addToTargetTree );
reportAux( _("Testing %d silkscreen features against %d board items."), reportAux( wxT( "Testing %d silkscreen features against %d board items." ),
silkTree.size(), silkTree.size(),
targetTree.size() ); targetTree.size() );

View File

@ -56,12 +56,12 @@ public:
virtual const wxString GetName() const override virtual const wxString GetName() const override
{ {
return "sliver checker"; return wxT( "sliver checker" );
}; };
virtual const wxString GetDescription() const override virtual const wxString GetDescription() const override
{ {
return "Checks copper layers for slivers"; return wxT( "Checks copper layers for slivers" );
} }
private: private:

View File

@ -1,7 +1,7 @@
/* /*
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2004-2020 KiCad Developers. * Copyright (C) 2004-2022 KiCad Developers.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -63,13 +63,13 @@ public:
virtual const wxString GetName() const override virtual const wxString GetName() const override
{ {
return "solder_mask_issues"; return wxT( "solder_mask_issues" );
}; };
virtual const wxString GetDescription() const override virtual const wxString GetDescription() const override
{ {
return "Tests for silkscreen being clipped by solder mask and copper being exposed by " return wxT( "Tests for silkscreen being clipped by solder mask and copper being exposed "
"mask apertures of other nets"; "by mask apertures of other nets" );
} }
private: private:
@ -618,7 +618,7 @@ bool DRC_TEST_PROVIDER_SOLDER_MASK::Run()
if( m_drcEngine->IsErrorLimitExceeded( DRCE_SILK_CLEARANCE ) if( m_drcEngine->IsErrorLimitExceeded( DRCE_SILK_CLEARANCE )
&& m_drcEngine->IsErrorLimitExceeded( DRCE_SOLDERMASK_BRIDGE ) ) && m_drcEngine->IsErrorLimitExceeded( DRCE_SOLDERMASK_BRIDGE ) )
{ {
reportAux( "Solder mask violations ignored. Tests not run." ); reportAux( wxT( "Solder mask violations ignored. Tests not run." ) );
return true; // continue with other tests return true; // continue with other tests
} }
@ -642,7 +642,7 @@ bool DRC_TEST_PROVIDER_SOLDER_MASK::Run()
if( m_drcEngine->QueryWorstConstraint( SILK_CLEARANCE_CONSTRAINT, worstClearanceConstraint ) ) if( m_drcEngine->QueryWorstConstraint( SILK_CLEARANCE_CONSTRAINT, worstClearanceConstraint ) )
m_largestClearance = std::max( m_largestClearance, worstClearanceConstraint.m_Value.Min() ); m_largestClearance = std::max( m_largestClearance, worstClearanceConstraint.m_Value.Min() );
reportAux( "Worst clearance : %d nm", m_largestClearance ); reportAux( wxT( "Worst clearance : %d nm" ), m_largestClearance );
if( !reportPhase( _( "Building solder mask..." ) ) ) if( !reportPhase( _( "Building solder mask..." ) ) )
return false; // DRC cancelled return false; // DRC cancelled

View File

@ -55,12 +55,12 @@ public:
virtual const wxString GetName() const override virtual const wxString GetName() const override
{ {
return "text_dimensions"; return wxT( "text_dimensions" );
}; };
virtual const wxString GetDescription() const override virtual const wxString GetDescription() const override
{ {
return "Tests text height and thickness"; return wxT( "Tests text height and thickness" );
} }
}; };
@ -74,14 +74,14 @@ bool DRC_TEST_PROVIDER_TEXT_DIMS::Run()
if( m_drcEngine->IsErrorLimitExceeded( DRCE_TEXT_HEIGHT ) if( m_drcEngine->IsErrorLimitExceeded( DRCE_TEXT_HEIGHT )
&& m_drcEngine->IsErrorLimitExceeded( DRCE_TEXT_THICKNESS ) ) && m_drcEngine->IsErrorLimitExceeded( DRCE_TEXT_THICKNESS ) )
{ {
reportAux( "Text dimension violations ignored. Tests not run." ); reportAux( wxT( "Text dimension violations ignored. Tests not run." ) );
return true; // continue with other tests return true; // continue with other tests
} }
if( !m_drcEngine->HasRulesForConstraintType( TEXT_HEIGHT_CONSTRAINT ) if( !m_drcEngine->HasRulesForConstraintType( TEXT_HEIGHT_CONSTRAINT )
&& !m_drcEngine->HasRulesForConstraintType( TEXT_THICKNESS_CONSTRAINT ) ) && !m_drcEngine->HasRulesForConstraintType( TEXT_THICKNESS_CONSTRAINT ) )
{ {
reportAux( "No text height or text thickness constraints found. Tests not run." ); reportAux( wxT( "No text height or text thickness constraints found. Tests not run." ) );
return true; // continue with other tests return true; // continue with other tests
} }

View File

@ -1,7 +1,7 @@
/* /*
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2004-2020 KiCad Developers. * Copyright (C) 2004-2022 KiCad Developers.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -49,12 +49,12 @@ public:
virtual const wxString GetName() const override virtual const wxString GetName() const override
{ {
return "width"; return wxT( "width" );
}; };
virtual const wxString GetDescription() const override virtual const wxString GetDescription() const override
{ {
return "Tests track widths"; return wxT( "Tests track widths" );
} }
}; };
@ -65,13 +65,13 @@ bool DRC_TEST_PROVIDER_TRACK_WIDTH::Run()
if( m_drcEngine->IsErrorLimitExceeded( DRCE_TRACK_WIDTH ) ) if( m_drcEngine->IsErrorLimitExceeded( DRCE_TRACK_WIDTH ) )
{ {
reportAux( "Track width violations ignored. Tests not run." ); reportAux( wxT( "Track width violations ignored. Tests not run." ) );
return true; // continue with other tests return true; // continue with other tests
} }
if( !m_drcEngine->HasRulesForConstraintType( TRACK_WIDTH_CONSTRAINT ) ) if( !m_drcEngine->HasRulesForConstraintType( TRACK_WIDTH_CONSTRAINT ) )
{ {
reportAux( "No track width constraints found. Tests not run." ); reportAux( wxT( "No track width constraints found. Tests not run." ) );
return true; // continue with other tests return true; // continue with other tests
} }

View File

@ -1,7 +1,7 @@
/* /*
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2004-2020 KiCad Developers. * Copyright (C) 2004-2022 KiCad Developers.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -49,12 +49,12 @@ public:
virtual const wxString GetName() const override virtual const wxString GetName() const override
{ {
return "diameter"; return wxT( "diameter" );
}; };
virtual const wxString GetDescription() const override virtual const wxString GetDescription() const override
{ {
return "Tests via diameters"; return wxT( "Tests via diameters" );
} }
}; };
@ -65,13 +65,13 @@ bool DRC_TEST_PROVIDER_VIA_DIAMETER::Run()
if( m_drcEngine->IsErrorLimitExceeded( DRCE_VIA_DIAMETER ) ) if( m_drcEngine->IsErrorLimitExceeded( DRCE_VIA_DIAMETER ) )
{ {
reportAux( "Via diameter violations ignored. Tests not run." ); reportAux( wxT( "Via diameter violations ignored. Tests not run." ) );
return true; // continue with other tests return true; // continue with other tests
} }
if( !m_drcEngine->HasRulesForConstraintType( VIA_DIAMETER_CONSTRAINT ) ) if( !m_drcEngine->HasRulesForConstraintType( VIA_DIAMETER_CONSTRAINT ) )
{ {
reportAux( "No via diameter constraints found. Tests not run." ); reportAux( wxT( "No via diameter constraints found. Tests not run." ) );
return true; // continue with other tests return true; // continue with other tests
} }

View File

@ -1,7 +1,7 @@
/* /*
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2021 KiCad Developers. * Copyright (C) 2021-2022 KiCad Developers.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -58,12 +58,12 @@ public:
virtual const wxString GetName() const override virtual const wxString GetName() const override
{ {
return "zone connections"; return wxT( "zone connections" );
}; };
virtual const wxString GetDescription() const override virtual const wxString GetDescription() const override
{ {
return "Checks thermal reliefs for a sufficient number of connecting spokes"; return wxT( "Checks thermal reliefs for a sufficient number of connecting spokes" );
} }
}; };