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
87bd01c2
Commit
87bd01c2
authored
Apr 07, 2022
by
潘栩锋
🚴
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加 AD盒模拟器 电池涂布 添加泵损坏导致纵向波动模拟
parent
6c67770d
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
97 additions
and
23 deletions
+97
-23
Coating.cs
Project.FLY.FlyADBase/FLY.Simulation.Coating/Coating.cs
+61
-11
FLY.Simulation.Calender.GuRuiShiYe.csproj
...nder.GuRuiShiYe/FLY.Simulation.Calender.GuRuiShiYe.csproj
+0
-0
FodyWeavers.xml
...Double/FLY.Simulation.Calender.GuRuiShiYe/FodyWeavers.xml
+0
-0
FodyWeavers.xsd
...Double/FLY.Simulation.Calender.GuRuiShiYe/FodyWeavers.xsd
+0
-0
Gage.cs
...ulation.Double/FLY.Simulation.Calender.GuRuiShiYe/Gage.cs
+0
-0
GageAD.cs
...ation.Double/FLY.Simulation.Calender.GuRuiShiYe/GageAD.cs
+0
-0
AssemblyInfo.cs
...Simulation.Calender.GuRuiShiYe/Properties/AssemblyInfo.cs
+0
-0
FLYAD7.cs
Project.FLY.FlyADBase/FLY.Simulation.Flyad7/FLYAD7.cs
+3
-3
WindowCoating.xaml
...ct.FLY.FlyADBase/FLYAD7_Simulation_Wpf/WindowCoating.xaml
+8
-3
WindowCoating.xaml.cs
...FLY.FlyADBase/FLYAD7_Simulation_Wpf/WindowCoating.xaml.cs
+5
-4
RangeStruct.cs
Project.FLY.Misc/MISC/RangeStruct.cs
+20
-2
No files found.
Project.FLY.FlyADBase/FLY.Simulation.Coating/Coating.cs
View file @
87bd01c2
...
...
@@ -57,7 +57,10 @@ namespace FLY.Simulation.Coating
public
List
<
DataInfo
>
Datas_Horizontal
=
new
List
<
DataInfo
>();
//横向数据
double
datas_horizontal_avg
=
0
;
int
datas_vertical_position
=
0
;
/// <summary>
/// 由于泵损坏带来的纵向波动
/// </summary>
double
datas_vertical_pumpDamaged
=
0
;
//30m 后的数据
public
List
<
DataInfo
>
Datas_Vertical_30m
=
new
List
<
DataInfo
>();
//纵向数据
...
...
@@ -65,6 +68,7 @@ namespace FLY.Simulation.Coating
int
datas_vertical_30m_position
=
0
;
/// <summary>
/// 膜宽
/// </summary>
...
...
@@ -123,9 +127,24 @@ namespace FLY.Simulation.Coating
/// </summary>
public
bool
HSignal2
;
/// <summary>
/// 设备状态
/// </summary>
public
bool
DeviceState
{
get
;
set
;
}
/// <summary>
/// 泵的转子坏了, 会看到有周期的波动,周期为 泵速
/// </summary>
public
bool
IsPumpDamaged
{
get
;
set
;
}
/// <summary>
/// 由于 泵的转子坏了 导致 面密度 周期的波动 的变化公差,单位g/m²
/// </summary>
public
double
ToleranceOfPumpBeDamaged
{
get
;
set
;
}
=
1
;
/// <summary>
/// 均值
/// </summary>
public
double
Avg
{
get
;
set
;
}
void
Load_Vertical
()
...
...
@@ -143,7 +162,7 @@ namespace FLY.Simulation.Coating
int
pos_mm
=
int
.
Parse
(
ss
[
0
]);
bool
isLight
=
bool
.
Parse
(
ss
[
1
]);
bool
isLight2
=
bool
.
Parse
(
ss
[
2
]);
double
thick
=
double
.
Parse
(
ss
[
3
]);
double
thick
=
double
.
Parse
(
ss
[
3
]);
//单位 g/m²
Datas_Vertical
.
Add
(
new
DataInfo
()
{
IsLight
=
isLight
,
IsLight2
=
isLight2
,
Thick
=
thick
});
Datas_Vertical_30m
.
Add
(
new
DataInfo
()
{
IsLight
=
isLight
,
IsLight2
=
isLight2
,
Thick
=
thick
});
...
...
@@ -216,8 +235,12 @@ namespace FLY.Simulation.Coating
return
0
;
if
(
mm
>=
FilmWidth
)
return
0
;
return
Datas_Vertical_30m
[
datas_vertical_position
].
Thick
*
Datas_Horizontal_30m
[
mm
].
Thick
/
datas_horizontal_avg
;
double
d
=
Datas_Vertical_30m
[
datas_vertical_position
].
Thick
*
Datas_Horizontal_30m
[
mm
].
Thick
/
datas_horizontal_avg
;
if
(
IsPumpDamaged
)
{
d
+=
datas_vertical_pumpDamaged
;
}
return
d
;
}
public
double
GetData
(
int
mm
)
{
...
...
@@ -226,7 +249,13 @@ namespace FLY.Simulation.Coating
if
(
mm
>=
FilmWidth
)
return
0
;
return
Datas_Vertical
[
datas_vertical_position
].
Thick
*
Datas_Horizontal
[
mm
].
Thick
/
datas_horizontal_avg
;
double
d
=
Datas_Vertical
[
datas_vertical_position
].
Thick
*
Datas_Horizontal
[
mm
].
Thick
/
datas_horizontal_avg
;
if
(
IsPumpDamaged
)
{
d
+=
datas_vertical_pumpDamaged
;
}
return
d
;
}
/// <summary>
/// 上一个时间点
...
...
@@ -249,18 +278,33 @@ namespace FLY.Simulation.Coating
double
filmMove
=
ts
.
TotalMinutes
*
FilmVelocity
;
FilmLength
+=
filmMove
;
//膜位置
int
p1
=
(
int
)(
FilmLength
*
1000
%
Datas_Vertical
.
Count
());
if
(
p1
!=
datas_vertical_position
)
{
datas_vertical_position
=
p1
;
Avg
=
Datas_Vertical
[
datas_vertical_position
].
Thick
/
100.0
;
if
(
AvgChanged
!=
null
)
double
avg
=
Datas_Vertical
[
datas_vertical_position
].
Thick
;
if
(
hmi_cc
.
NowCtrl
.
Pump
>
0
&&
IsPumpDamaged
)
{
AvgChanged
(
FilmLength
,
(
int
)(
Avg
*
100
));
// 泵损坏 周期 m
double
intervalOfPumpDamage
=
FilmVelocity
/
hmi_cc
.
NowCtrl
.
Pump
;
double
index
=
FilmLength
%
intervalOfPumpDamage
;
double
percent
=
index
/
intervalOfPumpDamage
;
double
v
=
ToleranceOfPumpBeDamaged
*
Math
.
Sin
(
Math
.
PI
*
2
*
percent
);
datas_vertical_pumpDamaged
=
v
;
avg
+=
datas_vertical_pumpDamaged
;
}
Avg
=
avg
;
AvgChanged
?.
Invoke
(
this
,
new
AvgChangedEventArgs
()
{
filmLength
=
FilmLength
,
avg
=
Avg
});
}
datas_vertical_30m_position
=
(
int
)((
FilmLength
-
OvenLength
)
*
1000
%
Datas_Vertical
.
Count
());
if
(
datas_vertical_30m_position
<
0
)
datas_vertical_30m_position
+=
Datas_Vertical
.
Count
();
...
...
@@ -288,7 +332,12 @@ namespace FLY.Simulation.Coating
/// <summary>
/// 每1mm更新一次
/// </summary>
public
event
Action
<
double
,
int
>
AvgChanged
;
public
event
AvgChangedEventHandler
AvgChanged
;
public
delegate
void
AvgChangedEventHandler
(
object
sender
,
AvgChangedEventArgs
args
);
public
class
AvgChangedEventArgs
:
EventArgs
{
public
double
filmLength
;
public
double
avg
;
}
public
event
Action
DatasChanged
;
public
event
Action
Datas30mChanged
;
public
void
NotifyDatasChanged
()
...
...
@@ -317,12 +366,13 @@ namespace FLY.Simulation.Coating
public
string
[]
GetSavePropertyNames
()
{
return
new
string
[]
{
"Port"
,
"CoatingMode"
nameof
(
Port
)
,
nameof
(
CoatingMode
)
};
}
}
/// <summary>
/// 涂布控制量
/// </summary>
...
...
Project.FLY.FlyADBase/FLY.Simulation.Calender.GuRuiShiYe/FLY.Simulation.Calender.GuRuiShiYe.csproj
→
Project.FLY.FlyADBase/FLY.Simulation.
Double/FLY.Simulation.
Calender.GuRuiShiYe/FLY.Simulation.Calender.GuRuiShiYe.csproj
View file @
87bd01c2
File moved
Project.FLY.FlyADBase/FLY.Simulation.Calender.GuRuiShiYe/FodyWeavers.xml
→
Project.FLY.FlyADBase/FLY.Simulation.
Double/FLY.Simulation.
Calender.GuRuiShiYe/FodyWeavers.xml
View file @
87bd01c2
File moved
Project.FLY.FlyADBase/FLY.Simulation.Calender.GuRuiShiYe/FodyWeavers.xsd
→
Project.FLY.FlyADBase/FLY.Simulation.
Double/FLY.Simulation.
Calender.GuRuiShiYe/FodyWeavers.xsd
View file @
87bd01c2
File moved
Project.FLY.FlyADBase/FLY.Simulation.Calender.GuRuiShiYe/Gage.cs
→
Project.FLY.FlyADBase/FLY.Simulation.
Double/FLY.Simulation.
Calender.GuRuiShiYe/Gage.cs
View file @
87bd01c2
File moved
Project.FLY.FlyADBase/FLY.Simulation.Calender.GuRuiShiYe/GageAD.cs
→
Project.FLY.FlyADBase/FLY.Simulation.
Double/FLY.Simulation.
Calender.GuRuiShiYe/GageAD.cs
View file @
87bd01c2
File moved
Project.FLY.FlyADBase/FLY.Simulation.Calender.GuRuiShiYe/Properties/AssemblyInfo.cs
→
Project.FLY.FlyADBase/FLY.Simulation.
Double/FLY.Simulation.
Calender.GuRuiShiYe/Properties/AssemblyInfo.cs
View file @
87bd01c2
File moved
Project.FLY.FlyADBase/FLY.Simulation.Flyad7/FLYAD7.cs
View file @
87bd01c2
...
...
@@ -330,8 +330,8 @@ namespace FLY.Simulation.Flyad7
}
else
{
Now
+=
FlyADBase
.
TimeGridAdvHelperExt
.
ad_ts
;
systick
+=
FlyADBase
.
TimeGridAdvHelperExt
.
ad_ts_ms
;
Now
+=
TimeSpan
.
FromTicks
((
long
)(
1.28
*
TimeSpan
.
TicksPerMillisecond
))
;
systick
+=
1.28
;
}
UpdateAD
();
...
...
@@ -385,7 +385,7 @@ namespace FLY.Simulation.Flyad7
TimeGridEvent
.
Invoke
(
this
,
new
TimeGridEventArgs
(
Now
,
FlyADBase
.
TimeGridAdvHelperExt
.
ad_ts
,
TimeSpan
.
FromTicks
((
long
)(
1.28
*
TimeSpan
.
TicksPerMillisecond
))
,
TimeGrid
.
ToArray
()));
}
TimeGrid
.
Clear
();
...
...
Project.FLY.FlyADBase/FLYAD7_Simulation_Wpf/WindowCoating.xaml
View file @
87bd01c2
...
...
@@ -97,8 +97,13 @@
</Grid>
<StackPanel>
<CheckBox Content="设置位" FontSize="18" FontWeight="Bold" Height="23" Margin="3" VerticalAlignment="Center" FlowDirection="RightToLeft" IsChecked="{Binding OK}" DataContext="{Binding DataContext,ElementName=hmi}"/>
<CheckBox Content="涂布状态" FontSize="18" FontWeight="Bold" Height="23" Margin="3" VerticalAlignment="Center" FlowDirection="RightToLeft" IsChecked="{Binding DeviceState}" IsEnabled="False"/>
<CheckBox Content="设置位" FontSize="18" FontWeight="Bold" Height="23" Margin="3" IsChecked="{Binding OK}" DataContext="{Binding DataContext,ElementName=hmi}"/>
<CheckBox Content="涂布状态" FontSize="18" FontWeight="Bold" Height="23" Margin="3" IsChecked="{Binding DeviceState}" IsEnabled="False"/>
<CheckBox Content="泵损坏" FontSize="18" FontWeight="Bold" Height="23" Margin="3" IsChecked="{Binding IsPumpDamaged}" />
<StackPanel Orientation="Horizontal">
<TextBlock Text="泵公差" FontSize="18" FontWeight="Bold" Height="23" Margin="3" />
<TextBox Text="{Binding ToleranceOfPumpBeDamaged }" FontSize="18" MinWidth="50"/>
</StackPanel>
</StackPanel>
</StackPanel>
...
...
@@ -122,7 +127,7 @@
</ComboBox>
<TextBlock FontSize="18" FontWeight="Bold" Height="23" Margin="3" VerticalAlignment="Center" >
<Run Text="当前平均值:" />
<Run Text="{Binding Avg}" />
<Run Text="{Binding Avg
,StringFormat={}{0:F2}
}" />
</TextBlock>
</StackPanel>
<Grid Margin="12,3" Grid.Row="2">
...
...
Project.FLY.FlyADBase/FLYAD7_Simulation_Wpf/WindowCoating.xaml.cs
View file @
87bd01c2
...
...
@@ -44,12 +44,13 @@ namespace FLYAD7_Simulation_Wpf
DataBindAll
();
mCoating
.
DatasChanged
+=
new
Action
(
mCoating_DatasChanged
);
mCoating
.
AvgChanged
+=
new
Action
<
double
,
int
>(
mCoating_AvgChanged
)
;
mCoating
.
AvgChanged
+=
MCoating_AvgChanged
;
}
void
mCoating_AvgChanged
(
double
arg1
,
int
arg2
)
private
void
MCoating_AvgChanged
(
object
sender
,
Coating
.
AvgChangedEventArgs
args
)
{
int
filmlength_cm
=
(
int
)(
arg1
*
100
);
int
filmlength_cm
=
(
int
)(
args
.
filmLength
*
100
);
if
(
FilmLength_cm
==
filmlength_cm
)
{
...
...
@@ -73,7 +74,7 @@ namespace FLYAD7_Simulation_Wpf
}
datas
.
Clear
();
}
datas
.
Add
(
arg
2
);
datas
.
Add
(
arg
s
.
avg
);
}
void
mCoating_DatasChanged
()
...
...
Project.FLY.Misc/MISC/RangeStruct.cs
View file @
87bd01c2
...
...
@@ -150,14 +150,32 @@ namespace Misc
};
if
(
r
.
End
<
r
.
Begin
)
{
return
new
RangeStruct
()
;
return
InvalidValue
;
}
else
{
return
r
;
}
}
/// <summary>
/// 范围 减
/// </summary>
/// <param name="a"></param>
/// <param name="b"></param>
/// <returns></returns>
public
static
RangeStruct
operator
-(
RangeStruct
a
,
RangeStruct
b
)
{
if
(
a
.
Begin
<
b
.
Begin
)
{
return
new
RangeStruct
(
a
.
Begin
,
b
.
Begin
-
1
);
}
else
{
if
(
a
.
End
>
b
.
End
)
return
new
RangeStruct
(
b
.
End
+
1
,
a
.
End
);
else
return
InvalidValue
;
}
}
/// <summary>
/// 范围 a小于b
/// </summary>
...
...
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