Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hemei
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
潘栩锋
hemei
Commits
d0b64cd2
Commit
d0b64cd2
authored
Oct 29, 2020
by
潘栩锋
🚴
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.修复 风环自动 只需要按清空全部加热就能对位复位。
2.修复 风环自动 修复自动加热没有降温操作。 3.修复 风环自动 对位显示记录
parent
d3e29b0d
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
109 additions
and
82 deletions
+109
-82
PgSetup.xaml
...dbackRenZiJia/FLY.FeedbackRenZiJia.UI.Client/PgSetup.xaml
+24
-24
PgSetup.xaml.cs
...ckRenZiJia/FLY.FeedbackRenZiJia.UI.Client/PgSetup.xaml.cs
+1
-1
AirRingGraph.xaml
...enZiJia.UI.Client/UiModule/AirRingGraph/AirRingGraph.xaml
+2
-2
MyMath.cs
...LY.FeedbackRenZiJia/FLY.FeedbackRenZiJia/Common/MyMath.cs
+1
-1
FeedbackHeat.cs
...dbackRenZiJia/FLY.FeedbackRenZiJia/Server/FeedbackHeat.cs
+4
-0
HeatCell.cs
....FeedbackRenZiJia/FLY.FeedbackRenZiJia/Server/HeatCell.cs
+77
-54
No files found.
Project.FLY.FeedbackRenZiJia/FLY.FeedbackRenZiJia.UI.Client/PgSetup.xaml
View file @
d0b64cd2
...
...
@@ -356,6 +356,21 @@
<StackPanel Visibility="{Binding MaxR,Converter={StaticResource maxR2VisConv}}" DataContext="{Binding HeatBuf}">
<TextBlock Style="{StaticResource Text.FieldContent2}" Margin="{StaticResource ControlMargin}" FontSize="15" Text="{Binding MaxR_Time, StringFormat={}{0:MM-dd HH:mm}}" Padding="2" Background="#FFC107"/>
<StackPanel Orientation="Horizontal" >
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" DataContext="{Binding ElementName=grid_viewModel,Path=DataContext}">
<Button Content="查看" Style="{StaticResource Button.Square2}" Command="{Binding BestImageCmd}"/>
</StackPanel>
<StackPanel Margin="{StaticResource ControlMargin}">
<TextBlock Style="{StaticResource Text.FieldHeader2}" Text="ID0" />
<StackPanel Orientation="Horizontal">
<TextBlock Style="{StaticResource Text.FieldContent}" Text="{Binding MaxR_Id0}" />
</StackPanel>
</StackPanel>
<StackPanel Margin="{StaticResource ControlMargin}">
<TextBlock Style="{StaticResource Text.FieldHeader2}" Text="ID1" />
<StackPanel Orientation="Horizontal">
<TextBlock Style="{StaticResource Text.FieldContent}" Text="{Binding MaxR_Id1}" />
</StackPanel>
</StackPanel>
<StackPanel Margin="{StaticResource ControlMargin}">
<TextBlock Style="{StaticResource Text.FieldHeader2}" Text="相关性" />
<StackPanel Orientation="Horizontal">
...
...
@@ -383,34 +398,17 @@
</StackPanel>
</StackPanel>
<StackPanel Margin="{StaticResource ControlMargin}">
<TextBlock Style="{StaticResource Text.FieldHeader2}" Text="ID0" />
<StackPanel Orientation="Horizontal">
<TextBlock Style="{StaticResource Text.FieldContent}" Text="{Binding MaxR_Id0}" />
</StackPanel>
</StackPanel>
<StackPanel Margin="{StaticResource ControlMargin}">
<TextBlock Style="{StaticResource Text.FieldHeader2}" Text="ID1" />
<StackPanel Orientation="Horizontal">
<TextBlock Style="{StaticResource Text.FieldContent}" Text="{Binding MaxR_Id1}" />
</StackPanel>
</StackPanel>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" DataContext="{Binding ElementName=grid_viewModel,Path=DataContext}">
<Button Content="查看" Style="{StaticResource Button.Square2}" Command="{Binding BestImageCmd}"/>
</StackPanel>
</StackPanel>
</StackPanel>
<StackPanel Orientation="Horizontal" DataContext="{Binding HeatCell}" Visibility="{Binding ElementName=grid_viewModel,Path=DataContext.IsAutoONo,Converter={StaticResource visbilityconv},ConverterParameter=Collapsed}">
<StackPanel Margin="{StaticResource ControlMargin}">
<TextBlock Style="{StaticResource Text.FieldHeader2}" Text="对位结果" />
<StackPanel Orientation="Horizontal">
<TextBlock Style="{StaticResource Text.FieldContent}" Text="{Binding AutoONoMsg}" />
</StackPanel>
</StackPanel>
<StackPanel Orientation="Horizontal" Visibility="{Binding AutoONoId0,Converter={StaticResource id2VisConv}}">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" DataContext="{Binding ElementName=grid_viewModel,Path=DataContext}">
<Button Content="查看" Style="{StaticResource Button.Square2}" Command="{Binding AutoONoImageCmd}"/>
</StackPanel>
<StackPanel Margin="{StaticResource ControlMargin}">
<TextBlock Style="{StaticResource Text.FieldHeader2}" Text="对位前ID" />
<StackPanel Orientation="Horizontal">
...
...
@@ -423,11 +421,13 @@
<TextBlock Style="{StaticResource Text.FieldContent}" Text="{Binding AutoONoId1}" />
</StackPanel>
</StackPanel>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" DataContext="{Binding ElementName=grid_viewModel,Path=DataContext}">
<Button Content="查看" Style="{StaticResource Button.Square2}" Command="{Binding AutoONoImageCmd}"/>
</StackPanel>
<StackPanel Margin="{StaticResource ControlMargin}">
<TextBlock Style="{StaticResource Text.FieldHeader2}" Text="对位结果" />
<StackPanel Orientation="Horizontal">
<TextBlock Style="{StaticResource Text.FieldContent2}" Text="{Binding AutoONoMsg}" />
</StackPanel>
</StackPanel>
</StackPanel>
</StackPanel >
</Border>
...
...
Project.FLY.FeedbackRenZiJia/FLY.FeedbackRenZiJia.UI.Client/PgSetup.xaml.cs
View file @
d0b64cd2
...
...
@@ -243,7 +243,7 @@ namespace FLY.FeedbackRenZiJia.UI.Client
private
void
AutoONoImage
()
{
var
p
=
container
.
Resolve
<
PgHeatAnalyse
>();
if
(
HeatCell
.
AutoONoStatus
==
AutoONoStatusEnum
.
Success
)
//
if (HeatCell.AutoONoStatus == AutoONoStatusEnum.Success)
{
p
.
SetNumber
(
HeatCell
.
AutoONoId0
,
HeatCell
.
AutoONoId1
);
}
...
...
Project.FLY.FeedbackRenZiJia/FLY.FeedbackRenZiJia.UI.Client/UiModule/AirRingGraph/AirRingGraph.xaml
View file @
d0b64cd2
...
...
@@ -271,13 +271,13 @@
Fill="Transparent"
Values="{Binding ThickPercents}"
Configuration="{Binding MapperThickPercents}"/>
<lvc:ScatterSeries
<
!--<
lvc:ScatterSeries
PointGeometry="{StaticResource Geometry.Close}"
StrokeThickness ="1"
Stroke="{StaticResource Brushes.Thick}"
Fill="{StaticResource WhiteBrush}"
Values="{Binding ThickPercents}"
Configuration="{Binding MapperThickPercentsWithIsStable}"/>
Configuration="{Binding MapperThickPercentsWithIsStable}"/>
-->
</lvc:CartesianChart.Series>
<lvc:CartesianChart.AxisX>
<lvc:Axis Foreground="{StaticResource Brushes.AxisLabel}"
...
...
Project.FLY.FeedbackRenZiJia/FLY.FeedbackRenZiJia/Common/MyMath.cs
View file @
d0b64cd2
...
...
@@ -58,7 +58,7 @@ namespace FLY.FeedbackRenZiJia.Common
if
(
double
.
IsNaN
(
d
))
percent
[
i
]
=
double
.
NaN
;
else
percent
[
i
]
=
(
int
)(
100
*
(
d
-
avg
)
/
avg
)
;
percent
[
i
]
=
100
*
(
d
-
avg
)
/
avg
;
}
}
return
percent
;
...
...
Project.FLY.FeedbackRenZiJia/FLY.FeedbackRenZiJia/Server/FeedbackHeat.cs
View file @
d0b64cd2
...
...
@@ -479,7 +479,11 @@ namespace FLY.FeedbackRenZiJia.Server
{
//启动了自控,应该关闭检测
mHeatCheck
.
Enable
=
false
;
//复位自动对位状态
//mHeatCell.ResetAuto();
}
}
else
if
(
e
.
PropertyName
==
nameof
(
IsConnectedWithPLC
))
{
...
...
Project.FLY.FeedbackRenZiJia/FLY.FeedbackRenZiJia/Server/HeatCell.cs
View file @
d0b64cd2
...
...
@@ -12,6 +12,7 @@ using AutoMapper;
using
System.IO
;
using
Newtonsoft.Json
;
using
FLY.Thick.Blowing.IService
;
using
Misc
;
namespace
FLY.FeedbackRenZiJia.Server
{
...
...
@@ -209,17 +210,27 @@ namespace FLY.FeedbackRenZiJia.Server
AutoONoStatus
=
AutoONoStatusEnum
.
Init
;
AutoONoMsg
=
"等待 加热=0,厚度稳定"
;
AutoONoId0
=
-
1
;
AutoONoId1
=
-
1
;
AutoONoId1
=
0
;
}
void
AutoONoOnPoll
()
{
if
(
mHeatBuf
.
Stability
!=
STABILITY
.
OK_CORREL
)
return
;
if
(
Heats
.
All
(
h
=>
h
==
0
))
{
//加热全部为0
//复位状态
ResetAuto
();
}
switch
(
AutoONoStatus
)
{
case
AutoONoStatusEnum
.
Init
:
{
if
(
mHeatBuf
.
Stability
!=
STABILITY
.
OK_CORREL
)
break
;
//
if (mHeatBuf.Stability != STABILITY.OK_CORREL)
//
break;
if
(
Heats
.
All
(
h
=>
h
==
0
))
{
...
...
@@ -263,13 +274,19 @@ namespace FLY.FeedbackRenZiJia.Server
return
;
}
//加热变化不够多, 变大Kp
autoONoKp
++;
double
k
=
autoONoKp
*
mHeatBuf
.
ThresholdMaxMin
/
maxMin
-
autoONoKp
;
if
(
k
<
0.5
)
k
=
0.5
;
autoONoKp
+=
k
;
}
}
Offsets
=
offsets
;
UpdatePreHeats
();
//这句一定要加!!!! 不然没法平滑,没法加热
//上面已经有平滑,不需要再执行 Smooth()
ModifyBase
();
HeatApply
();
...
...
@@ -279,8 +296,6 @@ namespace FLY.FeedbackRenZiJia.Server
//虽然稳定了,但已经被人加热了,无法启动对位模式
AutoONoStatus
=
AutoONoStatusEnum
.
Fail
;
AutoONoMsg
=
"加热不为0,无法启动对位模式"
;
AutoONoId0
=
-
1
;
AutoONoId1
=
-
1
;
return
;
}
}
...
...
@@ -388,11 +403,11 @@ namespace FLY.FeedbackRenZiJia.Server
Offsets
=
offsets
;
UpdatePreHeats
();
//这句一定要加!!!! 不然没法平滑,没法加热
Smooth
();
//平滑
if
(!
IsForbidUpDown
)
//禁止整体上移下降
ModifyBase
();
//自动整体上移下降
Smooth
();
//平滑,它会导致Offset被修改,<0的都被删除掉
HeatApply
();
//执行加热
}
...
...
@@ -646,31 +661,35 @@ namespace FLY.FeedbackRenZiJia.Server
}
#
region
PreHeats
平滑处理
void
UpdateHeatSigmas
(
int
[]
heats
,
out
int
[]
heatsigma
s
)
double
[]
GetHeatSigmas
(
int
[]
heat
s
)
{
heatsigmas
=
new
int
[
ChannelCnt
];
var
heatsigmas
=
new
double
[
ChannelCnt
];
for
(
int
i
=
0
;
i
<
ChannelCnt
;
i
++)
{
int
[]
dat
=
new
int
[
3
];
int
index
;
for
(
int
j
=
0
;
j
<
3
;
j
++)
{
index
=
i
-
1
+
j
;
if
(
index
<
0
)
index
+=
ChannelCnt
;
else
if
(
index
>=
ChannelCnt
)
index
-=
ChannelCnt
;
dat
[
j
]
=
heats
[
index
]
*
100
;
}
heatsigmas
[
i
]
=
Misc
.
MyMath
.
Sigma
(
dat
);
var
dat
=
getSubArray
(
heats
,
i
);
heatsigmas
[
i
]
=
dat
.
Sigma
();
}
return
heatsigmas
;
}
void
UpdateHeatSigmas
()
{
int
[]
heatsigmas
;
UpdateHeatSigmas
(
PreHeats
.
ToArray
(),
out
heatsigmas
);
MaxHeatSigma
=
heatsigmas
.
Max
()
/
100.0
;
var
heatsigmas
=
GetHeatSigmas
(
PreHeats
);
MaxHeatSigma
=
heatsigmas
.
Max
();
}
T
[]
getSubArray
<
T
>(
T
[]
array
,
int
index
)
{
T
[]
dat
=
new
T
[
3
];
for
(
int
j
=
0
;
j
<
3
;
j
++)
{
int
idx
=
index
-
1
+
j
;
if
(
idx
<
0
)
idx
+=
array
.
Count
();
else
if
(
idx
>=
array
.
Count
())
idx
-=
array
.
Count
();
dat
[
j
]
=
array
[
idx
];
}
return
dat
;
}
/// <summary>
/// 平滑,不断修改PreHeats 直到HeatsSigma 合格
...
...
@@ -679,53 +698,57 @@ namespace FLY.FeedbackRenZiJia.Server
{
int
[]
heats
=
PreHeats
.
ToArray
();
int
[]
heats2
=
new
int
[
ChannelCnt
];
int
[]
heatsigmas
;
bool
hasChanged
=
false
;
bool
hasChanged2
=
false
;
// bool hasChanged3 = false
;
double
[]
heatsigmas
;
do
{
//1.更新sigma
UpdateHeatSigmas
(
heats
,
out
heatsigma
s
);
heatsigmas
=
GetHeatSigmas
(
heat
s
);
//2.检测HeatsSigma, 哪里比较大,对该位置 滤波
hasChanged
=
false
;
for
(
int
i
=
0
;
i
<
heats
.
Count
();
i
++)
{
if
(
heatsigmas
[
i
]
>
(
ThresholdHeatSigma
*
100
))
//不行,要滤波!!!
if
(
heatsigmas
[
i
]
>
(
ThresholdHeatSigma
))
//不行,要滤波!!!
{
//连续3个滤波
int
[]
dat
=
new
int
[
3
];
int
index
;
for
(
int
j
=
0
;
j
<
3
;
j
++)
{
index
=
i
-
1
+
j
;
if
(
index
<
0
)
index
+=
ChannelCnt
;
else
if
(
index
>=
ChannelCnt
)
index
-=
ChannelCnt
;
dat
[
j
]
=
heats
[
index
];
}
heats2
[
i
]
=
(
int
)
Math
.
Round
(
dat
[
0
]
*
0.33
+
dat
[
1
]
*
0.34
+
dat
[
2
]
*
0.33
);
// (int)Math.Round(dat.Average());
if
(
heats2
[
i
]
!=
heats
[
i
])
hasChanged
=
true
;
int
[]
dat
=
getSubArray
(
heats
,
i
);
heats2
[
i
]
=
(
int
)
Math
.
Round
(
dat
.
Average
());
//if (heats2[i] == heats[i])
//{
// //居然一样,修改旁边的两个的值
// if (i > 0) {
// int idx = i-1;
// dat = getSubArray(heats, idx);
// heats2[idx] = (int)Math.Round(dat.Average());
// }
// if (i == heats.Count() - 1)
// {
// int idx = 0;
// dat = getSubArray(heats, idx);
// heats2[idx] = (int)Math.Round(dat.Average());
// }
//}
}
else
{
heats2
[
i
]
=
heats
[
i
];
}
}
//3.有滤波行为,继续求循环,求sigma,判断。。。。。
if
(
hasChanged
)
{
for
(
int
i
=
0
;
i
<
ChannelCnt
;
i
++)
{
hasChanged
=
false
;
for
(
int
i
=
0
;
i
<
heats
.
Count
();
i
++)
{
if
(
heats
[
i
]!=
heats2
[
i
])
{
heats
[
i
]
=
heats2
[
i
];
hasChanged
=
true
;
}
hasChanged2
=
true
;
}
if
(
hasChanged
)
hasChanged2
=
true
;
}
while
(
hasChanged
);
if
(
hasChanged2
)
...
...
@@ -737,7 +760,7 @@ namespace FLY.FeedbackRenZiJia.Server
}
NotifyPropertyChanged
(
nameof
(
PreHeats
));
NotifyPropertyChanged
(
nameof
(
Offsets
));
MaxHeatSigma
=
heatsigmas
.
Max
()
/
100.0
;
MaxHeatSigma
=
heatsigmas
.
Max
();
}
}
#
endregion
...
...
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