Commit 3be7f334 authored by 潘栩锋's avatar 潘栩锋 🚴

修复 测厚 即时扫描图 Y轴 公差 与产品不一致

parent d6861dde
...@@ -51,6 +51,6 @@ using System.Windows; ...@@ -51,6 +51,6 @@ using System.Windows;
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示: //通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("7.5.1.0")] [assembly: AssemblyVersion("7.5.5.0")]
[assembly: AssemblyFileVersion("7.5.1.0")] [assembly: AssemblyFileVersion("7.5.5.0")]
[assembly: Guid("BD20A921-953E-44CA-8FAB-4619D3CBCD06")] [assembly: Guid("BD20A921-953E-44CA-8FAB-4619D3CBCD06")]
...@@ -17,7 +17,8 @@ ...@@ -17,7 +17,8 @@
<!--MahApps.Brushes.Accent--> <!--MahApps.Brushes.Accent-->
<SolidColorBrush x:Key="Brushes.ChartArea0" Color="#CC60A917" /> <SolidColorBrush x:Key="Brushes.ChartArea0" Color="#CC60A917" />
<!--MahApps.Brushes.ValidationSummary4--> <!--MahApps.Brushes.ValidationSummary4-->
<SolidColorBrush x:Key="Brushes.ChartArea1" Color="#ccfec007"/> <!--<SolidColorBrush x:Key="Brushes.ChartArea1" Color="#ccfec007"/>-->
<SolidColorBrush x:Key="Brushes.ChartArea1" Color="Orange"/>
<!--MahApps.Brushes.ValidationSummary2--> <!--MahApps.Brushes.ValidationSummary2-->
<SolidColorBrush x:Key="Brushes.ChartArea2" Color="#CCCA000C" /> <SolidColorBrush x:Key="Brushes.ChartArea2" Color="#CCCA000C" />
......
...@@ -219,35 +219,8 @@ namespace FLY.Thick.FilmCasting.UI.UiModule ...@@ -219,35 +219,8 @@ namespace FLY.Thick.FilmCasting.UI.UiModule
profileParam.PropertyChanged += ProfileParam_PropertyChanged; profileParam.PropertyChanged += ProfileParam_PropertyChanged;
this.PropertyChanged += ScanGraphVm_PropertyChanged; this.PropertyChanged += ScanGraphVm_PropertyChanged;
bulkDb.TempFrameChanged += BulkDb_TempFrameChanged; bulkDb.TempFrameChanged += BulkDb_TempFrameChanged;
bulkDb.GetTempFrame(GetTempFrameHandler, null);
} }
void GetTempFrameHandler(object asyncContext, object retData)
{
BulkDbTempFrameChangedEventArgs reponse = retData as BulkDbTempFrameChangedEventArgs;
Time = reponse.Time;
datas.Clear();
if (reponse.D != null) {
for (int i = 0; i < reponse.StartIndex; i++) {
datas.Add(double.NaN);
}
datas.AddRange(reponse.D);
}
//清除全部数据
Values.Clear();
//更新平均值,它会引起 YFormatter 刷新
UpdateAverage();
PropertyChanged_Average();
Values.AddRange(datas);
}
protected void BulkDb_TempFrameChanged(object sender, EventArgs e) protected void BulkDb_TempFrameChanged(object sender, EventArgs e)
{ {
BulkDbTempFrameChangedEventArgs reponse = e as BulkDbTempFrameChangedEventArgs; BulkDbTempFrameChangedEventArgs reponse = e as BulkDbTempFrameChangedEventArgs;
...@@ -328,16 +301,6 @@ namespace FLY.Thick.FilmCasting.UI.UiModule ...@@ -328,16 +301,6 @@ namespace FLY.Thick.FilmCasting.UI.UiModule
} }
} }
protected void BulkDb_PropertyChanged(object sender, PropertyChangedEventArgs e)
{
if (e.PropertyName == nameof(FObjBase.FObjServiceClient.IsConnected))
{
if ((bulkDb as FObjBase.FObjServiceClient).IsConnected)
{
bulkDb.GetTempFrame(GetTempFrameHandler, null);
}
}
}
protected void Graphparam_PropertyChanged(object sender, PropertyChangedEventArgs e) protected void Graphparam_PropertyChanged(object sender, PropertyChangedEventArgs e)
{ {
...@@ -350,24 +313,35 @@ namespace FLY.Thick.FilmCasting.UI.UiModule ...@@ -350,24 +313,35 @@ namespace FLY.Thick.FilmCasting.UI.UiModule
NotifyPropertyChanged(nameof(YFormatter)); NotifyPropertyChanged(nameof(YFormatter));
UpdateMaxMinTextAsync(); UpdateMaxMinTextAsync();
} }
else if (e.PropertyName == nameof(graphparam.IsAutoTarget)) {
PropertyChanged_IsAutoTarget();
}
} }
protected void UpdateY() protected void UpdateY()
{ {
double target = this.profileParam.Target; PropertyChanged_IsAutoTarget();
}
/// <summary>
/// profileParam.Target 变化了,触发
/// </summary>
void PropertyChanged_IsAutoTarget()
{
//自动目标值模式 且 已经有平均值
if (graphparam.IsAutoTarget && (!double.IsNaN(Average))) if (graphparam.IsAutoTarget && (!double.IsNaN(Average)))
{ {
target = Average; PropertyChanged_Average();
}
else {
Target = profileParam.Target;
PropertyChanged_Target();
} }
Target = target;
TolerancePercent = profileParam.TolerancePercent;
Tolerance = Math.Max(TolerancePercent * Target, MIN_TOLERANCE);
PropertyChanged_Target_Tolerance_YRangePercent();
} }
/// <summary>
/// profileParam.Target 变化了,触发
/// </summary>
void PropertyChanged_ParamTarget() void PropertyChanged_ParamTarget()
{ {
//自动目标值模式 且 已经有平均值 //自动目标值模式 且 已经有平均值
...@@ -377,14 +351,39 @@ namespace FLY.Thick.FilmCasting.UI.UiModule ...@@ -377,14 +351,39 @@ namespace FLY.Thick.FilmCasting.UI.UiModule
} }
Target = profileParam.Target; Target = profileParam.Target;
PropertyChanged_Target_Tolerance_YRangePercent(); PropertyChanged_Target();
} }
void PropertyChanged_ParamTolerancePercent()
/// <summary>
/// profileParam.TolerancePercent 变化了,触发
/// </summary>
void PropertyChanged_ParamTolerancePercent()
{ {
TolerancePercent = profileParam.TolerancePercent; TolerancePercent = profileParam.TolerancePercent;
PropertyChanged_TolerancePercent();
}
/// <summary>
/// TolerancePercent 变化了,触发
/// </summary>
void PropertyChanged_TolerancePercent()
{
Tolerance = Math.Max(TolerancePercent * Target, MIN_TOLERANCE); Tolerance = Math.Max(TolerancePercent * Target, MIN_TOLERANCE);
PropertyChanged_Target_Tolerance_YRangePercent(); PropertyChanged_Target_Tolerance_YRangePercent();
} }
/// <summary>
/// Target 变化了,触发
/// </summary>
void PropertyChanged_Target()
{
Tolerance = Math.Max(TolerancePercent * Target, MIN_TOLERANCE);
PropertyChanged_Target_Tolerance_YRangePercent();
}
/// <summary>
/// target 或 tolerance 或 yrangePercent 变化了,触发
/// </summary>
void PropertyChanged_Target_Tolerance_YRangePercent() void PropertyChanged_Target_Tolerance_YRangePercent()
{ {
ToleranceYMax = Target + Tolerance; ToleranceYMax = Target + Tolerance;
...@@ -395,6 +394,7 @@ namespace FLY.Thick.FilmCasting.UI.UiModule ...@@ -395,6 +394,7 @@ namespace FLY.Thick.FilmCasting.UI.UiModule
YMax = Target + Tolerance * graphparam.YRangePercent; YMax = Target + Tolerance * graphparam.YRangePercent;
YMin = Target - Tolerance * graphparam.YRangePercent; YMin = Target - Tolerance * graphparam.YRangePercent;
} }
void PropertyChanged_YRangePercent() void PropertyChanged_YRangePercent()
{ {
YMax = Target + Tolerance * graphparam.YRangePercent; YMax = Target + Tolerance * graphparam.YRangePercent;
...@@ -410,7 +410,11 @@ namespace FLY.Thick.FilmCasting.UI.UiModule ...@@ -410,7 +410,11 @@ namespace FLY.Thick.FilmCasting.UI.UiModule
if (!double.IsNaN(Target))//之前有显示范围 if (!double.IsNaN(Target))//之前有显示范围
{ {
if (Average < ToleranceYMax && Average > ToleranceYMin) double range = YMax - YMin;
double target = (YMax + YMin) / 2;
range = range * 2 / 3 / 2;
if (Math.Abs(target - Average)<range)
{ {
//变化很小, 不调整显示 //变化很小, 不调整显示
return; return;
...@@ -418,7 +422,7 @@ namespace FLY.Thick.FilmCasting.UI.UiModule ...@@ -418,7 +422,7 @@ namespace FLY.Thick.FilmCasting.UI.UiModule
} }
Target = Average; Target = Average;
PropertyChanged_Target_Tolerance_YRangePercent(); PropertyChanged_Target();
} }
protected void UpdateX() protected void UpdateX()
......
...@@ -75,6 +75,7 @@ namespace FLY.Thick.FilmCasting.UI.UiModule ...@@ -75,6 +75,7 @@ namespace FLY.Thick.FilmCasting.UI.UiModule
Values.AddRange(datas); Values.AddRange(datas);
UpdateAverage(); UpdateAverage();
UpdateY(); UpdateY();
UpdateMaxMinText(); UpdateMaxMinText();
#endregion #endregion
......
{ {
"InstallZipVersion":"7.5.1", "InstallZipVersion":"7.5.5",
"InstallZipUrl":"http://server.flyautomation.net:8889/download/流延测厚仪安装包_v7.5.1_20220305.7z" "InstallZipUrl":"http://server.flyautomation.net:8889/download/流延测厚仪安装包_v7.5.5_20220308.7z"
} }
\ No newline at end of file
# 流延测厚仪安装包_v7.5.1_20220305 # 流延测厚仪安装包_v7.5.5_20220308
## 流延测厚仪客户端 v7.5.1 ## 流延测厚仪客户端 v7.5.5
1. 添加 支持称重, 支持自动模头 1. 添加 支持称重, 支持自动模头
2. 修复 即时图 Y轴 公差没有与产品不一致
## 自动模头服务器 v7.0.0 ## 自动模头服务器 v7.0.0
## 称重服务器 v7.0.0 ## 称重服务器 v7.0.0
......
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