7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-19 21:41:40 +00:00

More wxString wide literals.

This commit is contained in:
Jeff Young 2022-02-04 22:44:59 +00:00
parent 9582457fef
commit 7ccac79192
102 changed files with 774 additions and 713 deletions
3d-viewer
eeschema/dialogs
pcbnew
action_plugin.cppboard.cppboard_connected_item.cppboard_item.cpp
board_stackup_manager
cleanup_item.cpp
connectivity
convert_shape_list_to_polygon.cppcross-probing.cpp
dialogs
edit_zone_helpers.cppfiles.cppfootprint.cppfootprint_edit_frame.cppfootprint_editor_utils.cppfootprint_info_impl.cppfootprint_viewer_frame.cppfootprint_wizard.hfootprint_wizard_frame.cppfootprint_wizard_frame_functions.cppfp_tree_model_adapter.cppfp_tree_synchronizing_adapter.cppgenerate_footprint_info.cppgraphics_cleaner.cppkicad_clipboard.cppload_select_footprint.cppmenubar_footprint_editor.cppmenubar_pcb_editor.cppnetinfo.hnetinfo_item.cppnetinfo_list.cpppad.cpppcb_base_edit_frame.cpppcb_base_frame.cpppcb_dimension.cpppcb_draw_panel_gal.cpppcb_edit_frame.cpppcb_expr_evaluator.cpppcb_group.cpppcb_painter.cpppcb_target.cpppcb_text.cpppcb_track.cpppcbnew.cpppcbplot.cppplot_board_layers.cppplot_brditems_plotter.cppplugin.cpp
plugins
sel_layer.cpptoolbars_pcb_editor.cppundo_redo.cppzone.cppzone_filler.cppzone_settings.cpp

View File

@ -536,7 +536,7 @@ bool S3D_CACHE::Set3DConfigDir( const wxString& aConfigDir )
{
wxLogTrace( MASK_3D_CACHE,
wxT( "%s:%s:%d\n * could not set 3D Config Directory on filename resolver\n"
" * config directory: '%s'" ),
" * config directory: '%s'" ),
__FILE__, __FUNCTION__, __LINE__, m_ConfigDir );
}

View File

@ -324,7 +324,7 @@ void S3D_PLUGIN_MANAGER::checkPluginPath( const wxString& aPath,
if( aPath.StartsWith( wxT( "${" ) ) || aPath.StartsWith( wxT( "$(" ) ) )
path.Assign( ExpandEnvVarSubstitutions( aPath, nullptr ), wxEmptyString );
else
path.Assign( aPath, "" );
path.Assign( aPath, wxT( "" ) );
path.Normalize();

View File

@ -323,8 +323,10 @@ SGNODE* S3D::ReadCache( const char* aFileName, void* aPluginMgr,
if( !rval )
{
wxLogTrace( MASK_3D_SG, "%s:%s:%d * [INFO] problems encountered reading cache file '%s'",
__FILE__, __FUNCTION__, __LINE__, aFileName );
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] problems encountered reading cache file "
"'%s'" ),
__FILE__, __FUNCTION__, __LINE__,
aFileName );
return nullptr;
}

View File

@ -783,7 +783,7 @@ void EDA_3D_CANVAS::OnMouseMove( wxMouseEvent& event )
m_3d_render_opengl->SetCurrentRollOverItem( nullptr );
Request_refresh();
reporter.Report( "" );
reporter.Report( wxEmptyString );
}
m_currentRollOverItem = nullptr;

View File

@ -239,13 +239,16 @@ static double rotationFromString( const wxString& aValue )
wxString PANEL_PREVIEW_3D_MODEL::formatScaleValue( double aValue )
{
return wxString::Format( "%.4f", aValue );
return wxString::Format( wxT( "%.4f" ),
aValue );
}
wxString PANEL_PREVIEW_3D_MODEL::formatRotationValue( double aValue )
{
return wxString::Format( "%.2f%s", aValue, GetAbbreviatedUnitsLabel( EDA_UNITS::DEGREES ) );
return wxString::Format( wxT( "%.2f%s" ),
aValue,
GetAbbreviatedUnitsLabel( EDA_UNITS::DEGREES ) );
}
@ -257,7 +260,9 @@ wxString PANEL_PREVIEW_3D_MODEL::formatOffsetValue( double aValue )
else if( m_userUnits == EDA_UNITS::MILS )
aValue /= 25.4 / 1e3;
return wxString::Format( "%.6f%s", aValue, GetAbbreviatedUnitsLabel( m_userUnits ) );
return wxString::Format( wxT( "%.6f%s" ),
aValue,
GetAbbreviatedUnitsLabel( m_userUnits ) );
}

View File

@ -357,8 +357,8 @@ bool PANEL_SYM_LIB_TABLE::verifyTables()
wxYES_NO | wxCENTER | wxICON_QUESTION | wxYES_DEFAULT );
badCellDlg.SetExtendedMessage( _( "Empty cells will result in all rows that are "
"invalid to be removed from the table." ) );
badCellDlg.SetYesNoLabels( wxMessageDialog::ButtonLabel( "Remove Invalid Cells" ),
wxMessageDialog::ButtonLabel( "Cancel Table Update" ) );
badCellDlg.SetYesNoLabels( wxMessageDialog::ButtonLabel( _( "Remove Invalid Cells" ) ),
wxMessageDialog::ButtonLabel( _( "Cancel Table Update" ) ) );
if( badCellDlg.ShowModal() == wxID_NO )
return false;

View File

@ -177,7 +177,7 @@ void ACTION_PLUGINS::register_action( ACTION_PLUGIN* aAction )
if ( !aAction->iconBitmap.IsOk() )
{
wxLogVerbose( "Failed to load icon " + icon_file_name + " for action plugin " );
wxLogVerbose( wxT( "Failed to load icon " ) + icon_file_name + wxT( " for action plugin " ) );
}
}
}

View File

@ -1011,14 +1011,14 @@ wxString BOARD::ConvertCrossReferencesToKIIDs( const wxString& aSource ) const
wxString test( remainder );
if( footprint->ResolveTextVar( &test ) )
token = footprint->m_Uuid.AsString() + ":" + remainder;
token = footprint->m_Uuid.AsString() + wxT( ":" ) + remainder;
break;
}
}
}
newbuf.append( "${" + token + "}" );
newbuf.append( wxT( "${" ) + token + wxT( "}" ) );
}
else
{
@ -1060,10 +1060,13 @@ wxString BOARD::ConvertKIIDsToCrossReferences( const wxString& aSource ) const
BOARD_ITEM* refItem = GetItem( KIID( ref ) );
if( refItem && refItem->Type() == PCB_FOOTPRINT_T )
token = static_cast<FOOTPRINT*>( refItem )->GetReference() + ":" + remainder;
{
token = static_cast<FOOTPRINT*>( refItem )->GetReference() + wxT( ":" )
+ remainder;
}
}
newbuf.append( "${" + token + "}" );
newbuf.append( wxT( "${" ) + token + wxT( "}" ) );
}
else
{
@ -1189,11 +1192,11 @@ void BOARD::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>
}
}
aList.emplace_back( _( "Pads" ), wxString::Format( "%d", padCount ) );
aList.emplace_back( _( "Vias" ), wxString::Format( "%d", viaCount ) );
aList.emplace_back( _( "Track Segments" ), wxString::Format( "%d", trackSegmentCount ) );
aList.emplace_back( _( "Nets" ), wxString::Format( "%d", (int) netCodes.size() ) );
aList.emplace_back( _( "Unrouted" ), wxString::Format( "%d", unconnected ) );
aList.emplace_back( _( "Pads" ), wxString::Format( wxT( "%d" ), padCount ) );
aList.emplace_back( _( "Vias" ), wxString::Format( wxT( "%d" ), viaCount ) );
aList.emplace_back( _( "Track Segments" ), wxString::Format( wxT( "%d" ), trackSegmentCount ) );
aList.emplace_back( _( "Nets" ), wxString::Format( wxT( "%d" ), (int) netCodes.size() ) );
aList.emplace_back( _( "Unrouted" ), wxString::Format( wxT( "%d" ), unconnected ) );
}

