public override ReturnCode IngestFile(ChannelCompartment compartment, string fileName) { DateTime time = DateTime.MinValue; DataFile dataFile = new DataFile(fileName); dataFile.DataStart = GetFileDate(fileName); ReturnCode returnCode = csvParser.ParseFile(fileName); int numRecords = csvParser.GetNumRecords(); if (HasEndTimes) { for (int r = 0; r < numRecords; ++r) { time = csvParser.EndTimes[r]; for (int c = 0; c < numChannels; c++) { channels[c].AddDataPoint(compartment, csvParser.TimeStamps[r], csvParser.Data[r, c], time - csvParser.TimeStamps[r], dataFile); } } } else { for (int r = 0; r < numRecords; ++r) { time = csvParser.TimeStamps[r]; for (int c = 0; c < numChannels; c++) { channels[c].AddDataPoint(compartment, time, csvParser.Data[r, c], dataFile); } } } dataFile.DataEnd = time; MakeNewParser(); return(ReturnCode.SUCCESS); }
public override ReturnCode IngestFile(ChannelCompartment compartment, string fileName) { ReturnCode returnCode = isrParser.ParseFile(fileName); DataFile dataFile = new DataFile(fileName, isrParser.GetDate()); int numRecords = isrParser.GetNumRecords(); DateTime time = DateTime.MinValue; for (int r = 0; r < numRecords; ++r) { time = isrParser.ISRTimeToDateTime(isrParser.GetRecord(r).time); channels[TOTALS1].AddDataPoint(compartment, time, isrParser.GetRecord(r).totals1, dataFile); channels[TOTALS2].AddDataPoint(compartment, time, isrParser.GetRecord(r).totals2, dataFile); channels[TOTALS3].AddDataPoint(compartment, time, isrParser.GetRecord(r).totals3, dataFile); channels[REALS_PLUS_ACC].AddDataPoint(compartment, time, isrParser.GetRecord(r).realsPlusAccidentals, dataFile); channels[ACC].AddDataPoint(compartment, time, isrParser.GetRecord(r).accidentals, dataFile); } dataFile.DataEnd = time; isrParser = new ISRParser(); return(ReturnCode.SUCCESS); }
public override ReturnCode IngestFile(ChannelCompartment compartment, string fileName) { ReturnCode returnCode = vbfParser.ParseFile(fileName); DataFile dataFile = new DataFile(fileName, vbfParser.GetDate()); DateTime time = DateTime.MinValue; int numRecords = vbfParser.GetNumRecords(); for (int r = 0; r < numRecords; ++r) { time = vbfParser.VBFTimeToDateTime(vbfParser.GetRecord(r).time); channels[data0].AddDataPoint(compartment, time, vbfParser.GetRecord(r).data[0], dataFile); channels[data1].AddDataPoint(compartment, time, vbfParser.GetRecord(r).data[1], dataFile); channels[data2].AddDataPoint(compartment, time, vbfParser.GetRecord(r).data[2], dataFile); channels[data3].AddDataPoint(compartment, time, vbfParser.GetRecord(r).data[3], dataFile); channels[data4].AddDataPoint(compartment, time, vbfParser.GetRecord(r).data[4], dataFile); channels[data5].AddDataPoint(compartment, time, vbfParser.GetRecord(r).data[5], dataFile); channels[data6].AddDataPoint(compartment, time, vbfParser.GetRecord(r).data[6], dataFile); channels[data7].AddDataPoint(compartment, time, vbfParser.GetRecord(r).data[7], dataFile); } dataFile.DataEnd = time; vbfParser = new VBFParser(); return(ReturnCode.SUCCESS); }
public void AddDataPoint(ChannelCompartment compartment, DateTime time, Spectrum spectrum, TimeSpan duration, DataFile file) { timeStamps[(int)compartment].Add(time); values[(int)compartment].Add(roi.GetROICountRate(spectrum)); durations[(int)compartment].Add(duration); files[(int)compartment].Add(file); }
public void AddDataPoint(ChannelCompartment compartment, DateTime time, double value, TimeSpan duration, DataFile file) { timeStamps[(int)compartment].Add(time); values[(int)compartment].Add(value); durations[(int)compartment].Add(duration); files[(int)compartment].Add(file); }