Commit b3feab20 authored by 潘栩锋's avatar 潘栩锋 🚴

1. 添加 风环断点模式添加开关

2. 修复 在数据库保存的厚度数据 K, 旋转角度,膜距离,速度,K 小数点太长
parent 9613761a
...@@ -301,7 +301,10 @@ ...@@ -301,7 +301,10 @@
<TextBlock Style="{StaticResource Styles.Text.FieldHeader}" Text="2σ当前值" /> <TextBlock Style="{StaticResource Styles.Text.FieldHeader}" Text="2σ当前值" />
<TextBlock Style="{StaticResource Styles.Text.FieldContent}" Text="{Binding Curr2Sigma, StringFormat={}{0:F1}}"/> <TextBlock Style="{StaticResource Styles.Text.FieldContent}" Text="{Binding Curr2Sigma, StringFormat={}{0:F1}}"/>
</StackPanel> </StackPanel>
<StackPanel Margin="{StaticResource ControlMargin}">
<TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="把同向长块打断" />
<ToggleButton Style="{StaticResource Styles.ToggleButton.YESNO}" IsChecked="{Binding CanBreakIn}"/>
</StackPanel>
<StackPanel Margin="{StaticResource ControlMargin}"> <StackPanel Margin="{StaticResource ControlMargin}">
<TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="厚度横向平滑直径" /> <TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="厚度横向平滑直径" />
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
...@@ -319,7 +322,7 @@ ...@@ -319,7 +322,7 @@
<StackPanel Margin="{StaticResource ControlMargin}"> <StackPanel Margin="{StaticResource ControlMargin}">
<TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="加热效果" /> <TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="加热效果" />
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<TextBox Style="{StaticResource Styles.Text.FieldContent.Input.Card}" Text="{Binding HeatEffectCurve,Converter={StaticResource heconv}}"/> <TextBox Style="{StaticResource Styles.Text.FieldContent.Input.Card}" Text="{Binding HeatEffectCurve,Converter={StaticResource heconv}}" Tag="Full"/>
</StackPanel> </StackPanel>
</StackPanel> </StackPanel>
</StackPanel> </StackPanel>
......
...@@ -63,6 +63,11 @@ namespace FLY.FeedbackRenZiJia.Client ...@@ -63,6 +63,11 @@ namespace FLY.FeedbackRenZiJia.Client
/// 对厚度数据横向平滑 单位加热棒数。 特别的当Smooth = ChannelCnt/2 就是膜泡的偏心度 /// 对厚度数据横向平滑 单位加热棒数。 特别的当Smooth = ChannelCnt/2 就是膜泡的偏心度
/// </summary> /// </summary>
public int ThickSmoothRange { get; set; } public int ThickSmoothRange { get; set; }
/// <summary>
/// 启动打断功能,会把长块打断
/// </summary>
public bool CanBreakIn { get; set; } = false;
#endregion #endregion
#region 对位 #region 对位
/// <summary> /// <summary>
......
...@@ -53,6 +53,11 @@ namespace FLY.FeedbackRenZiJia.IService ...@@ -53,6 +53,11 @@ namespace FLY.FeedbackRenZiJia.IService
/// 对厚度数据横向平滑 单位加热棒数。 特别的当Smooth = ChannelCnt/2 就是膜泡的偏心度 /// 对厚度数据横向平滑 单位加热棒数。 特别的当Smooth = ChannelCnt/2 就是膜泡的偏心度
/// </summary> /// </summary>
int ThickSmoothRange { get; set; } int ThickSmoothRange { get; set; }
/// <summary>
/// 启动打断功能,会把长块打断
/// </summary>
bool CanBreakIn { get; set; }
#endregion #endregion
#region 对位 #region 对位
/// <summary> /// <summary>
......
...@@ -72,6 +72,11 @@ namespace FLY.FeedbackRenZiJia.Server ...@@ -72,6 +72,11 @@ namespace FLY.FeedbackRenZiJia.Server
/// 对厚度数据横向平滑 单位加热棒数。 特别的当Smooth = ChannelCnt/2 就是膜泡的偏心度 /// 对厚度数据横向平滑 单位加热棒数。 特别的当Smooth = ChannelCnt/2 就是膜泡的偏心度
/// </summary> /// </summary>
public int ThickSmoothRange { get; set; } = 5; public int ThickSmoothRange { get; set; } = 5;
/// <summary>
/// 启动打断功能,会把长块打断
/// </summary>
public bool CanBreakIn { get; set; } = false;
#endregion #endregion
#region 状态 #region 状态
...@@ -293,13 +298,19 @@ namespace FLY.FeedbackRenZiJia.Server ...@@ -293,13 +298,19 @@ namespace FLY.FeedbackRenZiJia.Server
offsets = new int[ChannelCnt]; offsets = new int[ChannelCnt];
//获取目标线。 正常全部都是0 //获取目标线。 正常全部都是0
//有同向长块的,也需要中间打断。 长块中间的目标值是 反向的ctrlLine
var targets = getTargets(thickPercents, ctrlLine); var targets = getTargets(thickPercents, ctrlLine);
int range5 = 5; int range5 = 5;
for (int i = 0; i < ChannelCnt; i++) for (int i = 0; i < ChannelCnt; i++)
{ {
double delta = (thickPercents[i] - targets[i]); double delta;
if (CanBreakIn)//启动打断功能
delta = (thickPercents[i] - targets[i]);
else
delta = thickPercents[i];//普通使用0%为目标值
if (Math.Abs(delta) > ctrlLine) if (Math.Abs(delta) > ctrlLine)
{ {
//这个点,及附近,都需要调节, 附近为±2 //这个点,及附近,都需要调节, 附近为±2
...@@ -332,28 +343,62 @@ namespace FLY.FeedbackRenZiJia.Server ...@@ -332,28 +343,62 @@ namespace FLY.FeedbackRenZiJia.Server
} }
} }
List<Range> getSignList(double[] thickPercents) int getSign(double thickPercent, double deadArea)
{
if (thickPercent > deadArea)
return 1;
else if (thickPercent < deadArea)
return -1;
else
return 0;
}
/// <summary>
///
/// </summary>
/// <param name="thickPercents">厚度 100%</param>
/// <param name="deadarea">盲区, 状态分 大于 +盲区; 在±盲区内; 小于-盲区</param>
/// <returns></returns>
List<Range> getSignList(double[] thickPercents, double deadArea)
{ {
List<Range> signList = new List<Range>(); List<Range> signList = new List<Range>();
bool sign0 = thickPercents[0] > 0;
bool last_sign = sign0;
signList.Add(new Range() { Begin = 0, End = 0 });
for (int i = 1; i < ChannelCnt; i++) int last_sign = 0;
for (int i = 0; i < ChannelCnt; i++)
{ {
bool sign = thickPercents[i] > 0; int sign = getSign(thickPercents[i], deadArea);
if (sign == last_sign) if (last_sign == 0)
signList.Last().End = i;
else
{ {
signList.Add(new Range() { Begin = i, End = i }); //之前的块,已经结束
if (sign != 0)
{
signList.Add(new Range() { Begin = i, End = i });
}
}
else
{
//之前的块,还没结束
if (sign == last_sign)
{
//延长之前的块
signList.Last().End = i;
}
else if (sign != 0)
{
//方向不同,需要建立新块
signList.Add(new Range() { Begin = i, End = i });
}
} }
last_sign = sign; last_sign = sign;
} }
if (last_sign == sign0)
int sign0 = getSign(thickPercents[0], deadArea);
if (last_sign != 0 && last_sign == sign0)
{ {
//最后一个,与第1个,可以合体 //最后一个,与第1个,可以合体
signList.First().Begin = signList.Last().Begin - ChannelCnt; signList.First().Begin = signList.Last().Begin - ChannelCnt;//它变成负数了
signList.RemoveAt(signList.Count() - 1); signList.RemoveAt(signList.Count() - 1);
} }
...@@ -373,9 +418,11 @@ namespace FLY.FeedbackRenZiJia.Server ...@@ -373,9 +418,11 @@ namespace FLY.FeedbackRenZiJia.Server
double[] getTargets(double[] thickPercents, double ctrlLine) double[] getTargets(double[] thickPercents, double ctrlLine)
{ {
int range6 = 6; int range6 = 6;
int range3 = 3; //int range3 = 3;
var signList = getSignList(thickPercents);
signList = signList.FindAll(s => s.Width >= range6); var signList = getSignList(thickPercents, 1);//以1%为盲区,获取同符号的厚度段。
signList = signList.FindAll(s => s.Width >= range6);//找到厚度段超过6个加热棒数的
double[] targets = new double[ChannelCnt]; double[] targets = new double[ChannelCnt];
foreach (var r in signList) foreach (var r in signList)
...@@ -383,13 +430,18 @@ namespace FLY.FeedbackRenZiJia.Server ...@@ -383,13 +430,18 @@ namespace FLY.FeedbackRenZiJia.Server
int i = r.Mid; int i = r.Mid;
if (i < 0)//第0段,Begin 为负数。 所以需要判断 if (i < 0)//第0段,Begin 为负数。 所以需要判断
i += ChannelCnt; i += ChannelCnt;
if (thickPercents[i] > 0) if (thickPercents[i] > 0)//这个块 大于正数
{ {
setTargets(targets, -ctrlLine, i, range3); //把长块,中间的位置目标值 设为反向符号的 ctrlLine。 这样实现了打断功能
//setTargets(targets, -ctrlLine, i, range3);
targets[i] = -ctrlLine;
} }
else else
{ {
setTargets(targets, ctrlLine, i, range3); //这个块负数
//setTargets(targets, ctrlLine, i, range3);
targets[i] = ctrlLine;
} }
} }
return targets; return targets;
...@@ -1018,6 +1070,11 @@ namespace FLY.FeedbackRenZiJia.Server ...@@ -1018,6 +1070,11 @@ namespace FLY.FeedbackRenZiJia.Server
/// </summary> /// </summary>
public int ThickSmoothRange = 5; public int ThickSmoothRange = 5;
/// <summary>
/// 启动打断功能,会把长块打断
/// </summary>
public bool CanBreakIn = false;
/// <summary> /// <summary>
/// 平滑的阀值,只有超出阀值,才平滑 /// 平滑的阀值,只有超出阀值,才平滑
/// </summary> /// </summary>
......
...@@ -1283,7 +1283,7 @@ namespace FLY.Thick.Blowing.Server ...@@ -1283,7 +1283,7 @@ namespace FLY.Thick.Blowing.Server
RPeriod = mPDetect.RenZiJiaPeriod, RPeriod = mPDetect.RenZiJiaPeriod,
RCnt = frameinfo.rotationCnt, RCnt = frameinfo.rotationCnt,
OrgBoltNo = OrgBoltNo, OrgBoltNo = OrgBoltNo,
RAngle = Math.Round(mPDetect.RAngle, 2), RAngle = Math.Round(mPDetect.RAngle, 1),
FilmLength = Math.Round(mPDetect.FilmLength, 2), FilmLength = Math.Round(mPDetect.FilmLength, 2),
FilmVelocity = Math.Round(mPDetect.FilmVelocity, 2), FilmVelocity = Math.Round(mPDetect.FilmVelocity, 2),
K = Math.Round(mProfileParam.K, 3), K = Math.Round(mProfileParam.K, 3),
......
...@@ -1689,10 +1689,10 @@ namespace FLY.Thick.BlowingScan.Server ...@@ -1689,10 +1689,10 @@ namespace FLY.Thick.BlowingScan.Server
RPeriod = mPDetect.RenZiJiaPeriod, RPeriod = mPDetect.RenZiJiaPeriod,
RCnt = mPDetect.RotationCnt, RCnt = mPDetect.RotationCnt,
OrgBoltNo = OrgBoltNo, OrgBoltNo = OrgBoltNo,
RAngle = mPDetect.RAngle, RAngle = Math.Round(mPDetect.RAngle,1),
FilmLength = mPDetect.FilmLength, FilmLength = Math.Round(mPDetect.FilmLength,2),
FilmVelocity = mPDetect.FilmVelocity, FilmVelocity = Math.Round(mPDetect.FilmVelocity,2),
K = mProfileParam.K, K = Math.Round(mProfileParam.K,3),
Thicks = realthicks, Thicks = realthicks,
Boltmap = map Boltmap = map
}; };
......
{ {
"InstallZipVersion":"7.6.1.1", "InstallZipVersion":"7.6.1.2",
"InstallZipUrl":"http://server.flyautomation.net:8889/download/和美安装包_v7.6.1.1_20221016.7z" "InstallZipUrl":"http://server.flyautomation.net:8889/download/和美安装包_v7.6.1.2_20221017.7z"
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment