Fix compil issues (and probably a bug). Also display calculation time info.

This commit is contained in:
jean-pierre charras 2023-08-24 13:02:10 +02:00
parent a97ba79883
commit eb8c1d2a90
2 changed files with 13 additions and 5 deletions

View File

@ -47,6 +47,7 @@
#include <wx/crt.h>
#include <wx/log.h>
#include <profile.h> // To use GetRunningMicroSecs or another profiling utility
#define OCC_VERSION_MIN 0x070500
@ -492,6 +493,9 @@ void EXPORTER_STEP::calculatePcbThickness()
bool EXPORTER_STEP::Export()
{
// Display the export time, for statistics
unsigned stats_startExportTime = GetRunningMicroSecs();
// setup opencascade message log
Message::DefaultMessenger()->RemovePrinters( STANDARD_TYPE( Message_PrinterOStream ) );
Message::DefaultMessenger()->AddPrinter( new KiCadPrinter( this ) );
@ -572,5 +576,9 @@ bool EXPORTER_STEP::Export()
ReportMessage( msg );
}
// Display calculation time in seconds
double calculation_time = (double)( GetRunningMicroSecs() - stats_startExportTime) / 1e6;
ReportMessage( wxString::Format( _( "\nExport time %.3f s\n" ), calculation_time ) );
return true;
}

View File

@ -620,7 +620,7 @@ bool STEP_PCB_MODEL::MakeShapes( std::vector<TopoDS_Shape>& aShapes, const SHAPE
std::vector<gp_Pnt> coords3D( coords.size() );
// Convert to 3D points
for( int ii = 0; ii < coords.size(); ii++ )
for( size_t ii = 0; ii < coords.size(); ii++ )
{
coords3D[ii] = gp_Pnt( pcbIUScale.IUTomm( coords[ii].x - aOrigin.x ),
-pcbIUScale.IUTomm( coords[ii].y - aOrigin.y ),
@ -635,7 +635,7 @@ bool STEP_PCB_MODEL::MakeShapes( std::vector<TopoDS_Shape>& aShapes, const SHAPE
aMkWire.Add( BRepBuilderAPI_MakeEdge( arcOfCircle ) );
if( aMkWire.Error() != BRepBuilderAPI_WireDone )
if( aMkWire.Error() != BRepLib_WireDone )
{
ReportMessage( wxT( "failed to add curve\n" ) );
return false;
@ -666,7 +666,7 @@ bool STEP_PCB_MODEL::MakeShapes( std::vector<TopoDS_Shape>& aShapes, const SHAPE
BRepBuilderAPI_MakeEdge mkEdge( start, end );
aMkWire.Add( mkEdge );
if( aMkWire.Error() != BRepBuilderAPI_WireDone )
if( aMkWire.Error() != BRepLib_WireDone )
{
ReportMessage( wxT( "failed to add curve\n" ) );
return false;
@ -687,7 +687,7 @@ bool STEP_PCB_MODEL::MakeShapes( std::vector<TopoDS_Shape>& aShapes, const SHAPE
BRepBuilderAPI_MakeFace mkFace;
for( int contId = 0; contId < polygon.size(); contId++ )
for( size_t contId = 0; contId < polygon.size(); contId++ )
{
const SHAPE_LINE_CHAIN& contour = polygon[contId];
BRepLib_MakeWire mkWire;
@ -775,7 +775,7 @@ bool STEP_PCB_MODEL::CreatePCB( SHAPE_POLY_SET& aOutline, VECTOR2D aOrigin )
Handle( Bnd_HArray1OfBox ) holeBoxSet = new Bnd_HArray1OfBox( 0, m_cutouts.size() - 1 );
for( int i = 0; i < m_cutouts.size(); i++ )
for( size_t i = 0; i < m_cutouts.size(); i++ )
{
Bnd_Box bbox;
BRepBndLib::Add( m_cutouts[i], bbox );