Commit 2705bf65 authored by 潘栩锋's avatar 潘栩锋 🚴

修复 测厚仪服务器的 图片周期保存, 因为LiveChart 没法释放资源,导致14小时后, 测厚仪服务器占内存900Mb

parent ad0cf58f
......@@ -51,6 +51,6 @@ using System.Windows;
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("7.2.1.0")]
[assembly: AssemblyFileVersion("7.2.1.0")]
[assembly: AssemblyVersion("7.3.0.0")]
[assembly: AssemblyFileVersion("7.3.0.0")]
[assembly: Guid("BD20A921-953E-44CA-8FAB-4619D3CBCD06")]
......@@ -113,6 +113,8 @@ namespace FLY.Thick.FilmCasting.UI.Server
this.scanGraphVm = new ScanGraphVm();
scanGraphVm.Init(this, profileParam);
Init_FrameworkElement();
this.PropertyChanged += PicHistory_PropertyChanged;
......@@ -134,11 +136,7 @@ namespace FLY.Thick.FilmCasting.UI.Server
}
private void PicHistory_PropertyChanged(object sender, PropertyChangedEventArgs e)
{
if (e.PropertyName == nameof(IntervalMin))
{
timer.Interval = TimeSpan.FromMinutes(IntervalMin);
}
else if (e.PropertyName == nameof(Enable)) {
if (e.PropertyName == nameof(Enable)) {
timer.IsEnabled = Enable;
}
}
......@@ -190,16 +188,18 @@ namespace FLY.Thick.FilmCasting.UI.Server
Directory.CreateDirectory(dirpath);
return $@"{dirpath}\{dt:HH_mm_ss}.jpg";
}
public async void SavePic(string path)
Viewbox viewbox;
ScanGraph scanGraph;
void Init_FrameworkElement()
{
//一定要把 scangraph 放入容器, 且scangraph Left,Top 对齐,margin=0
//不然有黑框
//整个scangraph 的尺寸是 Margin+(Width,Height)
//Margin 是透明,也就是黑色
var viewbox = new Viewbox();
ScanGraph scanGraph = new ScanGraph
viewbox = new Viewbox();
scanGraph = new ScanGraph
{
Width = PicWidth,
Height = PicHeight,
......@@ -217,8 +217,52 @@ namespace FLY.Thick.FilmCasting.UI.Server
scanGraph.ChartUpdate();//强制使 livechart 刷新
viewbox.UpdateLayout();
}
//public async void SavePic(string path)
//{
// //一定要把 scangraph 放入容器, 且scangraph Left,Top 对齐,margin=0
// //不然有黑框
// //整个scangraph 的尺寸是 Margin+(Width,Height)
// //Margin 是透明,也就是黑色
// var viewbox = new Viewbox();
// ScanGraph scanGraph = new ScanGraph
// {
// Width = PicWidth,
// Height = PicHeight,
// //HorizontalAlignment = System.Windows.HorizontalAlignment.Left,
// //VerticalAlignment = System.Windows.VerticalAlignment.Top,
// //Margin = new System.Windows.Thickness()
// };
// scanGraph.Init(scanGraphVm);
// viewbox.Child = scanGraph;
// viewbox.Measure(scanGraph.RenderSize);
// viewbox.Arrange(new System.Windows.Rect(new System.Windows.Point(0, 0), scanGraph.RenderSize));
// scanGraph.ChartUpdate();//强制使 livechart 刷新
// viewbox.UpdateLayout();
// ChartToImage.SaveToJpeg(scanGraph, path);
//}
public void SavePic(string path)
{
scanGraph.Width = PicWidth;
scanGraph.Height = PicHeight;
viewbox.Measure(scanGraph.RenderSize);
viewbox.Arrange(new System.Windows.Rect(new System.Windows.Point(0, 0), scanGraph.RenderSize));
scanGraph.ChartUpdate();//强制使 livechart 刷新
viewbox.UpdateLayout();
ChartToImage.SaveToJpeg(scanGraph, path);
}
public async Task Add(Pack_GetFrameReponse reponse)
{
......
......@@ -51,6 +51,6 @@ using System.Windows;
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("7.2.1.0")]
[assembly: AssemblyFileVersion("7.2.1.0")]
[assembly: AssemblyVersion("7.3.1.0")]
[assembly: AssemblyFileVersion("7.3.1.0")]
[assembly: Guid("E7D930E0-C871-4001-A31A-DC748ED5817C")]
......@@ -51,5 +51,5 @@ using System.Windows;
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("7.2.1.0")]
[assembly: AssemblyFileVersion("7.2.1.0")]
[assembly: AssemblyVersion("7.3.0.0")]
[assembly: AssemblyFileVersion("7.3.0.0")]
Subproject commit 7d29227dee96f5d25468263e740e9eb3f56a07f2
Subproject commit 33cc7ebab0aa2e7eef031c90073940769a5d7c9b
{
"InstallZipVersion":"7.3.0",
"InstallZipUrl":"http://server.flyautomation.net:8889/download/流延测厚仪安装包_v7.3.0_20210920.7z"
"InstallZipVersion":"7.3.1",
"InstallZipUrl":"http://server.flyautomation.net:8889/download/流延测厚仪安装包_v7.3.1_20210920.7z"
}
\ No newline at end of file
流延测厚仪安装包_v7.3.1_20210920
1. 修复 ScanData数据表 EndTime 为 DateTime.Now, 但 Time 为 flyad.Now, 导致时间错乱
2. 修复 Reflect_SeviceClient 大量数据 bug
3. 修复 测厚仪服务器,保存图片功能, livechart 的控件不会释放资源,导致14小时后,服务器占了 900Mb 内存
流延测厚仪安装包_v7.3.0_20210920
1. 添加 在客户端左下角 “枫莱尔” 进入的界面菜单, 添加 【升级检测】
2. 修复 样品界面 样品直径无法保存
......
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