public NGAMInstrument(DetectionSystem parent, string name, uint id) : base(parent, name, id) { InstrumentType = "NGAM"; FileExtension = FILE_EXTENSION; filePrefix = ""; vbfParser = new VBFParser(); numChannels = NUM_CHANNELS; channels = new Channel[numChannels]; channels[data0] = new Channel(Name + "-data0", this, Channel.ChannelType.COUNT_RATE, 0); channels[data1] = new Channel(Name + "-data1", this, Channel.ChannelType.COUNT_RATE, 0); channels[data2] = new Channel(Name + "-data2", this, Channel.ChannelType.COUNT_RATE, 0); channels[data3] = new Channel(Name + "-data3", this, Channel.ChannelType.COUNT_RATE, 0); channels[data4] = new Channel(Name + "-data4", this, Channel.ChannelType.COUNT_RATE, 0); channels[data5] = new Channel(Name + "-data5", this, Channel.ChannelType.COUNT_RATE, 0); channels[data6] = new Channel(Name + "-data6", this, Channel.ChannelType.COUNT_RATE, 0); channels[data7] = new Channel(Name + "-data7", this, Channel.ChannelType.COUNT_RATE, 0); }
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); }