/// <summary> Stores the last sensor range of a glove. </summary> /// <param name="currentRange"></param> /// <param name="forGlove"></param> /// <returns></returns> public static bool SaveLastRange(SGCore.Calibration.SensorRange currentRange, SGCore.HapticGlove forGlove) { if (forGlove != null) { string name = forGlove.GetDeviceID() + ".txt"; return(SG.Util.FileIO.SaveTxtFile(ProfileDirectory + rangeDir, name, new string[] { currentRange.Serialize() })); } return(false); }
/// <summary> Loads the last sensor range of a glove. </summary> /// <param name="forGlove"></param> /// <param name="lastRange"></param> /// <returns></returns> public static bool LoadLastRange(SGCore.HapticGlove forGlove, out SGCore.Calibration.SensorRange lastRange) { if (forGlove != null) { string name = forGlove.GetDeviceID() + ".txt"; string[] lines; if (SG.Util.FileIO.ReadTxtFile(ProfileDirectory + rangeDir + name, out lines) && lines.Length > 0 && lines[0].Length > 0) { lastRange = SGCore.Calibration.SensorRange.Deserialize(lines[0]); return(true); } } lastRange = new SGCore.Calibration.SensorRange(); return(false); }