Пример #1
0
        /// <summary>
        /// Preserve first generated INCC or LM file name on the measurement id
        /// todo: save the other file names
        /// </summary>
        public void PersistFileNames()
        {
            string filename = ResultsFileName; // start with the LM csv default name, in case this is an LM measurement only

            // But always use the first INCC5 filename for legacy consistency
            if (INCCResultsFileNames != null && INCCResultsFileNames.Count > 0) // need a defined filename and fully initialized Measurement here
            {
                filename = INCCResultsFileNames[0];
            }

            if (!String.IsNullOrEmpty(filename))  // only do the write if it's non-null
            {
                DB.Measurements ms   = new DB.Measurements();
                string          type = MeasOption.ToString();
                long            id;
                int             dupNum = 0;
                id = ms.Lookup(AcquireState.detector_id, MeasDate, MeasOption.PrintName());

                logger.TraceEvent(LogLevels.Verbose, 34001, String.Format("Patching in the first file name...{0} " + filename, dupNum == 1 ? "Original measurement" : "Reanalysis #" + dupNum));
                ms.UpdateFileName(filename, id);
            }
        }