int main(int argc, char *argv[]) { opt_proc(argc,argv); if (extraction_order==0) solve0(); else if (extraction_order==1) solve1(); else { fprintf(stderr,"extraction_order must be 0 or 1, abort\n"); exit(-1); } return 0; }
void Gcode::solve(){ int readPos =1;//reading postion String StrCodeNum=""; for(readPos=1;code[readPos]!=' '&&readPos<code.length();readPos++) { StrCodeNum= StrCodeNum+code[readPos]; } int codeNum=atoi(StrCodeNum.c_str()); switch (codeNum){ //The codes are executed differently according to the number after 'G'('g'). case 0 : if (readPos>=code.length() ) {break;} //Illegal,quit solving solve0(readPos); break; case 28: solve28(readPos); break; default: break; } }