Commit 9ededca9 authored by jean-pierre charras's avatar jean-pierre charras
Browse files

Gerbview: Fix a minor but annoying issue in gerbview config: colors setup is...

Gerbview: Fix a minor but annoying issue in gerbview  config: colors setup is broken when running a testing version after an old gerbview version (due to a bug of this old version which breaks the color config)
parent 2f3c5e7a
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -122,15 +122,15 @@ PARAM_CFG_ARRAY& GERBVIEW_FRAME::GetConfigurationSettings()
    // because the parameter list that use these keywords does not store them,
    // just points to them.
    static const wxChar* keys[] = {
        wxT("ColorLayer0"),     wxT("ColorLayer1"),     wxT("ColorLayer2"),     wxT("ColorLayer3"),
        wxT("ColorLayer4"),     wxT("ColorLayer5"),     wxT("ColorLayer6"),     wxT("ColorLayer7"),
        wxT("ColorLayer8"),     wxT("ColorLayer9"),     wxT("ColorLayer10"),    wxT("ColorLayer11"),
        wxT("ColorLayer12"),    wxT("ColorLayer13"),    wxT("ColorLayer14"),    wxT("ColorLayer15"),

        wxT("ColorLayer16"),    wxT("ColorLayer17"),    wxT("ColorLayer18"),    wxT("ColorLayer19"),
        wxT("ColorLayer20"),    wxT("ColorLayer21"),    wxT("ColorLayer22"),    wxT("ColorLayer23"),
        wxT("ColorLayer24"),    wxT("ColorLayer25"),    wxT("ColorLayer26"),    wxT("ColorLayer27"),
        wxT("ColorLayer28"),    wxT("ColorLayer29"),    wxT("ColorLayer30"),    wxT("ColorLayer31"),
        wxT("ColorLayer_0"),     wxT("ColorLayer_1"),     wxT("ColorLayer_2"),     wxT("ColorLayer_3"),
        wxT("ColorLayer_4"),     wxT("ColorLayer_5"),     wxT("ColorLayer_6"),     wxT("ColorLayer_7"),
        wxT("ColorLayer_8"),     wxT("ColorLayer_9"),     wxT("ColorLayer_10"),    wxT("ColorLayer_11"),
        wxT("ColorLayer_12"),    wxT("ColorLayer_13"),    wxT("ColorLayer_14"),    wxT("ColorLayer_15"),

        wxT("ColorLayer_16"),    wxT("ColorLayer_17"),    wxT("ColorLayer_18"),    wxT("ColorLayer_19"),
        wxT("ColorLayer_20"),    wxT("ColorLayer_21"),    wxT("ColorLayer_22"),    wxT("ColorLayer_23"),
        wxT("ColorLayer_24"),    wxT("ColorLayer_25"),    wxT("ColorLayer_26"),    wxT("ColorLayer_27"),
        wxT("ColorLayer_28"),    wxT("ColorLayer_29"),    wxT("ColorLayer_30"),    wxT("ColorLayer_31"),
    };

    wxASSERT( DIM(keys) == DIM(color_default) );
+1 −1
Original line number Diff line number Diff line
@@ -50,7 +50,7 @@


// Config keywords
static const wxString   cfgShowPageSizeOption( wxT( "ShowPageSizeOpt" ) );
static const wxString   cfgShowPageSizeOption( wxT( "PageSizeOpt" ) );
static const wxString   cfgShowDCodes( wxT( "ShowDCodesOpt" ) );
static const wxString   cfgShowNegativeObjects( wxT( "ShowNegativeObjectsOpt" ) );
static const wxString   cfgShowBorderAndTitleBlock( wxT( "ShowBorderAndTitleBlock" ) );
+11 −3
Original line number Diff line number Diff line
@@ -153,7 +153,8 @@ bool GERBER_IMAGE::ExecuteRS274XCommand( int command,
                                   char*&    text )
{
    int      code;
    int      xy_seq_len, xy_seq_char;
    int      xy_seq_len;        // not used, provided but not yet in use
    int      xy_seq_char;
    bool     ok = true;
    char     line[GERBER_BUFZ];
    wxString msg;
@@ -215,13 +216,14 @@ bool GERBER_IMAGE::ExecuteRS274XCommand( int command,
                break;

            case 'X':
            case 'Y':       // Values transmitted :2 (really xy_seq_len : FIX
                            // ME) digits
            case 'Y':       // Values transmitted :2 (really xy_seq_len :
                            // digits
            {
                code = *(text++);
                char ctmp = *(text++) - '0';
                if( code == 'X' )
                {
                    xy_seq_len--;
                    // number of digits after the decimal point (0 to 6 allowed)
                    m_FmtScale.x = *text - '0';
                    m_FmtLen.x   = ctmp + m_FmtScale.x;
@@ -234,6 +236,7 @@ bool GERBER_IMAGE::ExecuteRS274XCommand( int command,
                }
                else
                {
                    xy_seq_len--;
                    m_FmtScale.y = *text - '0';
                    m_FmtLen.y   = ctmp + m_FmtScale.y;
                    if( m_FmtScale.y < 0 )
@@ -255,6 +258,11 @@ bool GERBER_IMAGE::ExecuteRS274XCommand( int command,
            }
        }

        if( xy_seq_len != 0 )
        {
            ReportMessage( wxT( "RS274X: suspicious Format Statement (FS) command" ) );
        }

        break;

    case AXIS_SELECT:       // command ASAXBY*% or %ASAYBX*%