|
9 | 9 | Background="{DynamicResource WindowBackgroundBrush}" |
10 | 10 | d:DesignHeight="400" d:DesignWidth="440"> |
11 | 11 | <UserControl.Resources> |
| 12 | + <local:BooleanBooleanValueConverter x:Key="BoolBoolConverter" /> |
| 13 | + <local:UnitsBooleanToStringConverter x:Key="UnitsConverter" /> |
| 14 | + |
12 | 15 | <Style x:Key="RateLabel" TargetType="{x:Type Label}"> |
13 | 16 | <Setter Property="Foreground" Value="{DynamicResource NormalTextBrush}" /> |
14 | 17 | <Setter Property="Margin" Value="0" /> |
|
27 | 30 | <Setter Property="Height" Value="22"/> |
28 | 31 | </Style> |
29 | 32 | </UserControl.Resources> |
30 | | - <Grid> |
| 33 | + <Grid HorizontalAlignment="Center"> |
31 | 34 | <Grid.RowDefinitions> |
32 | | - <RowDefinition Height="Auto" /> |
33 | | - <RowDefinition Height="Auto" /> |
34 | | - <RowDefinition Height="Auto" /> |
35 | | - <RowDefinition Height="Auto" /> |
36 | | - <RowDefinition Height="Auto" /> |
| 35 | + <RowDefinition Height="Auto" MinHeight="10" /> |
| 36 | + <RowDefinition Height="Auto" MinHeight="10" /> |
| 37 | + <RowDefinition Height="Auto" MinHeight="10" /> |
| 38 | + <RowDefinition Height="Auto" MinHeight="10" /> |
37 | 39 | </Grid.RowDefinitions> |
38 | 40 | <Grid.ColumnDefinitions> |
39 | 41 | <ColumnDefinition Width="Auto" /> |
40 | | - <ColumnDefinition Width="Auto" MaxWidth="86" /> |
41 | | - <ColumnDefinition Width="Auto" /> |
42 | 42 | </Grid.ColumnDefinitions> |
43 | 43 |
|
44 | | - <Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" Margin="0,3" HorizontalAlignment="Center" Style="{StaticResource RateValue}" |
| 44 | + <Label Grid.Row="0" Grid.Column="0" Margin="0,3" HorizontalAlignment="Center" Style="{StaticResource RateValue}" |
45 | 45 | Content="{Binding TrackingRateText, FallbackValue=Tracking Rate Info goes here.}" /> |
46 | | - <StackPanel Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="3" Orientation="Horizontal" Height="Auto" HorizontalAlignment="Center"> |
| 46 | + <GroupBox Grid.Row="1" Grid.Column="0" Header="Current Telescope Tracking Rate Offsets" |
| 47 | + Foreground="{DynamicResource NormalTextBrush}" HorizontalAlignment="Center"> |
| 48 | + <Grid> |
| 49 | + <Grid.RowDefinitions> |
| 50 | + <RowDefinition Height="Auto" MinHeight="10"/> |
| 51 | + <RowDefinition Height="Auto" MinHeight="10"/> |
| 52 | + <RowDefinition Height="Auto" MinHeight="10"/> |
| 53 | + </Grid.RowDefinitions> |
| 54 | + <Grid.ColumnDefinitions> |
| 55 | + <ColumnDefinition Width="Auto" MinWidth="30"/> |
| 56 | + <ColumnDefinition Width="Auto" MinWidth="60"/> |
| 57 | + <ColumnDefinition Width="Auto" MinWidth="90"/> |
| 58 | + </Grid.ColumnDefinitions> |
| 59 | + <Label Grid.Row="0" Grid.Column="0" Content="RA Offset Rate:" HorizontalAlignment="Right" VerticalAlignment="Center" |
| 60 | + Foreground="{DynamicResource NormalTextBrush}" Padding="1" /> |
| 61 | + <Label Grid.Row="0" Grid.Column="1" HorizontalAlignment="Right" VerticalAlignment="Center" |
| 62 | + Foreground="{DynamicResource DynamicTextBrush}" Padding="0" |
| 63 | + Content="{Binding RaRateOffset}" ContentStringFormat="F7" /> |
| 64 | + <Label Grid.Row="0" Grid.Column="2" HorizontalAlignment="Left" VerticalAlignment="Bottom" Padding="0" |
| 65 | + Margin="6,0,0,1" Foreground="{DynamicResource NormalTextBrush}" |
| 66 | + Content="{Binding AscomRaUnits}" /> |
| 67 | + |
| 68 | + <Label Grid.Row="1" Grid.Column="0" Content="Dec Offset Rate:" HorizontalAlignment="Right" VerticalAlignment="Center" |
| 69 | + Foreground="{DynamicResource NormalTextBrush}" Padding="1" /> |
| 70 | + <Label Grid.Row="1" Grid.Column="1" HorizontalAlignment="Right" VerticalAlignment="Center" |
| 71 | + Padding="0" Foreground="{DynamicResource DynamicTextBrush}" |
| 72 | + Content="{Binding DecRateOffset}" ContentStringFormat="F7" /> |
| 73 | + <Label Grid.Row="1" Grid.Column="2" HorizontalAlignment="Left" VerticalAlignment="Center" |
| 74 | + Margin="6,0,0,0" Foreground="{DynamicResource NormalTextBrush}" Padding="0" |
| 75 | + Content="{Binding AscomDecUnits}" /> |
| 76 | + |
| 77 | + <Label Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="3" Foreground="{DynamicResource NormalTextBrush}" Padding="1" |
| 78 | + Content="{Binding RatesNote}" /> |
| 79 | + |
| 80 | + </Grid> |
| 81 | + </GroupBox> |
| 82 | + <StackPanel Grid.Row="2" Grid.Column="0" Orientation="Horizontal" Height="Auto" HorizontalAlignment="Center" |
| 83 | + Margin="0,8,0,0"> |
47 | 84 | <Button Content="Sidereal" Height="60" Width="60" Style="{StaticResource CircleButton}" |
48 | 85 | Command="{Binding ApplySiderealTrackingCommand}" /> |
49 | 86 | <Button Content="Lunar" Height="60" Width="60" Style="{StaticResource CircleButton}" |
50 | 87 | Command="{Binding ApplyLunarTrackingCommand}" /> |
51 | | - <Button Content="Offset" Height="60" Width="60" Style="{StaticResource CircleButton}" |
52 | | - Command="{Binding ApplyOffsetTrackingCommand}" /> |
| 88 | + <Button Content="Solar" Height="60" Width="60" Style="{StaticResource CircleButton}" |
| 89 | + Command="{Binding ApplySolarTrackingCommand}" /> |
| 90 | + <Button Content="King" Height="60" Width="60" Style="{StaticResource CircleButton}" |
| 91 | + Command="{Binding ApplyKingTrackingCommand}" /> |
53 | 92 | </StackPanel> |
54 | 93 |
|
55 | | - <Label Grid.Row="2" Grid.Column="0" Content="RA Offset Rate:" HorizontalAlignment="Right" VerticalAlignment="Center" |
56 | | - Margin="0,8,4,8" Style="{StaticResource RateLabel}" /> |
57 | | - <local:DoubleEntryBox Grid.Row="2" Grid.Column="1" Height="22" Width="76" Margin="6" HorizontalAlignment="Left" VerticalAlignment="Center" |
58 | | - Text="{Binding RaOffsetRate, StringFormat=F5, ConverterCulture={x:Static gl:CultureInfo.CurrentCulture}}" |
59 | | - IsEnabled="{Binding CanChangeOffsetRate}"/> |
60 | | - <Label Grid.Row="2" Grid.Column="2" Content="arc-seconds / hour" HorizontalAlignment="Left" VerticalAlignment="Center" Style="{StaticResource RateLabel}" Margin="6,0"/> |
| 94 | + <GroupBox Grid.Row="3" Grid.Column="0" Header="Change Sidereal Tracking Offsets" HorizontalAlignment="Center" |
| 95 | + Foreground="{DynamicResource NormalTextBrush}"> |
| 96 | + <Grid> |
| 97 | + <Grid.RowDefinitions> |
| 98 | + <RowDefinition Height="Auto" MinHeight="10" /> |
| 99 | + <RowDefinition Height="Auto" MinHeight="10" /> |
| 100 | + <RowDefinition Height="Auto" MinHeight="10" /> |
| 101 | + <RowDefinition Height="Auto" MinHeight="10" /> |
| 102 | + </Grid.RowDefinitions> |
| 103 | + <Grid.ColumnDefinitions> |
| 104 | + <ColumnDefinition Width="Auto" MinWidth="30" /> |
| 105 | + <ColumnDefinition Width="Auto" MinWidth="60" /> |
| 106 | + <ColumnDefinition Width="Auto" MinWidth="90" /> |
| 107 | + <ColumnDefinition Width="Auto" MinWidth="40" /> |
| 108 | + </Grid.ColumnDefinitions> |
61 | 109 |
|
62 | | - <Label Grid.Row="3" Grid.Column="0" Content="Dec Offset Rate:" HorizontalAlignment="Right" VerticalAlignment="Center" |
63 | | - Margin="0,8,4,8" Style="{StaticResource RateLabel}" /> |
64 | | - <local:DoubleEntryBox Grid.Row="3" Grid.Column="1" Height="22" Width="76" Margin="6" HorizontalAlignment="Left" VerticalAlignment="Center" |
65 | | - Text="{Binding DecOffsetRate, StringFormat=F5, ConverterCulture={x:Static gl:CultureInfo.CurrentCulture}}" |
66 | | - IsEnabled="{Binding CanChangeOffsetRate}" /> |
67 | | - <Label Grid.Row="3" Grid.Column="2" Content="arc-seconds / hour" HorizontalAlignment="Left" VerticalAlignment="Center" Style="{StaticResource RateLabel}" Margin="6,0" /> |
| 110 | + <StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" Orientation="Horizontal"> |
| 111 | + <Label Content="Rate Units: " Foreground="{DynamicResource NormalTextBrush}" VerticalAlignment="Center"/> |
| 112 | + <RadioButton Content="ASCOM Units" VerticalAlignment="Center" Foreground="{DynamicResource NormalTextBrush}" |
| 113 | + ToolTip="See the current rates above for ASCOM Units" |
| 114 | + IsChecked="{Binding UseNasaJplUnits, Converter={StaticResource BoolBoolConverter}, ConverterParameter=False}" /> |
| 115 | + <RadioButton Content="JPL Horizons Units" VerticalAlignment="Center" Foreground="{DynamicResource NormalTextBrush}" Margin="8,0,0,0" |
| 116 | + ToolTip="NASA JPL Horizons rate units are arc-seconds per hour" |
| 117 | + IsChecked="{Binding UseNasaJplUnits, Converter={StaticResource BoolBoolConverter}, ConverterParameter=True}" /> |
| 118 | + </StackPanel> |
| 119 | + <Label Grid.Row="1" Grid.Column="0" Content="RA Offset Rate:" HorizontalAlignment="Right" VerticalAlignment="Center" |
| 120 | + Foreground="{DynamicResource NormalTextBrush}" Padding="1" /> |
| 121 | + <local:DoubleEntryBox Grid.Row="1" Grid.Column="1" Height="22" Width="76" Margin="6" HorizontalAlignment="Left" VerticalAlignment="Center" |
| 122 | + Text="{Binding NewRaOffsetRate, StringFormat=F7, ConverterCulture={x:Static gl:CultureInfo.CurrentCulture}}" /> |
| 123 | + <Button Grid.Row="1" Grid.Column="3" Grid.RowSpan="2" Height="80" Width="80" Style="{StaticResource CircleButton}" |
| 124 | + Command="{Binding CommitNewRatesCommand}"> |
| 125 | + <Button.Content> |
| 126 | + <TextBlock TextWrapping="Wrap" TextAlignment="Center" Text="Send To Telescope" /> |
| 127 | + </Button.Content> |
| 128 | + </Button> |
68 | 129 |
|
69 | | - <Label Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="3" Margin="6" Foreground="{DynamicResource NormalTextBrush}"> |
70 | | - <Label.Content> |
71 | | - <TextBlock TextWrapping="Wrap"> |
72 | | - Rate units of arc-seconds/hour were chosen to coincide with the<LineBreak/> |
73 | | - rate values that are provided by the NASA JPL Horizons web site. |
74 | | - </TextBlock> |
75 | | - </Label.Content> |
76 | | - </Label> |
| 130 | + <Label Grid.Row="1" Grid.Column="2" HorizontalAlignment="Left" VerticalAlignment="Center" Padding="2" MinWidth="140" |
| 131 | + Foreground="{DynamicResource NormalTextBrush}"> |
| 132 | + <Label.Content> |
| 133 | + <MultiBinding Converter="{StaticResource UnitsConverter}"> |
| 134 | + <Binding Path="UseNasaJplUnits" /> |
| 135 | + <Binding Path="NasaJplRaUnits" /> |
| 136 | + <Binding Path="AscomRaUnits" /> |
| 137 | + </MultiBinding> |
| 138 | + </Label.Content> |
| 139 | + </Label> |
| 140 | + <Label Grid.Row="2" Grid.Column="0" Content="Dec Offset Rate:" HorizontalAlignment="Right" VerticalAlignment="Center" |
| 141 | + Foreground="{DynamicResource NormalTextBrush}" Padding="1" /> |
| 142 | + <local:DoubleEntryBox Grid.Row="2" Grid.Column="1" Height="22" Width="76" Margin="6" HorizontalAlignment="Left" VerticalAlignment="Center" |
| 143 | + Text="{Binding NewDecOffsetRate, StringFormat=F7, ConverterCulture={x:Static gl:CultureInfo.CurrentCulture}}" /> |
| 144 | + <Label Grid.Row="2" Grid.Column="2" HorizontalAlignment="Left" VerticalAlignment="Center" Padding="2" MinWidth="140" |
| 145 | + Foreground="{DynamicResource NormalTextBrush}"> |
| 146 | + <Label.Content> |
| 147 | + <MultiBinding Converter="{StaticResource UnitsConverter}"> |
| 148 | + <Binding Path="UseNasaJplUnits" /> |
| 149 | + <Binding Path="NasaJplDecUnits" /> |
| 150 | + <Binding Path="AscomDecUnits" /> |
| 151 | + </MultiBinding> |
| 152 | + </Label.Content> |
| 153 | + </Label> |
| 154 | + </Grid> |
| 155 | + </GroupBox> |
77 | 156 | </Grid> |
78 | 157 | </UserControl> |
0 commit comments