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
dd514bb7
Commit
dd514bb7
authored
Sep 06, 2019
by
潘栩锋
🚴
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复 coating 模拟控制bug
parent
02fb55ad
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
26 deletions
+42
-26
HMI.cs
Project.FLY.FlyADBase/FLY.Simulation.Coating/HMI.cs
+17
-13
WindowCoating.xaml
...ct.FLY.FlyADBase/FLYAD7_Simulation_Wpf/WindowCoating.xaml
+21
-6
WindowCoating.xaml.cs
...FLY.FlyADBase/FLYAD7_Simulation_Wpf/WindowCoating.xaml.cs
+4
-7
No files found.
Project.FLY.FlyADBase/FLY.Simulation.Coating/HMI.cs
View file @
dd514bb7
...
...
@@ -28,7 +28,8 @@ namespace FLY.Simulation.Coating
FLY
.
ModbusModule
.
ServerTCP
mbServer
;
FLY
.
ModbusModule
.
PLCRegister
mPLCRegister
;
Dictionary
<
UInt16
,
string
>
Addrs
=
new
Dictionary
<
ushort
,
string
>();
Dictionary
<
UInt16
,
string
>
Addrs_reg
=
new
Dictionary
<
ushort
,
string
>();
Dictionary
<
UInt16
,
string
>
Addrs_coil
=
new
Dictionary
<
ushort
,
string
>();
public
double
PumpSet
...
...
@@ -169,14 +170,14 @@ namespace FLY.Simulation.Coating
mPLCRegister
.
RegChanged
+=
new
ModbusModule
.
PLCRegister
.
RegChangedEventHandler
(
plcregister_RegChanged
);
Addrs
.
Add
(
ADDR_D_PumpSet
,
"PumpSet"
);
Addrs
.
Add
(
ADDR_D_LeftSet
,
"LeftSet"
);
Addrs
.
Add
(
ADDR_D_Left
,
"Left"
);
Addrs
.
Add
(
ADDR_D_RightSet
,
"RightSet"
);
Addrs
.
Add
(
ADDR_D_Right
,
"Right"
);
Addrs
.
Add
(
ADDR_D_FilmVelocity
,
"FilmVelocity"
);
Addrs
.
Add
(
ADDR_C_OK
,
"OK"
);
Addrs
_reg
.
Add
(
ADDR_D_PumpSet
,
"PumpSet"
);
Addrs
_reg
.
Add
(
ADDR_D_LeftSet
,
"LeftSet"
);
Addrs
_reg
.
Add
(
ADDR_D_Left
,
"Left"
);
Addrs
_reg
.
Add
(
ADDR_D_RightSet
,
"RightSet"
);
Addrs
_reg
.
Add
(
ADDR_D_Right
,
"Right"
);
Addrs
_reg
.
Add
(
ADDR_D_FilmVelocity
,
"FilmVelocity"
);
Addrs
_coil
.
Add
(
ADDR_C_OK
,
"OK"
);
Addrs_coil
.
Add
(
ADDR_C_STATE
,
"State"
);
Misc
.
BindingOperations
.
SetBinding
(
cc
.
NowCtrl
,
"Pump"
,
this
,
"PumpSet"
,
Misc
.
BindingOperations
.
BindingMode
.
TwoWay
);
...
...
@@ -209,19 +210,22 @@ namespace FLY.Simulation.Coating
{
if
(
e
.
RegType
==
ModbusModule
.
PLCRegister
.
RegChangedEventArgs
.
REG_TYPE
.
REG
)
{
foreach
(
UInt16
key
in
Addrs
.
Keys
)
foreach
(
UInt16
key
in
Addrs
_reg
.
Keys
)
{
if
(
e
.
IsCover
(
key
))
{
NotifyPropertyChanged
(
Addrs
[
key
]);
NotifyPropertyChanged
(
Addrs
_reg
[
key
]);
}
}
}
else
{
if
(
e
.
IsCover
(
ADDR_C_STATE
))
foreach
(
UInt16
key
in
Addrs_coil
.
Keys
)
{
NotifyPropertyChanged
(
"State"
);
if
(
e
.
IsCover
(
key
))
{
NotifyPropertyChanged
(
Addrs_coil
[
key
]);
}
}
}
}
...
...
Project.FLY.FlyADBase/FLYAD7_Simulation_Wpf/WindowCoating.xaml
View file @
dd514bb7
...
...
@@ -12,6 +12,9 @@
<RowDefinition Height="auto" />
<RowDefinition Height="273*" />
</Grid.RowDefinitions>
<Grid x:Name="hmi_cc"/>
<Grid x:Name="inner_cc"/>
<Grid x:Name="hmi"/>
<StackPanel Orientation="Horizontal">
<Grid HorizontalAlignment="Left" Margin="12,3" >
<Grid.ColumnDefinitions>
...
...
@@ -63,17 +66,29 @@
<TextBlock Style="{StaticResource textBlockStyle_title}" Text="内部设置值" />
</Button>
<TextBlock Style="{StaticResource textBlockStyle_curr}" Grid.Column="1" Grid.Row="1" Text="{Binding Pump}" Name="textblock_pump_out"/>
<TextBlock Style="{StaticResource textBlockStyle_curr}" Grid.Column="1" Grid.Row="2" Text="{Binding LeftDis}" Name="textblock_left_out"/>
<TextBlock Style="{StaticResource textBlockStyle_curr}" Grid.Column="1" Grid.Row="3" Text="{Binding RightDis}" Name="textblock_right_out"/>
<StackPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="1" HorizontalAlignment="Center">
<TextBlock Style="{StaticResource textBlockStyle_curr}" Text="{Binding Pump}" DataContext="{Binding DataContext,ElementName=hmi_cc}"/>
<TextBlock Text="/"/>
<TextBlock Style="{StaticResource textBlockStyle_curr}" Text="{Binding PumpSet}" DataContext="{Binding DataContext,ElementName=hmi}" />
</StackPanel>
<StackPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="2" HorizontalAlignment="Center">
<TextBlock Style="{StaticResource textBlockStyle_curr}" Text="{Binding LeftDis}" DataContext="{Binding DataContext,ElementName=hmi_cc}" />
<TextBlock Text="/"/>
<TextBlock Style="{StaticResource textBlockStyle_curr}" Text="{Binding LeftSet}" DataContext="{Binding DataContext,ElementName=hmi}"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="3" HorizontalAlignment="Center">
<TextBlock Style="{StaticResource textBlockStyle_curr}" Text="{Binding RightDis}" DataContext="{Binding DataContext,ElementName=hmi_cc}"/>
<TextBlock Text="/"/>
<TextBlock Style="{StaticResource textBlockStyle_curr}" Text="{Binding RightSet}" DataContext="{Binding DataContext,ElementName=hmi}" />
</StackPanel>
<TextBox Style="{StaticResource textBoxStyle_set}" Grid.Column="2" Grid.Row="1" Name="textbox_pumpset_out" />
<TextBox Style="{StaticResource textBoxStyle_set}" Grid.Column="2" Grid.Row="2" Name="textbox_leftset_out" />
<TextBox Style="{StaticResource textBoxStyle_set}" Grid.Column="2" Grid.Row="3" Name="textbox_rightset_out" />
<TextBlock Style="{StaticResource textBlockStyle_curr}" Grid.Column="3" Grid.Row="1" Text="{Binding Pump}"
Name="textblock_pump_inner"
/>
<TextBlock Style="{StaticResource textBlockStyle_curr}" Grid.Column="3" Grid.Row="2" Text="{Binding LeftDis}"
Name="textblock_left_inner
"/>
<TextBlock Style="{StaticResource textBlockStyle_curr}" Grid.Column="3" Grid.Row="3" Text="{Binding RightDis}"
Name="textblock_right_inner
" />
<TextBlock Style="{StaticResource textBlockStyle_curr}" Grid.Column="3" Grid.Row="1" Text="{Binding Pump}"
DataContext="{Binding DataContext,ElementName=inner_cc}"
/>
<TextBlock Style="{StaticResource textBlockStyle_curr}" Grid.Column="3" Grid.Row="2" Text="{Binding LeftDis}"
DataContext="{Binding DataContext,ElementName=inner_cc}
"/>
<TextBlock Style="{StaticResource textBlockStyle_curr}" Grid.Column="3" Grid.Row="3" Text="{Binding RightDis}"
DataContext="{Binding DataContext,ElementName=inner_cc}
" />
<TextBox Style="{StaticResource textBoxStyle_set}" Grid.Column="4" Grid.Row="1" Name="textbox_pumpset_inner"/>
<TextBox Style="{StaticResource textBoxStyle_set}" Grid.Column="4" Grid.Row="2" Name="textbox_leftset_inner" />
...
...
Project.FLY.FlyADBase/FLYAD7_Simulation_Wpf/WindowCoating.xaml.cs
View file @
dd514bb7
...
...
@@ -33,14 +33,11 @@ namespace FLYAD7_Simulation_Wpf
public
void
Init
(
Coating
coating
)
{
mCoating
=
coating
;
textblock_pump_out
.
DataContext
=
mCoating
.
hmi_cc
.
NowCtrl
;
textblock_left_out
.
DataContext
=
mCoating
.
hmi
_cc
.
NowCtrl
;
textblock_right_out
.
DataContext
=
mCoating
.
hmi_cc
.
NowCtrl
;
hmi_cc
.
DataContext
=
mCoating
.
hmi_cc
.
NowCtrl
;
inner_cc
.
DataContext
=
mCoating
.
inner
_cc
.
NowCtrl
;
hmi
.
DataContext
=
mCoating
.
hmi
;
textblock_pump_inner
.
DataContext
=
mCoating
.
inner_cc
.
NowCtrl
;
textblock_left_inner
.
DataContext
=
mCoating
.
inner_cc
.
NowCtrl
;
textblock_right_inner
.
DataContext
=
mCoating
.
inner_cc
.
NowCtrl
;
this
.
DataContext
=
coating
;
...
...
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