View File

@ -139,9 +139,9 @@ wxString BOARD_CONNECTED_ITEM::GetNetnameMsg() const
if( !netname.length() )
return wxT( "[<no net>]" );
else if( GetNetCode() < 0 )
return wxT( "[" + UnescapeString( netname ) + "](" + _( "Not Found" ) + ")" );
return wxT( "[" ) + UnescapeString( netname ) + wxT( "](" ) + _( "Not Found" ) + wxT( ")" );
else
return wxT( "[" + UnescapeString( netname ) + "]" );
return wxT( "[" ) + UnescapeString( netname ) + wxT( "]" );
}

View File

@ -171,8 +171,8 @@ void BOARD_ITEM::TransformShapeWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBu
int aError, ERROR_LOC aErrorLoc,
bool ignoreLineWidth ) const
{
wxASSERT_MSG( false,
"Called TransformShapeWithClearanceToPolygon() on unsupported BOARD_ITEM." );
wxASSERT_MSG( false, wxT( "Called TransformShapeWithClearanceToPolygon() on unsupported "
"BOARD_ITEM." ) );
};

View File

@ -48,18 +48,18 @@ BOARD_STACKUP_ITEM::BOARD_STACKUP_ITEM( BOARD_STACKUP_ITEM_TYPE aType )
break;
case BS_ITEM_TYPE_DIELECTRIC:
m_TypeName = KEY_CORE; // or prepreg
SetMaterial( "FR4" ); // or other dielectric name
SetLossTangent( 0.02 ); // for FR4
SetEpsilonR( 4.5 ); // for FR4
m_TypeName = KEY_CORE; // or prepreg
SetMaterial( wxT( "FR4" ) ); // or other dielectric name
SetLossTangent( 0.02 ); // for FR4
SetEpsilonR( 4.5 ); // for FR4
break;
case BS_ITEM_TYPE_SOLDERPASTE:
m_TypeName = "solderpaste";
m_TypeName = wxT( "solderpaste" );
break;
case BS_ITEM_TYPE_SOLDERMASK:
m_TypeName = "soldermask";
m_TypeName = wxT( "soldermask" );
m_Color = NotSpecifiedPrm();
SetMaterial( NotSpecifiedPrm() ); // or other solder mask material name
SetThickness( GetMaskDefaultThickness() );
@ -67,7 +67,7 @@ BOARD_STACKUP_ITEM::BOARD_STACKUP_ITEM( BOARD_STACKUP_ITEM_TYPE aType )
break;
case BS_ITEM_TYPE_SILKSCREEN:
m_TypeName = "silkscreen";
m_TypeName = wxT( "silkscreen" );
m_Color = NotSpecifiedPrm();
SetMaterial( NotSpecifiedPrm() ); // or other silkscreen material name
SetEpsilonR( DEFAULT_EPSILON_R_SILKSCREEN );
@ -299,7 +299,7 @@ BOARD_STACKUP::BOARD_STACKUP()
m_EdgeConnectorConstraints = BS_EDGE_CONNECTOR_NONE;
m_CastellatedPads = false; // True if some castellated pads exist
m_EdgePlating = false; // True if edge board is plated
m_FinishType = "None"; // undefined finish type
m_FinishType = wxT( "None" ); // undefined finish type
}
@ -550,12 +550,12 @@ void BOARD_STACKUP::BuildDefaultStackupList( const BOARD_DESIGN_SETTINGS* aSetti
if( (dielectric_idx & 1) == 0 )
{
item->SetTypeName( KEY_CORE );
item->SetMaterial( "FR4" );
item->SetMaterial( wxT( "FR4" ) );
}
else
{
item->SetTypeName( KEY_PREPREG );
item->SetMaterial( "FR4" );
item->SetMaterial( wxT( "FR4" ) );
}
Add( item );
@ -617,7 +617,7 @@ void BOARD_STACKUP::FormatBoardStackup( OUTPUTFORMATTER* aFormatter,
wxString layer_name;
if( item->GetBrdLayerId() == UNDEFINED_LAYER )
layer_name.Printf( "dielectric %d", item->GetDielectricLayerId() );
layer_name.Printf( wxT( "dielectric %d" ), item->GetDielectricLayerId() );
else
layer_name = LSET::Name( item->GetBrdLayerId() );

View File

@ -56,21 +56,27 @@ wxString BuildStackupReport( BOARD_STACKUP& aStackup, EDA_UNITS aUnits )
wxString sublayer_text;
if( item->GetSublayersCount() )
sublayer_text.Printf( "\n sublayer \"1/%d\"", item->GetSublayersCount() );
{
sublayer_text.Printf( wxT( "\n sublayer \"1/%d\"" ),
item->GetSublayersCount() );
}
txt.Printf( "layer \"%s\" type \"%s\"%s",
item->FormatDielectricLayerName(),
item->GetTypeName(), sublayer_text );
txt.Printf( wxT( "layer \"%s\" type \"%s\"%s" ),
item->FormatDielectricLayerName(),
item->GetTypeName(), sublayer_text );
}
else
txt.Printf( "layer \"%s\" type \"%s\"", item->GetLayerName(),
{
txt.Printf( wxT( "layer \"%s\" type \"%s\"" ),
item->GetLayerName(),
item->GetTypeName() );
}
report << txt;
if( item->IsColorEditable() )
{
txt.Printf( " Color \"%s\"", item->GetColor() );
txt.Printf( wxT( " Color \"%s\"" ), item->GetColor() );
report << txt;
}
@ -78,38 +84,38 @@ wxString BuildStackupReport( BOARD_STACKUP& aStackup, EDA_UNITS aUnits )
{
if( idx ) // not printed for the main (first) layer.
{
txt.Printf( "\n sublayer \"%d/%d\"", idx+1, item->GetSublayersCount() );
txt.Printf( wxT( "\n sublayer \"%d/%d\"" ), idx+1, item->GetSublayersCount() );
report << txt;
}
if( item->IsThicknessEditable() )
{
txt.Printf( " Thickness %s",
txt.Printf( wxT( " Thickness %s" ),
StringFromValue( aUnits, item->GetThickness( idx ), true ) );
report << txt;
if( item->GetType() == BS_ITEM_TYPE_DIELECTRIC && item->IsThicknessLocked( idx ) )
{
txt.Printf( " Locked" );
txt.Printf( wxT( " Locked" ) );
report << txt;
}
}
if( item->IsMaterialEditable() )
{
txt.Printf( " Material \"%s\"", item->GetMaterial( idx ) );
txt.Printf( wxT( " Material \"%s\"" ), item->GetMaterial( idx ) );
report << txt;
}
if( item->HasEpsilonRValue() )
{
txt.Printf( " EpsilonR %s", item->FormatEpsilonR( idx ) );
txt.Printf( wxT( " EpsilonR %s" ), item->FormatEpsilonR( idx ) );
report << txt;
}
if( item->HasLossTangentValue() )
{
txt.Printf( " LossTg %s", item->FormatLossTangent( idx ) );
txt.Printf( wxT( " LossTg %s" ), item->FormatLossTangent( idx ) );
report << txt;
}
}
@ -118,26 +124,26 @@ wxString BuildStackupReport( BOARD_STACKUP& aStackup, EDA_UNITS aUnits )
}
// Finish and other options:
txt.Printf( "Finish \"%s\"", aStackup.m_FinishType );
txt.Printf( wxT( "Finish \"%s\"" ), aStackup.m_FinishType );
report << txt;
if( aStackup.m_HasDielectricConstrains )
report << " Option \"Impedance Controlled\"";
report << wxT( " Option \"Impedance Controlled\"" );
if( aStackup.m_EdgePlating )
report << " Option \"Plated edges\"";
report << wxT( " Option \"Plated edges\"" );
if( aStackup.m_CastellatedPads )
report << " Option \"Castellated Pads\"";
report << wxT( " Option \"Castellated Pads\"" );
if( aStackup.m_EdgeConnectorConstraints != BS_EDGE_CONNECTOR_NONE )
{
wxString conn_txt = "yes";
wxString conn_txt = wxT( "yes" );
if( aStackup.m_EdgeConnectorConstraints == BS_EDGE_CONNECTOR_BEVELLED )
conn_txt << ",bevelled";
conn_txt << wxT( ",bevelled" );
txt.Printf( " EdgeConnector \"%s\"", conn_txt );
txt.Printf( wxT( " EdgeConnector \"%s\"" ), conn_txt );
report << txt;
}

View File

@ -37,32 +37,32 @@
// DO NOT translate them, as they are proper noun
static DIELECTRIC_SUBSTRATE substrateMaterial[] =
{
{ NotSpecifiedPrm(), 0.0, 0.0 }, // Not specified, not in .gbrjob
{ "FR4", 4.5, 0.02 }, // used in .gbrjob file
{ "FR408-HR", 3.69, 0.0091 }, // used in .gbrjob file
{ "Polyimide", 3.2, 0.004 }, // used in .gbrjob file
{ "Kapton", 3.2, 0.004 }, // used in .gbrjob file
{ "Polyolefin", 1.0, 0.0 }, // used in .gbrjob file
{ "Al", 8.7, 0.001 }, // used in .gbrjob file
{ "PTFE", 2.1, 0.0002 }, // used in .gbrjob file
{ "Teflon", 2.1, 0.0002 }, // used in .gbrjob file
{ "Ceramic", 1.0, 0.0 } // used in .gbrjob file
{ NotSpecifiedPrm(), 0.0, 0.0 }, // Not specified, not in .gbrjob
{ wxT( "FR4" ), 4.5, 0.02 }, // used in .gbrjob file
{ wxT( "FR408-HR" ), 3.69, 0.0091 }, // used in .gbrjob file
{ wxT( "Polyimide" ), 3.2, 0.004 }, // used in .gbrjob file
{ wxT( "Kapton" ), 3.2, 0.004 }, // used in .gbrjob file
{ wxT( "Polyolefin" ), 1.0, 0.0 }, // used in .gbrjob file
{ wxT( "Al" ), 8.7, 0.001 }, // used in .gbrjob file
{ wxT( "PTFE" ), 2.1, 0.0002 }, // used in .gbrjob file
{ wxT( "Teflon" ), 2.1, 0.0002 }, // used in .gbrjob file
{ wxT( "Ceramic" ), 1.0, 0.0 } // used in .gbrjob file
// Other names are free
};
static DIELECTRIC_SUBSTRATE solderMaskMaterial[] =
{
{ NotSpecifiedPrm(), DEFAULT_EPSILON_R_SOLDERMASK, 0.0 }, // Not specified, not in .gbrjob
{ "Epoxy", DEFAULT_EPSILON_R_SOLDERMASK, 0.0 }, // Epoxy Liquid material (usual)
{ "Liquid Ink", DEFAULT_EPSILON_R_SOLDERMASK, 0.0 }, // Liquid Ink Photoimageable
{ "Dry Film", DEFAULT_EPSILON_R_SOLDERMASK, 0.0 } // Dry Film Photoimageable
{ NotSpecifiedPrm(), DEFAULT_EPSILON_R_SOLDERMASK, 0.0 }, // Not specified, not in .gbrjob
{ wxT( "Epoxy" ), DEFAULT_EPSILON_R_SOLDERMASK, 0.0 }, // Epoxy Liquid material (usual)
{ wxT( "Liquid Ink" ), DEFAULT_EPSILON_R_SOLDERMASK, 0.0 }, // Liquid Ink Photoimageable
{ wxT( "Dry Film" ), DEFAULT_EPSILON_R_SOLDERMASK, 0.0 } // Dry Film Photoimageable
};
static DIELECTRIC_SUBSTRATE silkscreenMaterial[] =
{
{ NotSpecifiedPrm(), DEFAULT_EPSILON_R_SILKSCREEN, 0.0 }, // Not specified, not in .gbrjob
{ "Liquid Photo", DEFAULT_EPSILON_R_SILKSCREEN, 0.0 }, // Liquid Ink Photoimageable
{ "Direct Printing", DEFAULT_EPSILON_R_SILKSCREEN, 0.0 } // Direct Legend Printing
{ NotSpecifiedPrm(), DEFAULT_EPSILON_R_SILKSCREEN, 0.0 }, // Not specified, not in .gbrjob
{ wxT( "Liquid Photo" ), DEFAULT_EPSILON_R_SILKSCREEN, 0.0 }, // Liquid Ink Photoimageable
{ wxT( "Direct Printing" ), DEFAULT_EPSILON_R_SILKSCREEN, 0.0 } // Direct Legend Printing
};

View File

@ -93,17 +93,17 @@ PANEL_SETUP_BOARD_STACKUP::PANEL_SETUP_BOARD_STACKUP( PAGED_DIALOG* aParent, PCB
// Calculates a good size for color swatches (icons) in this dialog
wxClientDC dc( this );
m_colorSwatchesSize = dc.GetTextExtent( "XX" );
m_colorIconsSize = dc.GetTextExtent( "XXXX" );
m_colorSwatchesSize = dc.GetTextExtent( wxT( "XX" ) );
m_colorIconsSize = dc.GetTextExtent( wxT( "XXXX" ) );
// Calculates a good size for wxTextCtrl to enter Epsilon R and Loss tan
// ("0.0000000" + margins)
m_numericFieldsSize = dc.GetTextExtent( "X.XXXXXXX" );
m_numericFieldsSize = dc.GetTextExtent( wxT( "X.XXXXXXX" ) );
m_numericFieldsSize.y = -1; // Use default for the vertical size
// Calculates a minimal size for wxTextCtrl to enter a dim with units
// ("000.0000000 mils" + margins)
m_numericTextCtrlSize = dc.GetTextExtent( "XXX.XXXXXXX mils" );
m_numericTextCtrlSize = dc.GetTextExtent( wxT( "XXX.XXXXXXX mils" ) );
m_numericTextCtrlSize.y = -1; // Use default for the vertical size
// The grid column containing the lock checkbox is kept to a minimal
@ -532,7 +532,7 @@ void PANEL_SETUP_BOARD_STACKUP::synchronizeWithBoard( bool aFullSync )
auto bm_combo = dynamic_cast<wxBitmapComboBox*>( ui_row_item.m_ColorCtrl );
int selected = 0; // The "not specified" item
if( item->GetColor().StartsWith( "#" ) ) // User defined color
if( item->GetColor().StartsWith( wxT( "#" ) ) ) // User defined color
{
COLOR4D custom_color( item->GetColor() );
@ -703,7 +703,8 @@ BOARD_STACKUP_ROW_UI_ITEM PANEL_SETUP_BOARD_STACKUP::createRowData( int aRow,
if( item->GetSublayersCount() > 1 )
{
lname << " (" << aSublayerIdx+1 << "/" << item->GetSublayersCount() << ")";
lname << wxT( " (" ) << aSublayerIdx+1 << wxT( "/" )
<< item->GetSublayersCount() << wxT( ")" );
}
wxStaticText* st_text = new wxStaticText( m_scGridWin, wxID_ANY, lname );
@ -789,7 +790,7 @@ BOARD_STACKUP_ROW_UI_ITEM PANEL_SETUP_BOARD_STACKUP::createRowData( int aRow,
if( item->IsColorEditable() )
{
if( item->GetColor().StartsWith( "#" ) ) // User defined color
if( item->GetColor().StartsWith( wxT( "#" ) ) ) // User defined color
{
ui_row_item.m_UserColor = COLOR4D( item->GetColor() ).ToColour();
}
@ -801,7 +802,7 @@ BOARD_STACKUP_ROW_UI_ITEM PANEL_SETUP_BOARD_STACKUP::createRowData( int aRow,
m_fgGridSizer->Add( bm_combo, 1, wxLEFT|wxRIGHT|wxALIGN_CENTER_VERTICAL|wxEXPAND, 2 );
if( item->GetColor().StartsWith( "#" ) )
if( item->GetColor().StartsWith( wxT( "#" ) ) )
{
selected = GetColorUserDefinedListIdx( item->GetType() );
bm_combo->SetString( selected, item->GetColor() );
@ -1046,7 +1047,7 @@ bool PANEL_SETUP_BOARD_STACKUP::transferDataFromUIToStackup()
success = false;
if( !error_msg.IsEmpty() )
error_msg << "\n";
error_msg << wxT( "\n" );
error_msg << _( "Incorrect value for Loss tg (Loss tg must be positive or null "
"if not used)" );
@ -1093,7 +1094,7 @@ bool PANEL_SETUP_BOARD_STACKUP::transferDataFromUIToStackup()
success = false;
if( !error_msg.IsEmpty() )
error_msg << "\n";
error_msg << wxT( "\n" );
error_msg << _( "A layer thickness is < 0. Fix it" );
}
@ -1444,11 +1445,11 @@ wxColor PANEL_SETUP_BOARD_STACKUP::getColorIconItem( int aRow )
default:
case BS_ITEM_TYPE_UNDEFINED:
wxFAIL_MSG( "PANEL_SETUP_BOARD_STACKUP::getColorIconItem: unrecognized item type" );
wxFAIL_MSG( wxT( "PANEL_SETUP_BOARD_STACKUP::getColorIconItem: unrecognized item type" ) );
break;
}
wxASSERT_MSG( color.IsOk(), "Invalid color in PCB stackup" );
wxASSERT_MSG( color.IsOk(), wxT( "Invalid color in PCB stackup" ) );
return color;
}
@ -1496,7 +1497,7 @@ wxBitmapComboBox* PANEL_SETUP_BOARD_STACKUP::createColorBox( BOARD_STACKUP_ITEM*
// Defined colors have a name, the user color uses HTML notation ( i.e. #FF000080)
if( IsCustomColorIdx( itemType, ii )
&& aStackupItem && aStackupItem->GetColor().StartsWith( "#" ) )
&& aStackupItem && aStackupItem->GetColor().StartsWith( wxT( "#" ) ) )
{
label = aStackupItem->GetColor();
curr_color = COLOR4D( label );

View File

@ -41,10 +41,10 @@
#include <board_stackup_manager/board_stackup.h>
// Keyword used in file to identify the dielectric layer type
#define KEY_CORE "core"
#define KEY_PREPREG "prepreg"
#define KEY_CORE wxT( "core" )
#define KEY_PREPREG wxT( "prepreg" )
#define KEY_COPPER "copper"
#define KEY_COPPER wxT( "copper" )
// key string used for not specified parameters
// Can be translated in dialogs, and is also a keyword outside dialogs

View File

@ -60,7 +60,7 @@ wxString CLEANUP_ITEM::GetErrorText( int aCode, bool aTranslate ) const
case CLEANUP_LINES_TO_RECT: msg = _HKI( "Convert lines to rectangle" ); break;
default:
wxFAIL_MSG( "Missing cleanup item description" );
wxFAIL_MSG( wxT( "Missing cleanup item description" ) );
msg = _HKI( "Unknown cleanup action" );
break;
}

View File

@ -498,25 +498,30 @@ void CN_CONNECTIVITY_ALGO::propagateConnections( BOARD_COMMIT* aCommit, PROPAGAT
{
bool skipConflicts = ( aMode == PROPAGATE_MODE::SKIP_CONFLICTS );
wxLogTrace( "CN", "propagateConnections: propagate skip conflicts? %d", skipConflicts );
wxLogTrace( wxT( "CN" ), wxT( "propagateConnections: propagate skip conflicts? %d" ),
skipConflicts );
for( const auto& cluster : m_connClusters )
{
if( skipConflicts && cluster->IsConflicting() )
{
wxLogTrace( "CN", "Conflicting nets in cluster %p; skipping update", cluster.get() );
wxLogTrace( wxT( "CN" ), wxT( "Conflicting nets in cluster %p; skipping update" ),
cluster.get() );
}
else if( cluster->IsOrphaned() )
{
wxLogTrace( "CN", "Skipping orphaned cluster %p [net: %s]", cluster.get(),
(const char*) cluster->OriginNetName().c_str() );
wxLogTrace( wxT( "CN" ), wxT( "Skipping orphaned cluster %p [net: %s]" ),
cluster.get(),
(const char*) cluster->OriginNetName().c_str() );
}
else if( cluster->HasValidNet() )
{
if( cluster->IsConflicting() )
{
wxLogTrace( "CN", "Conflicting nets in cluster %p; chose %d (%s)", cluster.get(),
cluster->OriginNet(), cluster->OriginNetName() );
wxLogTrace( wxT( "CN" ), wxT( "Conflicting nets in cluster %p; chose %d (%s)" ),
cluster.get(),
cluster->OriginNet(),
cluster->OriginNetName() );
}
// normal cluster: just propagate from the pads
@ -542,15 +547,19 @@ void CN_CONNECTIVITY_ALGO::propagateConnections( BOARD_COMMIT* aCommit, PROPAGAT
if( n_changed )
{
wxLogTrace( "CN", "Cluster %p : net : %d %s", cluster.get(),
cluster->OriginNet(), (const char*) cluster->OriginNetName().c_str() );
wxLogTrace( wxT( "CN" ), wxT( "Cluster %p : net : %d %s" ),
cluster.get(),
cluster->OriginNet(),
(const char*) cluster->OriginNetName().c_str() );
}
else
wxLogTrace( "CN", "Cluster %p : nothing to propagate", cluster.get() );
wxLogTrace( wxT( "CN" ), wxT( "Cluster %p : nothing to propagate" ),
cluster.get() );
}
else
{
wxLogTrace( "CN", "Cluster %p : connected to unused net", cluster.get() );
wxLogTrace( wxT( "CN" ), wxT( "Cluster %p : connected to unused net" ),
cluster.get() );
}
}
}
@ -590,7 +599,7 @@ void CN_CONNECTIVITY_ALGO::FindIsolatedCopperIslands( ZONE* aZone, PCB_LAYER_ID
}
}
wxLogTrace( "CN", "Found %u isolated islands\n", (unsigned)aIslands.size() );
wxLogTrace( wxT( "CN" ), wxT( "Found %u isolated islands\n" ), (unsigned) aIslands.size() );
}
void CN_CONNECTIVITY_ALGO::FindIsolatedCopperIslands( std::vector<CN_ZONE_ISOLATED_ISLAND_LIST>& aZones )

View File

@ -644,7 +644,7 @@ bool CONNECTIVITY_DATA::TestTrackEndpointDangling( PCB_TRACK* aTrack, VECTOR2I*
// Not in the connectivity system. This is a bug!
if( items.empty() )
{
wxFAIL_MSG( "track not in connectivity system" );
wxFAIL_MSG( wxT( "track not in connectivity system" ) );
return false;
}
@ -737,7 +737,7 @@ bool CONNECTIVITY_DATA::TestTrackEndpointDangling( PCB_TRACK* aTrack, VECTOR2I*
}
else
{
wxFAIL_MSG( "CONNECTIVITY_DATA::TestTrackEndpointDangling: unknown track type" );
wxFAIL_MSG( wxT( "CONNECTIVITY_DATA::TestTrackEndpointDangling: unknown track type" ) );
}
return false;

View File

@ -160,7 +160,7 @@ void CN_ITEM::Dump()
for( CN_ITEM* i : m_connected )
{
PCB_TRACK* t = static_cast<PCB_TRACK*>( i->Parent() );
wxLogDebug( " - %p %d\n", t, t->Type() );
wxLogDebug( wxT( " - %p %d\n" ), t, t->Type() );
}
}
@ -458,12 +458,12 @@ void CN_CLUSTER::Dump()
{
for( auto item : m_items )
{
wxLogTrace( "CN", " - item : %p bitem : %p type : %d inet %s\n",
wxLogTrace( wxT( "CN" ), wxT( " - item : %p bitem : %p type : %d inet %s\n" ),
item,
item->Parent(),
item->Parent()->Type(),
(const char*) item->Parent()->GetNetname().c_str() );
wxLogTrace( "CN", "- item : %p bitem : %p type : %d inet %s\n",
wxLogTrace( wxT( "CN" ), wxT( "- item : %p bitem : %p type : %d inet %s\n" ),
item,
item->Parent(),
item->Parent()->Type(),

View File

@ -39,7 +39,7 @@ void FROM_TO_CACHE::buildEndpointList( )
for( PAD* pad : footprint->Pads() )
{
FT_ENDPOINT ent;
ent.name = footprint->GetReference() + "-" + pad->GetNumber();
ent.name = footprint->GetReference() + wxT( "-" ) + pad->GetNumber();
ent.parent = pad;
m_ftEndpoints.push_back( ent );
ent.name = footprint->GetReference();
@ -140,7 +140,8 @@ int FROM_TO_CACHE::cacheFromToPaths( const wxString& aFrom, const wxString& aTo
int count = 0;
auto netName = path.from->GetNetname();
wxString fromName = path.from->GetParent()->GetReference() + "-" + path.from->GetNumber();
wxString fromName = path.from->GetParent()->GetReference() + wxT( "-" )
+ path.from->GetNumber();
const KICAD_T onlyRouting[] = { PCB_PAD_T, PCB_ARC_T, PCB_VIA_T, PCB_TRACE_T, EOT };
@ -157,7 +158,7 @@ int FROM_TO_CACHE::cacheFromToPaths( const wxString& aFrom, const wxString& aTo
const PAD *pad = static_cast<const PAD*>( pitem );
wxString toName = pad->GetParent()->GetReference() + "-" + pad->GetNumber();
wxString toName = pad->GetParent()->GetReference() + wxT( "-" ) + pad->GetNumber();
for ( const auto& endpoint : m_ftEndpoints )

View File

@ -953,13 +953,15 @@ bool isCopperOutside( const FOOTPRINT* aMod, SHAPE_POLY_SET& aShape )
if( poly.OutlineCount() == 0 )
{
VECTOR2I padPos = pad->GetPosition();
wxLogTrace( traceBoardOutline, "Tested pad (%d, %d): outside", padPos.x, padPos.y );
wxLogTrace( traceBoardOutline, wxT( "Tested pad (%d, %d): outside" ),
padPos.x, padPos.y );
padOutside = true;
break;
}
VECTOR2I padPos = pad->GetPosition();
wxLogTrace( traceBoardOutline, "Tested pad (%d, %d): not outside", padPos.x, padPos.y );
wxLogTrace( traceBoardOutline, wxT( "Tested pad (%d, %d): not outside" ),
padPos.x, padPos.y );
}
return padOutside;
@ -1021,7 +1023,7 @@ int findEndSegments( SHAPE_LINE_CHAIN& aChain, SEG& aStartSeg, SEG& aEndSeg )
if( foundSegs == 0 )
{
// The first segment we encounter is the "start" segment
wxLogTrace( traceBoardOutline, "Found start segment: (%d, %d)-(%d, %d)",
wxLogTrace( traceBoardOutline, wxT( "Found start segment: (%d, %d)-(%d, %d)" ),
seg.A.x, seg.A.y, seg.B.x, seg.B.y );
aStartSeg = seg;
foundSegs++;
@ -1029,7 +1031,7 @@ int findEndSegments( SHAPE_LINE_CHAIN& aChain, SEG& aStartSeg, SEG& aEndSeg )
else
{
// Once we find both start and end, we can stop
wxLogTrace( traceBoardOutline, "Found end segment: (%d, %d)-(%d, %d)",
wxLogTrace( traceBoardOutline, wxT( "Found end segment: (%d, %d)-(%d, %d)" ),
seg.A.x, seg.A.y, seg.B.x, seg.B.y );
aEndSeg = seg;
foundSegs++;
@ -1061,7 +1063,7 @@ bool BuildFootprintPolygonOutlines( BOARD* aBoard, SHAPE_POLY_SET& aOutlines, in
// No footprint loaded
if( !footprint )
{
wxLogTrace( traceBoardOutline, "No footprint found on board" );
wxLogTrace( traceBoardOutline, wxT( "No footprint found on board" ) );
return false;
}
@ -1091,12 +1093,12 @@ bool BuildFootprintPolygonOutlines( BOARD* aBoard, SHAPE_POLY_SET& aOutlines, in
// A closed outline was found on Edge_Cuts
if( success )
{
wxLogTrace( traceBoardOutline, "Closed outline found" );
wxLogTrace( traceBoardOutline, wxT( "Closed outline found" ) );
// If copper is outside a closed polygon, treat it as a hole
if( isCopperOutside( footprint, outlines ) )
{
wxLogTrace( traceBoardOutline, "Treating outline as a hole" );
wxLogTrace( traceBoardOutline, wxT( "Treating outline as a hole" ) );
buildBoardBoundingBoxPoly( aBoard, aOutlines );
@ -1120,7 +1122,7 @@ bool BuildFootprintPolygonOutlines( BOARD* aBoard, SHAPE_POLY_SET& aOutlines, in
// If all copper is inside, then the computed outline is the board outline
else
{
wxLogTrace( traceBoardOutline, "Treating outline as board edge" );
wxLogTrace( traceBoardOutline, wxT( "Treating outline as board edge" ) );
aOutlines = outlines;
}
@ -1129,7 +1131,7 @@ bool BuildFootprintPolygonOutlines( BOARD* aBoard, SHAPE_POLY_SET& aOutlines, in
// No board outlines were found, so use the bounding box
else if( outlines.OutlineCount() == 0 )
{
wxLogTrace( traceBoardOutline, "Using footprint bounding box" );
wxLogTrace( traceBoardOutline, wxT( "Using footprint bounding box" ) );
buildBoardBoundingBoxPoly( aBoard, aOutlines );
return true;
@ -1137,7 +1139,7 @@ bool BuildFootprintPolygonOutlines( BOARD* aBoard, SHAPE_POLY_SET& aOutlines, in
// There is an outline present, but it is not closed
else
{
wxLogTrace( traceBoardOutline, "Trying to build outline" );
wxLogTrace( traceBoardOutline, wxT( "Trying to build outline" ) );
std::vector<SHAPE_LINE_CHAIN> closedChains;
std::vector<SHAPE_LINE_CHAIN> openChains;
@ -1152,12 +1154,12 @@ bool BuildFootprintPolygonOutlines( BOARD* aBoard, SHAPE_POLY_SET& aOutlines, in
if( hole.IsClosed() )
{
wxLogTrace( traceBoardOutline, "Found closed hole" );
wxLogTrace( traceBoardOutline, wxT( "Found closed hole" ) );
closedChains.push_back( hole );
}
else
{
wxLogTrace( traceBoardOutline, "Found open hole" );
wxLogTrace( traceBoardOutline, wxT( "Found open hole" ) );
openChains.push_back( hole );
}
}
@ -1184,7 +1186,7 @@ bool BuildFootprintPolygonOutlines( BOARD* aBoard, SHAPE_POLY_SET& aOutlines, in
if( chain.SegmentCount() == 0 )
{
// Something is wrong, bail out with the overall footprint bounding box
wxLogTrace( traceBoardOutline, "No line segments in provided outline" );
wxLogTrace( traceBoardOutline, wxT( "No line segments in provided outline" ) );
aOutlines = bbox;
return true;
}
@ -1192,7 +1194,7 @@ bool BuildFootprintPolygonOutlines( BOARD* aBoard, SHAPE_POLY_SET& aOutlines, in
{
// This case means there is only 1 line segment making up the edge cuts of the
// footprint, so we just need to use it to cut the bounding box in half.
wxLogTrace( traceBoardOutline, "Only 1 line segment in provided outline" );
wxLogTrace( traceBoardOutline, wxT( "Only 1 line segment in provided outline" ) );
startSeg = chain.Segment( 0 );
@ -1205,7 +1207,8 @@ bool BuildFootprintPolygonOutlines( BOARD* aBoard, SHAPE_POLY_SET& aOutlines, in
if( inter0 && inter2 && !inter1 && !inter3 )
{
// Intersects the vertical rectangle sides only
wxLogTrace( traceBoardOutline, "Segment intersects only vertical bbox sides" );
wxLogTrace( traceBoardOutline, wxT( "Segment intersects only vertical bbox "
"sides" ) );
// The upper half
upper.Append( *inter0 );
@ -1224,7 +1227,8 @@ bool BuildFootprintPolygonOutlines( BOARD* aBoard, SHAPE_POLY_SET& aOutlines, in
else if( inter1 && inter3 && !inter0 && !inter2 )
{
// Intersects the horizontal rectangle sides only
wxLogTrace( traceBoardOutline, "Segment intersects only horizontal bbox sides" );
wxLogTrace( traceBoardOutline, wxT( "Segment intersects only horizontal bbox "
"sides" ) );
// The left half
upper.Append( *inter1 );
@ -1243,7 +1247,8 @@ bool BuildFootprintPolygonOutlines( BOARD* aBoard, SHAPE_POLY_SET& aOutlines, in
else
{
// Angled line segment that cuts across a corner
wxLogTrace( traceBoardOutline, "Segment intersects two perpendicular bbox sides" );
wxLogTrace( traceBoardOutline, wxT( "Segment intersects two perpendicular bbox "
"sides" ) );
// Figure out which actual lines are intersected, since IntersectLines assumes
// an infinite line
@ -1255,7 +1260,7 @@ bool BuildFootprintPolygonOutlines( BOARD* aBoard, SHAPE_POLY_SET& aOutlines, in
if( hit0 && hit1 )
{
// Cut across the upper left corner
wxLogTrace( traceBoardOutline, "Segment cuts upper left corner" );
wxLogTrace( traceBoardOutline, wxT( "Segment cuts upper left corner" ) );
// The upper half
upper.Append( *inter0 );
@ -1274,7 +1279,7 @@ bool BuildFootprintPolygonOutlines( BOARD* aBoard, SHAPE_POLY_SET& aOutlines, in
else if( hit1 && hit2 )
{
// Cut across the upper right corner
wxLogTrace( traceBoardOutline, "Segment cuts upper right corner" );
wxLogTrace( traceBoardOutline, wxT( "Segment cuts upper right corner" ) );
// The upper half
upper.Append( *inter1 );
@ -1293,7 +1298,7 @@ bool BuildFootprintPolygonOutlines( BOARD* aBoard, SHAPE_POLY_SET& aOutlines, in
else if( hit2 && hit3 )
{
// Cut across the lower right corner
wxLogTrace( traceBoardOutline, "Segment cuts lower right corner" );
wxLogTrace( traceBoardOutline, wxT( "Segment cuts lower right corner" ) );
// The upper half
upper.Append( *inter2 );
@ -1312,7 +1317,7 @@ bool BuildFootprintPolygonOutlines( BOARD* aBoard, SHAPE_POLY_SET& aOutlines, in
else
{
// Cut across the lower left corner
wxLogTrace( traceBoardOutline, "Segment cuts upper left corner" );
wxLogTrace( traceBoardOutline, wxT( "Segment cuts upper left corner" ) );
// The upper half
upper.Append( *inter0 );
@ -1333,7 +1338,7 @@ bool BuildFootprintPolygonOutlines( BOARD* aBoard, SHAPE_POLY_SET& aOutlines, in
else
{
// More than 1 segment
wxLogTrace( traceBoardOutline, "Multiple segments in outline" );
wxLogTrace( traceBoardOutline, wxT( "Multiple segments in outline" ) );
// Just a temporary thing
aOutlines = bbox;
@ -1352,19 +1357,19 @@ bool BuildFootprintPolygonOutlines( BOARD* aBoard, SHAPE_POLY_SET& aOutlines, in
if( isCopperOutside( footprint, poly1 ) )
{
wxLogTrace( traceBoardOutline, "Using lower shape" );
wxLogTrace( traceBoardOutline, wxT( "Using lower shape" ) );
aOutlines = poly2;
}
else
{
wxLogTrace( traceBoardOutline, "Using upper shape" );
wxLogTrace( traceBoardOutline, wxT( "Using upper shape" ) );
aOutlines = poly1;
}
// Add all closed polys as holes to the main outline
for( SHAPE_LINE_CHAIN& closedChain : closedChains )
{
wxLogTrace( traceBoardOutline, "Adding hole to main outline" );
wxLogTrace( traceBoardOutline, wxT( "Adding hole to main outline" ) );
aOutlines.AddHole( closedChain, -1 );
}

View File

@ -115,7 +115,7 @@ void PCB_EDIT_FRAME::ExecuteRemoteCommand( const char* cmdline )
if( !crossProbingSettings.auto_highlight )
return;
wxStringTokenizer netsTok = wxStringTokenizer( FROM_UTF8( text ), "," );
wxStringTokenizer netsTok = wxStringTokenizer( FROM_UTF8( text ), wxT( "," ) );
bool first = true;
while( netsTok.HasMoreTokens() )

View File

@ -492,7 +492,7 @@ static bool ModuleCompare( const RefDesInfo& aA, const RefDesInfo& aB )
wxString DIALOG_BOARD_REANNOTATE::CoordTowxString( int aX, int aY )
{
return wxString::Format( "%s, %s",
return wxString::Format( wxT( "%s, %s" ),
MessageTextFromValue( m_units, aX ),
MessageTextFromValue( m_units, aY ) );
}
@ -522,14 +522,14 @@ void DIALOG_BOARD_REANNOTATE::LogChangePlan()
(int) m_refDesTypes.size() );
for( RefDesTypeStr Type : m_refDesTypes ) // Show all the types of refdes
message += Type.RefDesType + ( 0 == ( i++ % 16 ) ? "\n" : " " );
message += Type.RefDesType + ( 0 == ( i++ % 16 ) ? wxT( "\n" ) : wxS( " " ) );
if( !m_excludeArray.empty() )
{
wxString excludes;
for( wxString& exclude : m_excludeArray ) // Show the refdes we are excluding
excludes += exclude + " ";
excludes += exclude + wxS( " " );
message += wxString::Format( _( "\nExcluding: %s from reannotation\n\n" ), excludes );
}
@ -538,10 +538,12 @@ void DIALOG_BOARD_REANNOTATE::LogChangePlan()
for( const RefDesChange& change : m_changeArray )
{
message += wxString::Format(
"%s -> %s %s %s\n", change.OldRefDesString, change.NewRefDes,
ActionMessage[change.Action],
UpdateRefDes != change.Action ? _( " will be ignored" ) : wxT( "" ) );
message += wxString::Format( wxT( "%s -> %s %s %s\n" ),
change.OldRefDesString,
change.NewRefDes,
ActionMessage[change.Action],
UpdateRefDes != change.Action ? _( " will be ignored" )
: wxT( "" ) );
}
ShowReport( message, RPT_SEVERITY_INFO );
@ -591,17 +593,17 @@ bool DIALOG_BOARD_REANNOTATE::ReannotateBoard()
if( !BuildFootprintList( BadRefDes ) )
{
ShowReport( "Selected options resulted in errors! Change them and try again.",
ShowReport( _( "Selected options resulted in errors! Change them and try again." ),
RPT_SEVERITY_ERROR );
return false;
}
if( !BadRefDes.empty() )
{
message.Printf(
_( "\nPCB has %d empty or invalid reference designations."
"\nRecommend running DRC with 'Test for parity between PCB and schematic' checked.\n" ),
(int) BadRefDes.size() );
message.Printf( _( "\nPCB has %d empty or invalid reference designations."
"\nRecommend running DRC with 'Test for parity between PCB and "
"schematic' checked.\n" ),
(int) BadRefDes.size() );
for( const RefDesInfo& mod : BadRefDes )
{
@ -612,7 +614,7 @@ bool DIALOG_BOARD_REANNOTATE::ReannotateBoard()
CoordTowxString( mod.x, mod.y ) );
}
ShowReport( message + badrefdes + "\n", RPT_SEVERITY_WARNING );
ShowReport( message + badrefdes + wxT( "\n" ), RPT_SEVERITY_WARNING );
message += _( "Reannotate anyway?" );
if( !IsOK( m_frame, message ) )
@ -633,7 +635,7 @@ bool DIALOG_BOARD_REANNOTATE::ReannotateBoard()
m_frame->GetCanvas()->GetView()->Update( footprint ); // Touch the footprint
}
commit.Push( "Geographic reannotation" );
commit.Push( wxT( "Geographic reannotation" ) );
return true;
}
@ -707,7 +709,7 @@ bool DIALOG_BOARD_REANNOTATE::BuildFootprintList( std::vector<RefDesInfo>& aBadR
}
else
{
firstnum = fpData.RefDesString.find_first_of( "0123456789" );
firstnum = fpData.RefDesString.find_first_of( wxT( "0123456789" ) );
if( std::string::npos == firstnum )
fpData.Action = InvalidRefDes; // do not change ref des such as 12 or +1, or L
@ -797,7 +799,7 @@ bool DIALOG_BOARD_REANNOTATE::BuildFootprintList( std::vector<RefDesInfo>& aBadR
{
if( m_changeArray[i].NewRefDes == m_changeArray[j].NewRefDes )
{
ShowReport( "Duplicate instances of " + m_changeArray[j].NewRefDes,
ShowReport( _( "Duplicate instances of " ) + m_changeArray[j].NewRefDes,
RPT_SEVERITY_ERROR );
if( errorcount++ > MAXERROR )

View File

@ -122,8 +122,8 @@ DIALOG_BOARD_STATISTICS::DIALOG_BOARD_STATISTICS( PCB_EDIT_FRAME* aParentFrame )
if( !s_savedDialogState.saveReportInitialized
|| s_savedDialogState.m_project != Prj().GetProjectFullName() )
{
fn.SetName( fn.GetName() + "_report" );
fn.SetExt( "txt" );
fn.SetName( fn.GetName() + wxT( "_report" ) );
fn.SetExt( wxT( "txt" ) );
s_savedDialogState.saveReportName = fn.GetFullName();
s_savedDialogState.saveReportFolder = wxPathOnly( Prj().GetProjectFullName() );
s_savedDialogState.m_project = Prj().GetProjectFullName();
@ -372,7 +372,7 @@ void DIALOG_BOARD_STATISTICS::updateWidets()
}
m_gridPads->SetCellValue( currentRow, COL_LABEL, _( "Total:" ) );
m_gridPads->SetCellValue( currentRow, COL_AMOUNT, wxString::Format( "%i ", totalPads ) );
m_gridPads->SetCellValue( currentRow, COL_AMOUNT, wxString::Format( wxT( "%i " ), totalPads ) );
int totalVias = 0;
currentRow = 0;
@ -380,13 +380,13 @@ void DIALOG_BOARD_STATISTICS::updateWidets()
for( const auto& type : m_viasTypes )
{
m_gridVias->SetCellValue( currentRow, COL_LABEL, type.title );
m_gridVias->SetCellValue( currentRow, COL_AMOUNT, wxString::Format( "%i ", type.qty ) );
m_gridVias->SetCellValue( currentRow, COL_AMOUNT, wxString::Format( wxT( "%i " ), type.qty ) );
totalVias += type.qty;
currentRow++;
}
m_gridVias->SetCellValue( currentRow, COL_LABEL, _( "Total:" ) );
m_gridVias->SetCellValue( currentRow, COL_AMOUNT, wxString::Format( "%i ", totalVias ) );
m_gridVias->SetCellValue( currentRow, COL_AMOUNT, wxString::Format( wxT( "%i " ), totalVias ) );
int totalFront = 0;
@ -398,12 +398,13 @@ void DIALOG_BOARD_STATISTICS::updateWidets()
for( const auto& type : m_componentsTypes )
{
m_gridComponents->SetCellValue( currentRow, COL_LABEL, type.title );
m_gridComponents->SetCellValue(
currentRow, COL_FRONT_SIDE, wxString::Format( "%i ", type.frontSideQty ) );
m_gridComponents->SetCellValue(
currentRow, COL_BOTTOM_SIDE, wxString::Format( "%i ", type.backSideQty ) );
m_gridComponents->SetCellValue( currentRow, COL_FRONT_SIDE,
wxString::Format( wxT( "%i " ), type.frontSideQty ) );
m_gridComponents->SetCellValue( currentRow, COL_BOTTOM_SIDE,
wxString::Format( wxT( "%i " ), type.backSideQty ) );
m_gridComponents->SetCellValue( currentRow, 3,
wxString::Format( wxT( "%i " ), type.frontSideQty + type.backSideQty ) );
wxString::Format( wxT( "%i " ),
type.frontSideQty + type.backSideQty ) );
totalFront += type.frontSideQty;
totalBack += type.backSideQty;
currentRow++;
@ -411,18 +412,20 @@ void DIALOG_BOARD_STATISTICS::updateWidets()
m_gridComponents->SetCellValue( currentRow, COL_LABEL, _( "Total:" ) );
m_gridComponents->SetCellValue( currentRow, COL_FRONT_SIDE,
wxString::Format( "%i ", totalFront ) );
wxString::Format( wxT( "%i " ), totalFront ) );
m_gridComponents->SetCellValue( currentRow, COL_BOTTOM_SIDE,
wxString::Format( "%i ", totalBack ) );
wxString::Format( wxT( "%i " ), totalBack ) );
m_gridComponents->SetCellValue( currentRow, COL_TOTAL,
wxString::Format( "%i ", totalFront + totalBack ) );
wxString::Format( wxT( "%i " ), totalFront + totalBack ) );
if( m_hasOutline )
{
m_gridBoard->SetCellValue( ROW_BOARD_WIDTH, COL_AMOUNT,
MessageTextFromValue( GetUserUnits(), m_boardWidth ) + " " );
MessageTextFromValue( GetUserUnits(),
m_boardWidth ) + wxS( " " ) );
m_gridBoard->SetCellValue( ROW_BOARD_HEIGHT, COL_AMOUNT,
MessageTextFromValue( GetUserUnits(), m_boardHeight ) + " " );
MessageTextFromValue( GetUserUnits(),
m_boardHeight ) + wxS( " " ) );
m_gridBoard->SetCellValue( ROW_BOARD_AREA, COL_AMOUNT,
MessageTextFromValue( GetUserUnits(), m_boardArea, true,
EDA_DATA_TYPE::AREA ) );
@ -482,7 +485,7 @@ void DIALOG_BOARD_STATISTICS::updateDrillGrid()
stopLayerStr = board->GetLayerName( type.stopLayer );
m_gridDrills->SetCellValue(
currentRow, drillType_t::COL_COUNT, wxString::Format( "%i", type.qty ) );
currentRow, drillType_t::COL_COUNT, wxString::Format( wxT( "%i" ), type.qty ) );
m_gridDrills->SetCellValue( currentRow, drillType_t::COL_SHAPE, shapeStr );
m_gridDrills->SetCellValue( currentRow, drillType_t::COL_X_SIZE,
MessageTextFromValue( GetUserUnits(), type.xSize ) );
@ -529,44 +532,44 @@ void DIALOG_BOARD_STATISTICS::printGridToStringAsTable( wxGrid* aGrid, wxString&
// Print column labels.
aStr << "|";
aStr << wxT( "|" );
if( aUseRowLabels )
{
aStr.Append( ' ', rowLabelsWidth );
aStr << " |";
aStr << wxT( " |" );
}
for( int col = 0; col < aGrid->GetNumberCols(); col++ )
{
if( aUseColLabels )
tmp.Printf( " %*s |", widths[col], aGrid->GetColLabelValue( col ) );
tmp.Printf( wxT( " %*s |" ), widths[col], aGrid->GetColLabelValue( col ) );
else
tmp.Printf( " %*s |", widths[col], aGrid->GetCellValue( 0, col ) );
tmp.Printf( wxT( " %*s |" ), widths[col], aGrid->GetCellValue( 0, col ) );
aStr << tmp;
}
aStr << "\n";
aStr << wxT( "\n" );
// Print column label horizontal separators.
aStr << "|";
aStr << wxT( "|" );
if( aUseRowLabels )
{
aStr.Append( '-', rowLabelsWidth );
aStr << "-|";
aStr << wxT( "-|" );
}
for( int col = 0; col < aGrid->GetNumberCols(); col++ )
{
aStr << "-";
aStr << wxT( "-" );
aStr.Append( '-', widths[col] );
aStr << "-|";
aStr << wxT( "-|" );
}
aStr << "\n";
aStr << wxT( "\n" );
// Print regular cells.
@ -581,21 +584,21 @@ void DIALOG_BOARD_STATISTICS::printGridToStringAsTable( wxGrid* aGrid, wxString&
for( int row = firstRow; row < aGrid->GetNumberRows(); row++ )
{
if( aUseRowLabels )
tmp.Printf( "|%-*s |", rowLabelsWidth, aGrid->GetRowLabelValue( row ) );
tmp.Printf( wxT( "|%-*s |" ), rowLabelsWidth, aGrid->GetRowLabelValue( row ) );
else if( aUseFirstColAsLabel )
tmp.Printf( "|%-*s |", widths[0], aGrid->GetCellValue( row, 0 ) );
tmp.Printf( wxT( "|%-*s |" ), widths[0], aGrid->GetCellValue( row, 0 ) );
else
tmp.Printf( "|" );
tmp.Printf( wxT( "|" ) );
aStr << tmp;
for( int col = firstCol; col < aGrid->GetNumberCols(); col++ )
{
tmp.Printf( " %*s |", widths[col], aGrid->GetCellValue( row, col ) );
tmp.Printf( wxT( " %*s |" ), widths[col], aGrid->GetCellValue( row, col ) );
aStr << tmp;
}
aStr << "\n";
aStr << wxT( "\n" );
}
}
@ -655,7 +658,7 @@ void DIALOG_BOARD_STATISTICS::saveReportClicked( wxCommandEvent& aEvent )
s_savedDialogState.saveReportFolder = wxPathOnly( saveFileDialog.GetPath() );
s_savedDialogState.saveReportName = saveFileDialog.GetFilename();
outFile = wxFopen( saveFileDialog.GetPath(), "wt" );
outFile = wxFopen( saveFileDialog.GetPath(), wxT( "wt" ) );
if( outFile == nullptr )
{
@ -664,47 +667,47 @@ void DIALOG_BOARD_STATISTICS::saveReportClicked( wxCommandEvent& aEvent )
return;
}
msg << _( "PCB statistics report\n=====================" ) << "\n";
msg << wxS( "- " ) << _( "Date" ) << wxS( ": " ) << wxDateTime::Now().Format() << "\n";
msg << wxS( "- " ) << _( "Project" ) << wxS( ": " )<< Prj().GetProjectName() << "\n";
msg << wxS( "- " ) << _( "Board name" ) << wxS( ": " )<< boardName << "\n";
msg << _( "PCB statistics report\n=====================" ) << wxT( "\n" );
msg << wxS( "- " ) << _( "Date" ) << wxS( ": " ) << wxDateTime::Now().Format() << wxT( "\n" );
msg << wxS( "- " ) << _( "Project" ) << wxS( ": " )<< Prj().GetProjectName() << wxT( "\n" );
msg << wxS( "- " ) << _( "Board name" ) << wxS( ": " )<< boardName << wxT( "\n" );
msg << "\n";
msg << _( "Board" ) << "\n-----\n";
msg << wxT( "\n" );
msg << _( "Board" ) << wxT( "\n-----\n" );
if( m_hasOutline )
{
msg << wxS( "- " ) << _( "Width" ) << wxS( ": " ) <<
MessageTextFromValue( GetUserUnits(), m_boardWidth ) << "\n";
MessageTextFromValue( GetUserUnits(), m_boardWidth ) << wxT( "\n" );
msg << wxS( "- " ) << _( "Height" ) << wxS( ": " ) <<
MessageTextFromValue( GetUserUnits(), m_boardHeight ) << "\n";
MessageTextFromValue( GetUserUnits(), m_boardHeight ) << wxT( "\n" );
msg << wxS( "- " ) << _( "Area" ) + wxS( ": " ) <<
MessageTextFromValue( GetUserUnits(), m_boardArea, true, EDA_DATA_TYPE::AREA );
msg << "\n";
msg << wxT( "\n" );
}
else
{
msg << wxS( "- " ) << _( "Width" ) << wxS( ": " ) << _( "unknown" ) << "\n";
msg << wxS( "- " ) << _( "Height" ) << wxS( ": " ) << _( "unknown" ) << "\n";
msg << wxS( "- " ) << _( "Area" ) << wxS( ": " ) << _( "unknown" ) << "\n";
msg << wxS( "- " ) << _( "Width" ) << wxS( ": " ) << _( "unknown" ) << wxT( "\n" );
msg << wxS( "- " ) << _( "Height" ) << wxS( ": " ) << _( "unknown" ) << wxT( "\n" );
msg << wxS( "- " ) << _( "Area" ) << wxS( ": " ) << _( "unknown" ) << wxT( "\n" );
}
msg << "\n";
msg << _( "Pads" ) << "\n----\n";
msg << wxT( "\n" );
msg << _( "Pads" ) << wxT( "\n----\n" );
for( auto& type : m_padsTypes )
msg << "- " << type.title << " " << type.qty << "\n";
msg << wxT( "- " ) << type.title << wxS( " " ) << type.qty << wxT( "\n" );
msg << "\n";
msg << _( "Vias" ) << "\n----\n";
msg << wxT( "\n" );
msg << _( "Vias" ) << wxT( "\n----\n" );
for( auto& type : m_viasTypes )
msg << "- " << type.title << " " << type.qty << "\n";
msg << wxT( "- " ) << type.title << wxS( " " ) << type.qty << wxT( "\n" );
// We will save data about components in the table.
// We have to calculate column widths
std::vector<int> widths;
std::vector<wxString> labels{ "", _( "Front Side" ), _( "Back Side" ), _( "Total" ) };
std::vector<wxString> labels{ wxT( "" ), _( "Front Side" ), _( "Back Side" ), _( "Total" ) };
wxString tmp;
widths.reserve( labels.size() );
@ -724,23 +727,23 @@ void DIALOG_BOARD_STATISTICS::saveReportClicked( wxCommandEvent& aEvent )
}
// Get maximum width for other columns
tmp.Printf( "%i", frontTotal );
tmp.Printf( wxT( "%i" ), frontTotal );
widths[1] = std::max<int>( tmp.size(), widths[1] );
tmp.Printf( "%i", backTotal );
tmp.Printf( wxT( "%i" ), backTotal );
widths[2] = std::max<int>( tmp.size(), widths[2] );
tmp.Printf( "%i", frontTotal + backTotal );
tmp.Printf( wxT( "%i" ), frontTotal + backTotal );
widths[3] = std::max<int>( tmp.size(), widths[3] );
//Write components amount to file
msg << "\n";
msg << _( "Components" ) << "\n----------\n";
msg << "\n";
msg << wxT( "\n" );
msg << _( "Components" ) << wxT( "\n----------\n" );
msg << wxT( "\n" );
printGridToStringAsTable( m_gridComponents, msg, false, false, true );
msg << "\n";
msg << _( "Drill holes" ) << "\n-----------\n";
msg << "\n";
msg << wxT( "\n" );
msg << _( "Drill holes" ) << wxT( "\n-----------\n" );
msg << wxT( "\n" );
printGridToStringAsTable( m_gridDrills, msg, false, true, false );

View File

@ -50,9 +50,9 @@ void DIALOG_CONSTRAINTS_REPORTER::DeleteAllPages()
void DIALOG_CONSTRAINTS_REPORTER::OnErrorLinkClicked( wxHtmlLinkEvent& event )
{
if( event.GetLinkInfo().GetHref() == "boardsetup" )
if( event.GetLinkInfo().GetHref() == wxT( "boardsetup" ) )
m_frame->ShowBoardSetupDialog( _( "Custom Rules" ) );
else if( event.GetLinkInfo().GetHref() == "drc" )
else if( event.GetLinkInfo().GetHref() == wxT( "drc" ) )
m_frame->GetToolManager()->RunAction( PCB_ACTIONS::runDRC, true );
}

Some files were not shown because too many files have changed in this diff Show More