public C_State() { prog = e_stateProg.started; mot = e_stateMotor.initializing; Spi = e_stateSPI.disconnected; //cam = e_stateWebCam.initializing; baslerCam = e_stateBaslerCam.initializing; }
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; } } }
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; } }
public static bool FURTHER(e_stateProg _comparedState) { return(FURTHER((object)_comparedState, (object)prog)); }