diff --git a/DistrictEnergy/Properties/AssemblyInfo.cs b/DistrictEnergy/Properties/AssemblyInfo.cs index 563a144..fbdb763 100644 --- a/DistrictEnergy/Properties/AssemblyInfo.cs +++ b/DistrictEnergy/Properties/AssemblyInfo.cs @@ -24,7 +24,7 @@ [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: AssemblyProduct("DistricEnergyPlugIn")] -[assembly: AssemblyVersion("2.0.2.*")] +[assembly: AssemblyVersion("2.0.3.*")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from diff --git a/DistrictEnergy/ViewModels/LoadsViewModel.cs b/DistrictEnergy/ViewModels/LoadsViewModel.cs index be4db27..94d791a 100644 --- a/DistrictEnergy/ViewModels/LoadsViewModel.cs +++ b/DistrictEnergy/ViewModels/LoadsViewModel.cs @@ -1,12 +1,16 @@ using System; +using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Runtime.CompilerServices; +using System.Windows; +using Deedle; using DistrictEnergy.Annotations; using DistrictEnergy.Helpers; using DistrictEnergy.Networks.ThermalPlants; using LiveCharts; using LiveCharts.Defaults; +using LiveCharts.Dtos; using LiveCharts.Geared; using Umi.RhinoServices.Context; using Umi.RhinoServices.UmiEvents; @@ -22,6 +26,8 @@ internal class LoadsViewModel : INotifyPropertyChanged private double _to; private Func _timeFormatter; private bool _isStorageVisible; + private double _fixedTo; + private double _fixedFrom; public LoadsViewModel() { @@ -53,7 +59,31 @@ public LoadsViewModel() }; From = new DateTime(2018, 01, 01, 0, 0, 0).Ticks; + FixedFrom = From; To = new DateTime(2018, 01, 01, 0, 0, 0).AddHours(8760).Ticks; + FixedTo = To; + } + + public double FixedTo + { + get => _fixedTo; + set + { + if (value.Equals(_fixedTo)) return; + _fixedTo = value; + OnPropertyChanged(); + } + } + + public double FixedFrom + { + get => _fixedFrom; + set + { + if (value.Equals(_fixedFrom)) return; + _fixedFrom = value; + OnPropertyChanged(); + } } public bool IsStorageVisible @@ -157,7 +187,7 @@ private void UpdateLoadsChart(object sender, EventArgs e) { var args = (DHRunLPModel.SimulationCompleted) e; var Total = new double[args.TimeSteps]; - var lineSmoothness = 0.5; + var lineSmoothness = 0.1; SeriesCollection.Clear(); DemandLineCollection.Clear(); @@ -180,11 +210,13 @@ private void UpdateLoadsChart(object sender, EventArgs e) SeriesCollection.Add(series); DemandLineCollection.Add(new GLineSeries { - Values = demand.Input.ToDateTimePoint().Split(12) + Values = demand.Input.ToDateTimePoint().Split(plot_duration) .Select(v => new DateTimePoint(v.First().DateTime, v.Sum())).AsGearedValues(), Title = demand.Name, LineSmoothness = lineSmoothness, - Stroke = demand.Fill + Stroke = demand.Fill, + PointGeometry = null, + StrokeThickness = 0.5, }); } @@ -233,7 +265,7 @@ private void UpdateLoadsChart(object sender, EventArgs e) .Select(v => new DateTimePoint(v.First().DateTime, v.Sum())).AsGearedValues(), Title = storage.Name, Fill = storage.Fill, - LineSmoothness = lineSmoothness, + LineSmoothness = 0.5, AreaLimit = 0, LabelPoint = KWhLabelPointFormatter, }); @@ -262,7 +294,6 @@ private void UpdateLoadsChart(object sender, EventArgs e) AreaLimit = 0, LabelPoint = KWhLabelPointFormatter, }); - IsStorageVisible = true; } } } diff --git a/DistrictEnergy/ViewModels/PlantSettingsViewModel.cs b/DistrictEnergy/ViewModels/PlantSettingsViewModel.cs index d78f60b..db30332 100644 --- a/DistrictEnergy/ViewModels/PlantSettingsViewModel.cs +++ b/DistrictEnergy/ViewModels/PlantSettingsViewModel.cs @@ -31,7 +31,6 @@ public class PlantSettingsViewModel : INotifyPropertyChanged typeof(PhotovoltaicArray), typeof(SolarThermalCollector), typeof(WindTurbine), - typeof(PipeNetwork), typeof(GridElectricity), typeof(GridGas), typeof(CustomEnergySupplyModule) @@ -99,11 +98,6 @@ private void LoadSettings(UmiContext context) { DistrictControl.Instance.ListOfPlantSettings.Add(new GridGas()); } - if (!DistrictControl.Instance.ListOfPlantSettings.OfType().Any()) - { - DistrictControl.Instance.ListOfDistrictLoads.Add(new PipeNetwork(LoadTypes.Cooling, "Cooling Losses")); - DistrictControl.Instance.ListOfDistrictLoads.Add(new PipeNetwork(LoadTypes.Heating, "Heating Losses")); - } } OnPropertyChanged(string.Empty); diff --git a/DistrictEnergy/Views/PlantSettings/ChilledWaterView.xaml b/DistrictEnergy/Views/PlantSettings/ChilledWaterView.xaml index 91e57b4..0bbbcda 100644 --- a/DistrictEnergy/Views/PlantSettings/ChilledWaterView.xaml +++ b/DistrictEnergy/Views/PlantSettings/ChilledWaterView.xaml @@ -26,7 +26,7 @@ + Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Primary/materialdesigncolor.blue.xaml" /> @@ -43,7 +43,7 @@ diff --git a/DistrictEnergy/Views/PlantSettings/ElectricGenerationView.xaml b/DistrictEnergy/Views/PlantSettings/ElectricGenerationView.xaml index f862082..d04ca0e 100644 --- a/DistrictEnergy/Views/PlantSettings/ElectricGenerationView.xaml +++ b/DistrictEnergy/Views/PlantSettings/ElectricGenerationView.xaml @@ -24,34 +24,11 @@ + Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Primary/materialdesigncolor.yellow.xaml" /> - diff --git a/DistrictEnergy/Views/PlantSettings/HotWaterView.xaml b/DistrictEnergy/Views/PlantSettings/HotWaterView.xaml index c44b753..5ef03ed 100644 --- a/DistrictEnergy/Views/PlantSettings/HotWaterView.xaml +++ b/DistrictEnergy/Views/PlantSettings/HotWaterView.xaml @@ -25,25 +25,11 @@ + Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Primary/materialdesigncolor.red.xaml" /> - diff --git a/DistrictEnergy/Views/PlantSettings/NetworkView.xaml b/DistrictEnergy/Views/PlantSettings/NetworkView.xaml index d602732..28d1a89 100644 --- a/DistrictEnergy/Views/PlantSettings/NetworkView.xaml +++ b/DistrictEnergy/Views/PlantSettings/NetworkView.xaml @@ -5,75 +5,121 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:DistrictEnergy.Views.PlantSettings" xmlns:viewModels="clr-namespace:DistrictEnergy.ViewModels" + xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - d:DesignHeight="87.984" d:DesignWidth="617.578" + d:DesignHeight="253.984" d:DesignWidth="617.578" + TextElement.Foreground="{DynamicResource MaterialDesignBody}" + TextElement.FontWeight="Regular" + TextElement.FontSize="13" + TextOptions.TextFormattingMode="Ideal" + TextOptions.TextRenderingMode="Auto" + Background="{DynamicResource MaterialDesignPaper}" + FontFamily="{DynamicResource MaterialDesignFont}" d:DataContext="{d:DesignInstance viewModels:NetworkViewModel}"> + + + + + + + + + + - - - - - - - - - - - - - - - - Fast - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Fast + + + + + Accurate + + + + + + + + + + + - Accurate - - - - - - - - - - + \ No newline at end of file diff --git a/DistrictEnergy/Views/ResultViews/Loads.xaml b/DistrictEnergy/Views/ResultViews/Loads.xaml index f2da901..31de535 100644 --- a/DistrictEnergy/Views/ResultViews/Loads.xaml +++ b/DistrictEnergy/Views/ResultViews/Loads.xaml @@ -6,12 +6,13 @@ xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf" xmlns:geared="clr-namespace:LiveCharts.Geared;assembly=LiveCharts.Geared" xmlns:viewModels="clr-namespace:DistrictEnergy.ViewModels" + xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="300" d:DataContext="{d:DesignInstance viewModels:LoadsViewModel}"> - - + +