|
|
|
@ -1,18 +1,11 @@
|
|
|
|
using System;
|
|
|
|
using System.Collections.ObjectModel;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
|
using System.Collections.ObjectModel;
|
|
|
|
|
|
|
|
using System.Collections.Specialized;
|
|
|
|
using System.Collections.Specialized;
|
|
|
|
using System.ComponentModel;
|
|
|
|
using System.ComponentModel;
|
|
|
|
using System.Diagnostics;
|
|
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
|
|
using System.Runtime.CompilerServices;
|
|
|
|
using System.Runtime.CompilerServices;
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
using System.Windows;
|
|
|
|
using System.Windows;
|
|
|
|
using System.Windows.Input;
|
|
|
|
using System.Windows.Input;
|
|
|
|
using System.Windows.Threading;
|
|
|
|
using System.Windows.Threading;
|
|
|
|
using SmartAquaViewer.Controls;
|
|
|
|
using SmartAquaViewer.Controls;
|
|
|
|
using SmartAquaViewer.DataAnalisys;
|
|
|
|
|
|
|
|
using SmartAquaViewer.DataAnalysis;
|
|
|
|
using SmartAquaViewer.DataAnalysis;
|
|
|
|
using SmartAquaViewer.Model;
|
|
|
|
using SmartAquaViewer.Model;
|
|
|
|
|
|
|
|
|
|
|
|
@ -52,8 +45,6 @@ namespace SmartAquaViewer.ViewModel
|
|
|
|
|
|
|
|
|
|
|
|
public ObservableCollection<TanksByTime> TanksByTimes { get; } = new();
|
|
|
|
public ObservableCollection<TanksByTime> TanksByTimes { get; } = new();
|
|
|
|
|
|
|
|
|
|
|
|
private ObservableCollection<int> SelectedTankNumbers { get; } = new();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private MonitorTab _selectedTab;
|
|
|
|
private MonitorTab _selectedTab;
|
|
|
|
public MonitorTab SelectedTab
|
|
|
|
public MonitorTab SelectedTab
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@ -355,16 +346,6 @@ namespace SmartAquaViewer.ViewModel
|
|
|
|
|
|
|
|
|
|
|
|
var keys = SelectedWaterTanks.Keys.ToList();
|
|
|
|
var keys = SelectedWaterTanks.Keys.ToList();
|
|
|
|
|
|
|
|
|
|
|
|
var selectedTanks = WaterQualityList
|
|
|
|
|
|
|
|
.SelectMany(wq => wq.Tanks.Select(tank => new { Tank = tank, VO = wq }))
|
|
|
|
|
|
|
|
.Where(x => keys.Contains(x.Tank.Number))
|
|
|
|
|
|
|
|
.GroupBy(x => x.Tank.Number)
|
|
|
|
|
|
|
|
.ToDictionary(
|
|
|
|
|
|
|
|
g => g.Key,
|
|
|
|
|
|
|
|
g => new ObservableCollection<WaterQualityVO>(
|
|
|
|
|
|
|
|
g.Select(x => x.VO).OrderBy(vo => vo.RecordedTime))
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GraphControlVM.SetTankLineGraph(WaterQualityList, keys, SelectedXField, SelectedYField, ShowMarkers, ShowLegends);
|
|
|
|
GraphControlVM.SetTankLineGraph(WaterQualityList, keys, SelectedXField, SelectedYField, ShowMarkers, ShowLegends);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -377,7 +358,7 @@ namespace SmartAquaViewer.ViewModel
|
|
|
|
|
|
|
|
|
|
|
|
var keys = SelectedWaterTanks.Keys.ToList();
|
|
|
|
var keys = SelectedWaterTanks.Keys.ToList();
|
|
|
|
|
|
|
|
|
|
|
|
GraphControlVM.SetBoxPlot(WaterQualityList, keys, SelectedXField, SelectedYField, BoxWidth, boxTimeSpan);
|
|
|
|
GraphControlVM.SetBoxPlot(WaterQualityList, keys, SelectedXField!, SelectedYField, BoxWidth, boxTimeSpan);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void SetGraphData_Scatter_Tank()
|
|
|
|
private void SetGraphData_Scatter_Tank()
|
|
|
|
@ -387,7 +368,7 @@ namespace SmartAquaViewer.ViewModel
|
|
|
|
|
|
|
|
|
|
|
|
var keys = SelectedWaterTanks.Keys.ToList();
|
|
|
|
var keys = SelectedWaterTanks.Keys.ToList();
|
|
|
|
|
|
|
|
|
|
|
|
GraphControlVM.SetScatterPlot(WaterQualityList, SelectedXField, SelectedYField, keys, ScatterMarkerSize, ShowRegression, ShowLegends);
|
|
|
|
GraphControlVM.SetScatterPlot(WaterQualityList, SelectedXField!, SelectedYField, keys, ScatterMarkerSize, ShowRegression, ShowLegends);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void SetGraphType()
|
|
|
|
private void SetGraphType()
|
|
|
|
@ -414,7 +395,7 @@ namespace SmartAquaViewer.ViewModel
|
|
|
|
{
|
|
|
|
{
|
|
|
|
SelectedGraphIndex = -1;
|
|
|
|
SelectedGraphIndex = -1;
|
|
|
|
SelectedGraphIndex = GraphTypes.Count > 0 ? 0 : -1;
|
|
|
|
SelectedGraphIndex = GraphTypes.Count > 0 ? 0 : -1;
|
|
|
|
}), System.Windows.Threading.DispatcherPriority.Background);
|
|
|
|
}), DispatcherPriority.Background);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void RebuildAvailableFields()
|
|
|
|
private void RebuildAvailableFields()
|
|
|
|
@ -422,7 +403,7 @@ namespace SmartAquaViewer.ViewModel
|
|
|
|
AvailableFields.Clear();
|
|
|
|
AvailableFields.Clear();
|
|
|
|
|
|
|
|
|
|
|
|
// 공통 시간
|
|
|
|
// 공통 시간
|
|
|
|
AvailableFields.Add(new FieldItem { Name = "RecordedTime", Display = "시간", DataType = typeof(DateTime) });
|
|
|
|
AvailableFields.Add(new FieldItem { Name = "RecordedTime", Display = "시간", DataType = typeof(DateTime), Kind = StepFieldKind.Time });
|
|
|
|
|
|
|
|
|
|
|
|
if (SelectedTab == MonitorTab.Tank)
|
|
|
|
if (SelectedTab == MonitorTab.Tank)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@ -496,7 +477,10 @@ namespace SmartAquaViewer.ViewModel
|
|
|
|
if ((SelectedGraphType == GraphType.LINE
|
|
|
|
if ((SelectedGraphType == GraphType.LINE
|
|
|
|
|| SelectedGraphType == GraphType.STEP
|
|
|
|
|| SelectedGraphType == GraphType.STEP
|
|
|
|
|| SelectedGraphType == GraphType.SCATTER)
|
|
|
|
|| SelectedGraphType == GraphType.SCATTER)
|
|
|
|
&& f.Name.Equals("Number")) continue;
|
|
|
|
&& f.Name!.Equals("Number")) continue;
|
|
|
|
|
|
|
|
if (SelectedGraphType == GraphType.LINE
|
|
|
|
|
|
|
|
&& (f.Kind.Equals(StepFieldKind.Status)
|
|
|
|
|
|
|
|
|| f.Name!.Equals("Filtering.InverterControllerStatus"))) continue;
|
|
|
|
XFieldCandidates.Add(f);
|
|
|
|
XFieldCandidates.Add(f);
|
|
|
|
if (SelectedGraphType == GraphType.STEP || SelectedGraphType == GraphType.BOX) break;
|
|
|
|
if (SelectedGraphType == GraphType.STEP || SelectedGraphType == GraphType.BOX) break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|