Commit 3057f45c authored by 潘栩锋's avatar 潘栩锋 🚴

修复 程序刚开机,HeatThickDetector 不会显示上一次的计算结果

parent 0a9653b5
......@@ -48,7 +48,7 @@ namespace FLY.HeatingHelper.UI.UiModule
NavigationService ns = Application.Current.Properties["NavigationService"] as NavigationService;
if (ns != null)
{
if(vm._dat.BeginUse())
if(vm.dat.BeginUse())
{
Page_HeatDetector page = new Page_HeatDetector();
container.BuildUp(page);
......
......@@ -10,28 +10,35 @@ namespace FLY.HeatingHelper.UI.UiModule
{
public class ViewModel_HeatThickDetector : INotifyPropertyChanged
{
public IThickHeatData _dat;
public IThickHeatData dat;
public IThickHeatData Dat
{
get
{
return _dat;
return dat;
}
set
{
_dat = value;
dat = value;
}
}
public ViewModel_HeatThickDetector(FLY.Thick.Blowing.IService.IBlowingService blowing, IThickHeatData dat)
{
_dat = dat;
this.dat = dat;
Misc.BindingOperations.SetBinding(dat, "NewResetBolt", this, "NewResetBolt");
Misc.BindingOperations.SetBinding(blowing, "OrgBoltNo", () =>
{
CurrentResetBolt = blowing.OrgBoltNo;
NewResetBolt = CurrentResetBolt;
if (this.dat.OldResetBolt == 0)
{
//刚开机
NewResetBolt = CurrentResetBolt;
}
else if (CurrentResetBolt != this.dat.OldResetBolt)
{
NewResetBolt = CurrentResetBolt;
}
});
IsDifferent = (CurrentResetBolt != NewResetBolt);
......@@ -55,8 +62,8 @@ namespace FLY.HeatingHelper.UI.UiModule
{
get
{
if (_dat == null) return false;
if (_dat.TotalDataFrom != DateTime.MinValue) return true;
if (dat == null) return false;
if (dat.TotalDataFrom != DateTime.MinValue) return true;
return false;
}
}
......
......@@ -62,9 +62,13 @@ namespace FLY.HeatingHelper
/// <summary>
/// 风环偏差值
/// 新计算得到的风环复位区号
/// </summary>
int NewResetBolt { get; }
/// <summary>
/// 原始风环复位区号
/// </summary>
int OldResetBolt { get; }
StateCode State { get; }
......@@ -214,11 +218,33 @@ namespace FLY.HeatingHelper
public class MaxSimilarityResult
{
/// <summary>
/// 第一幅图
/// </summary>
public int frameIdx1;
/// <summary>
/// 第二幅图
/// </summary>
public int frameIdx2;
/// <summary>
/// 正确的复位区号
/// </summary>
public int frameShift;
/// <summary>
/// 原始的复位区号
/// </summary>
public int oldOrgBolt;
/// <summary>
/// 相关性
/// </summary>
public double similarity;
/// <summary>
/// 正确的旋转角度
/// </summary>
public double deltaAngle;
/// <summary>
/// 正确的Kp
/// </summary>
public double ThickToHeatFactor;
}
......
......@@ -186,6 +186,7 @@ namespace FLY.HeatingHelper
#endregion
public int NewResetBolt { get; internal set; } = 0;
public int OldResetBolt { get; private set; } = 0;
public bool BeginUse(bool isAsync = true)
{
......@@ -214,6 +215,7 @@ namespace FLY.HeatingHelper
if (ms.similarity > 0.7)
{
NewResetBolt = ms.frameShift;
OldResetBolt = ms.oldOrgBolt;
}
}
......@@ -1354,6 +1356,7 @@ namespace FLY.HeatingHelper
}
result.frameIdx1 = idx1;
result.frameIdx2 = idx2;
result.oldOrgBolt = GetResetBoltByIndex(idx2);
result.frameShift = theshift;
result.similarity = maxcorel;
result.deltaAngle = deltaAngle;
......
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