Protel到Allegro/CCT格式转换
FILE fp1, fp2;
AfxMessageBox(hello);
fp1=fopen(pick.txt, rt);
if (fp1==NULL) AfxMessageBox(Can not open the file!!!);
fp2=fopen(place.txt,wt);
if (fp2==NULL) AfxMessageBox(Can not create the file!!!);
char refdes[5], Pattern[5];
float midx,midy,refx,refy,padx,pady,rotation;
char tb[1];
char tmp=';
fprintf(fp2,%sn, # Allegro script);
fprintf(fp2,%sn, version 13.6);
fprintf(fp2,%sn, place refdes);
while (!feof(fp1)) ;
char yy=tb[0];
if (yy!=‘T‘) fprintf(fp2, pop mirrorn);
fprintf(fp2, pick %f %f n, padx,pady);
fprintf(fp2, next n);
};
fprintf(fp2, done);
fclose(fp1);
fclose(fp2);
评论