Skip to content
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
31 changes: 31 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,3 +175,34 @@ a separate inventory and authorization.
When recommending a task or writing a prompt or handover, state the model,
effort, new or existing session and Plan or Build mode, with a brief reason.
A recommendation does not mean any setting was changed automatically.

## SAM_UI dialog conventions

`CLAUDE.md` imports this file, so these are the only copy; do not restate them elsewhere.
The reference is the Part O windows (`WPF/SAM.Analytical.UI.WPF/Windows/PartO*Window.xaml`);
do not invent a parallel design system and do not restyle Part O when touching other dialogs.

- Merge `Themes/PartOStyles.xaml` and use its resources: `PartO.Brush.*` colours (no literal hex for text,
borders, surfaces or status), `PartO.SectionHeading`, `PartO.Caption` for secondary text,
`PartO.PrimaryButton` for the one action a dialog wants, `PartO.StatusGlyph` beside a status label.
- Window: `FontFamily="Roboto Light"`, `WindowStartupLocation="CenterOwner"`, `Owner` set by the caller,
`ShowInTaskbar="False"` for a modal dialog, `SizeToContent="Height"` with a `Width`/`MinWidth` for forms,
`ResizeMode="CanResizeWithGrip"` only where content can grow. Content margin `16,14`.
- Buttons: bottom-right, `Height="28"`, `MinWidth` 90 (or `Padding="12,0"`), 8 px apart; one primary
with `IsDefault`, Cancel/Close with `IsCancel`. A disabled choice keeps a tooltip saying why
(`ToolTipService.ShowOnDisabled`).
- Status is never colour alone: pair colour with a glyph or words. Warning is amber, failure red, success
green (`PartO.Brush.Warning/Danger/Success`). Long operations use the shared progress window
(`documentation/ProgressDialogPattern.md`), not an ad-hoc bar.
- Restyling is XAML-only: keep element names, handlers, cancellation, diagnostics and result logic as they are.

## Validation policy

Size validation to the change; do not run the full 26-repository BuildAll or the licensed simulation suite
for styling changes unless a concrete dependency or regression risk requires it.

- Documentation change: documentation review (links, accuracy, no internal files promoted to `master`).
- UI-only change: build the affected SAM_UI project(s) and run the targeted tests that cover the changed code;
compare the window against the Part O reference (ownership, resize, DPI scaling, buttons, error and cancel paths).
- Simulation logic change: focused unit tests plus the relevant workflow checks.
- Installer change: packaging and deployment validation.
35 changes: 22 additions & 13 deletions WPF/SAM.Analytical.UI.WPF/Windows/EngineComparisonWindow.xaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
<Window x:Class="SAM.Analytical.UI.WPF.EngineComparisonWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Compare Tas / OpenStudio" Height="780" Width="1180" MinWidth="760" MinHeight="480" WindowStartupLocation="CenterOwner">
Title="Compare Tas / OpenStudio" Height="780" Width="1180" MinWidth="760" MinHeight="480"
FontFamily="Roboto Light" WindowStartupLocation="CenterOwner">
<!-- SAM_UI#231, Phase 1: a lightweight view over SAM_Validation's comparison of two B1a documents. Every value, difference,
band and note shown is SAM_Validation's; this window only lays them out. No charts in Phase 1. -->
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/SAM.Analytical.UI.WPF;component/Themes/PartOStyles.xaml"/>
</ResourceDictionary.MergedDictionaries>
<Style x:Key="Style_Row" TargetType="DataGridRow">
<Style.Triggers>
<DataTrigger Binding="{Binding Status}" Value="NotEquivalent">
Expand Down Expand Up @@ -90,16 +95,20 @@
<Setter Property="TextTrimming" Value="CharacterEllipsis"/>
<Setter Property="ToolTip" Value="{Binding StatusText}"/>
</Style>
</ResourceDictionary>
</Window.Resources>
<Grid Margin="10">
<Grid Margin="16,14,16,14">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>

