Gerbview: Minor fixes
This commit is contained in:
parent
46f106b6cd
commit
1ae31edb9a
|
@ -261,9 +261,14 @@ void GERBVIEW_FRAME::OnShowGerberSourceFile( wxCommandEvent& event )
|
||||||
ExecuteFile( this, editorname, QuoteFullPath( fn ) );
|
ExecuteFile( this, editorname, QuoteFullPath( fn ) );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
|
||||||
wxMessageBox( _( "No editor defined. Please select one" ) );
|
wxMessageBox( _( "No editor defined. Please select one" ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
else
|
||||||
|
{
|
||||||
|
wxString msg;
|
||||||
|
msg.Printf( _( "No file loaded on the active layer %d" ), layer + 1 );
|
||||||
|
wxMessageBox( msg );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -153,12 +153,14 @@ bool GERBER_IMAGE::ExecuteRS274XCommand( int command,
|
||||||
char*& text )
|
char*& text )
|
||||||
{
|
{
|
||||||
int code;
|
int code;
|
||||||
int xy_seq_len; // not used, provided but not yet in use
|
int seq_len; // not used, just provided
|
||||||
int xy_seq_char;
|
int seq_char;
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
char line[GERBER_BUFZ];
|
char line[GERBER_BUFZ];
|
||||||
wxString msg;
|
wxString msg;
|
||||||
double fcoord;
|
double fcoord;
|
||||||
|
bool x_fmt_known = false;
|
||||||
|
bool y_fmt_known = false;
|
||||||
|
|
||||||
// conv_scale = scaling factor from inch to Internal Unit
|
// conv_scale = scaling factor from inch to Internal Unit
|
||||||
double conv_scale = IU_PER_MILS * 1000;
|
double conv_scale = IU_PER_MILS * 1000;
|
||||||
|
@ -170,7 +172,7 @@ bool GERBER_IMAGE::ExecuteRS274XCommand( int command,
|
||||||
switch( command )
|
switch( command )
|
||||||
{
|
{
|
||||||
case FORMAT_STATEMENT:
|
case FORMAT_STATEMENT:
|
||||||
xy_seq_len = 2;
|
seq_len = 2;
|
||||||
|
|
||||||
while( *text != '*' )
|
while( *text != '*' )
|
||||||
{
|
{
|
||||||
|
@ -192,11 +194,6 @@ bool GERBER_IMAGE::ExecuteRS274XCommand( int command,
|
||||||
text++;
|
text++;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'D': // Decimal format: sometimes found, but not really documented
|
|
||||||
m_DecimalFormat = true;
|
|
||||||
text++;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'A': // Absolute coord
|
case 'A': // Absolute coord
|
||||||
m_Relative = false;
|
m_Relative = false;
|
||||||
text++;
|
text++;
|
||||||
|
@ -207,23 +204,36 @@ bool GERBER_IMAGE::ExecuteRS274XCommand( int command,
|
||||||
text++;
|
text++;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'N': // Sequence code (followed by the number of digits
|
case 'G':
|
||||||
// for the X,Y command
|
case 'N': // Sequence code (followed by one digit: the sequence len)
|
||||||
|
// (sometimes found before the X,Y sequence)
|
||||||
|
// Obscure option
|
||||||
text++;
|
text++;
|
||||||
xy_seq_char = *text++;
|
seq_char = *text++;
|
||||||
if( (xy_seq_char >= '0') && (xy_seq_char <= '9') )
|
if( (seq_char >= '0') && (seq_char <= '9') )
|
||||||
xy_seq_len = -'0';
|
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;
|
break;
|
||||||
|
|
||||||
case 'X':
|
case 'X':
|
||||||
case 'Y': // Values transmitted :2 (really xy_seq_len :
|
case 'Y':
|
||||||
// digits
|
|
||||||
{
|
{
|
||||||
code = *(text++);
|
code = *(text++);
|
||||||
char ctmp = *(text++) - '0';
|
char ctmp = *(text++) - '0';
|
||||||
if( code == 'X' )
|
if( code == 'X' )
|
||||||
{
|
{
|
||||||
xy_seq_len--;
|
x_fmt_known = true;
|
||||||
// number of digits after the decimal point (0 to 6 allowed)
|
// number of digits after the decimal point (0 to 6 allowed)
|
||||||
m_FmtScale.x = *text - '0';
|
m_FmtScale.x = *text - '0';
|
||||||
m_FmtLen.x = ctmp + m_FmtScale.x;
|
m_FmtLen.x = ctmp + m_FmtScale.x;
|
||||||
|
@ -236,7 +246,7 @@ bool GERBER_IMAGE::ExecuteRS274XCommand( int command,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
xy_seq_len--;
|
y_fmt_known = true;
|
||||||
m_FmtScale.y = *text - '0';
|
m_FmtScale.y = *text - '0';
|
||||||
m_FmtLen.y = ctmp + m_FmtScale.y;
|
m_FmtLen.y = ctmp + m_FmtScale.y;
|
||||||
if( m_FmtScale.y < 0 )
|
if( m_FmtScale.y < 0 )
|
||||||
|
@ -252,16 +262,16 @@ bool GERBER_IMAGE::ExecuteRS274XCommand( int command,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
msg.Printf( wxT( "Unknown id (%c) in FS command" ),
|
||||||
|
*text );
|
||||||
|
ReportMessage( msg );
|
||||||
GetEndOfBlock( buff, text, m_Current_File );
|
GetEndOfBlock( buff, text, m_Current_File );
|
||||||
ok = false;
|
ok = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if( !x_fmt_known || !y_fmt_known )
|
||||||
if( xy_seq_len != 0 )
|
ReportMessage( wxT( "RS274X: Format Statement (FS) without X or Y format" ) );
|
||||||
{
|
|
||||||
ReportMessage( wxT( "RS274X: suspicious Format Statement (FS) command" ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
; General Product Description Definitions
|
; General Product Description Definitions
|
||||||
!define PRODUCT_NAME "KiCad"
|
!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 PRODUCT_WEB_SITE "http://iut-tice.ujf-grenoble.fr/kicad/"
|
||||||
!define SOURCEFORGE_WEB_SITE "http://kicad.sourceforge.net/"
|
!define SOURCEFORGE_WEB_SITE "http://kicad.sourceforge.net/"
|
||||||
!define COMPANY_NAME ""
|
!define COMPANY_NAME ""
|
||||||
|
@ -36,7 +36,7 @@ SetCompressor /final /solid lzma
|
||||||
CRCCheck force
|
CRCCheck force
|
||||||
XPStyle on
|
XPStyle on
|
||||||
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
|
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"
|
InstallDir "$PROGRAMFILES\KiCad"
|
||||||
ShowInstDetails hide
|
ShowInstDetails hide
|
||||||
ShowUnInstDetails hide
|
ShowUnInstDetails hide
|
||||||
|
|
Loading…
Reference in New Issue