fix: 온실가스 그래프 버그 수정

hhsung_work
HyungJune Kim 10 months ago
parent 2e56475725
commit 1be29e82a0

@ -5,6 +5,8 @@ VisualStudioVersion = 17.13.35931.197
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SmartAquaViewer", "SmartAquaViewer\SmartAquaViewer.csproj", "{B1AF5CCA-731E-42E1-8ECD-9B8FC7237A95}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SmartAquaViewer", "SmartAquaViewer\SmartAquaViewer.csproj", "{B1AF5CCA-731E-42E1-8ECD-9B8FC7237A95}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FFMPEGPlayer", "..\FFMPEGPlayer\FFMPEGPlayer\FFMPEGPlayer.csproj", "{1A33B46E-B95E-491A-B7A1-6D9EDCA40FD4}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -21,6 +23,14 @@ Global
{B1AF5CCA-731E-42E1-8ECD-9B8FC7237A95}.Release|Any CPU.Build.0 = Release|Any CPU {B1AF5CCA-731E-42E1-8ECD-9B8FC7237A95}.Release|Any CPU.Build.0 = Release|Any CPU
{B1AF5CCA-731E-42E1-8ECD-9B8FC7237A95}.Release|x64.ActiveCfg = Release|x64 {B1AF5CCA-731E-42E1-8ECD-9B8FC7237A95}.Release|x64.ActiveCfg = Release|x64
{B1AF5CCA-731E-42E1-8ECD-9B8FC7237A95}.Release|x64.Build.0 = Release|x64 {B1AF5CCA-731E-42E1-8ECD-9B8FC7237A95}.Release|x64.Build.0 = Release|x64
{1A33B46E-B95E-491A-B7A1-6D9EDCA40FD4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1A33B46E-B95E-491A-B7A1-6D9EDCA40FD4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1A33B46E-B95E-491A-B7A1-6D9EDCA40FD4}.Debug|x64.ActiveCfg = Debug|x64
{1A33B46E-B95E-491A-B7A1-6D9EDCA40FD4}.Debug|x64.Build.0 = Debug|x64
{1A33B46E-B95E-491A-B7A1-6D9EDCA40FD4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1A33B46E-B95E-491A-B7A1-6D9EDCA40FD4}.Release|Any CPU.Build.0 = Release|Any CPU
{1A33B46E-B95E-491A-B7A1-6D9EDCA40FD4}.Release|x64.ActiveCfg = Release|x64
{1A33B46E-B95E-491A-B7A1-6D9EDCA40FD4}.Release|x64.Build.0 = Release|x64
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE

@ -40,36 +40,4 @@ namespace SmartAquaViewer.Classes
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
=> !(value is bool b && b); => !(value is bool b && b);
} }
public class EnergyToGreenHouseGasConverter : IValueConverter
{
// 2024년 배출계수 (kgCO₂/kWh)
private const double EmissionFactor = 0.4747;
/// <summary>
/// kWh → tCO₂ 변환
/// </summary>
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is double kWh)
{
double tonCO2 = (kWh * EmissionFactor) / 1000.0;
return tonCO2.ToString("F2"); // 소수점 3자리
}
return null;
}
/// <summary>
/// tCO₂ → kWh 역변환 (Binding TwoWay 대응)
/// </summary>
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
if (double.TryParse(value?.ToString(), out double tonCO2))
{
double kWh = (tonCO2 * 1000.0) / EmissionFactor;
return kWh;
}
return null;
}
}
} }

