/// <summary> /// Performs an instant stop of the actuator <br/> ///Not recommended because of potential hardware stress. Consider using Controller.MainController.ActuatorSoftStop() instead <br/> ///Higher level wrapper method, called from the user interface. Calls Controller.ActuatorController.HardStop() /// </summary> /// <param name="deviceID">identifies actuator, of type int</param> public void ActuatorHardStop(int deviceID) { if (ActuatorInContext.GetStatus(ActuatorInContext.DeviceID).CurSpeed != 0 || ActuatorInContext.GetStatus(ActuatorInContext.DeviceID).uCurSpeed != 0) { if (ActuatorInContext.HardStop(deviceID) == Result.ok) { //Task asyncTask = Task.Run(() => //{ // if (ActuatorInContext.WaitForStopWhile(deviceID, 0) == Result.ok) // logController.LogActuatorInfo(Enums.ActuatorLog.HardStop, ActuatorInContext, Enums.ActuatorLogTiming.Finish); //}); } } }
/// <summary> /// Deprecated. Thread was tasked with executing work used for checking for newly connected actuators. /// by calling Controller.ActuatorErrorHandler.CheckForActuatorErrors() /// </summary> /// <param name="obj"></param> /// <param name="e"></param> // TO DELETE void bgWorkerErrorPollingProgressChanged(object obj, ProgressChangedEventArgs e) { if (ActuatorInContext.DeviceID != -1) { actuatorErrorHandler.CheckForActuatorErrors(ActuatorInContext.GetStatus(ActuatorInContext.DeviceID)); } // If device is -1, meaning that actuator got disconncted else { // Try to get another actuator in context, the first one found in the list if (Actuators.Count > 0) { ChangeContext(Actuators.List[0].DeviceID); } // Await actuator connection else { } } }