Browse Source

Rationalize STEP file warnings

1) Use consistent terminology and formatting
2) Capitalize STEP
3) Don't double-report errors in MessageBox and REPORTER

Fixes https://gitlab.com/kicad/code/kicad/issues/7670
6.0.7
Jeff Young 4 years ago
parent
commit
507b386c79
  1. 22
      utils/kicad2step/kicad2step.cpp
  2. 4
      utils/kicad2step/pcb/oce_utils.cpp

22
utils/kicad2step/kicad2step.cpp

@ -366,7 +366,7 @@ int PANEL_KICAD2STEP::RunConverter()
if( out_fname.FileExists() && !m_params.m_overwrite ) if( out_fname.FileExists() && !m_params.m_overwrite )
{ {
ReportMessage( _( "** Output already exists.\n"
ReportMessage( _( "** Output already exists. Export aborted. **\n"
"Enable the force overwrite flag to overwrite it." ) ); "Enable the force overwrite flag to overwrite it." ) );
return -1; return -1;
@ -404,7 +404,7 @@ int PANEL_KICAD2STEP::RunConverter()
if( !res ) if( !res )
{ {
ReportMessage( _( "\n**Error building STEP board model. Abort export **\n" ) );
ReportMessage( _( "\n** Error building STEP board model. Export aborted. **\n" ) );
return -1; return -1;
} }
@ -419,23 +419,19 @@ int PANEL_KICAD2STEP::RunConverter()
if( !res ) if( !res )
{ {
ReportMessage( _( "\nError Write STEP file\n" ) );
ReportMessage( _( "\n** Error writing STEP file. **\n" ) );
return -1; return -1;
} }
} }
catch( const Standard_Failure& e ) catch( const Standard_Failure& e )
{ {
wxString err = e.GetMessageString();
wxMessageBox( err, _( "Export Error" ) );
ReportMessage( wxString::Format( _( "\nExport Error: %s\n" ), err ) );
ReportMessage( _( "\n*** Abort export ***\n" ) );
ReportMessage( e.GetMessageString() );
ReportMessage( _( "\n** Error exporting STEP file. Export aborted. **\n" ) );
return -1; return -1;
} }
catch( ... ) catch( ... )
{ {
wxMessageBox( _( "(no exception information)" ), _( "Unknown error" ) );
ReportMessage( _( "\nUnknown error\n*** Abort export ***\n" ) );
ReportMessage( _( "\n** Error exporting STEP file. Export aborted. **\n" ) );
return -1; return -1;
} }
} }
@ -444,7 +440,7 @@ int PANEL_KICAD2STEP::RunConverter()
msgs << msgs_from_opencascade.str(); msgs << msgs_from_opencascade.str();
ReportMessage( msgs ); ReportMessage( msgs );
ReportMessage( wxString::Format( _( "\nStep file '%s' created\n\n" ), outfile ) );
ReportMessage( wxString::Format( _( "\nSTEP file '%s' created.\n" ), outfile ) );
errs << errors_from_opencascade.str(); errs << errors_from_opencascade.str();
ReportMessage( errs ); ReportMessage( errs );
@ -465,10 +461,6 @@ int PANEL_KICAD2STEP::RunConverter()
msg = _( "STEP file has been created, but there are warnings." ); msg = _( "STEP file has been created, but there are warnings." );
} }
} }
else // No error messages: the file is expected OK
{
msg.Printf( _( "STEP file:\n%s\nhas been created successfully." ), outfile );
}
ReportMessage( msg ); ReportMessage( msg );

4
utils/kicad2step/pcb/oce_utils.cpp

@ -1150,8 +1150,8 @@ bool PCBMODEL::getModelLabel( const std::string& aFileName, TRIPLET aScale, TDF_
else // Substitution is not allowed else // Substitution is not allowed
{ {
if( aErrorMessage ) if( aErrorMessage )
aErrorMessage->Printf( "Cannot add a VRML model data to a Step file.\n",
aFileName );
aErrorMessage->Printf( "Cannot add a VRML model to a STEP file.\n", aFileName );
return false; return false;
} }

Loading…
Cancel
Save