Skip to content

Commit

Permalink
progress
Browse files Browse the repository at this point in the history
  • Loading branch information
HendrikMennen committed Nov 15, 2023
1 parent b933be0 commit 8476c37
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 44 deletions.
1 change: 1 addition & 0 deletions src/OneWare.Core/App.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ protected override AvaloniaObject CreateShell()
windowService.RegisterMenuItem("MainWindow_MainMenu/Extras", new MenuItemModel("Settings")
{
Header = $"Settings",
ImageIconObservable = Current?.GetResourceObservable("Material.SettingsOutline"),
Command = new RelayCommand(() => windowService.Show(new ApplicationSettingsView()
{
DataContext = ContainerLocator.Container.Resolve<ApplicationSettingsViewModel>()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Collections.ObjectModel;
using System.Reactive.Linq;
using System.Runtime.InteropServices;
using Avalonia.Threading;
using OneWare.Shared;
using OneWare.Shared.Enums;
using OneWare.Shared.Helpers;
Expand Down Expand Up @@ -38,14 +39,14 @@ public TerminalManagerViewModel(ISettingsService settingsService, IDockService d
Title = "Terminal";
Id = "Terminal";

// settingsService.GetSettingObservable<string>("General_SelectedTheme").Throttle(TimeSpan.FromMilliseconds(5))
// .Subscribe(x => Dispatcher.UIThread.Post(() =>
// {
// foreach (var t in Terminals)
// {
// t.Terminal.Redraw();
// }
// }));
settingsService.GetSettingObservable<string>("General_SelectedTheme").Throttle(TimeSpan.FromMilliseconds(5))
.Subscribe(x => Dispatcher.UIThread.Post(() =>
{
foreach (var t in Terminals)
{
t.Terminal.Redraw();
}
}));
}

public override void InitializeContent()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,14 @@ public string SearchTextNodes
set => SetProperty(ref _searchTextNodes, value);
}

public event EventHandler NodeConnected;
public event EventHandler? NodeConnected;

public event EventHandler NodeDisconnected;
public event EventHandler? NodeDisconnected;

public FpgaModelBase()
{
ConnectCommand = new RelayCommand(ConnectSelected, () => SelectedNode is not null && SelectedPin is not null);
ConnectCommand = new RelayCommand(ConnectSelected, () => SelectedNode is { Connection: null }
&& SelectedPin is { Connection :null });

DisconnectCommand = new RelayCommand(DisconnectSelected, () => SelectedPin is {Connection: not null});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
x:DataType="viewModels:UniversalFpgaProjectCompileViewModel"
Name="UniversalFpgaProjectCompileViewView">
<Interaction.Behaviors>
<behaviours:CommandOnEnterBehaviour Command="{Binding SelectedFpga.ConnectCommand, FallbackValue={x:Null}}"/>
<behaviours:CommandOnEnterBehaviour Command="{Binding SelectedFpga.ConnectCommand, FallbackValue={x:Null}}" />
</Interaction.Behaviors>

<Grid RowDefinitions="*, Auto">
Expand All @@ -41,64 +41,82 @@
Content="{Binding }" />

<Grid ColumnDefinitions="*, 70, *" RowDefinitions="20, *" DockPanel.Dock="Top">

<TextBlock Grid.Row="0" Grid.Column="0" Text="Pins:"></TextBlock>
<Border Grid.Column="0" Grid.Row="1" Background="{DynamicResource ThemeControlLowBrush}" BorderThickness="1" BorderBrush="{DynamicResource ThemeBorderLowBrush}">
<Border Grid.Column="0" Grid.Row="1" Background="{DynamicResource ThemeControlLowBrush}"
BorderThickness="1" BorderBrush="{DynamicResource ThemeBorderLowBrush}">
<DockPanel Background="{DynamicResource ThemeControlLowBrush}">
<controls:SearchBox DockPanel.Dock="Top" VerticalAlignment="Center"
Background="{DynamicResource ThemeBackgroundBrush}"
SearchText="{Binding SearchTextPins}"
VerticalContentAlignment="Center" SearchButtonVisible="False" />
<DataGrid Name="VisiblePinDataGrid" CanUserSortColumns="False" CanUserReorderColumns="False" CanUserResizeColumns="True"
Background="{DynamicResource ThemeControlLowBrush}"
RowBackground="Transparent" IsReadOnly="True"
<DataGrid Name="VisiblePinDataGrid" CanUserSortColumns="False"
CanUserReorderColumns="False" CanUserResizeColumns="True"
Background="{DynamicResource ThemeControlLowBrush}"
RowBackground="Transparent" IsReadOnly="True"
ItemsSource="{Binding VisiblePins}"
SelectedItem="{Binding SelectedPin}"
BorderThickness="0"
BorderThickness="0 1 0 0"
VerticalScrollBarVisibility="Visible">
<DataGrid.Columns>
<DataGridTextColumn Header="Pin" Width="*" Binding="{Binding Name}"/>
<DataGridTextColumn Header="Description" Width="*" Binding="{Binding Description}"/>
<DataGridTextColumn Header="Node" Width="*" Binding="{Binding Connection.Name, FallbackValue={}}"/>
<DataGridTextColumn Header="Pin" Width="*" Binding="{Binding Name}" />
<DataGridTextColumn Header="Description" Width="*"
Binding="{Binding Description}" />
<DataGridTextColumn Header="Node" Width="*"
Binding="{Binding Connection.Name, FallbackValue={}}" />
</DataGrid.Columns>
</DataGrid>
</DockPanel>
</Border>

<Border Grid.Column="1" Grid.Row="1" Background="{DynamicResource ThemeBackgroundBrush}">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" Spacing="15">
<Button Command="{Binding ConnectCommand}" Classes="BorderButton" Height="40" Width="40" CornerRadius="5">
<Image Source="{DynamicResource VSImageLib2019.Plugged_16x}" Height="25" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Button>
<Button Command="{Binding DisconnectCommand}" Classes="BorderButton" Height="40" Width="40" CornerRadius="5">
<Image Source="{DynamicResource VSImageLib2019.Unplugged_16x}" Height="25" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Button>
</StackPanel>
</Border>


<Border Grid.Column="1" Grid.Row="1" Background="{DynamicResource ThemeBackgroundBrush}">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" Spacing="30">
<Button Command="{Binding ConnectCommand}" Classes="BorderButton" Height="40"
ToolTip.Tip="Connect" Width="40" CornerRadius="5">
<Button.RenderTransform>
<RotateTransform Angle="45"></RotateTransform>
</Button.RenderTransform>
<Image Source="{DynamicResource VSImageLib2019.Plugged_16x}" Height="25"
HorizontalAlignment="Center" VerticalAlignment="Center" />
</Button>
<Button Command="{Binding DisconnectCommand}" Classes="BorderButton" Height="40"
ToolTip.Tip="Disconnect" Width="40" CornerRadius="5">
<Button.RenderTransform>
<RotateTransform Angle="45"></RotateTransform>
</Button.RenderTransform>
<Image Source="{DynamicResource VSImageLib2019.Unplugged_16x}" Height="25"
HorizontalAlignment="Center" VerticalAlignment="Center" />
</Button>
</StackPanel>
</Border>

<TextBlock Grid.Row="0" Grid.Column="2" Text="Nodes:"></TextBlock>
<Border Grid.Column="2" Grid.Row="1" Background="{DynamicResource ThemeControlLowBrush}" BorderThickness="1" BorderBrush="{DynamicResource ThemeBorderLowBrush}">
<Border Grid.Column="2" Grid.Row="1" Background="{DynamicResource ThemeControlLowBrush}"
BorderThickness="1" BorderBrush="{DynamicResource ThemeBorderLowBrush}">
<DockPanel Background="{DynamicResource ThemeControlLowBrush}">
<controls:SearchBox DockPanel.Dock="Top" VerticalAlignment="Center"
Background="{DynamicResource ThemeBackgroundBrush}"
VerticalContentAlignment="Center" SearchButtonVisible="False" SearchText="{Binding SearchTextNodes}"/>
<DataGrid CanUserSortColumns="False" CanUserReorderColumns="False" CanUserResizeColumns="True"
Background="{DynamicResource ThemeControlLowBrush}"
RowBackground="Transparent" IsReadOnly="True"
VerticalContentAlignment="Center" SearchButtonVisible="False"
SearchText="{Binding SearchTextNodes}" />
<DataGrid CanUserSortColumns="False" CanUserReorderColumns="False"
CanUserResizeColumns="True"
Background="{DynamicResource ThemeControlLowBrush}"
RowBackground="Transparent" IsReadOnly="True"
ItemsSource="{Binding VisibleNodes}"
SelectedItem="{Binding SelectedNode}"
BorderThickness="0"
BorderThickness="0 1 0 0"
VerticalScrollBarVisibility="Visible">
<DataGrid.Columns>
<DataGridTextColumn Header="Node" Width="*" Binding="{Binding Name}"/>
<DataGridTextColumn Header="Direction" Width="*" Binding="{Binding Direction}"/>
<DataGridTextColumn Header="Pin" Width="*" Binding="{Binding Connection.Name, FallbackValue={}}"/>
<DataGridTextColumn Header="Node" Width="*" Binding="{Binding Name}" />
<DataGridTextColumn Header="Direction" Width="*" Binding="{Binding Direction}" />
<DataGridTextColumn Header="Pin" Width="*"
Binding="{Binding Connection.Name, FallbackValue={}}" />
</DataGrid.Columns>
</DataGrid>
</DockPanel>
</Border>
</Grid>

</Grid>
</DockPanel>
</Grid>
</Border>
Expand Down

0 comments on commit 8476c37

Please sign in to comment.