Exemple #1
0
 public C_State()
 {
     prog = e_stateProg.started;
     mot  = e_stateMotor.initializing;
     Spi  = e_stateSPI.disconnected;
     //cam = e_stateWebCam.initializing;
     baslerCam = e_stateBaslerCam.initializing;
 }
Exemple #2
0
        public static void CLOSE_program()
        {
            prog = e_stateProg.closing;

            // Kill serial port
            Thread dexter = new Thread(new ThreadStart(C_SPI.CLOSE_connectionAndAbortThread)); // the serial (port) killer
            int    q      = 10;                                                                // try to stop it X-times

            while (q > 0)
            {
                dexter.Start();
                System.Threading.Thread.Sleep(500);
                if (C_SPI.spi.IsOpen == false)
                {
                    break;
                }
            }
        }
Exemple #3
0
 public static void SET_state(object _state)
 {
     if (_state is e_stateBaslerCam)
     {
         baslerCam = (e_stateBaslerCam)_state;
     }
     else if (_state is e_stateMotor)
     {
         mot = (e_stateMotor)_state;
     }
     else if (_state is e_stateProg)
     {
         prog = (e_stateProg)_state;
     }
     else if (_state is e_stateSPI)
     {
         Spi = (e_stateSPI)_state;
     }
 }
Exemple #4
0
 public static bool FURTHER(e_stateProg _comparedState)
 {
     return(FURTHER((object)_comparedState, (object)prog));
 }