public static extern void PNCalibrateAvatar(int avatarIndex, CalibrationTypes type);
public static extern void PNCalibrateAllAvatars(CalibrationTypes type);
public static extern bool PNCanCalibratePose(int avatarIndex, CalibrationTypes type);
/// <summary> /// Depending on application and device type, this method calibrates the device for a pressure mapping. /// </summary> /// <returns>True if successful, false otherwise.</returns> public abstract Exception PrepareSimulatorForPressureMapping(CalibrationTypes type, IProgress <GenericSimulationProgress> progress = null);
/// <summary> /// Pumps all valves to either "10mB - 3 seconds" or "10mb" at once. This procedure roughly matches the original procedure of "pump to 30mB then evacuate for 5 seconds". /// </summary> public override Exception PrepareSimulatorForPressureMapping(CalibrationTypes type, IProgress <GenericSimulationProgress> progress = null) { if (bSimulatorIsInUse) { return new SimulatorExceptions.DeviceBusyException() { DeviceId = this.DeviceId } } ; StatusDisplay.SetProgressBarValue(0); StatusDisplay.SetTextToStatus(SimulatorInterfaces.SimulatorStati.Inflate); Application.DoEvents(); myPressureLevels = myPressureLevels.Select(v => v = 0).ToArray(); //invalidate the pressure levels Exception ex = null; this.bIsCurrentlyPreparingForAPressureMapping = true; if (type == CalibrationTypes.Liegesimulator) { //pump all valves to 10mB ex = PumpValve(255, 10, progress); StatusDisplay.SetTextToStatus(SimulatorInterfaces.SimulatorStati.Evacuate); if (!isDebugMode && ex == null) { ex = EvacuateValveByTime(255, 18000, 0, progress); //we dont need to evacuate for 12*3 seconds here, as evacuating all tubes at once is a lot faster } } else if (type == CalibrationTypes.ErgonometerNL || type == CalibrationTypes.Liegesimulator2_0) { Stopwatch sw = new Stopwatch(); sw.Start(); //pump all valves to 10mB int baseValue = Liegesimulator2_0ProfileElements.EVACUATE_PRESSURE_BASE_VALUE; //the base value for evacuation is also the calibration value (10mb) ex = PumpValve(255, baseValue, progress); sw.Stop(); if (ex == null && sw.Elapsed.TotalSeconds < 6) //start another cycle to make sure the target pressure is actually applied { Logger.AddLogEntry(Logger.LogEntryCategories.Debug, "PrepareSimulatorForPressureMapping() took less than 6 seconds. Starting another cycle...", null, "CSerialSimulator"); ex = PumpValve(255, 10, progress); } } iCountMeasurements = 0; bSimulatorIsInUse = this.bIsCurrentlyPreparingForAPressureMapping = false; if (ex != null) { StatusDisplay.SetTextToStatus(SimulatorInterfaces.SimulatorStati.NotReady); StatusDisplay.SetProgressBarValue(0); this.IsPreparedForPressureMapping = false; return(ex); } else { StatusDisplay.SetTextToStatus(SimulatorInterfaces.SimulatorStati.PreparedForMapping); StatusDisplay.SetProgressBarValue(100); this.IsPreparedForPressureMapping = true; this.OnPreparedForPressureMappingOccured(this); } return(null); }
public override Exception PrepareSimulatorForPressureMapping(CalibrationTypes type, IProgress <GenericSimulationProgress> progress = null) { throw new NotImplementedException(); }