Skip to content

Commit

Permalink
Merge pull request #212 from kostoskistefan/master
Browse files Browse the repository at this point in the history
Add Reload button to LiveSPICE VST
  • Loading branch information
dsharlet authored Dec 18, 2023
2 parents 3e4564d + 2a24fdc commit 0bab2a3
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 8 deletions.
21 changes: 13 additions & 8 deletions LiveSPICEVst/EditorView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,36 @@
<local:SchematicDisplay x:Name="OverlaySchematic" Opacity="0.5" IsHitTestVisible="False" />
<DockPanel Margin="8,6">
<DockPanel DockPanel.Dock="Top" HorizontalAlignment="Stretch" Margin="5">
<Button DockPanel.Dock="Right" x:Name="ShowAboutButton" Click="ShowAboutButton_Click" HorizontalAlignment="Right">
<TextBlock Margin="5,0,5,0">About</TextBlock>
<Button x:Name="LoadCircuitButton" Click="LoadCircuitButton_Click">
<TextBlock TextTrimming="CharacterEllipsis">Load Schematic</TextBlock>
</Button>
</DockPanel>
<UniformGrid DockPanel.Dock="Top" Columns="3" Margin="5,0">
<Button x:Name="ReloadCircuitButton" Click="ReloadCircuitButton_Click">
<TextBlock Margin="5,0,5,0">Reload</TextBlock>
</Button>
<Button DockPanel.Dock="Right" x:Name="ShowCircuitButton" Click="ShowCircuitButton_Click" HorizontalAlignment="Right">
<Button x:Name="ShowCircuitButton" Click="ShowCircuitButton_Click">
<TextBlock Margin="5,0,5,0">View</TextBlock>
</Button>
<Button x:Name="LoadCircuitButton" Click="LoadCircuitButton_Click" MaxWidth="200">
<TextBlock TextTrimming="CharacterEllipsis">Load Schematic</TextBlock>
<Button x:Name="ShowAboutButton" Click="ShowAboutButton_Click">
<TextBlock Margin="5,0,5,0">About</TextBlock>
</Button>
</DockPanel>
</UniformGrid>
<StackPanel DockPanel.Dock="Top" Orientation="Horizontal" HorizontalAlignment="Center" Margin="5" UseLayoutRounding="True">
<StackPanel.Resources>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="FontWeight" Value="Bold" />
<Setter Property="Margin" Value="10,0,5,0"/>
</Style>
</StackPanel.Resources>
<TextBlock>Oversample:</TextBlock>
<TextBlock VerticalAlignment="Center">Oversample:</TextBlock>
<ComboBox x:Name="OversampleComboBox" SelectionChanged="OversampleComboBox_SelectionChanged">
<ComboBoxItem>1</ComboBoxItem>
<ComboBoxItem>2</ComboBoxItem>
<ComboBoxItem>4</ComboBoxItem>
<ComboBoxItem>8</ComboBoxItem>
</ComboBox>
<TextBlock>Iterations:</TextBlock>
<TextBlock VerticalAlignment="Center">Iterations:</TextBlock>
<ComboBox x:Name="IterationsComboBox" SelectionChanged="IterationsComboBox_SelectionChanged">
<ComboBoxItem>1</ComboBoxItem>
<ComboBoxItem>2</ComboBoxItem>
Expand Down
13 changes: 13 additions & 0 deletions LiveSPICEVst/EditorView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,19 @@ private void ShowAboutButton_Click(object sender, RoutedEventArgs e)
about.ShowDialog();
}

private void ReloadCircuitButton_Click(object sender, RoutedEventArgs e)
{
if (string.IsNullOrEmpty(Plugin.SchematicPath))
{
return;
}

Plugin.LoadSchematic(Plugin.SchematicPath);

UpdateSchematic();
}


private void ShowCircuitButton_Click(object sender, RoutedEventArgs e)
{
if (Plugin.SimulationProcessor.Schematic != null)
Expand Down

0 comments on commit 0bab2a3

Please sign in to comment.