From 1ae31edb9ae6cf8d12d8ef6f4a38dc4ac950675d Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Wed, 6 Mar 2013 20:32:59 +0100 Subject: [PATCH] Gerbview: Minor fixes --- gerbview/events_called_functions.cpp | 9 +++-- gerbview/rs274x.cpp | 54 ++++++++++++++++------------ packaging/windows/nsis/install.nsi | 4 +-- 3 files changed, 41 insertions(+), 26 deletions(-) diff --git a/gerbview/events_called_functions.cpp b/gerbview/events_called_functions.cpp index 0ec8da19fb..46b69c1385 100644 --- a/gerbview/events_called_functions.cpp +++ b/gerbview/events_called_functions.cpp @@ -261,9 +261,14 @@ void GERBVIEW_FRAME::OnShowGerberSourceFile( wxCommandEvent& event ) ExecuteFile( this, editorname, QuoteFullPath( fn ) ); } else - { wxMessageBox( _( "No editor defined. Please select one" ) ); - } + } + + else + { + wxString msg; + msg.Printf( _( "No file loaded on the active layer %d" ), layer + 1 ); + wxMessageBox( msg ); } } diff --git a/gerbview/rs274x.cpp b/gerbview/rs274x.cpp index 902394cd03..893698a0ed 100644 --- a/gerbview/rs274x.cpp +++ b/gerbview/rs274x.cpp @@ -153,12 +153,14 @@ bool GERBER_IMAGE::ExecuteRS274XCommand( int command, char*& text ) { int code; - int xy_seq_len; // not used, provided but not yet in use - int xy_seq_char; + int seq_len; // not used, just provided + int seq_char; bool ok = true; char line[GERBER_BUFZ]; wxString msg; double fcoord; + bool x_fmt_known = false; + bool y_fmt_known = false; // conv_scale = scaling factor from inch to Internal Unit double conv_scale = IU_PER_MILS * 1000; @@ -170,7 +172,7 @@ bool GERBER_IMAGE::ExecuteRS274XCommand( int command, switch( command ) { case FORMAT_STATEMENT: - xy_seq_len = 2; + seq_len = 2; while( *text != '*' ) { @@ -192,11 +194,6 @@ bool GERBER_IMAGE::ExecuteRS274XCommand( int command, text++; break; - case 'D': // Decimal format: sometimes found, but not really documented - m_DecimalFormat = true; - text++; - break; - case 'A': // Absolute coord m_Relative = false; text++; @@ -207,23 +204,36 @@ bool GERBER_IMAGE::ExecuteRS274XCommand( int command, text++; break; - case 'N': // Sequence code (followed by the number of digits - // for the X,Y command + case 'G': + case 'N': // Sequence code (followed by one digit: the sequence len) + // (sometimes found before the X,Y sequence) + // Obscure option text++; - xy_seq_char = *text++; - if( (xy_seq_char >= '0') && (xy_seq_char <= '9') ) - xy_seq_len = -'0'; + seq_char = *text++; + if( (seq_char >= '0') && (seq_char <= '9') ) + seq_len = seq_char - '0'; + break; + + case 'D': + case 'M': // Sequence code (followed by one digit: the sequence len) + // (sometimes found after the X,Y sequence) + // Obscure option + code = *text++; + if( ( *text >= '0' ) && ( *text<= '9' ) ) + text++; // skip the digit + else if( code == 'D' ) + // Decimal format: sometimes found, but not really documented + m_DecimalFormat = true; break; case 'X': - case 'Y': // Values transmitted :2 (really xy_seq_len : - // digits + case 'Y': { code = *(text++); char ctmp = *(text++) - '0'; if( code == 'X' ) { - xy_seq_len--; + x_fmt_known = true; // number of digits after the decimal point (0 to 6 allowed) m_FmtScale.x = *text - '0'; m_FmtLen.x = ctmp + m_FmtScale.x; @@ -236,7 +246,7 @@ bool GERBER_IMAGE::ExecuteRS274XCommand( int command, } else { - xy_seq_len--; + y_fmt_known = true; m_FmtScale.y = *text - '0'; m_FmtLen.y = ctmp + m_FmtScale.y; if( m_FmtScale.y < 0 ) @@ -252,16 +262,16 @@ bool GERBER_IMAGE::ExecuteRS274XCommand( int command, break; default: + msg.Printf( wxT( "Unknown id (%c) in FS command" ), + *text ); + ReportMessage( msg ); GetEndOfBlock( buff, text, m_Current_File ); ok = false; break; } } - - if( xy_seq_len != 0 ) - { - ReportMessage( wxT( "RS274X: suspicious Format Statement (FS) command" ) ); - } + if( !x_fmt_known || !y_fmt_known ) + ReportMessage( wxT( "RS274X: Format Statement (FS) without X or Y format" ) ); break; diff --git a/packaging/windows/nsis/install.nsi b/packaging/windows/nsis/install.nsi index 53bef3e6fd..0e95f0bf7b 100644 --- a/packaging/windows/nsis/install.nsi +++ b/packaging/windows/nsis/install.nsi @@ -17,7 +17,7 @@ ; General Product Description Definitions !define PRODUCT_NAME "KiCad" -!define PRODUCT_VERSION "2013.03.04" +!define PRODUCT_VERSION "2013.03.06" !define PRODUCT_WEB_SITE "http://iut-tice.ujf-grenoble.fr/kicad/" !define SOURCEFORGE_WEB_SITE "http://kicad.sourceforge.net/" !define COMPANY_NAME "" @@ -36,7 +36,7 @@ SetCompressor /final /solid lzma CRCCheck force XPStyle on Name "${PRODUCT_NAME} ${PRODUCT_VERSION}" -OutFile "${PRODUCT_NAME}_stable-${PRODUCT_VERSION}-BZR3982_Win_full_version.exe" +OutFile "${PRODUCT_NAME}_stable-${PRODUCT_VERSION}-BZR3986_Win_full_version.exe" InstallDir "$PROGRAMFILES\KiCad" ShowInstDetails hide ShowUnInstDetails hide