@ -37,6 +37,11 @@ namespace SmartAquaViewer.DataAnalysis
/// </summary> /// </summary>
public double TotalEnergy { get; set; } public double TotalEnergy { get; set; }
/// <summary>
/// 총 온실가스 배출량 (톤, tCO₂)
/// </summary>
public double TotalGreenhouseGas { get; set; }
public WaterQualityVO() { } public WaterQualityVO() { }
public WaterQualityVO(DateTime RecordedTime, WaterTank tank, FilteringSystem filtering, SterilizingSystem sterilizing) public WaterQualityVO(DateTime RecordedTime, WaterTank tank, FilteringSystem filtering, SterilizingSystem sterilizing)
@ -67,6 +72,25 @@ namespace SmartAquaViewer.DataAnalysis
vo.Sterilizing.ExcessOzoneDestroyerEnergy; vo.Sterilizing.ExcessOzoneDestroyerEnergy;
} }
double ConvertEnergyToGHG(double energy)
{
// 2024년 배출계수 (kgCO₂/kWh)
const double EmissionFactor = 0.4747;
return (energy * EmissionFactor); // / 1000.0; // tCO₂
}
double CalculateTotalGreenhouseGas(WaterQualityVO vo)
{
return vo.Filtering.AirBlowerGreenhouseGas +
vo.Filtering.CirculationPumpGreenhouseGas +
vo.Filtering.HeatPumpGreenhouseGas +
vo.Filtering.SandFilterGreenhouseGas +
vo.Sterilizing.ExcessOzoneDestroyerGreenhouseGas +
vo.Sterilizing.OzoneDissolverGreenhouseGas +
vo.Sterilizing.OzoneGeneratorGreenhouseGas +
vo.Sterilizing.UVSterilizerGreenhouseGas;
}
if (totalRowsCount <= 0) return list; if (totalRowsCount <= 0) return list;
double totalSeconds; double totalSeconds;
@ -102,6 +126,7 @@ namespace SmartAquaViewer.DataAnalysis
Filtering = new FilteringSystem( Filtering = new FilteringSystem(
sandFilterPower: rand.Next(0, 2) == 1, sandFilterPower: rand.Next(0, 2) == 1,
sandFilterEnergy: Math.Round(rand.NextDouble() * 2 + 0.5, 2), sandFilterEnergy: Math.Round(rand.NextDouble() * 2 + 0.5, 2),
sandFilterGreenhouseGas: 0, // 추후 계산
sumpPH: Math.Round(rand.NextDouble() * 2 + 6, 2), sumpPH: Math.Round(rand.NextDouble() * 2 + 6, 2),
sumpORP: Math.Round(rand.NextDouble() * 200 + 100, 2), sumpORP: Math.Round(rand.NextDouble() * 200 + 100, 2),
sumpWaterLevel: Math.Round(rand.NextDouble() * 2 + 1, 2), sumpWaterLevel: Math.Round(rand.NextDouble() * 2 + 1, 2),
@ -109,28 +134,44 @@ namespace SmartAquaViewer.DataAnalysis
sumpTemperature: Math.Round(rand.NextDouble() * 10 + 15, 2), sumpTemperature: Math.Round(rand.NextDouble() * 10 + 15, 2),
circulationPumpPower: rand.Next(0, 2) == 1, circulationPumpPower: rand.Next(0, 2) == 1,
circulationPumpEnergy: Math.Round(rand.NextDouble() * 2 + 0.5, 2), circulationPumpEnergy: Math.Round(rand.NextDouble() * 2 + 0.5, 2),
circulationPumpGreenhouseGas: 0, // 추후 계산
inverterControllerStatus: rand.Next(0, 2) == 1 ? "Normal" : "Error", inverterControllerStatus: rand.Next(0, 2) == 1 ? "Normal" : "Error",
flowRate: Math.Round(rand.NextDouble() * 5 + 1, 2), flowRate: Math.Round(rand.NextDouble() * 5 + 1, 2),
heatPumpPower: rand.Next(0, 2) == 1, heatPumpPower: rand.Next(0, 2) == 1,
heatPumpTemperature: Math.Round(rand.NextDouble() * 10 + 15, 2), heatPumpTemperature: Math.Round(rand.NextDouble() * 10 + 15, 2),
heatPumpEnergy: Math.Round(rand.NextDouble() * 2 + 0.5, 2), heatPumpEnergy: Math.Round(rand.NextDouble() * 2 + 0.5, 2),
heatPumpGreenhouseGas: 0, // 추후 계산
airBlowerPower: rand.Next(0, 2) == 1, airBlowerPower: rand.Next(0, 2) == 1,
airBlowerEnergy: Math.Round(rand.NextDouble() * 2 + 0.5, 2) airBlowerEnergy: Math.Round(rand.NextDouble() * 2 + 0.5, 2),
airBlowerGreenhouseGas: 0 // 추후 계산
), ),
Sterilizing = new SterilizingSystem( Sterilizing = new SterilizingSystem(
ozoneGeneratorPower: rand.Next(0, 2) == 1, ozoneGeneratorPower: rand.Next(0, 2) == 1,
ozoneGeneratorEnergy: Math.Round(rand.NextDouble() * 2 + 0.5, 2), ozoneGeneratorEnergy: Math.Round(rand.NextDouble() * 2 + 0.5, 2),
ozoneGeneratorGreenhouseGas: 0, // 추후 계산
uvSterilizerId: "UV" + rand.Next(1, 100), uvSterilizerId: "UV" + rand.Next(1, 100),
uvSterilizerPower: rand.Next(0, 2) == 1, uvSterilizerPower: rand.Next(0, 2) == 1,
uvSterilizerEnergy: Math.Round(rand.NextDouble() * 2 + 0.5, 2), uvSterilizerEnergy: Math.Round(rand.NextDouble() * 2 + 0.5, 2),
uvSterilizerGreenhouseGas: 0, // 추후 계산
ozoneDissolverPower: rand.Next(0, 2) == 1, ozoneDissolverPower: rand.Next(0, 2) == 1,
ozoneDissolverPressure: Math.Round(rand.NextDouble() * 100 + 50, 2), ozoneDissolverPressure: Math.Round(rand.NextDouble() * 100 + 50, 2),
ozoneDissolverEnergy: Math.Round(rand.NextDouble() * 2 + 0.5, 2), ozoneDissolverEnergy: Math.Round(rand.NextDouble() * 2 + 0.5, 2),
ozoneDissolverGreenhouseGas: 0, // 추후 계산
excessOzoneDestroyerPower: rand.Next(0, 2) == 1, excessOzoneDestroyerPower: rand.Next(0, 2) == 1,
excessOzoneDestroyerEnergy: Math.Round(rand.NextDouble() * 2 + 0.5, 2) excessOzoneDestroyerEnergy: Math.Round(rand.NextDouble() * 2 + 0.5, 2),
excessOzoneDestroyerGreenhouseGas: 0 // 추후 계산
), ),
}; };
vo.TotalEnergy = CalculateTotalEnergy(vo); vo.TotalEnergy = CalculateTotalEnergy(vo);
vo.Filtering.SandFilterGreenhouseGas = ConvertEnergyToGHG(vo.Filtering.SandFilterEnergy);
vo.Filtering.CirculationPumpGreenhouseGas = ConvertEnergyToGHG(vo.Filtering.CirculationPumpEnergy);
vo.Filtering.HeatPumpGreenhouseGas = ConvertEnergyToGHG(vo.Filtering.HeatPumpEnergy);
vo.Filtering.AirBlowerGreenhouseGas = ConvertEnergyToGHG(vo.Filtering.AirBlowerEnergy);
vo.Sterilizing.OzoneGeneratorGreenhouseGas = ConvertEnergyToGHG(vo.Sterilizing.OzoneGeneratorEnergy);
vo.Sterilizing.UVSterilizerGreenhouseGas = ConvertEnergyToGHG(vo.Sterilizing.UVSterilizerEnergy);
vo.Sterilizing.OzoneDissolverGreenhouseGas = ConvertEnergyToGHG(vo.Sterilizing.OzoneDissolverEnergy);
vo.Sterilizing.ExcessOzoneDestroyerGreenhouseGas = ConvertEnergyToGHG(vo.Sterilizing.ExcessOzoneDestroyerEnergy);
vo.TotalGreenhouseGas = CalculateTotalGreenhouseGas(vo);
list.Add(vo); list.Add(vo);
} }
@ -202,6 +243,12 @@ namespace SmartAquaViewer.DataAnalysis
[Column("filter_sand_filter_energy")] [Column("filter_sand_filter_energy")]
public double SandFilterEnergy { get; set; } public double SandFilterEnergy { get; set; }
/// <summary>
/// 모래여과기 온실가스 (tCO₂)
/// </summary>
[Column("filter_sand_filter_greenhouse_gas")]
public double SandFilterGreenhouseGas { get; set; }
/// <summary> /// <summary>
/// 섬프탱크 pH (산도) /// 섬프탱크 pH (산도)
/// </summary> /// </summary>
@ -244,6 +291,12 @@ namespace SmartAquaViewer.DataAnalysis
[Column("filter_circulation_pump_energy")] [Column("filter_circulation_pump_energy")]
public double CirculationPumpEnergy { get; set; } public double CirculationPumpEnergy { get; set; }
/// <summary>
/// 순환펌프 온실가스 (tCO₂)
/// </summary>
[Column("filter_circulation_pump_greenhouse_gas")]
public double CirculationPumpGreenhouseGas { get; set; }
/// <summary> /// <summary>
/// 인버터 제어기 상태 /// 인버터 제어기 상태
/// </summary> /// </summary>
@ -274,6 +327,12 @@ namespace SmartAquaViewer.DataAnalysis
[Column("filter_heat_pump_energy")] [Column("filter_heat_pump_energy")]
public double HeatPumpEnergy { get; set; } public double HeatPumpEnergy { get; set; }
/// <summary>
/// 히트펌프 온실가스 (tCO₂)
/// </summary>
[Column("filter_heat_pump_greenhouse_gas")]
public double HeatPumpGreenhouseGas { get; set; }
/// <summary> /// <summary>
/// 에어브로와 전원 (true: ON, false: OFF) /// 에어브로와 전원 (true: ON, false: OFF)
/// </summary> /// </summary>
@ -286,16 +345,24 @@ namespace SmartAquaViewer.DataAnalysis
[Column("filter_air_blower_energy")] [Column("filter_air_blower_energy")]
public double AirBlowerEnergy { get; set; } public double AirBlowerEnergy { get; set; }
/// <summary>
/// 에어브로와 온실가스 (tCO₂)
/// </summary>
[Column("filter_air_blower_greenhouse_gas")]
public double AirBlowerGreenhouseGas { get; set; }
public FilteringSystem() { } public FilteringSystem() { }
public FilteringSystem( public FilteringSystem(
bool sandFilterPower, double sandFilterEnergy, bool sandFilterPower, double sandFilterEnergy, double sandFilterGreenhouseGas,
double sumpPH, double sumpORP, double sumpWaterLevel, double sumpFlowRate, double sumpTemperature, double sumpPH, double sumpORP, double sumpWaterLevel, double sumpFlowRate, double sumpTemperature,
bool circulationPumpPower, double circulationPumpEnergy, string? inverterControllerStatus, double flowRate, bool circulationPumpPower, double circulationPumpEnergy, double circulationPumpGreenhouseGas, string? inverterControllerStatus, double flowRate,
bool heatPumpPower, double heatPumpTemperature, double heatPumpEnergy, bool airBlowerPower, double airBlowerEnergy) bool heatPumpPower, double heatPumpTemperature, double heatPumpEnergy, double heatPumpGreenhouseGas,
bool airBlowerPower, double airBlowerEnergy, double airBlowerGreenhouseGas)
{ {
SandFilterPower = sandFilterPower; SandFilterPower = sandFilterPower;
SandFilterEnergy = sandFilterEnergy; SandFilterEnergy = sandFilterEnergy;
SandFilterGreenhouseGas = sandFilterGreenhouseGas;
SumpPH = sumpPH; SumpPH = sumpPH;
SumpORP = sumpORP; SumpORP = sumpORP;
SumpWaterLevel = sumpWaterLevel; SumpWaterLevel = sumpWaterLevel;
@ -303,13 +370,16 @@ namespace SmartAquaViewer.DataAnalysis
SumpTemperature = sumpTemperature; SumpTemperature = sumpTemperature;
CirculationPumpPower = circulationPumpPower; CirculationPumpPower = circulationPumpPower;
CirculationPumpEnergy = circulationPumpEnergy; CirculationPumpEnergy = circulationPumpEnergy;
CirculationPumpGreenhouseGas = circulationPumpGreenhouseGas;
InverterControllerStatus = inverterControllerStatus; InverterControllerStatus = inverterControllerStatus;
FlowRate = flowRate; FlowRate = flowRate;
HeatPumpPower = heatPumpPower; HeatPumpPower = heatPumpPower;
HeatPumpTemperature = heatPumpTemperature; HeatPumpTemperature = heatPumpTemperature;
HeatPumpEnergy = heatPumpEnergy; HeatPumpEnergy = heatPumpEnergy;
HeatPumpGreenhouseGas = heatPumpGreenhouseGas;
AirBlowerPower = airBlowerPower; AirBlowerPower = airBlowerPower;
AirBlowerEnergy = airBlowerEnergy; AirBlowerEnergy = airBlowerEnergy;
AirBlowerGreenhouseGas = airBlowerGreenhouseGas;
} }
} }
@ -328,6 +398,12 @@ namespace SmartAquaViewer.DataAnalysis
[Column("ster_ozone_generator_energy")] [Column("ster_ozone_generator_energy")]
public double OzoneGeneratorEnergy { get; set; } public double OzoneGeneratorEnergy { get; set; }
/// <summary>
/// 오존 발생기 온실가스 (tCO₂)
/// </summary>
[Column("ster_ozone_generator_greenhouse_gas")]
public double OzoneGeneratorGreenhouseGas { get; set; }
/// <summary> /// <summary>
/// 자외선 살균기 ID /// 자외선 살균기 ID
/// </summary> /// </summary>
@ -346,6 +422,12 @@ namespace SmartAquaViewer.DataAnalysis
[Column("ster_uv_sterilizer_energy")] [Column("ster_uv_sterilizer_energy")]
public double UVSterilizerEnergy { get; set; } public double UVSterilizerEnergy { get; set; }
/// <summary>
/// 자외선 살균기 온실가스 (tCO₂)
/// </summary>
[Column("ster_uv_sterilizer_greenhouse_gas")]
public double UVSterilizerGreenhouseGas { get; set; }
/// <summary> /// <summary>
/// 오존용해장치 전원 (true: ON, false: OFF) /// 오존용해장치 전원 (true: ON, false: OFF)
/// </summary> /// </summary>
@ -364,6 +446,12 @@ namespace SmartAquaViewer.DataAnalysis
[Column("ster_ozone_dissolver_energy")] [Column("ster_ozone_dissolver_energy")]
public double OzoneDissolverEnergy { get; set; } public double OzoneDissolverEnergy { get; set; }
/// <summary>
/// 오존용해장치 온실가스 (tCO₂)
/// </summary>
[Column("ster_ozone_dissolver_greenhouse_gas")]
public double OzoneDissolverGreenhouseGas { get; set; }
/// <summary> /// <summary>
/// 배오존장치 전원 (true: ON, false: OFF) /// 배오존장치 전원 (true: ON, false: OFF)
/// </summary> /// </summary>
@ -376,24 +464,34 @@ namespace SmartAquaViewer.DataAnalysis
[Column("ster_excess_ozone_destroyer_energy")] [Column("ster_excess_ozone_destroyer_energy")]
public double ExcessOzoneDestroyerEnergy { get; set; } public double ExcessOzoneDestroyerEnergy { get; set; }
/// <summary>
/// 배오존장치 온실가스 (tCO₂)
/// </summary>
[Column("ster_excess_ozone_destroyer_greenhouse_gas")]
public double ExcessOzoneDestroyerGreenhouseGas { get; set; }
public SterilizingSystem() { } public SterilizingSystem() { }
public SterilizingSystem( public SterilizingSystem(
bool ozoneGeneratorPower, double ozoneGeneratorEnergy, bool ozoneGeneratorPower, double ozoneGeneratorEnergy, double ozoneGeneratorGreenhouseGas,
string uvSterilizerId, bool uvSterilizerPower, double uvSterilizerEnergy, string uvSterilizerId, bool uvSterilizerPower, double uvSterilizerEnergy, double uvSterilizerGreenhouseGas,
bool ozoneDissolverPower, double ozoneDissolverPressure, double ozoneDissolverEnergy, bool ozoneDissolverPower, double ozoneDissolverPressure, double ozoneDissolverEnergy, double ozoneDissolverGreenhouseGas,
bool excessOzoneDestroyerPower, double excessOzoneDestroyerEnergy) bool excessOzoneDestroyerPower, double excessOzoneDestroyerEnergy, double excessOzoneDestroyerGreenhouseGas)
{ {
OzoneGeneratorPower = ozoneGeneratorPower; OzoneGeneratorPower = ozoneGeneratorPower;
OzoneGeneratorEnergy = ozoneGeneratorEnergy; OzoneGeneratorEnergy = ozoneGeneratorEnergy;
OzoneGeneratorGreenhouseGas = ozoneGeneratorGreenhouseGas;
UVSterilizerId = uvSterilizerId; UVSterilizerId = uvSterilizerId;
UVSterilizerPower = uvSterilizerPower; UVSterilizerPower = uvSterilizerPower;
UVSterilizerEnergy = uvSterilizerEnergy; UVSterilizerEnergy = uvSterilizerEnergy;
UVSterilizerGreenhouseGas = uvSterilizerGreenhouseGas;
OzoneDissolverPower = ozoneDissolverPower; OzoneDissolverPower = ozoneDissolverPower;
OzoneDissolverPressure = ozoneDissolverPressure; OzoneDissolverPressure = ozoneDissolverPressure;
OzoneDissolverEnergy = ozoneDissolverEnergy; OzoneDissolverEnergy = ozoneDissolverEnergy;
OzoneDissolverGreenhouseGas = ozoneDissolverGreenhouseGas;
ExcessOzoneDestroyerPower = excessOzoneDestroyerPower; ExcessOzoneDestroyerPower = excessOzoneDestroyerPower;
ExcessOzoneDestroyerEnergy = excessOzoneDestroyerEnergy; ExcessOzoneDestroyerEnergy = excessOzoneDestroyerEnergy;
ExcessOzoneDestroyerGreenhouseGas = excessOzoneDestroyerGreenhouseGas;
} }
} }
} }

