-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainPage.xaml
178 lines (149 loc) · 13.2 KB
/
MainPage.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
<Page
x:Class="T41_UI.Views.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:i1="using:T41_UI.Views"
mc:Ignorable="d">
<Canvas x:Name="ContentArea" Background="Black" Height="720" Width="1200" HorizontalAlignment="Right" VerticalAlignment="Top">
<Canvas.Resources>
<i1:FreqFormatter x:Key="FreqConverter" />
<i1:BandFormatter x:Key="BandConverter" />
<i1:ModeFormatter x:Key="ModeConverter" />
<i1:DemodFormatter x:Key="DemodConverter" />
<i1:PwrFormatter x:Key="PwrConverter" />
<i1:NfFlagColorFormatter x:Key="NfFlagColorConverter" />
<i1:NfFlagTextFormatter x:Key="NfFlagTextConverter" />
<i1:AgcFormatter x:Key="AgcConverter" />
</Canvas.Resources>
<!-- T41 related controls -->
<StackPanel Orientation="Horizontal" >
<StackPanel Orientation="Vertical" Padding="2,0,10,0">
<Rectangle x:Name="menu" Height="42" Stroke="Black" Width="768" />
<StackPanel Orientation="Horizontal" >
<!-- VFO A -->
<Canvas Height="75" Width="{x:Bind FREQUENCY_W_ACTIVE}" >
<!-- *** TODO: try to bind this to t41.CurrentFreqA *** -->
<TextBlock x:Name="vfoAFreq" Text="{Binding Path=CurrentFreqA, Mode=TwoWay, Converter={StaticResource FreqConverter}}" Foreground="Lime" FontSize="{x:Bind FREQ_FONT_ACTIVE}" FontFamily="Courier New" CharacterSpacing="-100"/> <!-- FreqConverter defaulst to using a decimal point as a separator, use ConverterParameter to specify a separator, for example , add "ConverterParameter=\," without quotes to use a comma as the separator -->
<Button x:Name="vfoAFreqButton" Height="75" Width="{x:Bind FREQUENCY_W_ACTIVE}" Click="vfoAFreq_Click" PointerWheelChanged="vfoAFreq_PointerWheelChanged" RightTapped="vfoAFreq_RightTapped" Background="Transparent"/>
</Canvas>
<!-- VFO B -->
<Canvas Height="75" Width="{x:Bind FREQUENCY_W_ACTIVE}" >
<!-- *** TODO: try to bind this to t41.CurrentFreqA *** -->
<TextBlock x:Name="vfoBFreq" Text="{Binding Path=CurrentFreqB, Mode=TwoWay, Converter={StaticResource FreqConverter}}" Foreground="White" FontSize="{x:Bind FREQ_FONT_INACTIVE}" FontFamily="Courier New" CharacterSpacing="-100"/>
<Button x:Name="vfoBFreqButton" Height="75" Width="{x:Bind FREQUENCY_W_INACTIVE}" Click="vfoBFreq_Click" PointerWheelChanged="vfoBFreq_PointerWheelChanged" RightTapped="vfoBFreq_RightTapped" Background="Transparent" />
</Canvas>
</StackPanel>
<!-- Operating Stats -->
<Grid x:Name="op_stats" Width="768" ColumnDefinitions="Auto,*,*,*,*,*">
<TextBlock Text="Center Freq" Grid.Column="0" FontSize="20" Foreground="White"/>
<TextBlock Text="{x:Bind t41.CenterFreq, Mode=TwoWay}" Grid.Column="1" Padding="4,0,0,0" FontSize="20" Foreground="Orange"/>
<Button x:Name="centerFreqButton" Click="centerFreq_Click" Height="30" Width="130" Grid.Column="1" Background="Transparent"/>
<TextBlock x:Name="band" Text="{Binding Path=CurrentBand, Mode=TwoWay, Converter={StaticResource BandConverter}}" Grid.Column="2" FontSize="20" Foreground="Orange" PointerWheelChanged="band_PointerWheelChanged"/>
<!-- <Button x:Name="bandButton" Click="band_Click" Height="30" Width="50" Grid.Column="2" Background="Transparent" PointerWheelChanged="band_PointerWheelChanged"/> -->
<TextBlock x:Name="mode" Text="{Binding Path=XmtMode, Mode=TwoWay, Converter={StaticResource ModeConverter}}" Grid.Column="3" FontSize="20" Foreground="Lime" PointerWheelChanged="mode_PointerWheelChanged"/>
<TextBlock x:Name="demod" Text="{Binding Path=CurrentDemod, Mode=TwoWay, Converter={StaticResource DemodConverter}}" Grid.Column="4" FontSize="20" Foreground="White" PointerWheelChanged="demod_PointerWheelChanged"/>
<TextBlock x:Name="pwr" Text="{Binding Path=TransmitPowerLevel, Mode=TwoWay, Converter={StaticResource PwrConverter}}" Grid.Column="5" FontSize="20" Foreground="Red"/>
<Button Click="pwr_Click" RightTapped="pwr_RightTapped" Height="30" Width="130" Grid.Column="5" Background="Transparent" PointerWheelChanged="pwr_PointerWheelChanged"/>
</Grid>
<!-- Frequency Spectrum -->
<Border Height="225" Width="772" BorderBrush="Yellow" BorderThickness="2">
<Canvas x:Name="freqSpectrum" Height="221" Width="768">
<StackPanel Orientation="Horizontal">
<!-- dB scale -->
<TextBlock Text="10dB" Padding="0,0,260,0" FontSize="20" Foreground="White"/>
<!-- Bandwidth Bar Values -->
<TextBlock Text="{Binding Path=BwValueLeft, Mode=TwoWay}" Padding="0,0,20,0" FontSize="20" Foreground="Lime"/>
<TextBlock Text="{Binding Path=BwValueRight, Mode=TwoWay}" FontSize="20" Foreground="White"/>
</StackPanel>
<!-- Bandwidth Bar -->
<Rectangle Canvas.Left="{Binding Path=BwLeft, Mode=TwoWay}" Height="195" Width="{Binding Path=BwWidth, Mode=TwoWay}" Canvas.Top="25" Fill="RoyalBlue" />
<Line X1="{Binding Path=BwLine, Mode=TwoWay}" X2="{Binding Path=BwLine, Mode=TwoWay}" Y1="25" Y2="220" Stroke="White"/>
</Canvas>
</Border>
<Grid Width="768" ColumnDefinitions="*,*,*,*,*">
<TextBlock x:Name="freq1" Grid.Column="0" Text="" HorizontalAlignment="Left" FontSize="20" Foreground="White"/>
<TextBlock x:Name="freq2" Grid.Column="1" Text="" HorizontalAlignment="Left" Padding="20,0,0,0" FontSize="20" Foreground="White"/>
<TextBlock x:Name="freq3" Grid.Column="2" Text="" HorizontalAlignment="Center" FontSize="20" Foreground="White"/>
<TextBlock x:Name="freq4" Grid.Column="3" Text="" HorizontalAlignment="Right" Padding="0,0,20,0" FontSize="20" Foreground="White"/>
<TextBlock x:Name="freq5" Grid.Column="4" Text="" HorizontalAlignment="Right" FontSize="20" Foreground="White"/>
</Grid>
<!-- Waterfall -->
<Canvas Height="450" Width="768">
<!--<Image x:Name="wfImage" Source="{Binding WFImage}" Height="1" Width="512"/>-->
<i1:Waterfall x:Name="waterfall" Width="768">
</i1:Waterfall>
</Canvas>
</StackPanel>
<StackPanel Orientation="Vertical">
<!-- Name, Version -->
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right"> <!-- BorderBrush="White" BorderThickness="2" -->
<TextBlock x:Name="name" Text="T41-EP SDT" Padding="0,0,5,0" FontSize="38" Foreground="Yellow"/>
<TextBlock x:Name="version" Text="sdr_dev.1" FontSize="20" Foreground="Lime"/>
</StackPanel>
<!-- Clock -->
<TextBlock x:Name="clock" Text="{Binding Path=Clock, Mode=OneWay}" Margin="0,-15,10,0" FontSize="38" Foreground="White" HorizontalAlignment="Right"/>
<StackPanel Orientation="Horizontal" Padding="0,10,0,0">
<TextBlock Text="S 1 3 5 7 9 +20dB" Padding="0,0,30,0" FontSize="20" Foreground="White" VerticalAlignment="Bottom"/>
<!-- XMIT Box -->
<Canvas Height="40">
<Rectangle x:Name="xmitBox" Stroke="Lime" Height="40" Width="80" Fill="Lime"/>
<TextBlock x:Name="xmit" Text="REC" FontSize="38" Height="42" Width="80" Foreground="Black" Margin="5,-7,0,0"/>
</Canvas>
</StackPanel>
<!-- S-Meter -->
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Padding="0,10,0,10">
<Border Height="27" Width="288" BorderBrush="Yellow" BorderThickness="2">
<Canvas x:Name="sMeter" Height="177" Width="430">
<!--<Line X1="2" X2="{x:Bind t41.SMeter, Mode=TwoWay}" Y1="12" Y2="12" Stroke="Red" StrokeThickness="20"/>-->
<Rectangle Margin="0,2,0,0" Height="20" Width="{x:Bind t41.SMeter, Mode=TwoWay}" Fill="Red" />
</Canvas>
</Border>
<TextBlock x:Name="dBm" Text="{x:Bind t41.Dbm, Mode=TwoWay}" Width="60" FontSize="20" Foreground="White"/>
<TextBlock x:Name="dBmLabel" Text="dBm" FontSize="20" Foreground="Lime"/>
</StackPanel>
<!-- Audio Spectrum -->
<Border Height="176" Width="409" BorderBrush="White" BorderThickness="2">
<Canvas x:Name="audioSpectrum" Height="172" Width="405">
</Canvas>
</Border>
<!-- *** TODO: use grid for this *** -->
<TextBlock Text="0k 1k 2k 3k 4k 5k 6k" Padding="0,0,0,10" FontSize="20" Foreground="White"/>
<!-- Info Box -->
<Grid Height="320" Width="408" ColumnDefinitions="Auto,*,*,*" RowDefinitions="Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto" BorderBrush="White" BorderThickness="2">
<TextBlock Text="Vol:" Padding="0,0,5,0" Grid.Column="0" Grid.Row="0" HorizontalAlignment="Right" FontSize="48" Foreground="White" />
<TextBlock x:Name="audioVolControl" Text="{x:Bind t41.AudioVolume, Mode=TwoWay}" Grid.Column="1" Grid.Row="0" HorizontalAlignment="Left" FontSize="48" Foreground="Lime" PointerWheelChanged="audioVolControl_PointerWheelChanged" />
<TextBlock Text="AGC" Grid.Column="2" Grid.Row="0" HorizontalAlignment="Right" FontSize="48" Foreground="White"/>
<TextBlock x:Name="agcControl" Text="{Binding Path=AGCMode, Mode=TwoWay, Converter={StaticResource AgcConverter}}" Padding="5,0,0,0" Grid.Column="3" Grid.Row="0" HorizontalAlignment="Left" FontSize="48" Foreground="Lime" PointerWheelChanged="agc_PointerWheelChanged"/>
<TextBlock x:Name="freqIncControl" Text="Increment:" Padding="0,0,5,0" Grid.Column="0" Grid.Row="1" HorizontalAlignment="Right" FontSize="20" Foreground="White"/>
<Button Height="30" Click="freqIncrement_Click" Width="130" Grid.Column="0" Grid.Row="1" Background="Transparent"/>
<TextBlock Text="{x:Bind t41.FreqIncrement, Mode=TwoWay}" Width="130" Grid.Column="1" Grid.Row="1" HorizontalAlignment="Left" FontSize="20" Foreground="Lime" PointerWheelChanged="freqIncrement_PointerWheelChanged" />
<TextBlock x:Name="ftIncControl" Text="FT Inc:" Padding="0,0,5,0" Grid.Column="2" Grid.Row="1" HorizontalAlignment="Right" FontSize="20" Foreground="Lime"/>
<Button Height="30" Click="ftIncrement_Click" Width="130" Grid.Column="2" Grid.Row="1" Background="Transparent"/>
<TextBlock Text="{x:Bind t41.FtIncrement, Mode=TwoWay}" Width="130" Grid.Column="3" Grid.Row="1" HorizontalAlignment="Left" FontSize="20" Foreground="Lime" PointerWheelChanged="ftIncrement_PointerWheelChanged" />
<TextBlock Text="Zoom:" Padding="0,0,5,0" Grid.Column="0" Grid.Row="2" HorizontalAlignment="Right" FontSize="20" Foreground="White"/>
<TextBlock Text="2x" Grid.Column="1" Grid.Row="2" HorizontalAlignment="Left" FontSize="20" Foreground="Lime" />
<TextBlock Text="NF Set:" Padding="0,0,5,0" Grid.Column="2" Grid.Row="2" HorizontalAlignment="Right" FontSize="20" Foreground="White"/>
<TextBlock Text="{Binding Path=LiveNoiseFloorFlag, Mode=TwoWay, Converter={StaticResource NfFlagTextConverter}}" Grid.Column="3" Grid.Row="2" HorizontalAlignment="Left" FontSize="20" Foreground="{Binding Path=LiveNoiseFloorFlag, Mode=TwoWay, Converter={StaticResource NfFlagColorConverter}}"/>
<Button Height="30" Click="nfSet_Click" Width="130" Grid.Column="2" Grid.Row="2" Grid.ColumnSpan="2" Background="Transparent" PointerWheelChanged="freqSpectrum_PointerWheelChanged"/>
<TextBlock Text="Decoder:" Padding="0,0,5,0" Grid.Column="0" Grid.Row="3" HorizontalAlignment="Right" FontSize="20" Foreground="White"/>
<TextBlock Text="Off" Grid.Column="1" Grid.Row="3" HorizontalAlignment="Left" FontSize="20" Foreground="White" />
<TextBlock Text="Stack:" Padding="0,0,5,0" Grid.Column="0" Grid.Row="4" HorizontalAlignment="Right" FontSize="20" Foreground="White"/>
<TextBlock Text="71k" Grid.Column="1" Grid.Row="4" HorizontalAlignment="Left" FontSize="20" Foreground="Lime" />
<TextBlock Text="Heap:" Padding="0,0,5,0" Grid.Column="2" Grid.Row="4" HorizontalAlignment="Right" FontSize="20" Foreground="White"/>
<TextBlock Text="152k" Grid.Column="3" Grid.Row="4" HorizontalAlignment="Left" FontSize="20" Foreground="Lime" />
<TextBlock Text="Temp:" Padding="0,0,5,0" Grid.Column="0" Grid.Row="5" HorizontalAlignment="Right" FontSize="20" Foreground="White"/>
<TextBlock Text="46°" Grid.Column="1" Grid.Row="5" HorizontalAlignment="Left" FontSize="20" Foreground="Lime" />
<TextBlock Text="Load:" Padding="0,0,5,0" Grid.Column="2" Grid.Row="5" HorizontalAlignment="Right" FontSize="20" Foreground="White"/>
<TextBlock Text="29%" Grid.Column="3" Grid.Row="5" HorizontalAlignment="Left" FontSize="20" Foreground="Lime" />
</Grid>
</StackPanel>
</StackPanel>
<!-- Serial related controls -->
<StackPanel Orientation="Horizontal" >
<ComboBox x:Name="serialPortComboBox" DropDownOpened="serialPort_ComboBoxOpened" SelectionChanged="serialPort_ComboBoxSelectionChanged" PlaceholderText="Select Port" Width="200" />
</StackPanel>
<Button x:Name="wfStartPauseButton" Click="data_Click" Content="Start" Height="30" Canvas.Top="690"/>
</Canvas>
</Page>