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); }
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} "); } }
protected override IDigitalTag AddDigitalTag(int id, string name, Func<string> descriptionGetter) { var digitalTag = new DigitalTag(_dispatcherService, id, name, descriptionGetter); Add(digitalTag); return digitalTag; }
public void ForUnreadDigitalTag() { DigitalTag.Verify(t => t.UpdateValue(null), Times.Once()); }