Commit f3503723 authored by Miguel Angel Ajo's avatar Miguel Angel Ajo
Browse files

merged to testing, fixed some scripting imports

parents b939f3bc b322a885
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -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) );
            RotatePoint( &aVertices[ii].x, &aVertices[ii].y, (int) (m_MatRotation.z * 10) );


        /* adjust offset position (offset is given in UNIT 3D (0.1 inch) */
        /* 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].x += m_MatPosition.x * SCALE_3D_CONV;
        aVertices[ii].y += m_MatPosition.y * SCALE_3D_CONV;
        aVertices[ii].y += m_MatPosition.y * SCALE_3D_CONV;
        aVertices[ii].z += m_MatPosition.z * SCALE_3D_CONV;
        aVertices[ii].z += m_MatPosition.z * SCALE_3D_CONV;
+21 −9
Original line number Original line Diff line number Diff line
@@ -52,21 +52,33 @@ PCBNew
  See the @todos in class_zone.cpp
  See the @todos in class_zone.cpp




Dick's Peronal TODO Items  (Last Update: 5-April-2012)
Dick's Peronal TODO Items  (Last Update: 24-April-2012)
-----------------------------------------------------
-----------------------------------------------------
0)  Check that the new load visibility BOARD settings is properly setting the toolbar

1)  Work through some scroll, pan, zoom overflows in PCBNEW's nanometer build mode.
    It is thought that if we can constrain the virtual IU space to within
    INT_MIN to INT_MAX then a whole host of other problems will go away.  Most
    of the evil is in EDA_DRAW_FRAME::AdjustScrollBars() which assumes the
    virtual IU space is infinite.  This function triggers a movement of the
    viewport within the virtual IU space and also a change in size of the virtual
    IU space.  Once this happens, you can end up thinking there are problems in
    functions like EDA_DRAW_PANE::DrawCrossHair(), but this may be an artifact
    of having traveled outside a limited virtual IU space.


2)  Check that the new load visibility BOARD settings is properly setting the toolbar
    buttons like show grid or ratsnest.  Add PCB_EDIT_FRAME::SetVisibleElements() so
    buttons like show grid or ratsnest.  Add PCB_EDIT_FRAME::SetVisibleElements() so
    toolbar crap is not known to a BOARD.
    toolbar crap is not known to a BOARD.


1) Finish removing global access requirements from KICAD_PLUGIN, so that:
3)  Finish removing global access requirements from KICAD_PLUGIN, so that:
    *)  a BOARD is a fully self contained document description.
    *)  a BOARD is a fully self contained document description.
    *)  plugin developers do not have to access globals, since a plugin could
    *)  plugin developers do not have to access globals, since a plugin could
        very well be a dynamically loaded DLL/DSO.
        very well be a dynamically loaded DLL/DSO.
        One final problem remains with BASE_SCREEN's grid origin, easy solution is to
        One final problem remains with BASE_SCREEN's grid origin, easy solution is to
        move just that one field into the BOARD.
        move just that one field into the BOARD.


2) Do an EAGLE XML import PCBNEW PLUGIN, and possibly add export support to it.
4) Do an EAGLE XML import PCBNEW PLUGIN, and possibly add export support to it.
   This is PLUGIN::Load() and maybe PLUGIN::Save().
   This is PLUGIN::Load() and maybe PLUGIN::Save().


3) Get back to the SWEET work.
5) Get back to the SWEET work.
+0 −2
Original line number Original line Diff line number Diff line
@@ -83,7 +83,6 @@ add_library(common STATIC ${COMMON_SRCS})


set(PCB_COMMON_SRCS
set(PCB_COMMON_SRCS
    base_screen.cpp
    base_screen.cpp
    base_units.cpp
    eda_text.cpp
    eda_text.cpp
    class_page_info.cpp
    class_page_info.cpp
    pcbcommon.cpp
    pcbcommon.cpp
@@ -120,7 +119,6 @@ set(PCB_COMMON_SRCS
    ../pcbnew/legacy_plugin.cpp
    ../pcbnew/legacy_plugin.cpp
    ../pcbnew/kicad_plugin.cpp
    ../pcbnew/kicad_plugin.cpp
    pcb_plot_params_keywords.cpp
    pcb_plot_params_keywords.cpp
    dialogs/dialog_page_settings.cpp
)
)




+13 −18
Original line number Original line Diff line number Diff line
@@ -70,17 +70,19 @@ void BASE_SCREEN::InitDataPoints( const wxSize& aPageSizeIU )
{
{
    if( m_Center )
    if( m_Center )
    {
    {
        m_crossHairPosition.x = m_crossHairPosition.y = 0;
        m_crossHairPosition.x = 0;
        m_crossHairPosition.y = 0;


        m_DrawOrg.x = -aPageSizeIU.x / 2;
        m_DrawOrg.x = -aPageSizeIU.x / 2;
        m_DrawOrg.y = -aPageSizeIU.y / 2;
        m_DrawOrg.y = -aPageSizeIU.y / 2;
    }
    }
    else
    else
    {
    {
        m_DrawOrg.x = m_DrawOrg.y = 0;

        m_crossHairPosition.x = aPageSizeIU.x / 2;
        m_crossHairPosition.x = aPageSizeIU.x / 2;
        m_crossHairPosition.y = aPageSizeIU.y / 2;
        m_crossHairPosition.y = aPageSizeIU.y / 2;

        m_DrawOrg.x = 0;
        m_DrawOrg.y = 0;
    }
    }


    m_O_Curseur.x = m_O_Curseur.y = 0;
    m_O_Curseur.x = m_O_Curseur.y = 0;
@@ -142,6 +144,8 @@ bool BASE_SCREEN::SetZoom( double coeff )
    if( coeff == m_Zoom )
    if( coeff == m_Zoom )
        return false;
        return false;


    wxLogDebug( "Zoom:%16g  1/Zoom:%16g", coeff, 1/coeff );

    m_Zoom = coeff;
    m_Zoom = coeff;


    return true;
    return true;
@@ -168,12 +172,10 @@ bool BASE_SCREEN::SetNextZoom()


bool BASE_SCREEN::SetPreviousZoom()
bool BASE_SCREEN::SetPreviousZoom()
{
{
    size_t i;

    if( m_ZoomList.IsEmpty() || m_Zoom <= m_ZoomList[0] )
    if( m_ZoomList.IsEmpty() || m_Zoom <= m_ZoomList[0] )
        return false;
        return false;


    for( i = m_ZoomList.GetCount(); i != 0; i-- )
    for( unsigned i = m_ZoomList.GetCount(); i != 0; i-- )
    {
    {
        if( m_Zoom > m_ZoomList[i - 1] )
        if( m_Zoom > m_ZoomList[i - 1] )
        {
        {
@@ -191,8 +193,7 @@ bool BASE_SCREEN::SetLastZoom()
    if( m_ZoomList.IsEmpty() || m_Zoom == m_ZoomList.Last() )
    if( m_ZoomList.IsEmpty() || m_Zoom == m_ZoomList.Last() )
        return false;
        return false;


    SetZoom( m_ZoomList.Last() );
    return SetZoom( m_ZoomList.Last() );
    return true;
}
}




@@ -216,11 +217,9 @@ void BASE_SCREEN::SetGrid( const wxRealPoint& size )
{
{
    wxASSERT( !m_grids.empty() );
    wxASSERT( !m_grids.empty() );


    size_t i;

    GRID_TYPE nearest_grid = m_grids[0];
    GRID_TYPE nearest_grid = m_grids[0];


    for( i = 0; i < m_grids.size(); i++ )
    for( unsigned i = 0; i < m_grids.size(); i++ )
    {
    {
        if( m_grids[i].m_Size == size )
        if( m_grids[i].m_Size == size )
        {
        {
@@ -228,7 +227,7 @@ void BASE_SCREEN::SetGrid( const wxRealPoint& size )
            return;
            return;
        }
        }


        // keep trace of the nearest grill size, if the exact size is not found
        // keep track of the nearest larger grid size, if the exact size is not found
        if ( size.x < m_grids[i].m_Size.x )
        if ( size.x < m_grids[i].m_Size.x )
            nearest_grid = m_grids[i];
            nearest_grid = m_grids[i];
    }
    }
@@ -245,9 +244,7 @@ void BASE_SCREEN::SetGrid( int id )
{
{
    wxASSERT( !m_grids.empty() );
    wxASSERT( !m_grids.empty() );


    size_t i;
    for( unsigned i = 0; i < m_grids.size(); i++ )

    for( i = 0; i < m_grids.size(); i++ )
    {
    {
        if( m_grids[i].m_Id == id )
        if( m_grids[i].m_Id == id )
        {
        {
@@ -266,9 +263,7 @@ void BASE_SCREEN::SetGrid( int id )


void BASE_SCREEN::AddGrid( const GRID_TYPE& grid )
void BASE_SCREEN::AddGrid( const GRID_TYPE& grid )
{
{
    size_t i;
    for( unsigned i = 0; i < m_grids.size(); i++ )

    for( i = 0; i < m_grids.size(); i++ )
    {
    {
        if( m_grids[i].m_Size == grid.m_Size && grid.m_Id != ID_POPUP_GRID_USER )
        if( m_grids[i].m_Size == grid.m_Size && grid.m_Id != ID_POPUP_GRID_USER )
        {
        {
+22 −18
Original line number Original line Diff line number Diff line
@@ -40,25 +40,13 @@
#include <base_units.h>
#include <base_units.h>




#if defined( PCBNEW )
#if defined( PCBNEW ) || defined( CVPCB ) || defined( EESCHEMA )
#if defined( USE_PCBNEW_NANOMETRES )
#define IU_TO_MM( x )       ( x / IU_PER_MM )
#define IU_TO_MM( x )       ( x * 1e-6 )
#define IU_TO_IN( x )       ( x / IU_PER_MILS / 1000 )
#define IU_TO_IN( x )       ( ( x * 1e-6 ) / 25.4 )
#define MM_TO_IU( x )       ( x * IU_PER_MM )
#define MM_TO_IU( x )       ( x * 1e6 )
#define IN_TO_IU( x )       ( x * IU_PER_MILS * 1000 )
#define IN_TO_IU( x )       ( ( x * 25.4 ) * 1e6 )
#else
#define IU_TO_MM( x )       ( ( x * 0.0001 ) * 25.4 )
#define IU_TO_IN( x )       ( x * 0.0001 )
#define MM_TO_IU( x )       ( ( x / 25.4 ) * 10000.0 )
#define IN_TO_IU( x )       ( x * 10000.0 )
#endif
#elif defined( EESCHEMA )
#define IU_TO_MM( x )       ( ( x * 0.001 ) * 25.4 )
#define IU_TO_IN( x )       ( x * 0.001 )
#define MM_TO_IU( x )       ( ( x / 25.4 ) * 1000.0 )
#define IN_TO_IU( x )       ( x * 1000.0 )
#else
#else
#error "Cannot resolve internal units due to no definition of EESCHEMA or PCBNEW."
#error "Cannot resolve internal units due to no definition of EESCHEMA, CVPCB or PCBNEW."
#endif
#endif




@@ -79,6 +67,11 @@ double To_User_Unit( EDA_UNITS_T aUnit, double aValue )




wxString CoordinateToString( int aValue, bool aConvertToMils )
wxString CoordinateToString( int aValue, bool aConvertToMils )
{
    return LengthDoubleToString( (double) aValue, aConvertToMils );
}

wxString LengthDoubleToString( double aValue, bool aConvertToMils )
{
{
    wxString      text;
    wxString      text;
    const wxChar* format;
    const wxChar* format;
@@ -261,3 +254,14 @@ int ReturnValueFromTextCtrl( const wxTextCtrl& aTextCtr )


    return value;
    return value;
}
}


wxString& operator <<( wxString& aString, const wxPoint& aPos )
{
    aString << wxT( "@ (" ) << CoordinateToString( aPos.x );
    aString << wxT( "," ) << CoordinateToString( aPos.y );
    aString << wxT( ")" );

    return aString;
}
Loading