示例#1
0
 /// <summary>
 /// Calls the EndUpdate method of the specified archive.
 /// </summary>
 public void EndUpdate(HistoricalArchiveLogic archiveLogic, int deviceNum, DateTime timestamp)
 {
     try
     {
         archiveLogic.Lock();
         archiveLogic.EndUpdate(deviceNum, timestamp);
         archiveLogic.LastWriteTime = DateTime.UtcNow;
     }
     catch (Exception ex)
     {
         log.WriteException(ex, ServerPhrases.ErrorInArchive, nameof(EndUpdate), archiveLogic.Code);
     }
     finally
     {
         Unlock(archiveLogic);
     }
 }
示例#2
0
        private readonly HistoricalArchiveLogic archiveLogic; // the historical archive logic


        /// <summary>
        /// Initializes a new instance of the class.
        /// </summary>
        public ArchiveCalcContext(HistoricalArchiveLogic archiveLogic, DateTime timestamp)
        {
            this.archiveLogic = archiveLogic ?? throw new ArgumentNullException(nameof(archiveLogic));
            Timestamp         = timestamp;
        }