Commit 7ff61276 authored by 潘栩锋's avatar 潘栩锋 🚴

Merge remote-tracking branch 'remotes/origin/dev7.0' into dev7.0-filmCasting

parents c6265fea 6924763a
......@@ -212,6 +212,51 @@ namespace Misc
}
return System.Linq.Enumerable.SequenceEqual(first, second, comparer);
}
/// <summary>
/// 对数列平滑;
/// 数列的两端,平滑量只有 radius;中间数据平滑量 = radius*2+1
/// </summary>
/// <param name="data">数列</param>
/// <param name="radius">平滑半径</param>
/// <returns></returns>
public static double[] Smooth(this IEnumerable<double> frame, int radius)
{
if (radius > 0)
{
double[] frame2 = new double[frame.Count()];
for (int i = 0; i < frame.Count(); i++)
{
double sum = 0;
int cnt = 0;
int index_b = i - radius;
int index_e = i + radius;
for (int j = index_b; j <= index_e; j++)
{
if ((j >= 0) && (j < frame.Count()))
{
double v = frame.ElementAt(j);
if (!double.IsNaN(v))
{
sum += v;
cnt++;
}
}
}
if (cnt > 0)
frame2[i] = sum / cnt;
else
frame2[i] = double.NaN;
}
return frame2;
}
else
{
return frame.ToArray();
}
}
}
/// <summary>
/// X Y 组合
......
......@@ -7,6 +7,9 @@ using System.Threading.Tasks;
namespace FLY.Thick.Base.UI
{
/// <summary>
/// LCUS1 绑定 全局参数字典ParamDictionary 的配置
/// </summary>
public class LCUS1_dependOn:LCUS1
{
ParamDictionary paramDictionary;
......
......@@ -7,6 +7,10 @@ using System.Threading.Tasks;
namespace FLY.Thick.Base.UI
{
/// <summary>
/// 报警服务 的带设备名称 版本
/// </summary>
public class WarningSystem2ServiceClientWithName : WarningSystem2ServiceClient
{
public string DevName { get; private set; }
......
......@@ -9,6 +9,9 @@ using System.Threading.Tasks;
namespace FLY.Thick.Base.UI.OnInit
{
/// <summary>
/// 显示 自动扫描 提示, 只是负责显示而已
/// </summary>
public class OnInitAutoScan : IOnInit
{
FLY.OBJComponents.IService.IWarningSystem2Service warningService;
......
......@@ -14,6 +14,12 @@ using FLY.Thick.Base.Common;
namespace FLY.Thick.Base.UI.OnInit
{
/// <summary>
/// ERRNOs.Instance.SCAN_ERRNO_OVERCTRL
/// ERRNOs.Instance.SCAN_ERRNO_OVERTOL
/// 扫描报警时,全屏显示
/// </summary>
public class OnInitError : IOnInit
{
#region 延时推送 MARKNO
......
......@@ -13,6 +13,9 @@ using FLY.Thick.Base.UI;
namespace FLY.Thick.Base.UI.OnInit
{
/// <summary>
/// F1~F5 动作
/// </summary>
public class OnInitGageCommand : IOnInit
{
Window window;
......
......@@ -11,6 +11,9 @@ using System.Windows;
namespace FLY.Thick.Base.UI.OnInit
{
/// <summary>
/// 语言切换,现在没法用 UI没做英语翻译
/// </summary>
public class OnInitLanguage : IOnInit
{
ParamDictionary paramDictionary;
......
......@@ -9,6 +9,9 @@ using Unity;
namespace FLY.Thick.Base.UI.OnInit
{
/// <summary>
/// LCUS1 USB继电器模块, 监听 WarningSystemManager
/// </summary>
public class OnInitLcus1_Multi : IOnInit
{
public int Level { get; private set; }
......
......@@ -9,6 +9,9 @@ using Unity;
namespace FLY.Thick.Base.UI.OnInit
{
/// <summary>
/// LCUS1 USB继电器模块, 监听 单个报警服务 IWarningSystem2Service
/// </summary>
public class OnInitLcus1_One : IOnInit
{
public int Level { get; private set; }
......
......@@ -11,6 +11,9 @@ using Unity;
namespace FLY.Thick.Base.UI.OnInit
{
/// <summary>
/// 虚拟键盘
/// </summary>
public class OnInitOSK : IOnInit
{
ParamDictionary paramDictionary;
......
......@@ -18,6 +18,9 @@ using System.Collections.ObjectModel;
namespace FLY.Thick.Base.UI.OnInit
{
/// <summary>
/// 监听 WarningSystemManager 的报警。 周期一个个显示 报警列表的内容
/// </summary>
public class OnInitWarnings : IOnInit
{
public int Level { get; private set; }
......@@ -98,6 +101,10 @@ namespace FLY.Thick.Base.UI.OnInit
}
}
/// <summary>
/// 从 warnings.service 容器获取全部 报警服务, 把 全部报警服务的报警内容 整合到 Errors
/// </summary>
public class WarningSystemManager : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
......
......@@ -195,16 +195,14 @@ namespace FLY.Thick.Base.UI.UiModule
UpdateError();
}
private void WarningService_PropertyChanged(object sender, PropertyChangedEventArgs e)
private void WarningSystem_PropertyChanged(object sender, PropertyChangedEventArgs e)
{
if (e.PropertyName == nameof(Reflect_SeviceClient.IsConnected))
{
UpdateError();
}
}
private void WarningSystem_PropertyChanged(object sender, PropertyChangedEventArgs e)
{
if (e.PropertyName == nameof(warningSystem.ReasonList))
else if (e.PropertyName == nameof(warningSystem.ReasonList))
{
if (warningSystem.ReasonList != null && warningSystem.ReasonList.Count() > 0)
reason_list_index = warningSystem.ReasonList.Count() - 1;
......
......@@ -266,8 +266,10 @@ namespace FLY.Thick.Base.Server
double v = MmOfR / 1000.0 / (dt - dtRound).TotalMinutes;
if (v < (FilmVelocity - 1))
FilmVelocity = v;
if (v >= (FilmVelocity - 1))
return;
FilmVelocity = v;
double p1 = RCnt * MmOfR / 1000.0;
......
......@@ -257,9 +257,14 @@ namespace SQLite
sqls.RemoveAll(sql => sql == null);
if (sqls.Count == 0)
return;
sqliteHelper.QueryTran(sqls);
int cnt = 0;
foreach (var sql in sqls) {
cnt += sqliteHelper.ExecuteNonQuery(sql);
}
if (cnt > 0) {
//数据库压缩
sqliteHelper.ExecuteNonQuery("VACUUM");
}
}
/// <summary>
......@@ -387,6 +392,7 @@ namespace SQLite
//把sqls里面为空的全部删除
if (sqliteHelper2.QueryTran(sqls)) {
//数据库压缩
sqliteHelper2.ExecuteNonQuery("VACUUM");
}
......
......@@ -446,18 +446,21 @@ namespace SQLite
/// <param name="parameters">执行增删改语句所需要的参数,参数必须以它们在SQL语句中的顺序为准。</param>
/// <returns></returns>
/// <exception cref="Exception"></exception>
public void ExecuteNonQuery(string sql)
public int ExecuteNonQuery(string sql)
{
int ret = 0;
using (SQLiteConnection connection = new SQLiteConnection(ConnectionString))
{
using (SQLiteCommand command = new SQLiteCommand(connection))
{
connection.Open();
command.CommandText = sql;
command.ExecuteNonQuery();
ret = command.ExecuteNonQuery();
connection.Close();
}
}
return ret;
}
......
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