592{
593
594 if(
Debug) printf(
" --- MoveEmulsion(%d,%d)\n",isrc,idest);
595 int res,attempt=0;
596 int cornpos;
597 if((isrc<0) || (isrc>3)) {printf("Wring Source Position assignement!\n");return 0;}
598 if((idest<0) || (idest>3)) {printf("Wring Scanned Position assignement!\n");return 0;}
599 if(isrc==idest) {printf("Same Source and Scanned Position assignement!\n");return 0;}
600
601 printf(
"\n%d > %d",isrc,idest); fflush(
stdout);
602 if(isrc==0) {
605 if(res<0) {printf("Hpos is not reached in 5 seconds!\n");return 0;}
607 if(res<0) {printf("Vpos is not reached in 5 seconds!\n");return 0;}
610 if(res<0) {printf("ArmVacuum is not reached in 2 seconds!\n");}
612 }
614 attempt=0;
616 attempt++;
619 gSystem->Sleep(100);
621 if(res<0) {printf("Vpos is not reached in 5 seconds!\n");return 0;}
622
624 if(res>=0) break;
625 }
626
629
630 cornpos=4;
632 if(res<0) {printf("Hpos is not reached in 5 seconds!\n");return 0;}
634 if(res<0) {printf("Vpos is not reached in 5 seconds!\n");return 0;}
637 if(res<0) {printf("Vpos is not reached in 5 seconds!\n");return 0;}
638
640 if(res<0) {printf("Vpos is not reached in 5 seconds!\n");return 0;}
643 if(res<0) {printf("Vpos is not reached in 5 seconds!\n");return 0;}
644 if(kbhit()){getch();printf("Paused. Continue? (y/n)"); if(getchar()=='n') return 0; else printf(" Continue.\n");}
645
646 cornpos=5;
648 if(res<0) {printf("Hpos is not reached in 5 seconds!\n");return 0;}
650 if(res<0) {printf("Vpos is not reached in 5 seconds!\n");return 0;}
653 if(res<0) {printf("Vpos is not reached in 5 seconds!\n");return 0;}
654
656 if(res<0) {printf("Vpos is not reached in 5 seconds!\n");return 0;}
659 if(res<0) {printf("Vpos is not reached in 5 seconds!\n");return 0;}
660 if(kbhit()){getch();printf("Paused. Continue? (y/n)"); if(getchar()=='n') return 0; else printf(" Continue.\n");}
661
662
663
665 if(res<0) {printf("Hpos is not reached in 5 seconds!\n");return 0;}
666
668 if(res<0) {printf("Vpos is not reached in 5 seconds!\n");return 0;}
670 }
672
676 printf("Robot can't take plate from the stage!\n");
677 return 0;}
678 }
679 else {
681 if(res<0) {printf("Hpos is not reached in 5 seconds!\n");return 0;}
683 if(res<0) {printf("Vpos is not reached in 5 seconds!\n");return 0;}
686 if(res<0 && isrc==0) {printf("ArmVacuum is not reached in 2 seconds!\n");}
688 if(
Debug) printf(
"Arm vac seems ok... trying to separate emulsions..\n");
690 if(
Debug) printf(
"Attempt %d..going up..\n",att+1);
692 if(res<0) {printf("Vpos is not reached in 5 seconds!\n");return 0;}
693 if(
Debug) printf(
"..going down..\n",att+1);
695 if(res<0) {printf("Vpos is not reached in 5 seconds!\n");return 0;}
696 }
697 if(
Debug) printf(
"Separation loop is complete..\n");
698
699 }
700 printf(
"\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b%d > %d",isrc,idest); fflush(
stdout);
701
703 if(res<0) {printf("Vpos is not reached in 5 seconds!\n");return 0;}
704 if(
Debug) printf(
"Ready to go to bank idest=%d\n",idest);
706 if(res<0) {printf("Hpos is not reached in 5 seconds!\n");return 0;}
708 if(res<0) {printf("Vpos is not reached in 5 seconds!\n");return 0;}
709 printf(
"\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b%d > %d",isrc,idest); fflush(
stdout);
711 if(idest==0) {
713 if(res<0)
714 {
715 printf("TableVacuum is not reached in 5 seconds!\n");
717 if(res<0) printf("Vpos is not reached in 5 seconds!\n");
718 return 0;
719
720 }
721
722 }
724 if(res<0) {printf("Vpos is not reached in 5 seconds!\n");return 0;}
725 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);
726 if(
Debug) printf(
" --- MoveEmulsion is done, returns 1.\n");
727
728 return 1;
729
730}
#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: AcqSerialPlateChanger.cxx:209
int GoOnHAxis(int position, int timeout)
Definition: AcqSerialPlateChanger.cxx:278