This commit is contained in:
2024-12-18 15:50:21 +08:00
parent 684973e6b7
commit b2c54119ea
214 changed files with 65908 additions and 8461 deletions

View File

@@ -0,0 +1,151 @@
using CapMachine.Wpf.Models.Tag;
using CapMachine.Wpf.Models;
using CapMachine.Wpf.PrismEvent;
using CapMachine.Wpf.Services;
using Prism.Events;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Timers;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using CapMachine.Wpf.Models.LightChart;
namespace CapMachine.Wpf.Views
{
/// <summary>
/// HistoryDataView.xaml 的交互逻辑
/// </summary>
public partial class HistoryDataView : UserControl
{
private readonly DataRecordService DatRecordService;
/// <summary>
/// 事件聚合器
/// </summary>
private IEventAggregator _EventAggregator { get; set; }
public MachineRtDataService MachineRtDataService { get; }
public IFreeSql FreeSql { get; }
public ILogService LogService { get; }
public ConfigService ConfigService { get; }
#region ChartManager实例集合
/// <summary>
/// Chart实例1
/// </summary>
public ChartManager Group1ChartManager { get; set; }
/// <summary>
/// Chart实例2
/// </summary>
public ChartManager Group2ChartManager { get; set; }
/// <summary>
/// Chart实例3
/// </summary>
public ChartManager Group3ChartManager { get; set; }
/// <summary>
/// Chart实例4
/// </summary>
public ChartManager Group4ChartManager { get; set; }
/// <summary>
/// Chart实例5
/// </summary>
public ChartManager Group5ChartManager { get; set; }
/// <summary>
/// Chart实例6
/// </summary>
public ChartManager Group6ChartManager { get; set; }
/// <summary>
/// Chart实例7
/// </summary>
public ChartManager Group7ChartManager { get; set; }
/// <summary>
/// Chart实例8
/// </summary>
public ChartManager Group8ChartManager { get; set; }
#endregion
/// <summary>
/// 实时变量管理
/// </summary>
public TagManager RtTagManager { get; set; }
/// <summary>
/// 实例化函数
/// </summary>
/// <param name="eventAggregator"></param>
/// <param name="machineRtDataService"></param>
public HistoryDataView(IEventAggregator eventAggregator, DataRecordService datRecordService, MachineRtDataService machineRtDataService, IFreeSql freeSql,ILogService logService,ConfigService configService)
{
//初始化当前的页面组件,原始方法
InitializeComponent();
//事件服务
_EventAggregator = eventAggregator;
this.DatRecordService = datRecordService;
RtTagManager = machineRtDataService.TagManger;
MachineRtDataService = machineRtDataService;
FreeSql = freeSql;
LogService = logService;
ConfigService = configService;
Group1ChartManager = new ChartManager(_EventAggregator, RtTagManager, DatRecordService, FreeSql, LgChart1, "LgChart1", 0, "History",false, LogService, ConfigService);
Group2ChartManager = new ChartManager(_EventAggregator, RtTagManager, DatRecordService, FreeSql, LgChart2, "LgChart2", 1, "History",false, LogService, ConfigService);
Group3ChartManager = new ChartManager(_EventAggregator, RtTagManager, DatRecordService, FreeSql, LgChart3, "LgChart3", 2, "History",false, LogService, ConfigService);
Group4ChartManager = new ChartManager(_EventAggregator, RtTagManager, DatRecordService, FreeSql, LgChart4, "LgChart4", 3, "History",false, LogService, ConfigService);
Group5ChartManager = new ChartManager(_EventAggregator, RtTagManager, DatRecordService, FreeSql, LgChart5, "LgChart5", 4, "History",false, LogService, ConfigService);
Group6ChartManager = new ChartManager(_EventAggregator, RtTagManager, DatRecordService, FreeSql, LgChart6, "LgChart6", 5, "History",false, LogService, ConfigService);
Group7ChartManager = new ChartManager(_EventAggregator, RtTagManager, DatRecordService, FreeSql, LgChart7, "LgChart7", 6, "History",false, LogService, ConfigService);
Group8ChartManager = new ChartManager(_EventAggregator, RtTagManager, DatRecordService, FreeSql, LgChart8, "LgChart8", 7, "History", false, LogService, ConfigService);
//LvChartRtValue.ItemsSource = RtTagManager.DicTags.Values.ToList();
LvChartRtValueSingle1.ItemsSource = Group1ChartManager.ListChartRtSeries;
LvChartRtValuedouble1.ItemsSource = Group1ChartManager.ListChartRtSeries;
LvChartRtValueSingle2.ItemsSource = Group2ChartManager.ListChartRtSeries;
LvChartRtValuedouble2.ItemsSource = Group2ChartManager.ListChartRtSeries;
LvChartRtValueSingle3.ItemsSource = Group3ChartManager.ListChartRtSeries;
LvChartRtValuedouble3.ItemsSource = Group3ChartManager.ListChartRtSeries;
LvChartRtValueSingle4.ItemsSource = Group4ChartManager.ListChartRtSeries;
LvChartRtValuedouble4.ItemsSource = Group4ChartManager.ListChartRtSeries;
LvChartRtValueSingle5.ItemsSource = Group5ChartManager.ListChartRtSeries;
LvChartRtValuedouble5.ItemsSource = Group5ChartManager.ListChartRtSeries;
LvChartRtValueSingle6.ItemsSource = Group6ChartManager.ListChartRtSeries;
LvChartRtValuedouble6.ItemsSource = Group6ChartManager.ListChartRtSeries;
LvChartRtValueSingle7.ItemsSource = Group7ChartManager.ListChartRtSeries;
LvChartRtValuedouble7.ItemsSource = Group7ChartManager.ListChartRtSeries;
LvChartRtValueSingle8.ItemsSource = Group8ChartManager.ListChartRtSeries;
LvChartRtValuedouble8.ItemsSource = Group8ChartManager.ListChartRtSeries;
}
}
}