Commit 5732d815 authored by charras's avatar charras
Browse files

Work on colors handling, and others changes. see changelog.

hide/show rastnest in pcbnew is currently not working, will be fixed soon
parent 4768fc78
Loading
Loading
Loading
Loading
+12 −11
Original line number Original line Diff line number Diff line
@@ -11,6 +11,7 @@
#include "drawtxt.h"
#include "drawtxt.h"
#include "confirm.h"
#include "confirm.h"
#include "class_board_design_settings.h"
#include "class_board_design_settings.h"
#include "colors_selection.h"


#include "3d_viewer.h"
#include "3d_viewer.h"
#include "trackball.h"
#include "trackball.h"
@@ -362,7 +363,7 @@ void Pcb3D_GLCanvas::Draw3D_Track( TRACK* track )
    if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( layer ) == false )
    if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( layer ) == false )
        return;
        return;


    int color = g_Parm_3D_Visu.m_BoardSettings->m_LayerColor[layer];
    int color = g_ColorsSettings.GetLayerColor(layer);


    if( layer == LAST_COPPER_LAYER )
    if( layer == LAST_COPPER_LAYER )
        layer = g_Parm_3D_Visu.m_Layers - 1;
        layer = g_Parm_3D_Visu.m_Layers - 1;
@@ -392,7 +393,7 @@ void Pcb3D_GLCanvas::Draw3D_SolidPolygonsInZones( ZONE_CONTAINER* zone_c )
    if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( layer ) == false )
    if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( layer ) == false )
        return;
        return;


    int color = g_Parm_3D_Visu.m_BoardSettings->m_LayerColor[layer];
    int color = g_ColorsSettings.GetLayerColor(layer);


    if( layer == LAST_COPPER_LAYER )
    if( layer == LAST_COPPER_LAYER )
        layer = g_Parm_3D_Visu.m_Layers - 1;
        layer = g_Parm_3D_Visu.m_Layers - 1;
@@ -467,14 +468,14 @@ void Pcb3D_GLCanvas::Draw3D_Via( SEGVIA* via )
            if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( layer ) ==
            if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( layer ) ==
                false )
                false )
                continue;
                continue;
            color = g_Parm_3D_Visu.m_BoardSettings->m_LayerColor[layer];
            color = g_ColorsSettings.GetLayerColor(layer);
        }
        }
        else
        else
        {
        {
            if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( LAYER_N_FRONT ) ==
            if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( LAYER_N_FRONT ) ==
                false )
                false )
                continue;
                continue;
            color = g_Parm_3D_Visu.m_BoardSettings->m_LayerColor[LAYER_N_FRONT];
            color = g_ColorsSettings.GetLayerColor(LAYER_N_FRONT);
        }
        }


        SetGLColor( color );
        SetGLColor( color );
@@ -491,7 +492,7 @@ void Pcb3D_GLCanvas::Draw3D_Via( SEGVIA* via )
    }
    }


    // Drawing hole:
    // Drawing hole:
    color = g_Parm_3D_Visu.m_BoardSettings->m_ViaColor[via->m_Shape];
    color =  g_ColorsSettings.GetItemColor(VIAS_VISIBLE + via->m_Shape);
    SetGLColor( color );
    SetGLColor( color );
    height = g_Parm_3D_Visu.m_LayerZcoord[top_layer] -
    height = g_Parm_3D_Visu.m_LayerZcoord[top_layer] -
             g_Parm_3D_Visu.m_LayerZcoord[bottom_layer];
             g_Parm_3D_Visu.m_LayerZcoord[bottom_layer];
@@ -510,7 +511,7 @@ void Pcb3D_GLCanvas::Draw3D_DrawSegment( DRAWSEGMENT* segment )
    if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( layer ) == false )
    if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( layer ) == false )
        return;
        return;


    int color = g_Parm_3D_Visu.m_BoardSettings->m_LayerColor[layer];
    int color = g_ColorsSettings.GetLayerColor(layer);


    SetGLColor( color );
    SetGLColor( color );
    w  = segment->m_Width * g_Parm_3D_Visu.m_BoardScale;
    w  = segment->m_Width * g_Parm_3D_Visu.m_BoardScale;