<GroupBox Grid.Row="0" Header="Runs (B1a documents)" Padding="6">
<GroupBox Grid.Row="0" Padding="8">
<GroupBox.Header>
<TextBlock Text="Runs (B1a documents)" Style="{StaticResource PartO.SectionHeading}" Margin="0"/>
</GroupBox.Header>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
Expand All @@ -118,14 +127,14 @@
<TextBox x:Name="TextBox_OpenStudio" Grid.Row="1" Grid.Column="1" IsReadOnly="True" Margin="0,0,6,4"/>
<Button x:Name="Button_BrowseOpenStudio" Grid.Row="1" Grid.Column="2" Content="Browse..." Width="90" Margin="0,0,0,4"/>
<StackPanel Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="3" Orientation="Horizontal" Margin="0,4,0,0">
<Button x:Name="Button_Run" Content="Run Tas + OpenStudio..." Padding="10,3" Margin="0,0,8,0" ToolTipService.ShowOnDisabled="True"/>
<Button x:Name="Button_LoadFolder" Content="Load run folder..." Padding="10,3" Margin="0,0,8,0"/>
<Button x:Name="Button_Compare" Content="Compare" Padding="10,3"/>
<Button x:Name="Button_Run" Content="Run Tas + OpenStudio..." Height="28" Padding="12,0" Margin="0,0,8,0" Style="{StaticResource PartO.PrimaryButton}" ToolTipService.ShowOnDisabled="True"/>
<Button x:Name="Button_LoadFolder" Content="Load run folder..." Height="28" Padding="12,0" Margin="0,0,8,0"/>
<Button x:Name="Button_Compare" Content="Compare" Height="28" Padding="12,0"/>
</StackPanel>
</Grid>
</GroupBox>

<Border x:Name="Border_Banner" Grid.Row="1" Margin="0,8,0,8" Padding="8,6" Background="#F2F2F2">
<Border x:Name="Border_Banner" Grid.Row="1" Margin="0,8,0,8" Padding="10,8" Background="{StaticResource PartO.Brush.Surface}" BorderBrush="{StaticResource PartO.Brush.Border}" BorderThickness="1">
<TextBlock x:Name="TextBlock_Banner" TextWrapping="Wrap" Text="Choose a Tas and an OpenStudio B1a document, load a comparison run folder, or run both engines on the open model."/>
</Border>

Expand Down Expand Up @@ -224,16 +233,16 @@
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0">
<TextBlock TextWrapping="Wrap" Foreground="#6A6A6A"
<TextBlock Style="{StaticResource PartO.Caption}"
Text="Normalized difference (%) = 100 × |OpenStudio − TAS| / max(|TAS|, |OpenStudio|, applicable near-zero floor). It is unsigned and is not percentage change against TAS; peak hours use circular hours and no percentage. Bands are provisional tolerance bands, not engineering verdicts."/>
<TextBlock TextWrapping="Wrap" Foreground="#6A6A6A" Margin="0,3,0,0"
<TextBlock Style="{StaticResource PartO.Caption}" Margin="0,3,0,0"
Text="Values, differences, bands and notes are SAM_Validation's (benchmark-compare). Missing values are never shown as zero. Unit mismatches and informational rows are labelled; informational rows keep their band but are excluded from the numerical status."/>
</StackPanel>
<WrapPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,6,0,0">
<Button x:Name="Button_OpenReport" Content="Open report" Padding="10,3" Margin="6,0,0,0" IsEnabled="False"/>
<Button x:Name="Button_Export" Content="Export reports..." Padding="10,3" Margin="6,0,0,0" IsEnabled="False"/>
<Button x:Name="Button_OpenFolder" Content="Open run folder" Padding="10,3" Margin="6,0,0,0" IsEnabled="False"/>
<Button x:Name="Button_Close" Content="Close" Padding="10,3" Margin="6,0,0,0" IsCancel="True"/>
<Button x:Name="Button_OpenReport" Content="Open report" Height="28" Padding="12,0" Margin="6,0,0,0" IsEnabled="False"/>
<Button x:Name="Button_Export" Content="Export reports..." Height="28" Padding="12,0" Margin="6,0,0,0" IsEnabled="False"/>
<Button x:Name="Button_OpenFolder" Content="Open run folder" Height="28" Padding="12,0" Margin="6,0,0,0" IsEnabled="False"/>
<Button x:Name="Button_Close" Content="Close" Height="28" Padding="12,0" Margin="6,0,0,0" IsCancel="True"/>
</WrapPanel>
</Grid>
</Grid>
Expand Down
30 changes: 21 additions & 9 deletions WPF/SAM.Analytical.UI.WPF/Windows/RunSimulationWindow.xaml
Original file line number Diff line number Diff line change
@@ -1,34 +1,46 @@
<Window x:Class="SAM.Analytical.UI.WPF.RunSimulationWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Run Simulation" Width="560" SizeToContent="Height" ResizeMode="NoResize" WindowStartupLocation="CenterOwner" ShowInTaskbar="False">
Title="Run Simulation" Width="600" SizeToContent="Height" MinWidth="480" ResizeMode="NoResize"
FontFamily="Roboto Light" WindowStartupLocation="CenterOwner" ShowInTaskbar="False">
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/SAM.Analytical.UI.WPF;component/Themes/PartOStyles.xaml"/>
</ResourceDictionary.MergedDictionaries>
<!-- An engine's explanation sits under its radio button, indented to the label (the Part O caption look). -->
<Style x:Key="Style_EngineCaption" TargetType="TextBlock" BasedOn="{StaticResource PartO.Caption}">
<Setter Property="Margin" Value="20,0,0,12"/>
</Style>
</ResourceDictionary>
</Window.Resources>
<!-- SAM_UI#231: the unified Run Simulation command. It only chooses the engine; each choice runs the existing workflow for it
(Tas: Energy Simulation, unchanged; OpenStudio: SAM_UI#229; Both: one frozen snapshot, both producers in turn, SAM_Validation's
comparison). -->
<StackPanel Margin="12">
<TextBlock Text="Simulate the open model with:" FontWeight="SemiBold" Margin="0,0,0,8"/>
<StackPanel Margin="16,14,16,14">
<TextBlock Text="Simulate the open model with:" Style="{StaticResource PartO.SectionHeading}" Margin="0,0,0,8"/>

