public void Esp32CoordinateObtained(object sender, ProgressChangedEventArgs e) { if (e.ProgressPercentage == 3) { Console.WriteLine("Obtained data about devices position"); //Clear previously data if (Devices != null) { Devices.Clear(); } Devices = Server.List_Devices; foreach (Device d in Devices) { DevicesRenderer.Add(new DeviceLabel(d.X, d.Y, d.Mac, "SSID: " + d.Ssid)); } } else if (e.ProgressPercentage == 4) { NumDevices = Server.NumDevicesInLastMinutes; //Clear graph with all values if (NumDevicesInterval.Count > 15) { var lastNum = NumDevicesInterval[15]; NumDevicesInterval.Clear(); //Save last value NumDevicesInterval.Add(lastNum); } NumDevicesInterval.Add(NumDevices); } }
private void DateChanged(object sender, EventArgs e) { /* String format = "ddd MMM dd HH:mm:ss yyyy"; * DateTime dt = (DateTime) Interval1.Value; * Console.WriteLine(dt.ToString(format));*/ //Console.WriteLine( Server.ConvertStringToDateTime(Interval1.Value.ToString()).ToString()); if (Interval1.Value != null && Interval2.Value != null) { DateTime start = (DateTime)Interval1.Value; DateTime end = (DateTime)Interval2.Value; //Clear previously data if (Devices != null) { Devices.Clear(); } Devices = Server.GetPositionInInterval(start, end); foreach (Device d in Devices) { DevicesRenderer.Add(new DeviceLabel(d.X, d.Y, d.Mac, "SSID: " + d.Ssid)); } } }