@@ -596,7 +597,7 @@ void Pcb3D_GLCanvas::Draw3D_DrawText( TEXTE_PCB* text )
    if( !Get3DLayerEnable( layer ) )
    if( !Get3DLayerEnable( layer ) )
        return;
        return;


    int color = g_Parm_3D_Visu.m_BoardSettings->m_LayerColor[layer];
    int color = g_ColorsSettings.GetLayerColor(layer);




    SetGLColor( color );
    SetGLColor( color );
@@ -730,7 +731,7 @@ void EDGE_MODULE::Draw3D( Pcb3D_GLCanvas* glcanvas )
    if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( m_Layer ) == false )
    if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( m_Layer ) == false )
        return;
        return;


    int color = g_Parm_3D_Visu.m_BoardSettings->m_LayerColor[m_Layer];
    int color = g_ColorsSettings.GetLayerColor(m_Layer);




    SetGLColor( color );
    SetGLColor( color );
@@ -838,7 +839,7 @@ void D_PAD::Draw3D( Pcb3D_GLCanvas* glcanvas )
            if( (layer > FIRST_COPPER_LAYER) && (layer < LAST_COPPER_LAYER)
            if( (layer > FIRST_COPPER_LAYER) && (layer < LAST_COPPER_LAYER)
               && !Both )
               && !Both )
                continue;
                continue;
            color = g_Parm_3D_Visu.m_BoardSettings->m_LayerColor[layer];
            color = g_ColorsSettings.GetLayerColor(layer);
            if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( layer ) ==
            if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( layer ) ==
                false )
                false )
                continue;
                continue;
@@ -890,7 +891,7 @@ void D_PAD::Draw3D( Pcb3D_GLCanvas* glcanvas )
                if( (layer > FIRST_COPPER_LAYER)
                if( (layer > FIRST_COPPER_LAYER)
                   && (layer < LAST_COPPER_LAYER) && !Both )
                   && (layer < LAST_COPPER_LAYER) && !Both )
                    continue;
                    continue;
                color = g_Parm_3D_Visu.m_BoardSettings->m_LayerColor[layer];
                color = g_ColorsSettings.GetLayerColor(layer);
                glNormal3f( 0.0, 0.0, (layer == LAYER_N_BACK) ? -1.0 : 1.0 );
                glNormal3f( 0.0, 0.0, (layer == LAYER_N_BACK) ? -1.0 : 1.0 );
                if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( layer ) ==
                if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( layer ) ==
                    false )
                    false )
@@ -968,7 +969,7 @@ void D_PAD::Draw3D( Pcb3D_GLCanvas* glcanvas )
            if( (layer > FIRST_COPPER_LAYER) && (layer < LAST_COPPER_LAYER)
            if( (layer > FIRST_COPPER_LAYER) && (layer < LAST_COPPER_LAYER)
               && !Both )
               && !Both )
                continue;
                continue;
            color = g_Parm_3D_Visu.m_BoardSettings->m_LayerColor[layer];
            color = g_ColorsSettings.GetLayerColor(layer);
            glNormal3f( 0.0, 0.0, (layer == LAYER_N_BACK) ? -1.0 : 1.0 );
            glNormal3f( 0.0, 0.0, (layer == LAYER_N_BACK) ? -1.0 : 1.0 );
            if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( layer ) ==
            if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( layer ) ==
                false )
                false )
+31 −0
Original line number Original line Diff line number Diff line
@@ -4,6 +4,37 @@ KiCad ChangeLog 2010
Please add newer entries at the top, list the date and your name with
Please add newer entries at the top, list the date and your name with
email address.
email address.


