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
582acd98
Commit
582acd98
authored
Jun 15, 2020
by
潘栩锋
🚴
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加 flyad7 吹膜模拟器 显示更多信息。
parent
adf9d9be
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
266 additions
and
89 deletions
+266
-89
Blowing.cs
Project.FLY.FlyADBase/FLY.Simulation.Blowing/Blowing.cs
+78
-39
GageAD.cs
Project.FLY.FlyADBase/FLY.Simulation.Blowing/GageAD.cs
+15
-8
WindowBlowing.xaml
...ct.FLY.FlyADBase/FLYAD7_Simulation_Wpf/WindowBlowing.xaml
+164
-37
WindowBlowing.xaml.cs
...FLY.FlyADBase/FLYAD7_Simulation_Wpf/WindowBlowing.xaml.cs
+9
-5
No files found.
Project.FLY.FlyADBase/FLY.Simulation.Blowing/Blowing.cs
View file @
582acd98
...
...
@@ -4,14 +4,13 @@ using System.Linq;
using
System.Text
;
using
System.ComponentModel
;
using
System.Collections.ObjectModel
;
using
System.IO
;
using
Newtonsoft.Json
;
namespace
FLY.Simulation.Blowing
{
/// <summary>
/// 吹膜模拟
/// 1.加载数据
/// </summary>
[
JsonObject
(
MemberSerialization
.
OptIn
)]
public
class
Blowing
:
INotifyPropertyChanged
{
#
region
参数
...
...
@@ -20,82 +19,89 @@ namespace FLY.Simulation.Blowing
/// <summary>
/// 两个限位间的角度范围 != 旋转的总角度,限位值 °
/// </summary>
public
double
AngleRange
;
[
JsonProperty
]
public
double
AngleRange
{
get
;
set
;
}
/// <summary>
/// 旋转的速度, min/R 1R = 360°
/// </summary>
[
JsonProperty
]
public
double
AngleVelocity
{
get
;
set
;
}
/// <summary>
/// 加速时间 单位 s
/// </summary>
public
double
AngleAccTime
;
[
JsonProperty
]
public
double
AngleAccTime
{
get
;
set
;
}
/// <summary>
/// 减速时间 单位 s
/// </summary>
public
double
AngleDecTime
;
[
JsonProperty
]
public
double
AngleDecTime
{
get
;
set
;
}
/// <summary>
/// 换方向冷却时间 单位s
/// </summary>
public
double
AngleCoolTime
;
[
JsonProperty
]
public
double
AngleCoolTime
{
get
;
set
;
}
#
endregion
#
region
膜
private
double
filmwidth
;
/// <summary>
/// 膜泡压扁后总宽度,单位
m
/// 膜泡压扁后总宽度,单位
脉冲
/// </summary>
public
double
FilmWidth
{
get
;
set
;
}
/// <summary>
/// 膜走带速度, m/min
/// </summary>
[
JsonProperty
]
public
double
FilmVelocity
{
get
;
set
;
}
/// <summary>
/// 人字架到测厚仪的距离 23m
/// </summary>
public
double
FilmDistance
;
[
JsonProperty
]
public
double
FilmDistance
{
get
;
set
;
}
/// <summary>
/// 辊轴承,单位mm
/// </summary>
public
double
RollPerimeter
;
[
JsonProperty
]
public
double
RollPerimeter
{
get
;
set
;
}
/// <summary>
/// 测辊信号,信号长,单位mm
/// </summary>
public
double
RollSignLength
;
[
JsonProperty
]
public
double
RollSignLength
{
get
;
set
;
}
#
endregion
//#region 风环
///// <summary>
///// 加热棒数量
///// </summary>
//public int ChannelCnt;
#
region
风环
/// <summary>
/// 加热棒数量
/// </summary>
[
JsonProperty
]
public
int
ChannelCnt
{
get
;
set
;
}
///// <summary>
///// 加热功率, 1~100
///// </summary>
//public int[] Heats;
///// <summary>
///// 第1根加热棒对应角度
///// </summary>
//public int Channel1stAngle;
/// <summary>
/// 第1根加热棒对应角度
/// </summary>
[
JsonProperty
]
public
double
Channel1stAngle
{
get
;
set
;
}
///// <summary>
///// 温度影响厚度变化比例, 1厚度,对应多少加热
///// </summary>
//public int Factor;//
//
#endregion
#
endregion
public
bool
IsShieldI9
{
get
;
set
;
}
...
...
@@ -105,21 +111,21 @@ namespace FLY.Simulation.Blowing
/// <summary>
/// 当前人字架角度 °
/// </summary>
public
double
CurrAngle
{
get
;
set
;
}
public
double
CurrAngle
{
get
;
private
set
;
}
/// <summary>
/// 当前速度,单位 °/s
/// </summary>
public
double
CurrAngleVelocity
;
public
double
CurrAngleVelocity
{
get
;
private
set
;
}
/// <summary>
/// 当前加速度, 单位 °/s^2
/// </summary>
public
double
CurrAngleAccV
;
public
double
CurrAngleAccV
{
get
;
private
set
;
}
/// <summary>
/// 当前已经走到长度, 通过编码器获取 单位 m
/// </summary>
public
double
CurrFilmLength
;
public
double
CurrFilmLength
{
get
;
private
set
;
}
#
endregion
public
HMI
mHMI
;
...
...
@@ -177,6 +183,13 @@ namespace FLY.Simulation.Blowing
RollPerimeter
=
314
;
//辊周长mm
RollSignLength
=
30
;
//辊信号长度mm
ChannelCnt
=
88
;
//加热棒数量
Channel1stAngle
=
100
;
//第1根加热棒对应角度
if
(!
Load
())
Save
();
//整个膜片1000个数据
int
[]
datas
=
OrgData
.
GetData
(
1000
);
for
(
int
i
=
0
;
i
<
1000
;
i
++)
...
...
@@ -186,12 +199,12 @@ namespace FLY.Simulation.Blowing
AfterDatas
.
Add
(
datas
[
i
]);
//系统扰动后 再 加热数据
}
mAirRing
=
new
AirRing
(
88
);
//44
支加热棒
mAirRing
=
new
AirRing
(
ChannelCnt
);
//88
支加热棒
mAirRing
.
Init
(
BeforeDatas
,
BeforeDatas2
,
0
);
mAirRing2
=
new
AirRing
(
88
);
//44
支加热棒;
mAirRing2
.
Init
(
BeforeDatas2
,
AfterDatas
,
400
);
//加热偏移了 400个数据, 总数是1000
mAirRing2
=
new
AirRing
(
ChannelCnt
);
//88
支加热棒;
mAirRing2
.
Init
(
BeforeDatas2
,
AfterDatas
,
(
int
)(
1000
*
Channel1stAngle
/
360
));
//加热偏移了
mAirRing2
.
AfterDatasUpdateEvent
+=
new
Action
<
ObservableCollection
<
int
>>(
mAirRing2_AfterDatasUpdateEvent
);
Avg
=
(
int
)(
BeforeDatas
.
Average
());
//原始平均值
...
...
@@ -208,7 +221,7 @@ namespace FLY.Simulation.Blowing
void
mAirRing2_AfterDatasUpdateEvent
(
ObservableCollection
<
int
>
obj
)
{
NotifyPropertyChanged
(
"AfterDatas"
);
NotifyPropertyChanged
(
nameof
(
AfterDatas
)
);
}
...
...
@@ -377,7 +390,7 @@ namespace FLY.Simulation.Blowing
void
Blowing_PropertyChanged
(
object
sender
,
PropertyChangedEventArgs
e
)
{
if
(
e
.
PropertyName
==
"Avg"
)
if
(
e
.
PropertyName
==
nameof
(
Avg
)
)
{
int
avg
=
(
int
)(
BeforeDatas
.
Average
());
int
offset
=
Avg
-
avg
;
...
...
@@ -389,7 +402,7 @@ namespace FLY.Simulation.Blowing
}
}
}
else
if
(
e
.
PropertyName
==
"TestPos"
)
else
if
(
e
.
PropertyName
==
nameof
(
TestPos
)
)
{
UpdateTestHeat
();
}
...
...
@@ -661,6 +674,30 @@ namespace FLY.Simulation.Blowing
}
}
public
event
PropertyChangedEventHandler
PropertyChanged
;
private
string
param_path
=
"simulation_blowing.json"
;
public
void
Save
()
{
string
json
=
Newtonsoft
.
Json
.
JsonConvert
.
SerializeObject
(
this
,
Formatting
.
Indented
);
File
.
WriteAllText
(
param_path
,
json
);
}
bool
Load
()
{
if
(!
File
.
Exists
(
param_path
))
return
false
;
try
{
string
json
=
File
.
ReadAllText
(
param_path
);
Newtonsoft
.
Json
.
JsonConvert
.
PopulateObject
(
json
,
this
);
return
true
;
}
catch
{
return
false
;
}
}
}
public
class
FilmData
{
...
...
@@ -669,4 +706,6 @@ namespace FLY.Simulation.Blowing
public
int
data1
;
public
int
data2
;
}
}
Project.FLY.FlyADBase/FLY.Simulation.Blowing/GageAD.cs
View file @
582acd98
...
...
@@ -35,30 +35,35 @@ namespace FLY.Simulation.Blowing
public
int
FilmBegin
;
/// <summary>
/// 传感器直径
/// 传感器直径
,单位脉冲
/// </summary>
public
int
SenserWidth
;
public
int
[]
AirDatas
;
CurveCollection
curve
;
double
ppmm
;
public
GageAD
()
{
curve
=
new
CurveCollection
();
double
mm_gagelen
=
3000
;
//设备总长3m
double
mm_filmwidth
=
2300
;
//膜宽2.3m
mBlowing
=
new
Blowing
();
double
m_filmwidth
=
mBlowing
.
FilmWidth
;
//膜宽2.3m
double
m_gagelen
=
3
;
//设备总长3m
double
mm_senserwidth
=
15
;
//传感器15mm
double
mm_filmbegin
=
300
;
//mm
PosLen
=
8030
;
double
ppmm
=
PosLen
/
mm_gagelen
;
ppmm
=
PosLen
/
(
m_gagelen
*
1000
)
;
FilmWidth
=
(
int
)(
m
m_filmwidth
*
ppmm
);
FilmWidth
=
(
int
)(
m
_filmwidth
*
1000
*
ppmm
);
FilmBegin
=
(
int
)(
mm_filmbegin
*
ppmm
);
SenserWidth
=
(
int
)(
mm_senserwidth
*
ppmm
);
mBlowing
=
new
Blowing
();
mBlowing
.
FilmWidth
=
FilmWidth
;
AirDatas
=
new
int
[
PosLen
];
NewAirDatas
();
...
...
@@ -96,7 +101,9 @@ namespace FLY.Simulation.Blowing
if
((
idx
>=
FilmBegin
)
&&
(
idx
<(
FilmBegin
+
FilmWidth
)))
{
FilmData
fd
=
mBlowing
.
GetData
(
idx
-
FilmBegin
);
int
position
=
idx
-
FilmBegin
;
double
pos_m
=
position
/
ppmm
/
1000.0
;
FilmData
fd
=
mBlowing
.
GetData
(
pos_m
);
if
(
fd
!=
null
)
{
data
+=
fd
.
data1
+
fd
.
data2
;
...
...
Project.FLY.FlyADBase/FLYAD7_Simulation_Wpf/WindowBlowing.xaml
View file @
582acd98
...
...
@@ -3,46 +3,173 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Chr="clr-namespace:System.Windows.Forms.DataVisualization.Charting;assembly=System.Windows.Forms.DataVisualization"
Title="吹膜模拟" Height="595" Width="507" Loaded="Window_Loaded">
Title="吹膜模拟" MinWidth="500" Loaded="Window_Loaded" SizeToContent="WidthAndHeight">
<Window.Resources>
<ResourceDictionary>
<Style TargetType="TextBlock" x:Key="TitleStyle">
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="FontSize" Value="18"/>
<Setter Property="Margin" Value="2"/>
</Style>
<Style TargetType="TextBlock" x:Key="H3Style">
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="FontSize" Value="12"/>
<Setter Property="Margin" Value="2"/>
</Style>
<Style TargetType="TextBlock" x:Key="FieldNameStyle">
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="FontSize" Value="12"/>
<Setter Property="Width" Value="120"/>
<Setter Property="Margin" Value="2"/>
</Style>
<Style TargetType="TextBlock" x:Key="FieldValueStyle">
<Setter Property="FontSize" Value="12"/>
<Setter Property="Width" Value="120"/>
<Setter Property="Margin" Value="2"/>
</Style>
<Style TargetType="TextBox" x:Key="InputStyle">
<Setter Property="Height" Value="23"/>
<Setter Property="Width" Value="120"/>
<Setter Property="Margin" Value="2"/>
</Style>
<Style TargetType="Button" x:Key="ButtonStyle">
<Setter Property="Padding" Value="10,5"/>
<Setter Property="Margin" Value="5"/>
</Style>
</ResourceDictionary>
</Window.Resources>
<Grid>
<TextBox Height="23" HorizontalAlignment="Left" Margin="12,41,0,0" Name="textBox1" VerticalAlignment="Top" Width="120" Text="{Binding FilmVelocity, StringFormat={}{0:F1}}"/>
<TextBlock Height="23" HorizontalAlignment="Left" Margin="12,12,0,0" Name="textBlock1" Text="线速度(m/min)" VerticalAlignment="Top" FontWeight="Bold" FontSize="18" />
<TextBlock Height="23" HorizontalAlignment="Left" Margin="166,12,0,0" Name="textBlock2" Text="旋转速度(min/R)" VerticalAlignment="Top" FontSize="18" FontWeight="Bold" />
<TextBox Height="23" HorizontalAlignment="Left" Margin="166,41,0,0" Name="textBox2" VerticalAlignment="Top" Width="120" Text="{Binding AngleVelocity, StringFormat={}{0:F1}}"/>
<TextBlock Height="23" HorizontalAlignment="Left" Margin="13,70,0,0" Name="textBlock3" Text="均值(um)" VerticalAlignment="Top" FontSize="18" FontWeight="Bold" />
<TextBox Height="23" HorizontalAlignment="Left" Margin="12,99,0,0" Name="textBox3" VerticalAlignment="Top" Width="120" Text="{Binding Avg}" />
<Slider Height="23" HorizontalAlignment="Left" Margin="95,163,0,0" Name="slider1" VerticalAlignment="Top" Width="383" Maximum="999" Minimum="1" Value="{Binding TestPos}"/>
<TextBlock Height="23" HorizontalAlignment="Left" Margin="12,137,0,0" Name="textBlock4" Text="厚度变化" VerticalAlignment="Top" FontSize="18" FontWeight="Bold" />
<TextBlock Height="23" HorizontalAlignment="Left" Margin="13,163,0,0" Name="textBlock5" VerticalAlignment="Top" FontWeight="Bold" >
<TextBlock.Inlines>
<Run Text="位置:"/>
<Run Text="{Binding TestPos}"/>
</TextBlock.Inlines>
</TextBlock>
<Slider Height="23" HorizontalAlignment="Left" Margin="95,192,0,0" Name="slider2" VerticalAlignment="Top" Width="383" Value="{Binding TestHeat}" Minimum="0" Maximum="100"/>
<TextBlock Height="23" HorizontalAlignment="Left" Margin="13,192,0,0" Name="textBlock6" VerticalAlignment="Top" FontWeight="Bold" >
<TextBlock.Inlines>
<Run Text="加热功率:"/>
<Run Text="{Binding TestHeat}"/>
</TextBlock.Inlines>
</TextBlock>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions>
<StackPanel>
<StackPanel Orientation="Horizontal" Margin="2">
<StackPanel Margin="2">
<StackPanel Orientation="Horizontal">
<StackPanel Margin="2">
<TextBlock Style="{StaticResource TitleStyle}" Text="线速度(m/min)" />
<TextBox Style="{StaticResource InputStyle}" Text="{Binding FilmVelocity, StringFormat={}{0:F1}}"/>
</StackPanel>
<StackPanel Margin="2">
<TextBlock Style="{StaticResource TitleStyle}" Text="旋转速度(min/R)" />
<TextBox Style="{StaticResource InputStyle}" Text="{Binding AngleVelocity, StringFormat={}{0:F1}}"/>
</StackPanel>
</StackPanel>
<StackPanel Orientation="Horizontal">
<StackPanel Margin="2">
<TextBlock Style="{StaticResource TitleStyle}" Text="均值(um)" />
<TextBox Style="{StaticResource InputStyle}" Text="{Binding Avg}"/>
</StackPanel>
<StackPanel Margin="2">
<TextBlock Style="{StaticResource TitleStyle}" Text="当前角度(°)" />
<TextBlock Style="{StaticResource FieldValueStyle}" Text="{Binding CurrAngle,StringFormat={}{0:F1}}"/>
</StackPanel>
<StackPanel Margin="2">
<TextBlock Style="{StaticResource TitleStyle}" Text="当前纵向位置(m)" />
<TextBlock Style="{StaticResource FieldValueStyle}" Text="{Binding CurrFilmLength,StringFormat={}{0:F1}}"/>
</StackPanel>
</StackPanel>
</StackPanel>
<GroupBox Header="电柜" Margin="2" >
<StackPanel >
<StackPanel x:Name="spPlc">
<CheckBox Content="电流计" Height="16" Margin="5" IsChecked="{Binding HasElectricCurrent}" IsEnabled="False"/>
<CheckBox Content="风机开" Height="16" Margin="5" IsChecked="{Binding HasFan}" />
</StackPanel>
<CheckBox Content="屏蔽I9" Height="16" Margin="5" IsChecked="{Binding IsShieldI9}" />
</StackPanel>
</GroupBox>
</StackPanel>
<StackPanel Margin="2">
<StackPanel Orientation="Horizontal" Margin="2">
<TextBlock Style="{StaticResource TitleStyle}" Text="厚度改变" />
<Button Style="{StaticResource ButtonStyle}" Content="应用" Click="button1_Click" />
</StackPanel>
<Grid Margin="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<TextBlock Style="{StaticResource H3Style}" Width="100" >
<TextBlock.Inlines>
<Run Text="位置:"/>
<Run Text="{Binding TestPos}"/>
</TextBlock.Inlines>
</TextBlock>
<Slider Grid.Column="1" Margin="2" Minimum="0" Maximum="999" Value="{Binding TestPos}"/>
</Grid>
<Grid Margin="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<TextBlock Style="{StaticResource H3Style}" Width="100" >
<TextBlock.Inlines>
<Run Text="加热功率:"/>
<Run Text="{Binding TestHeat}"/>
</TextBlock.Inlines>
</TextBlock>
<Slider Grid.Column="1" Margin="2" Value="{Binding TestHeat}" Minimum="0" Maximum="100"/>
</Grid>
</StackPanel>
<TextBlock FontSize="18" FontWeight="Bold" Height="23" HorizontalAlignment="Left" Margin="166,70,0,0" Name="textBlock9" Text="当前角度(°)" VerticalAlignment="Top" />
<TextBox Height="23" HorizontalAlignment="Left" Margin="166,99,0,0" Name="textBox4" VerticalAlignment="Top" Width="120" Text="{Binding CurrAngle,StringFormat={}{0:F1}}"/>
<Button Content="应用" Height="23" HorizontalAlignment="Left" Margin="398,139,0,0" Name="button1" VerticalAlignment="Top" Width="75" Click="button1_Click" />
<WindowsFormsHost Height="159" HorizontalAlignment="Left" Margin="12,221,0,0" Name="windowsFormsHost1" VerticalAlignment="Top" Width="466" >
<Chr:Chart x:Name="chart1" />
</WindowsFormsHost>
<WindowsFormsHost Height="159" HorizontalAlignment="Left" Margin="12,386,0,0" VerticalAlignment="Top" Width="466" >
<Chr:Chart x:Name="chart2" />
</WindowsFormsHost>
<GroupBox Header="电柜" Height="108" HorizontalAlignment="Left" Margin="328,12,0,0" Name="groupBox1" VerticalAlignment="Top" Width="145">
<StackPanel Orientation="Vertical">
<CheckBox Content="电流计" Height="16" Margin="5" IsChecked="{Binding HasElectricCurrent}" IsEnabled="False"/>
<CheckBox Content="风机开" Height="16" Margin="5" IsChecked="{Binding HasFan}" />
<CheckBox x:Name="checkbox_isShieldI9" Content="屏蔽I9" Height="16" Margin="5" IsChecked="{Binding IsShieldI9}" />
<WindowsFormsHost Height="160" Margin="2" >
<Chr:Chart x:Name="chart1" />
</WindowsFormsHost>
<WindowsFormsHost Height="160" Margin="2" >
<Chr:Chart x:Name="chart2" />
</WindowsFormsHost>
</StackPanel>
<GroupBox Margin="2" Grid.Column="1">
<GroupBox.Header>
<TextBlock Style="{StaticResource TitleStyle}" Text="需要重启才能生效参数"/>
</GroupBox.Header>
<StackPanel>
<StackPanel Orientation="Horizontal" Margin="2">
<TextBlock Style="{StaticResource FieldNameStyle}" Text="旋转加速时间(s)"/>
<TextBox Style="{StaticResource InputStyle}" Text="{Binding AngleAccTime}"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="2">
<TextBlock Style="{StaticResource FieldNameStyle}" Text="旋转减速时间(s)"/>
<TextBox Style="{StaticResource InputStyle}" Text="{Binding AngleDecTime}"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="2">
<TextBlock Style="{StaticResource FieldNameStyle}" Text="换方向冷却时间(s)"/>
<TextBox Style="{StaticResource InputStyle}" Text="{Binding AngleCoolTime}"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="2">
<TextBlock Style="{StaticResource FieldNameStyle}" Text="膜泡压扁后总宽度(m)"/>
<TextBox Style="{StaticResource InputStyle}" Text="{Binding FilmWidth}"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="2">
<TextBlock Style="{StaticResource FieldNameStyle}" Text="膜走带速度(m/min)"/>
<TextBox Style="{StaticResource InputStyle}" Text="{Binding FilmVelocity}"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="2">
<TextBlock Style="{StaticResource FieldNameStyle}" Text="膜距离(m)"/>
<TextBox Style="{StaticResource InputStyle}" Text="{Binding FilmDistance}"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="2">
<TextBlock Style="{StaticResource FieldNameStyle}" Text="辊信号长(mm)"/>
<TextBox Style="{StaticResource InputStyle}" Text="{Binding RollSignLength}"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="2">
<TextBlock Style="{StaticResource FieldNameStyle}" Text="加热棒数量"/>
<TextBox Style="{StaticResource InputStyle}" Text="{Binding ChannelCnt}"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="2">
<TextBlock Style="{StaticResource FieldNameStyle}" Text="第1根加热棒对应角度"/>
<TextBox Style="{StaticResource InputStyle}" Text="{Binding Channel1stAngle}"/>
</StackPanel>
<Button Style="{StaticResource ButtonStyle}" Content="保存" Click="btnSaveClick"/>
</StackPanel>
</GroupBox>
</Grid>
</Window>
Project.FLY.FlyADBase/FLYAD7_Simulation_Wpf/WindowBlowing.xaml.cs
View file @
582acd98
...
...
@@ -147,23 +147,22 @@ namespace FLYAD7_Simulation_Wpf
private
void
Window_Loaded
(
object
sender
,
RoutedEventArgs
e
)
{
this
.
DataContext
=
mBlowing
;
this
.
groupBox1
.
DataContext
=
mBlowing
.
mHMI
;
this
.
spPlc
.
DataContext
=
mBlowing
.
mHMI
;
mBlowing
.
PropertyChanged
+=
new
System
.
ComponentModel
.
PropertyChangedEventHandler
(
mBlowing_PropertyChanged
);
DataBindAll
();
chart1
.
ChartAreas
[
"Default"
].
CursorX
.
Position
=
mBlowing
.
TestPos
;
DataBindAll_chart2
();
this
.
checkbox_isShieldI9
.
DataContext
=
mBlowing
;
}
void
mBlowing_PropertyChanged
(
object
sender
,
System
.
ComponentModel
.
PropertyChangedEventArgs
e
)
{
if
(
e
.
PropertyName
==
"TestPos"
)
if
(
e
.
PropertyName
==
nameof
(
mBlowing
.
TestPos
)
)
{
chart1
.
ChartAreas
[
"Default"
].
CursorX
.
Position
=
mBlowing
.
TestPos
;
}
else
if
(
e
.
PropertyName
==
"AfterDatas"
)
else
if
(
e
.
PropertyName
==
nameof
(
mBlowing
.
AfterDatas
)
)
{
this
.
Dispatcher
.
Invoke
(
new
Action
(
DataBindAll2_chart2
));
this
.
Dispatcher
.
Invoke
(
new
Action
(
DataBindAll2
));
...
...
@@ -220,6 +219,11 @@ namespace FLYAD7_Simulation_Wpf
{
mBlowing
.
Test
();
}
private
void
btnSaveClick
(
object
sender
,
RoutedEventArgs
e
)
{
mBlowing
.
Save
();
MessageBox
.
Show
(
"已经保存数据,请重启"
);
}
}
}
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