From 6f555b6258de1c635c8f127f0cfc7e8ca3b1a1f9 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Fri, 11 Mar 2022 21:16:52 +0000 Subject: [PATCH] wxT() and some cleanup in DRC. --- pcbnew/drc/drc_test_provider.cpp | 8 ++--- .../drc/drc_test_provider_annular_width.cpp | 10 +++--- pcbnew/drc/drc_test_provider_connectivity.cpp | 6 ++-- .../drc_test_provider_copper_clearance.cpp | 16 +++++----- .../drc_test_provider_courtyard_clearance.cpp | 10 +++--- .../drc_test_provider_diff_pair_coupling.cpp | 31 ++++++++++--------- pcbnew/drc/drc_test_provider_disallow.cpp | 4 +-- .../drc/drc_test_provider_edge_clearance.cpp | 17 +++++----- pcbnew/drc/drc_test_provider_hole_size.cpp | 8 ++--- pcbnew/drc/drc_test_provider_hole_to_hole.cpp | 12 +++---- .../drc/drc_test_provider_library_parity.cpp | 8 ++--- .../drc/drc_test_provider_matched_length.cpp | 18 +++++------ ...drc_test_provider_mechanical_clearance.cpp | 10 +++--- pcbnew/drc/drc_test_provider_misc.cpp | 14 ++++----- .../drc_test_provider_schematic_parity.cpp | 10 +++--- .../drc/drc_test_provider_silk_clearance.cpp | 16 ++++------ .../drc/drc_test_provider_sliver_checker.cpp | 4 +-- pcbnew/drc/drc_test_provider_solder_mask.cpp | 12 +++---- pcbnew/drc/drc_test_provider_text_dims.cpp | 8 ++--- pcbnew/drc/drc_test_provider_track_width.cpp | 10 +++--- pcbnew/drc/drc_test_provider_via_diameter.cpp | 10 +++--- .../drc_test_provider_zone_connections.cpp | 6 ++-- 22 files changed, 124 insertions(+), 124 deletions(-) diff --git a/pcbnew/drc/drc_test_provider.cpp b/pcbnew/drc/drc_test_provider.cpp index 11d7f659e7..b13991c90c 100644 --- a/pcbnew/drc/drc_test_provider.cpp +++ b/pcbnew/drc/drc_test_provider.cpp @@ -1,7 +1,7 @@ /* * 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 * 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 ""; } +const wxString DRC_TEST_PROVIDER::GetName() const { return wxT( "" ); } const wxString DRC_TEST_PROVIDER::GetDescription() const { return ""; } @@ -140,13 +140,13 @@ void DRC_TEST_PROVIDER::reportRuleStatistics() if( !m_isRuleDriven ) return; - m_drcEngine->ReportAux( "Rule hit statistics: " ); + m_drcEngine->ReportAux( wxT( "Rule hit statistics: " ) ); for( const std::pair& stat : m_stats ) { 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.second ) ); } diff --git a/pcbnew/drc/drc_test_provider_annular_width.cpp b/pcbnew/drc/drc_test_provider_annular_width.cpp index 0bc6aab5ef..74c8364f39 100644 --- a/pcbnew/drc/drc_test_provider_annular_width.cpp +++ b/pcbnew/drc/drc_test_provider_annular_width.cpp @@ -1,7 +1,7 @@ /* * 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 under the terms of the GNU General Public License @@ -54,12 +54,12 @@ public: virtual const wxString GetName() const override { - return "annular_width"; + return wxT( "annular_width" ); }; 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 ) ) { - reportAux( "Annular width violations ignored. Skipping check." ); + reportAux( wxT( "Annular width violations ignored. Skipping check." ) ); return true; // continue with other tests } @@ -76,7 +76,7 @@ bool DRC_TEST_PROVIDER_ANNULAR_WIDTH::Run() 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 } diff --git a/pcbnew/drc/drc_test_provider_connectivity.cpp b/pcbnew/drc/drc_test_provider_connectivity.cpp index 67827c0d74..74ecce5ea0 100644 --- a/pcbnew/drc/drc_test_provider_connectivity.cpp +++ b/pcbnew/drc/drc_test_provider_connectivity.cpp @@ -1,7 +1,7 @@ /* * 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 under the terms of the GNU General Public License @@ -56,12 +56,12 @@ public: virtual const wxString GetName() const override { - return "connectivity"; + return wxT( "connectivity" ); }; virtual const wxString GetDescription() const override { - return "Tests board connectivity"; + return wxT( "Tests board connectivity" ); } }; diff --git a/pcbnew/drc/drc_test_provider_copper_clearance.cpp b/pcbnew/drc/drc_test_provider_copper_clearance.cpp index 692f770e96..0abc897f08 100644 --- a/pcbnew/drc/drc_test_provider_copper_clearance.cpp +++ b/pcbnew/drc/drc_test_provider_copper_clearance.cpp @@ -1,7 +1,7 @@ /* * 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 * modify it under the terms of the GNU General Public License @@ -70,12 +70,12 @@ public: virtual const wxString GetName() const override { - return "clearance"; + return wxT( "clearance" ); }; virtual const wxString GetDescription() const override { - return "Tests copper item clearance"; + return wxT( "Tests copper item clearance" ); } private: @@ -113,7 +113,7 @@ bool DRC_TEST_PROVIDER_COPPER_CLEARANCE::Run() 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 } @@ -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 size_t delta = 50; @@ -201,7 +201,7 @@ bool DRC_TEST_PROVIDER_COPPER_CLEARANCE::Run() forEachGeometryItem( itemTypes, LSET::AllCuMask(), countItems ); 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 ) ) { @@ -509,7 +509,7 @@ void DRC_TEST_PROVIDER_COPPER_CLEARANCE::testTrackClearances() const int delta = 100; 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, int> checkedPairs; @@ -785,7 +785,7 @@ void DRC_TEST_PROVIDER_COPPER_CLEARANCE::testPadClearances( ) for( FOOTPRINT* footprint : m_board->Footprints() ) count += footprint->Pads().size(); - reportAux( "Testing %d pads...", count ); + reportAux( wxT( "Testing %d pads..." ), count ); int ii = 0; std::map< std::pair, int> checkedPairs; diff --git a/pcbnew/drc/drc_test_provider_courtyard_clearance.cpp b/pcbnew/drc/drc_test_provider_courtyard_clearance.cpp index 2d11208948..413653d3ad 100644 --- a/pcbnew/drc/drc_test_provider_courtyard_clearance.cpp +++ b/pcbnew/drc/drc_test_provider_courtyard_clearance.cpp @@ -1,7 +1,7 @@ /* * 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 under the terms of the GNU General Public License @@ -56,12 +56,12 @@ public: virtual const wxString GetName() const override { - return "courtyard_clearance"; + return wxT( "courtyard_clearance" ); } virtual const wxString GetDescription() const override { - return "Tests footprints' courtyard clearance"; + return wxT( "Tests footprints' courtyard clearance" ); } private: @@ -89,7 +89,7 @@ bool DRC_TEST_PROVIDER_COURTYARD_CLEARANCE::testFootprintCourtyardDefinitions() } else { - reportAux( "All courtyard violations ignored. Tests not run." ); + reportAux( wxT( "All courtyard violations ignored. Tests not run." ) ); 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 ) ) m_largestClearance = constraint.GetValue().Min(); - reportAux( "Worst courtyard clearance : %d nm", m_largestClearance ); + reportAux( wxT( "Worst courtyard clearance : %d nm" ), m_largestClearance ); if( !testFootprintCourtyardDefinitions() ) return false; diff --git a/pcbnew/drc/drc_test_provider_diff_pair_coupling.cpp b/pcbnew/drc/drc_test_provider_diff_pair_coupling.cpp index df29adffd4..88aa6fa370 100644 --- a/pcbnew/drc/drc_test_provider_diff_pair_coupling.cpp +++ b/pcbnew/drc/drc_test_provider_diff_pair_coupling.cpp @@ -1,7 +1,7 @@ /* * 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 * under the terms of the GNU General Public License as published by the @@ -66,12 +66,12 @@ public: virtual const wxString GetName() const override { - return "diff_pair_coupling"; + return wxT( "diff_pair_coupling" ); }; virtual const wxString GetDescription() const override { - return "Tests differential pair coupling"; + return wxT( "Tests differential pair coupling" ); } 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 ) ) { - drc_dbg( 10, "eval dp %p\n", item ); + drc_dbg( 10, wxT( "eval dp %p\n" ), item ); const DRC_CONSTRAINT_T constraintsToCheck[] = { 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 ) 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(); @@ -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(), 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; @@ -350,8 +350,10 @@ bool test::DRC_TEST_PROVIDER_DIFF_PAIR_COUPLING::Run() wxString nameP = niP->GetNetname(); wxString nameN = niN->GetNetname(); - reportAux( wxString::Format( "Rule '%s', DP: (+) %s - (-) %s", - it.first.parentRule->m_Name, nameP, nameN ) ); + reportAux( wxString::Format( wxT( "Rule '%s', DP: (+) %s - (-) %s" ), + it.first.parentRule->m_Name, + nameP, + nameN ) ); extractDiffPairCoupledItems( it.second, copperTree ); @@ -359,7 +361,7 @@ bool test::DRC_TEST_PROVIDER_DIFF_PAIR_COUPLING::Run() it.second.totalLengthN = 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 gapConstraint = 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 ); } - 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() ); 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 ); - 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(), totalLen ) ) ); @@ -477,8 +480,8 @@ bool test::DRC_TEST_PROVIDER_DIFF_PAIR_COUPLING::Run() auto val = gapConstraint->GetValue(); auto drcItem = DRC_ITEM::Create( DRCE_DIFF_PAIR_GAP_OUT_OF_RANGE ); - m_msg = drcItem->GetErrorText() + " (" + - gapConstraint->GetParentRule()->m_Name + " "; + m_msg = drcItem->GetErrorText() + wxT( " (" ) + + gapConstraint->GetParentRule()->m_Name + wxS( " " ); if( val.HasMin() ) m_msg += wxString::Format( _( "minimum gap: %s; " ), diff --git a/pcbnew/drc/drc_test_provider_disallow.cpp b/pcbnew/drc/drc_test_provider_disallow.cpp index 72d620f960..462dfd5602 100644 --- a/pcbnew/drc/drc_test_provider_disallow.cpp +++ b/pcbnew/drc/drc_test_provider_disallow.cpp @@ -56,12 +56,12 @@ public: virtual const wxString GetName() const override { - return "disallow"; + return wxT( "disallow" ); }; virtual const wxString GetDescription() const override { - return "Tests for disallowed items (e.g. keepouts)"; + return wxT( "Tests for disallowed items (e.g. keepouts)" ); } }; diff --git a/pcbnew/drc/drc_test_provider_edge_clearance.cpp b/pcbnew/drc/drc_test_provider_edge_clearance.cpp index dd3b3c8585..39df76d054 100644 --- a/pcbnew/drc/drc_test_provider_edge_clearance.cpp +++ b/pcbnew/drc/drc_test_provider_edge_clearance.cpp @@ -1,7 +1,7 @@ /* * 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 * modify it under the terms of the GNU General Public License @@ -60,12 +60,12 @@ public: virtual const wxString GetName() const override { - return "edge_clearance"; + return wxT( "edge_clearance" ); } virtual const wxString GetDescription() const override { - return "Tests items vs board edge clearance"; + return wxT( "Tests items vs board edge clearance" ); } private: @@ -129,7 +129,7 @@ bool DRC_TEST_PROVIDER_EDGE_CLEARANCE::Run() } else { - reportAux( "Edge clearance violations ignored. Tests not run." ); + reportAux( wxT( "Edge clearance violations ignored. Tests not run." ) ); 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 ) ) m_largestClearance = worstClearanceConstraint.GetValue().Min(); - reportAux( "Worst clearance : %d nm", m_largestClearance ); + reportAux( wxT( "Worst clearance : %d nm" ), m_largestClearance ); std::vector> edges; // we own these DRC_RTREE edgesTree; @@ -217,8 +217,9 @@ bool DRC_TEST_PROVIDER_EDGE_CLEARANCE::Run() wxString val; wxGetEnv( "WXTRACE", &val ); - drc_dbg( 2, "outline: %d items, board: %d items\n", - (int) edges.size(), (int) boardItems.size() ); + drc_dbg( 2, wxT( "outline: %d items, board: %d items\n" ), + (int) edges.size(), + (int) boardItems.size() ); // This is the number of tests between 2 calls to the progress bar const int delta = 50; @@ -274,7 +275,7 @@ bool DRC_TEST_PROVIDER_EDGE_CLEARANCE::Run() reportRuleStatistics(); - return true; + return !m_drcEngine->IsCancelled(); } diff --git a/pcbnew/drc/drc_test_provider_hole_size.cpp b/pcbnew/drc/drc_test_provider_hole_size.cpp index b41b578f69..f4aa68ddb2 100644 --- a/pcbnew/drc/drc_test_provider_hole_size.cpp +++ b/pcbnew/drc/drc_test_provider_hole_size.cpp @@ -1,7 +1,7 @@ /* * 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 under the terms of the GNU General Public License @@ -52,12 +52,12 @@ public: virtual const wxString GetName() const override { - return "hole_size"; + return wxT( "hole_size" ); }; 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: @@ -124,7 +124,7 @@ bool DRC_TEST_PROVIDER_HOLE_SIZE::Run() reportRuleStatistics(); - return true; + return !m_drcEngine->IsCancelled(); } diff --git a/pcbnew/drc/drc_test_provider_hole_to_hole.cpp b/pcbnew/drc/drc_test_provider_hole_to_hole.cpp index d158b697d1..d5e87ee51a 100644 --- a/pcbnew/drc/drc_test_provider_hole_to_hole.cpp +++ b/pcbnew/drc/drc_test_provider_hole_to_hole.cpp @@ -1,7 +1,7 @@ /* * 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 under the terms of the GNU General Public License @@ -58,12 +58,12 @@ public: virtual const wxString GetName() const override { - return "hole_to_hole_clearance"; + return wxT( "hole_to_hole_clearance" ); }; virtual const wxString GetDescription() const override { - return "Tests hole to hole spacing"; + return wxT( "Tests hole to hole spacing" ); } private: @@ -96,7 +96,7 @@ bool DRC_TEST_PROVIDER_HOLE_TO_HOLE::Run() if( m_drcEngine->IsErrorLimitExceeded( DRCE_DRILLED_HOLES_TOO_CLOSE ) && 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 } @@ -107,11 +107,11 @@ bool DRC_TEST_PROVIDER_HOLE_TO_HOLE::Run() if( m_drcEngine->QueryWorstConstraint( HOLE_TO_HOLE_CONSTRAINT, worstClearanceConstraint ) ) { 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 { - 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 } diff --git a/pcbnew/drc/drc_test_provider_library_parity.cpp b/pcbnew/drc/drc_test_provider_library_parity.cpp index 5168b3f4aa..28e4e23eb5 100644 --- a/pcbnew/drc/drc_test_provider_library_parity.cpp +++ b/pcbnew/drc/drc_test_provider_library_parity.cpp @@ -59,12 +59,12 @@ public: virtual const wxString GetName() const override { - return "library_parity"; + return wxT( "library_parity" ); }; 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 ) ) { std::shared_ptr 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, libName ); drcItem->SetErrorMessage( msg ); @@ -518,7 +518,7 @@ bool DRC_TEST_PROVIDER_LIBRARY_PARITY::Run() if( !m_drcEngine->IsErrorLimitExceeded( DRCE_LIB_FOOTPRINT_MISMATCH ) ) { std::shared_ptr 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, libName ); drcItem->SetErrorMessage( msg ); diff --git a/pcbnew/drc/drc_test_provider_matched_length.cpp b/pcbnew/drc/drc_test_provider_matched_length.cpp index 2c04fe3f07..1727b6f114 100644 --- a/pcbnew/drc/drc_test_provider_matched_length.cpp +++ b/pcbnew/drc/drc_test_provider_matched_length.cpp @@ -1,7 +1,7 @@ /* * 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 * under the terms of the GNU General Public License as published by the @@ -59,12 +59,12 @@ public: virtual const wxString GetName() const override { - return "length"; + return wxT( "length" ); }; virtual const wxString GetDescription() const override { - return "Tests matched track lengths."; + return wxT( "Tests matched track lengths." ); } DRC_LENGTH_REPORT BuildLengthReport() const; @@ -338,15 +338,15 @@ bool DRC_TEST_PROVIDER_MATCHED_LENGTH::runInternal( bool aDelayReportMode ) 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 ) ); for( auto& ent : matchedConnections ) { - reportAux(wxString::Format( " - net: %s, from: %s, to: %s, " - "%d matching items, " - "total: %s (tracks: %s, vias: %s, pad-to-die: %s), " - "vias: %d", + reportAux(wxString::Format( wxT( " - net: %s, from: %s, to: %s, " + "%d matching items, " + "total: %s (tracks: %s, vias: %s, pad-to-die: %s), " + "vias: %d" ), ent.netname, ent.from, ent.to, @@ -378,7 +378,7 @@ bool DRC_TEST_PROVIDER_MATCHED_LENGTH::runInternal( bool aDelayReportMode ) reportRuleStatistics(); } - return true; + return !m_drcEngine->IsCancelled(); } diff --git a/pcbnew/drc/drc_test_provider_mechanical_clearance.cpp b/pcbnew/drc/drc_test_provider_mechanical_clearance.cpp index a73b73abef..881832afd6 100644 --- a/pcbnew/drc/drc_test_provider_mechanical_clearance.cpp +++ b/pcbnew/drc/drc_test_provider_mechanical_clearance.cpp @@ -1,7 +1,7 @@ /* * 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 * modify it under the terms of the GNU General Public License @@ -62,12 +62,12 @@ public: virtual const wxString GetName() const override { - return "mechanical_clearance"; + return wxT( "mechanical_clearance" ); }; virtual const wxString GetDescription() const override { - return "Tests item clearances irrespective of nets"; + return wxT( "Tests item clearances irrespective of nets" ); } private: @@ -106,7 +106,7 @@ bool DRC_TEST_PROVIDER_MECHANICAL_CLEARANCE::Run() 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 } @@ -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 size_t delta = 50; diff --git a/pcbnew/drc/drc_test_provider_misc.cpp b/pcbnew/drc/drc_test_provider_misc.cpp index 3e82e33e5d..cd73577a98 100644 --- a/pcbnew/drc/drc_test_provider_misc.cpp +++ b/pcbnew/drc/drc_test_provider_misc.cpp @@ -1,7 +1,7 @@ /* * 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 * modify it under the terms of the GNU General Public License @@ -59,12 +59,12 @@ public: virtual const wxString GetName() const override { - return "miscellaneous"; + return wxT( "miscellaneous" ); }; virtual const wxString GetDescription() const override { - return "Misc checks (board outline, missing textvars)"; + return wxT( "Misc checks (board outline, missing textvars)" ); } private: @@ -304,11 +304,11 @@ void DRC_TEST_PROVIDER_MISC::testTextVars() return; drawItems.SetMilsToIUfactor( IU_PER_MILS ); - drawItems.SetPageNumber( "1" ); + drawItems.SetPageNumber( wxT( "1" ) ); drawItems.SetSheetCount( 1 ); - drawItems.SetFileName( "dummyFilename" ); - drawItems.SetSheetName( "dummySheet" ); - drawItems.SetSheetLayer( "dummyLayer" ); + drawItems.SetFileName( wxT( "dummyFilename" ) ); + drawItems.SetSheetName( wxT( "dummySheet" ) ); + drawItems.SetSheetLayer( wxT( "dummyLayer" ) ); drawItems.SetProject( m_board->GetProject() ); drawItems.BuildDrawItemsList( drawingSheet->GetPageInfo(), drawingSheet->GetTitleBlock() ); diff --git a/pcbnew/drc/drc_test_provider_schematic_parity.cpp b/pcbnew/drc/drc_test_provider_schematic_parity.cpp index 42ad22b694..604c388baa 100644 --- a/pcbnew/drc/drc_test_provider_schematic_parity.cpp +++ b/pcbnew/drc/drc_test_provider_schematic_parity.cpp @@ -1,7 +1,7 @@ /* * 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 * modify it under the terms of the GNU General Public License @@ -60,12 +60,12 @@ public: virtual const wxString GetName() const override { - return "schematic_parity"; + return wxT( "schematic_parity" ); }; virtual const wxString GetDescription() const override { - return "Performs layout-vs-schematics integity check"; + return wxT( "Performs layout-vs-schematics integity check" ); } private: @@ -218,7 +218,7 @@ bool DRC_TEST_PROVIDER_SCHEMATIC_PARITY::Run() if( !netlist ) { - reportAux( _( "No netlist provided, skipping schematic parity tests." ) ); + reportAux( wxT( "No netlist provided, skipping schematic parity tests." ) ); return true; } @@ -227,7 +227,7 @@ bool DRC_TEST_PROVIDER_SCHEMATIC_PARITY::Run() reportRuleStatistics(); } - return true; + return !m_drcEngine->IsCancelled(); } diff --git a/pcbnew/drc/drc_test_provider_silk_clearance.cpp b/pcbnew/drc/drc_test_provider_silk_clearance.cpp index fba6f4e08d..3cb7089b0f 100644 --- a/pcbnew/drc/drc_test_provider_silk_clearance.cpp +++ b/pcbnew/drc/drc_test_provider_silk_clearance.cpp @@ -1,7 +1,7 @@ /* * 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 under the terms of the GNU General Public License @@ -25,15 +25,11 @@ #include #include #include - #include -#include - #include #include #include #include - #include /* @@ -60,12 +56,12 @@ public: virtual const wxString GetName() const override { - return "silk_clearance"; + return wxT( "silk_clearance" ); }; virtual const wxString GetDescription() const override { - return "Tests for overlapping silkscreen features."; + return wxT( "Tests for overlapping silkscreen features." ); } private: @@ -82,7 +78,7 @@ bool DRC_TEST_PROVIDER_SILK_CLEARANCE::Run() 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 } @@ -94,7 +90,7 @@ bool DRC_TEST_PROVIDER_SILK_CLEARANCE::Run() if( m_drcEngine->QueryWorstConstraint( SILK_CLEARANCE_CONSTRAINT, worstClearanceConstraint ) ) 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..." ) ) ) return false; // DRC cancelled @@ -150,7 +146,7 @@ bool DRC_TEST_PROVIDER_SILK_CLEARANCE::Run() LSET::FrontMask() | LSET::BackMask() | LSET( 2, Edge_Cuts, Margin ), addToTargetTree ); - reportAux( _("Testing %d silkscreen features against %d board items."), + reportAux( wxT( "Testing %d silkscreen features against %d board items." ), silkTree.size(), targetTree.size() ); diff --git a/pcbnew/drc/drc_test_provider_sliver_checker.cpp b/pcbnew/drc/drc_test_provider_sliver_checker.cpp index a873eb666a..f00051b75c 100644 --- a/pcbnew/drc/drc_test_provider_sliver_checker.cpp +++ b/pcbnew/drc/drc_test_provider_sliver_checker.cpp @@ -56,12 +56,12 @@ public: virtual const wxString GetName() const override { - return "sliver checker"; + return wxT( "sliver checker" ); }; virtual const wxString GetDescription() const override { - return "Checks copper layers for slivers"; + return wxT( "Checks copper layers for slivers" ); } private: diff --git a/pcbnew/drc/drc_test_provider_solder_mask.cpp b/pcbnew/drc/drc_test_provider_solder_mask.cpp index b8f0f8f5bb..06f5b3a3c8 100644 --- a/pcbnew/drc/drc_test_provider_solder_mask.cpp +++ b/pcbnew/drc/drc_test_provider_solder_mask.cpp @@ -1,7 +1,7 @@ /* * 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 under the terms of the GNU General Public License @@ -63,13 +63,13 @@ public: virtual const wxString GetName() const override { - return "solder_mask_issues"; + return wxT( "solder_mask_issues" ); }; virtual const wxString GetDescription() const override { - return "Tests for silkscreen being clipped by solder mask and copper being exposed by " - "mask apertures of other nets"; + return wxT( "Tests for silkscreen being clipped by solder mask and copper being exposed " + "by mask apertures of other nets" ); } private: @@ -618,7 +618,7 @@ bool DRC_TEST_PROVIDER_SOLDER_MASK::Run() if( m_drcEngine->IsErrorLimitExceeded( DRCE_SILK_CLEARANCE ) && 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 } @@ -642,7 +642,7 @@ bool DRC_TEST_PROVIDER_SOLDER_MASK::Run() if( m_drcEngine->QueryWorstConstraint( SILK_CLEARANCE_CONSTRAINT, worstClearanceConstraint ) ) 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..." ) ) ) return false; // DRC cancelled diff --git a/pcbnew/drc/drc_test_provider_text_dims.cpp b/pcbnew/drc/drc_test_provider_text_dims.cpp index 96002164fd..b97d4df0d3 100644 --- a/pcbnew/drc/drc_test_provider_text_dims.cpp +++ b/pcbnew/drc/drc_test_provider_text_dims.cpp @@ -55,12 +55,12 @@ public: virtual const wxString GetName() const override { - return "text_dimensions"; + return wxT( "text_dimensions" ); }; 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 ) && 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 } if( !m_drcEngine->HasRulesForConstraintType( TEXT_HEIGHT_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 } diff --git a/pcbnew/drc/drc_test_provider_track_width.cpp b/pcbnew/drc/drc_test_provider_track_width.cpp index c56f3a81c7..2a67c83024 100644 --- a/pcbnew/drc/drc_test_provider_track_width.cpp +++ b/pcbnew/drc/drc_test_provider_track_width.cpp @@ -1,7 +1,7 @@ /* * 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 under the terms of the GNU General Public License @@ -49,12 +49,12 @@ public: virtual const wxString GetName() const override { - return "width"; + return wxT( "width" ); }; 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 ) ) { - reportAux( "Track width violations ignored. Tests not run." ); + reportAux( wxT( "Track width violations ignored. Tests not run." ) ); return true; // continue with other tests } 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 } diff --git a/pcbnew/drc/drc_test_provider_via_diameter.cpp b/pcbnew/drc/drc_test_provider_via_diameter.cpp index 606951be9b..449c858607 100644 --- a/pcbnew/drc/drc_test_provider_via_diameter.cpp +++ b/pcbnew/drc/drc_test_provider_via_diameter.cpp @@ -1,7 +1,7 @@ /* * 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 under the terms of the GNU General Public License @@ -49,12 +49,12 @@ public: virtual const wxString GetName() const override { - return "diameter"; + return wxT( "diameter" ); }; 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 ) ) { - reportAux( "Via diameter violations ignored. Tests not run." ); + reportAux( wxT( "Via diameter violations ignored. Tests not run." ) ); return true; // continue with other tests } 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 } diff --git a/pcbnew/drc/drc_test_provider_zone_connections.cpp b/pcbnew/drc/drc_test_provider_zone_connections.cpp index fd60ed075e..6bdc4d21f0 100644 --- a/pcbnew/drc/drc_test_provider_zone_connections.cpp +++ b/pcbnew/drc/drc_test_provider_zone_connections.cpp @@ -1,7 +1,7 @@ /* * 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 * modify it under the terms of the GNU General Public License @@ -58,12 +58,12 @@ public: virtual const wxString GetName() const override { - return "zone connections"; + return wxT( "zone connections" ); }; 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" ); } };