-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConnectionSettingsWindow.xaml
More file actions
324 lines (294 loc) · 15.9 KB
/
Copy pathConnectionSettingsWindow.xaml
File metadata and controls
324 lines (294 loc) · 15.9 KB
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
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
<Window x:Class="Dnp3MasterTester.ConnectionSettingsWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Connection Setup"
Width="820"
Height="760"
WindowStartupLocation="CenterOwner"
ResizeMode="CanResizeWithGrip">
<Window.Resources>
<Style x:Key="TcpSectionBorderStyle" TargetType="Border" BasedOn="{StaticResource CardBorderStyle}">
<Setter Property="IsEnabled" Value="True" />
<Setter Property="Opacity" Value="1" />
<Style.Triggers>
<DataTrigger Binding="{Binding IsTcpTransport}" Value="False">
<Setter Property="IsEnabled" Value="False" />
<Setter Property="Opacity" Value="0.55" />
</DataTrigger>
</Style.Triggers>
</Style>
<Style x:Key="SerialSectionBorderStyle" TargetType="Border" BasedOn="{StaticResource CardBorderStyle}">
<Setter Property="IsEnabled" Value="True" />
<Setter Property="Opacity" Value="1" />
<Style.Triggers>
<DataTrigger Binding="{Binding IsSerialTransport}" Value="False">
<Setter Property="IsEnabled" Value="False" />
<Setter Property="Opacity" Value="0.55" />
</DataTrigger>
</Style.Triggers>
</Style>
</Window.Resources>
<Grid Margin="16">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<StackPanel Margin="0,0,0,12">
<TextBlock Text="Connection Setup"
FontSize="18"
FontWeight="Bold" />
<TextBlock Margin="0,6,0,0"
Foreground="{StaticResource TextMutedBrush}"
Text="Edit transport, addresses, polling behavior, and transport-specific TCP or serial parameters for the current DNP3 session."
TextWrapping="Wrap" />
</StackPanel>
<ScrollViewer Grid.Row="1"
VerticalScrollBarVisibility="Auto">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Border Grid.Row="0"
Style="{StaticResource CardBorderStyle}"
Padding="16"
Margin="0,0,0,12">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0" Margin="0,0,10,0">
<TextBlock Text="Polling Profile" />
<ComboBox ItemsSource="{Binding PollingProfiles}"
SelectedItem="{Binding Settings.PollingProfile}" />
</StackPanel>
<StackPanel Grid.Column="1">
<TextBlock Text="Transport" />
<ComboBox ItemsSource="{Binding TransportTypes}"
SelectedItem="{Binding Settings.Transport}" />
</StackPanel>
</Grid>
</Border>
<Border Grid.Row="1"
Style="{StaticResource CardBorderStyle}"
Padding="16"
Margin="0,0,0,12">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<TextBlock Grid.Row="0"
Grid.ColumnSpan="2"
FontSize="16"
FontWeight="SemiBold"
Text="Common Session Settings" />
<StackPanel Grid.Row="1" Grid.Column="0" Margin="0,12,10,0">
<TextBlock Text="Master Address" />
<TextBox Text="{Binding Settings.MasterAddress, UpdateSourceTrigger=PropertyChanged}" />
</StackPanel>
<StackPanel Grid.Row="1" Grid.Column="1" Margin="0,12,0,0">
<TextBlock Text="Outstation Address" />
<TextBox Text="{Binding Settings.OutstationAddress, UpdateSourceTrigger=PropertyChanged}" />
</StackPanel>
</Grid>
</Border>
<Border Grid.Row="2"
Style="{StaticResource TcpSectionBorderStyle}"
Padding="16"
Margin="0,0,0,12">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<TextBlock Grid.Row="0"
Grid.ColumnSpan="2"
FontSize="16"
FontWeight="SemiBold"
Text="TCP Target" />
<StackPanel Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" Margin="0,12,0,0">
<TextBlock Text="Remote Endpoint" />
<TextBox Text="{Binding Settings.Endpoint, UpdateSourceTrigger=PropertyChanged}" />
</StackPanel>
</Grid>
</Border>
<Border Grid.Row="3"
Style="{StaticResource SerialSectionBorderStyle}"
Padding="16"
Margin="0,0,0,12">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<TextBlock Grid.Row="0"
Grid.ColumnSpan="2"
FontSize="16"
FontWeight="SemiBold"
Text="Serial Target" />
<StackPanel Grid.Row="1" Grid.Column="0" Margin="0,12,10,10">
<TextBlock Text="Serial Port" />
<Grid Margin="0,4,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<ComboBox Grid.Column="0"
Margin="0,0,8,0"
ItemsSource="{Binding SerialPortOptions}"
SelectedItem="{Binding Settings.SerialPort, UpdateSourceTrigger=PropertyChanged}" />
<Button Grid.Column="1"
Width="70"
Command="{Binding RefreshSerialPortsCommand}"
Content="Refresh" />
</Grid>
<TextBlock Margin="0,6,0,0"
Foreground="{StaticResource TextMutedBrush}"
Text="{Binding SerialPortAvailabilityText}"
TextWrapping="Wrap" />
</StackPanel>
<StackPanel Grid.Row="1" Grid.Column="1" Margin="0,12,0,10">
<TextBlock Text="Baud Rate" />
<TextBox Text="{Binding Settings.SerialBaudRate, UpdateSourceTrigger=PropertyChanged}" />
</StackPanel>
<StackPanel Grid.Row="2" Grid.Column="0" Margin="0,0,10,10">
<TextBlock Text="Data Bits" />
<ComboBox ItemsSource="{Binding SerialDataBitOptions}"
SelectedItem="{Binding Settings.SerialDataBits}" />
</StackPanel>
<StackPanel Grid.Row="2" Grid.Column="1" Margin="0,0,0,10">
<TextBlock Text="Stop Bits" />
<ComboBox ItemsSource="{Binding SerialStopBitOptions}"
SelectedItem="{Binding Settings.SerialStopBits}" />
</StackPanel>
<StackPanel Grid.Row="3" Grid.Column="0" Margin="0,0,10,0">
<TextBlock Text="Parity" />
<ComboBox ItemsSource="{Binding SerialParityOptions}"
SelectedItem="{Binding Settings.SerialParity}" />
</StackPanel>
<StackPanel Grid.Row="3" Grid.Column="1">
<TextBlock Text="Flow Control" />
<ComboBox ItemsSource="{Binding SerialFlowControlOptions}"
SelectedItem="{Binding Settings.SerialFlowControl}" />
</StackPanel>
</Grid>
</Border>
<Border Grid.Row="4"
Style="{StaticResource CardBorderStyle}"
Padding="16"
Margin="0,0,0,12">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<TextBlock Grid.Row="0"
Grid.ColumnSpan="3"
FontSize="16"
FontWeight="SemiBold"
Text="Timing" />
<StackPanel Grid.Row="1" Grid.Column="0" Margin="0,12,10,0">
<TextBlock Text="Request Timeout (s)" />
<TextBox Text="{Binding Settings.RequestTimeoutSeconds, UpdateSourceTrigger=PropertyChanged}" />
</StackPanel>
<StackPanel Grid.Row="1" Grid.Column="1" Margin="0,12,10,0">
<TextBlock Text="Fast Event Poll (s)" />
<TextBox Text="{Binding Settings.EventPollSeconds, UpdateSourceTrigger=PropertyChanged}" />
</StackPanel>
<StackPanel Grid.Row="1" Grid.Column="2" Margin="0,12,0,0">
<TextBlock Text="Static Refresh (s)" />
<TextBox Text="{Binding Settings.StaticRefreshSeconds, UpdateSourceTrigger=PropertyChanged}" />
</StackPanel>
</Grid>
</Border>
<Border Grid.Row="5"
Style="{StaticResource SerialSectionBorderStyle}"
Padding="16"
Margin="0,0,0,12">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<TextBlock Grid.Row="0"
Grid.ColumnSpan="2"
FontSize="16"
FontWeight="SemiBold"
Text="Serial Recovery" />
<StackPanel Grid.Row="1" Grid.Column="0" Margin="0,12,10,0">
<TextBlock Text="Port Open Retry (s)" />
<TextBox Text="{Binding Settings.SerialOpenRetrySeconds, UpdateSourceTrigger=PropertyChanged}" />
</StackPanel>
<TextBlock Grid.Row="1"
Grid.Column="1"
Margin="0,30,0,0"
Foreground="{StaticResource TextMutedBrush}"
Text="{Binding SerialProfile}"
TextWrapping="Wrap" />
</Grid>
</Border>
<Border Grid.Row="6"
Style="{StaticResource CardBorderStyle}"
Padding="16">
<StackPanel>
<TextBlock FontSize="16"
FontWeight="SemiBold"
Text="Polling Features" />
<WrapPanel Margin="0,12,0,0">
<CheckBox Margin="0,0,16,8" IsChecked="{Binding Settings.EnableStartupIntegrity}" Content="Startup Integrity" />
<CheckBox Margin="0,0,16,8" IsChecked="{Binding Settings.EnableSlowStaticRefresh}" Content="Slow Static Refresh" />
<CheckBox Margin="0,0,16,8" IsChecked="{Binding Settings.EnableAutoEventScan}" Content="Auto Event Scan on IIN" />
<CheckBox Margin="0,0,0,8" IsChecked="{Binding Settings.EnableUnsolicited}" Content="Enable Unsolicited" />
</WrapPanel>
</StackPanel>
</Border>
</Grid>
</ScrollViewer>
<StackPanel Grid.Row="2"
Orientation="Horizontal"
HorizontalAlignment="Right"
Margin="0,12,0,0">
<Button Width="90"
Margin="0,0,8,0"
IsCancel="True"
Content="Close" />
<Button Width="90"
Style="{StaticResource PrimaryButtonStyle}"
IsDefault="True"
Content="Done"
Click="DoneButton_Click" />
</StackPanel>
</Grid>
</Window>