Rev 292 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 292 | Rev 315 | ||
---|---|---|---|
Line 541... | Line 541... | ||
541 | if (MIKRO_Open (port)) MessagePopup ("Error", "Mikro Port Not found !\n Change in the GUI") ; |
541 | if (MIKRO_Open (port)) MessagePopup ("Error", "Mikro Port Not found !\n Change in the GUI") ; |
542 | MIKRO_Init(1,0); |
542 | MIKRO_Init(1,0); |
543 | MIKRO_Init(2,0); |
543 | MIKRO_Init(2,0); |
544 | #endif |
544 | #endif |
545 | #ifdef uSMC_USB |
545 | #ifdef uSMC_USB |
546 | uSMC_Open(); |
546 | if (uSMC_Open()) MessagePopup("SMC Error","SMC Open Failed"); |
547 | for (int i=0; i<3; i++) { |
547 | for (int i=0; i<3; i++) { |
548 | node[i]=uSMC_FindSerial(serials[i])+1; |
548 | node[i]=uSMC_FindSerial(serials[i])+1; |
549 | uSMC_Init(node[i],1); |
549 | uSMC_Init(node[i],1); |
550 | } |
550 | } |
551 | #endif /* uSMC_USB */ |
551 | #endif /* uSMC_USB */ |
Line 739... | Line 739... | ||
739 | case SCAN_BD : |
739 | case SCAN_BD : |
740 | axis = 2; |
740 | axis = 2; |
741 | direction = -1; |
741 | direction = -1; |
742 | GetCtrlVal(panel, SCAN_STEPY, &step); |
742 | GetCtrlVal(panel, SCAN_STEPY, &step); |
743 | break; |
743 | break; |
- | 744 | case SCAN_BF : |
|
- | 745 | axis = 3; |
|
- | 746 | direction = 1; |
|
- | 747 | GetCtrlVal(panel, SCAN_STEPZ, &step); |
|
- | 748 | break; |
|
- | 749 | case SCAN_BB : |
|
- | 750 | axis = 3; |
|
- | 751 | direction = -1; |
|
- | 752 | GetCtrlVal(panel, SCAN_STEPZ, &step); |
|
- | 753 | break; |
|
744 | } |
754 | } |
745 | #ifdef MIKRO |
755 | #ifdef MIKRO |
746 | { |
756 | { |
747 | int n=0; |
757 | int n=0; |
748 | MIKRO_MoveFor(axis, direction*step ); |
758 | MIKRO_MoveFor(axis, direction*step ); |
749 | MIKRO_GetPosition(axis,&n); |
759 | MIKRO_GetPosition(axis,&n); |
750 | if (axis == 1) SetCtrlVal (panel, SCAN_XP, n); |
760 | if (axis == 1) SetCtrlVal (panel, SCAN_XP, n); |
751 | if (axis == 2) SetCtrlVal (panel, SCAN_YP, n); |
761 | if (axis == 2) SetCtrlVal (panel, SCAN_YP, n); |
- | 762 | if (axis == 3) SetCtrlVal (panel, SCAN_ZP, n); |
|
752 | } |
763 | } |
753 | #endif // MIKRO |
764 | #endif // MIKRO |
754 | 765 | ||
755 | #ifdef uSMC_USB |
766 | #ifdef uSMC_USB |
756 | { |
767 | { |
757 | int n=0; |
768 | int n=0; |
758 | uSMC_MoveFor(node[axis-1], direction*step ); |
769 | uSMC_MoveFor(node[axis-1], direction*step ); |
759 | uSMC_GetPosition(node[axis-1],&n); |
770 | uSMC_GetPosition(node[axis-1],&n); |
760 | if (axis == 1) SetCtrlVal (panel, SCAN_XP, n); |
771 | if (axis == 1) SetCtrlVal (panel, SCAN_XP, n); |
761 | if (axis == 2) SetCtrlVal (panel, SCAN_YP, n); |
772 | if (axis == 2) SetCtrlVal (panel, SCAN_YP, n); |
- | 773 | if (axis == 3) SetCtrlVal (panel, SCAN_ZP, n); |
|
762 | } |
774 | } |
763 | #endif // MIKRO |
775 | #endif // MIKRO |
764 | } |
776 | } |
765 | 777 | ||
766 | break; |
778 | break; |
767 | } |
779 | } |
768 | return 0; |
780 | return 0; |
769 | } |
781 | } |
770 | 782 | ||
771 | 783 | ||
772 | 784 | ||
773 | 785 | ||
774 | 786 | ||
775 | int CVICALLBACK GoXCB (int panel, int control, int event, |
787 | int CVICALLBACK GoXCB (int panel, int control, int event, |
776 | void *callbackData, int eventData1, int eventData2) { |
788 | void *callbackData, int eventData1, int eventData2) { |
777 | int n2; |
789 | int n2; |
778 | switch (event) { |
790 | switch (event) { |
779 | case EVENT_COMMIT: |
791 | case EVENT_COMMIT: |
780 | GetCtrlVal (panel, SCAN_XG, &n2); |
792 | GetCtrlVal (panel, SCAN_XG, &n2); |
781 | #ifdef MIKRO |
793 | #ifdef MIKRO |
782 | MIKRO_MoveTo(1,n2); |
794 | MIKRO_MoveTo(1,n2); |
783 | MIKRO_GetPosition(1,&n2); |
795 | MIKRO_GetPosition(1,&n2); |
784 | #endif |
796 | #endif |
Line 796... | Line 808... | ||
796 | int CVICALLBACK GoYCB (int panel, int control, int event, |
808 | int CVICALLBACK GoYCB (int panel, int control, int event, |
797 | void *callbackData, int eventData1, int eventData2) { |
809 | void *callbackData, int eventData1, int eventData2) { |
798 | int n2; |
810 | int n2; |
799 | switch (event) { |
811 | switch (event) { |
800 | case EVENT_COMMIT: |
812 | case EVENT_COMMIT: |
801 | GetCtrlVal (panel, SCAN_YG, &n2); |
813 | GetCtrlVal (panel, SCAN_YG, &n2); |
- | 814 | #ifdef MIKRO |
|
- | 815 | MIKRO_MoveTo(2,n2); |
|
- | 816 | MIKRO_GetPosition(2,&n2); |
|
- | 817 | ||
- | 818 | #endif |
|
- | 819 | #ifdef uSMC_USB |
|
- | 820 | uSMC_MoveTo(node[1],n2); |
|
- | 821 | uSMC_GetPosition(node[1],&n2); |
|
- | 822 | #endif |
|
- | 823 | SetCtrlVal (panel, SCAN_YP, n2); |
|
- | 824 | break; |
|
- | 825 | } |
|
- | 826 | return 0; |
|
- | 827 | } |
|
- | 828 | ||
- | 829 | int CVICALLBACK GoZCB (int panel, int control, int event, |
|
- | 830 | void *callbackData, int eventData1, int eventData2) { |
|
- | 831 | int n2; |
|
- | 832 | switch (event) { |
|
- | 833 | case EVENT_COMMIT: |
|
- | 834 | GetCtrlVal (panel, SCAN_ZG, &n2); |
|
802 | #ifdef MIKRO |
835 | #ifdef MIKRO |
803 | MIKRO_MoveTo( |
836 | MIKRO_MoveTo(3,n2); |
804 | MIKRO_GetPosition( |
837 | MIKRO_GetPosition(3,&n2); |
805 | 838 | ||
806 | #endif |
839 | #endif |
807 | #ifdef uSMC_USB |
840 | #ifdef uSMC_USB |
808 | uSMC_MoveTo(node[ |
841 | uSMC_MoveTo(node[2],n2); |
809 | uSMC_GetPosition(node[ |
842 | uSMC_GetPosition(node[2],&n2); |
810 | #endif |
843 | #endif |
811 | SetCtrlVal (panel, |
844 | SetCtrlVal (panel, SCAN_ZP, n2); |
812 | break; |
845 | break; |
813 | } |
846 | } |
814 | return 0; |
847 | return 0; |
815 | } |
848 | } |
- | 849 | ||
816 | 850 | ||
817 | int CVICALLBACK GetCurrentPositionCB (int panel, int control, int event, |
851 | int CVICALLBACK GetCurrentPositionCB (int panel, int control, int event, |
818 | void *callbackData, int eventData1, int eventData2) { |
852 | void *callbackData, int eventData1, int eventData2) { |
819 | 853 | ||
820 | int n[ |
854 | int n[3]; |
821 | switch (event) { |
855 | switch (event) { |
822 | case EVENT_COMMIT: { |
856 | case EVENT_COMMIT: { |
823 | #ifdef MIKRO |
857 | #ifdef MIKRO |
824 | MIKRO_GetPosition(1,&n[0]); |
858 | MIKRO_GetPosition(1,&n[0]); |
825 | SetCtrlVal (panel, SCAN_XP, n[0]); |
859 | SetCtrlVal (panel, SCAN_XP, n[0]); |
826 | MIKRO_GetPosition(2,&n[1]); |
860 | MIKRO_GetPosition(2,&n[1]); |
827 | SetCtrlVal (panel, SCAN_YP, n[1]); |
861 | SetCtrlVal (panel, SCAN_YP, n[1]); |
- | 862 | MIKRO_GetPosition(3,&n[2]); |
|
- | 863 | SetCtrlVal (panel, SCAN_ZP, n[2]); |
|
828 | #endif |
864 | #endif |
829 | #ifdef uSMC_USB |
865 | #ifdef uSMC_USB |
830 | uSMC_GetPosition(node[0],&n[0]); |
866 | uSMC_GetPosition(node[0],&n[0]); |
831 | SetCtrlVal (panel, SCAN_XP, n[0]); |
867 | SetCtrlVal (panel, SCAN_XP, n[0]); |
832 | uSMC_GetPosition(node[1],&n[1]); |
868 | uSMC_GetPosition(node[1],&n[1]); |
833 | SetCtrlVal (panel, SCAN_YP, n[1]); |
869 | SetCtrlVal (panel, SCAN_YP, n[1]); |
- | 870 | uSMC_GetPosition(node[2],&n[2]); |
|
- | 871 | SetCtrlVal (panel, SCAN_ZP, n[2]); |
|
834 | #endif |
872 | #endif |
835 | break; |
873 | break; |
836 | } |
874 | } |
837 | } |
875 | } |
838 | return 0; |
876 | return 0; |