Skip to content

Commit

Permalink
Fic issue where a Connect failure in the Focuser device was not repor…
Browse files Browse the repository at this point in the history
…ted. Make all Connected methods confirm that the set value is reflected in Get Connected.
  • Loading branch information
Peter-Simpson committed May 17, 2023
1 parent 46bd1b7 commit 8b5f209
Show file tree
Hide file tree
Showing 13 changed files with 145 additions and 55 deletions.
14 changes: 10 additions & 4 deletions ConformU/Conform/Devices/CameraTester.cs
Original file line number Diff line number Diff line change
Expand Up @@ -327,20 +327,26 @@ public override bool Connected
{
get
{
if (settings.DisplayMethodCalls)
LogTestAndMessage("ConformanceCheck", "About to get Connected");
LogCallToDriver("ConformanceCheck", "About to get Connected");
return camera.Connected;
}
set
{
if (settings.DisplayMethodCalls)
LogTestAndMessage("ConformanceCheck", "About to set Connected");
LogCallToDriver("ConformanceCheck", "About to set Connected");
SetTest("Connected");
SetAction("Waiting for Connected to become 'true'");
camera.Connected = value;
ResetTestActionStatus();

// Make sure that the value set is reflected in Connected GET
bool connectedState = Connected;
if (connectedState != value)
{
throw new ASCOM.InvalidOperationException($"Connected was set to {value} but Connected Get returned {connectedState}.");
}
}
}

