From bb1980c827a4eadf3269c0f1374045243d2c61e5 Mon Sep 17 00:00:00 2001 From: TekuSP Date: Tue, 26 Dec 2023 08:39:32 +0100 Subject: [PATCH] Fix bugs, fix wifi atttempts being on wrong line --- OpenHaloApplication.cs | 1 - Windows/ConnectingWIFI.cs | 8 +++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/OpenHaloApplication.cs b/OpenHaloApplication.cs index 981433f..8a4417f 100644 --- a/OpenHaloApplication.cs +++ b/OpenHaloApplication.cs @@ -24,7 +24,6 @@ public class OpenHaloApplication : Application public static Font SmallFont; public static void Main() { - Thread.Sleep(5000); int backLightPin = 8; int chipSelect = 10; int dataCommand = 9; diff --git a/Windows/ConnectingWIFI.cs b/Windows/ConnectingWIFI.cs index 3259a77..7eaae9b 100644 --- a/Windows/ConnectingWIFI.cs +++ b/Windows/ConnectingWIFI.cs @@ -74,6 +74,12 @@ public ConnectingWIFI(OpenHaloApplication application) wifiText.ForeColor = System.Drawing.Color.White; stackPanel.Children.Add(wifiText); + Text atttemptText = new Text(OpenHaloApplication.SmallFont, ""); + atttemptText.VerticalAlignment = VerticalAlignment.Center; + atttemptText.HorizontalAlignment = HorizontalAlignment.Center; + atttemptText.ForeColor = System.Drawing.Color.White; + stackPanel.Children.Add(atttemptText); + Console.WriteLine("Wifi Connections init...."); Configs.Wifi pernament = null; while (WifiNetworkHelper.Status != NetworkHelperStatus.NetworkIsReady) @@ -81,7 +87,7 @@ public ConnectingWIFI(OpenHaloApplication application) foreach (var item in OpenHaloApplication.config.Wifis) { int tries = 5; - wifiText.Dispatcher.Invoke(TimeSpan.MaxValue, (args) => { wifiText.TextContent = item.SSID + "try " + (5 - tries); return null; }, null); + wifiText.Dispatcher.Invoke(TimeSpan.MaxValue, (args) => { wifiText.TextContent = item.SSID; atttemptText.TextContent = "Attempt: " + (tries - 5 + 1); return null; }, null); pernament = item; Console.WriteLine("Trying: " + item.SSID); WifiNetworkHelper.ScanAndConnectDhcp(item.SSID, item.Password, System.Device.Wifi.WifiReconnectionKind.Manual);