Esempio n. 1
0
        public ISRInstrument(DetectionSystem parent, string name, uint id) : base(parent, name, id)
        {
            InstrumentType = "ISR";
            FileExtension  = FILE_EXTENSION;
            filePrefix     = "";
            isrParser      = new ISRParser();

            numChannels              = NUM_CHANNELS;
            channels                 = new Channel[numChannels];
            channels[TOTALS1]        = new Channel(Name + "-Totals-1", this, Channel.ChannelType.COUNT_RATE, 0);
            channels[TOTALS2]        = new Channel(Name + "-Totals-2", this, Channel.ChannelType.COUNT_RATE, 0);
            channels[TOTALS3]        = new Channel(Name + "-Totals-3", this, Channel.ChannelType.COUNT_RATE, 0);
            channels[REALS_PLUS_ACC] = new Channel(Name + "-Real+Acc", this, Channel.ChannelType.COUNT_RATE, 0);
            channels[ACC]            = new Channel(Name + "-Acc", this, Channel.ChannelType.COUNT_RATE, 0);
        }
Esempio n. 2
0
        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);
        }