Fixed a few more code inspections

This commit is contained in:
2021-03-02 12:54:47 +00:00
parent f57a73843a
commit cdf1066e4e
+5 -8
View File
@@ -2048,6 +2048,7 @@ namespace ASCOM.Meade.net
{ {
if (string.IsNullOrEmpty(result)) if (string.IsNullOrEmpty(result))
{ {
// ReSharper disable once RedundantAssignment
isSlewing = false; isSlewing = false;
return isSlewing; return isSlewing;
} }
@@ -2167,8 +2168,7 @@ namespace ASCOM.Meade.net
if (value < -90) if (value < -90)
throw new InvalidValueException("Declination cannot be less than -90."); throw new InvalidValueException("Declination cannot be less than -90.");
var dms = ""; var dms = IsLongFormat ?
dms = IsLongFormat ?
_utilities.DegreesToDMS(value, "*", ":", ":", _digitsDe) : _utilities.DegreesToDMS(value, "*", ":", ":", _digitsDe) :
_utilities.DegreesToDM(value, "*", "", _digitsDe); _utilities.DegreesToDM(value, "*", "", _digitsDe);
@@ -2223,12 +2223,9 @@ namespace ASCOM.Meade.net
if (value >= 24) if (value >= 24)
throw new InvalidValueException("Right ascension value cannot be greater than 23:59:59"); throw new InvalidValueException("Right ascension value cannot be greater than 23:59:59");
var hms = ""; var hms = IsLongFormat ?
if(IsLongFormat) _utilities.HoursToHMS(value, ":", ":", ":", _digitsRa) :
hms = _utilities.HoursToHMS(value, ":", ":", ":", _digitsRa); _utilities.HoursToHM(value, ":", "", _digitsRa).Replace(',','.');
else
//meade protocol defines H:MM.T format
hms = _utilities.HoursToHM(value, ":", "", _digitsRa).Replace(',','.');
var command = $":Sr{hms}#"; var command = $":Sr{hms}#";
LogMessage("TargetRightAscension Set", $"{command}"); LogMessage("TargetRightAscension Set", $"{command}");