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 { /// /// HistoryDataView.xaml 的交互逻辑 /// public partial class HistoryDataView : UserControl { private readonly DataRecordService DatRecordService; /// /// 事件聚合器 /// private IEventAggregator _EventAggregator { get; set; } public MachineRtDataService MachineRtDataService { get; } public IFreeSql FreeSql { get; } public ILogService LogService { get; } public ConfigService ConfigService { get; } #region ChartManager实例集合 /// /// Chart实例1 /// public ChartManager Group1ChartManager { get; set; } /// /// Chart实例2 /// public ChartManager Group2ChartManager { get; set; } /// /// Chart实例3 /// public ChartManager Group3ChartManager { get; set; } /// /// Chart实例4 /// public ChartManager Group4ChartManager { get; set; } /// /// Chart实例5 /// public ChartManager Group5ChartManager { get; set; } /// /// Chart实例6 /// public ChartManager Group6ChartManager { get; set; } /// /// Chart实例7 /// public ChartManager Group7ChartManager { get; set; } /// /// Chart实例8 /// public ChartManager Group8ChartManager { get; set; } #endregion /// /// 实时变量管理 /// public TagManager RtTagManager { get; set; } /// /// 实例化函数 /// /// /// 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; } } }