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

* 流延测厚仪安装包_v7.3.2_20211113

1. 修复 流延测厚仪服务器 保存图片 很慢
2. 修复 流延测厚仪服务器 删除图片出错(不存在的文件夹)
3. 优化 AD盒参数保存在电脑。 避免AD盒 i2c 有问题。
parent a3c10259
...@@ -68,6 +68,11 @@ namespace FLY.Thick.FilmCasting.UI.Server ...@@ -68,6 +68,11 @@ namespace FLY.Thick.FilmCasting.UI.Server
/// </summary> /// </summary>
public bool IsPercent { get; set; } = true; public bool IsPercent { get; set; } = true;
/// <summary>
/// 自动目标值
/// </summary>
public bool IsAutoTarget { get; set; }
#endregion #endregion
#region 状态 #region 状态
/// <summary> /// <summary>
...@@ -165,10 +170,14 @@ namespace FLY.Thick.FilmCasting.UI.Server ...@@ -165,10 +170,14 @@ namespace FLY.Thick.FilmCasting.UI.Server
TimeRange = TimeSpan.FromMinutes(5), TimeRange = TimeSpan.FromMinutes(5),
AvgRange = scanWarning.Target * scanWarning.TolerancePercent * 2 AvgRange = scanWarning.Target * scanWarning.TolerancePercent * 2
}, },
async (object asyncContext, object retData) => (object asyncContext, object retData) =>
{ {
Pack_GetFrameReponse reponse = retData as Pack_GetFrameReponse; //创建新线程跑下面的
await Add(reponse); Task.Factory.StartNew((obj) =>
{
Pack_GetFrameReponse reponse = obj as Pack_GetFrameReponse;
Add(reponse);
}, retData);
}, this); }, this);
} }
...@@ -264,7 +273,7 @@ namespace FLY.Thick.FilmCasting.UI.Server ...@@ -264,7 +273,7 @@ namespace FLY.Thick.FilmCasting.UI.Server
ChartToImage.SaveToJpeg(scanGraph, path); ChartToImage.SaveToJpeg(scanGraph, path);
} }
public async Task Add(Pack_GetFrameReponse reponse) void Add(Pack_GetFrameReponse reponse)
{ {
if (reponse.scanData == null) if (reponse.scanData == null)
return;//没有数据 return;//没有数据
...@@ -280,30 +289,27 @@ namespace FLY.Thick.FilmCasting.UI.Server ...@@ -280,30 +289,27 @@ namespace FLY.Thick.FilmCasting.UI.Server
//ALL //ALL
string path = CreateCurrPath(reponse.scanData.EndTime, false); string path = CreateCurrPath(reponse.scanData.EndTime, false);
App.Current.MainWindow.Dispatcher.Invoke(() => timer.Dispatcher.Invoke(() =>
{ {
scanGraphVm.UpdateValue(reponse, isWarning); scanGraphVm.UpdateValue(reponse, isWarning);
SavePic(path); SavePic(path);
}); });
await Task.Factory.StartNew(() => try
{ {
try if (isWarning)
{
if (isWarning)
{
string path_iswarning = CreateCurrPath(reponse.scanData.EndTime, true);
File.Copy(path, path_iswarning, true);
}
Keep();
}
catch
{ {
return; string path_iswarning = CreateCurrPath(reponse.scanData.EndTime, true);
File.Copy(path, path_iswarning, true);
} }
});
Keep();
}
catch
{
return;
}
} }
...@@ -373,11 +379,46 @@ namespace FLY.Thick.FilmCasting.UI.Server ...@@ -373,11 +379,46 @@ namespace FLY.Thick.FilmCasting.UI.Server
{ {
while (dateInRootPath.Count > KeepDay) while (dateInRootPath.Count > KeepDay)
{ {
string dirpath = RootPath + @"\all\" + dateInRootPath.First().ToString(@"yyyy\\MM\\dd"); try
Directory.Delete(dirpath, true); {
string dirpath = RootPath + @"\all\" + dateInRootPath.First().ToString(@"yyyy\\MM\\dd");
if (Directory.Exists(dirpath))
{
Directory.Delete(dirpath, true);
dirpath = RootPath + @"\iswarning\" + dateInRootPath.First().ToString(@"yyyy\\MM\\dd"); //检测上级文件夹,里面是空的,那就继续删除
Directory.Delete(dirpath, true); dirpath = RootPath + @"\all\" + dateInRootPath.First().ToString(@"yyyy\\MM");
Directory.Delete(dirpath);
dirpath = RootPath + @"\all\" + dateInRootPath.First().ToString(@"yyyy");
Directory.Delete(dirpath);
}
}
catch
{
//删除不了。不管了。。。。
}
try
{
string dirpath = RootPath + @"\iswarning\" + dateInRootPath.First().ToString(@"yyyy\\MM\\dd");
if (Directory.Exists(dirpath))
{
Directory.Delete(dirpath, true);
//检测上级文件夹,里面是空的,那就继续删除
dirpath = RootPath + @"\iswarning\" + dateInRootPath.First().ToString(@"yyyy\\MM");
Directory.Delete(dirpath);
dirpath = RootPath + @"\iswarning\" + dateInRootPath.First().ToString(@"yyyy");
Directory.Delete(dirpath);
}
}
catch
{
//删除不了。不管了。。。。
}
dateInRootPath.RemoveAt(0); dateInRootPath.RemoveAt(0);
} }
...@@ -490,5 +531,10 @@ namespace FLY.Thick.FilmCasting.UI.Server ...@@ -490,5 +531,10 @@ namespace FLY.Thick.FilmCasting.UI.Server
/// Y轴%显示 /// Y轴%显示
/// </summary> /// </summary>
public bool IsPercent { get; set; } = true; public bool IsPercent { get; set; } = true;
/// <summary>
/// 自动目标值
/// </summary>
public bool IsAutoTarget { get; set; }
} }
} }
...@@ -267,6 +267,11 @@ namespace FLY.Thick.FilmCasting.UI.Server ...@@ -267,6 +267,11 @@ namespace FLY.Thick.FilmCasting.UI.Server
{ {
double target = this.profileParam.Target; double target = this.profileParam.Target;
if (picHistory.IsAutoTarget)
{
if (!double.IsNaN(Average))
target = Average;
}
double tolerance = this.profileParam.TolerancePercent * target; double tolerance = this.profileParam.TolerancePercent * target;
Target = target; Target = target;
......
...@@ -91,6 +91,10 @@ ...@@ -91,6 +91,10 @@
<TextBlock Style="{StaticResource Styles.Text.FieldHeader}" Text="Y轴%显示"/> <TextBlock Style="{StaticResource Styles.Text.FieldHeader}" Text="Y轴%显示"/>
<CheckBox IsChecked="{Binding IsPercent}"/> <CheckBox IsChecked="{Binding IsPercent}"/>
</StackPanel> </StackPanel>
<StackPanel Margin="{StaticResource ControlMargin}">
<TextBlock Style="{StaticResource Styles.Text.FieldHeader}" Text="Y轴自动目标值"/>
<CheckBox IsChecked="{Binding IsAutoTarget}"/>
</StackPanel>
</StackPanel> </StackPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" > <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" >
<Button Style="{StaticResource Styles.Button.Square.Accent2}" Content="图片保存" Click="btnSavePicClick" Width="auto"/> <Button Style="{StaticResource Styles.Button.Square.Accent2}" Content="图片保存" Click="btnSavePicClick" Width="auto"/>
......
...@@ -100,6 +100,11 @@ namespace FLY.Thick.FilmCasting.UI.Server ...@@ -100,6 +100,11 @@ namespace FLY.Thick.FilmCasting.UI.Server
/// </summary> /// </summary>
public bool IsPercent { get; set; } = true; public bool IsPercent { get; set; } = true;
/// <summary>
/// Y轴自动目标值
/// </summary>
public bool IsAutoTarget { get; set; }
public RelayCommand OkCmd { get; private set; } public RelayCommand OkCmd { get; private set; }
private PicHistory picHistory; private PicHistory picHistory;
public PicHistory PicHistory => picHistory; public PicHistory PicHistory => picHistory;
...@@ -121,6 +126,7 @@ namespace FLY.Thick.FilmCasting.UI.Server ...@@ -121,6 +126,7 @@ namespace FLY.Thick.FilmCasting.UI.Server
YRangePercent = picHistory.YRangePercent; YRangePercent = picHistory.YRangePercent;
IntervalMin = picHistory.IntervalMin; IntervalMin = picHistory.IntervalMin;
IsPercent = picHistory.IsPercent; IsPercent = picHistory.IsPercent;
IsAutoTarget = picHistory.IsAutoTarget;
this.picHistory = picHistory; this.picHistory = picHistory;
} }
...@@ -184,7 +190,7 @@ namespace FLY.Thick.FilmCasting.UI.Server ...@@ -184,7 +190,7 @@ namespace FLY.Thick.FilmCasting.UI.Server
picHistory.YRangePercent = YRangePercent; picHistory.YRangePercent = YRangePercent;
picHistory.IntervalMin = IntervalMin; picHistory.IntervalMin = IntervalMin;
picHistory.IsPercent = IsPercent; picHistory.IsPercent = IsPercent;
picHistory.IsAutoTarget = IsAutoTarget;
picHistory.Save(); picHistory.Save();
MessageBox.Show($"设置完成"); MessageBox.Show($"设置完成");
......
...@@ -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.3.1.0")] [assembly: AssemblyVersion("7.3.2")]
[assembly: AssemblyFileVersion("7.3.1.0")] [assembly: AssemblyFileVersion("7.3.2")]
[assembly: Guid("E7D930E0-C871-4001-A31A-DC748ED5817C")] [assembly: Guid("E7D930E0-C871-4001-A31A-DC748ED5817C")]
Subproject commit 33cc7ebab0aa2e7eef031c90073940769a5d7c9b Subproject commit 64064eb49ba70a22f57160b88f62c4e398eb1e9c
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