Loading 3d-viewer/3d_aux.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -70,7 +70,7 @@ void S3D_MASTER::Set_Object_Coords( std::vector< S3D_Vertex >& aVertices ) RotatePoint( &aVertices[ii].x, &aVertices[ii].y, (int) (m_MatRotation.z * 10) ); /* adjust offset position (offset is given in UNIT 3D (0.1 inch) */ #define SCALE_3D_CONV (PCB_INTERNAL_UNIT / UNITS3D_TO_UNITSPCB) #define SCALE_3D_CONV ((IU_PER_MILS * 1000) / UNITS3D_TO_UNITSPCB) aVertices[ii].x += m_MatPosition.x * SCALE_3D_CONV; aVertices[ii].y += m_MatPosition.y * SCALE_3D_CONV; aVertices[ii].z += m_MatPosition.z * SCALE_3D_CONV; Loading common/base_units.cpp +16 −0 Original line number Diff line number Diff line Loading @@ -67,6 +67,11 @@ double To_User_Unit( EDA_UNITS_T aUnit, double aValue ) wxString CoordinateToString( int aValue, bool aConvertToMils ) { return LengthDoubleToString( (double) aValue, aConvertToMils ); } wxString LengthDoubleToString( double aValue, bool aConvertToMils ) { wxString text; const wxChar* format; Loading Loading @@ -249,3 +254,14 @@ int ReturnValueFromTextCtrl( const wxTextCtrl& aTextCtr ) return value; } wxString& operator <<( wxString& aString, const wxPoint& aPos ) { aString << wxT( "@ (" ) << CoordinateToString( aPos.x ); aString << wxT( "," ) << CoordinateToString( aPos.y ); aString << wxT( ")" ); return aString; } common/common.cpp +0 −33 Original line number Diff line number Diff line Loading @@ -334,39 +334,6 @@ unsigned long GetNewTimeStamp() } const wxString& valeur_param( int valeur, wxString& buf_texte ) { switch( g_UserUnit ) { case MILLIMETRES: buf_texte.Printf( _( "%3.3f mm" ), valeur * 0.00254 ); break; case INCHES: buf_texte.Printf( wxT( "%2.4f \"" ), valeur * 0.0001 ); break; case UNSCALED_UNITS: buf_texte.Printf( wxT( "%d" ), valeur ); break; } return buf_texte; } wxString& operator <<( wxString& aString, const wxPoint& aPos ) { wxString temp; aString << wxT( "@ (" ) << valeur_param( aPos.x, temp ); aString << wxT( "," ) << valeur_param( aPos.y, temp ); aString << wxT( ")" ); return aString; } double RoundTo0( double x, double precision ) { assert( precision != 0 ); Loading common/drawframe.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -584,6 +584,11 @@ wxString EDA_DRAW_FRAME::CoordinateToString( int aValue, bool aConvertToMils ) return ::CoordinateToString( aValue, aConvertToMils ); } wxString EDA_DRAW_FRAME::LengthDoubleToString( double aValue, bool aConvertToMils ) { return ::LengthDoubleToString( aValue, aConvertToMils ); } bool EDA_DRAW_FRAME::HandleBlockBegin( wxDC* aDC, int aKey, const wxPoint& aPosition ) { Loading eeschema/class_drc_erc_item.cpp +2 −6 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ #include <class_drc_item.h> #include <erc.h> #include <base_units.h> wxString DRC_ITEM::GetErrorText() const { Loading Loading @@ -57,14 +58,9 @@ wxString DRC_ITEM::GetErrorText() const } } wxString DRC_ITEM::ShowCoord( const wxPoint& aPos ) { wxString ret; wxPoint pos_in_pcb_units = aPos; pos_in_pcb_units.x *= 10; pos_in_pcb_units.y *= 10; ret << pos_in_pcb_units; ret << aPos; return ret; } Loading
3d-viewer/3d_aux.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -70,7 +70,7 @@ void S3D_MASTER::Set_Object_Coords( std::vector< S3D_Vertex >& aVertices ) RotatePoint( &aVertices[ii].x, &aVertices[ii].y, (int) (m_MatRotation.z * 10) ); /* adjust offset position (offset is given in UNIT 3D (0.1 inch) */ #define SCALE_3D_CONV (PCB_INTERNAL_UNIT / UNITS3D_TO_UNITSPCB) #define SCALE_3D_CONV ((IU_PER_MILS * 1000) / UNITS3D_TO_UNITSPCB) aVertices[ii].x += m_MatPosition.x * SCALE_3D_CONV; aVertices[ii].y += m_MatPosition.y * SCALE_3D_CONV; aVertices[ii].z += m_MatPosition.z * SCALE_3D_CONV; Loading
common/base_units.cpp +16 −0 Original line number Diff line number Diff line Loading @@ -67,6 +67,11 @@ double To_User_Unit( EDA_UNITS_T aUnit, double aValue ) wxString CoordinateToString( int aValue, bool aConvertToMils ) { return LengthDoubleToString( (double) aValue, aConvertToMils ); } wxString LengthDoubleToString( double aValue, bool aConvertToMils ) { wxString text; const wxChar* format; Loading Loading @@ -249,3 +254,14 @@ int ReturnValueFromTextCtrl( const wxTextCtrl& aTextCtr ) return value; } wxString& operator <<( wxString& aString, const wxPoint& aPos ) { aString << wxT( "@ (" ) << CoordinateToString( aPos.x ); aString << wxT( "," ) << CoordinateToString( aPos.y ); aString << wxT( ")" ); return aString; }
common/common.cpp +0 −33 Original line number Diff line number Diff line Loading @@ -334,39 +334,6 @@ unsigned long GetNewTimeStamp() } const wxString& valeur_param( int valeur, wxString& buf_texte ) { switch( g_UserUnit ) { case MILLIMETRES: buf_texte.Printf( _( "%3.3f mm" ), valeur * 0.00254 ); break; case INCHES: buf_texte.Printf( wxT( "%2.4f \"" ), valeur * 0.0001 ); break; case UNSCALED_UNITS: buf_texte.Printf( wxT( "%d" ), valeur ); break; } return buf_texte; } wxString& operator <<( wxString& aString, const wxPoint& aPos ) { wxString temp; aString << wxT( "@ (" ) << valeur_param( aPos.x, temp ); aString << wxT( "," ) << valeur_param( aPos.y, temp ); aString << wxT( ")" ); return aString; } double RoundTo0( double x, double precision ) { assert( precision != 0 ); Loading
common/drawframe.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -584,6 +584,11 @@ wxString EDA_DRAW_FRAME::CoordinateToString( int aValue, bool aConvertToMils ) return ::CoordinateToString( aValue, aConvertToMils ); } wxString EDA_DRAW_FRAME::LengthDoubleToString( double aValue, bool aConvertToMils ) { return ::LengthDoubleToString( aValue, aConvertToMils ); } bool EDA_DRAW_FRAME::HandleBlockBegin( wxDC* aDC, int aKey, const wxPoint& aPosition ) { Loading
eeschema/class_drc_erc_item.cpp +2 −6 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ #include <class_drc_item.h> #include <erc.h> #include <base_units.h> wxString DRC_ITEM::GetErrorText() const { Loading Loading @@ -57,14 +58,9 @@ wxString DRC_ITEM::GetErrorText() const } } wxString DRC_ITEM::ShowCoord( const wxPoint& aPos ) { wxString ret; wxPoint pos_in_pcb_units = aPos; pos_in_pcb_units.x *= 10; pos_in_pcb_units.y *= 10; ret << pos_in_pcb_units; ret << aPos; return ret; }