707{
708
709 int res,attempt=0;
710 int cornpos;
711 if((isrc<0) || (isrc>3)) {printf("Wring Source Position assignement!\n");return 0;}
712 if((idest<0) || (idest>3)) {printf("Wring Scanned Position assignement!\n");return 0;}
713 if(isrc==idest) {printf("Same Source and Scanned Position assignement!\n");return 0;}
714
715 printf(
"\n%d > %d",isrc,idest); fflush(
stdout);
716 if(isrc==0) {
719 if(res<0) {printf("Hpos is not reached in 5 seconds!\n");return 0;}
721 if(res<0) {printf("Vpos is not reached in 5 seconds!\n");return 0;}
724 if(res<0) {printf("ArmVacuum is not reached in 2 seconds!\n");}
726 }
728 attempt=0;
730 attempt++;
733 if(res<0) {printf("Vpos is not reached in 5 seconds!\n");return 0;}
734
736 if(res>=0) break;
737 }
738
740
741 cornpos=4;
743 if(res<0) {printf("Hpos is not reached in 5 seconds!\n");return 0;}
745 if(res<0) {printf("Vpos is not reached in 5 seconds!\n");return 0;}
748 if(res<0) {printf("Vpos is not reached in 5 seconds!\n");return 0;}
749
751 if(res<0) {printf("Vpos is not reached in 5 seconds!\n");return 0;}
754 if(res<0) {printf("Vpos is not reached in 5 seconds!\n");return 0;}
755 if(kbhit()){getch();printf("Paused. Continue? (y/n)"); if(getchar()=='n') return 0; else printf(" Continue.\n");}
756
757 cornpos=5;
759 if(res<0) {printf("Hpos is not reached in 5 seconds!\n");return 0;}
761 if(res<0) {printf("Vpos is not reached in 5 seconds!\n");return 0;}
764 if(res<0) {printf("Vpos is not reached in 5 seconds!\n");return 0;}
765
767 if(res<0) {printf("Vpos is not reached in 5 seconds!\n");return 0;}
770 if(res<0) {printf("Vpos is not reached in 5 seconds!\n");return 0;}
771 if(kbhit()){getch();printf("Paused. Continue? (y/n)"); if(getchar()=='n') return 0; else printf(" Continue.\n");}
772
773
774
776 if(res<0) {printf("Hpos is not reached in 5 seconds!\n");return 0;}
777
779 if(res<0) {printf("Vpos is not reached in 5 seconds!\n");return 0;}
781 }
782
786 printf("Robot can't take plate from the stage!\n");
787 return 0;}
788 }
789 else {
791 if(res<0) {printf("Hpos is not reached in 5 seconds!\n");return 0;}
793 if(res<0) {printf("Vpos is not reached in 5 seconds!\n");return 0;}
796 if(res<0 && isrc==0) {printf("ArmVacuum is not reached in 2 seconds!\n");}
800 if(res<0) {printf("Vpos is not reached in 5 seconds!\n");return 0;}
802 if(res<0) {printf("Vpos is not reached in 5 seconds!\n");return 0;}
803 }
804 }
805 printf(
"\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b%d > %d",isrc,idest); fflush(
stdout);
806
808 if(res<0) {printf("Vpos is not reached in 5 seconds!\n");return 0;}
810 if(res<0) {printf("Hpos is not reached in 5 seconds!\n");return 0;}
812 if(res<0) {printf("Vpos is not reached in 5 seconds!\n");return 0;}
813 printf(
"\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b%d > %d",isrc,idest); fflush(
stdout);
815 if(idest==0) {
817 if(res<0)
818 {
819 printf("TableVacuum is not reached in 5 seconds!\n");
821 if(res<0) printf("Vpos is not reached in 5 seconds!\n");
822 return 0;
823
824 }
825
826 }
828 if(res<0) {printf("Vpos is not reached in 5 seconds!\n");return 0;}
829 printf(
"\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b"); fflush(
stdout);
830
831 return 1;
832
833}
#define VPOS_ABOVE_STAGE
Definition: AcqPlateChanger.h:28
#define VPOS_DOWN_TO_STAGE
Definition: AcqPlateChanger.h:27
#define VPOS_DOWN
Definition: AcqPlateChanger.h:26
int ArmVacuumControl(bool VacOn, int timeout)
Definition: AcqPlateChanger.cxx:219