Hello friends! I've been playing around with gerbv and trying to modify it to read .kicad_pcb files as input. However, I'm having trouble finding the places in the source code where
~gerbv reads a gerber file: I think this has something to do with project.c/read_project_file() which has the following line: [965] initfile = gerb_find_file("init.scm", initdirs); But I haven't found anything as explicit as the code below (in red) which reads the input file character by character and has a switch statement and everything ~gerbv draws something on screen: I think this has something to do with the library GDK from the GNOME/GTK project, and also something to do with callbacks.c which contains [224] gtk_widget_show (screen <http://gerbv.geda-project.org/doxygen/callbacks_8c.html#a1ec55bca5ad7868d265ee62fe10a29bc> .win.gerber); Any comments would be much appreciated. Thanks! Colin Tang while( text && *text ) { switch( *text ) { case ' ': case '\r': case '\n': text++; break; case '*': // End command m_CommandState = END_BLOCK; text++; break; case 'M': // End file m_CommandState = CMD_IDLE; while( *text ) text++; break; case 'G': /* Line type Gxx : command */ G_command = GCodeNumber( text ); Execute_G_Command( text, G_command ); break; case 'D': /* Line type Dxx : Tool selection (xx > 0) or * command if xx = 0..9 */ D_commande = DCodeNumber( text ); Execute_DCODE_Command( text, D_commande ); break; case 'X': case 'Y': /* Move or draw command */ m_CurrentPos = ReadXYCoord( text ); if( *text == '*' ) // command like X12550Y19250* { Execute_DCODE_Command( text, m_Last_Pen_Command ); } break; case 'I': case 'J': /* Auxiliary Move command */ m_IJPos = ReadIJCoord( text ); if( *text == '*' ) // command like X35142Y15945J504* { Execute_DCODE_Command( text, m_Last_Pen_Command ); } break; case '%': if( m_CommandState != ENTER_RS274X_CMD ) { m_CommandState = ENTER_RS274X_CMD; ReadRS274XCommand( lineBuffer, GERBER_BUFZ, text ); } else //Error { AddMessageToList( "Expected RS274X Command" ); m_CommandState = CMD_IDLE; text++; } break; default: msg.Printf( "Unexpected char 0x%2.2X <%c<", *text, *text ); AddMessageToList( msg ); text++; break; }
_______________________________________________ Gerbv-devel mailing list Gerbv-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gerbv-devel