Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
T
Thick-Common
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
潘栩锋
Thick-Common
Commits
02fb55ad
Commit
02fb55ad
authored
Sep 04, 2019
by
潘栩锋
🚴
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
AD盒 涂布模拟 添加 “确定” 寄存器
parent
4e0d0f28
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
95 additions
and
62 deletions
+95
-62
HMI.cs
Project.FLY.FlyADBase/FLY.Simulation.Coating/HMI.cs
+28
-2
WindowCoating.xaml
...ct.FLY.FlyADBase/FLYAD7_Simulation_Wpf/WindowCoating.xaml
+67
-60
No files found.
Project.FLY.FlyADBase/FLY.Simulation.Coating/HMI.cs
View file @
02fb55ad
...
...
@@ -21,6 +21,7 @@ namespace FLY.Simulation.Coating
const
UInt16
ADDR_D_FilmVelocity
=
6
;
//float
const
UInt16
ADDR_C_STATE
=
0
;
//涂布状态 bit 0
const
UInt16
ADDR_C_OK
=
2
;
//设置 0->1 设置
CoatingCtrl
mCoatingCtrl
;
...
...
@@ -109,6 +110,7 @@ namespace FLY.Simulation.Coating
}
}
public
double
FilmVelocity
{
get
...
...
@@ -143,6 +145,21 @@ namespace FLY.Simulation.Coating
}
}
public
bool
OK
{
get
{
return
mPLCRegister
.
GetBool
(
ADDR_C_OK
);
}
set
{
if
(
OK
!=
value
)
{
mPLCRegister
.
SetBool
(
ADDR_C_OK
,
value
);
NotifyPropertyChanged
(
"OK"
);
}
}
}
public
HMI
(
Coating
coating
,
CoatingCtrl
cc
,
int
port
)
{
mCoatingCtrl
=
cc
;
...
...
@@ -158,6 +175,9 @@ namespace FLY.Simulation.Coating
Addrs
.
Add
(
ADDR_D_RightSet
,
"RightSet"
);
Addrs
.
Add
(
ADDR_D_Right
,
"Right"
);
Addrs
.
Add
(
ADDR_D_FilmVelocity
,
"FilmVelocity"
);
Addrs
.
Add
(
ADDR_C_OK
,
"OK"
);
Misc
.
BindingOperations
.
SetBinding
(
cc
.
NowCtrl
,
"Pump"
,
this
,
"PumpSet"
,
Misc
.
BindingOperations
.
BindingMode
.
TwoWay
);
Misc
.
BindingOperations
.
SetBinding
(
cc
.
NowCtrl
,
"LeftDis"
,
this
,
"Left"
);
...
...
@@ -169,15 +189,21 @@ namespace FLY.Simulation.Coating
LeftSet
=
Left
;
RightSet
=
Right
;
this
.
PropertyChanged
+=
new
PropertyChangedEventHandler
(
HMI_PropertyChanged
);
}
void
HMI_PropertyChanged
(
object
sender
,
PropertyChangedEventArgs
e
)
{
if
((
e
.
PropertyName
==
"PumpSet"
)
||
(
e
.
PropertyName
==
"LeftSet"
)
||
(
e
.
PropertyName
==
"RightSet"
))
if
(
e
.
PropertyName
==
"OK"
)
{
if
(
OK
==
true
)
{
mCoatingCtrl
.
SetCoatingCtrl
(
PumpSet
,
LeftSet
,
RightSet
);
}
}
}
void
plcregister_RegChanged
(
object
sender
,
ModbusModule
.
PLCRegister
.
RegChangedEventArgs
e
)
{
...
...
Project.FLY.FlyADBase/FLYAD7_Simulation_Wpf/WindowCoating.xaml
View file @
02fb55ad
...
...
@@ -12,7 +12,8 @@
<RowDefinition Height="auto" />
<RowDefinition Height="273*" />
</Grid.RowDefinitions>
<Grid HorizontalAlignment="Left" Margin="12,3" Name="grid1" >
<StackPanel Orientation="Horizontal">
<Grid HorizontalAlignment="Left" Margin="12,3" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="auto" />
...
...
@@ -80,6 +81,13 @@
</Grid>
<StackPanel>
<CheckBox Content="设置位" FontSize="18" FontWeight="Bold" Height="23" Margin="3" VerticalAlignment="Center" FlowDirection="RightToLeft" IsChecked="{Binding OK}" IsEnabled="False"/>
<CheckBox Content="涂布状态" FontSize="18" FontWeight="Bold" Height="23" Margin="3" VerticalAlignment="Center" FlowDirection="RightToLeft" IsChecked="{Binding DeviceState}" IsEnabled="False"/>
</StackPanel>
</StackPanel>
<StackPanel Orientation="Horizontal" Grid.Row="1" Margin="12,3">
<StackPanel Orientation="Horizontal" Margin="3">
<TextBlock Text="modbusTCP 端口:" />
...
...
@@ -97,7 +105,6 @@
<TextBlock Text="转移涂布"/>
</ComboBoxItem>
</ComboBox>
<CheckBox Content="涂布状态" FontSize="18" FontWeight="Bold" Height="23" Margin="3" Name="checkBox1" VerticalAlignment="Center" FlowDirection="RightToLeft" IsChecked="{Binding DeviceState}"/>
<TextBlock FontSize="18" FontWeight="Bold" Height="23" Margin="3" VerticalAlignment="Center" >
<Run Text="当前平均值:" />
<Run Text="{Binding Avg}" />
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment