More wide-string declarations.

This commit is contained in:
Jeff Young 2022-02-05 02:06:25 +00:00
parent f8ff104003
commit b2e3f03222
45 changed files with 662 additions and 639 deletions

View File

@ -52,14 +52,12 @@ void drcPrintDebugMessage( int level, const wxString& msg, const char *function,
{ {
wxString valueStr; wxString valueStr;
if( wxGetEnv( "DRC_DEBUG", &valueStr ) ) if( wxGetEnv( wxT( "DRC_DEBUG" ), &valueStr ) )
{ {
int setLevel = wxAtoi( valueStr ); int setLevel = wxAtoi( valueStr );
if( level <= setLevel ) if( level <= setLevel )
{ printf( "%-30s:%d | %s\n", function, line, (const char *) msg.c_str() );
printf("%-30s:%d | %s\n", function, line, (const char *) msg.c_str() );
}
} }
} }
@ -141,7 +139,7 @@ std::shared_ptr<DRC_RULE> DRC_ENGINE::createImplicitRule( const wxString& name )
void DRC_ENGINE::loadImplicitRules() void DRC_ENGINE::loadImplicitRules()
{ {
ReportAux( wxString::Format( "Building implicit rules (per-item/class overrides, etc...)" ) ); ReportAux( wxString::Format( wxT( "Building implicit rules (per-item/class overrides, etc...)" ) ) );
BOARD_DESIGN_SETTINGS& bds = m_board->GetDesignSettings(); BOARD_DESIGN_SETTINGS& bds = m_board->GetDesignSettings();
@ -217,7 +215,7 @@ void DRC_ENGINE::loadImplicitRules()
std::shared_ptr<DRC_RULE> uViaRule = createImplicitRule( _( "board setup micro-via constraints" ) ); std::shared_ptr<DRC_RULE> uViaRule = createImplicitRule( _( "board setup micro-via constraints" ) );
uViaRule->m_Condition = new DRC_RULE_CONDITION( "A.Via_Type == 'Micro'" ); uViaRule->m_Condition = new DRC_RULE_CONDITION( wxT( "A.Via_Type == 'Micro'" ) );
DRC_CONSTRAINT uViaDrillConstraint( HOLE_SIZE_CONSTRAINT ); DRC_CONSTRAINT uViaDrillConstraint( HOLE_SIZE_CONSTRAINT );
uViaDrillConstraint.Value().SetMin( bds.m_MicroViasMinDrill ); uViaDrillConstraint.Value().SetMin( bds.m_MicroViasMinDrill );
@ -238,7 +236,7 @@ void DRC_ENGINE::loadImplicitRules()
{ {
std::shared_ptr<DRC_RULE> bbViaRule = createImplicitRule( _( "board setup constraints" ) ); std::shared_ptr<DRC_RULE> bbViaRule = createImplicitRule( _( "board setup constraints" ) );
bbViaRule->m_Condition = new DRC_RULE_CONDITION( "A.Via_Type == 'Blind/buried'" ); bbViaRule->m_Condition = new DRC_RULE_CONDITION( wxT( "A.Via_Type == 'Blind/buried'" ) );
DRC_CONSTRAINT disallowConstraint( DISALLOW_CONSTRAINT ); DRC_CONSTRAINT disallowConstraint( DISALLOW_CONSTRAINT );
disallowConstraint.m_DisallowFlags = DRC_DISALLOW_BB_VIAS; disallowConstraint.m_DisallowFlags = DRC_DISALLOW_BB_VIAS;
@ -262,7 +260,7 @@ void DRC_ENGINE::loadImplicitRules()
netclassRule->m_Name = wxString::Format( _( "netclass '%s'" ), ncName ); netclassRule->m_Name = wxString::Format( _( "netclass '%s'" ), ncName );
netclassRule->m_Implicit = true; netclassRule->m_Implicit = true;
expr = wxString::Format( "A.NetClass == '%s'", ncName ); expr = wxString::Format( wxT( "A.NetClass == '%s'" ), ncName );
netclassRule->m_Condition = new DRC_RULE_CONDITION( expr ); netclassRule->m_Condition = new DRC_RULE_CONDITION( expr );
netclassClearanceRules.push_back( netclassRule ); netclassClearanceRules.push_back( netclassRule );
@ -290,7 +288,8 @@ void DRC_ENGINE::loadImplicitRules()
ncName ); ncName );
netclassRule->m_Implicit = true; netclassRule->m_Implicit = true;
expr = wxString::Format( "A.NetClass == '%s' && A.inDiffPair('*')", ncName ); expr = wxString::Format( wxT( "A.NetClass == '%s' && A.inDiffPair('*')" ),
ncName );
netclassRule->m_Condition = new DRC_RULE_CONDITION( expr ); netclassRule->m_Condition = new DRC_RULE_CONDITION( expr );
netclassItemSpecificRules.push_back( netclassRule ); netclassItemSpecificRules.push_back( netclassRule );
@ -307,7 +306,7 @@ void DRC_ENGINE::loadImplicitRules()
ncName ); ncName );
netclassRule->m_Implicit = true; netclassRule->m_Implicit = true;
expr = wxString::Format( "A.NetClass == '%s'", ncName ); expr = wxString::Format( wxT( "A.NetClass == '%s'" ), ncName );
netclassRule->m_Condition = new DRC_RULE_CONDITION( expr ); netclassRule->m_Condition = new DRC_RULE_CONDITION( expr );
netclassItemSpecificRules.push_back( netclassRule ); netclassItemSpecificRules.push_back( netclassRule );
@ -325,7 +324,7 @@ void DRC_ENGINE::loadImplicitRules()
ncName ); ncName );
netclassRule->m_Implicit = true; netclassRule->m_Implicit = true;
expr = wxString::Format( "A.NetClass == '%s' && AB.isCoupledDiffPair()", expr = wxString::Format( wxT( "A.NetClass == '%s' && AB.isCoupledDiffPair()" ),
ncName ); ncName );
netclassRule->m_Condition = new DRC_RULE_CONDITION( expr ); netclassRule->m_Condition = new DRC_RULE_CONDITION( expr );
netclassItemSpecificRules.push_back( netclassRule ); netclassItemSpecificRules.push_back( netclassRule );
@ -343,7 +342,7 @@ void DRC_ENGINE::loadImplicitRules()
netclassRule->m_Name = wxString::Format( _( "netclass '%s'" ), ncName ); netclassRule->m_Name = wxString::Format( _( "netclass '%s'" ), ncName );
netclassRule->m_Implicit = true; netclassRule->m_Implicit = true;
expr = wxString::Format( "A.NetClass == '%s' && A.Via_Type != 'Micro'", expr = wxString::Format( wxT( "A.NetClass == '%s' && A.Via_Type != 'Micro'" ),
ncName ); ncName );
netclassRule->m_Condition = new DRC_RULE_CONDITION( expr ); netclassRule->m_Condition = new DRC_RULE_CONDITION( expr );
netclassItemSpecificRules.push_back( netclassRule ); netclassItemSpecificRules.push_back( netclassRule );
@ -371,7 +370,7 @@ void DRC_ENGINE::loadImplicitRules()
netclassRule->m_Name = wxString::Format( _( "netclass '%s'" ), ncName ); netclassRule->m_Name = wxString::Format( _( "netclass '%s'" ), ncName );
netclassRule->m_Implicit = true; netclassRule->m_Implicit = true;
expr = wxString::Format( "A.NetClass == '%s' && A.Via_Type == 'Micro'", expr = wxString::Format( wxT( "A.NetClass == '%s' && A.Via_Type == 'Micro'" ),
ncName ); ncName );
netclassRule->m_Condition = new DRC_RULE_CONDITION( expr ); netclassRule->m_Condition = new DRC_RULE_CONDITION( expr );
netclassItemSpecificRules.push_back( netclassRule ); netclassItemSpecificRules.push_back( netclassRule );
@ -446,7 +445,7 @@ void DRC_ENGINE::loadImplicitRules()
else else
rule = createImplicitRule( wxString::Format( _( "keepout area '%s'" ), name ) ); rule = createImplicitRule( wxString::Format( _( "keepout area '%s'" ), name ) );
rule->m_Condition = new DRC_RULE_CONDITION( wxString::Format( "A.insideArea('%s')", rule->m_Condition = new DRC_RULE_CONDITION( wxString::Format( wxT( "A.insideArea('%s')" ),
zone->m_Uuid.AsString() ) ); zone->m_Uuid.AsString() ) );
rule->m_LayerCondition = zone->GetLayerSet(); rule->m_LayerCondition = zone->GetLayerSet();
@ -473,7 +472,7 @@ void DRC_ENGINE::loadImplicitRules()
rule->AddConstraint( disallowConstraint ); rule->AddConstraint( disallowConstraint );
} }
ReportAux( wxString::Format( "Building %d implicit netclass rules", ReportAux( wxString::Format( wxT( "Building %d implicit netclass rules" ),
(int) netclassClearanceRules.size() ) ); (int) netclassClearanceRules.size() ) );
} }
@ -503,7 +502,7 @@ void DRC_ENGINE::loadRules( const wxFileName& aPath )
void DRC_ENGINE::compileRules() void DRC_ENGINE::compileRules()
{ {
ReportAux( wxString::Format( "Compiling Rules (%d rules): ", (int) m_rules.size() ) ); ReportAux( wxString::Format( wxT( "Compiling Rules (%d rules): " ), (int) m_rules.size() ) );
for( std::shared_ptr<DRC_RULE>& rule : m_rules ) for( std::shared_ptr<DRC_RULE>& rule : m_rules )
{ {
@ -538,7 +537,7 @@ void DRC_ENGINE::InitEngine( const wxFileName& aRulePath )
for( DRC_TEST_PROVIDER* provider : m_testProviders ) for( DRC_TEST_PROVIDER* provider : m_testProviders )
{ {
ReportAux( wxString::Format( "Create DRC provider: '%s'", provider->GetName() ) ); ReportAux( wxString::Format( wxT( "Create DRC provider: '%s'" ), provider->GetName() ) );
provider->SetDRCEngine( this ); provider->SetDRCEngine( this );
} }
@ -572,7 +571,7 @@ void DRC_ENGINE::InitEngine( const wxFileName& aRulePath )
} }
catch( PARSE_ERROR& ) catch( PARSE_ERROR& )
{ {
wxFAIL_MSG( "Compiling implicit rules failed." ); wxFAIL_MSG( wxT( "Compiling implicit rules failed." ) );
} }
throw original_parse_error; throw original_parse_error;
@ -655,7 +654,7 @@ void DRC_ENGINE::RunTests( EDA_UNITS aUnits, bool aReportAllTrackErrors, bool aT
for( DRC_TEST_PROVIDER* provider : m_testProviders ) for( DRC_TEST_PROVIDER* provider : m_testProviders )
{ {
ReportAux( wxString::Format( "Run DRC provider: '%s'", provider->GetName() ) ); ReportAux( wxString::Format( wxT( "Run DRC provider: '%s'" ), provider->GetName() ) );
if( !provider->Run() ) if( !provider->Run() )
break; break;
@ -919,10 +918,10 @@ DRC_CONSTRAINT DRC_ENGINE::EvalRules( DRC_CONSTRAINT_T aConstraintType, const BO
switch( c->constraint.m_Type ) switch( c->constraint.m_Type )
{ {
case TRACK_WIDTH_CONSTRAINT: msg = "track width"; break; case TRACK_WIDTH_CONSTRAINT: msg = _( "track width" ); break;
case ANNULAR_WIDTH_CONSTRAINT: msg = "annular width"; break; case ANNULAR_WIDTH_CONSTRAINT: msg = _( "annular width" ); break;
case VIA_DIAMETER_CONSTRAINT: msg = "via diameter"; break; case VIA_DIAMETER_CONSTRAINT: msg = _( "via diameter" ); break;
default: msg = "constraint"; break; default: msg = _( "constraint" ); break;
} }
REPORT( wxString::Format( _( "Checking %s %s: %s." ), REPORT( wxString::Format( _( "Checking %s %s: %s." ),
@ -1370,7 +1369,7 @@ void DRC_ENGINE::ReportViolation( const std::shared_ptr<DRC_ITEM>& aItem, const
if( m_reporter ) if( m_reporter )
{ {
wxString msg = wxString::Format( "Test '%s': %s (code %d)", wxString msg = wxString::Format( wxT( "Test '%s': %s (code %d)" ),
aItem->GetViolatingTest()->GetName(), aItem->GetViolatingTest()->GetName(),
aItem->GetErrorMessage(), aItem->GetErrorMessage(),
aItem->GetErrorCode() ); aItem->GetErrorCode() );
@ -1378,13 +1377,13 @@ void DRC_ENGINE::ReportViolation( const std::shared_ptr<DRC_ITEM>& aItem, const
DRC_RULE* rule = aItem->GetViolatingRule(); DRC_RULE* rule = aItem->GetViolatingRule();
if( rule ) if( rule )
msg += wxString::Format( ", violating rule: '%s'", rule->m_Name ); msg += wxString::Format( wxT( ", violating rule: '%s'" ), rule->m_Name );
m_reporter->Report( msg ); m_reporter->Report( msg );
wxString violatingItemsStr = "Violating items: "; wxString violatingItemsStr = wxT( "Violating items: " );
m_reporter->Report( wxString::Format( " |- violating position (%d, %d)", m_reporter->Report( wxString::Format( wxT( " |- violating position (%d, %d)" ),
aPos.x, aPos.x,
aPos.y ) ); aPos.y ) );
} }
@ -1469,22 +1468,22 @@ int DRC_ENGINE::MatchDpSuffix( const wxString& aNetName, wxString& aComplementNe
} }
else if( ch == '+' ) else if( ch == '+' )
{ {
aComplementNet = "-"; aComplementNet = wxT( "-" );
rv = 1; rv = 1;
} }
else if( ch == '-' ) else if( ch == '-' )
{ {
aComplementNet = "+"; aComplementNet = wxT( "+" );
rv = -1; rv = -1;
} }
else if( ch == 'N' ) else if( ch == 'N' )
{ {
aComplementNet = "P"; aComplementNet = wxT( "P" );
rv = -1; rv = -1;
} }
else if ( ch == 'P' ) else if ( ch == 'P' )
{ {
aComplementNet = "N"; aComplementNet = wxT( "N" );
rv = 1; rv = 1;
} }
else else

View File

@ -343,8 +343,8 @@ void IPC356D_WRITER::Write( const wxString& aFilename )
if( ( file = wxFopen( aFilename, wxT( "wt" ) ) ) == nullptr ) if( ( file = wxFopen( aFilename, wxT( "wt" ) ) ) == nullptr )
{ {
wxString details; wxString details;
details.Printf( "The file %s could not be opened for writing.", aFilename ); details.Printf( wxT( "The file %s could not be opened for writing." ), aFilename );
DisplayErrorMessage( m_parent, "Could not write IPC-356D file!", details ); DisplayErrorMessage( m_parent, wxT( "Could not write IPC-356D file!" ), details );
return; return;
} }

View File

@ -183,14 +183,14 @@ std::string PLACE_FILE_EXPORTER::GenPositionData()
if( layer == B_Cu ) if( layer == B_Cu )
footprint_pos.x = - footprint_pos.x; footprint_pos.x = - footprint_pos.x;
wxString tmp = "\"" + list[ii].m_Reference; wxString tmp = wxT( "\"" ) + list[ii].m_Reference;
tmp << "\"" << csv_sep; tmp << wxT( "\"" ) << csv_sep;
tmp << "\"" << list[ii].m_Value; tmp << wxT( "\"" ) << list[ii].m_Value;
tmp << "\"" << csv_sep; tmp << wxT( "\"" ) << csv_sep;
tmp << "\"" << list[ii].m_Footprint->GetFPID().GetLibItemName().wx_str(); tmp << wxT( "\"" ) << list[ii].m_Footprint->GetFPID().GetLibItemName().wx_str();
tmp << "\"" << csv_sep; tmp << wxT( "\"" ) << csv_sep;
tmp << wxString::Format( "%f%c%f%c%f", tmp << wxString::Format( wxT( "%f%c%f%c%f" ),
footprint_pos.x * conv_unit, footprint_pos.x * conv_unit,
csv_sep, csv_sep,
// Keep the Y axis oriented from bottom to top, // Keep the Y axis oriented from bottom to top,

View File

@ -169,7 +169,7 @@ static std::string GenCADLayerNameFlipped( int aCuCount, PCB_LAYER_ID aId )
static wxString escapeString( const wxString& aString ) static wxString escapeString( const wxString& aString )
{ {
wxString copy( aString ); wxString copy( aString );
copy.Replace( "\"", "\\\"" ); copy.Replace( wxT( "\"" ), wxT( "\\\"" ) );
return copy; return copy;
} }
@ -239,7 +239,7 @@ void PCB_EDIT_FRAME::ExportToGenCAD( wxCommandEvent& aEvent )
if( path.IsEmpty() ) if( path.IsEmpty() )
{ {
wxFileName brdFile = GetBoard()->GetFileName(); wxFileName brdFile = GetBoard()->GetFileName();
brdFile.SetExt( "cad" ); brdFile.SetExt( wxT( "cad" ) );
path = brdFile.GetFullPath(); path = brdFile.GetFullPath();
} }
@ -250,7 +250,7 @@ void PCB_EDIT_FRAME::ExportToGenCAD( wxCommandEvent& aEvent )
path = optionsDialog.GetFileName(); path = optionsDialog.GetFileName();
SetLastPath( LAST_PATH_GENCAD, path ); SetLastPath( LAST_PATH_GENCAD, path );
FILE* file = wxFopen( path, "wt" ); FILE* file = wxFopen( path, wxT( "wt" ) );
if( !file ) if( !file )
{ {
@ -769,7 +769,7 @@ static void CreateShapesSection( FILE* aFile, BOARD* aPcb )
// find an unused name or matching entry // find an unused name or matching entry
do do
{ {
newShapeName = wxString::Format( "%s_%d", shapeName, suffix ); newShapeName = wxString::Format( wxT( "%s_%d" ), shapeName, suffix );
shapeIt = shapes.find( newShapeName ); shapeIt = shapes.find( newShapeName );
++suffix; ++suffix;
} }
@ -820,7 +820,7 @@ static void CreateShapesSection( FILE* aFile, BOARD* aPcb )
while( it != pins.end() ) while( it != pins.end() )
{ {
pinname = wxString::Format( "%s_%d", origPinname, suffix ); pinname = wxString::Format( wxT( "%s_%d" ), origPinname, suffix );
++suffix; ++suffix;
it = pins.find( pinname ); it = pins.find( pinname );
} }
@ -937,13 +937,13 @@ static void CreateSignalsSection( FILE* aFile, BOARD* aPcb )
if( net->GetNetname() == wxEmptyString ) // dummy netlist (no connection) if( net->GetNetname() == wxEmptyString ) // dummy netlist (no connection)
{ {
msg.Printf( "NoConnection%d", NbNoConn++ ); msg.Printf( wxT( "NoConnection%d" ), NbNoConn++ );
} }
if( net->GetNetCode() <= 0 ) // dummy netlist (no connection) if( net->GetNetCode() <= 0 ) // dummy netlist (no connection)
continue; continue;
msg = wxT( "SIGNAL \"" ) + escapeString( net->GetNetname() ) + "\""; msg = wxT( "SIGNAL \"" ) + escapeString( net->GetNetname() ) + wxT( "\"" );
fputs( TO_UTF8( msg ), aFile ); fputs( TO_UTF8( msg ), aFile );
fputs( "\n", aFile ); fputs( "\n", aFile );
@ -1292,7 +1292,7 @@ static void FootprintWriteShape( FILE* aFile, FOOTPRINT* aFootprint, const wxStr
break; break;
default: default:
wxFAIL_MSG( wxString::Format( "Type Edge Module %d invalid.", wxFAIL_MSG( wxString::Format( wxT( "Type Edge Module %d invalid." ),
PtStruct->Type() ) ); PtStruct->Type() ) );
break; break;
} }

View File

@ -396,7 +396,7 @@ bool HYPERLYNX_EXPORTER::writeDevices()
wxString layerName = m_board->GetLayerName( footprint->GetLayer() ); wxString layerName = m_board->GetLayerName( footprint->GetLayer() );
if( ref.IsEmpty() ) if( ref.IsEmpty() )
ref = "EMPTY"; ref = wxT( "EMPTY" );
m_out->Print( 1, "(? REF=\"%s\" L=\"%s\")\n", (const char*) ref.c_str(), m_out->Print( 1, "(? REF=\"%s\" L=\"%s\")\n", (const char*) ref.c_str(),
(const char*) layerName.c_str() ); (const char*) layerName.c_str() );
@ -447,12 +447,12 @@ bool HYPERLYNX_EXPORTER::writeNetObjects( const std::vector<BOARD_ITEM*>& aObjec
wxString ref = pad->GetParent()->GetReference(); wxString ref = pad->GetParent()->GetReference();
if( ref.IsEmpty() ) if( ref.IsEmpty() )
ref = "EMPTY"; ref = wxT( "EMPTY" );
wxString padName = pad->GetNumber(); wxString padName = pad->GetNumber();
if( padName.IsEmpty() ) if( padName.IsEmpty() )
padName = "1"; padName = wxT( "1" );
m_out->Print( 1, "(PIN X=%.10f Y=%.10f R=\"%s.%s\" P=%d)\n", m_out->Print( 1, "(PIN X=%.10f Y=%.10f R=\"%s.%s\" P=%d)\n",

View File

@ -792,7 +792,7 @@ void EXPORTER_PCB_VRML::ExportVrmlFootprint( FOOTPRINT* aFootprint, std::ostream
auto sM = aFootprint->Models().begin(); auto sM = aFootprint->Models().begin();
auto eM = aFootprint->Models().end(); auto eM = aFootprint->Models().end();
wxFileName subdir( m_Subdir3DFpModels, "" ); wxFileName subdir( m_Subdir3DFpModels, wxT( "" ) );
while( sM != eM ) while( sM != eM )
{ {
@ -871,7 +871,7 @@ void EXPORTER_PCB_VRML::ExportVrmlFootprint( FOOTPRINT* aFootprint, std::ostream
wxFileName dstFile; wxFileName dstFile;
dstFile.SetPath( m_Subdir3DFpModels ); dstFile.SetPath( m_Subdir3DFpModels );
dstFile.SetName( srcFile.GetName() ); dstFile.SetName( srcFile.GetName() );
dstFile.SetExt( "wrl" ); dstFile.SetExt( wxT( "wrl" ) );
// copy the file if necessary // copy the file if necessary
wxDateTime srcModTime = srcFile.GetModificationTime(); wxDateTime srcModTime = srcFile.GetModificationTime();
@ -889,7 +889,7 @@ void EXPORTER_PCB_VRML::ExportVrmlFootprint( FOOTPRINT* aFootprint, std::ostream
// copy VRML models and use the scenegraph library to // copy VRML models and use the scenegraph library to
// translate other model types // translate other model types
if( fileExt == "wrl" ) if( fileExt == wxT( "wrl" ) )
{ {
if( !wxCopyFile( srcFile.GetFullPath(), dstFile.GetFullPath() ) ) if( !wxCopyFile( srcFile.GetFullPath(), dstFile.GetFullPath() ) )
continue; continue;
@ -926,14 +926,14 @@ void EXPORTER_PCB_VRML::ExportVrmlFootprint( FOOTPRINT* aFootprint, std::ostream
if( m_UseRelPathIn3DModelFilename ) if( m_UseRelPathIn3DModelFilename )
{ {
wxFileName tmp = dstFile; wxFileName tmp = dstFile;
tmp.SetExt( "" ); tmp.SetExt( wxT( "" ) );
tmp.SetName( "" ); tmp.SetName( wxT( "" ) );
tmp.RemoveLastDir(); tmp.RemoveLastDir();
dstFile.MakeRelativeTo( tmp.GetPath() ); dstFile.MakeRelativeTo( tmp.GetPath() );
} }
wxString fn = dstFile.GetFullPath(); wxString fn = dstFile.GetFullPath();
fn.Replace( "\\", "/" ); fn.Replace( wxT( "\\" ), wxT( "/" ) );
(*aOutputFile) << TO_UTF8( fn ) << "\"\n } ]\n"; (*aOutputFile) << TO_UTF8( fn ) << "\"\n } ]\n";
(*aOutputFile) << " }\n"; (*aOutputFile) << " }\n";
@ -1049,7 +1049,7 @@ bool PCB_EDIT_FRAME::ExportVRML_File( const wxString& aFullFileName, double aMMt
void EXPORTER_PCB_VRML::ExportFp3DModelsAsLinkedFile( const wxString& aFullFileName ) void EXPORTER_PCB_VRML::ExportFp3DModelsAsLinkedFile( const wxString& aFullFileName )
{ {
// check if the 3D Subdir exists - create if not // check if the 3D Subdir exists - create if not
wxFileName subdir( m_Subdir3DFpModels, "" ); wxFileName subdir( m_Subdir3DFpModels, wxT( "" ) );
if( ! subdir.DirExists() ) if( ! subdir.DirExists() )
{ {
@ -1070,7 +1070,7 @@ void EXPORTER_PCB_VRML::ExportFp3DModelsAsLinkedFile( const wxString& aFullFileN
// Begin with the usual VRML boilerplate // Begin with the usual VRML boilerplate
wxString fn = aFullFileName; wxString fn = aFullFileName;
fn.Replace( "\\" , "/" ); fn.Replace( wxT( "\\" ) , wxT( "/" ) );
output_file << "#VRML V2.0 utf8\n"; output_file << "#VRML V2.0 utf8\n";
output_file << "WorldInfo {\n"; output_file << "WorldInfo {\n";
output_file << " title \"" << TO_UTF8( fn ) << " - Generated by Pcbnew\"\n"; output_file << " title \"" << TO_UTF8( fn ) << " - Generated by Pcbnew\"\n";

View File

@ -490,10 +490,10 @@ void EXCELLON_WRITER::writeEXCELLONHeader( DRILL_LAYER_PAIR aLayerPair, TYPE_FIL
{ {
// The next lines in EXCELLON files are comments: // The next lines in EXCELLON files are comments:
wxString msg; wxString msg;
msg << "KiCad " << GetBuildVersion(); msg << wxT( "KiCad " ) << GetBuildVersion();
fprintf( m_file, "; DRILL file {%s} date %s\n", TO_UTF8( msg ), TO_UTF8( DateAndTime() ) ); fprintf( m_file, "; DRILL file {%s} date %s\n", TO_UTF8( msg ), TO_UTF8( DateAndTime() ) );
msg = "; FORMAT={"; msg = wxT( "; FORMAT={" );
// Print precision: // Print precision:
// Note in decimal format the precision is not used. // Note in decimal format the precision is not used.
@ -501,10 +501,10 @@ void EXCELLON_WRITER::writeEXCELLONHeader( DRILL_LAYER_PAIR aLayerPair, TYPE_FIL
if( m_zeroFormat != DECIMAL_FORMAT ) if( m_zeroFormat != DECIMAL_FORMAT )
msg << m_precision.GetPrecisionString(); msg << m_precision.GetPrecisionString();
else else
msg << "-:-"; // in decimal format the precision is irrelevant msg << wxT( "-:-" ); // in decimal format the precision is irrelevant
msg << "/ absolute / "; msg << wxT( "/ absolute / " );
msg << ( m_unitsMetric ? "metric" : "inch" ); msg << ( m_unitsMetric ? wxT( "metric" ) : wxT( "inch" ) );
/* Adding numbers notation format. /* Adding numbers notation format.
* this is same as m_Choice_Zeros_Format strings, but NOT translated * this is same as m_Choice_Zeros_Format strings, but NOT translated
@ -517,29 +517,28 @@ void EXCELLON_WRITER::writeEXCELLONHeader( DRILL_LAYER_PAIR aLayerPair, TYPE_FIL
const wxString zero_fmt[4] = const wxString zero_fmt[4] =
{ {
"decimal", wxT( "decimal" ),
"suppress leading zeros", wxT( "suppress leading zeros" ),
"suppress trailing zeros", wxT( "suppress trailing zeros" ),
"keep zeros" wxT( "keep zeros" )
}; };
msg << zero_fmt[m_zeroFormat] << "}\n"; msg << zero_fmt[m_zeroFormat] << wxT( "}\n" );
fputs( TO_UTF8( msg ), m_file ); fputs( TO_UTF8( msg ), m_file );
// add the structured comment TF.CreationDate: // add the structured comment TF.CreationDate:
// The attribute value must conform to the full version of the ISO 8601 // The attribute value must conform to the full version of the ISO 8601
msg = GbrMakeCreationDateAttributeString( GBR_NC_STRING_FORMAT_NCDRILL ) + "\n"; msg = GbrMakeCreationDateAttributeString( GBR_NC_STRING_FORMAT_NCDRILL ) + wxT( "\n" );
fputs( TO_UTF8( msg ), m_file ); fputs( TO_UTF8( msg ), m_file );
// Add the application name that created the drill file // Add the application name that created the drill file
msg = "; #@! TF.GenerationSoftware,Kicad,Pcbnew,"; msg = wxT( "; #@! TF.GenerationSoftware,Kicad,Pcbnew," );
msg << GetBuildVersion() << "\n"; msg << GetBuildVersion() << wxT( "\n" );
fputs( TO_UTF8( msg ), m_file ); fputs( TO_UTF8( msg ), m_file );
// Add the standard X2 FileFunction for drill files // Add the standard X2 FileFunction for drill files
// TF.FileFunction,Plated[NonPlated],layer1num,layer2num,PTH[NPTH] // TF.FileFunction,Plated[NonPlated],layer1num,layer2num,PTH[NPTH]
msg = BuildFileFunctionAttributeString( aLayerPair, aHolesType , true ) msg = BuildFileFunctionAttributeString( aLayerPair, aHolesType , true ) + wxT( "\n" );
+ "\n";
fputs( TO_UTF8( msg ), m_file ); fputs( TO_UTF8( msg ), m_file );
fputs( "FMAT,2\n", m_file ); // Use Format 2 commands (version used since 1979) fputs( "FMAT,2\n", m_file ); // Use Format 2 commands (version used since 1979)

View File

@ -278,11 +278,11 @@ const wxString GENDRILL_WRITER_BASE::getDrillFileName( DRILL_LAYER_PAIR aPair, b
wxString extend; wxString extend;
if( aNPTH ) if( aNPTH )
extend = "-NPTH"; extend = wxT( "-NPTH" );
else if( aPair == DRILL_LAYER_PAIR( F_Cu, B_Cu ) ) else if( aPair == DRILL_LAYER_PAIR( F_Cu, B_Cu ) )
{ {
if( !aMerge_PTH_NPTH ) if( !aMerge_PTH_NPTH )
extend = "-PTH"; extend = wxT( "-PTH" );
// if merged, extend with nothing // if merged, extend with nothing
} }
else else
@ -369,18 +369,18 @@ const wxString GENDRILL_WRITER_BASE::BuildFileFunctionAttributeString(
wxString text; wxString text;
if( aCompatNCdrill ) if( aCompatNCdrill )
text = "; #@! "; text = wxT( "; #@! " );
else else
text = "%"; text = wxT( "%" );
text << "TF.FileFunction,"; text << wxT( "TF.FileFunction," );
if( aHoleType == NPTH_FILE ) if( aHoleType == NPTH_FILE )
text << "NonPlated,"; text << wxT( "NonPlated," );
else if( aHoleType == MIXED_FILE ) // only for Excellon format else if( aHoleType == MIXED_FILE ) // only for Excellon format
text << "MixedPlating,"; text << wxT( "MixedPlating," );
else else
text << "Plated,"; text << wxT( "Plated," );
int layer1 = aLayerPair.first; int layer1 = aLayerPair.first;
int layer2 = aLayerPair.second; int layer2 = aLayerPair.second;
@ -394,24 +394,24 @@ const wxString GENDRILL_WRITER_BASE::BuildFileFunctionAttributeString(
else else
layer2 += 1; layer2 += 1;
text << layer1 << "," << layer2; text << layer1 << wxT( "," ) << layer2;
// Now add PTH or NPTH or Blind or Buried attribute // Now add PTH or NPTH or Blind or Buried attribute
int toplayer = 1; int toplayer = 1;
int bottomlayer = m_pcb->GetCopperLayerCount(); int bottomlayer = m_pcb->GetCopperLayerCount();
if( aHoleType == NPTH_FILE ) if( aHoleType == NPTH_FILE )
text << ",NPTH"; text << wxT( ",NPTH" );
else if( aHoleType == MIXED_FILE ) // only for Excellon format else if( aHoleType == MIXED_FILE ) // only for Excellon format
{ {
// write nothing // write nothing
} }
else if( layer1 == toplayer && layer2 == bottomlayer ) else if( layer1 == toplayer && layer2 == bottomlayer )
text << ",PTH"; text << wxT( ",PTH" );
else if( layer1 == toplayer || layer2 == bottomlayer ) else if( layer1 == toplayer || layer2 == bottomlayer )
text << ",Blind"; text << wxT( ",Blind" );
else else
text << ",Buried"; text << wxT( ",Buried" );
// In NC drill file, these previous parameters should be enough: // In NC drill file, these previous parameters should be enough:
if( aCompatNCdrill ) if( aCompatNCdrill )
@ -436,16 +436,16 @@ const wxString GENDRILL_WRITER_BASE::BuildFileFunctionAttributeString(
} }
if( hasOblong && hasDrill ) if( hasOblong && hasDrill )
text << ",Mixed"; text << wxT( ",Mixed" );
else if( hasDrill ) else if( hasDrill )
text << ",Drill"; text << wxT( ",Drill" );
else if( hasOblong ) else if( hasOblong )
text << ",Route"; text << wxT( ",Route" );
// else: empty file. // else: empty file.
// End of .FileFunction attribute: // End of .FileFunction attribute:
text << "*%"; text << wxT( "*%" );
return text; return text;
} }

View File

@ -49,7 +49,7 @@ GERBER_WRITER::GERBER_WRITER( BOARD* aPcb )
m_zeroFormat = SUPPRESS_LEADING; m_zeroFormat = SUPPRESS_LEADING;
m_conversionUnits = 1.0; m_conversionUnits = 1.0;
m_unitsMetric = true; m_unitsMetric = true;
m_drillFileExtension = "gbr"; m_drillFileExtension = wxT( "gbr" );
m_merge_PTH_NPTH = false; m_merge_PTH_NPTH = false;
} }
@ -162,7 +162,7 @@ int GERBER_WRITER::createDrillFile( wxString& aFullFilename, bool aIsNpth,
plotter.AddLineToHeader( text ); plotter.AddLineToHeader( text );
// Add file polarity (positive) // Add file polarity (positive)
text = "%TF.FilePolarity,Positive*%"; text = wxT( "%TF.FilePolarity,Positive*%" );
plotter.AddLineToHeader( text ); plotter.AddLineToHeader( text );
if( !plotter.OpenFile( aFullFilename ) ) if( !plotter.OpenFile( aFullFilename ) )
@ -303,7 +303,7 @@ const wxString GERBER_WRITER::getDrillFileName( DRILL_LAYER_PAIR aPair, bool aNP
// Gerber files extension is always .gbr. // Gerber files extension is always .gbr.
// Therefore, to mark drill files, add "-drl" to the filename. // Therefore, to mark drill files, add "-drl" to the filename.
wxFileName fname( GENDRILL_WRITER_BASE::getDrillFileName( aPair, aNPTH, aMerge_PTH_NPTH ) ); wxFileName fname( GENDRILL_WRITER_BASE::getDrillFileName( aPair, aNPTH, aMerge_PTH_NPTH ) );
fname.SetName( fname.GetName() + "-drl" ); fname.SetName( fname.GetName() + wxT( "-drl" ) );
return fname.GetFullPath(); return fname.GetFullPath();
} }

View File

@ -352,21 +352,21 @@ void GERBER_JOBFILE_WRITER::addJSONFilesAttributes()
if( layer <= B_Cu ) if( layer <= B_Cu )
{ {
gbr_layer_id = "Copper,L"; gbr_layer_id = wxT( "Copper,L" );
if( layer == B_Cu ) if( layer == B_Cu )
gbr_layer_id << m_pcb->GetCopperLayerCount(); gbr_layer_id << m_pcb->GetCopperLayerCount();
else else
gbr_layer_id << layer + 1; gbr_layer_id << layer + 1;
gbr_layer_id << ","; gbr_layer_id << wxT( "," );
if( layer == B_Cu ) if( layer == B_Cu )
gbr_layer_id << "Bot"; gbr_layer_id << wxT( "Bot" );
else if( layer == F_Cu ) else if( layer == F_Cu )
gbr_layer_id << "Top"; gbr_layer_id << wxT( "Top" );
else else
gbr_layer_id << "Inr"; gbr_layer_id << wxT( "Inr" );
} }
else else
@ -374,44 +374,44 @@ void GERBER_JOBFILE_WRITER::addJSONFilesAttributes()
switch( layer ) switch( layer )
{ {
case B_Adhes: case B_Adhes:
gbr_layer_id = "Glue,Bot"; gbr_layer_id = wxT( "Glue,Bot" );
break; break;
case F_Adhes: case F_Adhes:
gbr_layer_id = "Glue,Top"; gbr_layer_id = wxT( "Glue,Top" );
break; break;
case B_Paste: case B_Paste:
gbr_layer_id = "SolderPaste,Bot"; gbr_layer_id = wxT( "SolderPaste,Bot" );
break; break;
case F_Paste: case F_Paste:
gbr_layer_id = "SolderPaste,Top"; gbr_layer_id = wxT( "SolderPaste,Top" );
break; break;
case B_SilkS: case B_SilkS:
gbr_layer_id = "Legend,Bot"; gbr_layer_id = wxT( "Legend,Bot" );
break; break;
case F_SilkS: case F_SilkS:
gbr_layer_id = "Legend,Top"; gbr_layer_id = wxT( "Legend,Top" );
break; break;
case B_Mask: case B_Mask:
gbr_layer_id = "SolderMask,Bot"; gbr_layer_id = wxT( "SolderMask,Bot" );
polarity = "Negative"; polarity = "Negative";
break; break;
case F_Mask: case F_Mask:
gbr_layer_id = "SolderMask,Top"; gbr_layer_id = wxT( "SolderMask,Top" );
polarity = "Negative"; polarity = "Negative";
break; break;
case Edge_Cuts: case Edge_Cuts:
gbr_layer_id = "Profile"; gbr_layer_id = wxT( "Profile" );
break; break;
case B_Fab: case B_Fab:
gbr_layer_id = "AssemblyDrawing,Bot"; gbr_layer_id = wxT( "AssemblyDrawing,Bot" );
break; break;
case F_Fab: case F_Fab:
gbr_layer_id = "AssemblyDrawing,Top"; gbr_layer_id = wxT( "AssemblyDrawing,Top" );
break; break;
case Dwgs_User: case Dwgs_User:
@ -426,7 +426,7 @@ void GERBER_JOBFILE_WRITER::addJSONFilesAttributes()
default: default:
skip_file = true; skip_file = true;
m_reporter->Report( "Unexpected layer id in job file", RPT_SEVERITY_ERROR ); m_reporter->Report( wxT( "Unexpected layer id in job file" ), RPT_SEVERITY_ERROR );
break; break;
} }
} }
@ -600,39 +600,39 @@ void GERBER_JOBFILE_WRITER::addJSONMaterialStackup()
switch( item->GetType() ) switch( item->GetType() )
{ {
case BS_ITEM_TYPE_COPPER: case BS_ITEM_TYPE_COPPER:
layer_type = "Copper"; layer_type = wxT( "Copper" );
layer_name = formatStringFromUTF32( m_pcb->GetLayerName( item->GetBrdLayerId() ) ); layer_name = formatStringFromUTF32( m_pcb->GetLayerName( item->GetBrdLayerId() ) );
last_copper_layer = item->GetBrdLayerId(); last_copper_layer = item->GetBrdLayerId();
break; break;
case BS_ITEM_TYPE_SILKSCREEN: case BS_ITEM_TYPE_SILKSCREEN:
layer_type = "Legend"; layer_type = wxT( "Legend" );
layer_name = formatStringFromUTF32( item->GetTypeName() ); layer_name = formatStringFromUTF32( item->GetTypeName() );
break; break;
case BS_ITEM_TYPE_SOLDERMASK: case BS_ITEM_TYPE_SOLDERMASK:
layer_type = "SolderMask"; layer_type = wxT( "SolderMask" );
layer_name = formatStringFromUTF32( item->GetTypeName() ); layer_name = formatStringFromUTF32( item->GetTypeName() );
break; break;
case BS_ITEM_TYPE_SOLDERPASTE: case BS_ITEM_TYPE_SOLDERPASTE:
layer_type = "SolderPaste"; layer_type = wxT( "SolderPaste" );
layer_name = formatStringFromUTF32( item->GetTypeName() ); layer_name = formatStringFromUTF32( item->GetTypeName() );
break; break;
case BS_ITEM_TYPE_DIELECTRIC: case BS_ITEM_TYPE_DIELECTRIC:
layer_type = "Dielectric"; layer_type = wxT( "Dielectric" );
// The option core or prepreg is not added here, as it creates constraints // The option core or prepreg is not added here, as it creates constraints
// in build process, not necessary wanted. // in build process, not necessary wanted.
if( sub_layer_count > 1 ) if( sub_layer_count > 1 )
{ {
layer_name = layer_name =
formatStringFromUTF32( wxString::Format( "dielectric layer %d - %d/%d", formatStringFromUTF32( wxString::Format( wxT( "dielectric layer %d - %d/%d" ),
item->GetDielectricLayerId(), sub_idx + 1, sub_layer_count ) ); item->GetDielectricLayerId(), sub_idx + 1, sub_layer_count ) );
} }
else else
layer_name = formatStringFromUTF32( wxString::Format( layer_name = formatStringFromUTF32( wxString::Format(
"dielectric layer %d", item->GetDielectricLayerId() ) ); wxT( "dielectric layer %d" ), item->GetDielectricLayerId() ) );
break; break;
default: default:
@ -647,11 +647,14 @@ void GERBER_JOBFILE_WRITER::addJSONMaterialStackup()
{ {
wxString colorName = item->GetColor(); wxString colorName = item->GetColor();
if( colorName.StartsWith( "#" ) ) // This is a user defined color. if( colorName.StartsWith( wxT( "#" ) ) ) // This is a user defined color.
{ {
// In job file a color can be given by its RGB values (0...255) // In job file a color can be given by its RGB values (0...255)
wxColor color( COLOR4D( colorName ).ToColour() ); wxColor color( COLOR4D( colorName ).ToColour() );
colorName.Printf( "R%dG%dB%d", color.Red(), color.Green(), color.Blue() ); colorName.Printf( wxT( "R%dG%dB%d" ),
color.Red(),
color.Green(),
color.Blue() );
} }
layer_json["Color"] = colorName; layer_json["Color"] = colorName;
@ -694,9 +697,9 @@ void GERBER_JOBFILE_WRITER::addJSONMaterialStackup()
wxString subLayerName; wxString subLayerName;
if( sub_layer_count > 1 ) if( sub_layer_count > 1 )
subLayerName.Printf( " (%d/%d)", sub_idx + 1, sub_layer_count ); subLayerName.Printf( wxT( " (%d/%d)" ), sub_idx + 1, sub_layer_count );
wxString name = wxString::Format( "%s/%s%s", wxString name = wxString::Format( wxT( "%s/%s%s" ),
formatStringFromUTF32( m_pcb->GetLayerName( last_copper_layer ) ), formatStringFromUTF32( m_pcb->GetLayerName( last_copper_layer ) ),
formatStringFromUTF32( m_pcb->GetLayerName( next_copper_layer ) ), formatStringFromUTF32( m_pcb->GetLayerName( next_copper_layer ) ),
subLayerName ); subLayerName );
@ -706,9 +709,9 @@ void GERBER_JOBFILE_WRITER::addJSONMaterialStackup()
// Add a comment ("Notes"): // Add a comment ("Notes"):
wxString note; wxString note;
note << wxString::Format( "Type: %s", layer_name.c_str() ); note << wxString::Format( wxT( "Type: %s" ), layer_name.c_str() );
note << wxString::Format( " (from %s to %s)", note << wxString::Format( wxT( " (from %s to %s)" ),
formatStringFromUTF32( m_pcb->GetLayerName( last_copper_layer ) ), formatStringFromUTF32( m_pcb->GetLayerName( last_copper_layer ) ),
formatStringFromUTF32( m_pcb->GetLayerName( next_copper_layer ) ) ); formatStringFromUTF32( m_pcb->GetLayerName( next_copper_layer ) ) );

View File

@ -94,13 +94,13 @@ int PLACEFILE_GERBER_WRITER::CreatePlaceFile( wxString& aFullFilename, PCB_LAYER
// Add the standard X2 FileFunction for P&P files // Add the standard X2 FileFunction for P&P files
// %TF.FileFunction,Component,Ln,[top][bottom]*% // %TF.FileFunction,Component,Ln,[top][bottom]*%
wxString text; wxString text;
text.Printf( "%%TF.FileFunction,Component,L%d,%s*%%", text.Printf( wxT( "%%TF.FileFunction,Component,L%d,%s*%%" ),
aLayer == B_Cu ? m_pcb->GetCopperLayerCount() : 1, aLayer == B_Cu ? m_pcb->GetCopperLayerCount() : 1,
aLayer == B_Cu ? "Bot" : "Top" ); aLayer == B_Cu ? wxT( "Bot" ) : wxT( "Top" ) );
plotter.AddLineToHeader( text ); plotter.AddLineToHeader( text );
// Add file polarity (positive) // Add file polarity (positive)
text = "%TF.FilePolarity,Positive*%"; text = wxT( "%TF.FilePolarity,Positive*%" );
plotter.AddLineToHeader( text ); plotter.AddLineToHeader( text );
if( !plotter.OpenFile( aFullFilename ) ) if( !plotter.OpenFile( aFullFilename ) )
@ -334,7 +334,7 @@ void PLACEFILE_GERBER_WRITER::findPads1( std::vector<PAD*>& aPadList, FOOTPRINT*
if( !pad->IsOnLayer( m_layer ) ) if( !pad->IsOnLayer( m_layer ) )
continue; continue;
if( pad->GetNumber() == "1" || pad->GetNumber() == "A1") if( pad->GetNumber() == wxT( "1" ) || pad->GetNumber() == wxT( "A1" ) )
aPadList.push_back( pad ); aPadList.push_back( pad );
} }
} }
@ -347,8 +347,8 @@ const wxString PLACEFILE_GERBER_WRITER::GetPlaceFileName( const wxString& aFullB
// Therefore, to mark pnp files, add "-pnp" to the filename, and a layer id. // Therefore, to mark pnp files, add "-pnp" to the filename, and a layer id.
wxFileName fn = aFullBaseFilename; wxFileName fn = aFullBaseFilename;
wxString post_id = "-pnp_"; wxString post_id = wxT( "-pnp_" );
post_id += aLayer == B_Cu ? "bottom" : "top"; post_id += aLayer == B_Cu ? wxT( "bottom" ) : wxT( "top" );
fn.SetName( fn.GetName() + post_id ); fn.SetName( fn.GetName() + post_id );
fn.SetExt( GerberFileExtension ); fn.SetExt( GerberFileExtension );

View File

@ -355,12 +355,12 @@ bool BOARD_NETLIST_UPDATER::updateFootprintParameters( FOOTPRINT* aPcbFootprint,
m_reporter->Report( msg, RPT_SEVERITY_ACTION ); m_reporter->Report( msg, RPT_SEVERITY_ACTION );
} }
if( ( aNetlistComponent->GetProperties().count( "exclude_from_bom" ) > 0 ) if( ( aNetlistComponent->GetProperties().count( wxT( "exclude_from_bom" ) ) > 0 )
!= ( ( aPcbFootprint->GetAttributes() & FP_EXCLUDE_FROM_BOM ) > 0 ) ) != ( ( aPcbFootprint->GetAttributes() & FP_EXCLUDE_FROM_BOM ) > 0 ) )
{ {
if( m_isDryRun ) if( m_isDryRun )
{ {
if( aNetlistComponent->GetProperties().count( "exclude_from_bom" ) ) if( aNetlistComponent->GetProperties().count( wxT( "exclude_from_bom" ) ) )
{ {
msg.Printf( _( "Add %s 'exclude from BOM' fabrication attribute." ), msg.Printf( _( "Add %s 'exclude from BOM' fabrication attribute." ),
aPcbFootprint->GetReference() ); aPcbFootprint->GetReference() );
@ -375,7 +375,7 @@ bool BOARD_NETLIST_UPDATER::updateFootprintParameters( FOOTPRINT* aPcbFootprint,
{ {
int attributes = aPcbFootprint->GetAttributes(); int attributes = aPcbFootprint->GetAttributes();
if( aNetlistComponent->GetProperties().count( "exclude_from_bom" ) ) if( aNetlistComponent->GetProperties().count( wxT( "exclude_from_bom" ) ) )
{ {
attributes |= FP_EXCLUDE_FROM_BOM; attributes |= FP_EXCLUDE_FROM_BOM;
msg.Printf( _( "Added %s 'exclude from BOM' fabrication attribute." ), msg.Printf( _( "Added %s 'exclude from BOM' fabrication attribute." ),
@ -853,7 +853,7 @@ bool BOARD_NETLIST_UPDATER::UpdateNetlist( NETLIST& aNetlist )
{ {
component = aNetlist.GetComponent( i ); component = aNetlist.GetComponent( i );
if( component->GetProperties().count( "exclude_from_board" ) ) if( component->GetProperties().count( wxT( "exclude_from_board" ) ) )
continue; continue;
msg.Printf( _( "Processing symbol '%s:%s'." ), msg.Printf( _( "Processing symbol '%s:%s'." ),
@ -948,7 +948,7 @@ bool BOARD_NETLIST_UPDATER::UpdateNetlist( NETLIST& aNetlist )
else else
component = aNetlist.GetComponentByReference( footprint->GetReference() ); component = aNetlist.GetComponentByReference( footprint->GetReference() );
if( component && component->GetProperties().count( "exclude_from_board" ) == 0 ) if( component && component->GetProperties().count( wxT( "exclude_from_board" ) ) == 0 )
matched = true; matched = true;
if( doDelete && !matched && footprint->IsLocked() ) if( doDelete && !matched && footprint->IsLocked() )

View File

@ -166,8 +166,9 @@ void KICAD_NETLIST_PARSER::Parse()
if( plevel != 0 ) if( plevel != 0 )
{ {
wxFAIL_MSG( wxString::Format( "KICAD_NETLIST_PARSER::Parse(): bad parenthesis " wxFAIL_MSG( wxString::Format( wxT( "KICAD_NETLIST_PARSER::Parse(): bad parenthesis "
"count (count = %d", plevel ) ); "count (count = %d" ),
plevel ) );
} }
} }

View File

@ -147,20 +147,20 @@ void altium_parse_polygons( std::map<wxString, wxString>& aProps,
{ {
const wxString si = std::to_string( i ); const wxString si = std::to_string( i );
const wxString vxi = "VX" + si; const wxString vxi = wxT( "VX" ) + si;
const wxString vyi = "VY" + si; const wxString vyi = wxT( "VY" ) + si;
if( aProps.find( vxi ) == aProps.end() || aProps.find( vyi ) == aProps.end() ) if( aProps.find( vxi ) == aProps.end() || aProps.find( vyi ) == aProps.end() )
break; // it doesn't seem like we know beforehand how many vertices are inside a polygon break; // it doesn't seem like we know beforehand how many vertices are inside a polygon
const bool isRound = ALTIUM_PARSER::ReadInt( aProps, "KIND" + si, 0 ) != 0; const bool isRound = ALTIUM_PARSER::ReadInt( aProps, wxT( "KIND" ) + si, 0 ) != 0;
const int32_t radius = ALTIUM_PARSER::ReadKicadUnit( aProps, "R" + si, "0mil" ); const int32_t radius = ALTIUM_PARSER::ReadKicadUnit( aProps, wxT( "R" ) + si, wxT( "0mil" ) );
const double sa = ALTIUM_PARSER::ReadDouble( aProps, "SA" + si, 0. ); const double sa = ALTIUM_PARSER::ReadDouble( aProps, wxT( "SA" ) + si, 0. );
const double ea = ALTIUM_PARSER::ReadDouble( aProps, "EA" + si, 0. ); const double ea = ALTIUM_PARSER::ReadDouble( aProps, wxT( "EA" ) + si, 0. );
const VECTOR2I vp = VECTOR2I( ALTIUM_PARSER::ReadKicadUnit( aProps, vxi, "0mil" ), const VECTOR2I vp = VECTOR2I( ALTIUM_PARSER::ReadKicadUnit( aProps, vxi, wxT( "0mil" ) ),
-ALTIUM_PARSER::ReadKicadUnit( aProps, vyi, "0mil" ) ); -ALTIUM_PARSER::ReadKicadUnit( aProps, vyi, wxT( "0mil" ) ) );
const VECTOR2I cp = VECTOR2I( ALTIUM_PARSER::ReadKicadUnit( aProps, "CX" + si, "0mil" ), const VECTOR2I cp = VECTOR2I( ALTIUM_PARSER::ReadKicadUnit( aProps, wxT( "CX" ) + si, wxT( "0mil" ) ),
-ALTIUM_PARSER::ReadKicadUnit( aProps, "CY" + si, "0mil" ) ); -ALTIUM_PARSER::ReadKicadUnit( aProps, wxT( "CY" ) + si, wxT( "0mil" ) ) );
aVertices.emplace_back( isRound, radius, sa, ea, vp, cp ); aVertices.emplace_back( isRound, radius, sa, ea, vp, cp );
} }
@ -171,19 +171,19 @@ ABOARD6::ABOARD6( ALTIUM_PARSER& aReader )
std::map<wxString, wxString> props = aReader.ReadProperties(); std::map<wxString, wxString> props = aReader.ReadProperties();
if( props.empty() ) if( props.empty() )
THROW_IO_ERROR( "Board6 stream has no props!" ); THROW_IO_ERROR( wxT( "Board6 stream has no props!" ) );
sheetpos = VECTOR2I( ALTIUM_PARSER::ReadKicadUnit( props, "SHEETX", "0mil" ), sheetpos = VECTOR2I( ALTIUM_PARSER::ReadKicadUnit( props, wxT( "SHEETX" ), wxT( "0mil" ) ),
-ALTIUM_PARSER::ReadKicadUnit( props, "SHEETY", "0mil" ) ); -ALTIUM_PARSER::ReadKicadUnit( props, wxT( "SHEETY" ), wxT( "0mil" ) ) );
sheetsize = wxSize( ALTIUM_PARSER::ReadKicadUnit( props, "SHEETWIDTH", "0mil" ), sheetsize = wxSize( ALTIUM_PARSER::ReadKicadUnit( props, wxT( "SHEETWIDTH" ), wxT( "0mil" ) ),
ALTIUM_PARSER::ReadKicadUnit( props, "SHEETHEIGHT", "0mil" ) ); ALTIUM_PARSER::ReadKicadUnit( props, wxT( "SHEETHEIGHT" ), wxT( "0mil" ) ) );
layercount = ALTIUM_PARSER::ReadInt( props, "LAYERSETSCOUNT", 1 ) + 1; layercount = ALTIUM_PARSER::ReadInt( props, wxT( "LAYERSETSCOUNT" ), 1 ) + 1;
for( size_t i = 1; i < std::numeric_limits<size_t>::max(); i++ ) for( size_t i = 1; i < std::numeric_limits<size_t>::max(); i++ )
{ {
const wxString layeri = "LAYER" + std::to_string( i ); const wxString layeri = wxT( "LAYER" ) + std::to_string( i );
const wxString layername = layeri + "NAME"; const wxString layername = layeri + wxT( "NAME" );
auto layernameit = props.find( layername ); auto layernameit = props.find( layername );
@ -192,14 +192,14 @@ ABOARD6::ABOARD6( ALTIUM_PARSER& aReader )
ABOARD6_LAYER_STACKUP l; ABOARD6_LAYER_STACKUP l;
l.name = ALTIUM_PARSER::ReadString( props, layername, "" ); l.name = ALTIUM_PARSER::ReadString( props, layername, wxT( "" ) );
l.nextId = ALTIUM_PARSER::ReadInt( props, layeri + "NEXT", 0 ); l.nextId = ALTIUM_PARSER::ReadInt( props, layeri + wxT( "NEXT" ), 0 );
l.prevId = ALTIUM_PARSER::ReadInt( props, layeri + "PREV", 0 ); l.prevId = ALTIUM_PARSER::ReadInt( props, layeri + wxT( "PREV" ), 0 );
l.copperthick = ALTIUM_PARSER::ReadKicadUnit( props, layeri + "COPTHICK", "1.4mil" ); l.copperthick = ALTIUM_PARSER::ReadKicadUnit( props, layeri + wxT( "COPTHICK" ), wxT( "1.4mil" ) );
l.dielectricconst = ALTIUM_PARSER::ReadDouble( props, layeri + "DIELCONST", 0. ); l.dielectricconst = ALTIUM_PARSER::ReadDouble( props, layeri + wxT( "DIELCONST" ), 0. );
l.dielectricthick = ALTIUM_PARSER::ReadKicadUnit( props, layeri + "DIELHEIGHT", "60mil" ); l.dielectricthick = ALTIUM_PARSER::ReadKicadUnit( props, layeri + wxT( "DIELHEIGHT" ), wxT( "60mil" ) );
l.dielectricmaterial = ALTIUM_PARSER::ReadString( props, layeri + "DIELMATERIAL", "FR-4" ); l.dielectricmaterial = ALTIUM_PARSER::ReadString( props, layeri + wxT( "DIELMATERIAL" ), wxT( "FR-4" ) );
stackup.push_back( l ); stackup.push_back( l );
} }
@ -207,7 +207,7 @@ ABOARD6::ABOARD6( ALTIUM_PARSER& aReader )
altium_parse_polygons( props, board_vertices ); altium_parse_polygons( props, board_vertices );
if( aReader.HasParsingError() ) if( aReader.HasParsingError() )
THROW_IO_ERROR( "Board6 stream was not parsed correctly!" ); THROW_IO_ERROR( wxT( "Board6 stream was not parsed correctly!" ) );
} }
ACLASS6::ACLASS6( ALTIUM_PARSER& aReader ) ACLASS6::ACLASS6( ALTIUM_PARSER& aReader )
@ -215,15 +215,15 @@ ACLASS6::ACLASS6( ALTIUM_PARSER& aReader )
std::map<wxString, wxString> properties = aReader.ReadProperties(); std::map<wxString, wxString> properties = aReader.ReadProperties();
if( properties.empty() ) if( properties.empty() )
THROW_IO_ERROR( "Classes6 stream has no properties!" ); THROW_IO_ERROR( wxT( "Classes6 stream has no properties!" ) );
name = ALTIUM_PARSER::ReadString( properties, "NAME", "" ); name = ALTIUM_PARSER::ReadString( properties, wxT( "NAME" ), wxT( "" ) );
uniqueid = ALTIUM_PARSER::ReadString( properties, "UNIQUEID", "" ); uniqueid = ALTIUM_PARSER::ReadString( properties, wxT( "UNIQUEID" ), wxT( "" ) );
kind = static_cast<ALTIUM_CLASS_KIND>( ALTIUM_PARSER::ReadInt( properties, "KIND", -1 ) ); kind = static_cast<ALTIUM_CLASS_KIND>( ALTIUM_PARSER::ReadInt( properties, wxT( "KIND" ), -1 ) );
for( size_t i = 0; i < std::numeric_limits<size_t>::max(); i++ ) for( size_t i = 0; i < std::numeric_limits<size_t>::max(); i++ )
{ {
auto mit = properties.find( "M" + std::to_string( i ) ); auto mit = properties.find( wxT( "M" ) + std::to_string( i ) );
if( mit == properties.end() ) if( mit == properties.end() )
break; // it doesn't seem like we know beforehand how many components are in the netclass break; // it doesn't seem like we know beforehand how many components are in the netclass
@ -232,7 +232,7 @@ ACLASS6::ACLASS6( ALTIUM_PARSER& aReader )
} }
if( aReader.HasParsingError() ) if( aReader.HasParsingError() )
THROW_IO_ERROR( "Classes6 stream was not parsed correctly" ); THROW_IO_ERROR( wxT( "Classes6 stream was not parsed correctly" ) );
} }
ACOMPONENT6::ACOMPONENT6( ALTIUM_PARSER& aReader ) ACOMPONENT6::ACOMPONENT6( ALTIUM_PARSER& aReader )
@ -240,29 +240,29 @@ ACOMPONENT6::ACOMPONENT6( ALTIUM_PARSER& aReader )
std::map<wxString, wxString> props = aReader.ReadProperties(); std::map<wxString, wxString> props = aReader.ReadProperties();
if( props.empty() ) if( props.empty() )
THROW_IO_ERROR( "Components6 stream has no props" ); THROW_IO_ERROR( wxT( "Components6 stream has no props" ) );
layer = altium_layer_from_name( ALTIUM_PARSER::ReadString( props, "LAYER", "" ) ); layer = altium_layer_from_name( ALTIUM_PARSER::ReadString( props, wxT( "LAYER" ), wxT( "" ) ) );
position = VECTOR2I( ALTIUM_PARSER::ReadKicadUnit( props, "X", "0mil" ), position = VECTOR2I( ALTIUM_PARSER::ReadKicadUnit( props, wxT( "X" ), wxT( "0mil" ) ),
-ALTIUM_PARSER::ReadKicadUnit( props, "Y", "0mil" ) ); -ALTIUM_PARSER::ReadKicadUnit( props, wxT( "Y" ), wxT( "0mil" ) ) );
rotation = ALTIUM_PARSER::ReadDouble( props, "ROTATION", 0. ); rotation = ALTIUM_PARSER::ReadDouble( props, wxT( "ROTATION" ), 0. );
locked = ALTIUM_PARSER::ReadBool( props, "LOCKED", false ); locked = ALTIUM_PARSER::ReadBool( props, wxT( "LOCKED" ), false );
nameon = ALTIUM_PARSER::ReadBool( props, "NAMEON", true ); nameon = ALTIUM_PARSER::ReadBool( props, wxT( "NAMEON" ), true );
commenton = ALTIUM_PARSER::ReadBool( props, "COMMENTON", false ); commenton = ALTIUM_PARSER::ReadBool( props, wxT( "COMMENTON" ), false );
sourcedesignator = ALTIUM_PARSER::ReadString( props, "SOURCEDESIGNATOR", "" ); sourcedesignator = ALTIUM_PARSER::ReadString( props, wxT( "SOURCEDESIGNATOR" ), wxT( "" ) );
sourcefootprintlibrary = ALTIUM_PARSER::ReadString( props, "SOURCEFOOTPRINTLIBRARY", "" ); sourcefootprintlibrary = ALTIUM_PARSER::ReadString( props, wxT( "SOURCEFOOTPRINTLIBRARY" ), wxT( "" ) );
pattern = ALTIUM_PARSER::ReadString( props, "PATTERN", "" ); pattern = ALTIUM_PARSER::ReadString( props, wxT( "PATTERN" ), wxT( "" ) );
sourcecomponentlibrary = ALTIUM_PARSER::ReadString( props, "SOURCECOMPONENTLIBRARY", "" ); sourcecomponentlibrary = ALTIUM_PARSER::ReadString( props, wxT( "SOURCECOMPONENTLIBRARY" ), wxT( "" ) );
sourcelibreference = ALTIUM_PARSER::ReadString( props, "SOURCELIBREFERENCE", "" ); sourcelibreference = ALTIUM_PARSER::ReadString( props, wxT( "SOURCELIBREFERENCE" ), wxT( "" ) );
nameautoposition = static_cast<ALTIUM_TEXT_POSITION>( nameautoposition = static_cast<ALTIUM_TEXT_POSITION>(
ALTIUM_PARSER::ReadInt( props, "NAMEAUTOPOSITION", 0 ) ); ALTIUM_PARSER::ReadInt( props, wxT( "NAMEAUTOPOSITION" ), 0 ) );
commentautoposition = static_cast<ALTIUM_TEXT_POSITION>( commentautoposition = static_cast<ALTIUM_TEXT_POSITION>(
ALTIUM_PARSER::ReadInt( props, "COMMENTAUTOPOSITION", 0 ) ); ALTIUM_PARSER::ReadInt( props, wxT( "COMMENTAUTOPOSITION" ), 0 ) );
if( aReader.HasParsingError() ) if( aReader.HasParsingError() )
THROW_IO_ERROR( "Components6 stream was not parsed correctly" ); THROW_IO_ERROR( wxT( "Components6 stream was not parsed correctly" ) );
} }
ADIMENSION6::ADIMENSION6( ALTIUM_PARSER& aReader ) ADIMENSION6::ADIMENSION6( ALTIUM_PARSER& aReader )
@ -272,40 +272,40 @@ ADIMENSION6::ADIMENSION6( ALTIUM_PARSER& aReader )
std::map<wxString, wxString> props = aReader.ReadProperties(); std::map<wxString, wxString> props = aReader.ReadProperties();
if( props.empty() ) if( props.empty() )
THROW_IO_ERROR( "Dimensions6 stream has no props" ); THROW_IO_ERROR( wxT( "Dimensions6 stream has no props" ) );
layer = altium_layer_from_name( ALTIUM_PARSER::ReadString( props, "LAYER", "" ) ); layer = altium_layer_from_name( ALTIUM_PARSER::ReadString( props, wxT( "LAYER" ), wxT( "" ) ) );
kind = static_cast<ALTIUM_DIMENSION_KIND>( ALTIUM_PARSER::ReadInt( props, "DIMENSIONKIND", 0 ) ); kind = static_cast<ALTIUM_DIMENSION_KIND>( ALTIUM_PARSER::ReadInt( props, wxT( "DIMENSIONKIND" ), 0 ) );
textformat = ALTIUM_PARSER::ReadString( props, "TEXTFORMAT", "" ); textformat = ALTIUM_PARSER::ReadString( props, wxT( "TEXTFORMAT" ), wxT( "" ) );
textprefix = ALTIUM_PARSER::ReadString( props, "TEXTPREFIX", "" ); textprefix = ALTIUM_PARSER::ReadString( props, wxT( "TEXTPREFIX" ), wxT( "" ) );
textsuffix = ALTIUM_PARSER::ReadString( props, "TEXTSUFFIX", "" ); textsuffix = ALTIUM_PARSER::ReadString( props, wxT( "TEXTSUFFIX" ), wxT( "" ) );
height = ALTIUM_PARSER::ReadKicadUnit( props, "HEIGHT", "0mil" ); height = ALTIUM_PARSER::ReadKicadUnit( props, wxT( "HEIGHT" ), wxT( "0mil" ) );
angle = ALTIUM_PARSER::ReadDouble( props, "ANGLE", 0. ); angle = ALTIUM_PARSER::ReadDouble( props, wxT( "ANGLE" ), 0. );
linewidth = ALTIUM_PARSER::ReadKicadUnit( props, "LINEWIDTH", "10mil" ); linewidth = ALTIUM_PARSER::ReadKicadUnit( props, wxT( "LINEWIDTH" ), wxT( "10mil" ) );
textheight = ALTIUM_PARSER::ReadKicadUnit( props, "TEXTHEIGHT", "10mil" ); textheight = ALTIUM_PARSER::ReadKicadUnit( props, wxT( "TEXTHEIGHT" ), wxT( "10mil" ) );
textlinewidth = ALTIUM_PARSER::ReadKicadUnit( props, "TEXTLINEWIDTH", "6mil" ); textlinewidth = ALTIUM_PARSER::ReadKicadUnit( props, wxT( "TEXTLINEWIDTH" ), wxT( "6mil" ) );
textprecision = ALTIUM_PARSER::ReadInt( props, "TEXTPRECISION", 2 ); textprecision = ALTIUM_PARSER::ReadInt( props, wxT( "TEXTPRECISION" ), 2 );
textbold = ALTIUM_PARSER::ReadBool( props, "TEXTLINEWIDTH", false ); textbold = ALTIUM_PARSER::ReadBool( props, wxT( "TEXTLINEWIDTH" ), false );
textitalic = ALTIUM_PARSER::ReadBool( props, "ITALIC", false ); textitalic = ALTIUM_PARSER::ReadBool( props, wxT( "ITALIC" ), false );
textgap = ALTIUM_PARSER::ReadKicadUnit( props, "TEXTGAP", "10mil" ); textgap = ALTIUM_PARSER::ReadKicadUnit( props, wxT( "TEXTGAP" ), wxT( "10mil" ) );
arrowsize = ALTIUM_PARSER::ReadKicadUnit( props, "ARROWSIZE", "60mil" ); arrowsize = ALTIUM_PARSER::ReadKicadUnit( props, wxT( "ARROWSIZE" ), wxT( "60mil" ) );
wxString text_position_raw = ALTIUM_PARSER::ReadString( props, "TEXTPOSITION", "" ); wxString text_position_raw = ALTIUM_PARSER::ReadString( props, wxT( "TEXTPOSITION" ), wxT( "" ) );
xy1 = VECTOR2I( ALTIUM_PARSER::ReadKicadUnit( props, "X1", "0mil" ), xy1 = VECTOR2I( ALTIUM_PARSER::ReadKicadUnit( props, wxT( "X1" ), wxT( "0mil" ) ),
-ALTIUM_PARSER::ReadKicadUnit( props, "Y1", "0mil" ) ); -ALTIUM_PARSER::ReadKicadUnit( props, wxT( "Y1" ), wxT( "0mil" ) ) );
int refcount = ALTIUM_PARSER::ReadInt( props, "REFERENCES_COUNT", 0 ); int refcount = ALTIUM_PARSER::ReadInt( props, wxT( "REFERENCES_COUNT" ), 0 );
for( int i = 0; i < refcount; i++ ) for( int i = 0; i < refcount; i++ )
{ {
const std::string refi = "REFERENCE" + std::to_string( i ) + "POINT"; const std::string refi = "REFERENCE" + std::to_string( i ) + "POINT";
referencePoint.emplace_back( ALTIUM_PARSER::ReadKicadUnit( props, refi + "X", "0mil" ), referencePoint.emplace_back( ALTIUM_PARSER::ReadKicadUnit( props, refi + wxT( "X" ), wxT( "0mil" ) ),
-ALTIUM_PARSER::ReadKicadUnit( props, refi + "Y", "0mil" ) ); -ALTIUM_PARSER::ReadKicadUnit( props, refi + wxT( "Y" ), wxT( "0mil" ) ) );
} }
for( size_t i = 1; i < std::numeric_limits<size_t>::max(); i++ ) for( size_t i = 1; i < std::numeric_limits<size_t>::max(); i++ )
@ -317,20 +317,20 @@ ADIMENSION6::ADIMENSION6( ALTIUM_PARSER& aReader )
if( props.find( textix ) == props.end() || props.find( textiy ) == props.end() ) if( props.find( textix ) == props.end() || props.find( textiy ) == props.end() )
break; // it doesn't seem like we know beforehand how many vertices are inside a polygon break; // it doesn't seem like we know beforehand how many vertices are inside a polygon
textPoint.emplace_back( ALTIUM_PARSER::ReadKicadUnit( props, textix, "0mil" ), textPoint.emplace_back( ALTIUM_PARSER::ReadKicadUnit( props, textix, wxT( "0mil" ) ),
-ALTIUM_PARSER::ReadKicadUnit( props, textiy, "0mil" ) ); -ALTIUM_PARSER::ReadKicadUnit( props, textiy, wxT( "0mil" ) ) );
} }
wxString dimensionunit = ALTIUM_PARSER::ReadString( props, "TEXTDIMENSIONUNIT", "Millimeters" ); wxString dimensionunit = ALTIUM_PARSER::ReadString( props, wxT( "TEXTDIMENSIONUNIT" ), wxT( "Millimeters" ) );
if( dimensionunit == "Inches" ) textunit = ALTIUM_UNIT::INCHES; if( dimensionunit == wxT( "Inches" ) ) textunit = ALTIUM_UNIT::INCHES;
else if( dimensionunit == "Mils" ) textunit = ALTIUM_UNIT::MILS; else if( dimensionunit == wxT( "Mils" ) ) textunit = ALTIUM_UNIT::MILS;
else if( dimensionunit == "Millimeters" ) textunit = ALTIUM_UNIT::MILLIMETERS; else if( dimensionunit == wxT( "Millimeters" ) ) textunit = ALTIUM_UNIT::MILLIMETERS;
else if( dimensionunit == "Centimeters" ) textunit = ALTIUM_UNIT::CENTIMETER; else if( dimensionunit == wxT( "Centimeters" ) ) textunit = ALTIUM_UNIT::CENTIMETER;
else textunit = ALTIUM_UNIT::UNKNOWN; else textunit = ALTIUM_UNIT::UNKNOWN;
if( aReader.HasParsingError() ) if( aReader.HasParsingError() )
THROW_IO_ERROR( "Dimensions6 stream was not parsed correctly" ); THROW_IO_ERROR( wxT( "Dimensions6 stream was not parsed correctly" ) );
} }
AMODEL::AMODEL( ALTIUM_PARSER& aReader ) AMODEL::AMODEL( ALTIUM_PARSER& aReader )
@ -338,18 +338,18 @@ AMODEL::AMODEL( ALTIUM_PARSER& aReader )
std::map<wxString, wxString> properties = aReader.ReadProperties(); std::map<wxString, wxString> properties = aReader.ReadProperties();
if( properties.empty() ) if( properties.empty() )
THROW_IO_ERROR( "Model stream has no properties!" ); THROW_IO_ERROR( wxT( "Model stream has no properties!" ) );
name = ALTIUM_PARSER::ReadString( properties, "NAME", "" ); name = ALTIUM_PARSER::ReadString( properties, wxT( "NAME" ), wxT( "" ) );
id = ALTIUM_PARSER::ReadString( properties, "ID", "" ); id = ALTIUM_PARSER::ReadString( properties, wxT( "ID" ), wxT( "" ) );
isEmbedded = ALTIUM_PARSER::ReadBool( properties, "EMBED", false ); isEmbedded = ALTIUM_PARSER::ReadBool( properties, wxT( "EMBED" ), false );
rotation.x = ALTIUM_PARSER::ReadDouble( properties, "ROTX", 0. ); rotation.x = ALTIUM_PARSER::ReadDouble( properties, wxT( "ROTX" ), 0. );
rotation.y = ALTIUM_PARSER::ReadDouble( properties, "ROTY", 0. ); rotation.y = ALTIUM_PARSER::ReadDouble( properties, wxT( "ROTY" ), 0. );
rotation.z = ALTIUM_PARSER::ReadDouble( properties, "ROTZ", 0. ); rotation.z = ALTIUM_PARSER::ReadDouble( properties, wxT( "ROTZ" ), 0. );
if( aReader.HasParsingError() ) if( aReader.HasParsingError() )
THROW_IO_ERROR( "Model stream was not parsed correctly" ); THROW_IO_ERROR( wxT( "Model stream was not parsed correctly" ) );
} }
ANET6::ANET6( ALTIUM_PARSER& aReader ) ANET6::ANET6( ALTIUM_PARSER& aReader )
@ -357,12 +357,12 @@ ANET6::ANET6( ALTIUM_PARSER& aReader )
std::map<wxString, wxString> properties = aReader.ReadProperties(); std::map<wxString, wxString> properties = aReader.ReadProperties();
if( properties.empty() ) if( properties.empty() )
THROW_IO_ERROR( "Nets6 stream has no properties" ); THROW_IO_ERROR( wxT( "Nets6 stream has no properties" ) );
name = ALTIUM_PARSER::ReadString( properties, "NAME", "" ); name = ALTIUM_PARSER::ReadString( properties, wxT( "NAME" ), wxT( "" ) );
if( aReader.HasParsingError() ) if( aReader.HasParsingError() )
THROW_IO_ERROR( "Nets6 stream was not parsed correctly" ); THROW_IO_ERROR( wxT( "Nets6 stream was not parsed correctly" ) );
} }
APOLYGON6::APOLYGON6( ALTIUM_PARSER& aReader ) APOLYGON6::APOLYGON6( ALTIUM_PARSER& aReader )
@ -370,35 +370,35 @@ APOLYGON6::APOLYGON6( ALTIUM_PARSER& aReader )
std::map<wxString, wxString> properties = aReader.ReadProperties(); std::map<wxString, wxString> properties = aReader.ReadProperties();
if( properties.empty() ) if( properties.empty() )
THROW_IO_ERROR( "Polygons6 stream has no properties" ); THROW_IO_ERROR( wxT( "Polygons6 stream has no properties" ) );
layer = altium_layer_from_name( ALTIUM_PARSER::ReadString( properties, "LAYER", "" ) ); layer = altium_layer_from_name( ALTIUM_PARSER::ReadString( properties, wxT( "LAYER" ), wxT( "" ) ) );
net = ALTIUM_PARSER::ReadInt( properties, "NET", ALTIUM_NET_UNCONNECTED ); net = ALTIUM_PARSER::ReadInt( properties, wxT( "NET" ), ALTIUM_NET_UNCONNECTED );
locked = ALTIUM_PARSER::ReadBool( properties, "LOCKED", false ); locked = ALTIUM_PARSER::ReadBool( properties, wxT( "LOCKED" ), false );
// TODO: kind // TODO: kind
gridsize = ALTIUM_PARSER::ReadKicadUnit( properties, "GRIDSIZE", "0mil" ); gridsize = ALTIUM_PARSER::ReadKicadUnit( properties, wxT( "GRIDSIZE" ), wxT( "0mil" ) );
trackwidth = ALTIUM_PARSER::ReadKicadUnit( properties, "TRACKWIDTH", "0mil" ); trackwidth = ALTIUM_PARSER::ReadKicadUnit( properties, wxT( "TRACKWIDTH" ), wxT( "0mil" ) );
minprimlength = ALTIUM_PARSER::ReadKicadUnit( properties, "MINPRIMLENGTH", "0mil" ); minprimlength = ALTIUM_PARSER::ReadKicadUnit( properties, wxT( "MINPRIMLENGTH" ), wxT( "0mil" ) );
useoctagons = ALTIUM_PARSER::ReadBool( properties, "USEOCTAGONS", false ); useoctagons = ALTIUM_PARSER::ReadBool( properties, wxT( "USEOCTAGONS" ), false );
pourindex = ALTIUM_PARSER::ReadInt( properties, "POURINDEX", 0 ); pourindex = ALTIUM_PARSER::ReadInt( properties, wxT( "POURINDEX" ), 0 );
wxString hatchstyleraw = ALTIUM_PARSER::ReadString( properties, "HATCHSTYLE", "" ); wxString hatchstyleraw = ALTIUM_PARSER::ReadString( properties, wxT( "HATCHSTYLE" ), wxT( "" ) );
if( hatchstyleraw == "Solid" ) hatchstyle = ALTIUM_POLYGON_HATCHSTYLE::SOLID; if( hatchstyleraw == wxT( "Solid" ) ) hatchstyle = ALTIUM_POLYGON_HATCHSTYLE::SOLID;
else if( hatchstyleraw == "45Degree" ) hatchstyle = ALTIUM_POLYGON_HATCHSTYLE::DEGREE_45; else if( hatchstyleraw == wxT( "45Degree" ) ) hatchstyle = ALTIUM_POLYGON_HATCHSTYLE::DEGREE_45;
else if( hatchstyleraw == "90Degree" ) hatchstyle = ALTIUM_POLYGON_HATCHSTYLE::DEGREE_90; else if( hatchstyleraw == wxT( "90Degree" ) ) hatchstyle = ALTIUM_POLYGON_HATCHSTYLE::DEGREE_90;
else if( hatchstyleraw == "Horizontal" ) hatchstyle = ALTIUM_POLYGON_HATCHSTYLE::HORIZONTAL; else if( hatchstyleraw == wxT( "Horizontal" ) ) hatchstyle = ALTIUM_POLYGON_HATCHSTYLE::HORIZONTAL;
else if( hatchstyleraw == "Vertical" ) hatchstyle = ALTIUM_POLYGON_HATCHSTYLE::VERTICAL; else if( hatchstyleraw == wxT( "Vertical" ) ) hatchstyle = ALTIUM_POLYGON_HATCHSTYLE::VERTICAL;
else if( hatchstyleraw == "None" ) hatchstyle = ALTIUM_POLYGON_HATCHSTYLE::NONE; else if( hatchstyleraw == wxT( "None" ) ) hatchstyle = ALTIUM_POLYGON_HATCHSTYLE::NONE;
else hatchstyle = ALTIUM_POLYGON_HATCHSTYLE::UNKNOWN; else hatchstyle = ALTIUM_POLYGON_HATCHSTYLE::UNKNOWN;
altium_parse_polygons( properties, vertices ); altium_parse_polygons( properties, vertices );
if( aReader.HasParsingError() ) if( aReader.HasParsingError() )
THROW_IO_ERROR( "Polygons6 stream was not parsed correctly" ); THROW_IO_ERROR( wxT( "Polygons6 stream was not parsed correctly" ) );
} }
ARULE6::ARULE6( ALTIUM_PARSER& aReader ) ARULE6::ARULE6( ALTIUM_PARSER& aReader )
@ -416,62 +416,62 @@ ARULE6::ARULE6( ALTIUM_PARSER& aReader )
std::map<wxString, wxString> props = aReader.ReadProperties(); std::map<wxString, wxString> props = aReader.ReadProperties();
if( props.empty() ) if( props.empty() )
THROW_IO_ERROR( "Rules6 stream has no props" ); THROW_IO_ERROR( wxT( "Rules6 stream has no props" ) );
name = ALTIUM_PARSER::ReadString( props, "NAME", "" ); name = ALTIUM_PARSER::ReadString( props, wxT( "NAME" ), wxT( "" ) );
priority = ALTIUM_PARSER::ReadInt( props, "PRIORITY", 1 ); priority = ALTIUM_PARSER::ReadInt( props, wxT( "PRIORITY" ), 1 );
scope1expr = ALTIUM_PARSER::ReadString( props, "SCOPE1EXPRESSION", "" ); scope1expr = ALTIUM_PARSER::ReadString( props, wxT( "SCOPE1EXPRESSION" ), wxT( "" ) );
scope2expr = ALTIUM_PARSER::ReadString( props, "SCOPE2EXPRESSION", "" ); scope2expr = ALTIUM_PARSER::ReadString( props, wxT( "SCOPE2EXPRESSION" ), wxT( "" ) );
wxString rulekind = ALTIUM_PARSER::ReadString( props, "RULEKIND", "" ); wxString rulekind = ALTIUM_PARSER::ReadString( props, wxT( "RULEKIND" ), wxT( "" ) );
if( rulekind == "Clearance" ) if( rulekind == wxT( "Clearance" ) )
{ {
kind = ALTIUM_RULE_KIND::CLEARANCE; kind = ALTIUM_RULE_KIND::CLEARANCE;
clearanceGap = ALTIUM_PARSER::ReadKicadUnit( props, "GAP", "10mil" ); clearanceGap = ALTIUM_PARSER::ReadKicadUnit( props, wxT( "GAP" ), wxT( "10mil" ) );
} }
else if( rulekind == "DiffPairsRouting" ) else if( rulekind == wxT( "DiffPairsRouting" ) )
{ {
kind = ALTIUM_RULE_KIND::DIFF_PAIR_ROUTINGS; kind = ALTIUM_RULE_KIND::DIFF_PAIR_ROUTINGS;
} }
else if( rulekind == "Height" ) else if( rulekind == wxT( "Height" ) )
{ {
kind = ALTIUM_RULE_KIND::HEIGHT; kind = ALTIUM_RULE_KIND::HEIGHT;
} }
else if( rulekind == "HoleSize" ) else if( rulekind == wxT( "HoleSize" ) )
{ {
kind = ALTIUM_RULE_KIND::HOLE_SIZE; kind = ALTIUM_RULE_KIND::HOLE_SIZE;
} }
else if( rulekind == "HoleToHoleClearance" ) else if( rulekind == wxT( "HoleToHoleClearance" ) )
{ {
kind = ALTIUM_RULE_KIND::HOLE_TO_HOLE_CLEARANCE; kind = ALTIUM_RULE_KIND::HOLE_TO_HOLE_CLEARANCE;
} }
else if( rulekind == "Width" ) else if( rulekind == wxT( "Width" ) )
{ {
kind = ALTIUM_RULE_KIND::WIDTH; kind = ALTIUM_RULE_KIND::WIDTH;
} }
else if( rulekind == "PasteMaskExpansion" ) else if( rulekind == wxT( "PasteMaskExpansion" ) )
{ {
kind = ALTIUM_RULE_KIND::PASTE_MASK_EXPANSION; kind = ALTIUM_RULE_KIND::PASTE_MASK_EXPANSION;
} }
else if( rulekind == "PlaneClearance" ) else if( rulekind == wxT( "PlaneClearance" ) )
{ {
kind = ALTIUM_RULE_KIND::PLANE_CLEARANCE; kind = ALTIUM_RULE_KIND::PLANE_CLEARANCE;
planeclearanceClearance = ALTIUM_PARSER::ReadKicadUnit( props, "CLEARANCE", "10mil" ); planeclearanceClearance = ALTIUM_PARSER::ReadKicadUnit( props, wxT( "CLEARANCE" ), wxT( "10mil" ) );
} }
else if( rulekind == "PolygonConnect" ) else if( rulekind == wxT( "PolygonConnect" ) )
{ {
kind = ALTIUM_RULE_KIND::POLYGON_CONNECT; kind = ALTIUM_RULE_KIND::POLYGON_CONNECT;
polygonconnectAirgapwidth = ALTIUM_PARSER::ReadKicadUnit( props, "AIRGAPWIDTH", "10mil" ); polygonconnectAirgapwidth = ALTIUM_PARSER::ReadKicadUnit( props, wxT( "AIRGAPWIDTH" ), wxT( "10mil" ) );
polygonconnectReliefconductorwidth = ALTIUM_PARSER::ReadKicadUnit( props, "RELIEFCONDUCTORWIDTH", "10mil" ); polygonconnectReliefconductorwidth = ALTIUM_PARSER::ReadKicadUnit( props, wxT( "RELIEFCONDUCTORWIDTH" ), wxT( "10mil" ) );
polygonconnectReliefentries = ALTIUM_PARSER::ReadInt( props, "RELIEFENTRIES", 4 ); polygonconnectReliefentries = ALTIUM_PARSER::ReadInt( props, wxT( "RELIEFENTRIES" ), 4 );
wxString style = ALTIUM_PARSER::ReadString( props, "CONNECTSTYLE", "" ); wxString style = ALTIUM_PARSER::ReadString( props, wxT( "CONNECTSTYLE" ), wxT( "" ) );
if( style == "Direct" ) polygonconnectStyle = ALTIUM_CONNECT_STYLE::DIRECT; if( style == wxT( "Direct" ) ) polygonconnectStyle = ALTIUM_CONNECT_STYLE::DIRECT;
else if( style == "Relief" ) polygonconnectStyle = ALTIUM_CONNECT_STYLE::RELIEF; else if( style == wxT( "Relief" ) ) polygonconnectStyle = ALTIUM_CONNECT_STYLE::RELIEF;
else if( style == "NoConnect" ) polygonconnectStyle = ALTIUM_CONNECT_STYLE::NONE; else if( style == wxT( "NoConnect" ) ) polygonconnectStyle = ALTIUM_CONNECT_STYLE::NONE;
else polygonconnectStyle = ALTIUM_CONNECT_STYLE::UNKNOWN; else polygonconnectStyle = ALTIUM_CONNECT_STYLE::UNKNOWN;
} }
else else
{ {
@ -479,7 +479,7 @@ ARULE6::ARULE6( ALTIUM_PARSER& aReader )
} }
if( aReader.HasParsingError() ) if( aReader.HasParsingError() )
THROW_IO_ERROR( "Rules6 stream was not parsed correctly" ); THROW_IO_ERROR( wxT( "Rules6 stream was not parsed correctly" ) );
} }
AARC6::AARC6( ALTIUM_PARSER& aReader ) AARC6::AARC6( ALTIUM_PARSER& aReader )
@ -487,7 +487,7 @@ AARC6::AARC6( ALTIUM_PARSER& aReader )
ALTIUM_RECORD recordtype = static_cast<ALTIUM_RECORD>( aReader.Read<uint8_t>() ); ALTIUM_RECORD recordtype = static_cast<ALTIUM_RECORD>( aReader.Read<uint8_t>() );
if( recordtype != ALTIUM_RECORD::ARC ) if( recordtype != ALTIUM_RECORD::ARC )
{ {
THROW_IO_ERROR( "Arcs6 stream has invalid recordtype" ); THROW_IO_ERROR( wxT( "Arcs6 stream has invalid recordtype" ) );
} }
// Subrecord 1 // Subrecord 1
@ -516,7 +516,7 @@ AARC6::AARC6( ALTIUM_PARSER& aReader )
if( aReader.HasParsingError() ) if( aReader.HasParsingError() )
{ {
THROW_IO_ERROR( "Arcs6 stream was not parsed correctly" ); THROW_IO_ERROR( wxT( "Arcs6 stream was not parsed correctly" ) );
} }
} }
@ -525,7 +525,7 @@ ACOMPONENTBODY6::ACOMPONENTBODY6( ALTIUM_PARSER& aReader )
ALTIUM_RECORD recordtype = static_cast<ALTIUM_RECORD>( aReader.Read<uint8_t>() ); ALTIUM_RECORD recordtype = static_cast<ALTIUM_RECORD>( aReader.Read<uint8_t>() );
if( recordtype != ALTIUM_RECORD::MODEL ) if( recordtype != ALTIUM_RECORD::MODEL )
THROW_IO_ERROR( "ComponentsBodies6 stream has invalid recordtype" ); THROW_IO_ERROR( wxT( "ComponentsBodies6 stream has invalid recordtype" ) );
aReader.ReadAndSetSubrecordLength(); aReader.ReadAndSetSubrecordLength();
@ -536,28 +536,28 @@ ACOMPONENTBODY6::ACOMPONENTBODY6( ALTIUM_PARSER& aReader )
std::map<wxString, wxString> properties = aReader.ReadProperties(); std::map<wxString, wxString> properties = aReader.ReadProperties();
if( properties.empty() ) if( properties.empty() )
THROW_IO_ERROR( "ComponentsBodies6 stream has no properties" ); THROW_IO_ERROR( wxT( "ComponentsBodies6 stream has no properties" ) );
modelName = ALTIUM_PARSER::ReadString( properties, "MODEL.NAME", "" ); modelName = ALTIUM_PARSER::ReadString( properties, wxT( "MODEL.NAME" ), wxT( "" ) );
modelId = ALTIUM_PARSER::ReadString( properties, "MODELID", "" ); modelId = ALTIUM_PARSER::ReadString( properties, wxT( "MODELID" ), wxT( "" ) );
modelIsEmbedded = ALTIUM_PARSER::ReadBool( properties, "MODEL.EMBED", false ); modelIsEmbedded = ALTIUM_PARSER::ReadBool( properties, wxT( "MODEL.EMBED" ), false );
modelPosition.x = ALTIUM_PARSER::ReadKicadUnit( properties, "MODEL.2D.X", "0mil" ); modelPosition.x = ALTIUM_PARSER::ReadKicadUnit( properties, wxT( "MODEL.2D.X" ), wxT( "0mil" ) );
modelPosition.y = -ALTIUM_PARSER::ReadKicadUnit( properties, "MODEL.2D.Y", "0mil" ); modelPosition.y = -ALTIUM_PARSER::ReadKicadUnit( properties, wxT( "MODEL.2D.Y" ), wxT( "0mil" ) );
modelPosition.z = ALTIUM_PARSER::ReadKicadUnit( properties, "MODEL.3D.DZ", "0mil" ); modelPosition.z = ALTIUM_PARSER::ReadKicadUnit( properties, wxT( "MODEL.3D.DZ" ), wxT( "0mil" ) );
modelRotation.x = ALTIUM_PARSER::ReadDouble( properties, "MODEL.3D.ROTX", 0. ); modelRotation.x = ALTIUM_PARSER::ReadDouble( properties, wxT( "MODEL.3D.ROTX" ), 0. );
modelRotation.y = ALTIUM_PARSER::ReadDouble( properties, "MODEL.3D.ROTY", 0. ); modelRotation.y = ALTIUM_PARSER::ReadDouble( properties, wxT( "MODEL.3D.ROTY" ), 0. );
modelRotation.z = ALTIUM_PARSER::ReadDouble( properties, "MODEL.3D.ROTZ", 0. ); modelRotation.z = ALTIUM_PARSER::ReadDouble( properties, wxT( "MODEL.3D.ROTZ" ), 0. );
rotation = ALTIUM_PARSER::ReadDouble( properties, "MODEL.2D.ROTATION", 0. ); rotation = ALTIUM_PARSER::ReadDouble( properties, wxT( "MODEL.2D.ROTATION" ), 0. );
bodyOpacity = ALTIUM_PARSER::ReadDouble( properties, "BODYOPACITY3D", 1. ); bodyOpacity = ALTIUM_PARSER::ReadDouble( properties, wxT( "BODYOPACITY3D" ), 1. );
aReader.SkipSubrecord(); aReader.SkipSubrecord();
if( aReader.HasParsingError() ) if( aReader.HasParsingError() )
THROW_IO_ERROR( "Components6 stream was not parsed correctly" ); THROW_IO_ERROR( wxT( "Components6 stream was not parsed correctly" ) );
} }
APAD6::APAD6( ALTIUM_PARSER& aReader ) APAD6::APAD6( ALTIUM_PARSER& aReader )
@ -565,18 +565,18 @@ APAD6::APAD6( ALTIUM_PARSER& aReader )
ALTIUM_RECORD recordtype = static_cast<ALTIUM_RECORD>( aReader.Read<uint8_t>() ); ALTIUM_RECORD recordtype = static_cast<ALTIUM_RECORD>( aReader.Read<uint8_t>() );
if( recordtype != ALTIUM_RECORD::PAD ) if( recordtype != ALTIUM_RECORD::PAD )
THROW_IO_ERROR( "Pads6 stream has invalid recordtype" ); THROW_IO_ERROR( wxT( "Pads6 stream has invalid recordtype" ) );
// Subrecord 1 // Subrecord 1
size_t subrecord1 = aReader.ReadAndSetSubrecordLength(); size_t subrecord1 = aReader.ReadAndSetSubrecordLength();
if( subrecord1 == 0 ) if( subrecord1 == 0 )
THROW_IO_ERROR( "Pads6 stream has no subrecord1 data" ); THROW_IO_ERROR( wxT( "Pads6 stream has no subrecord1 data" ) );
name = aReader.ReadWxString(); name = aReader.ReadWxString();
if( aReader.GetRemainingSubrecordBytes() != 0 ) if( aReader.GetRemainingSubrecordBytes() != 0 )
THROW_IO_ERROR( "Pads6 stream has invalid subrecord1 length" ); THROW_IO_ERROR( wxT( "Pads6 stream has invalid subrecord1 length" ) );
aReader.SkipSubrecord(); aReader.SkipSubrecord();
@ -596,7 +596,7 @@ APAD6::APAD6( ALTIUM_PARSER& aReader )
size_t subrecord5 = aReader.ReadAndSetSubrecordLength(); size_t subrecord5 = aReader.ReadAndSetSubrecordLength();
if( subrecord5 < 114 ) if( subrecord5 < 114 )
THROW_IO_ERROR( "Pads6 stream subrecord has length < 114, which is unexpected" ); THROW_IO_ERROR( wxT( "Pads6 stream subrecord has length < 114, which is unexpected" ) );
layer = static_cast<ALTIUM_LAYER>( aReader.Read<uint8_t>() ); layer = static_cast<ALTIUM_LAYER>( aReader.Read<uint8_t>() );
tolayer = ALTIUM_LAYER::UNKNOWN; tolayer = ALTIUM_LAYER::UNKNOWN;
@ -697,7 +697,7 @@ APAD6::APAD6( ALTIUM_PARSER& aReader )
aReader.SkipSubrecord(); aReader.SkipSubrecord();
if( aReader.HasParsingError() ) if( aReader.HasParsingError() )
THROW_IO_ERROR( "Pads6 stream was not parsed correctly" ); THROW_IO_ERROR( wxT( "Pads6 stream was not parsed correctly" ) );
} }
AVIA6::AVIA6( ALTIUM_PARSER& aReader ) AVIA6::AVIA6( ALTIUM_PARSER& aReader )
@ -705,7 +705,7 @@ AVIA6::AVIA6( ALTIUM_PARSER& aReader )
ALTIUM_RECORD recordtype = static_cast<ALTIUM_RECORD>( aReader.Read<uint8_t>() ); ALTIUM_RECORD recordtype = static_cast<ALTIUM_RECORD>( aReader.Read<uint8_t>() );
if( recordtype != ALTIUM_RECORD::VIA ) if( recordtype != ALTIUM_RECORD::VIA )
THROW_IO_ERROR( "Vias6 stream has invalid recordtype" ); THROW_IO_ERROR( wxT( "Vias6 stream has invalid recordtype" ) );
// Subrecord 1 // Subrecord 1
size_t subrecord1 = aReader.ReadAndSetSubrecordLength(); size_t subrecord1 = aReader.ReadAndSetSubrecordLength();
@ -743,7 +743,7 @@ AVIA6::AVIA6( ALTIUM_PARSER& aReader )
aReader.SkipSubrecord(); aReader.SkipSubrecord();
if( aReader.HasParsingError() ) if( aReader.HasParsingError() )
THROW_IO_ERROR( "Vias6 stream was not parsed correctly" ); THROW_IO_ERROR( wxT( "Vias6 stream was not parsed correctly" ) );
} }
ATRACK6::ATRACK6( ALTIUM_PARSER& aReader ) ATRACK6::ATRACK6( ALTIUM_PARSER& aReader )
@ -751,7 +751,7 @@ ATRACK6::ATRACK6( ALTIUM_PARSER& aReader )
ALTIUM_RECORD recordtype = static_cast<ALTIUM_RECORD>( aReader.Read<uint8_t>() ); ALTIUM_RECORD recordtype = static_cast<ALTIUM_RECORD>( aReader.Read<uint8_t>() );
if( recordtype != ALTIUM_RECORD::TRACK ) if( recordtype != ALTIUM_RECORD::TRACK )
THROW_IO_ERROR( "Tracks6 stream has invalid recordtype" ); THROW_IO_ERROR( wxT( "Tracks6 stream has invalid recordtype" ) );
// Subrecord 1 // Subrecord 1
aReader.ReadAndSetSubrecordLength(); aReader.ReadAndSetSubrecordLength();
@ -776,7 +776,7 @@ ATRACK6::ATRACK6( ALTIUM_PARSER& aReader )
aReader.SkipSubrecord(); aReader.SkipSubrecord();
if( aReader.HasParsingError() ) if( aReader.HasParsingError() )
THROW_IO_ERROR( "Tracks6 stream was not parsed correctly" ); THROW_IO_ERROR( wxT( "Tracks6 stream was not parsed correctly" ) );
} }
ATEXT6::ATEXT6( ALTIUM_PARSER& aReader, std::map<uint32_t, wxString>& aStringTable ) ATEXT6::ATEXT6( ALTIUM_PARSER& aReader, std::map<uint32_t, wxString>& aStringTable )
@ -784,7 +784,7 @@ ATEXT6::ATEXT6( ALTIUM_PARSER& aReader, std::map<uint32_t, wxString>& aStringTab
ALTIUM_RECORD recordtype = static_cast<ALTIUM_RECORD>( aReader.Read<uint8_t>() ); ALTIUM_RECORD recordtype = static_cast<ALTIUM_RECORD>( aReader.Read<uint8_t>() );
if( recordtype != ALTIUM_RECORD::TEXT ) if( recordtype != ALTIUM_RECORD::TEXT )
THROW_IO_ERROR( "Texts6 stream has invalid recordtype" ); THROW_IO_ERROR( wxT( "Texts6 stream has invalid recordtype" ) );
// Subrecord 1 - Properties // Subrecord 1 - Properties
size_t subrecord1 = aReader.ReadAndSetSubrecordLength(); size_t subrecord1 = aReader.ReadAndSetSubrecordLength();
@ -833,12 +833,12 @@ ATEXT6::ATEXT6( ALTIUM_PARSER& aReader, std::map<uint32_t, wxString>& aStringTab
text = aReader.ReadWxString(); text = aReader.ReadWxString();
// Normalize Windows line endings // Normalize Windows line endings
text.Replace( "\r\n", "\n" ); text.Replace( wxT( "\r\n" ), wxT( "\n" ) );
aReader.SkipSubrecord(); aReader.SkipSubrecord();
if( aReader.HasParsingError() ) if( aReader.HasParsingError() )
THROW_IO_ERROR( "Texts6 stream was not parsed correctly" ); THROW_IO_ERROR( wxT( "Texts6 stream was not parsed correctly" ) );
} }
AFILL6::AFILL6( ALTIUM_PARSER& aReader ) AFILL6::AFILL6( ALTIUM_PARSER& aReader )
@ -846,7 +846,7 @@ AFILL6::AFILL6( ALTIUM_PARSER& aReader )
ALTIUM_RECORD recordtype = static_cast<ALTIUM_RECORD>( aReader.Read<uint8_t>() ); ALTIUM_RECORD recordtype = static_cast<ALTIUM_RECORD>( aReader.Read<uint8_t>() );
if( recordtype != ALTIUM_RECORD::FILL ) if( recordtype != ALTIUM_RECORD::FILL )
THROW_IO_ERROR( "Fills6 stream has invalid recordtype" ); THROW_IO_ERROR( wxT( "Fills6 stream has invalid recordtype" ) );
// Subrecord 1 // Subrecord 1
aReader.ReadAndSetSubrecordLength(); aReader.ReadAndSetSubrecordLength();
@ -870,7 +870,7 @@ AFILL6::AFILL6( ALTIUM_PARSER& aReader )
aReader.SkipSubrecord(); aReader.SkipSubrecord();
if( aReader.HasParsingError() ) if( aReader.HasParsingError() )
THROW_IO_ERROR( "Fills6 stream was not parsed correctly" ); THROW_IO_ERROR( wxT( "Fills6 stream was not parsed correctly" ) );
} }
AREGION6::AREGION6( ALTIUM_PARSER& aReader, bool aExtendedVertices ) AREGION6::AREGION6( ALTIUM_PARSER& aReader, bool aExtendedVertices )
@ -878,7 +878,7 @@ AREGION6::AREGION6( ALTIUM_PARSER& aReader, bool aExtendedVertices )
ALTIUM_RECORD recordtype = static_cast<ALTIUM_RECORD>( aReader.Read<uint8_t>() ); ALTIUM_RECORD recordtype = static_cast<ALTIUM_RECORD>( aReader.Read<uint8_t>() );
if( recordtype != ALTIUM_RECORD::REGION ) if( recordtype != ALTIUM_RECORD::REGION )
THROW_IO_ERROR( "Regions6 stream has invalid recordtype" ); THROW_IO_ERROR( wxT( "Regions6 stream has invalid recordtype" ) );
// Subrecord 1 // Subrecord 1
aReader.ReadAndSetSubrecordLength(); aReader.ReadAndSetSubrecordLength();
@ -901,12 +901,12 @@ AREGION6::AREGION6( ALTIUM_PARSER& aReader, bool aExtendedVertices )
std::map<wxString, wxString> properties = aReader.ReadProperties(); std::map<wxString, wxString> properties = aReader.ReadProperties();
if( properties.empty() ) if( properties.empty() )
THROW_IO_ERROR( "Regions6 stream has empty properties" ); THROW_IO_ERROR( wxT( "Regions6 stream has empty properties" ) );
int pkind = ALTIUM_PARSER::ReadInt( properties, "KIND", 0 ); int pkind = ALTIUM_PARSER::ReadInt( properties, wxT( "KIND" ), 0 );
bool is_cutout = ALTIUM_PARSER::ReadBool( properties, "ISBOARDCUTOUT", false ); bool is_cutout = ALTIUM_PARSER::ReadBool( properties, wxT( "ISBOARDCUTOUT" ), false );
is_shapebased = ALTIUM_PARSER::ReadBool( properties, "ISSHAPEBASED", false ); is_shapebased = ALTIUM_PARSER::ReadBool( properties, wxT( "ISSHAPEBASED" ), false );
// TODO: this can differ from the other subpolyindex?! // TODO: this can differ from the other subpolyindex?!
//subpolyindex = static_cast<uint16_t>( //subpolyindex = static_cast<uint16_t>(
@ -985,5 +985,5 @@ AREGION6::AREGION6( ALTIUM_PARSER& aReader, bool aExtendedVertices )
aReader.SkipSubrecord(); aReader.SkipSubrecord();
if( aReader.HasParsingError() ) if( aReader.HasParsingError() )
THROW_IO_ERROR( "Regions6 stream was not parsed correctly" ); THROW_IO_ERROR( wxT( "Regions6 stream was not parsed correctly" ) );
} }

View File

@ -74,8 +74,8 @@ FOOTPRINT* ALTIUM_PCB::HelperGetFootprint( uint16_t aComponent ) const
{ {
if( aComponent == ALTIUM_COMPONENT_NONE || m_components.size() <= aComponent ) if( aComponent == ALTIUM_COMPONENT_NONE || m_components.size() <= aComponent )
{ {
THROW_IO_ERROR( wxString::Format( "Component creator tries to access component id %d " THROW_IO_ERROR( wxString::Format( wxT( "Component creator tries to access component id %d "
"of %d existing components", "of %d existing components" ),
aComponent, m_components.size() ) ); aComponent, m_components.size() ) );
} }
@ -94,8 +94,8 @@ PCB_SHAPE* ALTIUM_PCB::HelperCreateAndAddShape( uint16_t aComponent )
{ {
if( m_components.size() <= aComponent ) if( m_components.size() <= aComponent )
{ {
THROW_IO_ERROR( wxString::Format( "Component creator tries to access component id %d " THROW_IO_ERROR( wxString::Format( wxT( "Component creator tries to access component "
"of %d existing components", "id %d of %d existing components" ),
aComponent, aComponent,
m_components.size() ) ); m_components.size() ) );
} }
@ -357,7 +357,7 @@ void ALTIUM_PCB::checkpoint()
/ std::max( 1U, m_totalCount ) ); / std::max( 1U, m_totalCount ) );
if( !m_progressReporter->KeepRefreshing() ) if( !m_progressReporter->KeepRefreshing() )
THROW_IO_ERROR( ( "Open cancelled by user." ) ); THROW_IO_ERROR( _( "Open cancelled by user." ) );
m_lastProgressCount = m_doneCount; m_lastProgressCount = m_doneCount;
} }
@ -532,8 +532,9 @@ void ALTIUM_PCB::Parse( const ALTIUM_COMPOUND_FILE& altiumPcbFi
if( mappedDirectory == aFileMapping.end() ) if( mappedDirectory == aFileMapping.end() )
{ {
wxASSERT_MSG( !isRequired, wxString::Format( "Altium Directory of kind %d was expected, " wxASSERT_MSG( !isRequired, wxString::Format( wxT( "Altium Directory of kind %d was "
"but no mapping is present in the code", "expected, but no mapping is "
"present in the code" ),
directory ) ); directory ) );
continue; continue;
} }
@ -684,8 +685,8 @@ FOOTPRINT* ALTIUM_PCB::ParseFootprint( const ALTIUM_COMPOUND_FILE& altiumLibFile
LIB_ID fpID = AltiumToKiCadLibID( "", footprintName ); // TODO: library name LIB_ID fpID = AltiumToKiCadLibID( "", footprintName ); // TODO: library name
footprint->SetFPID( fpID ); footprint->SetFPID( fpID );
footprint->SetDescription( "Test Description for " + aFootprintName + " - " + footprintName ); footprint->SetDescription( wxT( "Test Description for " ) + aFootprintName + wxT( " - " ) + footprintName );
footprint->SetReference( "UNK" ); // TODO: extract footprint->SetReference( wxT( "UNK" ) ); // TODO: extract
footprint->SetValue( footprintName ); footprint->SetValue( footprintName );
footprint->Reference().SetVisible( true ); // TODO: extract visibility information footprint->Reference().SetVisible( true ); // TODO: extract visibility information
footprint->Value().SetVisible( true ); footprint->Value().SetVisible( true );
@ -750,12 +751,12 @@ FOOTPRINT* ALTIUM_PCB::ParseFootprint( const ALTIUM_COMPOUND_FILE& altiumLibFile
if( parser.HasParsingError() ) if( parser.HasParsingError() )
{ {
THROW_IO_ERROR( wxString::Format( "%s stream was not parsed correctly", streamName ) ); THROW_IO_ERROR( wxString::Format( wxT( "%s stream was not parsed correctly" ), streamName ) );
} }
if( parser.GetRemainingBytes() != 0 ) if( parser.GetRemainingBytes() != 0 )
{ {
THROW_IO_ERROR( wxString::Format( "%s stream is not fully parsed", streamName ) ); THROW_IO_ERROR( wxString::Format( wxT( "%s stream is not fully parsed" ), streamName ) );
} }
return footprint.release(); return footprint.release();
@ -769,8 +770,9 @@ int ALTIUM_PCB::GetNetCode( uint16_t aId ) const
} }
else if( m_num_nets < aId ) else if( m_num_nets < aId )
{ {
THROW_IO_ERROR( wxString::Format( THROW_IO_ERROR( wxString::Format( wxT( "Netcode with id %d does not exist. Only %d nets "
"Netcode with id %d does not exist. Only %d nets are known", aId, m_num_nets ) ); "are known" ),
aId, m_num_nets ) );
} }
else else
{ {
@ -803,7 +805,7 @@ const ARULE6* ALTIUM_PCB::GetRuleDefault( ALTIUM_RULE_KIND aKind ) const
for( const ARULE6& rule : rules->second ) for( const ARULE6& rule : rules->second )
{ {
if( rule.scope1expr == "All" && rule.scope2expr == "All" ) if( rule.scope1expr == wxT( "All" ) && rule.scope2expr == wxT( "All" ) )
return &rule; return &rule;
} }
@ -833,7 +835,7 @@ void ALTIUM_PCB::ParseBoard6Data( const ALTIUM_COMPOUND_FILE& aAltiumPcbFile
const CFB::COMPOUND_FILE_ENTRY* aEntry ) const CFB::COMPOUND_FILE_ENTRY* aEntry )
{ {
if( m_progressReporter ) if( m_progressReporter )
m_progressReporter->Report( "Loading board data..." ); m_progressReporter->Report( _( "Loading board data..." ) );
ALTIUM_PARSER reader( aAltiumPcbFile, aEntry ); ALTIUM_PARSER reader( aAltiumPcbFile, aEntry );
@ -841,7 +843,7 @@ void ALTIUM_PCB::ParseBoard6Data( const ALTIUM_COMPOUND_FILE& aAltiumPcbFile
ABOARD6 elem( reader ); ABOARD6 elem( reader );
if( reader.GetRemainingBytes() != 0 ) if( reader.GetRemainingBytes() != 0 )
THROW_IO_ERROR( "Board6 stream is not fully parsed" ); THROW_IO_ERROR( wxT( "Board6 stream is not fully parsed" ) );
m_board->GetDesignSettings().SetAuxOrigin( elem.sheetpos ); m_board->GetDesignSettings().SetAuxOrigin( elem.sheetpos );
m_board->GetDesignSettings().SetGridOrigin( elem.sheetpos ); m_board->GetDesignSettings().SetGridOrigin( elem.sheetpos );
@ -882,18 +884,18 @@ void ALTIUM_PCB::ParseBoard6Data( const ALTIUM_COMPOUND_FILE& aAltiumPcbFile
// handle unused layer in case of odd layercount // handle unused layer in case of odd layercount
if( layer.nextId == 0 && layercount != kicadLayercount ) if( layer.nextId == 0 && layercount != kicadLayercount )
{ {
m_board->SetLayerName( ( *it )->GetBrdLayerId(), "[unused]" ); m_board->SetLayerName( ( *it )->GetBrdLayerId(), wxT( "[unused]" ) );
if( ( *it )->GetType() != BS_ITEM_TYPE_COPPER ) if( ( *it )->GetType() != BS_ITEM_TYPE_COPPER )
{ {
THROW_IO_ERROR( "Board6 stream, unexpected item while parsing stackup" ); THROW_IO_ERROR( wxT( "Board6 stream, unexpected item while parsing stackup" ) );
} }
( *it )->SetThickness( 0 ); ( *it )->SetThickness( 0 );
++it; ++it;
if( ( *it )->GetType() != BS_ITEM_TYPE_DIELECTRIC ) if( ( *it )->GetType() != BS_ITEM_TYPE_DIELECTRIC )
{ {
THROW_IO_ERROR( "Board6 stream, unexpected item while parsing stackup" ); THROW_IO_ERROR( wxT( "Board6 stream, unexpected item while parsing stackup" ) );
} }
( *it )->SetThickness( 0, 0 ); ( *it )->SetThickness( 0, 0 );
( *it )->SetThicknessLocked( true, 0 ); ( *it )->SetThicknessLocked( true, 0 );
@ -904,7 +906,7 @@ void ALTIUM_PCB::ParseBoard6Data( const ALTIUM_COMPOUND_FILE& aAltiumPcbFile
static_cast<PCB_LAYER_ID>( curLayer++ ) } ); static_cast<PCB_LAYER_ID>( curLayer++ ) } );
if( ( *it )->GetType() != BS_ITEM_TYPE_COPPER ) if( ( *it )->GetType() != BS_ITEM_TYPE_COPPER )
THROW_IO_ERROR( "Board6 stream, unexpected item while parsing stackup" ); THROW_IO_ERROR( wxT( "Board6 stream, unexpected item while parsing stackup" ) );
( *it )->SetThickness( layer.copperthick ); ( *it )->SetThickness( layer.copperthick );
@ -925,7 +927,7 @@ void ALTIUM_PCB::ParseBoard6Data( const ALTIUM_COMPOUND_FILE& aAltiumPcbFile
if( klayer == B_Cu ) if( klayer == B_Cu )
{ {
if( layer.nextId != 0 ) if( layer.nextId != 0 )
THROW_IO_ERROR( "Board6 stream, unexpected id while parsing last stackup layer" ); THROW_IO_ERROR( wxT( "Board6 stream, unexpected id while parsing last stackup layer" ) );
// overwrite entry from internal -> bottom // overwrite entry from internal -> bottom
m_layermap[alayer] = B_Cu; m_layermap[alayer] = B_Cu;
@ -935,7 +937,7 @@ void ALTIUM_PCB::ParseBoard6Data( const ALTIUM_COMPOUND_FILE& aAltiumPcbFile
++it; ++it;
if( ( *it )->GetType() != BS_ITEM_TYPE_DIELECTRIC ) if( ( *it )->GetType() != BS_ITEM_TYPE_DIELECTRIC )
THROW_IO_ERROR( "Board6 stream, unexpected item while parsing stackup" ); THROW_IO_ERROR( wxT( "Board6 stream, unexpected item while parsing stackup" ) );
( *it )->SetThickness( layer.dielectricthick, 0 ); ( *it )->SetThickness( layer.dielectricthick, 0 );
( *it )->SetMaterial( layer.dielectricmaterial.empty() ? ( *it )->SetMaterial( layer.dielectricmaterial.empty() ?
@ -1016,7 +1018,7 @@ void ALTIUM_PCB::ParseClasses6Data( const ALTIUM_COMPOUND_FILE& aAltiumPcbFi
const CFB::COMPOUND_FILE_ENTRY* aEntry ) const CFB::COMPOUND_FILE_ENTRY* aEntry )
{ {
if( m_progressReporter ) if( m_progressReporter )
m_progressReporter->Report( "Loading netclasses..." ); m_progressReporter->Report( _( "Loading netclasses..." ) );
ALTIUM_PARSER reader( aAltiumPcbFile, aEntry ); ALTIUM_PARSER reader( aAltiumPcbFile, aEntry );
@ -1044,7 +1046,7 @@ void ALTIUM_PCB::ParseClasses6Data( const ALTIUM_COMPOUND_FILE& aAltiumPcbFi
} }
if( reader.GetRemainingBytes() != 0 ) if( reader.GetRemainingBytes() != 0 )
THROW_IO_ERROR( "Classes6 stream is not fully parsed" ); THROW_IO_ERROR( wxT( "Classes6 stream is not fully parsed" ) );
m_board->m_LegacyNetclassesLoaded = true; m_board->m_LegacyNetclassesLoaded = true;
} }
@ -1053,7 +1055,7 @@ void ALTIUM_PCB::ParseComponents6Data( const ALTIUM_COMPOUND_FILE& aAltiumPc
const CFB::COMPOUND_FILE_ENTRY* aEntry ) const CFB::COMPOUND_FILE_ENTRY* aEntry )
{ {
if( m_progressReporter ) if( m_progressReporter )
m_progressReporter->Report( "Loading components..." ); m_progressReporter->Report( _( "Loading components..." ) );
ALTIUM_PARSER reader( aAltiumPcbFile, aEntry ); ALTIUM_PARSER reader( aAltiumPcbFile, aEntry );
@ -1078,7 +1080,7 @@ void ALTIUM_PCB::ParseComponents6Data( const ALTIUM_COMPOUND_FILE& aAltiumPc
// If the reference begins with a number, we prepend 'UNK' (unknown) for the source designator // If the reference begins with a number, we prepend 'UNK' (unknown) for the source designator
wxString reference = elem.sourcedesignator; wxString reference = elem.sourcedesignator;
if( reference.find_first_not_of( "0123456789" ) == wxString::npos ) if( reference.find_first_not_of( "0123456789" ) == wxString::npos )
reference.Prepend( "UNK" ); reference.Prepend( wxT( "UNK" ) );
footprint->SetReference( reference ); footprint->SetReference( reference );
footprint->SetLocked( elem.locked ); footprint->SetLocked( elem.locked );
@ -1090,7 +1092,7 @@ void ALTIUM_PCB::ParseComponents6Data( const ALTIUM_COMPOUND_FILE& aAltiumPc
} }
if( reader.GetRemainingBytes() != 0 ) if( reader.GetRemainingBytes() != 0 )
THROW_IO_ERROR( "Components6 stream is not fully parsed" ); THROW_IO_ERROR( wxT( "Components6 stream is not fully parsed" ) );
} }
@ -1111,7 +1113,7 @@ void ALTIUM_PCB::ParseComponentsBodies6Data( const ALTIUM_COMPOUND_FILE& aAl
const CFB::COMPOUND_FILE_ENTRY* aEntry ) const CFB::COMPOUND_FILE_ENTRY* aEntry )
{ {
if( m_progressReporter ) if( m_progressReporter )
m_progressReporter->Report( "Loading component 3D models..." ); m_progressReporter->Report( _( "Loading component 3D models..." ) );
ALTIUM_PARSER reader( aAltiumPcbFile, aEntry ); ALTIUM_PARSER reader( aAltiumPcbFile, aEntry );
@ -1125,9 +1127,10 @@ void ALTIUM_PCB::ParseComponentsBodies6Data( const ALTIUM_COMPOUND_FILE& aAl
if( m_components.size() <= elem.component ) if( m_components.size() <= elem.component )
{ {
THROW_IO_ERROR( wxString::Format( THROW_IO_ERROR( wxString::Format( wxT( "ComponentsBodies6 stream tries to access "
"ComponentsBodies6 stream tries to access component id %d of %d existing components", "component id %d of %d existing components" ),
elem.component, m_components.size() ) ); elem.component,
m_components.size() ) );
} }
if( !elem.modelIsEmbedded ) if( !elem.modelIsEmbedded )
@ -1137,9 +1140,9 @@ void ALTIUM_PCB::ParseComponentsBodies6Data( const ALTIUM_COMPOUND_FILE& aAl
if( modelTuple == m_models.end() ) if( modelTuple == m_models.end() )
{ {
THROW_IO_ERROR( wxString::Format( THROW_IO_ERROR( wxString::Format( wxT( "ComponentsBodies6 stream tries to access "
"ComponentsBodies6 stream tries to access model id %s which does not exist", "model id %s which does not exist" ),
elem.modelId ) ); elem.modelId ) );
} }
FOOTPRINT* footprint = m_components.at( elem.component ); FOOTPRINT* footprint = m_components.at( elem.component );
@ -1175,14 +1178,14 @@ void ALTIUM_PCB::ParseComponentsBodies6Data( const ALTIUM_COMPOUND_FILE& aAl
} }
if( reader.GetRemainingBytes() != 0 ) if( reader.GetRemainingBytes() != 0 )
THROW_IO_ERROR( "ComponentsBodies6 stream is not fully parsed" ); THROW_IO_ERROR( wxT( "ComponentsBodies6 stream is not fully parsed" ) );
} }
void ALTIUM_PCB::HelperParseDimensions6Linear( const ADIMENSION6& aElem ) void ALTIUM_PCB::HelperParseDimensions6Linear( const ADIMENSION6& aElem )
{ {
if( aElem.referencePoint.size() != 2 ) if( aElem.referencePoint.size() != 2 )
THROW_IO_ERROR( "Incorrect number of reference points for linear dimension object" ); THROW_IO_ERROR( wxT( "Incorrect number of reference points for linear dimension object" ) );
PCB_LAYER_ID klayer = GetKicadLayer( aElem.layer ); PCB_LAYER_ID klayer = GetKicadLayer( aElem.layer );
@ -1274,7 +1277,7 @@ void ALTIUM_PCB::HelperParseDimensions6Linear( const ADIMENSION6& aElem )
void ALTIUM_PCB::HelperParseDimensions6Radial(const ADIMENSION6 &aElem) void ALTIUM_PCB::HelperParseDimensions6Radial(const ADIMENSION6 &aElem)
{ {
if( aElem.referencePoint.size() < 2 ) if( aElem.referencePoint.size() < 2 )
THROW_IO_ERROR( "Not enough reference points for radial dimension object" ); THROW_IO_ERROR( wxT( "Not enough reference points for radial dimension object" ) );
PCB_LAYER_ID klayer = GetKicadLayer( aElem.layer ); PCB_LAYER_ID klayer = GetKicadLayer( aElem.layer );
@ -1324,7 +1327,7 @@ void ALTIUM_PCB::HelperParseDimensions6Radial(const ADIMENSION6 &aElem)
if( aElem.textPoint.empty() ) if( aElem.textPoint.empty() )
{ {
wxLogError( "No text position present for leader dimension object" ); wxLogError( wxT( "No text position present for leader dimension object" ) );
return; return;
} }
@ -1412,7 +1415,7 @@ void ALTIUM_PCB::HelperParseDimensions6Leader( const ADIMENSION6& aElem )
if( aElem.textPoint.empty() ) if( aElem.textPoint.empty() )
{ {
wxLogError( "No text position present for leader dimension object" ); wxLogError( wxT( "No text position present for leader dimension object" ) );
return; return;
} }
@ -1480,7 +1483,7 @@ void ALTIUM_PCB::ParseDimensions6Data( const ALTIUM_COMPOUND_FILE& aAltiumPc
const CFB::COMPOUND_FILE_ENTRY* aEntry ) const CFB::COMPOUND_FILE_ENTRY* aEntry )
{ {
if( m_progressReporter ) if( m_progressReporter )
m_progressReporter->Report( "Loading dimension drawings..." ); m_progressReporter->Report( _( "Loading dimension drawings..." ) );
ALTIUM_PARSER reader( aAltiumPcbFile, aEntry ); ALTIUM_PARSER reader( aAltiumPcbFile, aEntry );
@ -1514,7 +1517,7 @@ void ALTIUM_PCB::ParseDimensions6Data( const ALTIUM_COMPOUND_FILE& aAltiumPc
} }
if( reader.GetRemainingBytes() != 0 ) if( reader.GetRemainingBytes() != 0 )
THROW_IO_ERROR( "Dimensions6 stream is not fully parsed" ); THROW_IO_ERROR( wxT( "Dimensions6 stream is not fully parsed" ) );
} }
@ -1522,7 +1525,7 @@ void ALTIUM_PCB::ParseModelsData( const ALTIUM_COMPOUND_FILE& aAltiumPcbFile
const CFB::COMPOUND_FILE_ENTRY* aEntry, const wxString& aRootDir ) const CFB::COMPOUND_FILE_ENTRY* aEntry, const wxString& aRootDir )
{ {
if( m_progressReporter ) if( m_progressReporter )
m_progressReporter->Report( "Loading 3D models..." ); m_progressReporter->Report( _( "Loading 3D models..." ) );
ALTIUM_PARSER reader( aAltiumPcbFile, aEntry ); ALTIUM_PARSER reader( aAltiumPcbFile, aEntry );
@ -1534,14 +1537,14 @@ void ALTIUM_PCB::ParseModelsData( const ALTIUM_COMPOUND_FILE& aAltiumPcbFile
wxSetEnv( PROJECT_VAR_NAME, projectPath ); wxSetEnv( PROJECT_VAR_NAME, projectPath );
// TODO: make this path configurable? // TODO: make this path configurable?
const wxString altiumModelDir = "ALTIUM_EMBEDDED_MODELS"; const wxString altiumModelDir = wxT( "ALTIUM_EMBEDDED_MODELS" );
wxFileName altiumModelsPath = wxFileName::DirName( projectPath ); wxFileName altiumModelsPath = wxFileName::DirName( projectPath );
wxString kicadModelPrefix = "${KIPRJMOD}/" + altiumModelDir + "/"; wxString kicadModelPrefix = wxT( "${KIPRJMOD}/" ) + altiumModelDir + wxT( "/" );
if( !altiumModelsPath.AppendDir( altiumModelDir ) ) if( !altiumModelsPath.AppendDir( altiumModelDir ) )
{ {
THROW_IO_ERROR( "Cannot construct directory path for step models" ); THROW_IO_ERROR( wxT( "Cannot construct directory path for step models" ) );
} }
// Create dir if it does not exist // Create dir if it does not exist
@ -1564,10 +1567,11 @@ void ALTIUM_PCB::ParseModelsData( const ALTIUM_COMPOUND_FILE& aAltiumPcbFile
checkpoint(); checkpoint();
AMODEL elem( reader ); AMODEL elem( reader );
wxString stepPath = wxString::Format( aRootDir + "%d", idx ); wxString stepPath = wxString::Format( aRootDir + wxT( "%d" ), idx );
bool validName = !elem.name.IsEmpty() && elem.name.IsAscii() && bool validName = !elem.name.IsEmpty() && elem.name.IsAscii() &&
wxString::npos == elem.name.find_first_of( invalidChars ); wxString::npos == elem.name.find_first_of( invalidChars );
wxString storageName = !validName ? wxString::Format( "model_%d", idx ) : elem.name; wxString storageName = !validName ? wxString::Format( wxT( "model_%d" ), idx )
: elem.name;
wxFileName storagePath( altiumModelsPath.GetPath(), storageName ); wxFileName storagePath( altiumModelsPath.GetPath(), storageName );
idx++; idx++;
@ -1606,7 +1610,7 @@ void ALTIUM_PCB::ParseModelsData( const ALTIUM_COMPOUND_FILE& aAltiumPcbFile
} }
if( reader.GetRemainingBytes() != 0 ) if( reader.GetRemainingBytes() != 0 )
THROW_IO_ERROR( "Models stream is not fully parsed" ); THROW_IO_ERROR( wxT( "Models stream is not fully parsed" ) );
} }
@ -1628,7 +1632,7 @@ void ALTIUM_PCB::ParseNets6Data( const ALTIUM_COMPOUND_FILE& aAltiumPcbFile,
} }
if( reader.GetRemainingBytes() != 0 ) if( reader.GetRemainingBytes() != 0 )
THROW_IO_ERROR( "Nets6 stream is not fully parsed" ); THROW_IO_ERROR( wxT( "Nets6 stream is not fully parsed" ) );
} }
void ALTIUM_PCB::ParsePolygons6Data( const ALTIUM_COMPOUND_FILE& aAltiumPcbFile, void ALTIUM_PCB::ParsePolygons6Data( const ALTIUM_COMPOUND_FILE& aAltiumPcbFile,
@ -1763,7 +1767,7 @@ void ALTIUM_PCB::ParsePolygons6Data( const ALTIUM_COMPOUND_FILE& aAltiumPcbF
if( reader.GetRemainingBytes() != 0 ) if( reader.GetRemainingBytes() != 0 )
{ {
THROW_IO_ERROR( "Polygons6 stream is not fully parsed" ); THROW_IO_ERROR( wxT( "Polygons6 stream is not fully parsed" ) );
} }
} }
@ -1795,7 +1799,7 @@ void ALTIUM_PCB::ParseRules6Data( const ALTIUM_COMPOUND_FILE& aAltiumPcbFile
if( reader.GetRemainingBytes() != 0 ) if( reader.GetRemainingBytes() != 0 )
{ {
THROW_IO_ERROR( "Rules6 stream is not fully parsed" ); THROW_IO_ERROR( wxT( "Rules6 stream is not fully parsed" ) );
} }
} }
@ -1817,7 +1821,7 @@ void ALTIUM_PCB::ParseBoardRegionsData( const ALTIUM_COMPOUND_FILE& aAltiumP
if( reader.GetRemainingBytes() != 0 ) if( reader.GetRemainingBytes() != 0 )
{ {
THROW_IO_ERROR( "BoardRegions stream is not fully parsed" ); THROW_IO_ERROR( wxT( "BoardRegions stream is not fully parsed" ) );
} }
} }
@ -2123,7 +2127,7 @@ void ALTIUM_PCB::ParseRegions6Data( const ALTIUM_COMPOUND_FILE& aAltiumPcbFi
if( reader.GetRemainingBytes() != 0 ) if( reader.GetRemainingBytes() != 0 )
{ {
THROW_IO_ERROR( "Regions6 stream is not fully parsed" ); THROW_IO_ERROR( wxT( "Regions6 stream is not fully parsed" ) );
} }
} }
@ -2325,7 +2329,7 @@ void ALTIUM_PCB::ParsePads6Data( const ALTIUM_COMPOUND_FILE& aAltiumPcbFile,
if( reader.GetRemainingBytes() != 0 ) if( reader.GetRemainingBytes() != 0 )
{ {
THROW_IO_ERROR( "Pads6 stream is not fully parsed" ); THROW_IO_ERROR( wxT( "Pads6 stream is not fully parsed" ) );
} }
} }
@ -2403,7 +2407,7 @@ void ALTIUM_PCB::ConvertPads6ToFootprintItemOnCopper( FOOTPRINT* aFootprint, con
switch( aElem.sizeAndShape->holeshape ) switch( aElem.sizeAndShape->holeshape )
{ {
case ALTIUM_PAD_HOLE_SHAPE::ROUND: case ALTIUM_PAD_HOLE_SHAPE::ROUND:
wxFAIL_MSG( "Round holes are handled before the switch" ); wxFAIL_MSG( wxT( "Round holes are handled before the switch" ) );
break; break;
case ALTIUM_PAD_HOLE_SHAPE::SQUARE: case ALTIUM_PAD_HOLE_SHAPE::SQUARE:
@ -2543,10 +2547,9 @@ void ALTIUM_PCB::ConvertPads6ToBoardItemOnNonCopper( const APAD6& aElem )
if( klayer == UNDEFINED_LAYER ) if( klayer == UNDEFINED_LAYER )
{ {
wxLogWarning( wxLogWarning( _( "Non-copper pad %s found on an Altium layer (%d) with no KiCad "
_( "Non-copper pad %s found on an Altium layer (%d) with no KiCad equivalent. " "equivalent. It has been moved to KiCad layer Eco1_User." ),
"It has been moved to KiCad layer Eco1_User." ), aElem.name, aElem.layer );
aElem.name, aElem.layer );
klayer = Eco1_User; klayer = Eco1_User;
} }
@ -2802,7 +2805,7 @@ void ALTIUM_PCB::ParseVias6Data( const ALTIUM_COMPOUND_FILE& aAltiumPcbFile,
if( reader.GetRemainingBytes() != 0 ) if( reader.GetRemainingBytes() != 0 )
{ {
THROW_IO_ERROR( "Vias6 stream is not fully parsed" ); THROW_IO_ERROR( wxT( "Vias6 stream is not fully parsed" ) );
} }
} }
@ -2950,7 +2953,7 @@ void ALTIUM_PCB::ParseWideStrings6Data( const ALTIUM_COMPOUND_FILE& aAltiumP
m_unicodeStrings = reader.ReadWideStringTable(); m_unicodeStrings = reader.ReadWideStringTable();
if( reader.GetRemainingBytes() != 0 ) if( reader.GetRemainingBytes() != 0 )
THROW_IO_ERROR( "WideStrings6 stream is not fully parsed" ); THROW_IO_ERROR( wxT( "WideStrings6 stream is not fully parsed" ) );
} }
void ALTIUM_PCB::ParseTexts6Data( const ALTIUM_COMPOUND_FILE& aAltiumPcbFile, void ALTIUM_PCB::ParseTexts6Data( const ALTIUM_COMPOUND_FILE& aAltiumPcbFile,
@ -2978,9 +2981,7 @@ void ALTIUM_PCB::ParseTexts6Data( const ALTIUM_COMPOUND_FILE& aAltiumPcbFile
} }
if( reader.GetRemainingBytes() != 0 ) if( reader.GetRemainingBytes() != 0 )
{ THROW_IO_ERROR( wxT( "Texts6 stream is not fully parsed" ) );
THROW_IO_ERROR( "Texts6 stream is not fully parsed" );
}
} }
@ -3021,9 +3022,10 @@ void ALTIUM_PCB::ConvertTexts6ToBoardItemOnLayer( const ATEXT6& aElem, PCB_LAYER
// TODO: improve parsing of variables // TODO: improve parsing of variables
wxString trimmedText = aElem.text; wxString trimmedText = aElem.text;
trimmedText.Trim(); trimmedText.Trim();
if( trimmedText.CmpNoCase( ".Layer_Name" ) == 0 )
if( trimmedText.CmpNoCase( wxT( ".Layer_Name" ) ) == 0 )
{ {
pcbText->SetText( "${LAYER}" ); pcbText->SetText( wxT( "${LAYER}" ) );
} }
else else
{ {
@ -3132,7 +3134,7 @@ void ALTIUM_PCB::ConvertTexts6ToEdaTextSettings( const ATEXT6& aElem, EDA_TEXT*
aEdaText->SetHorizJustify( GR_TEXT_H_ALIGN_RIGHT ); aEdaText->SetHorizJustify( GR_TEXT_H_ALIGN_RIGHT );
break; break;
default: default:
wxLogError( "Unexpected horizontal Text Position. This should never happen." ); wxLogError( wxT( "Unexpected horizontal Text Position. This should never happen." ) );
break; break;
} }
@ -3154,7 +3156,7 @@ void ALTIUM_PCB::ConvertTexts6ToEdaTextSettings( const ATEXT6& aElem, EDA_TEXT*
aEdaText->SetVertJustify( GR_TEXT_V_ALIGN_BOTTOM ); aEdaText->SetVertJustify( GR_TEXT_V_ALIGN_BOTTOM );
break; break;
default: default:
wxLogError( "Unexpected vertical text position. This should never happen." ); wxLogError( wxT( "Unexpected vertical text position. This should never happen." ) );
break; break;
} }
} }

View File

@ -167,43 +167,43 @@ const ALTIUM_RULE_TOKEN& ALTIUM_RULE_TOKENIZER::Next()
nextCh = nextChar(); nextCh = nextChar();
} }
if( identString.IsSameAs( "True", false ) ) if( identString.IsSameAs( wxT( "True" ), false ) )
{ {
m_nextToken = { ALTIUM_RULE_TOKEN_KIND::CONST_TRUE, startPos }; m_nextToken = { ALTIUM_RULE_TOKEN_KIND::CONST_TRUE, startPos };
} }
else if( identString.IsSameAs( "False", false ) ) else if( identString.IsSameAs( wxT( "False" ), false ) )
{ {
m_nextToken = { ALTIUM_RULE_TOKEN_KIND::CONST_FALSE, startPos }; m_nextToken = { ALTIUM_RULE_TOKEN_KIND::CONST_FALSE, startPos };
} }
else if( identString.IsSameAs( "Div", false ) ) else if( identString.IsSameAs( wxT( "Div" ), false ) )
{ {
m_nextToken = { ALTIUM_RULE_TOKEN_KIND::INTEGRAL_DIV, startPos }; m_nextToken = { ALTIUM_RULE_TOKEN_KIND::INTEGRAL_DIV, startPos };
} }
else if( identString.IsSameAs( "Mod", false ) ) else if( identString.IsSameAs( wxT( "Mod" ), false ) )
{ {
m_nextToken = { ALTIUM_RULE_TOKEN_KIND::MOD, startPos }; m_nextToken = { ALTIUM_RULE_TOKEN_KIND::MOD, startPos };
} }
else if( identString.IsSameAs( "And", false ) ) else if( identString.IsSameAs( wxT( "And" ), false ) )
{ {
m_nextToken = { ALTIUM_RULE_TOKEN_KIND::AND, startPos }; m_nextToken = { ALTIUM_RULE_TOKEN_KIND::AND, startPos };
} }
else if( identString.IsSameAs( "Or", false ) ) else if( identString.IsSameAs( wxT( "Or" ), false ) )
{ {
m_nextToken = { ALTIUM_RULE_TOKEN_KIND::OR, startPos }; m_nextToken = { ALTIUM_RULE_TOKEN_KIND::OR, startPos };
} }
else if( identString.IsSameAs( "Xor", false ) ) else if( identString.IsSameAs( wxT( "Xor" ), false ) )
{ {
m_nextToken = { ALTIUM_RULE_TOKEN_KIND::XOR, startPos }; m_nextToken = { ALTIUM_RULE_TOKEN_KIND::XOR, startPos };
} }
else if( identString.IsSameAs( "Not", false ) ) else if( identString.IsSameAs( wxT( "Not" ), false ) )
{ {
m_nextToken = { ALTIUM_RULE_TOKEN_KIND::NOT, startPos }; m_nextToken = { ALTIUM_RULE_TOKEN_KIND::NOT, startPos };
} }
else if( identString.IsSameAs( "Between", false ) ) else if( identString.IsSameAs( wxT( "Between" ), false ) )
{ {
m_nextToken = { ALTIUM_RULE_TOKEN_KIND::BETWEEN, startPos }; m_nextToken = { ALTIUM_RULE_TOKEN_KIND::BETWEEN, startPos };
} }
else if( identString.IsSameAs( "Like", false ) ) else if( identString.IsSameAs( wxT( "Like" ), false ) )
{ {
m_nextToken = { ALTIUM_RULE_TOKEN_KIND::LIKE, startPos }; m_nextToken = { ALTIUM_RULE_TOKEN_KIND::LIKE, startPos };
} }

View File

@ -362,7 +362,7 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadBoardStackup()
break; break;
default: default:
wxFAIL_MSG( "Unexpected Layer type. Was expecting an electrical type" ); wxFAIL_MSG( wxT( "Unexpected Layer type. Was expecting an electrical type" ) );
break; break;
} }
@ -445,11 +445,11 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadBoardStackup()
} }
else if( item->GetType() == BOARD_STACKUP_ITEM_TYPE::BS_ITEM_TYPE_SILKSCREEN ) else if( item->GetType() == BOARD_STACKUP_ITEM_TYPE::BS_ITEM_TYPE_SILKSCREEN )
{ {
item->SetColor( "White" ); item->SetColor( wxT( "White" ) );
} }
else if( item->GetType() == BOARD_STACKUP_ITEM_TYPE::BS_ITEM_TYPE_SOLDERMASK ) else if( item->GetType() == BOARD_STACKUP_ITEM_TYPE::BS_ITEM_TYPE_SOLDERMASK )
{ {
item->SetColor( "Green" ); item->SetColor( wxT( "Green" ) );
} }
} }
@ -544,23 +544,23 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadBoardStackup()
case LAYER_SUBTYPE::LAYERSUBTYPE_NONE: case LAYER_SUBTYPE::LAYERSUBTYPE_NONE:
// Generic Non-electrical layer (older CADSTAR versions). // Generic Non-electrical layer (older CADSTAR versions).
// Attempt to detect technical layers by string matching. // Attempt to detect technical layers by string matching.
if( layerName.Contains( "glue" ) || layerName.Contains( "adhesive" ) ) if( layerName.Contains( wxT( "glue" ) ) || layerName.Contains( wxT( "adhesive" ) ) )
{ {
selectLayerID( PCB_LAYER_ID::F_Adhes, PCB_LAYER_ID::B_Adhes, LOG_LEVEL::MSG ); selectLayerID( PCB_LAYER_ID::F_Adhes, PCB_LAYER_ID::B_Adhes, LOG_LEVEL::MSG );
} }
else if( layerName.Contains( "silk" ) || layerName.Contains( "legend" ) ) else if( layerName.Contains( wxT( "silk" ) ) || layerName.Contains( wxT( "legend" ) ) )
{ {
selectLayerID( PCB_LAYER_ID::F_SilkS, PCB_LAYER_ID::B_SilkS, LOG_LEVEL::MSG ); selectLayerID( PCB_LAYER_ID::F_SilkS, PCB_LAYER_ID::B_SilkS, LOG_LEVEL::MSG );
} }
else if( layerName.Contains( "assembly" ) || layerName.Contains( "fabrication" ) ) else if( layerName.Contains( wxT( "assembly" ) ) || layerName.Contains( wxT( "fabrication" ) ) )
{ {
selectLayerID( PCB_LAYER_ID::F_Fab, PCB_LAYER_ID::B_Fab, LOG_LEVEL::MSG ); selectLayerID( PCB_LAYER_ID::F_Fab, PCB_LAYER_ID::B_Fab, LOG_LEVEL::MSG );
} }
else if( layerName.Contains( "resist" ) || layerName.Contains( "mask" ) ) else if( layerName.Contains( wxT( "resist" ) ) || layerName.Contains( wxT( "mask" ) ) )
{ {
selectLayerID( PCB_LAYER_ID::F_Mask, PCB_LAYER_ID::B_Mask, LOG_LEVEL::MSG ); selectLayerID( PCB_LAYER_ID::F_Mask, PCB_LAYER_ID::B_Mask, LOG_LEVEL::MSG );
} }
else if( layerName.Contains( "paste" ) ) else if( layerName.Contains( wxT( "paste" ) ) )
{ {
selectLayerID( PCB_LAYER_ID::F_Paste, PCB_LAYER_ID::B_Paste, LOG_LEVEL::MSG ); selectLayerID( PCB_LAYER_ID::F_Paste, PCB_LAYER_ID::B_Paste, LOG_LEVEL::MSG );
} }
@ -591,13 +591,13 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadBoardStackup()
break; break;
default: default:
wxFAIL_MSG( "Unknown CADSTAR Layer Sub-type" ); wxFAIL_MSG( wxT( "Unknown CADSTAR Layer Sub-type" ) );
break; break;
} }
break; break;
default: default:
wxFAIL_MSG( "Unknown CADSTAR Layer Type" ); wxFAIL_MSG( wxT( "Unknown CADSTAR Layer Type" ) );
break; break;
} }
@ -648,7 +648,7 @@ void CADSTAR_PCB_ARCHIVE_LOADER::remapUnsureLayers()
{ {
if( layerPair.second == PCB_LAYER_ID::UNDEFINED_LAYER ) if( layerPair.second == PCB_LAYER_ID::UNDEFINED_LAYER )
{ {
wxFAIL_MSG( "Unexpected Layer ID" ); wxFAIL_MSG( wxT( "Unexpected Layer ID" ) );
continue; continue;
} }
@ -762,7 +762,7 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadLibraryFigures( const SYMDEF_PCB& aComponen
drawCadstarShape( fig.Shape, getKiCadLayer( fig.LayerID ), drawCadstarShape( fig.Shape, getKiCadLayer( fig.LayerID ),
getLineThickness( fig.LineCodeID ), getLineThickness( fig.LineCodeID ),
wxString::Format( "Component %s:%s -> Figure %s", wxString::Format( wxT( "Component %s:%s -> Figure %s" ),
aComponent.ReferenceName, aComponent.ReferenceName,
aComponent.Alternate, aComponent.Alternate,
fig.ID ), fig.ID ),
@ -852,7 +852,7 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadLibraryCoppers( const SYMDEF_PCB& aComponen
else else
{ {
drawCadstarShape( compCopper.Shape, copperLayer, lineThickness, drawCadstarShape( compCopper.Shape, copperLayer, lineThickness,
wxString::Format( "Component %s:%s -> Copper element", wxString::Format( wxT( "Component %s:%s -> Copper element" ),
aComponent.ReferenceName, aComponent.Alternate ), aComponent.ReferenceName, aComponent.Alternate ),
aFootprint ); aFootprint );
} }
@ -941,7 +941,7 @@ PAD* CADSTAR_PCB_ARCHIVE_LOADER::getKiCadPad( const COMPONENT_PAD& aCadstarPad,
break; break;
default: default:
wxFAIL_MSG( "Unknown Pad type" ); wxFAIL_MSG( wxT( "Unknown Pad type" ) );
} }
pad->SetAttribute( PAD_ATTRIB::SMD ); // assume SMD pad for now pad->SetAttribute( PAD_ATTRIB::SMD ); // assume SMD pad for now
@ -1121,7 +1121,7 @@ PAD* CADSTAR_PCB_ARCHIVE_LOADER::getKiCadPad( const COMPONENT_PAD& aCadstarPad,
break; break;
default: default:
wxFAIL_MSG( "Unknown Pad Shape" ); wxFAIL_MSG( wxT( "Unknown Pad Shape" ) );
} }
if( csPadcode.ReliefClearance != UNDEFINED_VALUE ) if( csPadcode.ReliefClearance != UNDEFINED_VALUE )
@ -1210,7 +1210,7 @@ PAD* CADSTAR_PCB_ARCHIVE_LOADER::getKiCadPad( const COMPONENT_PAD& aCadstarPad,
} }
else else
{ {
wxFAIL_MSG( "No copper layers defined in the pad?" ); wxFAIL_MSG( wxT( "No copper layers defined in the pad?" ) );
csPadcode.SlotOrientation = 0; csPadcode.SlotOrientation = 0;
pad->SetOffset( drillOffset ); pad->SetOffset( drillOffset );
} }
@ -1317,8 +1317,9 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadBoards()
CADSTAR_BOARD& board = boardPair.second; CADSTAR_BOARD& board = boardPair.second;
GROUP_ID boardGroup = createUniqueGroupID( wxT( "Board" ) ); GROUP_ID boardGroup = createUniqueGroupID( wxT( "Board" ) );
drawCadstarShape( board.Shape, PCB_LAYER_ID::Edge_Cuts, drawCadstarShape( board.Shape, PCB_LAYER_ID::Edge_Cuts,
getLineThickness( board.LineCodeID ), wxString::Format( "BOARD %s", board.ID ), getLineThickness( board.LineCodeID ),
m_board, boardGroup ); wxString::Format( wxT( "BOARD %s" ), board.ID ),
m_board, boardGroup );
if( !board.GroupID.IsEmpty() ) if( !board.GroupID.IsEmpty() )
{ {
@ -1336,7 +1337,8 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadFigures()
{ {
FIGURE& fig = figPair.second; FIGURE& fig = figPair.second;
drawCadstarShape( fig.Shape, getKiCadLayer( fig.LayerID ), drawCadstarShape( fig.Shape, getKiCadLayer( fig.LayerID ),
getLineThickness( fig.LineCodeID ), wxString::Format( "FIGURE %s", fig.ID ), getLineThickness( fig.LineCodeID ),
wxString::Format( wxT( "FIGURE %s" ), fig.ID ),
m_board, fig.GroupID ); m_board, fig.GroupID );
//TODO process "swaprule" (doesn't seem to apply to Layout Figures?) //TODO process "swaprule" (doesn't seem to apply to Layout Figures?)
@ -1794,10 +1796,10 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadDocumentationSymbols()
{ {
FIGURE fig = figPair.second; FIGURE fig = figPair.second;
drawCadstarShape( fig.Shape, layer, getLineThickness( fig.LineCodeID ), drawCadstarShape( fig.Shape, layer, getLineThickness( fig.LineCodeID ),
wxString::Format( "DOCUMENTATION SYMBOL %s, FIGURE %s", wxString::Format( wxT( "DOCUMENTATION SYMBOL %s, FIGURE %s" ),
docSymDefinition.ReferenceName, fig.ID ), docSymDefinition.ReferenceName, fig.ID ),
m_board, groupID, moveVector, rotationAngle, scalingFactor, m_board, groupID, moveVector, rotationAngle, scalingFactor,
centreOfTransform, mirrorInvert ); centreOfTransform, mirrorInvert );
} }
} }
@ -2176,7 +2178,7 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadNets()
std::map<NETELEMENT_ID, long> netelementSizes; std::map<NETELEMENT_ID, long> netelementSizes;
if( netnameForErrorReporting.IsEmpty() ) if( netnameForErrorReporting.IsEmpty() )
netnameForErrorReporting = wxString::Format( "$%ld", net.SignalNum ); netnameForErrorReporting = wxString::Format( wxT( "$%ld" ), net.SignalNum );
for( std::pair<NETELEMENT_ID, NET_PCB::VIA> viaPair : net.Vias ) for( std::pair<NETELEMENT_ID, NET_PCB::VIA> viaPair : net.Vias )
{ {
@ -2601,7 +2603,7 @@ void CADSTAR_PCB_ARCHIVE_LOADER::drawCadstarText(
break; break;
default: default:
wxFAIL_MSG( "Unknown Alignment - needs review!" ); wxFAIL_MSG( wxT( "Unknown Alignment - needs review!" ) );
} }
if( aMirrorInvert ) if( aMirrorInvert )
@ -3034,7 +3036,7 @@ SHAPE_LINE_CHAIN CADSTAR_PCB_ARCHIVE_LOADER::getLineChainFromShapes( const std::
break; break;
default: default:
wxFAIL_MSG( "Drawsegment type is unexpected. Ignored." ); wxFAIL_MSG( wxT( "Drawsegment type is unexpected. Ignored." ) );
} }
} }
@ -3124,7 +3126,7 @@ std::vector<PCB_TRACK*> CADSTAR_PCB_ARCHIVE_LOADER::makeTracksFromShapes(
break; break;
default: default:
wxFAIL_MSG( "Drawsegment type is unexpected. Ignored." ); wxFAIL_MSG( wxT( "Drawsegment type is unexpected. Ignored." ) );
continue; continue;
} }
@ -3323,7 +3325,7 @@ void CADSTAR_PCB_ARCHIVE_LOADER::addAttribute( const ATTRIBUTE_LOCATION& aCadsta
break; break;
default: default:
wxFAIL_MSG( "Unknown Alignment - needs review!" ); wxFAIL_MSG( wxT( "Unknown Alignment - needs review!" ) );
} }
//TODO Handle different font types when KiCad can support it. //TODO Handle different font types when KiCad can support it.
@ -3619,7 +3621,7 @@ void CADSTAR_PCB_ARCHIVE_LOADER::applyDimensionSettings( const DIMENSION& aCads
suffix = ParseTextFields( remainingStr.Mid( endpos + 2 ), &m_context ); suffix = ParseTextFields( remainingStr.Mid( endpos + 2 ), &m_context );
} }
if( suffix.StartsWith( "mm" ) ) if( suffix.StartsWith( wxT( "mm" ) ) )
{ {
aKiCadDim->SetUnitsFormat( DIM_UNITS_FORMAT::BARE_SUFFIX ); aKiCadDim->SetUnitsFormat( DIM_UNITS_FORMAT::BARE_SUFFIX );
suffix = suffix.Mid( 2 ); suffix = suffix.Mid( 2 );
@ -3663,7 +3665,7 @@ void CADSTAR_PCB_ARCHIVE_LOADER::applyDimensionSettings( const DIMENSION& aCads
break; break;
case UNITS::DESIGN: case UNITS::DESIGN:
wxFAIL_MSG( "We should have handled design units before coming here!" ); wxFAIL_MSG( wxT( "We should have handled design units before coming here!" ) );
break; break;
} }
} }
@ -3675,7 +3677,7 @@ bool CADSTAR_PCB_ARCHIVE_LOADER::calculateZonePriorities( PCB_LAYER_ID& aLayer )
auto inflateValue = auto inflateValue =
[&]( ZONE* aZoneA, ZONE* aZoneB ) [&]( ZONE* aZoneA, ZONE* aZoneB )
{ {
int extra = getKiCadLength( Assignments.Codedefs.SpacingCodes.at( "C_C" ).Spacing ) int extra = getKiCadLength( Assignments.Codedefs.SpacingCodes.at( wxT( "C_C" ) ).Spacing )
- m_board->GetDesignSettings().m_MinClearance; - m_board->GetDesignSettings().m_MinClearance;
int retval = std::max( aZoneA->GetLocalClearance(), aZoneB->GetLocalClearance() ); int retval = std::max( aZoneA->GetLocalClearance(), aZoneB->GetLocalClearance() );
@ -3916,24 +3918,24 @@ NETINFO_ITEM* CADSTAR_PCB_ARCHIVE_LOADER::getKiCadNet( const NET_ID& aCadstarNet
FOOTPRINT* m = getFootprintFromCadstarID( firstPin.ComponentID ); FOOTPRINT* m = getFootprintFromCadstarID( firstPin.ComponentID );
newName = wxT( "Net-(" ); newName = wxT( "Net-(" );
newName << m->Reference().GetText(); newName << m->Reference().GetText();
newName << "-Pad" << wxString::Format( "%ld", firstPin.PadID ) << ")"; newName << wxT( "-Pad" ) << wxString::Format( wxT( "%ld" ), firstPin.PadID );
newName << wxT( ")" );
} }
else else
{ {
wxFAIL_MSG( "A net with no pins associated?" ); wxFAIL_MSG( wxT( "A net with no pins associated?" ) );
newName = wxT( "csNet-" ); newName = wxT( "csNet-" );
newName << wxString::Format( "%i", csNet.SignalNum ); newName << wxString::Format( wxT( "%i" ), csNet.SignalNum );
} }
} }
if( !m_doneNetClassWarning && !csNet.NetClassID.IsEmpty() if( !m_doneNetClassWarning && !csNet.NetClassID.IsEmpty()
&& csNet.NetClassID != wxT( "NONE" ) ) && csNet.NetClassID != wxT( "NONE" ) )
{ {
wxLogMessage( wxLogMessage( _( "The CADSTAR design contains nets with a 'Net Class' assigned. KiCad "
_( "The CADSTAR design contains nets with a 'Net Class' assigned. KiCad does " "does not have an equivalent to CADSTAR's Net Class so these elements "
"not have an equivalent to CADSTAR's Net Class so these elements were not " "were not imported. Note: KiCad's version of 'Net Class' is closer to "
"imported. Note: KiCad's version of 'Net Class' is closer to CADSTAR's " "CADSTAR's 'Net Route Code' (which has been imported for all nets)." ) );
"'Net Route Code' (which has been imported for all nets)." ) );
m_doneNetClassWarning = true; m_doneNetClassWarning = true;
} }
@ -4123,7 +4125,7 @@ CADSTAR_PCB_ARCHIVE_LOADER::GROUP_ID CADSTAR_PCB_ARCHIVE_LOADER::createUniqueGro
while( m_groupMap.find( groupName ) != m_groupMap.end() ) while( m_groupMap.find( groupName ) != m_groupMap.end() )
{ {
groupName = aName + wxT( "_" ) + wxString::Format( "%i", ++num ); groupName = aName + wxT( "_" ) + wxString::Format( wxT( "%i" ), ++num );
} }
PCB_GROUP* docSymGroup = new PCB_GROUP( m_board ); PCB_GROUP* docSymGroup = new PCB_GROUP( m_board );

View File

@ -76,14 +76,14 @@ void CADSTAR_PCB_ARCHIVE_PARSER::Parse()
{ {
if( Header.Format.Type == wxT( "LIBRARY" ) ) if( Header.Format.Type == wxT( "LIBRARY" ) )
{ {
THROW_IO_ERROR( "The selected file is a CADSTAR library file (as opposed to a " THROW_IO_ERROR( wxT( "The selected file is a CADSTAR library file (as opposed "
"layout file). CADSTAR libraries cannot yet be imported into " "to a layout file). CADSTAR libraries cannot yet be "
"KiCad." ); "imported into KiCad." ) );
} }
else else
{ {
THROW_IO_ERROR( "The selected file is an unknown CADSTAR format so cannot be " THROW_IO_ERROR( wxT( "The selected file is an unknown CADSTAR format so "
"imported into KiCad." ); "cannot be imported into KiCad." ) );
} }
} }
} }
@ -333,15 +333,15 @@ void CADSTAR_PCB_ARCHIVE_PARSER::MATERIAL::Parse( XNODE* aNode, PARSER_CONTEXT*
} }
else else
{ {
THROW_UNKNOWN_PARAMETER_IO_ERROR( sType, wxString::Format( "MATERIAL %s", Name ) ); THROW_UNKNOWN_PARAMETER_IO_ERROR( sType, wxString::Format( wxT( "MATERIAL %s" ), Name ) );
} }
XNODE* iNode = aNode->GetChildren(); XNODE* iNode = aNode->GetChildren();
if( !iNode ) if( !iNode )
{ {
THROW_MISSING_PARAMETER_IO_ERROR( THROW_MISSING_PARAMETER_IO_ERROR( wxT( "RESISTIVITY" ),
wxT( "RESISTIVITY" ), wxString::Format( "MATERIAL %s", Name ) ); wxString::Format( wxT( "MATERIAL %s" ), Name ) );
} }
for( ; iNode; iNode = iNode->GetNext() ) for( ; iNode; iNode = iNode->GetNext() )
@ -362,7 +362,7 @@ void CADSTAR_PCB_ARCHIVE_PARSER::MATERIAL::Parse( XNODE* aNode, PARSER_CONTEXT*
} }
else else
{ {
THROW_UNKNOWN_NODE_IO_ERROR( nodeName, wxString::Format( "MATERIAL %s", Name ) ); THROW_UNKNOWN_NODE_IO_ERROR( nodeName, wxString::Format( wxT( "MATERIAL %s" ), Name ) );
} }
} }
} }
@ -412,14 +412,16 @@ void CADSTAR_PCB_ARCHIVE_PARSER::LAYER::Parse( XNODE* aNode, PARSER_CONTEXT* aCo
} }
else else
{ {
THROW_UNKNOWN_PARAMETER_IO_ERROR( THROW_UNKNOWN_PARAMETER_IO_ERROR( embedsValue,
embedsValue, wxString::Format( "LAYER %s -> EMBEDS", Name ) ); wxString::Format( wxT( "LAYER %s -> EMBEDS" ),
Name ) );
} }
} }
else else
{ {
THROW_UNKNOWN_NODE_IO_ERROR( childOfTempNode->GetName(), THROW_UNKNOWN_NODE_IO_ERROR( childOfTempNode->GetName(),
wxString::Format( "LAYER %s->MAKE", Name ) ); wxString::Format( wxT( "LAYER %s->MAKE" ),
Name ) );
} }
} }
} }
@ -449,13 +451,15 @@ void CADSTAR_PCB_ARCHIVE_PARSER::LAYER::Parse( XNODE* aNode, PARSER_CONTEXT* aCo
} }
else else
{ {
THROW_UNKNOWN_PARAMETER_IO_ERROR( THROW_UNKNOWN_PARAMETER_IO_ERROR( bias,
bias, wxString::Format( "LAYER %s -> BIAS", Name ) ); wxString::Format( wxT( "LAYER %s -> BIAS" ),
Name ) );
} }
} }
else else
{ {
THROW_UNKNOWN_NODE_IO_ERROR( tempNodeName, wxString::Format( "LAYER %s", Name ) ); THROW_UNKNOWN_NODE_IO_ERROR( tempNodeName, wxString::Format( wxT( "LAYER %s" ),
Name ) );
} }
} }
}; };
@ -562,13 +566,13 @@ void CADSTAR_PCB_ARCHIVE_PARSER::LAYER::Parse( XNODE* aNode, PARSER_CONTEXT* aCo
} }
else else
{ {
THROW_UNKNOWN_PARAMETER_IO_ERROR( THROW_UNKNOWN_PARAMETER_IO_ERROR( sSubType, wxString::Format( wxT( "LAYER %s %s" ),
sSubType, wxString::Format( "LAYER %s %s", Name, cNodeName ) ); Name, cNodeName ) );
} }
} }
else else
{ {
THROW_UNKNOWN_NODE_IO_ERROR( cNodeName, wxString::Format( "LAYER %s", Name ) ); THROW_UNKNOWN_NODE_IO_ERROR( cNodeName, wxString::Format( wxT( "LAYER %s" ), Name ) );
} }
} }
} }
@ -762,7 +766,7 @@ void CADSTAR_PCB_ARCHIVE_PARSER::PADCODE::Parse( XNODE* aNode, PARSER_CONTEXT* a
Name = GetXmlAttributeIDString( aNode, 1 ); Name = GetXmlAttributeIDString( aNode, 1 );
XNODE* cNode = aNode->GetChildren(); XNODE* cNode = aNode->GetChildren();
wxString location = wxString::Format( "PADCODE -> %s", Name ); wxString location = wxString::Format( wxT( "PADCODE -> %s" ), Name );
for( ; cNode; cNode = cNode->GetNext() ) for( ; cNode; cNode = cNode->GetNext() )
{ {
@ -850,7 +854,7 @@ void CADSTAR_PCB_ARCHIVE_PARSER::VIACODE::Parse( XNODE* aNode, PARSER_CONTEXT* a
Name = GetXmlAttributeIDString( aNode, 1 ); Name = GetXmlAttributeIDString( aNode, 1 );
XNODE* cNode = aNode->GetChildren(); XNODE* cNode = aNode->GetChildren();
wxString location = wxString::Format( "VIACODE -> %s", Name ); wxString location = wxString::Format( wxT( "VIACODE -> %s" ), Name );
for( ; cNode; cNode = cNode->GetNext() ) for( ; cNode; cNode = cNode->GetNext() )
{ {
@ -907,7 +911,7 @@ void CADSTAR_PCB_ARCHIVE_PARSER::LAYERPAIR::Parse( XNODE* aNode, PARSER_CONTEXT*
PhysicalLayerStart = GetXmlAttributeIDLong( aNode, 2 ); PhysicalLayerStart = GetXmlAttributeIDLong( aNode, 2 );
PhysicalLayerEnd = GetXmlAttributeIDLong( aNode, 3 ); PhysicalLayerEnd = GetXmlAttributeIDLong( aNode, 3 );
wxString location = wxString::Format( "LAYERPAIR -> %s", Name ); wxString location = wxString::Format( wxT( "LAYERPAIR -> %s" ), Name );
if( aNode->GetChildren() ) if( aNode->GetChildren() )
{ {
@ -1075,7 +1079,7 @@ void CADSTAR_PCB_ARCHIVE_PARSER::COMPONENT_AREA::Parse( XNODE* aNode, PARSER_CON
XNODE* cNode = aNode->GetChildren(); XNODE* cNode = aNode->GetChildren();
bool shapeIsInitialised = false; // Stop more than one Shape Object bool shapeIsInitialised = false; // Stop more than one Shape Object
wxString location = wxString::Format( "COMPAREA %s", ID ); wxString location = wxString::Format( wxT( "COMPAREA %s" ), ID );
if( !cNode ) if( !cNode )
THROW_MISSING_NODE_IO_ERROR( wxT( "Shape" ), location ); THROW_MISSING_NODE_IO_ERROR( wxT( "Shape" ), location );
@ -1166,7 +1170,7 @@ void CADSTAR_PCB_ARCHIVE_PARSER::COMPONENT_PAD::Parse( XNODE* aNode, PARSER_CONT
Side = GetPadSide( GetXmlAttributeIDString( aNode, 3 ) ); Side = GetPadSide( GetXmlAttributeIDString( aNode, 3 ) );
XNODE* cNode = aNode->GetChildren(); XNODE* cNode = aNode->GetChildren();
wxString location = wxString::Format( "PAD %ld", ID ); wxString location = wxString::Format( wxT( "PAD %ld" ), ID );
if( !cNode ) if( !cNode )
THROW_MISSING_NODE_IO_ERROR( wxT( "PT" ), location ); THROW_MISSING_NODE_IO_ERROR( wxT( "PT" ), location );
@ -1343,7 +1347,7 @@ void CADSTAR_PCB_ARCHIVE_PARSER::DIMENSION::LINE::Parse( XNODE* aNode, PARSER_CO
else if( aNode->GetName() == wxT( "ANGULARLINE" ) ) else if( aNode->GetName() == wxT( "ANGULARLINE" ) )
Type = TYPE::ANGULARLINE; Type = TYPE::ANGULARLINE;
else else
wxASSERT_MSG( true, "Not a valid type. What happened to the node Name?" ); wxASSERT_MSG( true, wxT( "Not a valid type. What happened to the node Name?" ) );
LineCodeID = GetXmlAttributeIDString( aNode, 0 ); LineCodeID = GetXmlAttributeIDString( aNode, 0 );
@ -1424,7 +1428,7 @@ void CADSTAR_PCB_ARCHIVE_PARSER::DIMENSION::Parse( XNODE* aNode, PARSER_CONTEXT*
//make sure aNode is valid TYPE //make sure aNode is valid TYPE
wxASSERT_MSG( typeMap.find( aNode->GetName() ) != typeMap.end(), wxASSERT_MSG( typeMap.find( aNode->GetName() ) != typeMap.end(),
"Not a valid type. What happened to the node Name?" ); wxT( "Not a valid type. What happened to the node Name?" ) );
Type = typeMap[aNode->GetName()]; Type = typeMap[aNode->GetName()];
LayerID = GetXmlAttributeIDString( aNode, 1 ); LayerID = GetXmlAttributeIDString( aNode, 1 );
@ -1632,7 +1636,7 @@ void CADSTAR_PCB_ARCHIVE_PARSER::CADSTAR_BOARD::Parse( XNODE* aNode, PARSER_CONT
XNODE* cNode = aNode->GetChildren(); XNODE* cNode = aNode->GetChildren();
bool shapeIsInitialised = false; // Stop more than one Shape Object bool shapeIsInitialised = false; // Stop more than one Shape Object
wxString location = wxString::Format( "BOARD %s", ID ); wxString location = wxString::Format( wxT( "BOARD %s" ), ID );
if( !cNode ) if( !cNode )
THROW_MISSING_NODE_IO_ERROR( wxT( "Shape" ), location ); THROW_MISSING_NODE_IO_ERROR( wxT( "Shape" ), location );
@ -1683,7 +1687,7 @@ void CADSTAR_PCB_ARCHIVE_PARSER::AREA::Parse( XNODE* aNode, PARSER_CONTEXT* aCon
XNODE* cNode = aNode->GetChildren(); XNODE* cNode = aNode->GetChildren();
bool shapeIsInitialised = false; // Stop more than one Shape Object bool shapeIsInitialised = false; // Stop more than one Shape Object
wxString location = wxString::Format( "AREA %s", ID ); wxString location = wxString::Format( wxT( "AREA %s" ), ID );
if( !cNode ) if( !cNode )
THROW_MISSING_NODE_IO_ERROR( wxT( "Shape" ), location ); THROW_MISSING_NODE_IO_ERROR( wxT( "Shape" ), location );

View File

@ -152,7 +152,7 @@ static wxString interpret_text( const wxString& aText )
continue; continue;
} }
static wxString escapeChars( " )]}'\"" ); static wxString escapeChars( wxT( " )]}'\"" ) );
if( i + 1 != aText.size() && escapeChars.Find( aText[i + 1] ) == wxNOT_FOUND ) if( i + 1 != aText.size() && escapeChars.Find( aText[i + 1] ) == wxNOT_FOUND )
{ {
@ -217,52 +217,52 @@ void ERULES::parse( wxXmlNode* aRules, std::function<void()> aCheckpoint )
{ {
aCheckpoint(); aCheckpoint();
if( child->GetName() == "param" ) if( child->GetName() == wxT( "param" ) )
{ {
const wxString& name = child->GetAttribute( "name" ); const wxString& name = child->GetAttribute( wxT( "name" ) );
const wxString& value = child->GetAttribute( "value" ); const wxString& value = child->GetAttribute( wxT( "value" ) );
if( name == "psElongationLong" ) if( name == wxT( "psElongationLong" ) )
psElongationLong = wxAtoi( value ); psElongationLong = wxAtoi( value );
else if( name == "psElongationOffset" ) else if( name == wxT( "psElongationOffset" ) )
psElongationOffset = wxAtoi( value ); psElongationOffset = wxAtoi( value );
else if( name == "mvStopFrame" ) else if( name == wxT( "mvStopFrame" ) )
value.ToCDouble( &mvStopFrame ); value.ToCDouble( &mvStopFrame );
else if( name == "mvCreamFrame" ) else if( name == wxT( "mvCreamFrame" ) )
value.ToCDouble( &mvCreamFrame ); value.ToCDouble( &mvCreamFrame );
else if( name == "mlMinStopFrame" ) else if( name == wxT( "mlMinStopFrame" ) )
mlMinStopFrame = parseEagle( value ); mlMinStopFrame = parseEagle( value );
else if( name == "mlMaxStopFrame" ) else if( name == wxT( "mlMaxStopFrame" ) )
mlMaxStopFrame = parseEagle( value ); mlMaxStopFrame = parseEagle( value );
else if( name == "mlMinCreamFrame" ) else if( name == wxT( "mlMinCreamFrame" ) )
mlMinCreamFrame = parseEagle( value ); mlMinCreamFrame = parseEagle( value );
else if( name == "mlMaxCreamFrame" ) else if( name == wxT( "mlMaxCreamFrame" ) )
mlMaxCreamFrame = parseEagle( value ); mlMaxCreamFrame = parseEagle( value );
else if( name == "srRoundness" ) else if( name == wxT( "srRoundness" ) )
value.ToCDouble( &srRoundness ); value.ToCDouble( &srRoundness );
else if( name == "srMinRoundness" ) else if( name == wxT( "srMinRoundness" ) )
srMinRoundness = parseEagle( value ); srMinRoundness = parseEagle( value );
else if( name == "srMaxRoundness" ) else if( name == wxT( "srMaxRoundness" ) )
srMaxRoundness = parseEagle( value ); srMaxRoundness = parseEagle( value );
else if( name == "psTop" ) else if( name == wxT( "psTop" ) )
psTop = wxAtoi( value ); psTop = wxAtoi( value );
else if( name == "psBottom" ) else if( name == wxT( "psBottom" ) )
psBottom = wxAtoi( value ); psBottom = wxAtoi( value );
else if( name == "psFirst" ) else if( name == wxT( "psFirst" ) )
psFirst = wxAtoi( value ); psFirst = wxAtoi( value );
else if( name == "rvPadTop" ) else if( name == wxT( "rvPadTop" ) )
value.ToCDouble( &rvPadTop ); value.ToCDouble( &rvPadTop );
else if( name == "rlMinPadTop" ) else if( name == wxT( "rlMinPadTop" ) )
rlMinPadTop = parseEagle( value ); rlMinPadTop = parseEagle( value );
else if( name == "rlMaxPadTop" ) else if( name == wxT( "rlMaxPadTop" ) )
rlMaxPadTop = parseEagle( value ); rlMaxPadTop = parseEagle( value );
else if( name == "rvViaOuter" ) else if( name == wxT( "rvViaOuter" ) )
value.ToCDouble( &rvViaOuter ); value.ToCDouble( &rvViaOuter );
else if( name == "rlMinViaOuter" ) else if( name == wxT( "rlMinViaOuter" ) )
rlMinViaOuter = parseEagle( value ); rlMinViaOuter = parseEagle( value );
else if( name == "rlMaxViaOuter" ) else if( name == wxT( "rlMaxViaOuter" ) )
rlMaxViaOuter = parseEagle( value ); rlMaxViaOuter = parseEagle( value );
else if( name == "mdWireWire" ) else if( name == wxT( "mdWireWire" ) )
mdWireWire = parseEagle( value ); mdWireWire = parseEagle( value );
} }
@ -321,7 +321,7 @@ void EAGLE_PLUGIN::checkpoint()
/ std::max( 1U, m_totalCount ) ); / std::max( 1U, m_totalCount ) );
if( !m_progressReporter->KeepRefreshing() ) if( !m_progressReporter->KeepRefreshing() )
THROW_IO_ERROR( ( "Open cancelled by user." ) ); THROW_IO_ERROR( _( "Open cancelled by user." ) );
m_lastProgressCount = m_doneCount; m_lastProgressCount = m_doneCount;
} }
@ -363,7 +363,7 @@ BOARD* EAGLE_PLUGIN::Load( const wxString& aFileName, BOARD* aAppendToMe,
m_progressReporter->Report( wxString::Format( _( "Loading %s..." ), aFileName ) ); m_progressReporter->Report( wxString::Format( _( "Loading %s..." ), aFileName ) );
if( !m_progressReporter->KeepRefreshing() ) if( !m_progressReporter->KeepRefreshing() )
THROW_IO_ERROR( ( "Open cancelled by user." ) ); THROW_IO_ERROR( _( "Open cancelled by user." ) );
} }
wxFileName fn = aFileName; wxFileName fn = aFileName;
@ -404,7 +404,7 @@ BOARD* EAGLE_PLUGIN::Load( const wxString& aFileName, BOARD* aAppendToMe,
if( m_rules->mdWireWire ) if( m_rules->mdWireWire )
designSettings.m_MinClearance = KiROUND( m_rules->mdWireWire ); designSettings.m_MinClearance = KiROUND( m_rules->mdWireWire );
NETCLASS defaults( "dummy" ); NETCLASS defaults( wxT( "dummy" ) );
auto finishNetclass = auto finishNetclass =
[&]( NETCLASSPTR netclass ) [&]( NETCLASSPTR netclass )
@ -431,7 +431,7 @@ BOARD* EAGLE_PLUGIN::Load( const wxString& aFileName, BOARD* aAppendToMe,
m_board->m_LegacyNetclassesLoaded = true; m_board->m_LegacyNetclassesLoaded = true;
m_board->m_LegacyDesignSettingsLoaded = true; m_board->m_LegacyDesignSettingsLoaded = true;
fn.SetExt( "kicad_dru" ); fn.SetExt( wxT( "kicad_dru" ) );
wxFile rulesFile( fn.GetFullPath(), wxFile::write ); wxFile rulesFile( fn.GetFullPath(), wxFile::write );
rulesFile.Write( m_customRules ); rulesFile.Write( m_customRules );
@ -442,7 +442,7 @@ BOARD* EAGLE_PLUGIN::Load( const wxString& aFileName, BOARD* aAppendToMe,
{ {
wxString errmsg = exc.what(); wxString errmsg = exc.what();
errmsg += "\n@ "; errmsg += wxT( "\n@ " );
errmsg += m_xpath->Contents(); errmsg += m_xpath->Contents();
THROW_IO_ERROR( errmsg ); THROW_IO_ERROR( errmsg );
@ -692,7 +692,7 @@ void EAGLE_PLUGIN::loadPlain( wxXmlNode* aGraphics )
wxString grName = gr->GetName(); wxString grName = gr->GetName();
if( grName == "wire" ) if( grName == wxT( "wire" ) )
{ {
m_xpath->push( "wire" ); m_xpath->push( "wire" );
@ -735,7 +735,7 @@ void EAGLE_PLUGIN::loadPlain( wxXmlNode* aGraphics )
m_xpath->pop(); m_xpath->pop();
} }
else if( grName == "text" ) else if( grName == wxT( "text" ) )
{ {
m_xpath->push( "text" ); m_xpath->push( "text" );
@ -856,7 +856,7 @@ void EAGLE_PLUGIN::loadPlain( wxXmlNode* aGraphics )
m_xpath->pop(); m_xpath->pop();
} }
else if( grName == "circle" ) else if( grName == wxT( "circle" ) )
{ {
m_xpath->push( "circle" ); m_xpath->push( "circle" );
@ -922,7 +922,7 @@ void EAGLE_PLUGIN::loadPlain( wxXmlNode* aGraphics )
m_xpath->pop(); m_xpath->pop();
} }
else if( grName == "rectangle" ) else if( grName == wxT( "rectangle" ) )
{ {
// This seems to be a simplified rectangular [copper] zone, cannot find any // This seems to be a simplified rectangular [copper] zone, cannot find any
// net related info on it from the DTD. // net related info on it from the DTD.
@ -958,7 +958,7 @@ void EAGLE_PLUGIN::loadPlain( wxXmlNode* aGraphics )
m_xpath->pop(); m_xpath->pop();
} }
else if( grName == "hole" ) else if( grName == wxT( "hole" ) )
{ {
m_xpath->push( "hole" ); m_xpath->push( "hole" );
@ -967,24 +967,24 @@ void EAGLE_PLUGIN::loadPlain( wxXmlNode* aGraphics )
FOOTPRINT* footprint = new FOOTPRINT( m_board ); FOOTPRINT* footprint = new FOOTPRINT( m_board );
m_board->Add( footprint, ADD_MODE::APPEND ); m_board->Add( footprint, ADD_MODE::APPEND );
footprint->SetReference( wxString::Format( "@HOLE%d", m_hole_count++ ) ); footprint->SetReference( wxString::Format( wxT( "@HOLE%d" ), m_hole_count++ ) );
footprint->Reference().SetVisible( false ); footprint->Reference().SetVisible( false );
packageHole( footprint, gr, true ); packageHole( footprint, gr, true );
m_xpath->pop(); m_xpath->pop();
} }
else if( grName == "frame" ) else if( grName == wxT( "frame" ) )
{ {
// picture this // picture this
} }
else if( grName == "polygon" ) else if( grName == wxT( "polygon" ) )
{ {
m_xpath->push( "polygon" ); m_xpath->push( "polygon" );
loadPolygon( gr ); loadPolygon( gr );
m_xpath->pop(); // "polygon" m_xpath->pop(); // "polygon"
} }
else if( grName == "dimension" ) else if( grName == wxT( "dimension" ) )
{ {
EDIMENSION d( gr ); EDIMENSION d( gr );
PCB_LAYER_ID layer = kicad_layer( d.layer ); PCB_LAYER_ID layer = kicad_layer( d.layer );
@ -1000,13 +1000,13 @@ void EAGLE_PLUGIN::loadPlain( wxXmlNode* aGraphics )
// Eagle dimension graphic arms may have different lengths, but they look // Eagle dimension graphic arms may have different lengths, but they look
// incorrect in KiCad (the graphic is tilted). Make them even length in // incorrect in KiCad (the graphic is tilted). Make them even length in
// such case. // such case.
if( *d.dimensionType == "horizontal" ) if( *d.dimensionType == wxT( "horizontal" ) )
{ {
int newY = ( d.y1.ToPcbUnits() + d.y2.ToPcbUnits() ) / 2; int newY = ( d.y1.ToPcbUnits() + d.y2.ToPcbUnits() ) / 2;
d.y1 = ECOORD( newY, ECOORD::EAGLE_UNIT::EU_NM ); d.y1 = ECOORD( newY, ECOORD::EAGLE_UNIT::EU_NM );
d.y2 = ECOORD( newY, ECOORD::EAGLE_UNIT::EU_NM ); d.y2 = ECOORD( newY, ECOORD::EAGLE_UNIT::EU_NM );
} }
else if( *d.dimensionType == "vertical" ) else if( *d.dimensionType == wxT( "vertical" ) )
{ {
int newX = ( d.x1.ToPcbUnits() + d.x2.ToPcbUnits() ) / 2; int newX = ( d.x1.ToPcbUnits() + d.x2.ToPcbUnits() ) / 2;
d.x1 = ECOORD( newX, ECOORD::EAGLE_UNIT::EU_NM ); d.x1 = ECOORD( newX, ECOORD::EAGLE_UNIT::EU_NM );
@ -1144,7 +1144,7 @@ void EAGLE_PLUGIN::loadElements( wxXmlNode* aElements )
{ {
checkpoint(); checkpoint();
if( element->GetName() != "element" ) if( element->GetName() != wxT( "element" ) )
{ {
// Get next item // Get next item
element = element->GetNext(); element = element->GetNext();
@ -1239,7 +1239,7 @@ void EAGLE_PLUGIN::loadElements( wxXmlNode* aElements )
while( attribute ) while( attribute )
{ {
if( attribute->GetName() != "attribute" ) if( attribute->GetName() != wxT( "attribute" ) )
{ {
attribute = attribute->GetNext(); attribute = attribute->GetNext();
continue; continue;
@ -1247,7 +1247,7 @@ void EAGLE_PLUGIN::loadElements( wxXmlNode* aElements )
EATTR a( attribute ); EATTR a( attribute );
if( a.name == "NAME" ) if( a.name == wxT( "NAME" ) )
{ {
name = a; name = a;
nameAttr = &name; nameAttr = &name;
@ -1267,7 +1267,7 @@ void EAGLE_PLUGIN::loadElements( wxXmlNode* aElements )
// annotation. If the reference begins with a number, we prepend // annotation. If the reference begins with a number, we prepend
// 'UNK' (unknown) for the symbol designator. // 'UNK' (unknown) for the symbol designator.
if( reference.find_first_not_of( "0123456789" ) == wxString::npos ) if( reference.find_first_not_of( "0123456789" ) == wxString::npos )
reference.Prepend( "UNK" ); reference.Prepend( wxT( "UNK" ) );
nameAttr->name = reference; nameAttr->name = reference;
footprint->SetReference( reference ); footprint->SetReference( reference );
@ -1291,8 +1291,8 @@ void EAGLE_PLUGIN::loadElements( wxXmlNode* aElements )
if( refanceNamePresetInPackageLayout ) if( refanceNamePresetInPackageLayout )
footprint->Reference().SetVisible( true ); footprint->Reference().SetVisible( true );
nameAttr->name = nameAttr->name + " = " + e.name; nameAttr->name = nameAttr->name + wxT( " = " ) + e.name;
footprint->SetReference( "NAME = " + e.name ); footprint->SetReference( wxT( "NAME = " ) + e.name );
break; break;
case EATTR::Off : case EATTR::Off :
@ -1312,7 +1312,7 @@ void EAGLE_PLUGIN::loadElements( wxXmlNode* aElements )
footprint->Reference().SetVisible( true ); footprint->Reference().SetVisible( true );
} }
} }
else if( a.name == "VALUE" ) else if( a.name == wxT( "VALUE" ) )
{ {
value = a; value = a;
valueAttr = &value; valueAttr = &value;
@ -1335,15 +1335,15 @@ void EAGLE_PLUGIN::loadElements( wxXmlNode* aElements )
if( valueNamePresetInPackageLayout ) if( valueNamePresetInPackageLayout )
footprint->Value().SetVisible( true ); footprint->Value().SetVisible( true );
footprint->SetValue( "VALUE" ); footprint->SetValue( wxT( "VALUE" ) );
break; break;
case EATTR::BOTH : case EATTR::BOTH :
if( valueNamePresetInPackageLayout ) if( valueNamePresetInPackageLayout )
footprint->Value().SetVisible( true ); footprint->Value().SetVisible( true );
valueAttr->value = opt_wxString( "VALUE = " + e.value ); valueAttr->value = opt_wxString( wxT( "VALUE = " ) + e.value );
footprint->SetValue( "VALUE = " + e.value ); footprint->SetValue( wxT( "VALUE = " ) + e.value );
break; break;
case EATTR::Off : case EATTR::Off :
@ -1424,7 +1424,7 @@ ZONE* EAGLE_PLUGIN::loadPolygon( wxXmlNode* aPolyNode )
// to allow the curve to link back // to allow the curve to link back
while( vertex ) while( vertex )
{ {
if( vertex->GetName() == "vertex" ) if( vertex->GetName() == wxT( "vertex" ) )
vertices.emplace_back( vertex ); vertices.emplace_back( vertex );
vertex = vertex->GetNext(); vertex = vertex->GetNext();
@ -1722,23 +1722,23 @@ FOOTPRINT* EAGLE_PLUGIN::makeFootprint( wxXmlNode* aPackage, const wxString& aPk
{ {
const wxString& itemName = packageItem->GetName(); const wxString& itemName = packageItem->GetName();
if( itemName == "description" ) if( itemName == wxT( "description" ) )
m->SetDescription( FROM_UTF8( packageItem->GetNodeContent().c_str() ) ); m->SetDescription( FROM_UTF8( packageItem->GetNodeContent().c_str() ) );
else if( itemName == "wire" ) else if( itemName == wxT( "wire" ) )
packageWire( m.get(), packageItem ); packageWire( m.get(), packageItem );
else if( itemName == "pad" ) else if( itemName == wxT( "pad" ) )
packagePad( m.get(), packageItem ); packagePad( m.get(), packageItem );
else if( itemName == "text" ) else if( itemName == wxT( "text" ) )
packageText( m.get(), packageItem ); packageText( m.get(), packageItem );
else if( itemName == "rectangle" ) else if( itemName == wxT( "rectangle" ) )
packageRectangle( m.get(), packageItem ); packageRectangle( m.get(), packageItem );
else if( itemName == "polygon" ) else if( itemName == wxT( "polygon" ) )
packagePolygon( m.get(), packageItem ); packagePolygon( m.get(), packageItem );
else if( itemName == "circle" ) else if( itemName == wxT( "circle" ) )
packageCircle( m.get(), packageItem ); packageCircle( m.get(), packageItem );
else if( itemName == "hole" ) else if( itemName == wxT( "hole" ) )
packageHole( m.get(), packageItem, false ); packageHole( m.get(), packageItem, false );
else if( itemName == "smd" ) else if( itemName == wxT( "smd" ) )
packageSMD( m.get(), packageItem ); packageSMD( m.get(), packageItem );
packageItem = packageItem->GetNext(); packageItem = packageItem->GetNext();
@ -1936,9 +1936,9 @@ void EAGLE_PLUGIN::packageText( FOOTPRINT* aFootprint, wxXmlNode* aTree ) const
FP_TEXT* txt; FP_TEXT* txt;
if( t.text.MakeUpper() == ">NAME" ) if( t.text.MakeUpper() == wxT( ">NAME" ) )
txt = &aFootprint->Reference(); txt = &aFootprint->Reference();
else if( t.text.MakeUpper() == ">VALUE" ) else if( t.text.MakeUpper() == wxT( ">VALUE" ) )
txt = &aFootprint->Value(); txt = &aFootprint->Value();
else else
{ {
@ -2124,7 +2124,7 @@ void EAGLE_PLUGIN::packagePolygon( FOOTPRINT* aFootprint, wxXmlNode* aTree ) con
// to allow the curve to link back // to allow the curve to link back
while( vertex ) while( vertex )
{ {
if( vertex->GetName() == "vertex" ) if( vertex->GetName() == wxT( "vertex" ) )
vertices.emplace_back( vertex ); vertices.emplace_back( vertex );
vertex = vertex->GetNext(); vertex = vertex->GetNext();
@ -2491,7 +2491,7 @@ void EAGLE_PLUGIN::loadClasses( wxXmlNode* aClasses )
classNode = classNode->GetNext(); classNode = classNode->GetNext();
} }
m_customRules = "(version 1)"; m_customRules = wxT( "(version 1)" );
for( ECLASS& eClass : eClasses ) for( ECLASS& eClass : eClasses )
{ {
@ -2500,16 +2500,16 @@ void EAGLE_PLUGIN::loadClasses( wxXmlNode* aClasses )
if( m_classMap[ entry.first ] != nullptr ) if( m_classMap[ entry.first ] != nullptr )
{ {
wxString rule; wxString rule;
rule.Printf( "(rule \"class %s:%s\"\n" rule.Printf( wxT( "(rule \"class %s:%s\"\n"
" (condition \"A.NetClass == '%s' && B.NetClass == '%s'\")\n" " (condition \"A.NetClass == '%s' && B.NetClass == '%s'\")\n"
" (constraint clearance (min %smm)))\n", " (constraint clearance (min %smm)))\n" ),
eClass.number, eClass.number,
entry.first, entry.first,
eClass.name, eClass.name,
m_classMap[ entry.first ]->GetName(), m_classMap[ entry.first ]->GetName(),
StringFromValue( EDA_UNITS::MILLIMETRES, entry.second.ToPcbUnits() ) ); StringFromValue( EDA_UNITS::MILLIMETRES, entry.second.ToPcbUnits() ) );
m_customRules += "\n" + rule; m_customRules += wxT( "\n" ) + rule;
} }
} }
} }
@ -2560,7 +2560,7 @@ void EAGLE_PLUGIN::loadSignals( wxXmlNode* aSignals )
{ {
const wxString& itemName = netItem->GetName(); const wxString& itemName = netItem->GetName();
if( itemName == "wire" ) if( itemName == wxT( "wire" ) )
{ {
m_xpath->push( "wire" ); m_xpath->push( "wire" );
@ -2640,7 +2640,7 @@ void EAGLE_PLUGIN::loadSignals( wxXmlNode* aSignals )
m_xpath->pop(); m_xpath->pop();
} }
else if( itemName == "via" ) else if( itemName == wxT( "via" ) )
{ {
m_xpath->push( "via" ); m_xpath->push( "via" );
EVIA v( netItem ); EVIA v( netItem );
@ -2729,7 +2729,7 @@ void EAGLE_PLUGIN::loadSignals( wxXmlNode* aSignals )
m_xpath->pop(); m_xpath->pop();
} }
else if( itemName == "contactref" ) else if( itemName == wxT( "contactref" ) )
{ {
m_xpath->push( "contactref" ); m_xpath->push( "contactref" );
// <contactref element="RN1" pad="7"/> // <contactref element="RN1" pad="7"/>
@ -2745,7 +2745,7 @@ void EAGLE_PLUGIN::loadSignals( wxXmlNode* aSignals )
sawPad = true; sawPad = true;
} }
else if( itemName == "polygon" ) else if( itemName == wxT( "polygon" ) )
{ {
m_xpath->push( "polygon" ); m_xpath->push( "polygon" );
auto* zone = loadPolygon( netItem ); auto* zone = loadPolygon( netItem );

View File

@ -75,7 +75,7 @@ BOARD* FABMASTER_PLUGIN::Load( const wxString &aFileName, BOARD *aAppendToMe,
aProgressReporter->Report( wxString::Format( _( "Loading %s..." ), aFileName ) ); aProgressReporter->Report( wxString::Format( _( "Loading %s..." ), aFileName ) );
if( !aProgressReporter->KeepRefreshing() ) if( !aProgressReporter->KeepRefreshing() )
THROW_IO_ERROR( ( "Open cancelled by user." ) ); THROW_IO_ERROR( _( "Open cancelled by user." ) );
} }
if( !m_fabmaster.Read( aFileName.ToStdString() ) ) if( !m_fabmaster.Read( aFileName.ToStdString() ) )

View File

@ -70,7 +70,7 @@ void FABMASTER::checkpoint()
/ std::max( 1U, m_totalCount ) ); / std::max( 1U, m_totalCount ) );
if( !m_progressReporter->KeepRefreshing() ) if( !m_progressReporter->KeepRefreshing() )
THROW_IO_ERROR( ( "Open cancelled by user." ) ); THROW_IO_ERROR( _( "Open cancelled by user." ) );
m_lastProgressCount = m_doneCount; m_lastProgressCount = m_doneCount;
} }
@ -273,7 +273,7 @@ double FABMASTER::processScaleFactor( size_t aRow )
for( int i = 7; i < 10 && retval < 1.0; ++i ) for( int i = 7; i < 10 && retval < 1.0; ++i )
{ {
auto units = rows[aRow][i]; std::string units = rows[aRow][i];
std::transform(units.begin(), units.end(),units.begin(), ::toupper); std::transform(units.begin(), units.end(),units.begin(), ::toupper);
if( units == "MILS" ) if( units == "MILS" )
@ -1267,7 +1267,7 @@ size_t FABMASTER::processGeometry( size_t aRow )
if( !gr_item ) if( !gr_item )
{ {
wxLogDebug( "Unhandled graphic item '%s' in row %zu.", wxLogDebug( wxT( "Unhandled graphic item '%s' in row %zu." ),
gr_data.graphic_dataname.c_str(), gr_data.graphic_dataname.c_str(),
geo_tag.c_str(), geo_tag.c_str(),
rownum ); rownum );
@ -1989,12 +1989,12 @@ bool FABMASTER::loadFootprints( BOARD* aBoard )
wxString lib_ref = m_filename.GetName(); wxString lib_ref = m_filename.GetName();
if( has_multiple ) if( has_multiple )
mod_ref.Append( wxString::Format( "_%d", i ) ); mod_ref.Append( wxString::Format( wxT( "_%d" ), i ) );
ReplaceIllegalFileNameChars( lib_ref, '_' ); ReplaceIllegalFileNameChars( lib_ref, '_' );
ReplaceIllegalFileNameChars( mod_ref, '_' ); ReplaceIllegalFileNameChars( mod_ref, '_' );
wxString key = !lib_ref.empty() ? lib_ref + ":" + mod_ref : mod_ref; wxString key = !lib_ref.empty() ? lib_ref + wxT( ":" ) + mod_ref : mod_ref;
LIB_ID fpID; LIB_ID fpID;
fpID.Parse( key, true ); fpID.Parse( key, true );

View File

@ -211,7 +211,7 @@ void LEGACY_PLUGIN::checkpoint()
/ std::max( 1U, m_lineCount ) ); / std::max( 1U, m_lineCount ) );
if( !m_progressReporter->KeepRefreshing() ) if( !m_progressReporter->KeepRefreshing() )
THROW_IO_ERROR( ( "Open cancelled by user." ) ); THROW_IO_ERROR( _( "Open cancelled by user." ) );
m_lastProgressLine = curLine; m_lastProgressLine = curLine;
} }
@ -441,7 +441,7 @@ BOARD* LEGACY_PLUGIN::Load( const wxString& aFileName, BOARD* aAppendToMe,
m_progressReporter->Report( wxString::Format( _( "Loading %s..." ), aFileName ) ); m_progressReporter->Report( wxString::Format( _( "Loading %s..." ), aFileName ) );
if( !m_progressReporter->KeepRefreshing() ) if( !m_progressReporter->KeepRefreshing() )
THROW_IO_ERROR( ( "Open cancelled by user." ) ); THROW_IO_ERROR( _( "Open cancelled by user." ) );
while( reader.ReadLine() ) while( reader.ReadLine() )
m_lineCount++; m_lineCount++;
@ -560,7 +560,7 @@ void LEGACY_PLUGIN::loadAllSections( bool doAppend )
} }
} }
THROW_IO_ERROR( "Missing '$EndBOARD'" ); THROW_IO_ERROR( wxT( "Missing '$EndBOARD'" ) );
} }
@ -575,7 +575,7 @@ void LEGACY_PLUGIN::checkVersion()
if( !TESTLINE( "PCBNEW-BOARD" ) ) if( !TESTLINE( "PCBNEW-BOARD" ) )
{ {
THROW_IO_ERROR( "Unknown file type" ); THROW_IO_ERROR( wxT( "Unknown file type" ) );
} }
int ver = 1; // if sccanf fails int ver = 1; // if sccanf fails
@ -631,7 +631,7 @@ void LEGACY_PLUGIN::loadGENERAL()
else if( TESTLINE( "EnabledLayers" ) ) else if( TESTLINE( "EnabledLayers" ) )
{ {
if( !saw_LayerCount ) if( !saw_LayerCount )
THROW_IO_ERROR( "Missing '$GENERAL's LayerCount" ); THROW_IO_ERROR( wxT( "Missing '$GENERAL's LayerCount" ) );
LEG_MASK enabledLayers = hexParse( line + SZ( "EnabledLayers" ) ); LEG_MASK enabledLayers = hexParse( line + SZ( "EnabledLayers" ) );
LSET new_mask = leg_mask2new( m_cu_count, enabledLayers ); LSET new_mask = leg_mask2new( m_cu_count, enabledLayers );
@ -652,7 +652,7 @@ void LEGACY_PLUGIN::loadGENERAL()
// However, this code works. // However, this code works.
#if 0 #if 0
if( !saw_LayerCount ) if( !saw_LayerCount )
THROW_IO_ERROR( "Missing '$GENERAL's LayerCount" ); THROW_IO_ERROR( wxT( "Missing '$GENERAL's LayerCount" ) );
LEG_MASK visibleLayers = hexParse( line + SZ( "VisibleLayers" ) ); LEG_MASK visibleLayers = hexParse( line + SZ( "VisibleLayers" ) );
@ -704,7 +704,7 @@ void LEGACY_PLUGIN::loadGENERAL()
} }
} }
THROW_IO_ERROR( "Missing '$EndGENERAL'" ); THROW_IO_ERROR( wxT( "Missing '$EndGENERAL'" ) );
} }
@ -835,7 +835,7 @@ void LEGACY_PLUGIN::loadSHEET()
} }
} }
THROW_IO_ERROR( "Missing '$EndSHEETDESCR'" ); THROW_IO_ERROR( wxT( "Missing '$EndSHEETDESCR'" ) );
} }
@ -1520,7 +1520,7 @@ void LEGACY_PLUGIN::loadPAD( FOOTPRINT* aFootprint )
} }
} }
THROW_IO_ERROR( "Missing '$EndPAD'" ); THROW_IO_ERROR( wxT( "Missing '$EndPAD'" ) );
} }
@ -1608,14 +1608,14 @@ void LEGACY_PLUGIN::loadFP_SHAPE( FOOTPRINT* aFootprint )
{ {
if( ( line = READLINE( m_reader ) ) == nullptr ) if( ( line = READLINE( m_reader ) ) == nullptr )
{ {
THROW_IO_ERROR( "S_POLGON point count mismatch." ); THROW_IO_ERROR( wxT( "S_POLGON point count mismatch." ) );
} }
// e.g. "Dl 23 44\n" // e.g. "Dl 23 44\n"
if( !TESTLINE( "Dl" ) ) if( !TESTLINE( "Dl" ) )
{ {
THROW_IO_ERROR( "Missing Dl point def" ); THROW_IO_ERROR( wxT( "Missing Dl point def" ) );
} }
BIU x = biuParse( line + SZ( "Dl" ), &data ); BIU x = biuParse( line + SZ( "Dl" ), &data );
@ -1678,8 +1678,8 @@ void LEGACY_PLUGIN::loadMODULE_TEXT( FP_TEXT* aText )
// convert the "quoted, escaped, UTF8, text" to a wxString, find it by skipping // convert the "quoted, escaped, UTF8, text" to a wxString, find it by skipping
// as far forward as needed until the first double quote. // as far forward as needed until the first double quote.
txt_end = data + ReadDelimitedText( &m_field, data ); txt_end = data + ReadDelimitedText( &m_field, data );
m_field.Replace( "%V", "${VALUE}" ); m_field.Replace( wxT( "%V" ), wxT( "${VALUE}" ) );
m_field.Replace( "%R", "${REFERENCE}" ); m_field.Replace( wxT( "%R" ), wxT( "${REFERENCE}" ) );
m_field = ConvertToNewOverbarNotation( m_field ); m_field = ConvertToNewOverbarNotation( m_field );
aText->SetText( m_field ); aText->SetText( m_field );
@ -1778,7 +1778,7 @@ void LEGACY_PLUGIN::load3D( FOOTPRINT* aFootprint )
} }
} }
THROW_IO_ERROR( "Missing '$EndSHAPE3D'" ); THROW_IO_ERROR( wxT( "Missing '$EndSHAPE3D'" ) );
} }
@ -1900,7 +1900,7 @@ void LEGACY_PLUGIN::loadPCB_LINE()
} }
} }
THROW_IO_ERROR( "Missing '$EndDRAWSEGMENT'" ); THROW_IO_ERROR( wxT( "Missing '$EndDRAWSEGMENT'" ) );
} }
void LEGACY_PLUGIN::loadNETINFO_ITEM() void LEGACY_PLUGIN::loadNETINFO_ITEM()
@ -1937,7 +1937,7 @@ void LEGACY_PLUGIN::loadNETINFO_ITEM()
} }
else else
{ {
THROW_IO_ERROR( "Two net definitions in '$EQUIPOT' block" ); THROW_IO_ERROR( wxT( "Two net definitions in '$EQUIPOT' block" ) );
} }
} }
else if( TESTLINE( "$EndEQUIPOT" ) ) else if( TESTLINE( "$EndEQUIPOT" ) )
@ -1967,7 +1967,7 @@ void LEGACY_PLUGIN::loadNETINFO_ITEM()
// If we are here, there is an error. // If we are here, there is an error.
delete net; delete net;
THROW_IO_ERROR( "Missing '$EndEQUIPOT'" ); THROW_IO_ERROR( wxT( "Missing '$EndEQUIPOT'" ) );
} }
@ -2077,7 +2077,7 @@ void LEGACY_PLUGIN::loadPCB_TEXT()
} }
} }
THROW_IO_ERROR( "Missing '$EndTEXTPCB'" ); THROW_IO_ERROR( wxT( "Missing '$EndTEXTPCB'" ) );
} }
@ -2130,7 +2130,7 @@ void LEGACY_PLUGIN::loadTrackList( int aStructType )
if( !TESTLINE( "De" ) ) if( !TESTLINE( "De" ) )
{ {
// mandatory 2nd line is missing // mandatory 2nd line is missing
THROW_IO_ERROR( "Missing 2nd line of a TRACK def" ); THROW_IO_ERROR( wxT( "Missing 2nd line of a TRACK def" ) );
} }
#endif #endif
@ -2156,7 +2156,7 @@ void LEGACY_PLUGIN::loadTrackList( int aStructType )
} }
else else
{ {
wxFAIL_MSG( "Segment type unknown" ); wxFAIL_MSG( wxT( "Segment type unknown" ) );
continue; continue;
} }
@ -2231,7 +2231,7 @@ void LEGACY_PLUGIN::loadTrackList( int aStructType )
} }
} }
THROW_IO_ERROR( "Missing '$EndTRACK'" ); THROW_IO_ERROR( wxT( "Missing '$EndTRACK'" ) );
} }
@ -2313,7 +2313,7 @@ void LEGACY_PLUGIN::loadNETCLASS()
} }
} }
THROW_IO_ERROR( "Missing '$EndNCLASS'" ); THROW_IO_ERROR( wxT( "Missing '$EndNCLASS'" ) );
} }
@ -2360,7 +2360,7 @@ void LEGACY_PLUGIN::loadZONE_CONTAINER()
int netcode = intParse( data, &data ); int netcode = intParse( data, &data );
if( ReadDelimitedText( buf, data, sizeof(buf) ) > (int) sizeof(buf) ) if( ReadDelimitedText( buf, data, sizeof(buf) ) > (int) sizeof(buf) )
THROW_IO_ERROR( "ZInfo netname too long" ); THROW_IO_ERROR( wxT( "ZInfo netname too long" ) );
const_cast<KIID&>( zc->m_Uuid ) = KIID( uuid ); const_cast<KIID&>( zc->m_Uuid ) = KIID( uuid );
@ -2597,7 +2597,7 @@ void LEGACY_PLUGIN::loadZONE_CONTAINER()
} }
} }
THROW_IO_ERROR( "Missing '$endCZONE_OUTLINE'" ); THROW_IO_ERROR( wxT( "Missing '$endCZONE_OUTLINE'" ) );
} }
@ -2736,7 +2736,7 @@ void LEGACY_PLUGIN::loadDIMENSION()
} }
} }
THROW_IO_ERROR( "Missing '$endCOTATION'" ); THROW_IO_ERROR( wxT( "Missing '$endCOTATION'" ) );
} }
@ -2775,7 +2775,7 @@ void LEGACY_PLUGIN::loadPCB_TARGET()
} }
} }
THROW_IO_ERROR( "Missing '$EndDIMENSION'" ); THROW_IO_ERROR( wxT( "Missing '$EndDIMENSION'" ) );
} }
@ -3082,7 +3082,7 @@ void LP_CACHE::LoadModules( LINE_READER* aReader )
{ {
if( !m_footprints.insert( footprintName, fp ).second ) if( !m_footprints.insert( footprintName, fp ).second )
{ {
wxFAIL_MSG( "error doing cache insert using guaranteed unique name" ); wxFAIL_MSG( wxT( "error doing cache insert using guaranteed unique name" ) );
} }
} }
else else
@ -3111,7 +3111,8 @@ void LP_CACHE::LoadModules( LINE_READER* aReader )
if( !m_footprints.insert( newName, fp ).second ) if( !m_footprints.insert( newName, fp ).second )
{ {
wxFAIL_MSG( "error doing cache insert using guaranteed unique name" ); wxFAIL_MSG( wxT( "error doing cache insert using guaranteed unique "
"name" ) );
} }
} }
} }

View File

@ -75,7 +75,7 @@ void PCB_TEXT::Parse( XNODE* aNode, int aLayer, const wxString& aDefaultUnits,
} }
aNode->GetAttribute( wxT( "Name" ), &m_name.text ); aNode->GetAttribute( wxT( "Name" ), &m_name.text );
m_name.text.Replace( "\r", "" ); m_name.text.Replace( wxT( "\r" ), wxT( "" ) );
str = FindNodeGetContent( aNode, wxT( "justify" ) ); str = FindNodeGetContent( aNode, wxT( "justify" ) );
m_name.justify = GetJustifyIdentificator( str ); m_name.justify = GetJustifyIdentificator( str );

View File

@ -54,7 +54,7 @@ static const char ACCEL_ASCII_KEYWORD[] = "ACCEL_ASCII";
if( !fgets( line, sizeof( line ), fp ) if( !fgets( line, sizeof( line ), fp )
// first line starts with "ACCEL_ASCII" with optional stuff on same line after that. // first line starts with "ACCEL_ASCII" with optional stuff on same line after that.
|| memcmp( line, ACCEL_ASCII_KEYWORD, sizeof(ACCEL_ASCII_KEYWORD)-1 ) ) || memcmp( line, ACCEL_ASCII_KEYWORD, sizeof(ACCEL_ASCII_KEYWORD)-1 ) )
THROW_IO_ERROR( "Unknown file type" ); THROW_IO_ERROR( wxT( "Unknown file type" ) );
// rewind the file // rewind the file
fseek( fp, 0, SEEK_SET ); fseek( fp, 0, SEEK_SET );

View File

@ -148,16 +148,16 @@ void pcbnewGetWizardsBackTrace( wxString& aTrace )
for( unsigned ii = 0; ii < traces.Count(); ++ii ) for( unsigned ii = 0; ii < traces.Count(); ++ii )
{ {
if( traces[ii].Contains( "Traceback" ) ) if( traces[ii].Contains( wxT( "Traceback" ) ) )
{ {
ii += 2; // Skip this line and next lines which are related to pcbnew.py module ii += 2; // Skip this line and next lines which are related to pcbnew.py module
if( !aTrace.IsEmpty() ) // Add separator for the next trace block if( !aTrace.IsEmpty() ) // Add separator for the next trace block
aTrace << "\n**********************************\n"; aTrace << wxT( "\n**********************************\n" );
} }
else else
{ {
aTrace += traces[ii] + "\n"; aTrace += traces[ii] + wxT( "\n" );
} }
} }
} }

View File

@ -221,7 +221,7 @@ bool COMPONENT_DRAGGER::Drag( const VECTOR2I& aP )
} }
default: default:
wxFAIL_MSG( "Unexpected item type in COMPONENT_DRAGGER::m_fixedItems" ); wxFAIL_MSG( wxT( "Unexpected item type in COMPONENT_DRAGGER::m_fixedItems" ) );
} }
} }

View File

@ -448,11 +448,11 @@ const wxString DP_MEANDER_PLACER::TuningInfo( EDA_UNITS aUnits ) const
} }
status += ::MessageTextFromValue( aUnits, m_lastLength ); status += ::MessageTextFromValue( aUnits, m_lastLength );
status += "/"; status += wxT( "/" );
status += ::MessageTextFromValue( aUnits, m_settings.m_targetLength ); status += ::MessageTextFromValue( aUnits, m_settings.m_targetLength );
status += " (gap: "; status += wxT( " (gap: " );
status += ::MessageTextFromValue( aUnits, m_originPair.Gap() ); status += ::MessageTextFromValue( aUnits, m_originPair.Gap() );
status += ")"; status += wxT( ")" );
return status; return status;
} }

View File

@ -613,22 +613,22 @@ int PNS_PCBNEW_RULE_RESOLVER::matchDpSuffix( const wxString& aNetName, wxString&
} }
else if( ch == '+' ) else if( ch == '+' )
{ {
aComplementNet = "-"; aComplementNet = wxT( "-" );
rv = 1; rv = 1;
} }
else if( ch == '-' ) else if( ch == '-' )
{ {
aComplementNet = "+"; aComplementNet = wxT( "+" );
rv = -1; rv = -1;
} }
else if( ch == 'N' ) else if( ch == 'N' )
{ {
aComplementNet = "P"; aComplementNet = wxT( "P" );
rv = -1; rv = -1;
} }
else if ( ch == 'P' ) else if ( ch == 'P' )
{ {
aComplementNet = "N"; aComplementNet = wxT( "N" );
rv = 1; rv = 1;
} }
else else
@ -917,7 +917,7 @@ std::unique_ptr<PNS::SOLID> PNS_KICAD_IFACE_BASE::syncPad( PAD* aPad )
} }
default: default:
wxLogTrace( "PNS", "unsupported pad type 0x%x", aPad->GetAttribute() ); wxLogTrace( wxT( "PNS" ), wxT( "unsupported pad type 0x%x" ), aPad->GetAttribute() );
return nullptr; return nullptr;
} }
@ -1192,7 +1192,7 @@ bool PNS_KICAD_IFACE_BASE::syncGraphicalItem( PNS::NODE* aWorld, PCB_SHAPE* aIte
void PNS_KICAD_IFACE_BASE::SetBoard( BOARD* aBoard ) void PNS_KICAD_IFACE_BASE::SetBoard( BOARD* aBoard )
{ {
m_board = aBoard; m_board = aBoard;
wxLogTrace( "PNS", "m_board = %p", m_board ); wxLogTrace( wxT( "PNS" ), wxT( "m_board = %p" ), m_board );
} }
@ -1276,7 +1276,7 @@ void PNS_KICAD_IFACE_BASE::SyncWorld( PNS::NODE *aWorld )
{ {
if( !m_board ) if( !m_board )
{ {
wxLogTrace( "PNS", "No board attached, aborting sync." ); wxLogTrace( wxT( "PNS" ), wxT( "No board attached, aborting sync." ) );
return; return;
} }
@ -1667,7 +1667,7 @@ EDA_UNITS PNS_KICAD_IFACE::GetUnits() const
void PNS_KICAD_IFACE::SetView( KIGFX::VIEW* aView ) void PNS_KICAD_IFACE::SetView( KIGFX::VIEW* aView )
{ {
wxLogTrace( "PNS", "SetView %p", aView ); wxLogTrace( wxT( "PNS" ), wxT( "SetView %p" ), aView );
if( m_previewItems ) if( m_previewItems )
{ {
@ -1696,7 +1696,7 @@ void PNS_KICAD_IFACE::SetView( KIGFX::VIEW* aView )
void PNS_KICAD_IFACE::UpdateNet( int aNetCode ) void PNS_KICAD_IFACE::UpdateNet( int aNetCode )
{ {
wxLogTrace( "PNS", "Update-net %d", aNetCode ); wxLogTrace( wxT( "PNS" ), wxT( "Update-net %d" ), aNetCode );
} }

View File

@ -738,7 +738,7 @@ void LINE::dragCornerFree( const VECTOR2I& aP, int aIndex )
} }
else else
{ {
wxASSERT_MSG( false, "Attempt to dragCornerFree in the middle of an arc!" ); wxASSERT_MSG( false, wxT( "Attempt to dragCornerFree in the middle of an arc!" ) );
} }
} }
@ -748,7 +748,7 @@ void LINE::dragCornerFree( const VECTOR2I& aP, int aIndex )
void LINE::DragCorner( const VECTOR2I& aP, int aIndex, bool aFreeAngle ) void LINE::DragCorner( const VECTOR2I& aP, int aIndex, bool aFreeAngle )
{ {
wxCHECK_RET( aIndex >= 0, "Negative index passed to LINE::DragCorner" ); wxCHECK_RET( aIndex >= 0, wxT( "Negative index passed to LINE::DragCorner" ) );
if( aFreeAngle ) if( aFreeAngle )
{ {

View File

@ -237,7 +237,7 @@ bool LINE_PLACER::handlePullback()
m_p_start = arc.GetP0(); m_p_start = arc.GetP0();
} }
wxLogTrace( "PNS", "Placer: pullback triggered [%d] [%s %s]", wxLogTrace( wxT( "PNS" ), wxT( "Placer: pullback triggered [%d] [%s %s]" ),
n, last_tail.Format().c_str(), first_head.Format().c_str() ); n, last_tail.Format().c_str(), first_head.Format().c_str() );
// erase the last point in the tail, hoping that the next iteration will // erase the last point in the tail, hoping that the next iteration will
@ -306,7 +306,7 @@ bool LINE_PLACER::reduceTail( const VECTOR2I& aEnd )
if( reduce_index >= 0 ) if( reduce_index >= 0 )
{ {
wxLogTrace( "PNS", "Placer: reducing tail: %d", reduce_index ); wxLogTrace( wxT( "PNS" ), wxT( "Placer: reducing tail: %d" ), reduce_index );
SHAPE_LINE_CHAIN reducedLine = new_direction.BuildInitialTrace( new_start, aEnd ); SHAPE_LINE_CHAIN reducedLine = new_direction.BuildInitialTrace( new_start, aEnd );
m_p_start = new_start; m_p_start = new_start;
@ -340,13 +340,13 @@ bool LINE_PLACER::mergeHead()
if( n_head < 3 ) if( n_head < 3 )
{ {
wxLogTrace( "PNS", "Merge failed: not enough head segs." ); wxLogTrace( wxT( "PNS" ), wxT( "Merge failed: not enough head segs." ) );
return false; return false;
} }
if( n_tail && head.CPoint( 0 ) != tail.CPoint( -1 ) ) if( n_tail && head.CPoint( 0 ) != tail.CPoint( -1 ) )
{ {
wxLogTrace( "PNS", "Merge failed: head and tail discontinuous." ); wxLogTrace( wxT( "PNS" ), wxT( "Merge failed: head and tail discontinuous." ) );
return false; return false;
} }
@ -390,7 +390,7 @@ bool LINE_PLACER::mergeHead()
head.Remove( 0, -1 ); head.Remove( 0, -1 );
wxLogTrace( "PNS", "Placer: merge %d, new direction: %s", n_head, wxLogTrace( wxT( "PNS" ), wxT( "Placer: merge %d, new direction: %s" ), n_head,
m_direction.Format().c_str() ); m_direction.Format().c_str() );
head.Simplify(); head.Simplify();
@ -918,7 +918,7 @@ void LINE_PLACER::routeStep( const VECTOR2I& aP )
LINE new_head; LINE new_head;
wxLogTrace( "PNS", "routeStep: direction: %s head: %d, tail: %d shapes", wxLogTrace( wxT( "PNS" ), wxT( "routeStep: direction: %s head: %d, tail: %d shapes" ),
m_direction.Format().c_str(), m_direction.Format().c_str(),
m_head.ShapeCount(), m_head.ShapeCount(),
m_tail.ShapeCount() ); m_tail.ShapeCount() );
@ -1154,7 +1154,8 @@ bool LINE_PLACER::Start( const VECTOR2I& aP, ITEM* aStartItem )
initialDir = DIRECTION_45( static_cast<DIRECTION_45::Directions>( int( angle ) ) ); initialDir = DIRECTION_45( static_cast<DIRECTION_45::Directions>( int( angle ) ) );
} }
wxLogTrace( "PNS", "Posture: init %s, last seg %s", initialDir.Format(), lastSegDir.Format() ); wxLogTrace( wxT( "PNS" ), wxT( "Posture: init %s, last seg %s" ),
initialDir.Format(), lastSegDir.Format() );
m_mouseTrailTracer.Clear(); m_mouseTrailTracer.Clear();
m_mouseTrailTracer.AddTrailPoint( aP ); m_mouseTrailTracer.AddTrailPoint( aP );
@ -1202,7 +1203,7 @@ void LINE_PLACER::initPlacement()
setWorld( rootNode ); setWorld( rootNode );
wxLogTrace( "PNS", "world %p, intitial-direction %s layer %d", wxLogTrace( wxT( "PNS" ), wxT( "world %p, intitial-direction %s layer %d" ),
m_world, m_world,
m_direction.Format().c_str(), m_direction.Format().c_str(),
m_currentLayer ); m_currentLayer );
@ -1552,7 +1553,7 @@ void LINE_PLACER::removeLoops( NODE* aNode, LINE& aLatest )
} }
} }
wxLogTrace( "PNS", "total segs removed: %d/%d", removedCount, total ); wxLogTrace( wxT( "PNS" ), wxT( "total segs removed: %d/%d" ), removedCount, total );
} }
for( LINKED_ITEM* s : toErase ) for( LINKED_ITEM* s : toErase )
@ -1697,7 +1698,8 @@ bool LINE_PLACER::buildInitialLine( const VECTOR2I& aP, LINE& aHead, bool aForce
SHAPE_LINE_CHAIN l; SHAPE_LINE_CHAIN l;
DIRECTION_45 guessedDir = m_mouseTrailTracer.GetPosture( aP ); DIRECTION_45 guessedDir = m_mouseTrailTracer.GetPosture( aP );
wxLogTrace( "PNS", "buildInitialLine: m_direction %s, guessedDir %s, tail points %d", wxLogTrace( wxT( "PNS" ),
wxT( "buildInitialLine: m_direction %s, guessedDir %s, tail points %d" ),
m_direction.Format(), guessedDir.Format(), m_tail.PointCount() ); m_direction.Format(), guessedDir.Format(), m_tail.PointCount() );
DIRECTION_45::CORNER_MODE cornerMode = Settings().GetCornerMode(); DIRECTION_45::CORNER_MODE cornerMode = Settings().GetCornerMode();

View File

@ -82,14 +82,14 @@ public:
#if 0 /// @todo move outside header. #if 0 /// @todo move outside header.
if( !IsLinked() ) if( !IsLinked() )
{ {
wxLogTrace( "PNS", "item %p: no links", this ); wxLogTrace( wxT( "PNS" ), wxT( "item %p: no links" ), this );
return; return;
} }
wxLogTrace( "PNS", "item %p: %d links", this, (int) m_links.size() ); wxLogTrace( wxT( "PNS" ), wxT( "item %p: %d links" ), this, (int) m_links.size() );
for( int i = 0; i < (int) m_links.size(); i++ ) for( int i = 0; i < (int) m_links.size(); i++ )
wxLogTrace( "PNS", "item %d: %p\n", i, m_links[i] ); wxLogTrace( wxT( "PNS" ), wxT( "item %d: %p\n" ), i, m_links[i] );
#endif #endif
} }

View File

@ -47,7 +47,7 @@ void LOGGER::Save( const std::string& aFilename )
{ {
FILE* f = fopen( aFilename.c_str(), "wb" ); FILE* f = fopen( aFilename.c_str(), "wb" );
wxLogTrace( "PNS", "Saving to '%s' [%p]", aFilename.c_str(), f ); wxLogTrace( wxT( "PNS" ), wxT( "Saving to '%s' [%p]" ), aFilename.c_str(), f );
for( const EVENT_ENTRY& evt : m_events ) for( const EVENT_ENTRY& evt : m_events )
{ {

View File

@ -287,7 +287,7 @@ const wxString MEANDER_PLACER::TuningInfo( EDA_UNITS aUnits ) const
} }
status += ::MessageTextFromValue( aUnits, m_lastLength ); status += ::MessageTextFromValue( aUnits, m_lastLength );
status += "/"; status += wxT( "/" );
status += ::MessageTextFromValue( aUnits, m_settings.m_targetLength ); status += ::MessageTextFromValue( aUnits, m_settings.m_targetLength );
return status; return status;

View File

@ -70,7 +70,7 @@ int MEANDER_PLACER_BASE::Clearance()
Router()->GetRuleResolver()->QueryConstraint( PNS::CONSTRAINT_TYPE::CT_CLEARANCE, itemToCheck, Router()->GetRuleResolver()->QueryConstraint( PNS::CONSTRAINT_TYPE::CT_CLEARANCE, itemToCheck,
nullptr, CurrentLayer(), &constraint ); nullptr, CurrentLayer(), &constraint );
wxCHECK_MSG( constraint.m_Value.HasMin(), m_currentWidth, "No minimum clearance?" ); wxCHECK_MSG( constraint.m_Value.HasMin(), m_currentWidth, wxT( "No minimum clearance?" ) );
return constraint.m_Value.Min(); return constraint.m_Value.Min();
} }

View File

@ -175,7 +175,7 @@ const wxString MEANDER_SKEW_PLACER::TuningInfo( EDA_UNITS aUnits ) const
} }
status += ::MessageTextFromValue( aUnits, m_lastLength - m_coupledLength ); status += ::MessageTextFromValue( aUnits, m_lastLength - m_coupledLength );
status += "/"; status += wxT( "/" );
status += ::MessageTextFromValue( aUnits, m_settings.m_targetSkew ); status += ::MessageTextFromValue( aUnits, m_settings.m_targetSkew );
return status; return status;

View File

@ -182,14 +182,14 @@ DIRECTION_45 MOUSE_TRAIL_TRACER::GetPosture( const VECTOR2I& aP )
if( !m_manuallyForced && !m_disableMouse && m_lastSegDirection != DIRECTION_45::UNDEFINED ) if( !m_manuallyForced && !m_disableMouse && m_lastSegDirection != DIRECTION_45::UNDEFINED )
{ {
PNS_DBG( dbg, Message, PNS_DBG( dbg, Message,
wxString::Format( "Posture: checking direction %s against last seg %s", wxString::Format( wxT( "Posture: checking direction %s against last seg %s" ),
m_direction.Format(), m_lastSegDirection.Format() ) ); m_direction.Format(), m_lastSegDirection.Format() ) );
if( straightDirection == m_lastSegDirection ) if( straightDirection == m_lastSegDirection )
{ {
if( m_direction != straightDirection ) if( m_direction != straightDirection )
{ {
PNS_DBG( dbg, Message, wxString::Format( "Posture: forcing straight => %s", PNS_DBG( dbg, Message, wxString::Format( wxT( "Posture: forcing straight => %s" ),
straightDirection.Format() ) ); straightDirection.Format() ) );
} }
@ -199,7 +199,7 @@ DIRECTION_45 MOUSE_TRAIL_TRACER::GetPosture( const VECTOR2I& aP )
{ {
if( m_direction != diagDirection ) if( m_direction != diagDirection )
{ {
PNS_DBG( dbg, Message, wxString::Format( "Posture: forcing diagonal => %s", PNS_DBG( dbg, Message, wxString::Format( wxT( "Posture: forcing diagonal => %s" ),
diagDirection.Format() ) ); diagDirection.Format() ) );
} }
@ -212,7 +212,7 @@ DIRECTION_45 MOUSE_TRAIL_TRACER::GetPosture( const VECTOR2I& aP )
case DIRECTION_45::ANG_HALF_FULL: case DIRECTION_45::ANG_HALF_FULL:
// Force a better (acute) connection // Force a better (acute) connection
m_direction = m_direction.IsDiagonal() ? straightDirection : diagDirection; m_direction = m_direction.IsDiagonal() ? straightDirection : diagDirection;
PNS_DBG( dbg, Message, wxString::Format( "Posture: correcting half full => %s", PNS_DBG( dbg, Message, wxString::Format( wxT( "Posture: correcting half full => %s" ),
m_direction.Format() ) ); m_direction.Format() ) );
break; break;
@ -224,7 +224,7 @@ DIRECTION_45 MOUSE_TRAIL_TRACER::GetPosture( const VECTOR2I& aP )
if( candidate.Angle( m_lastSegDirection ) == DIRECTION_45::ANG_RIGHT ) if( candidate.Angle( m_lastSegDirection ) == DIRECTION_45::ANG_RIGHT )
{ {
PNS_DBG( dbg, Message, wxString::Format( "Posture: correcting right => %s", PNS_DBG( dbg, Message, wxString::Format( wxT( "Posture: correcting right => %s" ),
candidate.Format() ) ); candidate.Format() ) );
m_direction = candidate; m_direction = candidate;
} }
@ -240,7 +240,7 @@ DIRECTION_45 MOUSE_TRAIL_TRACER::GetPosture( const VECTOR2I& aP )
if( candidate.Angle( m_lastSegDirection ) == DIRECTION_45::ANG_OBTUSE ) if( candidate.Angle( m_lastSegDirection ) == DIRECTION_45::ANG_OBTUSE )
{ {
PNS_DBG( dbg, Message, wxString::Format( "Posture: correcting obtuse => %s", PNS_DBG( dbg, Message, wxString::Format( wxT( "Posture: correcting obtuse => %s" ),
candidate.Format() ) ); candidate.Format() ) );
m_direction = candidate; m_direction = candidate;
} }

View File

@ -70,14 +70,14 @@ NODE::~NODE()
{ {
if( !m_children.empty() ) if( !m_children.empty() )
{ {
wxLogTrace( "PNS", "attempting to free a node that has kids." ); wxLogTrace( wxT( "PNS" ), wxT( "attempting to free a node that has kids." ) );
assert( false ); assert( false );
} }
#ifdef DEBUG #ifdef DEBUG
if( allocNodes.find( this ) == allocNodes.end() ) if( allocNodes.find( this ) == allocNodes.end() )
{ {
wxLogTrace( "PNS", "attempting to free an already-free'd node." ); wxLogTrace( wxT( "PNS" ), wxT( "attempting to free an already-free'd node." ) );
assert( false ); assert( false );
} }
@ -161,7 +161,7 @@ NODE* NODE::Branch()
} }
#if 0 #if 0
wxLogTrace( "PNS", "%d items, %d joints, %d overrides", wxLogTrace( wxT( "PNS" ), wxT( "%d items, %d joints, %d overrides" ),
child->m_index->Size(), child->m_index->Size(),
(int) child->m_joints.size(), (int) child->m_joints.size(),
(int) child->m_override.size() ); (int) child->m_override.size() );
@ -640,7 +640,8 @@ bool NODE::Add( std::unique_ptr< SEGMENT > aSegment, bool aAllowRedundant )
{ {
if( aSegment->Seg().A == aSegment->Seg().B ) if( aSegment->Seg().A == aSegment->Seg().B )
{ {
wxLogTrace( "PNS", "attempting to add a segment with same end coordinates, ignoring." ); wxLogTrace( wxT( "PNS" ),
wxT( "attempting to add a segment with same end coordinates, ignoring." ) );
return false; return false;
} }
@ -1228,7 +1229,7 @@ JOINT& NODE::touchJoint( const VECTOR2I& aPos, const LAYER_RANGE& aLayers, int a
void JOINT::Dump() const void JOINT::Dump() const
{ {
wxLogTrace( "PNS", "joint layers %d-%d, net %d, pos %s, links: %d", wxLogTrace( wxT( "PNS" ), wxT( "joint layers %d-%d, net %d, pos %s, links: %d" ),
m_layers.Start(), m_layers.Start(),
m_layers.End(), m_layers.End(),
m_tag.net, m_tag.net,
@ -1281,7 +1282,7 @@ void NODE::Dump( bool aLong )
{ {
for( j = m_joints.begin(); j != m_joints.end(); ++j ) for( j = m_joints.begin(); j != m_joints.end(); ++j )
{ {
wxLogTrace( "PNS", "joint : %s, links : %d\n", wxLogTrace( wxT( "PNS" ), wxT( "joint : %s, links : %d\n" ),
j->second.GetPos().Format().c_str(), j->second.LinkCount() ); j->second.GetPos().Format().c_str(), j->second.LinkCount() );
JOINT::LINKED_ITEMS::const_iterator k; JOINT::LINKED_ITEMS::const_iterator k;
@ -1294,8 +1295,9 @@ void NODE::Dump( bool aLong )
case ITEM::SEGMENT_T: case ITEM::SEGMENT_T:
{ {
const SEGMENT* seg = static_cast<const SEGMENT*>( m_item ); const SEGMENT* seg = static_cast<const SEGMENT*>( m_item );
wxLogTrace( "PNS", " -> seg %s %s\n", seg->GetSeg().A.Format().c_str(), wxLogTrace( wxT( "PNS" ), wxT( " -> seg %s %s\n" ),
seg->GetSeg().B.Format().c_str() ); seg->GetSeg().A.Format().c_str(),
seg->GetSeg().B.Format().c_str() );
break; break;
} }
@ -1316,14 +1318,17 @@ void NODE::Dump( bool aLong )
LINE::LinkedSegments* seg_refs = l->GetLinkedSegments(); LINE::LinkedSegments* seg_refs = l->GetLinkedSegments();
if( aLong ) if( aLong )
wxLogTrace( "PNS", "Line: %s, net %d ", l->GetLine().Format().c_str(), l->GetNet() ); {
wxLogTrace( wxT( "PNS" ), wxT( "Line: %s, net %d " ),
l->GetLine().Format().c_str(), l->GetNet() );
}
for( std::vector<SEGMENT*>::iterator j = seg_refs->begin(); j != seg_refs->end(); ++j ) for( std::vector<SEGMENT*>::iterator j = seg_refs->begin(); j != seg_refs->end(); ++j )
{ {
wxLogTrace( "PNS", "%s ", (*j)->GetSeg().A.Format().c_str() ); wxLogTrace( wxT( "PNS" ), wxT( "%s " ), (*j)->GetSeg().A.Format().c_str() );
if( j + 1 == seg_refs->end() ) if( j + 1 == seg_refs->end() )
wxLogTrace( "PNS", "%s\n", (*j)->GetSeg().B.Format().c_str() ); wxLogTrace( wxT( "PNS" ), wxT( "%s\n" ), (*j)->GetSeg().B.Format().c_str() );
all_segs.erase( *j ); all_segs.erase( *j );
} }
@ -1331,7 +1336,8 @@ void NODE::Dump( bool aLong )
lines_count++; lines_count++;
} }
wxLogTrace( "PNS", "Local joints: %d, lines : %d \n", m_joints.size(), lines_count ); wxLogTrace( wxT( "PNS" ), wxT( "Local joints: %d, lines : %d \n" ),
m_joints.size(), lines_count );
#endif #endif
} }

View File

@ -296,7 +296,7 @@ SHOVE::SHOVE_STATUS SHOVE::shoveLineToHullSet( const LINE& aCurLine, const LINE&
if( !l.Walkaround( hull, path, clockwise ) ) if( !l.Walkaround( hull, path, clockwise ) )
{ {
PNS_DBG( Dbg(), Message, wxString::Format( "Fail-Walk %s %s %d\n", PNS_DBG( Dbg(), Message, wxString::Format( wxT( "Fail-Walk %s %s %d\n" ),
hull.Format().c_str(), hull.Format().c_str(),
l.CLine().Format().c_str(), l.CLine().Format().c_str(),
clockwise? 1 : 0) ); clockwise? 1 : 0) );
@ -329,19 +329,21 @@ SHOVE::SHOVE_STATUS SHOVE::shoveLineToHullSet( const LINE& aCurLine, const LINE&
if( ( vFirst < 0 || vLast < 0 ) && !path.CompareGeometry( aObstacleLine.CLine() ) ) if( ( vFirst < 0 || vLast < 0 ) && !path.CompareGeometry( aObstacleLine.CLine() ) )
{ {
PNS_DBG( Dbg(), Message, wxString::Format( "attempt %d fail vfirst-last", attempt ) ); PNS_DBG( Dbg(), Message, wxString::Format( wxT( "attempt %d fail vfirst-last" ),
attempt ) );
continue; continue;
} }
if( path.CPoint( -1 ) != obs.CPoint( -1 ) || path.CPoint( 0 ) != obs.CPoint( 0 ) ) if( path.CPoint( -1 ) != obs.CPoint( -1 ) || path.CPoint( 0 ) != obs.CPoint( 0 ) )
{ {
PNS_DBG( Dbg(), Message, wxString::Format( "attempt %d fail vend-start\n", attempt ) ); PNS_DBG( Dbg(), Message, wxString::Format( wxT( "attempt %d fail vend-start\n" ),
attempt ) );
continue; continue;
} }
if( !checkShoveDirection( aCurLine, aObstacleLine, l ) ) if( !checkShoveDirection( aCurLine, aObstacleLine, l ) )
{ {
PNS_DBG( Dbg(), Message, wxString::Format( "attempt %d fail direction-check", PNS_DBG( Dbg(), Message, wxString::Format( wxT( "attempt %d fail direction-check" ),
attempt ) ); attempt ) );
aResultLine.SetShape( l.CLine() ); aResultLine.SetShape( l.CLine() );
continue; continue;
@ -349,7 +351,7 @@ SHOVE::SHOVE_STATUS SHOVE::shoveLineToHullSet( const LINE& aCurLine, const LINE&
if( path.SelfIntersecting() ) if( path.SelfIntersecting() )
{ {
PNS_DBG( Dbg(), Message, wxString::Format( "attempt %d fail self-intersect", PNS_DBG( Dbg(), Message, wxString::Format( wxT( "attempt %d fail self-intersect" ),
attempt ) ); attempt ) );
continue; continue;
} }
@ -375,7 +377,8 @@ SHOVE::SHOVE_STATUS SHOVE::shoveLineToHullSet( const LINE& aCurLine, const LINE&
if( colliding ) if( colliding )
{ {
PNS_DBG( Dbg(), Message, wxString::Format( "attempt %d fail coll-check", attempt ) ); PNS_DBG( Dbg(), Message, wxString::Format( wxT( "attempt %d fail coll-check" ),
attempt ) );
continue; continue;
} }
@ -431,7 +434,7 @@ SHOVE::SHOVE_STATUS SHOVE::ShoveObstacleLine( const LINE& aCurLine, const LINE&
hulls.reserve( currentLineSegmentCount + 1 ); hulls.reserve( currentLineSegmentCount + 1 );
#ifdef DEBUG #ifdef DEBUG
Dbg()->Message( wxString::Format( "shove process-single: cur net %d obs %d cl %d", Dbg()->Message( wxString::Format( wxT( "shove process-single: cur net %d obs %d cl %d" ),
aCurLine.Net(), aObstacleLine.Net(), clearance ) ); aCurLine.Net(), aObstacleLine.Net(), clearance ) );
#endif #endif
@ -509,7 +512,7 @@ SHOVE::SHOVE_STATUS SHOVE::onCollidingSegment( LINE& aCurrent, SEGMENT* aObstacl
if( Dbg() ) if( Dbg() )
{ {
Dbg()->BeginGroup( wxString::Format( "on-colliding-segment-iter-%d", Dbg()->BeginGroup( wxString::Format( wxT( "on-colliding-segment-iter-%d" ),
m_iter ).ToStdString() ); m_iter ).ToStdString() );
Dbg()->AddSegment( tmp.Seg(), WHITE, "obstacle-segment" ); Dbg()->AddSegment( tmp.Seg(), WHITE, "obstacle-segment" );
Dbg()->AddLine( aCurrent.CLine(), RED, 10000, "current-line" ); Dbg()->AddLine( aCurrent.CLine(), RED, 10000, "current-line" );
@ -579,7 +582,8 @@ SHOVE::SHOVE_STATUS SHOVE::onCollidingArc( LINE& aCurrent, ARC* aObstacleArc )
if ( Dbg() ) if ( Dbg() )
{ {
Dbg()->BeginGroup( wxString::Format( "on-colliding-arc-iter-%d", m_iter ).ToStdString() ); Dbg()->BeginGroup( wxString::Format( wxT( "on-colliding-arc-iter-%d" ),
m_iter ).ToStdString() );
Dbg()->AddLine( tmp.CLine(), WHITE, 10000, "obstacle-segment" ); Dbg()->AddLine( tmp.CLine(), WHITE, 10000, "obstacle-segment" );
Dbg()->AddLine( aCurrent.CLine(), RED, 10000, "current-line" ); Dbg()->AddLine( aCurrent.CLine(), RED, 10000, "current-line" );
Dbg()->AddLine( obstacleLine.CLine(), GREEN, 10000, "obstacle-line" ); Dbg()->AddLine( obstacleLine.CLine(), GREEN, 10000, "obstacle-line" );
@ -865,7 +869,7 @@ SHOVE::SHOVE_STATUS SHOVE::pushOrShoveVia( VIA* aVia, const VECTOR2I& aForce, in
JOINT* jt = m_currentNode->FindJoint( p0, aVia ); JOINT* jt = m_currentNode->FindJoint( p0, aVia );
VECTOR2I p0_pushed( p0 + aForce ); VECTOR2I p0_pushed( p0 + aForce );
PNS_DBG( Dbg(), Message, wxString::Format( "via force [%d %d]\n", aForce.x, aForce.y ) ); PNS_DBG( Dbg(), Message, wxString::Format( wxT( "via force [%d %d]\n" ), aForce.x, aForce.y ) );
// nothing to do... // nothing to do...
if ( aForce.x == 0 && aForce.y == 0 ) if ( aForce.x == 0 && aForce.y == 0 )
@ -874,7 +878,7 @@ SHOVE::SHOVE_STATUS SHOVE::pushOrShoveVia( VIA* aVia, const VECTOR2I& aForce, in
if( !jt ) if( !jt )
{ {
PNS_DBG( Dbg(), Message, PNS_DBG( Dbg(), Message,
wxString::Format( "weird, can't find the center-of-via joint\n" ) ); wxString::Format( wxT( "weird, can't find the center-of-via joint\n" ) ) );
return SH_INCOMPLETE; return SH_INCOMPLETE;
} }
@ -1222,7 +1226,7 @@ SHOVE::SHOVE_STATUS SHOVE::shoveIteration( int aIter )
if( nearest ) if( nearest )
PNS_DBG( Dbg(), Message, PNS_DBG( Dbg(), Message,
wxString::Format( "nearest %p %s", nearest->m_item, wxString::Format( wxT( "nearest %p %s" ), nearest->m_item,
nearest->m_item->KindStr() ) ); nearest->m_item->KindStr() ) );
if( nearest ) if( nearest )

View File

@ -83,7 +83,7 @@ static const SHAPE_LINE_CHAIN buildHullForPrimitiveShape( const SHAPE* aShape, i
} }
default: default:
{ {
wxFAIL_MSG( wxString::Format( "Unsupported hull shape: %d (%s).", wxFAIL_MSG( wxString::Format( wxT( "Unsupported hull shape: %d (%s)." ),
aShape->Type(), aShape->Type(),
SHAPE_TYPE_asString( aShape->Type() ) ) ); SHAPE_TYPE_asString( aShape->Type() ) ) );
break; break;

View File

@ -204,7 +204,9 @@ ITEM* TOOL_BASE::pickSingleItem( const VECTOR2I& aWhere, int aNet, int aLayer, b
if( rv ) if( rv )
{ {
wxLogTrace( "PNS", "%s, layer : %d, tl: %d", rv->KindStr().c_str(), rv->Layers().Start(), wxLogTrace( wxT( "PNS" ), wxT( "%s, layer : %d, tl: %d" ),
rv->KindStr().c_str(),
rv->Layers().Start(),
tl ); tl );
} }
@ -349,7 +351,7 @@ void TOOL_BASE::updateEndItem( const TOOL_EVENT& aEvent )
if( m_endItem ) if( m_endItem )
{ {
wxLogTrace( "PNS", "%s, layer : %d", wxLogTrace( wxT( "PNS" ), wxT( "%s, layer : %d" ),
m_endItem->KindStr().c_str(), m_endItem->KindStr().c_str(),
m_endItem->Layers().Start() ); m_endItem->Layers().Start() );
} }

View File

@ -75,7 +75,7 @@ WALKAROUND::WALKAROUND_STATUS WALKAROUND::singleStep( LINE& aPath, bool aWinding
PNS_DBG( Dbg(), AddLine, aPath.CLine(), GREEN, 1, name ); PNS_DBG( Dbg(), AddLine, aPath.CLine(), GREEN, 1, name );
snprintf( name, sizeof( name ), "result-%s-%d", aWindingDirection ? "cw" : "ccw", m_iteration ); snprintf( name, sizeof( name ), "result-%s-%d", aWindingDirection ? "cw" : "ccw", m_iteration );
PNS_DBG( Dbg(), AddLine, path_walk, BLUE, 10000, name ); PNS_DBG( Dbg(), AddLine, path_walk, BLUE, 10000, name );
PNS_DBG( Dbg(), Message, wxString::Format( "Stat cw %d", !!s_cw ) ); PNS_DBG( Dbg(), Message, wxString::Format( wxT( "Stat cw %d" ), !!s_cw ) );
PNS_DBGN( Dbg(), EndGroup ); PNS_DBGN( Dbg(), EndGroup );
path_walk.Simplify(); path_walk.Simplify();

View File

@ -375,11 +375,11 @@ void ROUTER_PREVIEW_ITEM::drawShape( const SHAPE* aShape, KIGFX::GAL* gal ) cons
} }
case SH_COMPOUND: case SH_COMPOUND:
wxFAIL_MSG( "Router preview item: nested compound shapes not supported" ); wxFAIL_MSG( wxT( "Router preview item: nested compound shapes not supported" ) );
break; break;
case SH_POLY_SET: case SH_POLY_SET:
wxFAIL_MSG( "Router preview item: SHAPE_POLY_SET not supported" ); wxFAIL_MSG( wxT( "Router preview item: SHAPE_POLY_SET not supported" ) );
break; break;
case SH_NULL: case SH_NULL:

View File

@ -629,7 +629,7 @@ static VIATYPE getViaTypeFromFlags( int aFlags )
case VIA_ACTION_FLAGS::MICROVIA: case VIA_ACTION_FLAGS::MICROVIA:
return VIATYPE::MICROVIA; return VIATYPE::MICROVIA;
default: default:
wxASSERT_MSG( false, "Unhandled via type" ); wxASSERT_MSG( false, wxT( "Unhandled via type" ) );
return VIATYPE::THROUGH; return VIATYPE::THROUGH;
} }
} }
@ -993,7 +993,7 @@ int ROUTER_TOOL::handleLayerSwitch( const TOOL_EVENT& aEvent, bool aForceVia )
break; break;
default: default:
wxFAIL_MSG( "unexpected via type" ); wxFAIL_MSG( wxT( "unexpected via type" ) );
return 0; return 0;
break; break;
} }

View File

@ -106,7 +106,7 @@ wxString NET_GRID_TABLE::GetValue( int aRow, int aCol )
return m_nets[aRow].color.ToWxString( wxC2S_CSS_SYNTAX ); return m_nets[aRow].color.ToWxString( wxC2S_CSS_SYNTAX );
case COL_VISIBILITY: case COL_VISIBILITY:
return m_nets[aRow].visible ? "1" : "0"; return m_nets[aRow].visible ? wxT( "1" ) : wxT( "0" );
case COL_LABEL: case COL_LABEL:
return m_nets[aRow].name; return m_nets[aRow].name;
@ -131,7 +131,7 @@ void NET_GRID_TABLE::SetValue( int aRow, int aCol, const wxString& aValue )
break; break;
case COL_VISIBILITY: case COL_VISIBILITY:
net.visible = ( aValue != "0" ); net.visible = ( aValue != wxT( "0" ) );
updateNetVisibility( net ); updateNetVisibility( net );
break; break;
@ -249,7 +249,7 @@ void NET_GRID_TABLE::Rebuild()
{ {
int netCode = pair.second->GetNetCode(); int netCode = pair.second->GetNetCode();
if( netCode > 0 && !pair.first.StartsWith( "unconnected-(" ) ) if( netCode > 0 && !pair.first.StartsWith( wxT( "unconnected-(" ) ) )
{ {
COLOR4D color = netColors.count( netCode ) ? netColors.at( netCode ) : COLOR4D color = netColors.count( netCode ) ? netColors.at( netCode ) :
COLOR4D::UNSPECIFIED; COLOR4D::UNSPECIFIED;

View File

@ -181,8 +181,6 @@ public:
APPEARANCE_SETTING() : APPEARANCE_SETTING() :
id( -1 ), id( -1 ),
label( "" ),
tooltip( "" ),
visible( false ), visible( false ),
can_control_opacity( false ), can_control_opacity( false ),
spacer( true ), spacer( true ),