Beispiel #1
0
        public MachineStatusRepositoryWithCache(InfluxClient client, string databaseName, TimeSpan cacheWriteInterval, ILogger logger = null) : base(logger)
        {
            repository = new MachineStatusRepository(client, databaseName);

            cacheWriteTimer          = new NonReentrantTimer(cacheWriteInterval.TotalMilliseconds);
            cacheWriteTimer.Elapsed += CacheWriteTimer_Elapsed;
            cacheWriteTimer.Start();
        }
        public MachineRepository(string ipaddress, string username, string password, TimeSpan timeOut, string databaseName = "TRMI_RAL_System_Dev", int port = 8086) : base(ipaddress, username, password, databaseName, timeOut, port)
        {
            var uri = new Uri($"http://{ipaddress}:{port}");

            MachineStatusRepo      = new MachineStatusRepository(_client, databaseName);
            MachineIsConnectedRepo = new MachineIsConnectedRepo(_client, databaseName);

            //var _client2 = new InfluxClient(uri, "TRMI_Trends", "1234");
            //_client2.Timeout = TimeSpan.FromMilliseconds(3000);
            MachineIsRunningRepo = new MachineIsRunningRepository(_client, databaseName);
        }