public override void ReadCanProperties()
{
// ICameraV1 properties
Expand Down
14 changes: 12 additions & 2 deletions ConformU/Conform/Devices/CoverCalibratorTester.cs
Original file line number Diff line number Diff line change
Expand Up @@ -173,13 +173,23 @@ public override bool Connected
{
get
{
LogCallToDriver("Connected", "About to get Connected property");
LogCallToDriver("ConformanceCheck", "About to get Connected");
return coverCalibratorDevice.Connected;
}
set
{
LogCallToDriver("Connected", "About to set Connected property");
LogCallToDriver("ConformanceCheck", "About to set Connected");
SetTest("Connected");
SetAction("Waiting for Connected to become 'true'");
coverCalibratorDevice.Connected = value;
ResetTestActionStatus();

// Make sure that the value set is reflected in Connected GET
bool connectedState = Connected;
if (connectedState != value)
{
throw new ASCOM.InvalidOperationException($"Connected was set to {value} but Connected Get returned {connectedState}.");
}
}
}

Expand Down
13 changes: 11 additions & 2 deletions ConformU/Conform/Devices/DomeTester.cs
Original file line number Diff line number Diff line change
Expand Up @@ -200,14 +200,23 @@ public override bool Connected
{
get
{
LogCallToDriver("Connected", "About to get Connected property");
LogCallToDriver("ConformanceCheck", "About to get Connected");
return domeDevice.Connected;
}
set
{
LogCallToDriver("Connected", "About to set Connected property");
LogCallToDriver("ConformanceCheck", "About to set Connected");
SetTest("Connected");
SetAction("Waiting for Connected to become 'true'");
domeDevice.Connected = value;
ResetTestActionStatus();

// Make sure that the value set is reflected in Connected GET
bool connectedState = Connected;
if (connectedState != value)
{
throw new ASCOM.InvalidOperationException($"Connected was set to {value} but Connected Get returned {connectedState}.");
}
}
}
public override void CheckCommonMethods()
Expand Down
14 changes: 12 additions & 2 deletions ConformU/Conform/Devices/FilerWheelTester.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,23 @@ public override bool Connected
{
get
{
LogCallToDriver("Connected", "About to get Connected property");
LogCallToDriver("ConformanceCheck", "About to get Connected");
return filterWheel.Connected;
}
set
{
LogCallToDriver("Connected", "About to set Connected property");
LogCallToDriver("ConformanceCheck", "About to set Connected");
SetTest("Connected");
SetAction("Waiting for Connected to become 'true'");
filterWheel.Connected = value;
ResetTestActionStatus();

// Make sure that the value set is reflected in Connected GET
bool connectedState = Connected;
if (connectedState != value)
{
throw new ASCOM.InvalidOperationException($"Connected was set to {value} but Connected Get returned {connectedState}.");
}
}
}
public override void PreRunCheck()
Expand Down
21 changes: 11 additions & 10 deletions ConformU/Conform/Devices/FocuserTester.cs
Original file line number Diff line number Diff line change
Expand Up @@ -167,21 +167,22 @@ public override bool Connected
{
get
{
LogCallToDriver("Connected", "About to get Connected property");
LogCallToDriver("ConformanceCheck", "About to get Connected");
return focuser.Connected;
}
set
{
try
{
LogDebug("Connected", "Setting connected state to: " + value.ToString());
LogCallToDriver("Connected", "About to set Link property");
focuser.Connected = value;
LogDebug("AccessChecks", "Successfully changed connected state");
}
catch (Exception ex)
LogCallToDriver("ConformanceCheck", "About to set Connected");
SetTest("Connected");
SetAction("Waiting for Connected to become 'true'");
focuser.Connected = value;
ResetTestActionStatus();

// Make sure that the value set is reflected in Connected GET
bool connectedState = Connected;
if (connectedState != value)
{
LogIssue("Connected", "Error changing focuser connected state: " + ex.ToString());
throw new ASCOM.InvalidOperationException($"Connected was set to {value} but Connected Get returned {connectedState}.");
}
}
}
Expand Down
14 changes: 12 additions & 2 deletions ConformU/Conform/Devices/ObservingConditionsTester.cs
Original file line number Diff line number Diff line change
Expand Up @@ -235,13 +235,23 @@ public override bool Connected
{
get
{
LogCallToDriver("Absolute", "About to get Connected property");
LogCallToDriver("ConformanceCheck", "About to get Connected");
return m_ObservingConditions.Connected;
}
set
{
LogCallToDriver("Absolute", "About to set Connected property");
LogCallToDriver("ConformanceCheck", "About to set Connected");
SetTest("Connected");
SetAction("Waiting for Connected to become 'true'");
m_ObservingConditions.Connected = value;
ResetTestActionStatus();

// Make sure that the value set is reflected in Connected GET
bool connectedState = Connected;
if (connectedState != value)
{
throw new ASCOM.InvalidOperationException($"Connected was set to {value} but Connected Get returned {connectedState}.");
}
}
}

Expand Down
18 changes: 13 additions & 5 deletions ConformU/Conform/Devices/RotatorTester.cs
Original file line number Diff line number Diff line change
Expand Up @@ -178,15 +178,23 @@ public override bool Connected
{
get
{
LogCallToDriver("Connected", "About to get Connected property");
bool ConnectedRet = m_Rotator.Connected;
return ConnectedRet;
LogCallToDriver("ConformanceCheck", "About to get Connected");
return m_Rotator.Connected;
}

set
{
LogCallToDriver("Connected", "About to set Connected property");
LogCallToDriver("ConformanceCheck", "About to set Connected");
SetTest("Connected");
SetAction("Waiting for Connected to become 'true'");
m_Rotator.Connected = value;
ResetTestActionStatus();

// Make sure that the value set is reflected in Connected GET
bool connectedState = Connected;
if (connectedState != value)
{
throw new ASCOM.InvalidOperationException($"Connected was set to {value} but Connected Get returned {connectedState}.");
}
}
}

Expand Down
14 changes: 12 additions & 2 deletions ConformU/Conform/Devices/SafetyMonitorTester.cs
Original file line number Diff line number Diff line change
Expand Up @@ -179,13 +179,23 @@ public override bool Connected
{
get
{
LogCallToDriver("Connected", "About to get Connected property");
LogCallToDriver("ConformanceCheck", "About to get Connected");
return m_SafetyMonitor.Connected;
}
set
{
LogCallToDriver("Connected", "About to set Connected property");
LogCallToDriver("ConformanceCheck", "About to set Connected");
SetTest("Connected");
SetAction("Waiting for Connected to become 'true'");
m_SafetyMonitor.Connected = value;
ResetTestActionStatus();

// Make sure that the value set is reflected in Connected GET
bool connectedState = Connected;
if (connectedState != value)
{
throw new ASCOM.InvalidOperationException($"Connected was set to {value} but Connected Get returned {connectedState}.");
}
}
}

Expand Down
14 changes: 12 additions & 2 deletions ConformU/Conform/Devices/SwitchTester.cs
Original file line number Diff line number Diff line change
Expand Up @@ -184,13 +184,23 @@ public override bool Connected
{
get
{
LogCallToDriver("Connected", "About to get Connected property");
LogCallToDriver("ConformanceCheck", "About to get Connected");
return m_Switch.Connected;
}
set
{
LogCallToDriver("Connected", "About to get Connected property");
LogCallToDriver("ConformanceCheck", "About to set Connected");
SetTest("Connected");
SetAction("Waiting for Connected to become 'true'");
m_Switch.Connected = value;
ResetTestActionStatus();

// Make sure that the value set is reflected in Connected GET
bool connectedState = Connected;
if (connectedState != value)
{
throw new ASCOM.InvalidOperationException($"Connected was set to {value} but Connected Get returned {connectedState}.");
}
}
}

Expand Down
20 changes: 13 additions & 7 deletions ConformU/Conform/Devices/TelescopeTester.cs
Original file line number Diff line number Diff line change
Expand Up @@ -443,17 +443,23 @@ public override bool Connected
{
get
{
if (settings.DisplayMethodCalls)
LogTestAndMessage("ConformanceCheck", "About to get Connected property");
bool ConnectedRet = telescopeDevice.Connected;
return ConnectedRet;
LogCallToDriver("ConformanceCheck", "About to get Connected");
return telescopeDevice.Connected;
}

set
{
if (settings.DisplayMethodCalls)
LogTestAndMessage("ConformanceCheck", "About to set Connected property " + value.ToString());
LogCallToDriver("ConformanceCheck", "About to set Connected");
SetTest("Connected");
SetAction("Waiting for Connected to become 'true'");
telescopeDevice.Connected = value;
ResetTestActionStatus();

// Make sure that the value set is reflected in Connected GET
bool connectedState = Connected;
if (connectedState != value)
{
throw new ASCOM.InvalidOperationException($"Connected was set to {value} but Connected Get returned {connectedState}.");
}
}
}

Expand Down
14 changes: 12 additions & 2 deletions ConformU/Conform/Devices/VideoTester.cs
Original file line number Diff line number Diff line change
Expand Up @@ -223,13 +223,23 @@ public override bool Connected
{
get
{
LogCallToDriver("Connected", "About to get Connected property");
LogCallToDriver("ConformanceCheck", "About to get Connected");
return videoDevice.Connected;
}
set
{
LogCallToDriver("Connected", "About to set Connected property");
LogCallToDriver("ConformanceCheck", "About to set Connected");
SetTest("Connected");
SetAction("Waiting for Connected to become 'true'");
videoDevice.Connected = value;
ResetTestActionStatus();

// Make sure that the value set is reflected in Connected GET
bool connectedState = Connected;
if (connectedState != value)
{
throw new ASCOM.InvalidOperationException($"Connected was set to {value} but Connected Get returned {connectedState}.");
}
}
}

Expand Down
24 changes: 12 additions & 12 deletions WindowsInstaller/ConformU.iss
Original file line number Diff line number Diff line change
Expand Up @@ -81,22 +81,22 @@ Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{

[Files]
; 64bit OS - Install the 64bit app
Source: "J:\ConformU\publish\ConformU64\*.exe"; DestDir: "{app}\64bit"; Flags: ignoreversion signonce; Check: Is64BitInstallMode
Source: "J:\ConformU\publish\ConformU64\*.dll"; DestDir: "{app}\64bit"; Flags: ignoreversion signonce; Check: Is64BitInstallMode
Source: "J:\ConformU\publish\ConformU64\*"; DestDir: "{app}\64bit"; Flags: ignoreversion; Excludes:"*.exe,*.dll"; Check: Is64BitInstallMode
Source: "J:\ConformU\publish\ConformU64\wwwroot\*"; DestDir: "{app}\64bit\wwwroot"; Flags: ignoreversion recursesubdirs createallsubdirs; Check: Is64BitInstallMode
Source: "..\publish\ConformU64\*.exe"; DestDir: "{app}\64bit"; Flags: ignoreversion signonce; Check: Is64BitInstallMode
Source: "..\publish\ConformU64\*.dll"; DestDir: "{app}\64bit"; Flags: ignoreversion signonce; Check: Is64BitInstallMode
Source: "..\publish\ConformU64\*"; DestDir: "{app}\64bit"; Flags: ignoreversion; Excludes:"*.exe,*.dll"; Check: Is64BitInstallMode
Source: "..\publish\ConformU64\wwwroot\*"; DestDir: "{app}\64bit\wwwroot"; Flags: ignoreversion recursesubdirs createallsubdirs; Check: Is64BitInstallMode

; 64bit OS - Install the 32bit app
Source: "J:\ConformU\publish\ConformU86\*.exe"; DestDir: "{app}\32bit"; Flags: ignoreversion signonce; Check: Is64BitInstallMode
Source: "J:\ConformU\publish\ConformU86\*.dll"; DestDir: "{app}\32bit"; Flags: ignoreversion signonce; Check: Is64BitInstallMode
Source: "J:\ConformU\publish\ConformU86\*"; DestDir: "{app}\32bit"; Flags: ignoreversion; Excludes:"*.exe,*.dll"; Check: Is64BitInstallMode
Source: "J:\ConformU\publish\ConformU86\wwwroot\*"; DestDir: "{app}\32bit\wwwroot"; Flags: ignoreversion recursesubdirs createallsubdirs; Check: Is64BitInstallMode
Source: "..\publish\ConformU86\*.exe"; DestDir: "{app}\32bit"; Flags: ignoreversion signonce; Check: Is64BitInstallMode
Source: "..\publish\ConformU86\*.dll"; DestDir: "{app}\32bit"; Flags: ignoreversion signonce; Check: Is64BitInstallMode
Source: "..\publish\ConformU86\*"; DestDir: "{app}\32bit"; Flags: ignoreversion; Excludes:"*.exe,*.dll"; Check: Is64BitInstallMode
Source: "..\publish\ConformU86\wwwroot\*"; DestDir: "{app}\32bit\wwwroot"; Flags: ignoreversion recursesubdirs createallsubdirs; Check: Is64BitInstallMode

; 32bit OS - Install the 32bit app
Source: "J:\ConformU\publish\ConformU86\*.exe"; DestDir: "{app}"; Flags: ignoreversion signonce; Check: not Is64BitInstallMode
Source: "J:\ConformU\publish\ConformU86\*.dll"; DestDir: "{app}"; Flags: ignoreversion signonce; Check: not Is64BitInstallMode
Source: "J:\ConformU\publish\ConformU86\*"; DestDir: "{app}"; Flags: ignoreversion; Excludes:"*.exe,*.dll"; Check: not Is64BitInstallMode
Source: "J:\ConformU\publish\ConformU86\wwwroot\*"; DestDir: "{app}\wwwroot"; Flags: ignoreversion recursesubdirs createallsubdirs; Check: not Is64BitInstallMode
Source: "..\publish\ConformU86\*.exe"; DestDir: "{app}"; Flags: ignoreversion signonce; Check: not Is64BitInstallMode
Source: "..\publish\ConformU86\*.dll"; DestDir: "{app}"; Flags: ignoreversion signonce; Check: not Is64BitInstallMode
Source: "..\publish\ConformU86\*"; DestDir: "{app}"; Flags: ignoreversion; Excludes:"*.exe,*.dll"; Check: not Is64BitInstallMode
Source: "..\publish\ConformU86\wwwroot\*"; DestDir: "{app}\wwwroot"; Flags: ignoreversion recursesubdirs createallsubdirs; Check: not Is64BitInstallMode

[Icons]
; 64bit OS
Expand Down
6 changes: 3 additions & 3 deletions publishWindows.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ cd
cd J:\ConformU

echo *** Build application
MSBuild "J:\ConformU\ConformU.sln" /p:Configuration=Debug /p:Platform="Any CPU" /t:Restore
MSBuild "ConformU.sln" /p:Configuration=Debug /p:Platform="Any CPU" /t:Restore
cd
MSBuild "J:\ConformU\ConformU.sln" /p:Configuration=Debug /p:Platform="Any CPU" /t:Rebuild
MSBuild "ConformU.sln" /p:Configuration=Debug /p:Platform="Any CPU" /t:Rebuild
echo *** Completed Build

echo *** Publishing Windows 64bit
Expand All @@ -26,7 +26,7 @@ echo *** Completed setting large address aware flag on 32bit EXE

echo *** Creating Windows installer
cd WindowsInstaller
"C:\Program Files (x86)\Inno Script Studio\isstudio.exe" -compile "J:\ConformU\WindowsInstaller\conformu.iss"
"C:\Program Files (x86)\Inno Script Studio\isstudio.exe" -compile "conformu.iss"
cd ..

echo *** Builds complete
Expand Down

0 comments on commit 8b5f209

Please sign in to comment.