-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainWindow.xaml
More file actions
299 lines (281 loc) · 16.9 KB
/
Copy pathMainWindow.xaml
File metadata and controls
299 lines (281 loc) · 16.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
<Window
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:local="clr-namespace:PromacWPF"
xmlns:Ports="clr-namespace:System.IO.Ports;assembly=System.IO.Ports" x:Class="PromacWPF.MainWindow"
mc:Ignorable="d"
Title="Promac2 WPF UI" Height="720" Width="1280" ResizeMode="CanMinimize" WindowStartupLocation="CenterScreen">
<Grid>
<Rectangle HorizontalAlignment="Left" Height="91" Margin="455,298,0,0" VerticalAlignment="Top" Width="162" Fill="#FFC7C7C7" RadiusX="10" RadiusY="10"/>
<Rectangle HorizontalAlignment="Left" Height="83" Margin="294,225,0,0" VerticalAlignment="Top" Width="572" Fill="#FFC7C7C7" RadiusX="10" RadiusY="10"/>
<Label x:Name="label" Content="COM Port:" HorizontalAlignment="Left" Margin="62,42,0,0" VerticalAlignment="Top"/>
<Label x:Name="label1" Content="Bits per second:" HorizontalAlignment="Left" Margin="33,68,0,0" VerticalAlignment="Top"/>
<Label x:Name="label2" Content="Data bits:" HorizontalAlignment="Left" Margin="67,94,0,0" VerticalAlignment="Top"/>
<Label x:Name="label3" Content="Parity:" HorizontalAlignment="Left" Margin="84,120,0,0" VerticalAlignment="Top"/>
<Label x:Name="label4" Content="Stop bits:" HorizontalAlignment="Left" Margin="68,146,0,0" VerticalAlignment="Top"/>
<Label x:Name="label5" Content="Flow control:" HorizontalAlignment="Left" Margin="49,172,0,0" VerticalAlignment="Top"/>
<ComboBox x:Name="comboBoxComPort" HorizontalAlignment="Left" Margin="131,44,0,0" VerticalAlignment="Top" Width="100"/>
<ComboBox x:Name="comboBoxRate" HorizontalAlignment="Left" Margin="131,70,0,0" VerticalAlignment="Top" Width="100" SelectedIndex="12">
<ComboBoxItem Content="50"/>
<ComboBoxItem Content="75"/>
<ComboBoxItem Content="110"/>
<ComboBoxItem Content="134"/>
<ComboBoxItem Content="150"/>
<ComboBoxItem Content="200"/>
<ComboBoxItem Content="300"/>
<ComboBoxItem Content="600"/>
<ComboBoxItem Content="1200"/>
<ComboBoxItem Content="1800"/>
<ComboBoxItem Content="2400"/>
<ComboBoxItem Content="4800"/>
<ComboBoxItem Content="9600"/>
<ComboBoxItem Content="19200"/>
<ComboBoxItem Content="28800"/>
<ComboBoxItem Content="38400"/>
<ComboBoxItem Content="57600"/>
<ComboBoxItem Content="76800"/>
<ComboBoxItem Content="115200"/>
<ComboBoxItem Content="230400"/>
<ComboBoxItem Content="460800"/>
<ComboBoxItem Content="576000"/>
<ComboBoxItem Content="921600"/>
</ComboBox>
<ComboBox x:Name="comboBoxDataBit" HorizontalAlignment="Left" Margin="131,96,0,0" VerticalAlignment="Top" Width="100" SelectedIndex="4">
<ComboBoxItem Content="4"/>
<ComboBoxItem Content="5"/>
<ComboBoxItem Content="6"/>
<ComboBoxItem Content="7"/>
<ComboBoxItem Content="8"/>
</ComboBox>
<ComboBox x:Name="comboBoxParity" HorizontalAlignment="Left" Margin="131,123,0,0" VerticalAlignment="Top" Width="100" SelectedIndex="0"/>
<ComboBox x:Name="comboBoxStopBit" HorizontalAlignment="Left" Margin="131,148,0,0" VerticalAlignment="Top" Width="100" SelectedIndex="1"/>
<ComboBox x:Name="comboBoxFlowControl" HorizontalAlignment="Left" Margin="131,174,0,0" VerticalAlignment="Top" Width="100" SelectedIndex="0"/>
<Button x:Name="buttonRefreshPort" Content="Refresh" HorizontalAlignment="Left" Margin="35,217,0,0" VerticalAlignment="Top" Click="buttonRefreshPort_Click"/>
<Button x:Name="buttonOpenPort" Content="Open" HorizontalAlignment="Left" Margin="83,217,0,0" VerticalAlignment="Top" Click="buttonOpenPort_Click"/>
<Button x:Name="buttonClosePort" Content="Close" HorizontalAlignment="Left" Margin="121,217,0,0" VerticalAlignment="Top" Click="buttonClosePort_Click"/>
<Button x:Name="buttonRestoreDefaults" Content="Restore Defaults" HorizontalAlignment="Left" Margin="159,217,0,0" VerticalAlignment="Top" Click="buttonRestoreDefaults_Click"/>
<Button x:Name="buttonTest" Content="Test" HorizontalAlignment="Left" Margin="159,242,0,0" VerticalAlignment="Top" Click="buttonTestPort_Click" Width="90" Height="20"/>
<!-- START C-F BUTTONS -->
<Button x:Name="buttonC" Content="C" HorizontalAlignment="Left" Margin="309,253,0,0" VerticalAlignment="Top" Width="40" Height="40" FontWeight="Bold" Click="buttonC_Click">
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="5"></Setter>
</Style>
</Button.Resources>
</Button>
<Button x:Name="buttonD" Content="D" HorizontalAlignment="Left" Margin="392,253,0,0" VerticalAlignment="Top" Width="40" Height="40" FontWeight="Bold" Click="buttonD_Click">
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="5"/>
</Style>
</Button.Resources>
</Button>
<Button x:Name="buttonE" Content="E" HorizontalAlignment="Left" Margin="475,253,0,0" VerticalAlignment="Top" Width="40" Height="40" FontWeight="Bold" Click="buttonE_Click">
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="5"/>
</Style>
</Button.Resources>
</Button>
<Button x:Name="buttonF" Content="F" HorizontalAlignment="Left" Margin="558,253,0,0" VerticalAlignment="Top" Width="39" Height="40" FontWeight="Bold" Click="buttonF_Click">
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="5"/>
</Style>
</Button.Resources>
</Button>
<!-- END C-F BUTTONS -->
<!-- START 8-B BUTTONS -->
<Button x:Name="button8" Content="8" HorizontalAlignment="Left" Margin="309,336,0,0" VerticalAlignment="Top" Width="40" Height="39" FontWeight="Bold" Click="button8_Click">
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="5"/>
</Style>
</Button.Resources>
</Button>
<Button x:Name="button9" Content="9" HorizontalAlignment="Left" Margin="392,336,0,0" VerticalAlignment="Top" Width="40" Height="39" FontWeight="Bold" Click="button9_Click">
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="5"/>
</Style>
</Button.Resources>
</Button>
<Button x:Name="buttonA" Content="A" HorizontalAlignment="Left" Margin="475,336,0,0" VerticalAlignment="Top" Width="40" Height="39" FontWeight="Bold" Click="buttonA_Click">
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="5"/>
</Style>
</Button.Resources>
</Button>
<Button x:Name="buttonB" Content="B" HorizontalAlignment="Left" Margin="558,336,0,0" VerticalAlignment="Top" Width="39" Height="39" FontWeight="Bold" Click="buttonB_Click">
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="5"/>
</Style>
</Button.Resources>
</Button>
<!-- END 8-B BUTTONS -->
<!-- START 4-7 BUTTONS -->
<Button x:Name="button4" Content="4" HorizontalAlignment="Left" Margin="309,419,0,0" VerticalAlignment="Top" Width="40" Height="39" FontWeight="Bold" Click="button4_Click">
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="5"></Setter>
</Style>
</Button.Resources>
</Button>
<Button x:Name="button5" Content="5" HorizontalAlignment="Left" Margin="392,419,0,0" VerticalAlignment="Top" Width="40" Height="39" FontWeight="Bold" Click="button5_Click">
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="5"/>
</Style>
</Button.Resources>
</Button>
<Button x:Name="button6" Content="6" HorizontalAlignment="Left" Margin="475,419,0,0" VerticalAlignment="Top" Width="40" Height="39" FontWeight="Bold" Click="button6_Click">
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="5"/>
</Style>
</Button.Resources>
</Button>
<Button x:Name="button7" Content="7" HorizontalAlignment="Left" Margin="558,419,0,0" VerticalAlignment="Top" Width="39" Height="39" FontWeight="Bold" Click="button7_Click">
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="5"/>
</Style>
</Button.Resources>
</Button>
<!-- END 4-7 BUTTONS -->
<!-- START 0-3 BUTTONS -->
<Button x:Name="button0" Content="0" HorizontalAlignment="Left" Margin="309,501,0,0" VerticalAlignment="Top" Width="40" Height="40" FontWeight="Bold" Click="button0_Click">
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="5"/>
</Style>
</Button.Resources>
</Button>
<Button x:Name="button1" Content="1" HorizontalAlignment="Left" Margin="392,501,0,0" VerticalAlignment="Top" Width="40" Height="40" FontWeight="Bold" Click="button1_Click">
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="5"/>
</Style>
</Button.Resources>
</Button>
<Button x:Name="button2" Content="2" HorizontalAlignment="Left" Margin="475,501,0,0" VerticalAlignment="Top" Width="40" Height="40" FontWeight="Bold" Click="button2_Click">
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="5"/>
</Style>
</Button.Resources>
</Button>
<Button x:Name="button3" Content="3" HorizontalAlignment="Left" Margin="558,501,0,0" VerticalAlignment="Top" Width="39" Height="40" FontWeight="Bold" Click="button3_Click">
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="5"/>
</Style>
</Button.Resources>
</Button>
<!-- END 8-B BUTTONS -->
<!-- DEVICE BUTTON -->
<Button x:Name="buttonDevice" Content="Device" HorizontalAlignment="Left" Margin="740,253,0,0" VerticalAlignment="Top" Height="40" Width="106" Click="buttonDevice_Click">
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="5"/>
</Style>
</Button.Resources>
</Button>
<!-- FUNCTION BUTTON -->
<Button x:Name="buttonFunction" Content="Function" HorizontalAlignment="Left" Margin="889,253,0,0" VerticalAlignment="Top" Height="40" Width="106" Click="buttonFunction_Click">
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="5"/>
</Style>
</Button.Resources>
</Button>
<!-- ROM TYPE BUTTON -->
<Button x:Name="buttonRomType" Content="ROM Type" HorizontalAlignment="Left" Margin="740,336,0,0" VerticalAlignment="Top" Height="39" Width="106" Click="buttonRomType_Click">
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="5"/>
</Style>
</Button.Resources>
</Button>
<!-- EDIT BUTTON -->
<Button x:Name="buttonEdit" Content="Edit" HorizontalAlignment="Left" Margin="889,336,0,0" VerticalAlignment="Top" Height="39" Width="106" Click="buttonEdit_Click">
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="5"/>
</Style>
</Button.Resources>
</Button>
<!-- UP ARROW BUTTON -->
<Button x:Name="buttonUpArrow" Content="▲" HorizontalAlignment="Left" Margin="889,419,0,0" VerticalAlignment="Top" Height="39" Width="106" Click="buttonUpArrow_Click">
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="5"/>
</Style>
</Button.Resources>
</Button>
<!-- DOWN ARROW BUTTON -->
<Button x:Name="buttonDownButton" Content="▼" HorizontalAlignment="Left" Margin="740,419,0,0" VerticalAlignment="Top" Height="39" Width="106" Click="buttonDownButton_Click">
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="5"/>
</Style>
</Button.Resources>
</Button>
<!-- SET BUTTON -->
<Button x:Name="buttonSet" Content="Set" HorizontalAlignment="Left" Margin="740,501,0,0" VerticalAlignment="Top" Height="40" Width="106" Click="buttonSet_Click">
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="5"/>
</Style>
</Button.Resources>
</Button>
<!-- RESET BUTTON -->
<Button x:Name="buttonReset" Content="Reset" HorizontalAlignment="Left" Margin="889,501,0,0" VerticalAlignment="Top" Height="40" Width="106" Click="buttonReset_Click">
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="5"/>
</Style>
</Button.Resources>
</Button>
<Label x:Name="label6" Content="Blank" HorizontalAlignment="Left" Margin="309,225,0,0" VerticalAlignment="Top"/>
<Label x:Name="label7" Content="Program" HorizontalAlignment="Left" Margin="384,225,0,0" VerticalAlignment="Top"/>
<Label x:Name="label8" Content="Verify" HorizontalAlignment="Left" Margin="475,225,0,0" VerticalAlignment="Top"/>
<Label x:Name="label9" Content="B.P.V." HorizontalAlignment="Left" Margin="558,225,0,0" VerticalAlignment="Top"/>
<Label x:Name="label10" Content="Copy" HorizontalAlignment="Left" Margin="476,308,0,0" VerticalAlignment="Top"/>
<Label x:Name="label11" Content="Erase" HorizontalAlignment="Left" Margin="559,308,0,0" VerticalAlignment="Top"/>
<Label x:Name="label12" Content="Device" HorizontalAlignment="Left" Margin="770,225,0,0" VerticalAlignment="Top"/>
<DockPanel LastChildFill="False">
<Menu DockPanel.Dock="Top">
<MenuItem Header="File">
<MenuItem Header="Exit" Click="menuItemExit_Click"/>
</MenuItem>
<MenuItem Header="Device">
<MenuItem Header="Blank Check" Click="menuItemBlankCheck_Click"/>
<MenuItem Header="Copy" Click="menuItemCopy_Click"/>
<MenuItem Header="Program" Click="menuItemProgram_Click"/>
<MenuItem Header="Verify" Click="menuItemVerify_Click"/>
<MenuItem Header="Blank-Program-Verify (B.P.V.)" Click="menuItemBPV_Click"/>
<MenuItem Header="Erase" Click="menuItemErase_Click"/>
</MenuItem>
<MenuItem Header="Edit">
<MenuItem Header="Complement" Click="menuItemComplement_Click"/>
<MenuItem Header="RAM Clear" Click="menuItemRamClean_Click"/>
</MenuItem>
<!--
<MenuItem Header="Function">
<MenuItem Header="Verify" Click="menuItemVerify_Click"/>
</MenuItem>
-->
<MenuItem Header="Interface">
<MenuItem Header="Serial Input" Click="menuItemSerialInput_Click"/>
<MenuItem Header="Serial Output" Click="menuItemSerialOutput_Click"/>
<MenuItem Header="Serial Verify" Click="menuItemSerialVerify_Click"/>
</MenuItem>
</Menu>
</DockPanel>
</Grid>
</Window>