-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainWindow.xaml
262 lines (251 loc) · 22.4 KB
/
MainWindow.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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
<Window x:Class="NITHtester.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Title="NITHtester" WindowStyle="SingleBorderWindow" ResizeMode="CanResize"
WindowStartupLocation="CenterScreen" WindowState="Maximized" Width="1500" Height="1600" Loaded="Window_Loaded">
<Grid Background="#222222">
<ScrollViewer Margin="0,0,0,0">
<StackPanel Margin="10,10,10,10" Background="#222222" Orientation="Vertical">
<!-- Sensor port -->
<StackPanel Orientation="Horizontal">
<Label Grid.Row="0" Grid.Column="0" Content="Sensor port:" HorizontalAlignment="Left" Style="{StaticResource EntryLabel}" />
<StackPanel Grid.Row="0" Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Left" Height="30">
<!-- Connection selector -->
<StackPanel Orientation="Vertical" Margin="0,0,30,0">
<RadioButton Name="rbtUSB" Content="USB" Foreground="White" IsChecked="True" Checked="rbtUSB_Checked" GroupName="PortType" />
<RadioButton Name="rbtUDP" Content="UDP" Foreground="White" IsChecked="False" Checked="rbtUDP_Checked" GroupName="PortType" />
</StackPanel>
<!-- USB port -->
<Label Style="{StaticResource EntryLabel}" Width="70" Content="USB port:" />
<Button x:Name="btnUSBPortMinus" Content="-" Width="40" HorizontalAlignment="Left" Click="btnUSBPortMinus_Click" />
<Border Style="{StaticResource BlackBorder}" Width="40" Margin="5,0,5,0">
<TextBlock Name="txtUSBPort" Style="{StaticResource WhiteText}" Width="40" TextAlignment="Center" HorizontalAlignment="Center" VerticalAlignment="Center" FontFamily="Bold" />
</Border>
<Button x:Name="btnUSBPortPlus" Content="+" Width="40" HorizontalAlignment="Left" Click="btnUSBPortPlus_Click" />
<Button Name="btnUSBPortScan" Content="Scan" Width="50" Margin="20,0,0,0" Click="btnUSBPortScan_Click" />
<!-- UDP port -->
<Label Style="{StaticResource EntryLabel}" Margin="20,0,0,0" Width="70" Content="UDP port:" Foreground="White" />
<Border Style="{StaticResource BlackBorder}" Width="50" Margin="5,0,5,0">
<TextBox x:Name="txtUDPPort" Text=" " Style="{StaticResource WhiteTextBlackBox}" TextAlignment="Center" HorizontalAlignment="Center" VerticalAlignment="Center" FontFamily="Bold" TextChanged="TxtUDPPort_OnTextChanged" />
</Border>
<!-- Connect/Disconnect -->
<Button x:Name="btnConnect" Content="Connect/Disconnect" Width="120" Margin="40,0,0,0" Click="btnConnect_Click" />
<Ellipse x:Name="indConnection" Width="20" Height="20" Stroke="White" StrokeThickness="2" Fill="DarkRed" Margin="10,0,0,0">
<Ellipse.Clip>
<EllipseGeometry RadiusX="40" RadiusY="40" Center="20,20" />
</Ellipse.Clip>
</Ellipse>
<!-- Pause -->
<Button x:Name="btnPause" Content="Pause" Width="80" Margin="40,0,0,0" Click="btnPause_Click" />
</StackPanel>
</StackPanel>
<!-- Sensor name -->
<DockPanel LastChildFill="True">
<Label Style="{StaticResource EntryLabel}" Content="Sensor name:" HorizontalAlignment="Left" />
<Border Style="{StaticResource BlackBorder}">
<TextBlock Style="{StaticResource WhiteText}" x:Name="txtSensorName" />
</Border>
</DockPanel>
<!-- Sensor version -->
<DockPanel LastChildFill="True">
<Label Style="{StaticResource EntryLabel}" Content="Sensor version:" HorizontalAlignment="Left" />
<Border Style="{StaticResource BlackBorder}">
<TextBlock Style="{StaticResource WhiteText}" Name="txtSensorVersion" HorizontalAlignment="Left" />
</Border>
</DockPanel>
<!-- OPcode -->
<DockPanel LastChildFill="True">
<Label Style="{StaticResource EntryLabel}" Content="Status code:" HorizontalAlignment="Left" />
<Border Style="{StaticResource BlackBorder}">
<TextBlock Style="{StaticResource WhiteText}" Name="txtStatusCode" HorizontalAlignment="Left" />
</Border>
</DockPanel>
<!-- Extra Data -->
<DockPanel LastChildFill="True">
<Label Style="{StaticResource EntryLabel}" Content="Extra data (optional):" HorizontalAlignment="Left" />
<Border Style="{StaticResource BlackBorder}">
<TextBlock Style="{StaticResource WhiteText}" Name="txtExtraData" HorizontalAlignment="Left" />
</Border>
</DockPanel>
<!-- Arguments -->
<DockPanel LastChildFill="True">
<Label Style="{StaticResource EntryLabel}" Content="Parameters and values:" HorizontalAlignment="Left" />
<Border Style="{StaticResource BlackBorder}">
<TextBox Style="{StaticResource WhiteTextBlackBox}" Name="txtParametersAndValues" Height="300" HorizontalAlignment="Left" TextWrapping="Wrap" AcceptsReturn="True" VerticalScrollBarVisibility="Auto" />
</Border>
</DockPanel>
<!-- Errors -->
<DockPanel LastChildFill="True">
<Label Style="{StaticResource EntryLabel}" Content="Errors list:" HorizontalAlignment="Left" />
<Border Style="{StaticResource BlackBorder}">
<TextBox Style="{StaticResource WhiteTextBlackBox}" Name="txtErrors" Height="100" HorizontalAlignment="Left" TextWrapping="Wrap" AcceptsReturn="True" VerticalScrollBarVisibility="Auto" />
</Border>
</DockPanel>
<!-- Raw strings -->
<DockPanel LastChildFill="True">
<Label Style="{StaticResource EntryLabel}" Content="Raw strings:" HorizontalAlignment="Left" />
<Border Style="{StaticResource BlackBorder}">
<TextBox Style="{StaticResource WhiteTextBlackBox}" Name="txtRawStrings" Height="100" HorizontalAlignment="Left" TextWrapping="Wrap" AcceptsReturn="True" VerticalScrollBarVisibility="Auto" />
</Border>
</DockPanel>
<!-- Bindable gauges -->
<StackPanel Orientation="Vertical">
<!-- Gauge 1 -->
<StackPanel Orientation="Horizontal">
<Label Style="{StaticResource EntryLabel}" Content="Bindable gauge 1:" HorizontalAlignment="Left" />
<ProgressBar Name="prbGauge1" Background="Black" Foreground="White" BorderThickness="0" Orientation="Horizontal" Maximum="100" Minimum="0" Width="360" />
<Label Style="{StaticResource EntryLabel}" Content="Arg:" Width="50" HorizontalAlignment="Left" HorizontalContentAlignment="Center" />
<ComboBox Name="lstGauge1" Width="100" />
<Label Style="{StaticResource EntryLabel}" Content="Min:" Width="50" HorizontalAlignment="Left" HorizontalContentAlignment="Center" />
<TextBox Name="txtMinGauge1" Style="{StaticResource WhiteTextBlackBox}" Width="50" />
<Label Style="{StaticResource EntryLabel}" Content="Max:" Width="50" HorizontalAlignment="Left" HorizontalContentAlignment="Center" />
<TextBox Name="txtMaxGauge1" Style="{StaticResource WhiteTextBlackBox}" Width="50" />
<Label Style="{StaticResource EntryLabel}" Content="Offset:" Width="50" HorizontalAlignment="Left" HorizontalContentAlignment="Center" />
<TextBox Name="txtOffGauge1" Style="{StaticResource WhiteTextBlackBox}" Width="50" />
<Label Style="{StaticResource EntryLabel}" Content="Prop.:" Width="50" HorizontalAlignment="Left" HorizontalContentAlignment="Center" />
<CheckBox Name="chkProp1" VerticalAlignment="Center" Width="Auto" />
<Label Style="{StaticResource EntryLabel}" Content="Filter Alpha:" Width="70" HorizontalAlignment="Left" HorizontalContentAlignment="Center" />
<TextBox Name="txtFilterAlpha1" Style="{StaticResource WhiteTextBlackBox}" Width="50" />
</StackPanel>
<!-- Gauge 2 -->
<StackPanel Orientation="Horizontal">
<Label Style="{StaticResource EntryLabel}" Content="Bindable gauge 2:" HorizontalAlignment="Left" />
<ProgressBar Name="prbGauge2" Background="Black" Foreground="White" BorderThickness="0" Orientation="Horizontal" Maximum="100" Minimum="0" Width="360" />
<Label Style="{StaticResource EntryLabel}" Content="Arg:" Width="50" HorizontalAlignment="Left" HorizontalContentAlignment="Center" />
<ComboBox Name="lstGauge2" Width="100" />
<Label Style="{StaticResource EntryLabel}" Content="Min:" Width="50" HorizontalAlignment="Left" HorizontalContentAlignment="Center" />
<TextBox Name="txtMinGauge2" Style="{StaticResource WhiteTextBlackBox}" Width="50" />
<Label Style="{StaticResource EntryLabel}" Content="Max:" Width="50" HorizontalAlignment="Left" HorizontalContentAlignment="Center" />
<TextBox Name="txtMaxGauge2" Style="{StaticResource WhiteTextBlackBox}" Width="50" />
<Label Style="{StaticResource EntryLabel}" Content="Offset:" Width="50" HorizontalAlignment="Left" HorizontalContentAlignment="Center" />
<TextBox Name="txtOffGauge2" Style="{StaticResource WhiteTextBlackBox}" Width="50" />
<Label Style="{StaticResource EntryLabel}" Content="Prop.:" Width="50" HorizontalAlignment="Left" HorizontalContentAlignment="Center" />
<CheckBox Name="chkProp2" VerticalAlignment="Center" Width="Auto" />
<Label Style="{StaticResource EntryLabel}" Content="Filter Alpha:" Width="70" HorizontalAlignment="Left" HorizontalContentAlignment="Center" />
<TextBox Name="txtFilterAlpha2" Style="{StaticResource WhiteTextBlackBox}" Width="50" />
</StackPanel>
<!-- Gauge 3 -->
<StackPanel Orientation="Horizontal">
<Label Style="{StaticResource EntryLabel}" Content="Bindable gauge 3:" HorizontalAlignment="Left" />
<ProgressBar Name="prbGauge3" Background="Black" Foreground="White" BorderThickness="0" Orientation="Horizontal" Maximum="100" Minimum="0" Width="360" />
<Label Style="{StaticResource EntryLabel}" Content="Arg:" Width="50" HorizontalAlignment="Left" HorizontalContentAlignment="Center" />
<ComboBox Name="lstGauge3" Width="100" />
<Label Style="{StaticResource EntryLabel}" Content="Min:" Width="50" HorizontalAlignment="Left" HorizontalContentAlignment="Center" />
<TextBox Name="txtMinGauge3" Style="{StaticResource WhiteTextBlackBox}" Width="50" />
<Label Style="{StaticResource EntryLabel}" Content="Max:" Width="50" HorizontalAlignment="Left" HorizontalContentAlignment="Center" />
<TextBox Name="txtMaxGauge3" Style="{StaticResource WhiteTextBlackBox}" Width="50" />
<Label Style="{StaticResource EntryLabel}" Content="Offset:" Width="50" HorizontalAlignment="Left" HorizontalContentAlignment="Center" />
<TextBox Name="txtOffGauge3" Style="{StaticResource WhiteTextBlackBox}" Width="50" />
<Label Style="{StaticResource EntryLabel}" Content="Prop.:" Width="50" HorizontalAlignment="Left" HorizontalContentAlignment="Center" />
<CheckBox Name="chkProp3" VerticalAlignment="Center" Width="Auto" />
<Label Style="{StaticResource EntryLabel}" Content="Filter Alpha:" Width="70" HorizontalAlignment="Left" HorizontalContentAlignment="Center" />
<TextBox Name="txtFilterAlpha3" Style="{StaticResource WhiteTextBlackBox}" Width="50" />
</StackPanel>
<!-- Gauge 4 -->
<StackPanel Orientation="Horizontal">
<Label Style="{StaticResource EntryLabel}" Content="Bindable gauge 4:" HorizontalAlignment="Left" />
<ProgressBar Name="prbGauge4" Background="Black" Foreground="White" BorderThickness="0" Orientation="Horizontal" Maximum="100" Minimum="0" Width="360" />
<Label Style="{StaticResource EntryLabel}" Content="Arg:" Width="50" HorizontalAlignment="Left" HorizontalContentAlignment="Center" />
<ComboBox Name="lstGauge4" Width="100" />
<Label Style="{StaticResource EntryLabel}" Content="Min:" Width="50" HorizontalAlignment="Left" HorizontalContentAlignment="Center" />
<TextBox Name="txtMinGauge4" Style="{StaticResource WhiteTextBlackBox}" Width="50" />
<Label Style="{StaticResource EntryLabel}" Content="Max:" Width="50" HorizontalAlignment="Left" HorizontalContentAlignment="Center" />
<TextBox Name="txtMaxGauge4" Style="{StaticResource WhiteTextBlackBox}" Width="50" />
<Label Style="{StaticResource EntryLabel}" Content="Offset:" Width="50" HorizontalAlignment="Left" HorizontalContentAlignment="Center" />
<TextBox Name="txtOffGauge4" Style="{StaticResource WhiteTextBlackBox}" Width="50" />
<Label Style="{StaticResource EntryLabel}" Content="Prop.:" Width="50" HorizontalAlignment="Left" HorizontalContentAlignment="Center" />
<CheckBox Name="chkProp4" VerticalAlignment="Center" Width="Auto" />
<Label Style="{StaticResource EntryLabel}" Content="Filter Alpha:" Width="70" HorizontalAlignment="Left" HorizontalContentAlignment="Center" />
<TextBox Name="txtFilterAlpha4" Style="{StaticResource WhiteTextBlackBox}" Width="50" />
</StackPanel>
<!-- Gauge 5 -->
<StackPanel Orientation="Horizontal">
<Label Style="{StaticResource EntryLabel}" Content="Bindable gauge 5:" HorizontalAlignment="Left" />
<ProgressBar Name="prbGauge5" Background="Black" Foreground="White" BorderThickness="0" Orientation="Horizontal" Maximum="100" Minimum="0" Width="360" />
<Label Style="{StaticResource EntryLabel}" Content="Arg:" Width="50" HorizontalAlignment="Left" HorizontalContentAlignment="Center" />
<ComboBox Name="lstGauge5" Width="100" />
<Label Style="{StaticResource EntryLabel}" Content="Min:" Width="50" HorizontalAlignment="Left" HorizontalContentAlignment="Center" />
<TextBox Name="txtMinGauge5" Style="{StaticResource WhiteTextBlackBox}" Width="50" />
<Label Style="{StaticResource EntryLabel}" Content="Max:" Width="50" HorizontalAlignment="Left" HorizontalContentAlignment="Center" />
<TextBox Name="txtMaxGauge5" Style="{StaticResource WhiteTextBlackBox}" Width="50" />
<Label Style="{StaticResource EntryLabel}" Content="Offset:" Width="50" HorizontalAlignment="Left" HorizontalContentAlignment="Center" />
<TextBox Name="txtOffGauge5" Style="{StaticResource WhiteTextBlackBox}" Width="50" />
<Label Style="{StaticResource EntryLabel}" Content="Prop.:" Width="50" HorizontalAlignment="Left" HorizontalContentAlignment="Center" />
<CheckBox Name="chkProp5" VerticalAlignment="Center" Width="Auto" />
<Label Style="{StaticResource EntryLabel}" Content="Filter Alpha:" Width="70" HorizontalAlignment="Left" HorizontalContentAlignment="Center" />
<TextBox Name="txtFilterAlpha5" Style="{StaticResource WhiteTextBlackBox}" Width="50" />
</StackPanel>
</StackPanel>
<!-- Headtracker debugger -->
<StackPanel Orientation="Horizontal">
<Label Style="{StaticResource EntryLabel}" Content="HeadTracker tester:" HorizontalAlignment="Left" />
<Canvas x:Name="cnvHeadTrackerPlot" Background="Black" Width="360" Height="360">
<Ellipse x:Name="dotPitchRoll" Fill="Green" Width="15" Height="15" />
<Ellipse x:Name="dotPitchYaw" Fill="White" Width="15" Height="15" />
</Canvas>
<StackPanel Orientation="Vertical">
<!-- Enabled -->
<StackPanel Orientation="Horizontal">
<Label Style="{StaticResource EntryLabel}" Content="Enabled:" Width="100" Margin="10,0,0,0" HorizontalAlignment="Left" HorizontalContentAlignment="Left" />
<CheckBox Name="chkHTenabled" VerticalAlignment="Center" Width="Auto" />
</StackPanel>
<!-- Argument bind -->
<StackPanel Orientation="Horizontal">
<Label Style="{StaticResource EntryLabel}" Content="Parameter bind:" Width="100" Margin="10,0,0,0" HorizontalAlignment="Left" HorizontalContentAlignment="Left" />
<ComboBox Name="cbxHTargBind" Width="100" />
</StackPanel>
<!-- Yaw multiplier -->
<StackPanel Orientation="Horizontal">
<Label Style="{StaticResource EntryLabel}" Content="Yaw multiplier:" Width="100" Margin="10,0,0,0" HorizontalAlignment="Left" HorizontalContentAlignment="Left" />
<TextBox Name="txtHTyawMultiplier" Style="{StaticResource WhiteTextBlackBox}" Width="100" />
</StackPanel>
<!-- Pitch multiplier -->
<StackPanel Orientation="Horizontal">
<Label Style="{StaticResource EntryLabel}" Content="Pitch multiplier:" Width="100" Margin="10,0,0,0" HorizontalAlignment="Left" HorizontalContentAlignment="Left" />
<TextBox Name="txtHTpitchMultiplier" Style="{StaticResource WhiteTextBlackBox}" Width="100" />
</StackPanel>
<!-- Roll multiplier -->
<StackPanel Orientation="Horizontal">
<Label Style="{StaticResource EntryLabel}" Content="Roll multiplier:" Width="100" Margin="10,0,0,0" HorizontalAlignment="Left" HorizontalContentAlignment="Left" />
<TextBox Name="txtHTrollMultiplier" Style="{StaticResource WhiteTextBlackBox}" Width="100" />
</StackPanel>
<!-- Calibrate center -->
<StackPanel Orientation="Horizontal">
<Label Style="{StaticResource EntryLabel}" Content="Calibrate:" Width="100" Margin="10,0,0,0" HorizontalAlignment="Left" HorizontalContentAlignment="Left" />
<Button Name="btnHTcalibrate" Content="Set Center" Width="100" />
</StackPanel>
<!-- Filter -->
<StackPanel Orientation="Horizontal">
<Label Style="{StaticResource EntryLabel}" Content="Filter alpha:" Width="100" Margin="10,0,0,0" HorizontalAlignment="Left" HorizontalContentAlignment="Left" />
<TextBox Name="txtHTfilterAlpha" Style="{StaticResource WhiteTextBlackBox}" Width="100" />
</StackPanel>
<!-- Raw position -->
<StackPanel Orientation="Horizontal">
<Label Style="{StaticResource EntryLabel}" Content="Raw Pos.:" Width="100" Margin="10,0,0,0" HorizontalAlignment="Left" HorizontalContentAlignment="Left" />
<Border Style="{StaticResource BlackBorder}">
<TextBlock Style="{StaticResource WhiteText}" Name="txtHTrawPosition" Height="Auto" Width="100" HorizontalAlignment="Center" TextWrapping="Wrap" xml:space="preserve" Text="Y: P: R:" />
</Border>
</StackPanel>
<!-- Raw acceleration -->
<StackPanel Orientation="Horizontal">
<Label Style="{StaticResource EntryLabel}" Content="Raw Accel.:" Width="100" Margin="10,0,0,0" HorizontalAlignment="Left" HorizontalContentAlignment="Left" />
<Border Style="{StaticResource BlackBorder}">
<TextBlock Style="{StaticResource WhiteText}" Name="txtHTrawAccel" Height="Auto" Width="100" HorizontalAlignment="Center" TextWrapping="Wrap" xml:space="preserve" Text="Y: P: R:" />
</Border>
</StackPanel>
</StackPanel>
</StackPanel>
<!-- Test -->
<DockPanel LastChildFill="True">
<Label Style="{StaticResource EntryLabel}" Content="Test panel:" HorizontalAlignment="Left" />
<Border Style="{StaticResource BlackBorder}">
<TextBlock Style="{StaticResource WhiteText}" Name="txtTestPanel" HorizontalAlignment="Left" />
</Border>
</DockPanel>
</StackPanel>
</ScrollViewer>
</Grid>
</Window>