Esempio n. 1
0
 /// <summary>
 /// Initializes a new instance of the class.
 /// </summary>
 public FrmPostgreCAO(AppDirs appDirs, ArchiveConfig archiveConfig)
     : this()
 {
     this.appDirs       = appDirs ?? throw new ArgumentNullException(nameof(appDirs));
     this.archiveConfig = archiveConfig ?? throw new ArgumentNullException(nameof(archiveConfig));
     options            = new PostgreCAO(archiveConfig.CustomOptions);
 }
Esempio n. 2
0
        private int[] cnlIndexes;                   // the channel mapping indexes


        /// <summary>
        /// Initializes a new instance of the class.
        /// </summary>
        public PostgreCAL(IArchiveContext archiveContext, ArchiveConfig archiveConfig, int[] cnlNums,
                          ModuleConfig moduleConfig) : base(archiveContext, archiveConfig, cnlNums)
        {
            this.moduleConfig = moduleConfig ?? throw new ArgumentNullException(nameof(moduleConfig));
            archiveOptions    = new PostgreCAO(archiveConfig.CustomOptions);
            appLog            = archiveContext.Log;
            arcLog            = archiveOptions.LogEnabled ? CreateLog(ModuleUtils.ModuleCode) : null;
            stopwatch         = new Stopwatch();
            queryBuilder      = new QueryBuilder(Code);
            pointQueue        = new PointQueue(FixQueueSize(), queryBuilder.InsertCurrentDataQuery)
            {
                ArchiveCode = Code,
                AppLog      = appLog,
                ArcLog      = arcLog
            };

            hasError      = false;
            conn          = null;
            thread        = null;
            terminated    = false;
            nextWriteTime = DateTime.MinValue;
            cnlIndexes    = null;
        }