Пример #1
0
 protected override void EstablishContext()
 {
     base.EstablishContext();
     DigitalTag         = new DigitalTag(new DispatcherService(), 1, "name", () => "");
     ReturnedDigitalTag = IoDevice.AddDigTag(DigitalTag);
     NumericTag         = new NumericTag(new DispatcherService(), 1, "name", () => "", () => "", () => "", 0, 0);
     ReturnedNumericTag = IoDevice.AddNumTag(NumericTag);
 }
Пример #2
0
 protected override void EstablishContext()
 {
     base.EstablishContext();
     DigitalTag = new DigitalTag(new DispatcherService(), 1, "name", () => "");
     ReturnedDigitalTag = IoDevice.AddDigTag(DigitalTag);
     NumericTag = new NumericTag(new DispatcherService(), 1, "name", () => "", () => "", () => "", 0, 0);
     ReturnedNumericTag = IoDevice.AddNumTag(NumericTag);
 }
Пример #3
0
        private static void addTag()
        {
            Console.WriteLine("Analogni ili digitalni (a/d)");
            string input = Console.ReadLine();
            Tag    tag   = null;

            if (input == "a")
            {
                tag = new AnalogTag
                {
                    id        = "2",
                    address   = "cos",
                    lowLimit  = 0,
                    highLimit = 100,
                    on        = true,
                    scanTime  = 3000,
                    Value     = 0
                };
            }
            else
            {
                tag = new DigitalTag
                {
                    id       = "3",
                    address  = "cos",
                    on       = true,
                    scanTime = 3000,
                    Value    = 0
                };
            }

            if (proxy.addTag(tag))
            {
                Console.WriteLine($"Tag sa id {tag.id} uspesno dodat");
            }
            else
            {
                Console.WriteLine($"Vec postoji tag sa id {tag.id} ");
            }
        }
Пример #4
0
 protected override IDigitalTag AddDigitalTag(int id, string name, Func<string> descriptionGetter)
 {
     var digitalTag = new DigitalTag(_dispatcherService, id, name, descriptionGetter);
     Add(digitalTag);
     return digitalTag;
 }
Пример #5
0
 public void ForUnreadDigitalTag()
 {
     DigitalTag.Verify(t => t.UpdateValue(null), Times.Once());
 }