#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdlib.h>
#include <stdio.h>


float beta1,beta2,stepwith;
int steps,i;
FILE *dat;


main (){
  char bttvstr[60],findstr[80];
  
  beta1 = 3.60;
  beta2 = 36.0;
  steps = 40;  
  stepwith = 3.6;
  
 
  // ---- schicke atmelcom.c den auftrag del laser von beta1 bis beta2 zu fahren
  
//  if ((dat=fopen("tmp/imgdata/beta.line","w+"))==NULL) { perror("fopen"); exit(-1);}
//  fprintf(dat,"%d ",steps);			// write a file with laser angles 
//  for(i=1;i<=steps;i++){   fprintf(dat,"%f ",stepwith*((float)i)); }
//  fclose(dat);  
  
//  printf("grab....\n");
//  sprintf(bttvstr,"bttvgrab -o pgm -d q -f tmp/pic/ -Q -k 3 -l %d",steps);
//  system(bttvstr);
  
  printf("findlaser....\n");
  sprintf(findstr,"findlaser -q -S -n -m \"tmp/pic/p_0009.pgm tmp/pic/p_ dummy %d %d\"",0,steps-1); 
  system(findstr);
  
  printf("distance....\n");
  system("distance");

  printf("contrast....\n");
  system("contrast");
  
  
}