2010-Jan-29 UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
================================================================================
 ++ All:
    added a test to solve a problem when cross compiling Kicad under Linux for Windows
    Specific to countries that use a comma as separators in floating point numbers notation:
    Depending on wxWideget version:
        printed as 0,5 and read as 0.5
        or
        printed as 0.5 and read as 0,5
    So float values are always broken in dialogs (many are seen as 0)
    Now a test is made, and if there are problems relative to floats
    (write/read conversion error),
    use the C convention (always a point as separator)
    
 ++ eeschema:
    Removed metrics grid values, that cannot be handled in schematic.
    (because 2 items are seen as connected if they have the same coordinates
    mixing mm and mils with internal units = 1 mil break netlist
    and ERC calculations
    So grid value *must* be an integer (in 1/1000 inch).
    And metric grid is not very useful in schematic.
    (Also 1 mil and 0.025 mm can be seen as the same value for a schematic that do not
    needs precision in dimensions, so no need to have mils and mm in grid values)

++ pcbnew:
    Starting work on color selection and items visibility
    * code cleaning and removing global values.
    * Separe visibility options for board editor and module editor
    (work in progress, just starting)


2010-Jan-28 UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
2010-Jan-28 UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
================================================================================
================================================================================
 *fixed eeschema crash when using the hotkey m (move) command.
 *fixed eeschema crash when using the hotkey m (move) command.
+1 −0
Original line number Original line Diff line number Diff line
@@ -13,6 +13,7 @@ set(COMMON_SRCS
    bezier_curves.cpp
    bezier_curves.cpp
    block_commande.cpp
    block_commande.cpp
    build_version.cpp
    build_version.cpp
    class_colors_design_settings.cpp
    class_marker_base.cpp
    class_marker_base.cpp
    class_plotter.cpp
    class_plotter.cpp
    class_undoredo_container.cpp
    class_undoredo_container.cpp
+12 −1
Original line number Original line Diff line number Diff line
@@ -117,6 +117,16 @@ StructColors ColorRefs[NBCOLOR] =
    {  128, 255, 255, LIGHTYELLOW,  wxT( "LIGHTYELLOW" ),  LIGHTYELLOW           }
    {  128, 255, 255, LIGHTYELLOW,  wxT( "LIGHTYELLOW" ),  LIGHTYELLOW           }
};
};


/** Function to use local notation or C standard notation for floating point numbers
 * some countries use 1,5 and others (and C) 1.5
 * so we switch from local to C and C to local when reading or writing files
 * And other problem is a bug when cross compiling under linux:
 * a printf print 1,5 and the read functions expects 1.5
 * (depending on version print = 1.5 and read = 1,5
 * Very annoying and we detect this and use a stupid but necessary workarount
*/
bool g_DisableFloatingPointLocalNotation = false;



/** function SetLocaleTo_C_standard
/** function SetLocaleTo_C_standard
 * because kicad is internationalized, switch internalization to "C" standard
 * because kicad is internationalized, switch internalization to "C" standard
@@ -146,6 +156,7 @@ void SetLocaleTo_C_standard( void )
 */
 */
void SetLocaleTo_Default( void )
void SetLocaleTo_Default( void )
{
{
    if( ! g_DisableFloatingPointLocalNotation )
        setlocale( LC_NUMERIC, "" );      // revert to the current locale
        setlocale( LC_NUMERIC, "" );      // revert to the current locale
}
}


+16 −0
Original line number Original line Diff line number Diff line
@@ -684,6 +684,22 @@ bool WinEDA_App::SetLanguage( bool first_time )
        m_EDA_CommonConfig->Write( wxT( "Language" ), m_LanguageId );
        m_EDA_CommonConfig->Write( wxT( "Language" ), m_LanguageId );
    }
    }


    // Test if floating point notation is working (bug in cross compilation)
    // Make a conversion double <=> string
    double dtst = 0.5;
    wxString msg;
    extern bool g_DisableFloatingPointLocalNotation;    // See common.cpp
    g_DisableFloatingPointLocalNotation = false;
    msg << dtst;
    double result;
    msg.ToDouble(&result);
    if( result != dtst )  // string to double encode/decode does not work! Bug detected
    {
        // Disable floating point localisation:
        g_DisableFloatingPointLocalNotation = true;
        SetLocaleTo_C_standard( );
    }

    if( !m_Locale->IsLoaded( DictionaryName ) )
    if( !m_Locale->IsLoaded( DictionaryName ) )
        m_Locale->AddCatalog( DictionaryName );
        m_Locale->AddCatalog( DictionaryName );


Loading