Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scrum 42 optimizer view #22

Merged
merged 8 commits into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 65 additions & 38 deletions src/ProfHeat.AUI/Assets/Images/ElectricBoiler.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
77 changes: 38 additions & 39 deletions src/ProfHeat.AUI/Assets/Images/GasBoiler.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
101 changes: 91 additions & 10 deletions src/ProfHeat.AUI/Assets/Images/GasMotor.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
979 changes: 979 additions & 0 deletions src/ProfHeat.AUI/Assets/Images/HeatingGrid.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
86 changes: 46 additions & 40 deletions src/ProfHeat.AUI/Assets/Images/OilBoiler.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions src/ProfHeat.AUI/ViewModels/OptimizerViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ public partial class OptimizerViewModel : BaseViewModel
};

public ObservableCollection<CheckBoxItem> CheckBoxItems { get; }
public string GridName { get; }
public string GridImagePath { get; }
#endregion

#region Constructor
Expand All @@ -68,7 +70,10 @@ public OptimizerViewModel(List<OptimizationResult> results)
() => OptimizeCommand.NotifyCanExecuteChanged()
))
);
GridName = _grid.Name;
GridImagePath = _grid.ImagePath;
}

#endregion

#region Commands
Expand Down
54 changes: 34 additions & 20 deletions src/ProfHeat.AUI/Views/OptimizerView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
xmlns:vm="using:ProfHeat.AUI.ViewModels"
xmlns:v="using:ProfHeat.AUI.Views"
xmlns:m="using:ProfHeat.Core.Models"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" Width="800" Height="450"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
Width="800" Height="450"
x:Class="ProfHeat.AUI.Views.OptimizerView"
x:DataType="vm:OptimizerViewModel">

<Grid ColumnDefinitions="Auto,Auto"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch">

<Grid ColumnDefinitions="Auto,Auto">
<StackPanel Grid.Column="0"
Width="250"
Margin="40,70,0,0"
Width="200"
Margin="100,30,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Top">
<Button CornerRadius="5"
Expand All @@ -24,30 +24,44 @@
<ItemsControl ItemsSource="{Binding CheckBoxItems}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<CheckBox Margin="4"
HorizontalAlignment="Left"
IsChecked="{Binding IsChecked}"
Content="{Binding Name}"/>
<Grid RowDefinitions="Auto" >
<StackPanel Grid.Row="0">
<CheckBox Margin="3"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Height="50"
IsChecked="{Binding IsChecked}"
Content="{Binding Name}"/>
</StackPanel>
<StackPanel Grid.Row="0">
<Svg Grid.Row="1"
HorizontalAlignment="Right"
VerticalAlignment="Top"
Width="50" Height="50"
Path="{Binding ImagePath}"/>
</StackPanel>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>

<Grid Grid.Column="1"
Width="500"
RowDefinitions="Auto, Auto, Auto" >
<TextBlock Grid.Row="0"
Text="HEATINGTON"
Text="{Binding GridName}"
HorizontalAlignment="Center"
VerticalAlignment="Top"
Margin="80,30,0,10"/>
<Image Grid.Row="1"
HorizontalAlignment="Right"
VerticalAlignment="Top"
Height="300"
Width="380"
Margin="0,0,20,0"
Source="/Assets/Images/HeatingtonMap.png"/>
<StackPanel Grid.Row="2" Height="30">
Margin="130,30,0,10"/>
<Svg Grid.Row="1"
HorizontalAlignment="Right"
VerticalAlignment="Top"
Height="300" Width="320"
Margin="0,0,20,0"
Path="{Binding GridImagePath}"/>
<StackPanel Grid.Row="2"
Height="30">
<Button CornerRadius="5"
Margin="0,0,20,30"
HorizontalAlignment="Right"
Expand Down
1 change: 0 additions & 1 deletion src/ProfHeat.Core/ProfHeat.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,4 @@
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>

</Project>
Loading