Fix compil issues (and probably a bug). Also display calculation time info.
This commit is contained in:
parent
a97ba79883
commit
eb8c1d2a90
|
@ -47,6 +47,7 @@
|
||||||
|
|
||||||
#include <wx/crt.h>
|
#include <wx/crt.h>
|
||||||
#include <wx/log.h>
|
#include <wx/log.h>
|
||||||
|
#include <profile.h> // To use GetRunningMicroSecs or another profiling utility
|
||||||
|
|
||||||
#define OCC_VERSION_MIN 0x070500
|
#define OCC_VERSION_MIN 0x070500
|
||||||
|
|
||||||
|
@ -492,6 +493,9 @@ void EXPORTER_STEP::calculatePcbThickness()
|
||||||
|
|
||||||
bool EXPORTER_STEP::Export()
|
bool EXPORTER_STEP::Export()
|
||||||
{
|
{
|
||||||
|
// Display the export time, for statistics
|
||||||
|
unsigned stats_startExportTime = GetRunningMicroSecs();
|
||||||
|
|
||||||
// setup opencascade message log
|
// setup opencascade message log
|
||||||
Message::DefaultMessenger()->RemovePrinters( STANDARD_TYPE( Message_PrinterOStream ) );
|
Message::DefaultMessenger()->RemovePrinters( STANDARD_TYPE( Message_PrinterOStream ) );
|
||||||
Message::DefaultMessenger()->AddPrinter( new KiCadPrinter( this ) );
|
Message::DefaultMessenger()->AddPrinter( new KiCadPrinter( this ) );
|
||||||
|
@ -572,5 +576,9 @@ bool EXPORTER_STEP::Export()
|
||||||
ReportMessage( msg );
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -620,7 +620,7 @@ bool STEP_PCB_MODEL::MakeShapes( std::vector<TopoDS_Shape>& aShapes, const SHAPE
|
||||||
std::vector<gp_Pnt> coords3D( coords.size() );
|
std::vector<gp_Pnt> coords3D( coords.size() );
|
||||||
|
|
||||||
// Convert to 3D points
|
// 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 ),
|
coords3D[ii] = gp_Pnt( pcbIUScale.IUTomm( coords[ii].x - aOrigin.x ),
|
||||||
-pcbIUScale.IUTomm( coords[ii].y - aOrigin.y ),
|
-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 ) );
|
aMkWire.Add( BRepBuilderAPI_MakeEdge( arcOfCircle ) );
|
||||||
|
|
||||||
if( aMkWire.Error() != BRepBuilderAPI_WireDone )
|
if( aMkWire.Error() != BRepLib_WireDone )
|
||||||
{
|
{
|
||||||
ReportMessage( wxT( "failed to add curve\n" ) );
|
ReportMessage( wxT( "failed to add curve\n" ) );
|
||||||
return false;
|
return false;
|
||||||
|
@ -666,7 +666,7 @@ bool STEP_PCB_MODEL::MakeShapes( std::vector<TopoDS_Shape>& aShapes, const SHAPE
|
||||||
BRepBuilderAPI_MakeEdge mkEdge( start, end );
|
BRepBuilderAPI_MakeEdge mkEdge( start, end );
|
||||||
aMkWire.Add( mkEdge );
|
aMkWire.Add( mkEdge );
|
||||||
|
|
||||||
if( aMkWire.Error() != BRepBuilderAPI_WireDone )
|
if( aMkWire.Error() != BRepLib_WireDone )
|
||||||
{
|
{
|
||||||
ReportMessage( wxT( "failed to add curve\n" ) );
|
ReportMessage( wxT( "failed to add curve\n" ) );
|
||||||
return false;
|
return false;
|
||||||
|
@ -687,7 +687,7 @@ bool STEP_PCB_MODEL::MakeShapes( std::vector<TopoDS_Shape>& aShapes, const SHAPE
|
||||||
|
|
||||||
BRepBuilderAPI_MakeFace mkFace;
|
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];
|
const SHAPE_LINE_CHAIN& contour = polygon[contId];
|
||||||
BRepLib_MakeWire mkWire;
|
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 );
|
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;
|
Bnd_Box bbox;
|
||||||
BRepBndLib::Add( m_cutouts[i], bbox );
|
BRepBndLib::Add( m_cutouts[i], bbox );
|
||||||
|
|
Loading…
Reference in New Issue