Beispiel #1
0
        public void DaMonitor()
        {
            var executed = 0;
            var tag      = TestRegister;

            _client.Monitor <double>(tag, (val1, u) =>
            {
                executed++;
                u();
            });
            _client.Monitor <double>(tag, (val1, u) =>
            {
                executed++;
                u();
            });
            _client.Monitor <double>(tag, (val1, u) =>
            {
                executed++;
                u();
            });
            const int interval = 100;

            Thread.Sleep(interval);
            _client.Write(tag, 10);
            Thread.Sleep(interval);
            _client.Write(tag, 11);
            Thread.Sleep(interval);
            _client.Write(tag, 12);
            Thread.Sleep(interval);
            _client.Write(tag, 13);
            Thread.Sleep(interval);
            Assert.AreEqual(3, executed);
        }
Beispiel #2
0
 public void Init()
 {
     _client = new DaClient(new Uri(ClientUrl));
     _client.Connect();
     // have to assign to graybox simulation items once to activate them
     _client.Write <double>(TestRegister, 4);
 }