Code inspections

This commit is contained in:
2019-09-29 19:51:19 +01:00
parent 272fdb58d1
commit 0e0ea2d2b0
22 changed files with 195 additions and 160 deletions
+25 -19
View File
@@ -8,10 +8,16 @@
// </auto-generated>
//------------------------------------------------------------------------------
using System.CodeDom.Compiler;
using System.ComponentModel;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Drawing;
using System.Globalization;
using System.Resources;
using System.Runtime.CompilerServices;
namespace ASCOM.Meade.net.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
@@ -19,27 +25,27 @@ namespace ASCOM.Meade.net.Properties {
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[DebuggerNonUserCode()]
[CompilerGenerated()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
private static CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
[EditorBrowsable(EditorBrowsableState.Advanced)]
internal static ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ASCOM.Meade.net.Properties.Resources", typeof(Resources).Assembly);
if (ReferenceEquals(resourceMan, null)) {
ResourceManager temp = new ResourceManager("ASCOM.Meade.net.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
@@ -50,8 +56,8 @@ namespace ASCOM.Meade.net.Properties {
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
[EditorBrowsable(EditorBrowsableState.Advanced)]
internal static CultureInfo Culture {
get {
return resourceCulture;
}
@@ -63,20 +69,20 @@ namespace ASCOM.Meade.net.Properties {
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap ASCOM {
internal static Bitmap ASCOM {
get {
object obj = ResourceManager.GetObject("ASCOM", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
return ((Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
/// </summary>
internal static System.Drawing.Icon DefaultIcon {
internal static Icon DefaultIcon {
get {
object obj = ResourceManager.GetObject("DefaultIcon", resourceCulture);
return ((System.Drawing.Icon)(obj));
return ((Icon)(obj));
}
}
+8 -4
View File
@@ -8,14 +8,18 @@
// </auto-generated>
//------------------------------------------------------------------------------
using System.CodeDom.Compiler;
using System.Configuration;
using System.Runtime.CompilerServices;
namespace ASCOM.Meade.net.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
[CompilerGenerated()]
[GeneratedCode("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.0.0.0")]
internal sealed partial class Settings : ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
private static Settings defaultInstance = ((Settings)(Synchronized(new Settings())));
public static Settings Default {
get {
+3 -3
View File
@@ -1,7 +1,7 @@
using System.Runtime.InteropServices;
using ASCOM.DeviceInterface;
using System.Collections;
using System.Collections;
using System.Runtime.InteropServices;
using System.Threading;
using ASCOM.DeviceInterface;
namespace ASCOM.Meade.net
{
+35 -33
View File
@@ -1,16 +1,18 @@
#define Telescope
using System;
using System.Runtime.InteropServices;
using ASCOM.Astrometry.AstroUtils;
using ASCOM.Utilities;
using ASCOM.DeviceInterface;
using System.Collections;
using System.Globalization;
using System.Reflection;
using System.Runtime.InteropServices;
using ASCOM.Astrometry;
using ASCOM.Astrometry.AstroUtils;
using ASCOM.Astrometry.NOVAS;
using ASCOM.DeviceInterface;
using ASCOM.Meade.net.AstroMaths;
using ASCOM.Meade.net.Properties;
using ASCOM.Meade.net.Wrapper;
using ASCOM.Utilities;
using ASCOM.Utilities.Interfaces;
namespace ASCOM.Meade.net
@@ -538,7 +540,7 @@ namespace ASCOM.Meade.net
if (site < 1)
throw new ArgumentOutOfRangeException(nameof(site),site,Resources.Telescope_SelectSite_Site_cannot_be_lower_than_1);
else if (site > 4)
if (site > 4)
throw new ArgumentOutOfRangeException(nameof(site), site, Resources.Telescope_SelectSite_Site_cannot_be_higher_than_4);
_sharedResourcesWrapper.SendBlind($":W{site}#");
@@ -553,7 +555,7 @@ namespace ASCOM.Meade.net
if (site < 1)
throw new ArgumentOutOfRangeException(nameof(site), site, Resources.Telescope_SelectSite_Site_cannot_be_lower_than_1);
else if (site > 4)
if (site > 4)
throw new ArgumentOutOfRangeException(nameof(site), site, Resources.Telescope_SelectSite_Site_cannot_be_higher_than_4);
string command = String.Empty;
@@ -607,7 +609,7 @@ namespace ASCOM.Meade.net
if (site < 1)
throw new ArgumentOutOfRangeException(nameof(site), site, Resources.Telescope_SelectSite_Site_cannot_be_lower_than_1);
else if (site > 4)
if (site > 4)
throw new ArgumentOutOfRangeException(nameof(site), site, Resources.Telescope_SelectSite_Site_cannot_be_higher_than_4);
switch (site)
@@ -831,7 +833,7 @@ namespace ASCOM.Meade.net
UtcDateTime = UTCDate,
SiteLongitude = SiteLongitude,
SiteLatitude = SiteLatitude,
EquatorialCoordinates = new EquatorialCoordinates()
EquatorialCoordinates = new EquatorialCoordinates
{
RightAscension = RightAscension,
Declination = Declination
@@ -866,7 +868,7 @@ namespace ASCOM.Meade.net
{
get
{
LogMessage("AtHome", "Get - " + false.ToString());
LogMessage("AtHome", "Get - " + false);
return false;
}
}
@@ -885,7 +887,7 @@ namespace ASCOM.Meade.net
public IAxisRates AxisRates(TelescopeAxes axis)
{
LogMessage("AxisRates", "Get - " + axis.ToString());
LogMessage("AxisRates", "Get - " + axis);
return new AxisRates(axis);
}
@@ -915,14 +917,14 @@ namespace ASCOM.Meade.net
{
get
{
LogMessage("CanFindHome", "Get - " + false.ToString());
LogMessage("CanFindHome", "Get - " + false);
return false;
}
}
public bool CanMoveAxis(TelescopeAxes axis)
{
LogMessage("CanMoveAxis", "Get - " + axis.ToString());
LogMessage("CanMoveAxis", "Get - " + axis);
switch (axis)
{
case TelescopeAxes.axisPrimary: return true; //RA or AZ
@@ -936,7 +938,7 @@ namespace ASCOM.Meade.net
{
get
{
LogMessage("CanPark", "Get - " + true.ToString());
LogMessage("CanPark", "Get - " + true);
return true;
}
}
@@ -945,7 +947,7 @@ namespace ASCOM.Meade.net
{
get
{
LogMessage("CanPulseGuide", "Get - " + true.ToString());
LogMessage("CanPulseGuide", "Get - " + true);
return true;
}
}
@@ -954,7 +956,7 @@ namespace ASCOM.Meade.net
{
get
{
LogMessage("CanSetDeclinationRate", "Get - " + false.ToString());
LogMessage("CanSetDeclinationRate", "Get - " + false);
return false;
}
}
@@ -967,7 +969,7 @@ namespace ASCOM.Meade.net
var canSetGuideRate = IsGuideRateSettingSupported();
LogMessage("CanSetGuideRates", "Get - " + canSetGuideRate.ToString());
LogMessage("CanSetGuideRates", "Get - " + canSetGuideRate);
return canSetGuideRate;
}
}
@@ -976,7 +978,7 @@ namespace ASCOM.Meade.net
{
get
{
LogMessage("CanSetPark", "Get - " + false.ToString());
LogMessage("CanSetPark", "Get - " + false);
return false;
}
}
@@ -985,7 +987,7 @@ namespace ASCOM.Meade.net
{
get
{
LogMessage("CanSetPierSide", "Get - " + false.ToString());
LogMessage("CanSetPierSide", "Get - " + false);
return false;
}
}
@@ -994,7 +996,7 @@ namespace ASCOM.Meade.net
{
get
{
LogMessage("CanSetRightAscensionRate", "Get - " + false.ToString());
LogMessage("CanSetRightAscensionRate", "Get - " + false);
return false;
}
}
@@ -1003,7 +1005,7 @@ namespace ASCOM.Meade.net
{
get
{
LogMessage("CanSetTracking", "Get - " + true.ToString());
LogMessage("CanSetTracking", "Get - " + true);
return true;
}
}
@@ -1012,7 +1014,7 @@ namespace ASCOM.Meade.net
{
get
{
LogMessage("CanSlew", "Get - " + true.ToString());
LogMessage("CanSlew", "Get - " + true);
return true;
}
}
@@ -1021,7 +1023,7 @@ namespace ASCOM.Meade.net
{
get
{
LogMessage("CanSlewAltAz", "Get - " + true.ToString());
LogMessage("CanSlewAltAz", "Get - " + true);
return true;
}
}
@@ -1030,7 +1032,7 @@ namespace ASCOM.Meade.net
{
get
{
LogMessage("CanSlewAltAzAsync", "Get - " + true.ToString());
LogMessage("CanSlewAltAzAsync", "Get - " + true);
return true;
}
}
@@ -1039,7 +1041,7 @@ namespace ASCOM.Meade.net
{
get
{
LogMessage("CanSlewAsync", "Get - " + true.ToString());
LogMessage("CanSlewAsync", "Get - " + true);
return true;
}
}
@@ -1048,7 +1050,7 @@ namespace ASCOM.Meade.net
{
get
{
LogMessage("CanSync", "Get - " + true.ToString());
LogMessage("CanSync", "Get - " + true);
return true;
}
}
@@ -1057,7 +1059,7 @@ namespace ASCOM.Meade.net
{
get
{
LogMessage("CanSyncAltAz", "Get - " + false.ToString());
LogMessage("CanSyncAltAz", "Get - " + false);
return false;
}
}
@@ -1066,7 +1068,7 @@ namespace ASCOM.Meade.net
{
get
{
LogMessage("CanUnpark", "Get - " + false.ToString());
LogMessage("CanUnpark", "Get - " + false);
return false;
}
}
@@ -1131,7 +1133,7 @@ namespace ASCOM.Meade.net
get
{
EquatorialCoordinateType equatorialSystem = EquatorialCoordinateType.equTopocentric;
LogMessage("DeclinationRate", "Get - " + equatorialSystem.ToString());
LogMessage("DeclinationRate", "Get - " + equatorialSystem);
return equatorialSystem;
}
}
@@ -1473,13 +1475,13 @@ namespace ASCOM.Meade.net
{
// Now using NOVAS 3.1
double siderealTime = 0.0;
using (var novas = new Astrometry.NOVAS.NOVAS31())
using (var novas = new NOVAS31())
{
var jd = _utilities.DateUTCToJulian(DateTime.UtcNow);
novas.SiderealTime(jd, 0, novas.DeltaT(jd),
Astrometry.GstType.GreenwichApparentSiderealTime,
Astrometry.Method.EquinoxBased,
Astrometry.Accuracy.Reduced, ref siderealTime);
GstType.GreenwichApparentSiderealTime,
Method.EquinoxBased,
Accuracy.Reduced, ref siderealTime);
}
// Allow for the longitude
@@ -2096,7 +2098,7 @@ namespace ASCOM.Meade.net
LogMessage("TrackingRates", "Get - ");
foreach (DriveRates driveRate in trackingRates)
{
LogMessage("TrackingRates", "Get - " + driveRate.ToString());
LogMessage("TrackingRates", "Get - " + driveRate);
}
return trackingRates;
}