From e0abde453206d53d6ace6fbfa6da1beeeee7edc7 Mon Sep 17 00:00:00 2001 From: Mauro-Sturaro Date: Sun, 20 Oct 2024 11:54:00 +0200 Subject: [PATCH] In roll-off roof the properties Device.Altitude and Device.Azimuth thow errors when read, so is mandatory to check first if the property is available. --- ASCOM.Alpaca.Simulators/Pages/DomeControl.razor | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ASCOM.Alpaca.Simulators/Pages/DomeControl.razor b/ASCOM.Alpaca.Simulators/Pages/DomeControl.razor index 93c457d8..46e4bbfc 100644 --- a/ASCOM.Alpaca.Simulators/Pages/DomeControl.razor +++ b/ASCOM.Alpaca.Simulators/Pages/DomeControl.razor @@ -169,14 +169,17 @@ { if (Connected) { - if (Device.CanSetShutter && Device.Altitude != -100000.0) + if (Device.CanSetShutter) { switch (Device.ShutterStatus) { case ShutterState.Open: if (Device.CanSetAltitude) { - return Device.Altitude.ToString("0.0"); + if (Device.Altitude != -100000.0) + return Device.Altitude.ToString("0.0"); + else + return "----"; } else { @@ -204,7 +207,7 @@ { if (Connected) { - if (Device.Azimuth != -100000.0) + if (Device.CanSetAzimuth && Device.Azimuth != -100000.0) { return Device.Azimuth.ToString("000.0"); }