@ -35,4 +35,10 @@ namespace SmartAquaViewer.Model
Off, Off,
On On
} }
public enum DataType
{
Energy,
GreenhouseGas
}
} }

@ -4,13 +4,14 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:SmartAquaViewer.View" xmlns:local="clr-namespace:SmartAquaViewer.View"
xmlns:control="clr-namespace:SmartAquaViewer.Controls"
xmlns:helper="clr-namespace:SmartAquaViewer.Helper" xmlns:helper="clr-namespace:SmartAquaViewer.Helper"
xmlns:classes="clr-namespace:SmartAquaViewer.Classes" xmlns:classes="clr-namespace:SmartAquaViewer.Classes"
mc:Ignorable="d" mc:Ignorable="d"
d:DesignHeight="940" d:DesignWidth="1650"> d:DesignHeight="940" d:DesignWidth="1650">
<UserControl.Resources> <UserControl.Resources>
<classes:EnergyToGreenHouseGasConverter x:Key="EnergyToGreenHouseGasConverter"/> <classes:InverseBoolConverter x:Key="InverseBoolConverter"/>
</UserControl.Resources> </UserControl.Resources>
<Grid Background="#243851"> <Grid Background="#243851">
@ -35,17 +36,17 @@
ElementStyle="{StaticResource DataGridElmenetStyle}"/> ElementStyle="{StaticResource DataGridElmenetStyle}"/>
<DataGridTextColumn Header="모래여과기" ElementStyle="{StaticResource DataGridElmenetStyle}" <DataGridTextColumn Header="모래여과기" ElementStyle="{StaticResource DataGridElmenetStyle}"
Binding="{Binding Filtering.SandFilterEnergy, Converter={StaticResource EnergyToGreenHouseGasConverter}}"/> Binding="{Binding Filtering.SandFilterGreenhouseGas, StringFormat=\{0:F3\}}"/>
<DataGridTextColumn Header="순환펌프" ElementStyle="{StaticResource DataGridElmenetStyle}" <DataGridTextColumn Header="순환펌프" ElementStyle="{StaticResource DataGridElmenetStyle}"
Binding="{Binding Filtering.CirculationPumpEnergy, Converter={StaticResource EnergyToGreenHouseGasConverter}}"/> Binding="{Binding Filtering.CirculationPumpGreenhouseGas, StringFormat=\{0:F3\}}"/>
<DataGridTextColumn Header="히트펌프" ElementStyle="{StaticResource DataGridElmenetStyle}" <DataGridTextColumn Header="히트펌프" ElementStyle="{StaticResource DataGridElmenetStyle}"
Binding="{Binding Filtering.HeatPumpEnergy, Converter={StaticResource EnergyToGreenHouseGasConverter}}"/> Binding="{Binding Filtering.HeatPumpGreenhouseGas, StringFormat=\{0:F3\}}"/>
<DataGridTextColumn Header="에어브로와" ElementStyle="{StaticResource DataGridElmenetStyle}" <DataGridTextColumn Header="에어브로와" ElementStyle="{StaticResource DataGridElmenetStyle}"
Binding="{Binding Filtering.AirBlowerEnergy, Converter={StaticResource EnergyToGreenHouseGasConverter}}"/> Binding="{Binding Filtering.AirBlowerGreenhouseGas, StringFormat=\{0:F3\}}"/>
<DataGridTextColumn Header="오존발생기" ElementStyle="{StaticResource DataGridElmenetStyle}" <DataGridTextColumn Header="오존발생기" ElementStyle="{StaticResource DataGridElmenetStyle}"
Binding="{Binding Sterilizing.OzoneGeneratorEnergy, Converter={StaticResource EnergyToGreenHouseGasConverter}}"/> Binding="{Binding Sterilizing.OzoneGeneratorGreenhouseGas, StringFormat=\{0:F3\}}"/>
<DataGridTextColumn ElementStyle="{StaticResource DataGridElmenetStyle}" <DataGridTextColumn ElementStyle="{StaticResource DataGridElmenetStyle}"
Binding="{Binding Sterilizing.UVSterilizerEnergy, Converter={StaticResource EnergyToGreenHouseGasConverter}}"> Binding="{Binding Sterilizing.UVSterilizerGreenhouseGas, StringFormat=\{0:F3\}}">
<DataGridTextColumn.Header> <DataGridTextColumn.Header>
<StackPanel> <StackPanel>
<TextBlock Text="자외선"/> <TextBlock Text="자외선"/>
@ -54,11 +55,11 @@
</DataGridTextColumn.Header> </DataGridTextColumn.Header>
</DataGridTextColumn> </DataGridTextColumn>
<DataGridTextColumn Header="오존용해장치" ElementStyle="{StaticResource DataGridElmenetStyle}" <DataGridTextColumn Header="오존용해장치" ElementStyle="{StaticResource DataGridElmenetStyle}"
Binding="{Binding Sterilizing.OzoneDissolverEnergy, Converter={StaticResource EnergyToGreenHouseGasConverter}}"/> Binding="{Binding Sterilizing.OzoneDissolverGreenhouseGas, StringFormat=\{0:F3\}}"/>
<DataGridTextColumn Header="배오존장치" ElementStyle="{StaticResource DataGridElmenetStyle}" <DataGridTextColumn Header="배오존장치" ElementStyle="{StaticResource DataGridElmenetStyle}"
Binding="{Binding Sterilizing.ExcessOzoneDestroyerEnergy, Converter={StaticResource EnergyToGreenHouseGasConverter}}"/> Binding="{Binding Sterilizing.ExcessOzoneDestroyerGreenhouseGas, StringFormat=\{0:F3\}}"/>
<DataGridTextColumn Header="총 온실가스" ElementStyle="{StaticResource DataGridElmenetStyle}" <DataGridTextColumn Header="총 배출량" ElementStyle="{StaticResource DataGridElmenetStyle}"
Binding="{Binding TotalEnergy, Converter={StaticResource EnergyToGreenHouseGasConverter}}"/> Binding="{Binding TotalGreenhouseGas, StringFormat=\{0:F3\}}"/>
</DataGrid.Columns> </DataGrid.Columns>
</DataGrid> </DataGrid>
</ScrollViewer> </ScrollViewer>
@ -86,13 +87,183 @@
helper:ComboBoxHelper.SelectFirstOnItemsChange="True" helper:ComboBoxHelper.SelectFirstOnItemsChange="True"
IsEditable="False" IsTextSearchEnabled="False"/> IsEditable="False" IsTextSearchEnabled="False"/>
</Grid> </Grid>
<Grid Margin="15 0">
<Grid.Resources>
<Style TargetType="FrameworkElement">
<Setter Property="Visibility" Value="Collapsed"/>
</Style>
<Style x:Key="VisibleWhenLine" TargetType="FrameworkElement" BasedOn="{StaticResource {x:Type FrameworkElement}}">
<Style.Triggers>
<DataTrigger Binding="{Binding SelectedGraphType}" Value="LINE">
<Setter Property="Visibility" Value="Visible"/>
</DataTrigger>
</Style.Triggers>
</Style>
<Style x:Key="VisibleWhenStackArea" TargetType="FrameworkElement" BasedOn="{StaticResource {x:Type FrameworkElement}}">
<Style.Triggers>
<DataTrigger Binding="{Binding SelectedGraphType}" Value="STACKAREA">
<Setter Property="Visibility" Value="Visible"/>
</DataTrigger>
</Style.Triggers>
</Style>
<Style x:Key="VisibleWhenLineNStackArea" TargetType="FrameworkElement" BasedOn="{StaticResource {x:Type FrameworkElement}}">
<Style.Triggers>
<DataTrigger Binding="{Binding SelectedGraphType}" Value="LINE">
<Setter Property="Visibility" Value="Visible"/>
</DataTrigger>
<DataTrigger Binding="{Binding SelectedGraphType}" Value="STACKAREA">
<Setter Property="Visibility" Value="Visible"/>
</DataTrigger>
</Style.Triggers>
</Style>
<Style x:Key="VisibleWhenPie" TargetType="FrameworkElement" BasedOn="{StaticResource {x:Type FrameworkElement}}">
<Style.Triggers>
<DataTrigger Binding="{Binding SelectedGraphType}" Value="PIE">
<Setter Property="Visibility" Value="Visible"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Grid.Resources>
<StackPanel>
<StackPanel Style="{StaticResource VisibleWhenLineNStackArea}">
<Grid Margin="0 0 0 20" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="80"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<TextBlock Text="X축" VerticalAlignment="Center"
FontSize="20" FontFamily="{StaticResource SCDream4}" Foreground="White"/>
<TextBlock Text="{Binding SelectedXField.Display}" VerticalAlignment="Center"
Margin="15 0 0 0" Grid.Column="1"
FontSize="20" FontFamily="{StaticResource SCDream4}" Foreground="White"/>
</Grid>
<Grid Margin="0 0 0 15">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="80"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<TextBlock Text="Y축" VerticalAlignment="Top"
FontSize="20" FontFamily="{StaticResource SCDream4}" Foreground="White"/>
<Border Grid.Column="1" CornerRadius="10"
Background="White" Margin="15 0 0 15">
<ListBox ItemsSource="{Binding YFieldCandidates}"
DisplayMemberPath="Display"
SelectionMode="Extended"
helper:MultiSelectBehavior.SelectedItems="{Binding SelectedYFields, Mode=OneWay}"
helper:MultiSelectBehavior.KeyPath="Key"
helper:MultiSelectBehavior.ValuePath="Value"
Height="Auto" Background="White"
FontSize="16" FontWeight="Bold"
Style="{StaticResource MaterialDesignFilterChipListBox}"/>
</Border>
</Grid>
</StackPanel>
<StackPanel Style="{StaticResource VisibleWhenPie}">
<Grid Margin="0 0 0 15">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="80"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<TextBlock Text="필드" VerticalAlignment="Top"
FontSize="20" FontFamily="{StaticResource SCDream4}" Foreground="White"/>
<Border Grid.Column="1" CornerRadius="10"
Background="White" Margin="15 0 0 15">
<ListBox ItemsSource="{Binding YFieldCandidates}"
DisplayMemberPath="Display"
SelectionMode="Extended"
helper:MultiSelectBehavior.SelectedItems="{Binding SelectedYFields, Mode=OneWay}"
helper:MultiSelectBehavior.KeyPath="Key"
helper:MultiSelectBehavior.ValuePath="Value"
Height="Auto" Background="White"
FontSize="16" FontWeight="Bold"
Style="{StaticResource MaterialDesignFilterChipListBox}"/>
</Border>
</Grid>
<StackPanel Orientation="Horizontal" Margin="0 0 0 15">
<RadioButton x:Name="rbStatus" Content="합계"
GroupName="pie" Margin="0 0 30 0"
Foreground="White" FontSize="20"
Style="{StaticResource MaterialDesignUserForegroundRadioButton}"
IsChecked="{Binding UseAverage, Converter={StaticResource InverseBoolConverter}, Mode=TwoWay}"/>
<RadioButton x:Name="pie" Content="평균"
GroupName="pie" Grid.Column="1"
Foreground="White" FontSize="20"
Style="{StaticResource MaterialDesignUserForegroundRadioButton}"
IsChecked="{Binding UseAverage, Mode=TwoWay}"/>
</StackPanel>
</StackPanel>
</StackPanel>
</Grid>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="15 0 0 0" Grid.Row="1">
<CheckBox Content="마커 표시" IsChecked="{Binding ShowMarkers}" Margin="0 0 15 0"
FontSize="20" FontFamily="{StaticResource SCDream4}" Foreground="White"
VerticalContentAlignment="Center">
<CheckBox.Style>
<Style TargetType="CheckBox" BasedOn="{StaticResource MaterialDesignUserForegroundCheckBox}">
<Setter Property="Visibility" Value="Collapsed"/>
<Style.Triggers>
<DataTrigger Binding="{Binding SelectedGraphType}" Value="LINE">
<Setter Property="Visibility" Value="Visible"/>
</DataTrigger>
<DataTrigger Binding="{Binding SelectedGraphType}" Value="STACKAREA">
<Setter Property="Visibility" Value="Visible"/>
</DataTrigger>
</Style.Triggers>
</Style>
</CheckBox.Style>
</CheckBox>
<CheckBox Content="범례 표시" IsChecked="{Binding ShowLegends}" Margin="0 0 15 0"
FontSize="20" FontFamily="{StaticResource SCDream4}" Foreground="White"
VerticalContentAlignment="Center">
<CheckBox.Style>
<Style TargetType="CheckBox" BasedOn="{StaticResource MaterialDesignUserForegroundCheckBox}">
<Setter Property="Visibility" Value="Collapsed"/>
<Style.Triggers>
<DataTrigger Binding="{Binding SelectedGraphType}" Value="LINE">
<Setter Property="Visibility" Value="Visible"/>
</DataTrigger>
<DataTrigger Binding="{Binding SelectedGraphType}" Value="STACKAREA">
<Setter Property="Visibility" Value="Visible"/>
</DataTrigger>
</Style.Triggers>
</Style>
</CheckBox.Style>
</CheckBox>
<CheckBox Content="도넛 모드" IsChecked="{Binding IsDonut}" Margin="0 0 15 0"
FontSize="20" FontFamily="{StaticResource SCDream4}" Foreground="White"
VerticalContentAlignment="Center">
<CheckBox.Style>
<Style TargetType="CheckBox" BasedOn="{StaticResource MaterialDesignUserForegroundCheckBox}">
<Setter Property="Visibility" Value="Collapsed"/>
<Style.Triggers>
<DataTrigger Binding="{Binding SelectedGraphType}" Value="PIE">
<Setter Property="Visibility" Value="Visible"/>
</DataTrigger>
</Style.Triggers>
</Style>
</CheckBox.Style>
</CheckBox>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="15 0" Grid.Row="1" HorizontalAlignment="Right">
<Button Content="그래프 생성" Style="{StaticResource MaterialDesignFlatLightBgButton}"
FontWeight="Bold" Command="{Binding DrawGraphCommand}"/>
</StackPanel> </StackPanel>
</Grid> </Grid>
</Border> </Border>
<Border Grid.Row="1" Grid.Column="1" Margin="0 0 20 20" CornerRadius="10" <Border Grid.Row="1" Grid.Column="1" Margin="0 0 20 20" CornerRadius="10"
Background="#384659" BorderBrush="#404F63" BorderThickness="1"> Background="#384659" BorderBrush="#404F63" BorderThickness="1">
<control:GraphControl x:Name="graphControl"
Margin="10" DataContext="{Binding GraphControlVM}"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
</Border> </Border>
</Grid> </Grid>
</UserControl> </UserControl>

