Beispiel #1
0
 /// <summary>
 /// Initializes a new instance of the class.
 /// </summary>
 public FrmPostgreEAO(AppDirs appDirs, ArchiveConfig archiveConfig)
     : this()
 {
     this.appDirs       = appDirs ?? throw new ArgumentNullException(nameof(appDirs));
     this.archiveConfig = archiveConfig ?? throw new ArgumentNullException(nameof(archiveConfig));
     options            = new PostgreEAO(archiveConfig.CustomOptions);
 }
Beispiel #2
0
        private volatile bool terminated;           // necessary to stop the thread


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

            hasError   = false;
            conn       = null;
            thread     = null;
            terminated = false;
        }