/// <summary> /// 从文件中读取RFID data /// </summary> /// <param name="filename"></param> /// <returns>RFID 类</returns> public static RFIDData readRFIDData(string filename) { filename = ItemString.baseFolder + filename; System.Diagnostics.Debug.WriteLine("readRFIDData:" + filename); StreamReader sr = new StreamReader(filename); string line = null; RFIDData rFIDData = new RFIDData(); while ((line = sr.ReadLine()) != null) { string[] temp = line.Split(); // System.Diagnostics.Debug.WriteLine(temp[0]+" "+temp[1]+" "+temp[2]); if (temp.Length < 3) { continue; } // System.Diagnostics.Debug.WriteLine("test: " + Convert.ToDouble(temp[1])); rFIDData.addRSSPhaseTime(Convert.ToDouble(temp[0]), Convert.ToDouble(temp[1]), Convert.ToInt64(temp[2])); } System.Diagnostics.Debug.WriteLine("readRFIDData:从文件读取完成--大小分别为:" + rFIDData.getTimestamps().Count); sr.Close(); return(rFIDData); }
/// <summary> /// 存储RFID 数据值,安装 RSS,Phase,timestamp 顺序存储到文件中 /// </summary> /// <param name="rFID"></param> /// <param name="description"></param> public static void writeRFIDData(RFIDData rFID, string description) { writeThreeVector(rFID.getpeakRssiInDbm(), rFID.getUnwarpPhase(), rFID.getTimestamps(), description + rFID.getID()); }