Commit 700300c2 by liulongfei

1. 预览操作日志

2. 播控操作日志
parent 3b2b762f
...@@ -20,6 +20,21 @@ namespace VIZ.Package.Domain ...@@ -20,6 +20,21 @@ namespace VIZ.Package.Domain
/// </summary> /// </summary>
public const string SYSTEM_SET_UP = "系统启动"; public const string SYSTEM_SET_UP = "系统启动";
/// <summary>
/// 启动预览
/// </summary>
public const string SYSTEM_SET_UP_PREVIEW = "启动预览";
/// <summary>
/// 发送Viz命令
/// </summary>
public const string SYSTEM_SEND_VIZ_COMMAND = "发送Viz命令";
/// <summary>
/// 触发快捷键
/// </summary>
public const string SYSTEM_HOT_KEY = "触发快捷键";
// =============================================================================================== // ===============================================================================================
// 操作 // 操作
// =============================================================================================== // ===============================================================================================
...@@ -33,5 +48,88 @@ namespace VIZ.Package.Domain ...@@ -33,5 +48,88 @@ namespace VIZ.Package.Domain
/// 关闭系统 /// 关闭系统
/// </summary> /// </summary>
public const string OPERATE_SHUTDOWN = "关闭系统"; public const string OPERATE_SHUTDOWN = "关闭系统";
// =============================================================================
// Viz预览
// =============================================================================
/// <summary>
/// 重启预览引擎
/// </summary>
public const string OPERATE_RESTART_PREVIEW = "重启预览引擎";
/// <summary>
/// 点击预览播放
/// </summary>
public const string OPERATE_PREVIEW_PLAY = "点击预览播放";
/// <summary>
/// 点击预览继续
/// </summary>
public const string OPERATE_PREVIEW_CONTINUE = "点击预览继续";
/// <summary>
/// 点击预览停止
/// </summary>
public const string OPERATE_PREVIEW_STOP = "点击预览停止";
/// <summary>
/// 点击预览更新
/// </summary>
public const string OPERATE_PREVIEW_UPDATE = "点击预览更新";
/// <summary>
/// 点击预览RGB
/// </summary>
public const string OPERATE_PREVIEW_RGB = "点击预览RGB";
/// <summary>
/// 点击预览Key
/// </summary>
public const string OPERATE_PREVIEW_KEY = "点击预览Key";
/// <summary>
/// 点击预览KeyPreview
/// </summary>
public const string OPERATE_PREVIEW_KEY_PREVIEW = "点击预览KeyPreview";
/// <summary>
/// 点击预览TS
/// </summary>
public const string OPERATE_PREVIEW_TS = "点击预览TS";
/// <summary>
/// 点击预览SA
/// </summary>
public const string OPERATE_PREVIEW_SA = "点击预览SA";
/// <summary>
/// 点击预览BB
/// </summary>
public const string OPERATE_PREVIEW_BB = "点击预览BB";
// =============================================================================
// Take
// =============================================================================
/// <summary>
/// 点击Take
/// </summary>
public const string OPERATE_TAKE_TAKE = "播控:点击Take";
/// <summary>
/// 点击继续
/// </summary>
public const string OPERATE_TAKE_CONTINUE = "播控:点击Continue";
/// <summary>
/// 点击下版
/// </summary>
public const string OPERATE_TAKE_OUT = "播控:点击TakeOut";
/// <summary>
/// 点击更新
/// </summary>
public const string OPERATE_TAKE_UPDATE = "播控:点击Update";
} }
} }
...@@ -9,6 +9,7 @@ using VIZ.Framework.Core; ...@@ -9,6 +9,7 @@ using VIZ.Framework.Core;
using VIZ.Package.Domain; using VIZ.Package.Domain;
using VIZ.Package.Plugin; using VIZ.Package.Plugin;
using VIZ.Package.Service; using VIZ.Package.Service;
using VIZ.Package.Storage;
namespace VIZ.Package.Module namespace VIZ.Package.Module
{ {
...@@ -67,6 +68,11 @@ namespace VIZ.Package.Module ...@@ -67,6 +68,11 @@ namespace VIZ.Package.Module
/// </summary> /// </summary>
private VizCommandControlObjectService vizCommandControlObjectService = new VizCommandControlObjectService(); private VizCommandControlObjectService vizCommandControlObjectService = new VizCommandControlObjectService();
/// <summary>
/// 操作日志服务
/// </summary>
private RecordLogService recordLogService = new RecordLogService();
// ============================================================== // ==============================================================
// Property // Property
// ============================================================== // ==============================================================
...@@ -92,6 +98,9 @@ namespace VIZ.Package.Module ...@@ -92,6 +98,9 @@ namespace VIZ.Package.Module
if (service == null) if (service == null)
return; return;
// 记录操作日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_TAKE_TAKE);
// 尝试更新控制字段List的值 // 尝试更新控制字段List的值
service.TryUpdateControlFieldListValue(); service.TryUpdateControlFieldListValue();
...@@ -154,6 +163,9 @@ namespace VIZ.Package.Module ...@@ -154,6 +163,9 @@ namespace VIZ.Package.Module
/// </summary> /// </summary>
private void Continue() private void Continue()
{ {
// 记录操作日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_TAKE_CONTINUE);
this.Execute( this.Execute(
action: (obj, view, conn) => action: (obj, view, conn) =>
{ {
...@@ -177,6 +189,9 @@ namespace VIZ.Package.Module ...@@ -177,6 +189,9 @@ namespace VIZ.Package.Module
/// </summary> /// </summary>
private void TakeOut() private void TakeOut()
{ {
// 记录操作日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_TAKE_OUT);
this.Execute( this.Execute(
action: (obj, view, conn) => action: (obj, view, conn) =>
{ {
...@@ -216,6 +231,9 @@ namespace VIZ.Package.Module ...@@ -216,6 +231,9 @@ namespace VIZ.Package.Module
if (service == null) if (service == null)
return; return;
// 记录操作日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_TAKE_UPDATE);
// 尝试更新控制字段List的值 // 尝试更新控制字段List的值
service.TryUpdateControlFieldListValue(); service.TryUpdateControlFieldListValue();
...@@ -259,6 +277,9 @@ namespace VIZ.Package.Module ...@@ -259,6 +277,9 @@ namespace VIZ.Package.Module
// 上板 // 上板
if (string.Equals(msg.Key, ApplicationDomainEx.HotKeyConfig.Take)) if (string.Equals(msg.Key, ApplicationDomainEx.HotKeyConfig.Take))
{ {
// 记录操作日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.SYSTEM_HOT_KEY, msg.Key);
this.Take(); this.Take();
return; return;
} }
...@@ -266,6 +287,9 @@ namespace VIZ.Package.Module ...@@ -266,6 +287,9 @@ namespace VIZ.Package.Module
// 继续 // 继续
if (string.Equals(msg.Key, ApplicationDomainEx.HotKeyConfig.TakeContinue)) if (string.Equals(msg.Key, ApplicationDomainEx.HotKeyConfig.TakeContinue))
{ {
// 记录操作日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.SYSTEM_HOT_KEY, msg.Key);
this.Continue(); this.Continue();
return; return;
} }
...@@ -273,6 +297,9 @@ namespace VIZ.Package.Module ...@@ -273,6 +297,9 @@ namespace VIZ.Package.Module
// 下版 // 下版
if (string.Equals(msg.Key, ApplicationDomainEx.HotKeyConfig.TakeOut)) if (string.Equals(msg.Key, ApplicationDomainEx.HotKeyConfig.TakeOut))
{ {
// 记录操作日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.SYSTEM_HOT_KEY, msg.Key);
this.TakeOut(); this.TakeOut();
return; return;
} }
...@@ -280,6 +307,9 @@ namespace VIZ.Package.Module ...@@ -280,6 +307,9 @@ namespace VIZ.Package.Module
// 更新 // 更新
if (string.Equals(msg.Key, ApplicationDomainEx.HotKeyConfig.TakeUpdate)) if (string.Equals(msg.Key, ApplicationDomainEx.HotKeyConfig.TakeUpdate))
{ {
// 记录操作日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.SYSTEM_HOT_KEY, msg.Key);
this.Update(); this.Update();
return; return;
} }
......
...@@ -6,6 +6,8 @@ using System.Text; ...@@ -6,6 +6,8 @@ using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using VIZ.Framework.Core; using VIZ.Framework.Core;
using VIZ.Package.Domain; using VIZ.Package.Domain;
using VIZ.Package.Service;
using VIZ.Package.Storage;
namespace VIZ.Package.Module namespace VIZ.Package.Module
{ {
...@@ -20,6 +22,11 @@ namespace VIZ.Package.Module ...@@ -20,6 +22,11 @@ namespace VIZ.Package.Module
private static readonly ILog log = LogManager.GetLogger(typeof(VizCommandWindowModel)); private static readonly ILog log = LogManager.GetLogger(typeof(VizCommandWindowModel));
/// <summary> /// <summary>
/// 操作日志服务
/// </summary>
private RecordLogService recordLogService = new RecordLogService();
/// <summary>
/// 日志视图模型 /// 日志视图模型
/// </summary> /// </summary>
public VizCommandWindowModel() public VizCommandWindowModel()
...@@ -82,6 +89,10 @@ namespace VIZ.Package.Module ...@@ -82,6 +89,10 @@ namespace VIZ.Package.Module
/// <param name="msg">消息</param> /// <param name="msg">消息</param>
private void OnVizCommandLogMessage(VizCommandLogMessage msg) private void OnVizCommandLogMessage(VizCommandLogMessage msg)
{ {
// 记录操作日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.System, RecordLogTrigger.System, RecordLogConstants.SYSTEM_SEND_VIZ_COMMAND, msg.Log);
// 更新界面
WPFHelper.BeginInvoke(() => WPFHelper.BeginInvoke(() =>
{ {
VizCommandWindow view = this.GetView<VizCommandWindow>(); VizCommandWindow view = this.GetView<VizCommandWindow>();
......
...@@ -8,6 +8,7 @@ using System.Text; ...@@ -8,6 +8,7 @@ using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using VIZ.Framework.Core; using VIZ.Framework.Core;
using VIZ.Package.Domain; using VIZ.Package.Domain;
using VIZ.Package.Service;
using VIZ.Package.Storage; using VIZ.Package.Storage;
namespace VIZ.Package.Module namespace VIZ.Package.Module
...@@ -23,6 +24,11 @@ namespace VIZ.Package.Module ...@@ -23,6 +24,11 @@ namespace VIZ.Package.Module
private readonly static ILog log = LogManager.GetLogger(typeof(VizPreviewController)); private readonly static ILog log = LogManager.GetLogger(typeof(VizPreviewController));
/// <summary> /// <summary>
/// 操作日志服务
/// </summary>
private RecordLogService recordLogService = new RecordLogService();
/// <summary>
/// Viz预览重启等待时间(单位:毫秒) /// Viz预览重启等待时间(单位:毫秒)
/// </summary> /// </summary>
private int VIZ_PREVIEW_RESTART_WAIT = ApplicationDomainEx.IniStorage.GetValue<VizConfig, int>(p => p.VIZ_PREVIEW_RESTART_WAIT); private int VIZ_PREVIEW_RESTART_WAIT = ApplicationDomainEx.IniStorage.GetValue<VizConfig, int>(p => p.VIZ_PREVIEW_RESTART_WAIT);
...@@ -49,6 +55,9 @@ namespace VIZ.Package.Module ...@@ -49,6 +55,9 @@ namespace VIZ.Package.Module
/// <param name="conn">连接模型</param> /// <param name="conn">连接模型</param>
public void StartVizEngine(VizPreviewView view, string path, ConnModel conn) public void StartVizEngine(VizPreviewView view, string path, ConnModel conn)
{ {
// 操作日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.System, RecordLogTrigger.System, RecordLogConstants.SYSTEM_SET_UP_PREVIEW);
var dpi = WPFHelper.GetDpiByGraphics(); var dpi = WPFHelper.GetDpiByGraphics();
int width = (int)(view.host.ActualWidth * (dpi.X / 96d)); int width = (int)(view.host.ActualWidth * (dpi.X / 96d));
int height = (int)(view.host.ActualHeight * (dpi.Y / 96d)); int height = (int)(view.host.ActualHeight * (dpi.Y / 96d));
......
...@@ -181,6 +181,11 @@ namespace VIZ.Package.Module ...@@ -181,6 +181,11 @@ namespace VIZ.Package.Module
/// </summary> /// </summary>
private VizCommandControlObjectService vizCommandControlObjectService = new VizCommandControlObjectService(); private VizCommandControlObjectService vizCommandControlObjectService = new VizCommandControlObjectService();
/// <summary>
/// 操作日志服务
/// </summary>
private RecordLogService recordLogService = new RecordLogService();
// ================================================================================ // ================================================================================
// Command // Command
// ================================================================================ // ================================================================================
...@@ -291,6 +296,9 @@ namespace VIZ.Package.Module ...@@ -291,6 +296,9 @@ namespace VIZ.Package.Module
if (DXMessageBox.Show("是否重启预览引擎?", "提示", MessageBoxButton.YesNo) != MessageBoxResult.Yes) if (DXMessageBox.Show("是否重启预览引擎?", "提示", MessageBoxButton.YesNo) != MessageBoxResult.Yes)
return; return;
// 操作日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_RESTART_PREVIEW);
// 设置预览引擎未准备完毕 // 设置预览引擎未准备完毕
ApplicationDomainEx.IsVizPreviewReadly = false; ApplicationDomainEx.IsVizPreviewReadly = false;
this.IsVizPreviewReadly = false; this.IsVizPreviewReadly = false;
...@@ -333,6 +341,9 @@ namespace VIZ.Package.Module ...@@ -333,6 +341,9 @@ namespace VIZ.Package.Module
/// </summary> /// </summary>
private void Play() private void Play()
{ {
// 记录操作日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_PREVIEW_PLAY);
this.Execute((obj, view, conn) => this.Execute((obj, view, conn) =>
{ {
this.vizCommandService.SetEnabledUpdate(conn, false); this.vizCommandService.SetEnabledUpdate(conn, false);
...@@ -363,6 +374,9 @@ namespace VIZ.Package.Module ...@@ -363,6 +374,9 @@ namespace VIZ.Package.Module
/// </summary> /// </summary>
private void Continue() private void Continue()
{ {
// 记录操作日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_PREVIEW_CONTINUE);
this.Execute((obj, view, conn) => this.Execute((obj, view, conn) =>
{ {
this.vizCommandService.Continue(conn, null, VizLayer.MAIN_LAYER); this.vizCommandService.Continue(conn, null, VizLayer.MAIN_LAYER);
...@@ -384,6 +398,9 @@ namespace VIZ.Package.Module ...@@ -384,6 +398,9 @@ namespace VIZ.Package.Module
/// </summary> /// </summary>
private void Stop() private void Stop()
{ {
// 记录操作日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_PREVIEW_STOP);
this.Execute((obj, view, conn) => this.Execute((obj, view, conn) =>
{ {
this.vizCommandService.Stop(conn, null, VizLayer.MAIN_LAYER); this.vizCommandService.Stop(conn, null, VizLayer.MAIN_LAYER);
...@@ -405,6 +422,9 @@ namespace VIZ.Package.Module ...@@ -405,6 +422,9 @@ namespace VIZ.Package.Module
/// </summary> /// </summary>
private void Update() private void Update()
{ {
// 记录操作日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_PREVIEW_UPDATE);
// 更新控制字段List的值 // 更新控制字段List的值
IFieldTreeService service = ApplicationDomainEx.ServiceManager.GetService<IFieldTreeService>(ViewServiceKeys.FIELD_TREE_SERVICE); IFieldTreeService service = ApplicationDomainEx.ServiceManager.GetService<IFieldTreeService>(ViewServiceKeys.FIELD_TREE_SERVICE);
if (service == null) if (service == null)
...@@ -455,6 +475,9 @@ namespace VIZ.Package.Module ...@@ -455,6 +475,9 @@ namespace VIZ.Package.Module
if (!ApplicationDomainEx.IsVizPreviewReadly || ApplicationDomainEx.CurrentPage == null) if (!ApplicationDomainEx.IsVizPreviewReadly || ApplicationDomainEx.CurrentPage == null)
return; return;
// 记录操作日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_PREVIEW_RGB);
this.vizCommandService.ShowRGB(ApplicationDomainEx.PreviewConn); this.vizCommandService.ShowRGB(ApplicationDomainEx.PreviewConn);
} }
...@@ -476,6 +499,9 @@ namespace VIZ.Package.Module ...@@ -476,6 +499,9 @@ namespace VIZ.Package.Module
if (!ApplicationDomainEx.IsVizPreviewReadly || ApplicationDomainEx.CurrentPage == null) if (!ApplicationDomainEx.IsVizPreviewReadly || ApplicationDomainEx.CurrentPage == null)
return; return;
// 记录操作日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_PREVIEW_KEY);
this.vizCommandService.ShowKey(ApplicationDomainEx.PreviewConn); this.vizCommandService.ShowKey(ApplicationDomainEx.PreviewConn);
} }
...@@ -497,6 +523,9 @@ namespace VIZ.Package.Module ...@@ -497,6 +523,9 @@ namespace VIZ.Package.Module
if (!ApplicationDomainEx.IsVizPreviewReadly || ApplicationDomainEx.CurrentPage == null) if (!ApplicationDomainEx.IsVizPreviewReadly || ApplicationDomainEx.CurrentPage == null)
return; return;
// 记录操作日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_PREVIEW_KEY_PREVIEW);
this.vizCommandService.ShowKeyPreview(ApplicationDomainEx.PreviewConn); this.vizCommandService.ShowKeyPreview(ApplicationDomainEx.PreviewConn);
} }
...@@ -719,6 +748,9 @@ namespace VIZ.Package.Module ...@@ -719,6 +748,9 @@ namespace VIZ.Package.Module
if (!ApplicationDomainEx.IsVizPreviewReadly || ApplicationDomainEx.CurrentPage == null) if (!ApplicationDomainEx.IsVizPreviewReadly || ApplicationDomainEx.CurrentPage == null)
return; return;
// 记录操作日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_PREVIEW_TS, $"值: {this.IsShowTS}");
this.vizCommandService.ShowTS(ApplicationDomainEx.PreviewConn, this.IsShowTS); this.vizCommandService.ShowTS(ApplicationDomainEx.PreviewConn, this.IsShowTS);
} }
...@@ -731,6 +763,9 @@ namespace VIZ.Package.Module ...@@ -731,6 +763,9 @@ namespace VIZ.Package.Module
if (!ApplicationDomainEx.IsVizPreviewReadly || ApplicationDomainEx.CurrentPage == null) if (!ApplicationDomainEx.IsVizPreviewReadly || ApplicationDomainEx.CurrentPage == null)
return; return;
// 记录操作日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_PREVIEW_SA, $"值: {this.IsShowSA}");
this.vizCommandService.ShowSA(ApplicationDomainEx.PreviewConn, this.IsShowSA); this.vizCommandService.ShowSA(ApplicationDomainEx.PreviewConn, this.IsShowSA);
} }
...@@ -743,6 +778,9 @@ namespace VIZ.Package.Module ...@@ -743,6 +778,9 @@ namespace VIZ.Package.Module
if (!ApplicationDomainEx.IsVizPreviewReadly || ApplicationDomainEx.CurrentPage == null) if (!ApplicationDomainEx.IsVizPreviewReadly || ApplicationDomainEx.CurrentPage == null)
return; return;
// 记录操作日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_PREVIEW_BB, $"值: {this.IsShowBB}");
this.vizCommandService.ShowBB(ApplicationDomainEx.PreviewConn, this.IsShowBB); this.vizCommandService.ShowBB(ApplicationDomainEx.PreviewConn, this.IsShowBB);
} }
} }
......
...@@ -21,7 +21,7 @@ namespace VIZ.Package.Storage ...@@ -21,7 +21,7 @@ namespace VIZ.Package.Storage
/// <summary> /// <summary>
/// 系统自动触发 /// 系统自动触发
/// </summary> /// </summary>
[Description("自动")] [Description("系统")]
System System
} }
} }
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