-
-
Notifications
You must be signed in to change notification settings - Fork 197
/
Copy pathMainWindow.xaml
160 lines (154 loc) · 8.15 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
<Window x:Class="ExampleWPFVisualization.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Communication="clr-namespace:DotNetSiemensPLCToolBoxLibrary.Communication;assembly=DotNetSiemensPLCToolBoxLibrary"
xmlns:ExampleWPFVisualization="clr-namespace:ExampleWPFVisualization"
xmlns:Converters="clr-namespace:JFKCommonLibrary.WPF.Converters;assembly=JFKCommonLibrary"
xmlns:Behaviours="clr-namespace:JFKCommonLibrary.WPF.Behaviors;assembly=JFKCommonLibrary" Title="MainWindow"
Width="1040"
Height="592">
<Window.Resources>
<ResourceDictionary>
<Converters:IntRangeToBrushConverter x:Key="FarbenConverter1">
<!--
<Converters:IntRangeToBrushConverter.IntRangeValues>
<Converters:IntRangeToBrushConverter.IntRangeValue IntRange="0-5000" Value="Red" />
<Converters:IntRangeToBrushConverter.IntRangeValue IntRange="5001-10000" Value="Blue" />
<Converters:IntRangeToBrushConverter.IntRangeValue IntRange="10001-15000" Value="Green" />
<Converters:IntRangeToBrushConverter.IntRangeValue IntRange="15001-20000" Value="Orange" />
<Converters:IntRangeToBrushConverter.IntRangeValue IntRange="20001-25000" Value="Purple" />
<Converters:IntRangeToBrushConverter.IntRangeValue IntRange="25001-30000" Value="Brown" />
<Converters:IntRangeToBrushConverter.IntRangeValue IntRange=">30000" Value="Yellow" />
</Converters:IntRangeToBrushConverter.IntRangeValues>
-->
</Converters:IntRangeToBrushConverter>
<Converters:BoolToBrushConverter x:Key="BoolBrushConverter1"
FalseValue="Red"
TrueValue="Green" />
<Communication:PLCTag x:Key="Tag1"
TagDataType="Word"
PropertyChanged="PLCTag_PropertyChanged"
S7FormatAddress="DB1.DBW6" />
<Communication:PLCTag x:Key="Tag2"
DataTypeStringFormat="Decimal"
PropertyChanged="PLCTag_PropertyChanged"
S7FormatAddress="DB1.DBW4" />
<Communication:PLCTag x:Key="Tag3"
TagDataType="Float"
PropertyChanged="PLCTag_PropertyChanged"
S7FormatAddress="DB1.DBD0" />
<Communication:PLCTag x:Key="Tag22"
TagDataType="Float"
PropertyChanged="PLCTag_PropertyChanged"
S7FormatAddress="DB1.DBD36" />
<Communication:PLCTag x:Key="Tag4"
PropertyChanged="PLCTag_PropertyChanged"
S7FormatAddress="M10.0" />
<Communication:PLCTag x:Key="Tag5"
TagDataType="BCDDWord"
PropertyChanged="PLCTag_PropertyChanged"
S7FormatAddress="MW200" />
<Communication:PLCTag x:Key="Tag6"
ByteAddress="0"
DataBlockNumber="1"
TagDataType="DateTime"
PropertyChanged="PLCTag_PropertyChanged" />
</ResourceDictionary>
</Window.Resources>
<Viewbox Stretch="Uniform">
<Grid Width="389">
<Label Name="lblStatus"
Height="23"
Margin="133,13,28,0"
VerticalAlignment="Top" />
<Button Name="cmdConfig"
Width="110"
Height="26"
Margin="12,12,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Click="cmdConfig_Click"
Content="Config Connection" />
<Button Name="cmdConnect"
Width="110"
Height="25"
Margin="19,46,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Click="cmdConnect_Click"
Content="Start Visu" />
<Button Name="cmdStop"
Width="110"
Height="25"
Margin="138,44,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Click="cmdStop_Click"
Content="Stop Visu"
IsEnabled="False" />
<TextBox Width="126"
Height="30"
Margin="14,131,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Background="{Binding Source={StaticResource Tag1},
Path=Value,
Converter={StaticResource FarbenConverter1}}"
Behaviours:InputBindingsManager.UpdatePropertySourceWhenEnterPressedProperty="TextBox.Text"
Text="{Binding Source={StaticResource Tag1},
Path=ValueAsString}" />
<TextBox Width="238"
Height="26"
Margin="8,175,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Background="{Binding Source={StaticResource Tag4},
Path=Value,
Converter={StaticResource BoolBrushConverter1}}"
Behaviours:InputBindingsManager.UpdatePropertySourceWhenEnterPressedProperty="TextBox.Text"
Text="{Binding Source={StaticResource Tag2},
Path=ValueAsString}" />
<TextBox Width="238"
Height="26"
Margin="12,214,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Behaviours:InputBindingsManager.UpdatePropertySourceWhenEnterPressedProperty="TextBox.Text"
Text="{Binding Source={StaticResource Tag3},
Path=ValueAsString}" />
<CheckBox Name="checkBox1"
Width="128"
Height="15"
Margin="0,115,0,0"
HorizontalAlignment="Right"
VerticalAlignment="Top"
Content="CheckBox"
IsChecked="{Binding Source={StaticResource Tag4},
Path=Value}" />
<DatePicker Name="datePicker1"
Width="170"
Height="26"
Margin="0,0,68,138"
HorizontalAlignment="Right"
VerticalAlignment="Bottom"
FirstDayOfWeek="Monday"
SelectedDate="{Binding Source={StaticResource Tag6},
Path=Value}"
SelectedDateFormat="Long" />
<Button Name="button1"
Width="115"
Height="41"
Margin="14,81,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Content="Button" />
<Button Name="button2"
Width="140"
Height="39"
Margin="244,132,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Content="Button" />
</Grid>
</Viewbox>
</Window>