@ -277,13 +277,13 @@ namespace SmartAquaViewer.ViewModel
switch (SelectedGraphType) switch (SelectedGraphType)
{ {
case GraphType.LINE: case GraphType.LINE:
GraphControlVM.SetMultiLineGraph(WaterQualityList, SelectedYFields, ShowMarkers, ShowLegends); GraphControlVM.SetMultiLineGraph(WaterQualityList, SelectedYFields, DataType.Energy, ShowMarkers, ShowLegends);
break; break;
case GraphType.STACKAREA: case GraphType.STACKAREA:
GraphControlVM.SetStackAreaPlot(WaterQualityList, SelectedYFields, ShowMarkers, ShowLegends); GraphControlVM.SetStackAreaPlot(WaterQualityList, SelectedYFields, DataType.Energy, ShowMarkers, ShowLegends);
break; break;
case GraphType.PIE: case GraphType.PIE:
GraphControlVM.SetPieChart(WaterQualityList, SelectedYFields, UseAverage, IsDonut); GraphControlVM.SetPieChart(WaterQualityList, SelectedYFields, DataType.Energy, UseAverage, IsDonut);
break; break;
default: default:
break; break;

@ -93,6 +93,7 @@ namespace SmartAquaViewer.ViewModel
public void SetMultiLineGraph( public void SetMultiLineGraph(
List<WaterQualityVO> collection, List<WaterQualityVO> collection,
ObservableCollection<FieldItem> yFields, ObservableCollection<FieldItem> yFields,
DataType dataType,
bool showMarker, bool showLegend) bool showMarker, bool showLegend)
{ {
Model.Series.Clear(); Model.Series.Clear();
@ -109,7 +110,7 @@ namespace SmartAquaViewer.ViewModel
var yAxis = new LinearAxis var yAxis = new LinearAxis
{ {
Position = AxisPosition.Left, Position = AxisPosition.Left,
Title = "전력 (kW)", Title = dataType == DataType.Energy ? "전력 (kW)" : "온실가스 (tCO₂)",
MajorGridlineStyle = LineStyle.Solid, MajorGridlineStyle = LineStyle.Solid,
MinorGridlineStyle = LineStyle.Dot MinorGridlineStyle = LineStyle.Dot
}; };
@ -127,7 +128,8 @@ namespace SmartAquaViewer.ViewModel
foreach (var r in collection.OrderBy(r => r.RecordedTime)) foreach (var r in collection.OrderBy(r => r.RecordedTime))
{ {
double? y = null; double? y = null;
y = ResolveEnergyField(r, field.Name!); double? v = ResolveGreenhouseGas(r, field.Name!);
y = dataType == DataType.Energy ? ResolveEnergyField(r, field.Name!) : v;
if (!y.HasValue) continue; if (!y.HasValue) continue;
series.Points.Add(new DataPoint( series.Points.Add(new DataPoint(
DateTimeAxis.ToDouble(r.RecordedTime), DateTimeAxis.ToDouble(r.RecordedTime),
@ -149,7 +151,7 @@ namespace SmartAquaViewer.ViewModel
LegendPlacement = LegendPlacement.Outside, LegendPlacement = LegendPlacement.Outside,
LegendPosition = LegendPosition.RightTop, LegendPosition = LegendPosition.RightTop,
LegendOrientation = LegendOrientation.Vertical, LegendOrientation = LegendOrientation.Vertical,
LegendTitle = "전력 소비량", LegendTitle = dataType == DataType.Energy ? "전력 소비량" : "온실가스 배출량",
TextColor = OxyColors.Black TextColor = OxyColors.Black
}); });
@ -474,6 +476,7 @@ namespace SmartAquaViewer.ViewModel
} }
public void SetStackAreaPlot(List<WaterQualityVO> collection, ObservableCollection<FieldItem> yFields, public void SetStackAreaPlot(List<WaterQualityVO> collection, ObservableCollection<FieldItem> yFields,
DataType dataType,
bool showMarker, bool showLegends) bool showMarker, bool showLegends)
{ {
Model.Series.Clear(); Model.Series.Clear();
@ -493,7 +496,7 @@ namespace SmartAquaViewer.ViewModel
var yAxis = new LinearAxis var yAxis = new LinearAxis
{ {
Position = AxisPosition.Left, Position = AxisPosition.Left,
Title = "전력 (kW)", Title = dataType == DataType.Energy ? "전력 (kW)" : "온실가스 (tCO₂)",
MajorGridlineStyle = LineStyle.Solid, MajorGridlineStyle = LineStyle.Solid,
MinorGridlineStyle = LineStyle.Dot MinorGridlineStyle = LineStyle.Dot
}; };
@ -522,7 +525,9 @@ namespace SmartAquaViewer.ViewModel
for (int i = 0; i < n; i++) for (int i = 0; i < n; i++)
{ {
double? y = ResolveEnergyField(records[i], field.Name!); double? y = dataType == DataType.Energy ?
ResolveEnergyField(records[i], field.Name!) :
ResolveGreenhouseGas(records[i], field.Name!);
double value = y ?? 0; double value = y ?? 0;
double x = DateTimeAxis.ToDouble(records[i].RecordedTime); double x = DateTimeAxis.ToDouble(records[i].RecordedTime);
@ -550,7 +555,7 @@ namespace SmartAquaViewer.ViewModel
LegendPlacement = LegendPlacement.Outside, LegendPlacement = LegendPlacement.Outside,
LegendPosition = LegendPosition.RightTop, LegendPosition = LegendPosition.RightTop,
LegendOrientation = LegendOrientation.Vertical, LegendOrientation = LegendOrientation.Vertical,
LegendTitle = "전력 소비량", LegendTitle = dataType == DataType.Energy ? "전력 소비량" : "온실가스 배출량",
TextColor = OxyColors.Black TextColor = OxyColors.Black
}); });
@ -558,6 +563,7 @@ namespace SmartAquaViewer.ViewModel
} }
public void SetPieChart(List<WaterQualityVO> collection, ObservableCollection<FieldItem> fields, public void SetPieChart(List<WaterQualityVO> collection, ObservableCollection<FieldItem> fields,
DataType dataType,
bool useAverage = false, bool donut = true, bool useAverage = false, bool donut = true,
double minLabelPercent = 0.03) double minLabelPercent = 0.03)
{ {
@ -579,8 +585,8 @@ namespace SmartAquaViewer.ViewModel
var agg = new List<(string name, double value)>(); var agg = new List<(string name, double value)>();
foreach (var f in fields) foreach (var f in fields)
{ {
var values = collection.Select(r => ResolveEnergyField(r, f.Name!) ?? 0.0); var values = collection.Select(r => (dataType == DataType.Energy ? ResolveEnergyField(r, f.Name!) : ResolveGreenhouseGas(r, f.Name!)) ?? 0.0);
double v = useAverage ? (values.Any() ? values.Average() : 0.0) : values.Sum(); double v = (useAverage ? (values.Any() ? values.Average() : 0.0) : values.Sum());
agg.Add((f.Display ?? f.Name!, v)); agg.Add((f.Display ?? f.Name!, v));
} }
@ -701,6 +707,23 @@ namespace SmartAquaViewer.ViewModel
}; };
} }
private double? ResolveGreenhouseGas(WaterQualityVO vo, string fieldName)
{
return fieldName switch
{
"Filtering.SandFilterGreenhouseGas" => vo.Filtering.SandFilterGreenhouseGas,
"Filtering.CirculationPumpGreenhouseGas" => vo.Filtering.CirculationPumpGreenhouseGas,
"Filtering.HeatPumpGreenhouseGas" => vo.Filtering.HeatPumpGreenhouseGas,
"Filtering.AirBlowerGreenhouseGas" => vo.Filtering.AirBlowerGreenhouseGas,
"Sterilizing.OzoneGeneratorGreenhouseGas" => vo.Sterilizing.OzoneGeneratorGreenhouseGas,
"Sterilizing.UVSterilizerGreenhouseGas" => vo.Sterilizing.UVSterilizerGreenhouseGas,
"Sterilizing.OzoneDissolverGreenhouseGas" => vo.Sterilizing.OzoneDissolverGreenhouseGas,
"Sterilizing.ExcessOzoneDestroyerGreenhouseGas" => vo.Sterilizing.ExcessOzoneDestroyerGreenhouseGas,
"TotalGreenhouseGas" => vo.TotalGreenhouseGas,
_ => null
};
}
private double? ResolveUvPowerPerId(WaterQualityVO r, string fieldName) private double? ResolveUvPowerPerId(WaterQualityVO r, string fieldName)
{ {
// 케이스 A // 케이스 A

@ -60,20 +60,6 @@ namespace SmartAquaViewer.ViewModel
} }
} }
private StepFieldKind _selectedKind = StepFieldKind.Sensor; // 기본값은 센서
public StepFieldKind SelectedKind
{
get => _selectedKind;
set
{
if (_selectedKind != value)
{
_selectedKind = value;
OnPropertyChanged();
}
}
}
public bool ShowXSelector => SelectedGraphType == GraphType.SCATTER; public bool ShowXSelector => SelectedGraphType == GraphType.SCATTER;
// [필드 후보 목록] 탭/시스템에 따라 달라짐 // [필드 후보 목록] 탭/시스템에 따라 달라짐
@ -120,8 +106,6 @@ namespace SmartAquaViewer.ViewModel
GraphType.PIE GraphType.PIE
}; };
SelectedKind = StepFieldKind.Energy; // 기본적으로 에너지 관련 필드만 표시
DrawGraphCommand = new RelayCommand(DrawGraph); DrawGraphCommand = new RelayCommand(DrawGraph);
RebuildAvailableFields(); RebuildAvailableFields();
@ -133,13 +117,13 @@ namespace SmartAquaViewer.ViewModel
switch (SelectedGraphType) switch (SelectedGraphType)
{ {
case GraphType.LINE: case GraphType.LINE:
GraphControlVM.SetMultiLineGraph(WaterQualityList, SelectedYFields, ShowMarkers, ShowLegends); GraphControlVM.SetMultiLineGraph(WaterQualityList, SelectedYFields, DataType.GreenhouseGas, ShowMarkers, ShowLegends);
break; break;
case GraphType.STACKAREA: case GraphType.STACKAREA:
GraphControlVM.SetStackAreaPlot(WaterQualityList, SelectedYFields, ShowMarkers, ShowLegends); GraphControlVM.SetStackAreaPlot(WaterQualityList, SelectedYFields, DataType.GreenhouseGas, ShowMarkers, ShowLegends);
break; break;
case GraphType.PIE: case GraphType.PIE:
GraphControlVM.SetPieChart(WaterQualityList, SelectedYFields); GraphControlVM.SetPieChart(WaterQualityList, SelectedYFields, DataType.GreenhouseGas);
break; break;
default: default:
break; break;
@ -153,15 +137,15 @@ namespace SmartAquaViewer.ViewModel
// 공통 시간 // 공통 시간
AvailableFields.Add(new FieldItem { Name = "RecordedTime", Display = "시간", DataType = typeof(DateTime) }); AvailableFields.Add(new FieldItem { Name = "RecordedTime", Display = "시간", DataType = typeof(DateTime) });
AvailableFields.Add(new FieldItem { Name = "TotalEnergy", Display = "총 전력", DataType = typeof(double), Kind = StepFieldKind.Energy }); AvailableFields.Add(new FieldItem { Name = "TotalGreenhouseGas", Display = "총 배출량", DataType = typeof(double), Kind = StepFieldKind.Energy });
AvailableFields.Add(new FieldItem { Name = "Filtering.SandFilterEnergy", Display = "모래여과기", DataType = typeof(double), Kind = StepFieldKind.Energy }); AvailableFields.Add(new FieldItem { Name = "Filtering.SandFilterGreenhouseGas", Display = "모래여과기", DataType = typeof(double), Kind = StepFieldKind.Energy });
AvailableFields.Add(new FieldItem { Name = "Filtering.CirculationPumpEnergy", Display = "순환펌프", DataType = typeof(double), Kind = StepFieldKind.Energy }); AvailableFields.Add(new FieldItem { Name = "Filtering.CirculationPumpGreenhouseGas", Display = "순환펌프", DataType = typeof(double), Kind = StepFieldKind.Energy });
AvailableFields.Add(new FieldItem { Name = "Filtering.HeatPumpEnergy", Display = "히트펌프", DataType = typeof(double), Kind = StepFieldKind.Energy }); AvailableFields.Add(new FieldItem { Name = "Filtering.HeatPumpGreenhouseGas", Display = "히트펌프", DataType = typeof(double), Kind = StepFieldKind.Energy });
AvailableFields.Add(new FieldItem { Name = "Filtering.AirBlowerEnergy", Display = "에어브로와", DataType = typeof(double), Kind = StepFieldKind.Energy }); AvailableFields.Add(new FieldItem { Name = "Filtering.AirBlowerGreenhouseGas", Display = "에어브로와", DataType = typeof(double), Kind = StepFieldKind.Energy });
AvailableFields.Add(new FieldItem { Name = "Sterilizing.OzoneGeneratorEnergy", Display = "오존발생기", DataType = typeof(double), Kind = StepFieldKind.Energy }); AvailableFields.Add(new FieldItem { Name = "Sterilizing.OzoneGeneratorGreenhouseGas", Display = "오존발생기", DataType = typeof(double), Kind = StepFieldKind.Energy });
AvailableFields.Add(new FieldItem { Name = "Sterilizing.UVSterilizerEnergy", Display = "자외선 살균기", DataType = typeof(double), Kind = StepFieldKind.Energy }); AvailableFields.Add(new FieldItem { Name = "Sterilizing.UVSterilizerGreenhouseGas", Display = "자외선 살균기", DataType = typeof(double), Kind = StepFieldKind.Energy });
AvailableFields.Add(new FieldItem { Name = "Sterilizing.OzoneDissolverEnergy", Display = "오존용해장치", DataType = typeof(double), Kind = StepFieldKind.Energy }); AvailableFields.Add(new FieldItem { Name = "Sterilizing.OzoneDissolverGreenhouseGas", Display = "오존용해장치", DataType = typeof(double), Kind = StepFieldKind.Energy });
AvailableFields.Add(new FieldItem { Name = "Sterilizing.ExcessOzoneDestroyerEnergy", Display = "배오존장치", DataType = typeof(double), Kind = StepFieldKind.Energy }); AvailableFields.Add(new FieldItem { Name = "Sterilizing.ExcessOzoneDestroyerGreenhouseGas", Display = "배오존장치", DataType = typeof(double), Kind = StepFieldKind.Energy });
} }
private void RebuildFieldCandidates() private void RebuildFieldCandidates()
@ -179,7 +163,7 @@ namespace SmartAquaViewer.ViewModel
SelectedXField = AvailableFields.FirstOrDefault(f => f.DataType == typeof(DateTime)) SelectedXField = AvailableFields.FirstOrDefault(f => f.DataType == typeof(DateTime))
?? AvailableFields.FirstOrDefault(); ?? AvailableFields.FirstOrDefault();
IEnumerable<FieldItem> src = AvailableFields.Where(f => f.Kind == SelectedKind); IEnumerable<FieldItem> src = AvailableFields;
if (SelectedGraphType is GraphType.LINE or GraphType.STACKAREA or GraphType.PIE) if (SelectedGraphType is GraphType.LINE or GraphType.STACKAREA or GraphType.PIE)
{ {

Loading…
Cancel
Save