-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainWindow.xaml
292 lines (292 loc) · 21.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
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
<Window x:Class="IgnitionHelper.MainWindow"
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:IgnitionHelper"
mc:Ignorable="d"
Title="IgnitionHelper" Height="493" Width="800" MinWidth="600" MinHeight="450"
Background="#546A76"
Foreground="#F5E9E2">
<Grid Margin="0,0,0,20">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="33*"/>
<ColumnDefinition Width="131*"/>
<ColumnDefinition Width="545*"/>
<ColumnDefinition Width="91*"/>
<ColumnDefinition Width="0*"/>
<ColumnDefinition Width="0*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="64*"/>
<RowDefinition Height="63*"/>
<RowDefinition Height="120*"/>
<RowDefinition Height="226*"/>
<RowDefinition Height="10"/>
</Grid.RowDefinitions>
<GroupBox Foreground="#F5E9E2" Grid.ColumnSpan="4" Header="Export Folder" Width="Auto" Margin="10,5,9,5"/>
<ScrollViewer Grid.Row="3" Grid.ColumnSpan="4" Margin="10,10,10,0" CanContentScroll="True" VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Auto" Grid.RowSpan="2">
<TextBlock x:Name= "TB_Status" TextWrapping="Wrap" Height="Auto" Width="Auto" ><Run Language="pl-pl"/><LineBreak/><Run Language="pl-pl"/></TextBlock>
</ScrollViewer>
<!--Tab Control-->
<TabControl Foreground="#F5E9E2" Grid.ColumnSpan="4" Margin="10,1,9,4" Grid.RowSpan="2" Grid.Row="1">
<!--DataTypeInstance Tab-->
<TabItem Header="DataTypeInstance">
<Grid>
<Grid.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#547A80"/>
<GradientStop Color="#F5E9E2" Offset="1"/>
<GradientStop Color="#8aa2a9" Offset="0.493"/>
</LinearGradientBrush>
</Grid.Background>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="20*"/>
<ColumnDefinition Width="20*"/>
<ColumnDefinition Width="20*"/>
<ColumnDefinition Width="20*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="20*"/>
<RowDefinition Height="20*"/>
<RowDefinition Height="20*"/>
<RowDefinition Height="20*"/>
<RowDefinition Height="20*"/>
</Grid.RowDefinitions>
<TextBox x:Name="TB_FilterTextUdt" Grid.Row="0" Grid.Column="0" Text="ud_;AB:PowerFlex" HorizontalAlignment="Left" Margin="5,5,0,0" VerticalAlignment="Top" Width="140" Height="20" TextChanged="TB_FilterTextUdt_TextChanged"/>
<TextBlock Grid.Row="0" Grid.Column="1" HorizontalAlignment="Left" Margin="0,5,0,0" TextWrapping="Wrap" Text="Strings included in Data Type name" VerticalAlignment="Top" Height="Auto" Width="Auto" Grid.ColumnSpan="3"/>
<Button x:Name ="B_SelectTagsXLSX" Grid.Row="1" Grid.Column="0" Content="Select Exp Tags (.XLSX)" HorizontalAlignment="Left" Margin="5,5,0,0" VerticalAlignment="Top" Width="140" Click="B_SelectTagsXLSX_ClickAsync" Height="20" IsEnabled="False">
<Button.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#547A80"/>
<GradientStop Color="#F5E9E2" Offset="1"/>
</LinearGradientBrush>
</Button.Background>
</Button>
<Button x:Name ="B_GenerateXml" Grid.Row="2" Grid.Column="0" Content="Generate XML" HorizontalAlignment="Left" VerticalAlignment="Top" Width="140" Height="20" Click="B_GenerateXml_ClickAsync" Margin="5,5,0,0" IsEnabled="False">
<Button.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#547A80"/>
<GradientStop Color="#F5E9E2" Offset="1"/>
</LinearGradientBrush>
</Button.Background>
</Button>
<Button x:Name ="B_ShowTagsWindow" Grid.Row="3" Grid.Column="0" Content="Modify Tags" HorizontalAlignment="Left" VerticalAlignment="Top" Width="140" Height="20" Click="B_ShowTagsWindow_Click" Margin="5,5,0,0" IsEnabled="False">
<Button.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#547A80"/>
<GradientStop Color="#F5E9E2" Offset="1"/>
</LinearGradientBrush>
</Button.Background>
</Button>
<TextBlock Grid.Row="3" Grid.Column="1" HorizontalAlignment="Left" Margin="0,5,0,0" TextWrapping="Wrap" Text="Select Tags to delete from .xml file" VerticalAlignment="Top" Height="Auto" Width="Auto" Grid.ColumnSpan="3"/>
<Button x:Name ="B_GenExcelTagData" Grid.Row="4" Grid.Column="0" Content="Generate TagData (.xlsx)" HorizontalAlignment="Left" VerticalAlignment="Top" Width="140" Height="20" Click="B_GenExcelTagData_ClickAsync" Margin="5,5,0,0" IsEnabled="False">
<Button.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#547A80"/>
<GradientStop Color="#F5E9E2" Offset="1"/>
</LinearGradientBrush>
</Button.Background>
</Button>
<TextBlock x:Name="L_PLCTagsFilePath" Grid.Row="1" Grid.Column="1" HorizontalAlignment="Left" Margin="0,5,0,0" TextWrapping="Wrap" Text="Tags from PLC file (.xlsx) path" VerticalAlignment="Top" Height="Auto" Width="Auto" Grid.ColumnSpan="3"/>
<TextBlock x:Name="L_HMITagsFilePath" Grid.Row="2" Grid.Column="1" HorizontalAlignment="Left" TextWrapping="Wrap" Text="Tags from Ignition file (.xml) path" VerticalAlignment="Top" Height="Auto" Width="Auto" Margin="0,5,0,0" Grid.ColumnSpan="3"/>
<TextBlock x:Name="L_ExtendNameToleration" Grid.Row="2" Grid.Column="4" HorizontalAlignment="Left" TextWrapping="Wrap" Text="Extend udt names comparision" VerticalAlignment="Top" Height="Auto" Width="Auto" Margin="0,5,0,0" Grid.ColumnSpan="3"/>
<CheckBox x:Name="CB_ExtendNameToleration" Grid.Row="2" Grid.Column="4" HorizontalAlignment="Right" VerticalAlignment="Top" Height="Auto" Width="Auto" Margin="0,5,5,0" />
</Grid>
</TabItem>
<!--DataTypeDefinition Tab-->
<TabItem Header="DataTypeDefinition">
<TabItem.Background>
<LinearGradientBrush EndPoint="0,1">
<GradientStop Color="#FFF0F0F0"/>
<GradientStop Color="#FFB5A3A3" Offset="1"/>
</LinearGradientBrush>
</TabItem.Background>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="20*"/>
<ColumnDefinition Width="20*"/>
<ColumnDefinition Width="20*"/>
<ColumnDefinition Width="20*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="20*"/>
<RowDefinition Height="20*"/>
<RowDefinition Height="20*"/>
<RowDefinition Height="20*"/>
</Grid.RowDefinitions>
<Grid.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#547A80"/>
<GradientStop Color="#F5E9E2" Offset="1"/>
<GradientStop Color="#8aa2a9" Offset="0.493"/>
</LinearGradientBrush>
</Grid.Background>
<Button x:Name ="B_SelectDTFromAB" Grid.Column="0" Grid.Row="0" Content="Select Exp Tags (.XLSX)" HorizontalAlignment="Left" Margin="5,5,0,0" VerticalAlignment="Top" Width="140" Height="20" Click="B_SelectDTFromAB_Click" IsEnabled="False">
<Button.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#547A80"/>
<GradientStop Color="#F5E9E2" Offset="1"/>
</LinearGradientBrush>
</Button.Background>
</Button>
<Button x:Name ="B_SelectDTFromHMI" Grid.Column="0" Grid.Row="1" Content="Generate XML" HorizontalAlignment="Left" VerticalAlignment="Top" Width="140" Height="20" Margin="5,5,0,0" Click="B_SelectDTFromHMI_Click" IsEnabled="False">
<Button.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#547A80"/>
<GradientStop Color="#F5E9E2" Offset="1"/>
</LinearGradientBrush>
</Button.Background>
</Button>
</Grid>
</TabItem>
<!--Tag/uDT editor Tab-->
<TabItem Header="Tag/uDT Editor">
<TabItem.Background>
<LinearGradientBrush EndPoint="0,1">
<GradientStop Color="#FFF0F0F0"/>
<GradientStop Color="#FFB5A3A3" Offset="1"/>
</LinearGradientBrush>
</TabItem.Background>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="14*"/>
<ColumnDefinition Width="83*"/>
<ColumnDefinition Width="97*"/>
<ColumnDefinition Width="97*"/>
<ColumnDefinition Width="97*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="20*"/>
<RowDefinition Height="20*"/>
<RowDefinition Height="20*"/>
<RowDefinition Height="20*"/>
</Grid.RowDefinitions>
<Grid.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#547A80"/>
<GradientStop Color="#F5E9E2" Offset="1"/>
<GradientStop Color="#8aa2a9" Offset="0.493"/>
</LinearGradientBrush>
</Grid.Background>
<Button x:Name ="B_SelectFileToEdit" Grid.Column="0" Grid.Row="0" Content="Select File To Edit (.xml)" HorizontalAlignment="Left" Margin="5,5,0,0" VerticalAlignment="Top" Width="140" Height="20" Click="B_SelectFileToEdit_Click" IsEnabled="True" Grid.ColumnSpan="2">
<Button.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#547A80"/>
<GradientStop Color="#F5E9E2" Offset="1"/>
</LinearGradientBrush>
</Button.Background>
</Button>
<TextBlock x:Name="L_SelectedFileToEditPath" Grid.Row="0" Grid.Column="2" HorizontalAlignment="Left" Margin="0,5,0,0" TextWrapping="Wrap" Text="Udt/Tags from PLC Ignition (.xml) path" VerticalAlignment="Top" Height="Auto" Width="Auto" Grid.ColumnSpan="2"/>
<Label Content="Tag Group" Grid.Column="0" Grid.Row="1" HorizontalAlignment="Left" Margin="5,0,0,0" VerticalAlignment="Center" Grid.ColumnSpan="2" Height="Auto" Width="Auto"/>
<TextBox x:Name="TB_TagGroup" Grid.Column="0" Grid.Row="2" HorizontalAlignment="Left" Margin="5,5,0,0" TextWrapping="Wrap" Text="CB" VerticalAlignment="Top" Width="140" Height="20" Grid.ColumnSpan="2"/>
<Label Content="Value To Edit" Grid.Column="2" Grid.Row="1" HorizontalAlignment="Left" Margin="5,0,0,0" VerticalAlignment="Center" Height="Auto" Width="Auto"/>
<TextBox x:Name="TB_ValueToEdit" Grid.Column="2" Grid.Row="2" HorizontalAlignment="Left" Margin="5,5,0,0" TextWrapping="Wrap" Text="tagGroup" VerticalAlignment="Top" Width="140" Height="20"/>
<Label Content="Edit Value" Grid.Column="3" Grid.Row="1" HorizontalAlignment="Left" Margin="4,0,0,0" VerticalAlignment="Center" Height="Auto" Width="Auto"/>
<TextBox x:Name="TB_EditValue" Grid.Column="3" Grid.Row="2" HorizontalAlignment="Left" Margin="4,5,0,0" TextWrapping="Wrap" Text="tagGroup_CB" VerticalAlignment="Top" Width="140" Height="20"/>
<Button x:Name ="B_EditTagUdt" Grid.Column="4" Grid.Row="2" Content="Edit" HorizontalAlignment="Left" Margin="5,5,0,0" VerticalAlignment="Top" Width="140" Height="20" Click="B_EditTagUdt_ClickAsync" IsEnabled="False">
<Button.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#547A80"/>
<GradientStop Color="#F5E9E2" Offset="1"/>
</LinearGradientBrush>
</Button.Background>
</Button>
<Button x:Name ="B_EditAlarmUdt" Grid.Column="4" Grid.Row="3" Content="Edit Alarms" HorizontalAlignment="Left" Margin="5,5,0,0" VerticalAlignment="Top" Width="140" Height="20" Click="B_EditAlarmUdt_ClickAsync" IsEnabled="False">
<Button.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#547A80"/>
<GradientStop Color="#F5E9E2" Offset="1"/>
</LinearGradientBrush>
</Button.Background>
</Button>
<Button x:Name ="B_CheckTags" Grid.Column="1" Grid.Row="3" Content="Check Tags" HorizontalAlignment="Left" Margin="-23,5,0,0" VerticalAlignment="Top" Width="140" Height="20" Click="B_CheckTags_ClickAsync" IsEnabled="False">
<Button.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#547A80"/>
<GradientStop Color="#F5E9E2" Offset="1"/>
</LinearGradientBrush>
</Button.Background>
</Button>
</Grid>
</TabItem>
<!--Tag/uDT JSON editor Tab-->
<TabItem Header="Tag/uDT JSON Editor">
<TabItem.Background>
<LinearGradientBrush EndPoint="0,1">
<GradientStop Color="#FFF0F0F0"/>
<GradientStop Color="#FFB5A3A3" Offset="1"/>
</LinearGradientBrush>
</TabItem.Background>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="30*"/>
<ColumnDefinition Width="20*"/>
<ColumnDefinition Width="20*"/>
<ColumnDefinition Width="20*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="20*"/>
<RowDefinition Height="20*"/>
<RowDefinition Height="20*"/>
<RowDefinition Height="20*"/>
</Grid.RowDefinitions>
<Grid.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#547A80"/>
<GradientStop Color="#F5E9E2" Offset="1"/>
<GradientStop Color="#8aa2a9" Offset="0.493"/>
</LinearGradientBrush>
</Grid.Background>
<Button x:Name ="B_SelectJsonToEdit" Grid.Column="0" Grid.Row="0" Content="Select File To Edit (.json)" HorizontalAlignment="Left" Margin="5,5,0,0" VerticalAlignment="Top" Width="140" Height="20" Click="B_SelectJsonToEdit_Click" IsEnabled="True">
<Button.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#547A80"/>
<GradientStop Color="#F5E9E2" Offset="1"/>
</LinearGradientBrush>
</Button.Background>
</Button>
<TextBlock x:Name="L_SelectedJsonToEditPath" Grid.Row="0" Grid.Column="1" HorizontalAlignment="Left" Margin="0,5,0,0" TextWrapping="Wrap" Text="Udt/Tags from PLC Ignition (.json) path" VerticalAlignment="Top" Height="Auto" Width="Auto" Grid.ColumnSpan="3"/>
<Label Content="Array Index/NodeName to Multiply" Grid.Column="0" Grid.Row="1" HorizontalAlignment="Left" Margin="5,5,0,0" VerticalAlignment="Top" Grid.ColumnSpan="2" Height="Auto" Width="Auto"/>
<TextBox x:Name="TB_JsonIndexToMultiply" Grid.Column="0" Grid.Row="2" HorizontalAlignment="Left" Margin="5,5,0,0" TextWrapping="Wrap" Text="0" VerticalAlignment="Top" Width="140" Height="20"/>
<Label Content="Property To Multiply" Grid.Column="1" Grid.Row="1" HorizontalAlignment="Left" Margin="5,5,0,0" VerticalAlignment="Top" Grid.ColumnSpan="2" Height="Auto" Width="Auto"/>
<TextBox x:Name="TB_JsonPropertyToMultiply" Grid.Column="1" Grid.Row="2" HorizontalAlignment="Left" Margin="5,0,0,0" TextWrapping="Wrap" Text="tags" VerticalAlignment="Center" Width="140" Height="20"/>
<Button x:Name ="B_EditTagUdtJson" Grid.Column="3" Grid.Row="2" Content="Edit Array" HorizontalAlignment="Left" Margin="5,5,0,0" VerticalAlignment="Top" Width="140" Height="20" Click="B_EditTagUdtJson_Click" IsEnabled="False">
<Button.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#547A80"/>
<GradientStop Color="#F5E9E2" Offset="1"/>
</LinearGradientBrush>
</Button.Background>
</Button>
<TextBox x:Name="TB_NodeNameToMultiply" Grid.Column="0" Grid.Row="3" HorizontalAlignment="Left" Margin="5,5,0,0" TextWrapping="Wrap" Text="nodeNameToMultiply" VerticalAlignment="Top" Width="140" Height="20"/>
<Button x:Name ="B_MultiplyTagUdtJson" Grid.Column="3" Grid.Row="3" Content="Multiply Node" HorizontalAlignment="Left" Margin="5,5,0,0" VerticalAlignment="Top" Width="140" Height="20" Click="B_MultiplyTagUdtJson_Click" IsEnabled="False">
<Button.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#547A80"/>
<GradientStop Color="#F5E9E2" Offset="1"/>
</LinearGradientBrush>
</Button.Background>
</Button>
</Grid>
</TabItem>
</TabControl>
<Button x:Name ="B_SelectExpFolder" Content="Select path" HorizontalAlignment="Left" Margin="19,26,0,0" VerticalAlignment="Top" Width="66" Click="B_SelectExpFolder_Click" Height="20" Grid.ColumnSpan="2">
<Button.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#547A80"/>
<GradientStop Color="#F5E9E2" Offset="1"/>
</LinearGradientBrush>
</Button.Background>
</Button>
<TextBlock x:Name="TB_ExpFolderPath" HorizontalAlignment="Left" TextWrapping="Wrap" Text="Path" VerticalAlignment="Top" Height="Auto" Width="Auto" Grid.Column="2" Margin="0,28,0,0"/>
<Button x:Name ="B_OpenExpFolder" Content="Open" HorizontalAlignment="Left" Margin="57,26,0,0" VerticalAlignment="Top" Width="66" Click="B_OpenExpFolder_Click" Height="20" IsEnabled="False" Grid.Column="1">
<Button.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#547A80"/>
<GradientStop Color="#F5E9E2" Offset="1"/>
</LinearGradientBrush>
</Button.Background>
</Button>
</Grid>
</Window>