<RadioButton x:Name="RadioButton_Tas" GroupName="Engine" IsChecked="True" Margin="0,0,0,2" ToolTipService.ShowOnDisabled="True">
<TextBlock Text="Tas only" FontWeight="SemiBold"/>
</RadioButton>
<TextBlock Margin="20,0,0,10" TextWrapping="Wrap" Foreground="#555555"
<TextBlock Style="{StaticResource Style_EngineCaption}"
Text="The existing Energy Simulation, unchanged: its own settings dialog, results written back into the open model as before."/>

<RadioButton x:Name="RadioButton_OpenStudio" GroupName="Engine" Margin="0,0,0,2" ToolTipService.ShowOnDisabled="True">
<TextBlock Text="OpenStudio/EnergyPlus only" FontWeight="SemiBold"/>
</RadioButton>
<TextBlock Margin="20,0,0,10" TextWrapping="Wrap" Foreground="#555555"
<TextBlock Style="{StaticResource Style_EngineCaption}"
Text="An annual OpenStudio/EnergyPlus run of a frozen copy of the open model. Its results and diagnostics are saved as a separate model in a new run folder; the open model is not changed. Needs OpenStudio 3.10."/>

<RadioButton x:Name="RadioButton_Both" GroupName="Engine" Margin="0,0,0,2" ToolTipService.ShowOnDisabled="True">
<TextBlock Text="Both - Tas + OpenStudio/EnergyPlus" FontWeight="SemiBold"/>
</RadioButton>
<TextBlock Margin="20,0,0,10" TextWrapping="Wrap" Foreground="#555555"
<TextBlock Style="{StaticResource Style_EngineCaption}"
Text="One read-only snapshot of the model and one weather file; Tas then OpenStudio run on it (benchmark-tas and benchmark-openstudio, with their fixed workflow settings), each keeping its own outputs. When both complete, SAM_Validation compares them and the comparison window opens. If one engine fails, the other's results are kept and shown as partially completed - nothing is compared or filled in. The open model is not changed."/>

<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,6,0,0">
<Button x:Name="Button_Run" Content="Run" Width="80" IsDefault="True" Margin="0,0,8,0"/>
<Button x:Name="Button_Cancel" Content="Cancel" Width="80" IsCancel="True"/>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,8,0,0">
<Button x:Name="Button_Run" Content="Run" MinWidth="90" Height="28" IsDefault="True" Margin="0,0,8,0" Style="{StaticResource PartO.PrimaryButton}"/>
<Button x:Name="Button_Cancel" Content="Cancel" MinWidth="90" Height="28" IsCancel="True"/>
</StackPanel>
</StackPanel>
</Window>
13 changes: 13 additions & 0 deletions documentation/evidence/sim-dialog-consistency/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# SAM_UI#246 visual acceptance evidence (2026-10-20)

Rendered from the isolated worktree build (Release, tested head = the PR's XAML commit) by a temporary,
uncommitted WPF test harness: each real window instance, fabricated SAM_Validation comparison documents,
no simulation. Captures are window content only (no title bar), at 100% (`-100`) and 150% (`-150`) scale.
Roboto Light is not installed on this machine, so all windows (Part O reference included) fall back to the
same system font.

- partO-100: Part O reference (Previous result found)
- run-both-100/150: Run Simulation, Both selected (longest explanation)
- run-disabled-150: Run Simulation with OpenStudio/Both disabled
- compare-model-1180-100: Compare Tas / OpenStudio, Model grid
- compare-spaces-760-150: Compare, Spaces grid at minimum width (horizontal scroll)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading