From 6ac80c408cec1d6dcde3b139ec2a6c8e899b8a92 Mon Sep 17 00:00:00 2001 From: Colin Dawson Date: Sat, 24 Apr 2021 13:07:42 +0100 Subject: [PATCH] Fixed problem with changing the modifying the profile on the fly! --- Meade.net.Telescope/Telescope.cs | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/Meade.net.Telescope/Telescope.cs b/Meade.net.Telescope/Telescope.cs index fdb427d..919fa51 100644 --- a/Meade.net.Telescope/Telescope.cs +++ b/Meade.net.Telescope/Telescope.cs @@ -2619,14 +2619,19 @@ namespace ASCOM.Meade.net private void WriteProfile() { - var profileProperties = new ProfileProperties - { - TraceLogger = Tl.Enabled, - ComPort = ComPort, - GuideRateArcSecondsPerSecond = GuideRate - }; + var changed = false; - SharedResourcesWrapper.WriteProfile(profileProperties); + var profileProperties = SharedResourcesWrapper.ReadProfile(); + + + if (Math.Abs(profileProperties.GuideRateArcSecondsPerSecond - GuideRate) > 0.0000001) + { + changed = true; + profileProperties.GuideRateArcSecondsPerSecond = GuideRate; + } + + if (changed) + SharedResourcesWrapper.WriteProfile(profileProperties); } #endregion }