Commit 69c060d2 authored by 潘栩锋's avatar 潘栩锋 🚴

Merge remote-tracking branch 'origin/fix-glee-ThickHeatAnalyst-20200320' into dev-6.0

parents 8edc3be0 5fa1d1b4
......@@ -104,6 +104,10 @@
<DependentUpon>App.xaml</DependentUpon>
</Compile>
<Compile Include="Converter\ValueConverters.cs" />
<Compile Include="UiModule\Dlg_GetSaveSwitches\DLG_GetSaveSwitches.xaml.cs">
<DependentUpon>DLG_GetSaveSwitches.xaml</DependentUpon>
</Compile>
<Compile Include="UiModule\Dlg_GetSaveSwitches\VM_GetSaveSwitches.cs" />
<Compile Include="UiModule\HeatThickDetector\HeatThickDetector.xaml.cs">
<DependentUpon>HeatThickDetector.xaml</DependentUpon>
</Compile>
......@@ -146,6 +150,10 @@
<DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Page Include="UiModule\Dlg_GetSaveSwitches\DLG_GetSaveSwitches.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UiModule\HeatThickDetector\HeatThickDetector.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
......@@ -207,6 +215,10 @@
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Project.FLY.FeedbackRenZiJia\FLY.FeedbackRenZiJia\FLY.FeedbackRenZiJia.csproj">
<Project>{3faf02de-b9e8-4dda-a8e4-7a99e6e53acb}</Project>
<Name>FLY.FeedbackRenZiJia</Name>
</ProjectReference>
<ProjectReference Include="..\..\Project.FLY.Thick.Blowing\FLY.Thick.Blowing\FLY.Thick.Blowing.csproj">
<Project>{cc20abeb-59f6-492b-a963-51121eb5ae66}</Project>
<Name>FLY.Thick.Blowing</Name>
......@@ -223,6 +235,10 @@
<Project>{5ee61ac6-5269-4f0f-b8fa-4334fe4a678f}</Project>
<Name>Misc</Name>
</ProjectReference>
<ProjectReference Include="..\..\thick_public\Project.FLY.Thick.Base\FLY.Thick.Base.UI\FLY.Thick.Base.UI.csproj">
<Project>{ec84265e-4196-4834-8ac0-81956777c5e9}</Project>
<Name>FLY.Thick.Base.UI</Name>
</ProjectReference>
<ProjectReference Include="..\FLY.HeatingHelper\FLY.HeatingHelper.csproj">
<Project>{973f0eed-3181-4fb9-abd6-196a9e816b77}</Project>
<Name>FLY.HeatingHelper</Name>
......
<Window x:Class="FLY.HeatingHelper.UI.UiModule.Dlg_GetSaveSwitches.DLG_GetSaveSwitches"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:FLY.HeatingHelper.UI.UiModule.Dlg_GetSaveSwitches"
mc:Ignorable="d"
Title="DLG_GetSaveSwitches" Height="256" Width="300">
<Grid Margin="0,0,0,-21">
<Grid.Resources>
<Style TargetType="CheckBox">
<Style.Setters>
<Setter Property="FontSize" Value="18"/>
<Setter Property="Margin" Value="5,5"/>
</Style.Setters>
</Style>
</Grid.Resources>
<StackPanel Orientation="Vertical" Margin="20,20">
<TextBlock Text="请选择要应用的项目:" FontSize="20"/>
<CheckBox Content="复位分区" IsChecked="{Binding ResetBoltSave}" HorizontalAlignment="Left"/>
<CheckBox Content="旋转角度" IsChecked="{Binding RAngleSave}" HorizontalAlignment="Left"/>
<CheckBox Content="比例系数" IsChecked="{Binding KpSave}" HorizontalAlignment="Left"/>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,15">
<Button Content="应 用" HorizontalAlignment="Right" MinWidth="80" Command="{Binding Apply}" Click="Button_Click"/>
<Button Content="取 消" HorizontalAlignment="Right" MinWidth="80" Command="{Binding Cancel}"
Click="Button_Click"
Margin="10,0,0,0"/>
</StackPanel>
</StackPanel>
</Grid>
</Window>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using Unity;
namespace FLY.HeatingHelper.UI.UiModule.Dlg_GetSaveSwitches
{
/// <summary>
/// DLG_GetSaveSwitches.xaml 的交互逻辑
/// </summary>
public partial class DLG_GetSaveSwitches : Window
{
public DLG_GetSaveSwitches()
{
InitializeComponent();
}
public VM_GetSaveSwitches vm;
[InjectionMethod]
public void Init(VM_GetSaveSwitches vm)
{
this.vm = vm;
DataContext = this.vm;
}
private void Button_Click(object sender, RoutedEventArgs e)
{
Close();
}
}
}
using GalaSoft.MvvmLight.Command;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FLY.HeatingHelper.UI.UiModule.Dlg_GetSaveSwitches
{
public class VM_GetSaveSwitches : INotifyPropertyChanged
{
public bool ResetBoltSave { get; set; } = true;
public bool RAngleSave { get; set; } = false;
public bool KpSave { get; set; } = false;
public bool IsCancel = false;
public RelayCommand Apply { get; set; }
private void Command_Apply()
{
IsCancel = false;
}
public RelayCommand Cancel { get; set; }
private void Command_Cancel()
{
IsCancel = true;
}
public VM_GetSaveSwitches()
{
Apply = new RelayCommand(Command_Apply);
Cancel = new RelayCommand(Command_Cancel);
}
public event PropertyChangedEventHandler PropertyChanged;
}
}
......@@ -187,7 +187,15 @@
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal">
<TextBlock Text="旋转角度:" Style="{StaticResource textblock}" />
<TextBlock Text="{Binding RotAngle,StringFormat={}{0:f1}}" Style="{StaticResource textblock}" />
<TextBlock Style="{StaticResource textblock}">
<TextBlock.Text>
<MultiBinding StringFormat="{}{0:f1}({1:f1})">
<Binding Path="RotAngle"/>
<Binding Path="CurrentAngle"/>
</MultiBinding>
</TextBlock.Text>
</TextBlock>
</StackPanel>
<StackPanel Grid.Row="1" Orientation="Horizontal">
<Button Click="Angle_Add" >
......@@ -202,6 +210,12 @@
<iconPacks:PackIconIonicons Kind="ArrowDropdownMD" Margin="8,3,0,0"/>
</StackPanel>
</Button>
<Button Click="Angle_Reset" >
<StackPanel Orientation="Horizontal">
<iconPacks:PackIconMaterial Kind="BackupRestore" VerticalAlignment="Center" Margin="5,0,0,0"/>
<TextBlock Text="当前值" />
</StackPanel>
</Button>
<!--<Button Click="Search_Angle" Width="120">
<StackPanel Orientation="Horizontal">
<iconPacks:PackIconEntypo Kind="BackInTime" VerticalAlignment="Center" Margin="5,0,0,0"/>
......@@ -209,10 +223,27 @@
</StackPanel>
</Button>-->
</StackPanel>
</Grid>
<Grid DockPanel.Dock="Top">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal">
<TextBlock Text="比例系数:" Style="{StaticResource textblock}" />
<TextBlock Style="{StaticResource textblock}">
<TextBlock.Text>
<MultiBinding StringFormat="{}{0:f2}({1:f2})">
<Binding Path="Kp"/>
<Binding Path="CurrentKp"/>
</MultiBinding>
</TextBlock.Text>
</TextBlock>
</StackPanel>
</Grid>
</DockPanel>
<StackPanel DockPanel.Dock="Right">
<Button Content="应用" Height="241" Width="50" Margin="0,15"/>
<Button Content="应用" Height="241" Width="50" Margin="0,15" Command="{Binding Apply}"/>
</StackPanel>
</DockPanel>
......
......@@ -19,6 +19,7 @@ using MathNet.Numerics.LinearAlgebra.Double;
using LiveCharts.Wpf;
using System.Globalization;
using Unity;
using GalaSoft.MvvmLight.Command;
namespace FLY.HeatingHelper.UI.UiModule
{
......@@ -95,8 +96,14 @@ namespace FLY.HeatingHelper.UI.UiModule
mainVM.Change_Angle(0.5);
}
private void Search_Angle(object sender, RoutedEventArgs e)
private void Button_Click(object sender, RoutedEventArgs e)
{
}
private void Angle_Reset(object sender, RoutedEventArgs e)
{
mainVM.RotAngle = mainVM.CurrentAngle;
}
}
......@@ -104,16 +111,21 @@ namespace FLY.HeatingHelper.UI.UiModule
{
[InjectionMethod]
public void Initilize(FLY.Thick.Blowing.IService.IBlowingService blowingService,
FLY.FeedbackRenZiJia.IService.IHeatCellService heatCellService,
FLY.Thick.Blowing.IService.IBlowingDetectService blowingDetectService)
{
blowing = blowingService;
bDetect = blowingDetectService;
this.heatCellService = heatCellService;
Misc.BindingOperations.SetBinding(blowing, "OrgBoltNo", this, "CurrentResetBolt");
Misc.BindingOperations.SetBinding(bDetect, "RAngle", this, "CurrentAngle");
Misc.BindingOperations.SetBinding(this.heatCellService, "Kp", this, "CurrentKp");
Apply = new RelayCommand(Command_Apply);
}
FLY.Thick.Blowing.IService.IBlowingService blowing;
FLY.Thick.Blowing.IService.IBlowingDetectService bDetect;
FLY.FeedbackRenZiJia.IService.IHeatCellService heatCellService;
public UC_FramePickerViewModel vm1 = new UC_FramePickerViewModel();
public UC_FramePickerViewModel vm2 = new UC_FramePickerViewModel();
......@@ -121,6 +133,9 @@ namespace FLY.HeatingHelper.UI.UiModule
public int CurrentResetBolt { get; set; }
public double CurrentAngle { get; set; }
public double CurrentKp { get; set; }
public double Kp { get; set; }
public int LockFrames { get; set; } = 1;
public bool LockAngle { get; set; } = true;
......@@ -133,6 +148,38 @@ namespace FLY.HeatingHelper.UI.UiModule
public double[] DS_vthick { get; protected set; } = null;
public double[] DS_vheat { get; protected set; } = null;
public RelayCommand Apply { get; set; }
private void Command_Apply()
{
if (!FLY.Thick.Base.UI.WdPassword.Authorize("Blowing"))
return;
var dlg = new Dlg_GetSaveSwitches.DLG_GetSaveSwitches();
var vm = new Dlg_GetSaveSwitches.VM_GetSaveSwitches();
dlg.Init(vm);
dlg.ShowDialog();
if (vm.IsCancel) return;
if (vm.ResetBoltSave)
{
blowing.OrgBoltNo = NewResetBolt;
blowing.Apply();
}
if (vm.RAngleSave)
{
bDetect.RAngle = RotAngle;
bDetect.Apply();
}
if (vm.KpSave)
{
heatCellService.Kp = Kp;
heatCellService.Apply();
}
FLY.ControlLibrary.Window_Tip.Show("应用成功", null, TimeSpan.FromSeconds(2));
}
private IThickHeatData _data;
private int _NewResetBolt = 0;
......@@ -146,6 +193,11 @@ namespace FLY.HeatingHelper.UI.UiModule
{
if (_NewResetBolt != value)
{
if(vth1 is null)
{
_NewResetBolt = value;
return;
}
int cnt = vth1.Count();
if (cnt > 0)
{
......@@ -178,19 +230,19 @@ namespace FLY.HeatingHelper.UI.UiModule
}
}
}
private int _resetBolt;
public int ResetBolt
{
get { return _resetBolt; }
set
{
if (_resetBolt != value)
{
_resetBolt = value;
UpdateVarChart();
}
}
}
//private int _resetBolt;
//public int ResetBolt
//{
// get { return _resetBolt; }
// set
// {
// if (_resetBolt != value)
// {
// _resetBolt = value;
// UpdateVarChart();
// }
// }
//}
public UC_AirRingShiftViewModel()
{
......@@ -214,9 +266,9 @@ namespace FLY.HeatingHelper.UI.UiModule
//var tmpVM = ViewModel_HeatDetector.Instance;
//tmpVM.PropertyChanged += DataSelecter_PropertyChanged;
//CurrentAngle = bDetect.Angle;
CurrentAngle = bDetect.RAngle;
CurrentResetBolt = blowing.OrgBoltNo;
RotAngle = CurrentAngle;
RotAngle = CurrentAngle = bDetect.RAngle;
NewResetBolt = CurrentResetBolt = blowing.OrgBoltNo;
Kp = CurrentKp = heatCellService.Kp;
vm1.OnLoaded(true);
vm2.OnLoaded();
......@@ -468,6 +520,7 @@ namespace FLY.HeatingHelper.UI.UiModule
vm1.SelectedFrame = result.frameIdx2;
NewResetBolt = result.frameShift;
TandH_Corel = result.similarity;
Kp = result.ThickToHeatFactor;
//rb += AirRingShift;
//while (rb >= _data.BoltCnt) rb -= _data.BoltCnt;
//while (rb < 0) rb += _data.BoltCnt;
......
......@@ -792,7 +792,7 @@ namespace FLY.HeatingHelper
}
// Step 7
return sumh / (sumt / thickmean);
return sumh / (sumt * 100 / thickmean);
}
protected double[] RemoveNaN(double[] dat)
......@@ -1356,9 +1356,9 @@ namespace FLY.HeatingHelper
result.similarity = maxcorel;
result.deltaAngle = deltaAngle;
var angle = GetRotAngleByIndex(idx1) + deltaAngle;
var heat = DataHelper.VectorSub(GetHeatsByIndex(idx2, -1, -1), GetHeatsByIndex(idx1, -1, -1));
var heat = DataHelper.VectorSub(GetHeatsByIndex(idx1, -1, -1), GetHeatsByIndex(idx2, -1, -1));
var t1 = GetThicksByIndex(idx1, 1, angle);
var th = DataHelper.VectorSub(t1, GetThicksByIndex(idx2, 1, angle));
var th = DataHelper.VectorSub(GetThicksByIndex(idx2, 1, angle), t1);
result.ThickToHeatFactor = CalculateHeatToThickFactor(heat, th,
MathNet.Numerics.Statistics.Statistics.Mean(t1));
});
......@@ -1487,7 +1487,7 @@ namespace FLY.HeatingHelper
tmp.Add(evt);
}
},
int.MaxValue, 10, true, false);
int.MaxValue, 10, false, false);
var r = SearchFeaturedBoltsItem(thickClasses[0].from, thickClasses[0].to, newitems, 5, 100, 5, 5, 5);
if (r != null)
{
......
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