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

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

2. 修复 在数据库保存的厚度数据 K, 旋转角度,膜距离,速度,K 小数点太长
parent 9613761a
......@@ -301,7 +301,10 @@
<TextBlock Style="{StaticResource Styles.Text.FieldHeader}" Text="2σ当前值" />
<TextBlock Style="{StaticResource Styles.Text.FieldContent}" Text="{Binding Curr2Sigma, StringFormat={}{0:F1}}"/>
</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}">
<TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="厚度横向平滑直径" />
<StackPanel Orientation="Horizontal">
......@@ -319,7 +322,7 @@
<StackPanel Margin="{StaticResource ControlMargin}">
<TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="加热效果" />
<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>
......
......@@ -63,6 +63,11 @@ namespace FLY.FeedbackRenZiJia.Client
/// 对厚度数据横向平滑 单位加热棒数。 特别的当Smooth = ChannelCnt/2 就是膜泡的偏心度
/// </summary>
public int ThickSmoothRange { get; set; }
/// <summary>
/// 启动打断功能,会把长块打断
/// </summary>
public bool CanBreakIn { get; set; } = false;
#endregion
#region 对位
/// <summary>
......
......@@ -53,6 +53,11 @@ namespace FLY.FeedbackRenZiJia.IService
/// 对厚度数据横向平滑 单位加热棒数。 特别的当Smooth = ChannelCnt/2 就是膜泡的偏心度
/// </summary>
int ThickSmoothRange { get; set; }
/// <summary>
/// 启动打断功能,会把长块打断
/// </summary>
bool CanBreakIn { get; set; }
#endregion
#region 对位
/// <summary>
......
......@@ -72,6 +72,11 @@ namespace FLY.FeedbackRenZiJia.Server
/// 对厚度数据横向平滑 单位加热棒数。 特别的当Smooth = ChannelCnt/2 就是膜泡的偏心度
/// </summary>
public int ThickSmoothRange { get; set; } = 5;
/// <summary>
/// 启动打断功能,会把长块打断
/// </summary>
public bool CanBreakIn { get; set; } = false;
#endregion
#region 状态
......@@ -293,12 +298,18 @@ namespace FLY.FeedbackRenZiJia.Server
offsets = new int[ChannelCnt];
//获取目标线。 正常全部都是0
//有同向长块的,也需要中间打断。 长块中间的目标值是 反向的ctrlLine
var targets = getTargets(thickPercents, ctrlLine);
int range5 = 5;
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)
{
......@@ -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>();
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++)
{
int sign = getSign(thickPercents[i], deadArea);
if (last_sign == 0)
{
//之前的块,已经结束
if (sign != 0)
{
signList.Add(new Range() { Begin = i, End = i });
}
}
else
{
bool sign = thickPercents[i] > 0;
//之前的块,还没结束
if (sign == last_sign)
{
//延长之前的块
signList.Last().End = i;
else
}
else if (sign != 0)
{
//方向不同,需要建立新块
signList.Add(new Range() { Begin = i, End = i });
}
}
last_sign = sign;
}
if (last_sign == sign0)
int sign0 = getSign(thickPercents[0], deadArea);
if (last_sign != 0 && last_sign == sign0)
{
//最后一个,与第1个,可以合体
signList.First().Begin = signList.Last().Begin - ChannelCnt;
signList.First().Begin = signList.Last().Begin - ChannelCnt;//它变成负数了
signList.RemoveAt(signList.Count() - 1);
}
......@@ -373,9 +418,11 @@ namespace FLY.FeedbackRenZiJia.Server
double[] getTargets(double[] thickPercents, double ctrlLine)
{
int range6 = 6;
int range3 = 3;
var signList = getSignList(thickPercents);
signList = signList.FindAll(s => s.Width >= range6);
//int range3 = 3;
var signList = getSignList(thickPercents, 1);//以1%为盲区,获取同符号的厚度段。
signList = signList.FindAll(s => s.Width >= range6);//找到厚度段超过6个加热棒数的
double[] targets = new double[ChannelCnt];
foreach (var r in signList)
......@@ -383,13 +430,18 @@ namespace FLY.FeedbackRenZiJia.Server
int i = r.Mid;
if (i < 0)//第0段,Begin 为负数。 所以需要判断
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
{
setTargets(targets, ctrlLine, i, range3);
//这个块负数
//setTargets(targets, ctrlLine, i, range3);
targets[i] = ctrlLine;
}
}
return targets;
......@@ -1018,6 +1070,11 @@ namespace FLY.FeedbackRenZiJia.Server
/// </summary>
public int ThickSmoothRange = 5;
/// <summary>
/// 启动打断功能,会把长块打断
/// </summary>
public bool CanBreakIn = false;
/// <summary>
/// 平滑的阀值,只有超出阀值,才平滑
/// </summary>
......
......@@ -1283,7 +1283,7 @@ namespace FLY.Thick.Blowing.Server
RPeriod = mPDetect.RenZiJiaPeriod,
RCnt = frameinfo.rotationCnt,
OrgBoltNo = OrgBoltNo,
RAngle = Math.Round(mPDetect.RAngle, 2),
RAngle = Math.Round(mPDetect.RAngle, 1),
FilmLength = Math.Round(mPDetect.FilmLength, 2),
FilmVelocity = Math.Round(mPDetect.FilmVelocity, 2),
K = Math.Round(mProfileParam.K, 3),
......
......@@ -1689,10 +1689,10 @@ namespace FLY.Thick.BlowingScan.Server
RPeriod = mPDetect.RenZiJiaPeriod,
RCnt = mPDetect.RotationCnt,
OrgBoltNo = OrgBoltNo,
RAngle = mPDetect.RAngle,
FilmLength = mPDetect.FilmLength,
FilmVelocity = mPDetect.FilmVelocity,
K = mProfileParam.K,
RAngle = Math.Round(mPDetect.RAngle,1),
FilmLength = Math.Round(mPDetect.FilmLength,2),
FilmVelocity = Math.Round(mPDetect.FilmVelocity,2),
K = Math.Round(mProfileParam.K,3),
Thicks = realthicks,
Boltmap = map
};
......
{
"InstallZipVersion":"7.6.1.1",
"InstallZipUrl":"http://server.flyautomation.net:8889/download/和美安装包_v7.6.1.1_20221016.7z"
"InstallZipVersion":"7.6.1.2",
"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