Skip to content

Commit

Permalink
Extend stop limit timers
Browse files Browse the repository at this point in the history
  • Loading branch information
rmorgan001 committed Sep 25, 2020
1 parent efd92d7 commit 06fdf73
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 31 deletions.
8 changes: 4 additions & 4 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
<Trademark>GS Server</Trademark>
<NeutralLanguage>en</NeutralLanguage>
<Copyright>Copyright © GreenSwamp Software 2019-2020</Copyright>
<AssemblyVersion>1.0.1.9</AssemblyVersion>
<FileVersion>1.0.1.9</FileVersion>
<ProductVersion>1.0.1.9</ProductVersion>
<Version>1.0.1.9</Version>
<AssemblyVersion>1.0.2.0</AssemblyVersion>
<FileVersion>1.0.2.0</FileVersion>
<ProductVersion>1.0.2.0</ProductVersion>
<Version>1.0.2.0</Version>
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion GS.Server/SkyTelescope/SkyTelescopeV.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
<BooleanToVisibilityConverter x:Key="BoolToVis"/>
</UserControl.Resources>
<Grid MinWidth="800">
<md:DialogHost IsOpen="{Binding IsDialogOpen}" DialogContent="{Binding DialogContent}" HorizontalAlignment="Center" VerticalAlignment="Center" CloseOnClickAway="True"/>
<md:DrawerHost IsLeftDrawerOpen="{Binding OpenSetupDialog}" BorderBrush="{StaticResource MaterialDesignDivider}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" BorderThickness="0">
<!-- switched lines for opendialog so COM can open the settings IsLeftDrawerOpen="{Binding OpenSetupDialog}"-->
<!--IsLeftDrawerOpen="{Binding ElementName=MenuToggleButton, Path=IsChecked}"-->
Expand Down Expand Up @@ -588,6 +587,7 @@
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<md:DialogHost Grid.RowSpan="2" IsOpen="{Binding IsDialogOpen}" DialogContent="{Binding DialogContent}" HorizontalAlignment="Center" VerticalAlignment="Center" CloseOnClickAway="True" />
<StackPanel Grid.Row="0" Grid.Column="0" Orientation="Horizontal">
<ToggleButton HorizontalAlignment="Left" VerticalAlignment="Top" IsChecked="{Binding OpenSetupDialog}" x:Name="MenuToggleButton" ToolTip="{StaticResource tbtipOpen}"
Command="{x:Static md:DrawerHost.OpenDrawerCommand}" CommandParameter="{x:Static Dock.Left}" IsHitTestVisible="True"
Expand Down
57 changes: 35 additions & 22 deletions GS.SkyWatcher/SkyWatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,16 @@ internal void AxisSlew(AxisId axis, double rate)

// Wait until the axis stops or counter runs out
var stopwatch = Stopwatch.StartNew();
while (stopwatch.Elapsed.TotalMilliseconds < 2000)
var counter = 1;
while (stopwatch.Elapsed.TotalMilliseconds <= 3500)
{
var axesstop = _commands.GetAxisStatus(axis);
// Return if the axis has stopped.
if (axesstop.FullStop)
{
break;
}
if (axesstop.FullStop) { break; }
// issue new stop
if (counter % 5 == 0) { AxisStop(axis); }
counter++;
Thread.Sleep(50);
}
return;
}
Expand Down Expand Up @@ -173,14 +175,16 @@ internal void AxisSlew(AxisId axis, double rate)

// Wait until the axis stops or counter runs out
var stopwatch = Stopwatch.StartNew();
while (stopwatch.Elapsed.TotalMilliseconds < 2000)
var counter = 1;
while (stopwatch.Elapsed.TotalMilliseconds <= 3500)
{
axesstatus = _commands.GetAxisStatus(axis);
// Return if the axis has stopped.
if (axesstatus.FullStop)
{
break;
}
if (axesstatus.FullStop) { break; }
// issue new stop
if (counter % 5 == 0) { AxisStop(axis); }
counter++;
Thread.Sleep(50);
}
}

Expand Down Expand Up @@ -352,15 +356,14 @@ internal void AxisPulse(AxisId axis, double guiderate, int duration, int backlas
{
// Wait until the axis stops or counter runs out
var sw2 = Stopwatch.StartNew();
while (sw2.Elapsed.TotalMilliseconds < 2000)
while (sw2.Elapsed.TotalMilliseconds <= 3500)
{
axesstatus = _commands.GetAxisStatus(axis);
// Return if the axis has stopped.
if (axesstatus.FullStop)
{
break;
}
if (axesstatus.FullStop) { break; }
Thread.Sleep(10);
}
if (!axesstatus.FullStop) { AxisStop(axis); }
}
}
}
Expand All @@ -376,11 +379,12 @@ internal void AxisPulse(AxisId axis, double guiderate, int duration, int backlas
{
// Wait until the axis stops or counter runs out
var stopwatch = Stopwatch.StartNew();
while (stopwatch.Elapsed.TotalMilliseconds < 2000)
while (stopwatch.Elapsed.TotalMilliseconds <= 3500)
{
axesstatus = _commands.GetAxisStatus(AxisId.Axis2);
// Return if the axis has stopped.
if (axesstatus.FullStop) { break; }
Thread.Sleep(10);
}
}

Expand Down Expand Up @@ -514,11 +518,16 @@ internal void AxisMoveSteps(AxisId axis, long movingSteps)

// Wait until the axis stops or counter runs out
var stopwatch = Stopwatch.StartNew();
while (stopwatch.Elapsed.TotalMilliseconds < 2000)
var counter = 1;
while (stopwatch.Elapsed.TotalMilliseconds <= 3500)
{
axesstatus = _commands.GetAxisStatus(axis);
// Return if the axis has stopped.
if (axesstatus.FullStop) { break; }
// issue new stop
if (counter % 5 == 0) { AxisStop(axis); }
counter++;
Thread.Sleep(50);
}
}

Expand Down Expand Up @@ -581,11 +590,15 @@ internal void AxisGoToTarget(AxisId axis, double targetPosition)

// Wait until the axis stops or counter runs out
var sw = Stopwatch.StartNew();
while (sw.Elapsed.TotalMilliseconds < 2000)
var counter = 1;
while (sw.Elapsed.TotalMilliseconds <= 3500)
{
axesstatus = _commands.GetAxisStatus(axis);
// Return if the axis has stopped.
if (axesstatus.FullStop) { break; }
if (counter % 5 == 0) { AxisStop(axis); }
counter++;
Thread.Sleep(50);
}
}

Expand Down Expand Up @@ -1005,12 +1018,12 @@ internal bool[] GetOneStepIndicators()
{
// Wait until the axis stops or counter runs out
stopwatch.Start();
while (stopwatch.Elapsed.TotalMilliseconds < 2000)
while (stopwatch.Elapsed.TotalMilliseconds <= 2000)
{
axesstatus1 = _commands.GetAxisStatus(AxisId.Axis1);
// Break loop if the axis has stopped.
if (axesstatus1.FullStop) { break; }
Thread.Sleep(1); // no need to hurry
Thread.Sleep(10); // no need to hurry
AxisStop(AxisId.Axis1); // force another stop
}
stopwatch.Reset(); //stop any interval measurement in progress and clear the elapsed time value
Expand Down Expand Up @@ -1044,12 +1057,12 @@ internal bool[] GetOneStepIndicators()
{
// Wait until the axis stops or counter runs out
stopwatch.Start();
while (stopwatch.Elapsed.TotalMilliseconds < 2000)
while (stopwatch.Elapsed.TotalMilliseconds <= 2000)
{
axesstatus2 = _commands.GetAxisStatus(AxisId.Axis2);
// Break loop if the axis has stopped.
if (axesstatus2.FullStop) { break; }
Thread.Sleep(1);
Thread.Sleep(10);
AxisStop(AxisId.Axis2); // force another stop
}
stopwatch.Reset();
Expand Down
8 changes: 4 additions & 4 deletions Resources/Installer/GreenSwampSetup.iss
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
; Script generated by the ASCOM Driver Installer Script Generator 6.2.0.0
; Generated by Robert Morgan on 5/20/2018 (UTC)
#define MyAppVersion "1.0.1.9"
#define ManualName "GSS Manual v1019.pdf"
#define VersionNumber "v1019"
#define InstallerBaseName "ASCOMGSServer1019Setup"
#define MyAppVersion "1.0.2.0"
#define ManualName "GSS Manual v1020.pdf"
#define VersionNumber "v1020"
#define InstallerBaseName "ASCOMGSServer1020Setup"
#define MyAppName "GSServer"
#define MyAppExeName "GS.Server.exe"

Expand Down

0 comments on commit 06fdf73

Please sign in to comment.