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 @@ ...@@ -104,6 +104,10 @@
<DependentUpon>App.xaml</DependentUpon> <DependentUpon>App.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="Converter\ValueConverters.cs" /> <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"> <Compile Include="UiModule\HeatThickDetector\HeatThickDetector.xaml.cs">
<DependentUpon>HeatThickDetector.xaml</DependentUpon> <DependentUpon>HeatThickDetector.xaml</DependentUpon>
</Compile> </Compile>
...@@ -146,6 +150,10 @@ ...@@ -146,6 +150,10 @@
<DependentUpon>MainWindow.xaml</DependentUpon> <DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType> <SubType>Code</SubType>
</Compile> </Compile>
<Page Include="UiModule\Dlg_GetSaveSwitches\DLG_GetSaveSwitches.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UiModule\HeatThickDetector\HeatThickDetector.xaml"> <Page Include="UiModule\HeatThickDetector\HeatThickDetector.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType> <SubType>Designer</SubType>
...@@ -207,6 +215,10 @@ ...@@ -207,6 +215,10 @@
<None Include="App.config" /> <None Include="App.config" />
</ItemGroup> </ItemGroup>
<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"> <ProjectReference Include="..\..\Project.FLY.Thick.Blowing\FLY.Thick.Blowing\FLY.Thick.Blowing.csproj">
<Project>{cc20abeb-59f6-492b-a963-51121eb5ae66}</Project> <Project>{cc20abeb-59f6-492b-a963-51121eb5ae66}</Project>
<Name>FLY.Thick.Blowing</Name> <Name>FLY.Thick.Blowing</Name>
...@@ -223,6 +235,10 @@ ...@@ -223,6 +235,10 @@
<Project>{5ee61ac6-5269-4f0f-b8fa-4334fe4a678f}</Project> <Project>{5ee61ac6-5269-4f0f-b8fa-4334fe4a678f}</Project>
<Name>Misc</Name> <Name>Misc</Name>
</ProjectReference> </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"> <ProjectReference Include="..\FLY.HeatingHelper\FLY.HeatingHelper.csproj">
<Project>{973f0eed-3181-4fb9-abd6-196a9e816b77}</Project> <Project>{973f0eed-3181-4fb9-abd6-196a9e816b77}</Project>
<Name>FLY.HeatingHelper</Name> <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 @@ ...@@ -187,7 +187,15 @@
</Grid.RowDefinitions> </Grid.RowDefinitions>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<TextBlock Text="旋转角度:" Style="{StaticResource textblock}" /> <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>
<StackPanel Grid.Row="1" Orientation="Horizontal"> <StackPanel Grid.Row="1" Orientation="Horizontal">
<Button Click="Angle_Add" > <Button Click="Angle_Add" >
...@@ -202,6 +210,12 @@ ...@@ -202,6 +210,12 @@
<iconPacks:PackIconIonicons Kind="ArrowDropdownMD" Margin="8,3,0,0"/> <iconPacks:PackIconIonicons Kind="ArrowDropdownMD" Margin="8,3,0,0"/>
</StackPanel> </StackPanel>
</Button> </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"> <!--<Button Click="Search_Angle" Width="120">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<iconPacks:PackIconEntypo Kind="BackInTime" VerticalAlignment="Center" Margin="5,0,0,0"/> <iconPacks:PackIconEntypo Kind="BackInTime" VerticalAlignment="Center" Margin="5,0,0,0"/>
...@@ -209,10 +223,27 @@ ...@@ -209,10 +223,27 @@
</StackPanel> </StackPanel>
</Button>--> </Button>-->
</StackPanel> </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> </Grid>
</DockPanel> </DockPanel>
<StackPanel DockPanel.Dock="Right"> <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> </StackPanel>
</DockPanel> </DockPanel>
......
...@@ -19,6 +19,7 @@ using MathNet.Numerics.LinearAlgebra.Double; ...@@ -19,6 +19,7 @@ using MathNet.Numerics.LinearAlgebra.Double;
using LiveCharts.Wpf; using LiveCharts.Wpf;
using System.Globalization; using System.Globalization;
using Unity; using Unity;
using GalaSoft.MvvmLight.Command;
namespace FLY.HeatingHelper.UI.UiModule namespace FLY.HeatingHelper.UI.UiModule
{ {
...@@ -95,8 +96,14 @@ namespace FLY.HeatingHelper.UI.UiModule ...@@ -95,8 +96,14 @@ namespace FLY.HeatingHelper.UI.UiModule
mainVM.Change_Angle(0.5); 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 ...@@ -104,16 +111,21 @@ namespace FLY.HeatingHelper.UI.UiModule
{ {
[InjectionMethod] [InjectionMethod]
public void Initilize(FLY.Thick.Blowing.IService.IBlowingService blowingService, public void Initilize(FLY.Thick.Blowing.IService.IBlowingService blowingService,
FLY.FeedbackRenZiJia.IService.IHeatCellService heatCellService,
FLY.Thick.Blowing.IService.IBlowingDetectService blowingDetectService) FLY.Thick.Blowing.IService.IBlowingDetectService blowingDetectService)
{ {
blowing = blowingService; blowing = blowingService;
bDetect = blowingDetectService; bDetect = blowingDetectService;
this.heatCellService = heatCellService;
Misc.BindingOperations.SetBinding(blowing, "OrgBoltNo", this, "CurrentResetBolt"); 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.IBlowingService blowing;
FLY.Thick.Blowing.IService.IBlowingDetectService bDetect; FLY.Thick.Blowing.IService.IBlowingDetectService bDetect;
FLY.FeedbackRenZiJia.IService.IHeatCellService heatCellService;
public UC_FramePickerViewModel vm1 = new UC_FramePickerViewModel(); public UC_FramePickerViewModel vm1 = new UC_FramePickerViewModel();
public UC_FramePickerViewModel vm2 = new UC_FramePickerViewModel(); public UC_FramePickerViewModel vm2 = new UC_FramePickerViewModel();
...@@ -121,6 +133,9 @@ namespace FLY.HeatingHelper.UI.UiModule ...@@ -121,6 +133,9 @@ namespace FLY.HeatingHelper.UI.UiModule
public int CurrentResetBolt { get; set; } public int CurrentResetBolt { get; set; }
public double CurrentAngle { get; set; } public double CurrentAngle { get; set; }
public double CurrentKp { get; set; }
public double Kp { get; set; }
public int LockFrames { get; set; } = 1; public int LockFrames { get; set; } = 1;
public bool LockAngle { get; set; } = true; public bool LockAngle { get; set; } = true;
...@@ -133,6 +148,38 @@ namespace FLY.HeatingHelper.UI.UiModule ...@@ -133,6 +148,38 @@ namespace FLY.HeatingHelper.UI.UiModule
public double[] DS_vthick { get; protected set; } = null; public double[] DS_vthick { get; protected set; } = null;
public double[] DS_vheat { 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 IThickHeatData _data;
private int _NewResetBolt = 0; private int _NewResetBolt = 0;
...@@ -146,6 +193,11 @@ namespace FLY.HeatingHelper.UI.UiModule ...@@ -146,6 +193,11 @@ namespace FLY.HeatingHelper.UI.UiModule
{ {
if (_NewResetBolt != value) if (_NewResetBolt != value)
{ {
if(vth1 is null)
{
_NewResetBolt = value;
return;
}
int cnt = vth1.Count(); int cnt = vth1.Count();
if (cnt > 0) if (cnt > 0)
{ {
...@@ -178,19 +230,19 @@ namespace FLY.HeatingHelper.UI.UiModule ...@@ -178,19 +230,19 @@ namespace FLY.HeatingHelper.UI.UiModule
} }
} }
} }
private int _resetBolt; //private int _resetBolt;
public int ResetBolt //public int ResetBolt
{ //{
get { return _resetBolt; } // get { return _resetBolt; }
set // set
{ // {
if (_resetBolt != value) // if (_resetBolt != value)
{ // {
_resetBolt = value; // _resetBolt = value;
UpdateVarChart(); // UpdateVarChart();
} // }
} // }
} //}
public UC_AirRingShiftViewModel() public UC_AirRingShiftViewModel()
{ {
...@@ -214,9 +266,9 @@ namespace FLY.HeatingHelper.UI.UiModule ...@@ -214,9 +266,9 @@ namespace FLY.HeatingHelper.UI.UiModule
//var tmpVM = ViewModel_HeatDetector.Instance; //var tmpVM = ViewModel_HeatDetector.Instance;
//tmpVM.PropertyChanged += DataSelecter_PropertyChanged; //tmpVM.PropertyChanged += DataSelecter_PropertyChanged;
//CurrentAngle = bDetect.Angle; //CurrentAngle = bDetect.Angle;
CurrentAngle = bDetect.RAngle; RotAngle = CurrentAngle = bDetect.RAngle;
CurrentResetBolt = blowing.OrgBoltNo; NewResetBolt = CurrentResetBolt = blowing.OrgBoltNo;
RotAngle = CurrentAngle; Kp = CurrentKp = heatCellService.Kp;
vm1.OnLoaded(true); vm1.OnLoaded(true);
vm2.OnLoaded(); vm2.OnLoaded();
...@@ -468,6 +520,7 @@ namespace FLY.HeatingHelper.UI.UiModule ...@@ -468,6 +520,7 @@ namespace FLY.HeatingHelper.UI.UiModule
vm1.SelectedFrame = result.frameIdx2; vm1.SelectedFrame = result.frameIdx2;
NewResetBolt = result.frameShift; NewResetBolt = result.frameShift;
TandH_Corel = result.similarity; TandH_Corel = result.similarity;
Kp = result.ThickToHeatFactor;
//rb += AirRingShift; //rb += AirRingShift;
//while (rb >= _data.BoltCnt) rb -= _data.BoltCnt; //while (rb >= _data.BoltCnt) rb -= _data.BoltCnt;
//while (rb < 0) rb += _data.BoltCnt; //while (rb < 0) rb += _data.BoltCnt;
......
...@@ -792,7 +792,7 @@ namespace FLY.HeatingHelper ...@@ -792,7 +792,7 @@ namespace FLY.HeatingHelper
} }
// Step 7 // Step 7
return sumh / (sumt / thickmean); return sumh / (sumt * 100 / thickmean);
} }
protected double[] RemoveNaN(double[] dat) protected double[] RemoveNaN(double[] dat)
...@@ -1356,9 +1356,9 @@ namespace FLY.HeatingHelper ...@@ -1356,9 +1356,9 @@ namespace FLY.HeatingHelper
result.similarity = maxcorel; result.similarity = maxcorel;
result.deltaAngle = deltaAngle; result.deltaAngle = deltaAngle;
var angle = GetRotAngleByIndex(idx1) + 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 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, result.ThickToHeatFactor = CalculateHeatToThickFactor(heat, th,
MathNet.Numerics.Statistics.Statistics.Mean(t1)); MathNet.Numerics.Statistics.Statistics.Mean(t1));
}); });
...@@ -1487,7 +1487,7 @@ namespace FLY.HeatingHelper ...@@ -1487,7 +1487,7 @@ namespace FLY.HeatingHelper
tmp.Add(evt); 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); var r = SearchFeaturedBoltsItem(thickClasses[0].from, thickClasses[0].to, newitems, 5, 100, 5, 5, 5);
if (r != null) 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