Пример #1
0
        public static int CPUindex            = 0;                       //Which CPU we're on


        public static void ArmHandlerLibraryMainSequence()
        {   //Start at Origin, find next CPU, Take picture
            //Pick Up requested CPU, Move to Calibration Image
            //Find Socket, put CPU in socket, wait until done
            //Once done, tell tray if good or bad, wait for position
            //Place CPU in position, wait for next either next CPU or done signal

            double[] Loc = { 0.0, 0.0, 0.0, 0.0 };
            FetchInformation();
            TrayManagerLibrary trayHandler = new TrayManagerLibrary(); //should be background worker
            bool done = false;
            int  CPU;

            while (!done)
            { //Main Loop
                if (!Running)
                {
                    return;
                }
                ArduinoMotionLibrary.ArdPosition("MOVE", 0, OriginLocation[0], OriginLocation[1], OriginLocation[2], OriginLocation[3]);
                CPU    = trayHandler.GetCPUPosition();
                Loc[0] = (CPU % trayHandler.trayDimensions[0]) * centerToCenterL;
                if (CPU > trayHandler.trayDimensions[0])
                {
                    Loc[1] += centerToCenterW;
                }
                Loc[2] -= (trayHandler.emptyTrayCount + trayHandler.goodTrayCount + trayHandler.badTrayCount) * centerToCenterZ;
                ArduinoMotionLibrary.ArdPosition("MOVE", 0, Loc[0], Loc[1], Loc[2], Loc[3]); //Move to CPU
                //Verify we're above a CPU
                while (!CameraTestCPU())
                {
                    //Keep Navigating to next CPU and testing
                }
                ArduinoMotionLibrary.ArdPosition("SHIFT", 0, 0, 0, 0, 0); //Descend Z
                //Grab CPU
                ArduinoMotionLibrary.ArdPosition("SHIFT", 0, 0, 0, 0, 0); //Raise back up
                //Move to Socket, calibration image later
                ArduinoMotionLibrary.ArdPosition("MOVE", 0, SocketLocation[0], SocketLocation[1], SocketLocation[2], SocketLocation[3]);
                ArduinoMotionLibrary.ArdPosition("SHIFT", 0, 0, 0, 0, 0); //Descend into socket
                //Release CPU
                //Wait for test
                //Tell Tray to present good or bad

                ArduinoMotionLibrary.ArdPosition("MOVE", 0, 0, 0, 0, 0); //Demo done, return to origin
                done = true;
            }
            return;
        }
Пример #2
0
 private void moveButton_Click(object sender, EventArgs e)
 {
     ArduinoMotionLibrary.ArdPosition("MOVE", portID, XcoordinateValue, YcoordinateValue, ZcoordinateValue, RotationVal);
 }