lifeemotions / knx.net

KNX.net provides a KNX API for .NET
MIT License
101 stars 47 forks source link

temp tag to text #65

Open Malexys opened 3 years ago

Malexys commented 3 years ago

How can I put the "temp" definition to a textbox or label, whatever I did did not work. Can you help?

static void Event(object sender, KnxEventArgs args) { if (args.DestinationAddress.Equals(new KnxThreeLevelGroupAddress(1, 1, 16))) { decimal temp = (decimal)connection.FromDataPoint("9.001", args.State); textbox1.text=temp.tostring(); return; }

if (args.DestinationAddress.ToString() == "1/1/17") { int perc = (int)connection.FromDataPoint("5.001", args.State); Console.WriteLine($"New Event: device {args.DestinationAddress} has status {perc}"); return; } }

Malexys commented 3 years ago

Çalışmadığım her ne olursa olsun, "geçici" tanımını bir metin kutusuna veya etikete nasıl koyabilirim? Yardım edebilir misin?

statik void Olay (nesne gönderen, KnxEventArgs bağımsız değişkenler) { if (args.DestinationAddress.Equals (yeni KnxThreeLevelGroupAddress (1, 1, 16))) { decimal temp = (decimal) connection.FromDataPoint ("9.001", args.State); textbox1.text = temp.tostring (); dönüş; }

if (args.DestinationAddress.ToString () == "1/1/17") { int perc = (int) connection.FromDataPoint ("5.001", args.State); Console.WriteLine ($ "Yeni Etkinlik: device {args.DestinationAddress} {perc}" durumuna sahip); dönüş; } }