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

风环

1. 优化 画面的相关性 为 稳定性 与 Misc.MyMath.Correl 的最大值。
2. 优化 自动对位的BestKp 只会比当前的Kp  小50% 才会提示。  当前Kp 比 BestKp 小永远都不提示。
3. 优化 自动对位的查找范围可以很小
parent cdb3e458
...@@ -90,6 +90,9 @@ ...@@ -90,6 +90,9 @@
<Button Style="{StaticResource ButtonStyle_RectangleIcon}" Command="{Binding NextStableCmd}" > <Button Style="{StaticResource ButtonStyle_RectangleIcon}" Command="{Binding NextStableCmd}" >
<iconPacks:PackIconMaterial Kind="ChevronDoubleRight" /> <iconPacks:PackIconMaterial Kind="ChevronDoubleRight" />
</Button> </Button>
<Button Style="{StaticResource ButtonStyle_RectangleIcon}" Command="{Binding NewestCmd}" Background="{StaticResource Badges.BlackBackground}">
<iconPacks:PackIconMaterial Kind="ArrowCollapseRight" />
</Button>
</StackPanel> </StackPanel>
<Grid Grid.Column="1" Grid.RowSpan="2" Panel.ZIndex="2" <Grid Grid.Column="1" Grid.RowSpan="2" Panel.ZIndex="2"
VerticalAlignment="Top" HorizontalAlignment="Left" > VerticalAlignment="Top" HorizontalAlignment="Left" >
......
...@@ -114,10 +114,11 @@ namespace FLY.FeedbackRenZiJia.UI.Client ...@@ -114,10 +114,11 @@ namespace FLY.FeedbackRenZiJia.UI.Client
public RelayCommand PreCmd { get; } public RelayCommand PreCmd { get; private set; }
public RelayCommand NextCmd { get; } public RelayCommand NextCmd { get; private set; }
public RelayCommand PreStableCmd { get; } public RelayCommand PreStableCmd { get; private set; }
public RelayCommand NextStableCmd { get; } public RelayCommand NextStableCmd { get; private set; }
public RelayCommand NewestCmd { get; private set; }
public Lc_ThickHeat frame; public Lc_ThickHeat frame;
IBulkDbService bulkDbService; IBulkDbService bulkDbService;
...@@ -154,6 +155,7 @@ namespace FLY.FeedbackRenZiJia.UI.Client ...@@ -154,6 +155,7 @@ namespace FLY.FeedbackRenZiJia.UI.Client
NextCmd = new RelayCommand(Next); NextCmd = new RelayCommand(Next);
PreStableCmd = new RelayCommand(PreStable); PreStableCmd = new RelayCommand(PreStable);
NextStableCmd = new RelayCommand(NextStable); NextStableCmd = new RelayCommand(NextStable);
NewestCmd = new RelayCommand(Newest);
} }
...@@ -301,7 +303,10 @@ namespace FLY.FeedbackRenZiJia.UI.Client ...@@ -301,7 +303,10 @@ namespace FLY.FeedbackRenZiJia.UI.Client
IsPre = false; IsPre = false;
Number++; Number++;
} }
private void Newest()
{
Number = bulkDbService.LastId;
}
private void PreStable() private void PreStable()
{ {
IsGetStableFrame = true; IsGetStableFrame = true;
......
...@@ -31,10 +31,13 @@ ...@@ -31,10 +31,13 @@
<RowDefinition /> <RowDefinition />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Grid x:Name="grid_viewModel"/> <Grid x:Name="grid_viewModel"/>
<StackPanel Orientation="Horizontal" Background="{StaticResource Background_Title}" > <StackPanel Orientation="Horizontal" Background="{StaticResource Brushes.TitleBar.Background}" >
<Button Style="{StaticResource ButtonStyle_back2}" Command="BrowseBack"/> <Button Style="{StaticResource Styles.TitleBar.BackButton2}" Command="BrowseBack"/>
<TextBlock Style="{StaticResource TextBlockStyle_Title}" Text="自动风环"/> <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
<TextBlock Text="自控设置" FontSize="30" VerticalAlignment="Center" Margin="{StaticResource ControlMargin}" Foreground="LightGray"/> <TextBlock Style="{StaticResource Styles.TitleBar.Text}" Text="自动风环"/>
<TextBlock Text="自控设置" FontSize="30" VerticalAlignment="Bottom" Margin="{StaticResource ControlMargin}" Foreground="LightGray"/>
</StackPanel>
</StackPanel> </StackPanel>
<!--<ScrollViewer Grid.Row="1" PanningMode="Both" > <!--<ScrollViewer Grid.Row="1" PanningMode="Both" >
...@@ -341,7 +344,7 @@ ...@@ -341,7 +344,7 @@
<TextBlock Style="{StaticResource Text.FieldContentMm2}" VerticalAlignment="Top" Text="°" /> <TextBlock Style="{StaticResource Text.FieldContentMm2}" VerticalAlignment="Top" Text="°" />
<TextBlock Style="{StaticResource Text.FieldContentMmInterval}" VerticalAlignment="Top" Text="|" /> <TextBlock Style="{StaticResource Text.FieldContentMmInterval}" VerticalAlignment="Top" Text="|" />
<StackPanel VerticalAlignment="Bottom"> <StackPanel VerticalAlignment="Bottom">
<TextBlock Style="{StaticResource Text.FieldContentMm2}" Text="最小:±36°" /> <TextBlock Style="{StaticResource Text.FieldContentMm2}" Text="最小:±10°" />
<TextBlock Style="{StaticResource Text.FieldContentMm2}" Text="最大:±180°" /> <TextBlock Style="{StaticResource Text.FieldContentMm2}" Text="最大:±180°" />
</StackPanel> </StackPanel>
</StackPanel> </StackPanel>
......
...@@ -224,7 +224,7 @@ namespace FLY.FeedbackRenZiJia.UI.Client.UiModule ...@@ -224,7 +224,7 @@ namespace FLY.FeedbackRenZiJia.UI.Client.UiModule
void UpdateIsKpDiff() void UpdateIsKpDiff()
{ {
double p = Kp / BestKp; double p = Kp / BestKp;
if ((p > 1.5)|| (p<0.7)) if ((p > 1.5))
{ {
IsKpDiff = true; IsKpDiff = true;
} }
......
...@@ -49,7 +49,7 @@ namespace FLY.FeedbackRenZiJia.IService ...@@ -49,7 +49,7 @@ namespace FLY.FeedbackRenZiJia.IService
#region 对位 #region 对位
/// <summary> /// <summary>
/// 对位查找范围 默认 ±120°, 最大值 180°,最小值 5 /// 对位查找范围 默认 ±120°, 最大值 180°,最小值 1
/// </summary> /// </summary>
int SearchAngleRange { get; set; } int SearchAngleRange { get; set; }
/// <summary> /// <summary>
......
...@@ -414,9 +414,13 @@ namespace FLY.FeedbackRenZiJia.Server ...@@ -414,9 +414,13 @@ namespace FLY.FeedbackRenZiJia.Server
//通过简单的范围比较计算稳定性 //通过简单的范围比较计算稳定性
//当Kp, 错位,就会另 稳定性的值很低 //当Kp, 错位,就会另 稳定性的值很低
CalR(thickpercents_diff, heatpercents_diff, out bool[] isStables); bool[] isStables = CalStable(thickpercents_diff, heatpercents_diff);
double currR = 1.0 * isStables.Count(b => b) / isStables.Count(); double currR = 1.0 * isStables.Count(b => b) / isStables.Count();
CurrR = currR; double currR2 = Misc.MyMath.Correl(thickpercents_diff, heatpercents_diff);
if (double.IsNaN(currR2))
currR2 = -1;
CurrR = Math.Max( currR, currR2 );
BoltIsStable = isStables; BoltIsStable = isStables;
LastHeatDiffMaxMin = (int)Common.MyMath.CalMaxMin(heatpercents_diff); LastHeatDiffMaxMin = (int)Common.MyMath.CalMaxMin(heatpercents_diff);
...@@ -562,7 +566,7 @@ namespace FLY.FeedbackRenZiJia.Server ...@@ -562,7 +566,7 @@ namespace FLY.FeedbackRenZiJia.Server
} }
void CalR(double[] thickpercents_diff, double[] heatpercents_diff, out bool[] isStable) bool[] CalStable(double[] thickpercents_diff, double[] heatpercents_diff)
{ {
//降低要求 //降低要求
//thickpercents_diff = Common.MyMath.Filter(thickpercents_diff, 3); //thickpercents_diff = Common.MyMath.Filter(thickpercents_diff, 3);
...@@ -578,7 +582,7 @@ namespace FLY.FeedbackRenZiJia.Server ...@@ -578,7 +582,7 @@ namespace FLY.FeedbackRenZiJia.Server
if (stableRange < 1) if (stableRange < 1)
stableRange = 1; stableRange = 1;
isStable = new bool[heatpercents_diff.Count()]; bool[] isStable = new bool[heatpercents_diff.Count()];
for (int i = 0; i < heatpercents_diff.Count(); i++) for (int i = 0; i < heatpercents_diff.Count(); i++)
{ {
if ((!double.IsNaN(thickpercents_diff[i])) && if ((!double.IsNaN(thickpercents_diff[i])) &&
...@@ -588,11 +592,11 @@ namespace FLY.FeedbackRenZiJia.Server ...@@ -588,11 +592,11 @@ namespace FLY.FeedbackRenZiJia.Server
isStable[i] = true; isStable[i] = true;
} }
} }
return isStable;
} }
public void Apply() public void Apply()
{ {
Save(); Save();
......
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