diff --git a/src/OneWare.PackageManager/Views/PackageManagerView.axaml b/src/OneWare.PackageManager/Views/PackageManagerView.axaml index a8252e25..caf46724 100644 --- a/src/OneWare.PackageManager/Views/PackageManagerView.axaml +++ b/src/OneWare.PackageManager/Views/PackageManagerView.axaml @@ -88,7 +88,7 @@ Text="{Binding Package.Name}" /> <TextBlock Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="2" Text="{Binding Package.Description}" TextWrapping="Wrap" /> - <StackPanel Grid.Row="0" Grid.Column="1" Spacing="5" Orientation="Horizontal"> + <StackPanel Grid.Row="0" Grid.Column="1" Spacing="10" Orientation="Horizontal"> <TextBlock Text="{Binding SelectedVersion.Version}" Foreground="{DynamicResource ThemeForegroundLowBrush}"/> <Button Content="{Binding PrimaryButtonText}" Background="{Binding PrimaryButtonBrush}" diff --git a/src/OneWare.Shared/Converters/BoolToOpacityConverter.cs b/src/OneWare.Shared/Converters/BoolToOpacityConverter.cs new file mode 100644 index 00000000..5ad8a549 --- /dev/null +++ b/src/OneWare.Shared/Converters/BoolToOpacityConverter.cs @@ -0,0 +1,18 @@ +using System.Globalization; +using Avalonia.Data.Converters; + +namespace OneWare.Shared.Converters; + +public class BoolToOpacityConverter : IValueConverter +{ + public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture) + { + if (value is bool t && t) return 1d; + return 0d; + } + + public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } +} \ No newline at end of file diff --git a/src/OneWare.Shared/Converters/SharedConverters.cs b/src/OneWare.Shared/Converters/SharedConverters.cs index 99bdd05a..6a874a8a 100644 --- a/src/OneWare.Shared/Converters/SharedConverters.cs +++ b/src/OneWare.Shared/Converters/SharedConverters.cs @@ -4,6 +4,8 @@ namespace OneWare.Shared.Converters; public static class SharedConverters { + public static readonly IValueConverter + BoolToOpacityConverter = new BoolToOpacityConverter(); public static readonly IValueConverter BoolToScrollBarVisibilityConverter = new BoolToScrollBarVisibilityConverter(); public static readonly IValueConverter ComparisonConverter = new ComparisonConverter(); @@ -18,4 +20,5 @@ public static readonly IValueConverter public static readonly IValueConverter PathToWindowIconConverter = new PathToWindowIconConverter(); public static readonly PathToBitmapConverter PathToBitmapConverter = new(); public static readonly IMultiValueConverter PathsEqualConverter = new PathsEqualConverter(); + public static readonly IMultiValueConverter ObjectsEqualConverter = new ObjectsEqualConverter(); } \ No newline at end of file diff --git a/src/OneWare.Shared/OneWare.Shared.csproj b/src/OneWare.Shared/OneWare.Shared.csproj index 6eee3ec5..3d974047 100644 --- a/src/OneWare.Shared/OneWare.Shared.csproj +++ b/src/OneWare.Shared/OneWare.Shared.csproj @@ -9,4 +9,7 @@ <Import Project="..\..\build\props\AvaloniaEdit.TextMate.props"/> <Import Project="..\..\build\props\Asmichi.ChildProcess.props"/> <Import Project="..\..\build\props\NodeEditorAvalonia.props"/> + <ItemGroup> + <UpToDateCheckInput Remove="Styles\Components.axaml" /> + </ItemGroup> </Project> diff --git a/src/OneWare.UniversalFpgaProjectSystem/Models/FpgaModel.cs b/src/OneWare.UniversalFpgaProjectSystem/Models/FpgaModel.cs index 84393582..451e3731 100644 --- a/src/OneWare.UniversalFpgaProjectSystem/Models/FpgaModel.cs +++ b/src/OneWare.UniversalFpgaProjectSystem/Models/FpgaModel.cs @@ -1,6 +1,31 @@ -namespace OneWare.UniversalFpgaProjectSystem.Models; +using CommunityToolkit.Mvvm.ComponentModel; -public class FpgaModel +namespace OneWare.UniversalFpgaProjectSystem.Models; + +public class FpgaModel : ObservableObject { + public string Name { get; } + + public Dictionary<string, FpgaPin> AvailablePins { get; } = new(); + + private CompileConnectionModel _selectedConnection; + private FpgaPin _selectedPin; + public FpgaPin SelectedPin + { + get => _selectedPin; + set => this.SetProperty(ref _selectedPin, value); + } + + private CompileSignalModel _selectedSignal; + + public FpgaModel(string name) + { + Name = name; + } + + public override string ToString() + { + return Name; + } } \ No newline at end of file diff --git a/src/OneWare.UniversalFpgaProjectSystem/Models/FpgaPin.cs b/src/OneWare.UniversalFpgaProjectSystem/Models/FpgaPin.cs new file mode 100644 index 00000000..7a8d41f0 --- /dev/null +++ b/src/OneWare.UniversalFpgaProjectSystem/Models/FpgaPin.cs @@ -0,0 +1,43 @@ +using CommunityToolkit.Mvvm.ComponentModel; + +namespace OneWare.UniversalFpgaProjectSystem.Models; + +public class FpgaPin : ObservableObject +{ + public FpgaModel Parent { get; } + public string Name { get; } + + private string _description; + public string Description + { + get => _description; + set => SetProperty(ref _description, value); + } + + private string _toolTipText; + public string ToolTipText + { + get => _toolTipText; + set => SetProperty(ref _toolTipText, value); + } + + private CompileSignalModel _connection; + public CompileSignalModel Connection + { + get => _connection; + set + { + this.SetProperty(ref _connection, value); + if (_connection == null) ToolTipText = "Click to connect " + Name; + else ToolTipText = Name + " is connected with " + _connection.Name; + } + } + + public CompilePinModel(string name, string description, FpgaModel parent) + { + Name = name; + Description = description; + Connection = null; + Parent = parent; + } +} \ No newline at end of file diff --git a/src/OneWare.UniversalFpgaProjectSystem/OneWare.UniversalFpgaProjectSystem.csproj b/src/OneWare.UniversalFpgaProjectSystem/OneWare.UniversalFpgaProjectSystem.csproj index ca248094..6b06e5ad 100644 --- a/src/OneWare.UniversalFpgaProjectSystem/OneWare.UniversalFpgaProjectSystem.csproj +++ b/src/OneWare.UniversalFpgaProjectSystem/OneWare.UniversalFpgaProjectSystem.csproj @@ -15,4 +15,8 @@ <SubType>Code</SubType> </Compile> </ItemGroup> + + <ItemGroup> + <AdditionalFiles Include="Styles\Components.axaml" /> + </ItemGroup> </Project> diff --git a/src/OneWare.UniversalFpgaProjectSystem/Styles/Components.axaml b/src/OneWare.UniversalFpgaProjectSystem/Styles/Components.axaml new file mode 100644 index 00000000..e614168b --- /dev/null +++ b/src/OneWare.UniversalFpgaProjectSystem/Styles/Components.axaml @@ -0,0 +1,215 @@ +<Styles xmlns="https://github.com/avaloniaui" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:models="clr-namespace:OneWare.UniversalFpgaProjectSystem.Models" + xmlns:views="clr-namespace:OneWare.UniversalFpgaProjectSystem.Views" + xmlns:viewModels="clr-namespace:OneWare.UniversalFpgaProjectSystem.ViewModels" + xmlns:converters="clr-namespace:OneWare.Shared.Converters;assembly=OneWare.Shared"> + + <Styles.Resources> + <SolidColorBrush x:Key="SelectionColorPin" Opacity="1" Color="{DynamicResource ThemeForegroundColor}" /> + <SolidColorBrush x:Key="SelectionColorConnected" Opacity="1" Color="#d4d4d4" /> + <Thickness x:Key="SelectedThickness">3</Thickness> + <Thickness x:Key="NormalThickness">1</Thickness> + </Styles.Resources> + + <Style Selector="Button.YellowGreen"> + <Setter Property="Background" Value="YellowGreen" /> + </Style> + <Style Selector="Button.Cyan"> + <Setter Property="Background" Value="Cyan" /> + </Style> + <Style Selector="Button.Orange"> + <Setter Property="Background" Value="Orange" /> + </Style> + <Style Selector="Button.V5"> + <Setter Property="Background" Value="#FF0033" /> + </Style> + + <Style Selector="Button:disabled"> + <Setter Property="Opacity" Value="1" /> + <Setter Property="BorderThickness" Value="1" /> + </Style> + + <Style Selector="Button.Connectable:pointerover"> + <Setter Property="Background" Value="#222222" /> + </Style> + + <Style Selector="TextBlock"> + <Setter Property="Height" Value="15" /> + <Setter Property="FontSize" Value="12" /> + </Style> + <Style Selector="TextBlock.Vert"> + <Setter Property="RenderTransform"> + <Setter.Value> + <RotateTransform Angle="270" /> + </Setter.Value> + </Setter> + </Style> + <Style Selector="Button:pressed /template/ ContentPresenter"> + <Setter Property="Background" Value="Black" /> + <Setter Property="BorderThickness" Value="1" /> + </Style> + + <Style Selector="Button"> + <Setter Property="Margin" Value="0" /> + <Setter Property="Width" Value="12" /> + <Setter Property="Height" Value="12" /> + <Setter Property="BorderThickness" Value="1" /> + <Setter Property="Background" Value="Yellow" /> + <Setter Property="BorderBrush" Value="{DynamicResource ThemeBorderLowBrush}" /> + <Setter Property="Padding" Value="0" /> + </Style> + + <Style Selector="Button.Unconnectable"> + <Setter Property="Template"> + <ControlTemplate> + <Border Name="PinBorder" Background="{TemplateBinding Background}" + BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{DynamicResource ThemeBorderLowBrush}"> + <Grid> + <ContentPresenter Content="{TemplateBinding Content}" HorizontalAlignment="Center" + VerticalAlignment="Center" Margin="0,0,0,0" /> + </Grid> + </Border> + </ControlTemplate> + </Setter> + </Style> + + <Style Selector="Menu.BindMenu > MenuItem > Panel > TextBlock"> + <Setter Property="Foreground" Value="White" /> + </Style> + + <Style Selector="Menu.BindMenu > MenuItem:pointerover > Border#root"> + <Setter Property="Background" Value="Transparent" /> + </Style> + + <Style Selector="Menu.BindMenu > MenuItem:selected > Border#root"> + <Setter Property="Background" Value="Transparent" /> + </Style> + + <Style Selector="Border.CruviExtension"> + <Setter Property="Opacity" + Value="{Binding !!$parent[views:UniversalFpgaProjectCompileView].((viewModels:UniversalFpgaProjectCompileViewModel)DataContext).HideExtensions, + Converter={x:Static converters:SharedConverters.BoolToOpacityConverter}}" /> + <Setter Property="IsHitTestVisible" Value="{Binding !$parent[views:UniversalFpgaProjectCompileView].((viewModels:UniversalFpgaProjectCompileViewModel)DataContext).HideExtensions}" /> + <Setter Property="Transitions"> + <Transitions> + <DoubleTransition Property="Opacity" Duration="0:0:0.1" /> + </Transitions> + </Setter> + </Style> + + <Style Selector="Button.Connectable" x:DataType="models:FpgaPin" x:CompileBindings="True"> + <Setter Property="Cursor" Value="Hand" /> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate> + <Grid> + <Border Name="PinBorder" Padding="0" Background="{TemplateBinding Background}" + BorderThickness="{TemplateBinding BorderThickness}" + BorderBrush="{DynamicResource ThemeBorderLowBrush}"> + <Grid> + <ContentPresenter Content="{TemplateBinding Content}" HorizontalAlignment="Center" + VerticalAlignment="Center" Margin="0,0,0,0" /> + <Interaction.Behaviors> + <DataTriggerBehavior ComparisonCondition="Equal" Value="True"> + <DataTriggerBehavior.Binding> + <MultiBinding Converter="{x:Static converters:SharedConverters.ObjectsEqualConverter}"> + <Binding Path="Parent.SelectedPin" /> + <Binding Path="#PinBorder.DataContext"/> + </MultiBinding> + </DataTriggerBehavior.Binding> + <ChangePropertyAction TargetObject="{Binding #PinBorder}" + PropertyName="BorderBrush" + Value="{StaticResource SelectionColorPin}" /> + <ChangePropertyAction TargetObject="{Binding #PinBorder}" + PropertyName="BorderThickness" + Value="{StaticResource SelectedThickness}" /> + </DataTriggerBehavior> + <DataTriggerBehavior ComparisonCondition="Equal" Value="False"> + <DataTriggerBehavior.Binding> + <MultiBinding Converter="{x:Static converters:SharedConverters.ObjectsEqualConverter}"> + <Binding Path="Parent.SelectedPin" /> + <Binding Path="#PinBorder.DataContext"/> + </MultiBinding> + </DataTriggerBehavior.Binding> + <ChangePropertyAction TargetObject="{Binding #PinBorder}" + PropertyName="BorderBrush" + Value="{DynamicResource ThemeBorderLowBrush}" /> + <ChangePropertyAction TargetObject="{Binding #PinBorder}" + PropertyName="BorderThickness" + Value="{StaticResource NormalThickness}" /> + </DataTriggerBehavior> + + <DataTriggerBehavior ComparisonCondition="Equal" Value="True"> + <DataTriggerBehavior.Binding> + <MultiBinding Converter="{x:Static converters:SharedConverters.ObjectsEqualConverter}"> + <Binding Path="Parent.SelectedConnection.Pin" /> + <Binding Path="#PinBorder.DataContext"/> + </MultiBinding> + </DataTriggerBehavior.Binding> + <ChangePropertyAction TargetObject="{Binding #PinBorder}" + PropertyName="BorderBrush" + Value="{StaticResource SelectionColorConnected}" /> + <ChangePropertyAction TargetObject="{Binding #PinBorder}" + PropertyName="BorderThickness" + Value="{StaticResource SelectedThickness}" /> + </DataTriggerBehavior> + <DataTriggerBehavior ComparisonCondition="Equal" Value="False"> + <DataTriggerBehavior.Binding> + <MultiBinding Converter="{x:Static converters:SharedConverters.ObjectsEqualConverter}"> + <Binding Path="Parent.SelectedConnection.Pin" /> + <Binding Path="#PinBorder.DataContext"/> + </MultiBinding> + </DataTriggerBehavior.Binding> + <ChangePropertyAction TargetObject="{Binding #PinBorder}" + PropertyName="BorderBrush" + Value="{DynamicResource ThemeBorderLowBrush}" /> + <ChangePropertyAction TargetObject="{Binding #PinBorder}" + PropertyName="BorderThickness" + Value="{StaticResource NormalThickness}" /> + </DataTriggerBehavior> + </Interaction.Behaviors> + </Grid> + </Border> + <Border Name="ConnectedRectangle" + IsVisible="{Binding Connection, Converter={x:Static ObjectConverters.IsNotNull}}" + Background="Black" BorderBrush="Transparent" BorderThickness="2" Opacity="0.8" /> + </Grid> + </ControlTemplate> + </Setter.Value> + </Setter> + <Setter Property="Command" Value="{Binding Parent.SelectPin}"/> + <Setter Property="CommandParameter" Value="{Binding Name}" /> + <Setter Property="ToolTip.Tip" Value="{Binding ToolTipText}" /> + </Style> + + <Style Selector="Button:pointerover" /> + + <Style Selector="Button.Connectable:pointerover"> + <Setter Property="Background" Value="#353535" /> + </Style> + + + <Style Selector="TextBlock.VertLeft, Image.VertLeft, Menu.VertLeft, Button.VertLeft, Grid.VertLeft"> + <Setter Property="RenderTransform"> + <Setter.Value> + <RotateTransform Angle="90" /> + </Setter.Value> + </Setter> + </Style> + <Style Selector="TextBlock.VertRight, Image.VertRight, Menu.VertRight, Button.VertRight, Grid.VertRight"> + <Setter Property="RenderTransform"> + <Setter.Value> + <RotateTransform Angle="270" /> + </Setter.Value> + </Setter> + </Style> + + <Style Selector="Rectangle.Diag, Button.Diag"> + <Setter Property="RenderTransform"> + <Setter.Value> + <RotateTransform Angle="45" /> + </Setter.Value> + </Setter> + </Style> +</Styles> diff --git a/src/OneWare.UniversalFpgaProjectSystem/ViewModels/UniversalFpgaProjectCompileViewModel.cs b/src/OneWare.UniversalFpgaProjectSystem/ViewModels/UniversalFpgaProjectCompileViewModel.cs index 537ca6e2..548fe456 100644 --- a/src/OneWare.UniversalFpgaProjectSystem/ViewModels/UniversalFpgaProjectCompileViewModel.cs +++ b/src/OneWare.UniversalFpgaProjectSystem/ViewModels/UniversalFpgaProjectCompileViewModel.cs @@ -1,5 +1,6 @@ using System.Collections.ObjectModel; using CommunityToolkit.Mvvm.ComponentModel; +using OneWare.Shared.Controls; using OneWare.UniversalFpgaProjectSystem.Models; namespace OneWare.UniversalFpgaProjectSystem.ViewModels; @@ -11,12 +12,34 @@ public class UniversalFpgaProjectCompileViewModel : ObservableObject public ObservableCollection<FpgaModel> FpgaModels { get; } = new(); + private FpgaModel? _selectedFpgaModel; + public FpgaModel? SelectedFpgaModel + { + get => _selectedFpgaModel; + set => SetProperty(ref _selectedFpgaModel, value); + } + public ObservableCollection<string> Signals { get; } = new(); public ObservableCollection<string> Pins { get; } = new(); + + private bool _hideExtensions = false; + public bool HideExtensions + { + get => _hideExtensions; + set => SetProperty(ref _hideExtensions, value); + } public UniversalFpgaProjectCompileViewModel(UniversalFpgaProjectRoot project) { _project = project; + + FpgaModels.Add(new FpgaModel("Max 10")); + SelectedFpgaModel = FpgaModels.First(); + } + + public async Task SaveAsync(FlexibleWindow window) + { + } } \ No newline at end of file diff --git a/src/OneWare.UniversalFpgaProjectSystem/Views/IceBreakerV1_0e.axaml b/src/OneWare.UniversalFpgaProjectSystem/Views/IceBreakerV1_0e.axaml new file mode 100644 index 00000000..86145bb4 --- /dev/null +++ b/src/OneWare.UniversalFpgaProjectSystem/Views/IceBreakerV1_0e.axaml @@ -0,0 +1,405 @@ +<UserControl xmlns="https://github.com/avaloniaui" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:models="clr-namespace:OneWare.UniversalFpgaProjectSystem.Models" + mc:Ignorable="d" + d:DesignHeight="500" + d:DesignWidth="1000" + x:Class="OneWare.UniversalFpgaProjectSystem.Views.IceBreakerV1_0e" x:DataType="models:FpgaModel" + x:CompileBindings="True"> + + + <UserControl.Styles> + <StyleInclude Source="avares://VHDPlus/Styles/Components.axaml" /> + </UserControl.Styles> + + <Design.DataContext> + <models:FpgaModel /> + </Design.DataContext> + + <Grid HorizontalAlignment="Center" RowDefinitions="Auto,Auto" ColumnDefinitions="Auto, Auto, 20,Auto, Auto"> + <Border Grid.Row="0" Grid.Column="1" Background="#1c1c1c" Height="30" Width="90" Margin="44 0 0 -5" + HorizontalAlignment="Left" VerticalAlignment="Bottom"> + <Grid> + <Menu x:CompileBindings="False" Classes="CruviLSPMOD BindMenu" DragDrop.AllowDrop="True" + DataContext="{Binding CruviLsInterfaces[0]}" Margin="0,0,0,0" HorizontalAlignment="Left" + VerticalAlignment="Center"> + <MenuItem Padding="0" x:DataType="cruviExtensions:CruviLsModel" Cursor="Hand" + Items="{Binding InterfaceMenu}" VerticalAlignment="Bottom"> + <MenuItem.Header> + <Grid> + <Rectangle Fill="#202020" Height="20" Width="60" HorizontalAlignment="Center" /> + <TextBlock Text="PMOD" Foreground="White" HorizontalAlignment="Center" + VerticalAlignment="Bottom" Height="15" TextAlignment="Center" Width="90" /> + </Grid> + </MenuItem.Header> + </MenuItem> + </Menu> + </Grid> + </Border> + + <Border Grid.Row="0" Grid.Column="1" Background="#1c1c1c" Height="30" Width="90" Margin="0 0 46 -5" + HorizontalAlignment="Right" VerticalAlignment="Bottom"> + <Grid> + <Menu x:CompileBindings="False" Classes="CruviLSPMOD BindMenu" DragDrop.AllowDrop="True" + DataContext="{Binding CruviLsInterfaces[1]}" Margin="0,0,0,0" HorizontalAlignment="Left" + VerticalAlignment="Center"> + <MenuItem Padding="0" x:DataType="cruviExtensions:CruviLsModel" Cursor="Hand" + Items="{Binding InterfaceMenu}" VerticalAlignment="Bottom"> + <MenuItem.Header> + <Grid> + <Rectangle Fill="#202020" Height="20" Width="60" HorizontalAlignment="Center" /> + <TextBlock Text="PMOD" Foreground="White" HorizontalAlignment="Center" + VerticalAlignment="Bottom" Height="15" TextAlignment="Center" Width="90" /> + </Grid> + </MenuItem.Header> + </MenuItem> + </Menu> + </Grid> + </Border> + + <Image Grid.Row="1" Grid.Column="0" Source="{DynamicResource Entypo+.ArrowLongLeft}" Margin="0, 0, 2, 20" + Height="20" + Width="20" HorizontalAlignment="Right" VerticalAlignment="Center" /> + <Image Grid.Row="1" Grid.Column="0" Source="{DynamicResource Entypo+.ArrowLongRight}" Margin="0, 20, 2, 0" + Height="20" + Width="20" HorizontalAlignment="Right" VerticalAlignment="Center" /> + <Button Grid.Row="1" Grid.Column="0" DataContext="{Binding AvailablePins[9]}" Classes="Connectable" + HorizontalAlignment="Right" VerticalAlignment="Center" Height="17" Width="24" Background="Blue" + BorderBrush="{DynamicResource ThemeBorderLowBrush}" BorderThickness="1" Margin="0, 0, 22, 20" + Content="TX" + Foreground="White" /> + <Button Grid.Row="1" Grid.Column="0" DataContext="{Binding AvailablePins[6]}" Classes="Connectable" + HorizontalAlignment="Right" VerticalAlignment="Center" Height="17" Width="24" Background="Red" + BorderBrush="{DynamicResource ThemeBorderLowBrush}" BorderThickness="1" Margin="0, 20, 22, 0" + Content="RX" + Foreground="White" /> + + <TextBlock Grid.Row="1" Grid.Column="0" Text="Power LED" HorizontalAlignment="Right" Margin="0 0 5 86"></TextBlock> + <TextBlock Grid.Row="1" Grid.Column="0" Text="User Button" HorizontalAlignment="Right" Margin="0 86 5 0"></TextBlock> + + <Border Grid.Row="1" Grid.Column="1" Background="#2F4362" Width="300" Height="180" CornerRadius="10"> + <Grid> + <TextBlock FontSize="13" FontWeight="Bold" Text="iCEBreaker" Width="80" Margin="100 40 0 0" + TextAlignment="Center" + HorizontalAlignment="Left" VerticalAlignment="Top" /> + <TextBlock FontSize="13" FontWeight="Bold" Text="v1.0e" Width="80" Margin="100 54 0 0" + TextAlignment="Center" + HorizontalAlignment="Left" VerticalAlignment="Top" /> + <Button Classes="Diag" ToolTip.Tip="Lattice iCE40UP5k" Background="Black" Foreground="White" Width="45" + Height="45" VerticalAlignment="Center" Padding="0" HorizontalAlignment="Right" + Margin="0, 0, 90, 0" /> + <Button Content="FTDI" ToolTip.Tip="FTDI FT2232HQ" Background="Black" Foreground="White" Width="55" + Height="55" VerticalAlignment="Center" Padding="0" HorizontalAlignment="Left" + Margin="65, 0, 0, 0" /> + <Button ToolTip.Tip="Winbond W25Q128" Background="Black" Foreground="White" Width="30" + Height="30" VerticalAlignment="Bottom" Padding="0" HorizontalAlignment="Center" + Margin="75, 0, 0, 25" /> + <TextBlock Foreground="White" VerticalAlignment="Center" Padding="0" HorizontalAlignment="Right" + Margin="0, 0, 90,0" Text="FPGA" IsHitTestVisible="False" Width="45" TextAlignment="Center" /> + <TextBlock Foreground="White" VerticalAlignment="Top" Padding="0" HorizontalAlignment="Left" + Margin="20, 30, 0,0" Text="CLK" /> + <Button DataContext="{Binding AvailablePins[35]}" Classes="Connectable" Background="Black" + Width="15" Height="12" VerticalAlignment="Top" Padding="0" HorizontalAlignment="Left" + Margin="24, 44, 0, 0" /> + + <Ellipse Fill="{DynamicResource ThemeBackgroundBrush}" Height="16" Width="16" VerticalAlignment="Top" + HorizontalAlignment="Left" Margin="5" /> + <Ellipse Fill="{DynamicResource ThemeBackgroundBrush}" Height="16" Width="16" + VerticalAlignment="Bottom" + HorizontalAlignment="Left" Margin="5" /> + <Ellipse Fill="{DynamicResource ThemeBackgroundBrush}" Height="16" Width="16" VerticalAlignment="Top" + HorizontalAlignment="Right" Margin="5" /> + <Ellipse Fill="{DynamicResource ThemeBackgroundBrush}" Height="16" Width="16" + VerticalAlignment="Bottom" + HorizontalAlignment="Right" Margin="5" /> + + <Rectangle Fill="Gray" Margin="-2 0 0 0" Width="25" Height="40" HorizontalAlignment="Left" + VerticalAlignment="Center" /> + <TextBlock Text="USB" Foreground="White" Classes="VertLeft" HorizontalAlignment="Left" + VerticalAlignment="Center" Margin="-2, 0, 2, 0" /> + + <Rectangle Fill="Gray" Width="14" Height="20" HorizontalAlignment="Left" VerticalAlignment="Bottom" + Margin="1, 0, 0, 40" /> + <Button DataContext="{Binding AvailablePins[10]}" Classes="Connectable" Background="#ffcc66" + Width="10" Height="14" HorizontalAlignment="Left" VerticalAlignment="Bottom" + Margin="3, 0, 0, 43" /> + + <Button Background="Lime" Width="10" Height="12" VerticalAlignment="Top" + HorizontalAlignment="Left" Margin="4, 48, 3, 23" /> + + <Button Background="Lime" Width="12" Height="10" VerticalAlignment="Bottom" + HorizontalAlignment="Left" Margin="25, 0, 0, 51" Classes="Connectable" + DataContext="{Binding AvailablePins[37]}" /> + + <Button Background="Red" Width="12" Height="10" VerticalAlignment="Bottom" + HorizontalAlignment="Left" Margin="25, 0, 0, 39" Classes="Connectable" + DataContext="{Binding AvailablePins[11]}" /> + + <Grid HorizontalAlignment="Right" VerticalAlignment="Center" RowDefinitions="12, 12, 12, 12, 12, 12" + ColumnDefinitions="30,12,12,4" Margin="0, 0, 0, 0"> + <!-- + <TextBlock Grid.Row="0" Text="P2_1" Foreground="White" /> + <TextBlock Grid.Row="1" Text="P2_2" Foreground="White" /> + <TextBlock Grid.Row="2" Text="P2_3" Foreground="White" /> + <TextBlock Grid.Row="3" Text="P2_4" Foreground="White" /> + <TextBlock Grid.Row="4" Text="GND" Foreground="White" /> + <TextBlock Grid.Row="5" Text="3.3V" Foreground="White" />--> + + <Button Grid.Row="0" Grid.Column="1" DataContext="{Binding AvailablePins[27]}" + Classes="Connectable" /> + <Button Grid.Row="1" Grid.Column="1" DataContext="{Binding AvailablePins[25]}" + Classes="Connectable" /> + <Button Grid.Row="2" Grid.Column="1" DataContext="{Binding AvailablePins[21]}" + Classes="Connectable" /> + <Button Grid.Row="3" Grid.Column="1" DataContext="{Binding AvailablePins[19]}" + Classes="Connectable" /> + <Button Grid.Row="4" Grid.Column="1" Background="#0094FF" IsEnabled="False" /> + <Button Grid.Row="5" Grid.Column="1" Background="#F97063" IsEnabled="False" /> + + <Button Grid.Row="0" Grid.Column="2" DataContext="{Binding AvailablePins[26]}" + Classes="Connectable" /> + <Button Grid.Row="1" Grid.Column="2" DataContext="{Binding AvailablePins[23]}" + Classes="Connectable" /> + <Button Grid.Row="2" Grid.Column="2" DataContext="{Binding AvailablePins[20]}" + Classes="Connectable" /> + <Button Grid.Row="3" Grid.Column="2" DataContext="{Binding AvailablePins[18]}" + Classes="Connectable" /> + <Button Grid.Row="4" Grid.Column="2" Background="#0094FF" IsEnabled="False" /> + <Button Grid.Row="5" Grid.Column="2" Background="#F97063" IsEnabled="False" /> + + <!-- + <TextBlock Grid.Row="0" Grid.Column="3" Text="P2_7" Foreground="White" /> + <TextBlock Grid.Row="1" Grid.Column="3" Text="P2_8" Foreground="White" /> + <TextBlock Grid.Row="2" Grid.Column="3" Text="P2_9" Foreground="White" /> + <TextBlock Grid.Row="3" Grid.Column="3" Text="P2_10" Foreground="White" /> + <TextBlock Grid.Row="4" Grid.Column="3" Text="GND" Foreground="White" /> + <TextBlock Grid.Row="5" Grid.Column="3" Text="3.3V" Foreground="White" />--> + </Grid> + + <Grid Classes="VertRight" HorizontalAlignment="Center" VerticalAlignment="Top" + RowDefinitions="12, 12, 12, 12, 12, 12" + ColumnDefinitions="0,12,12,0" Margin="0, -20, 120, 0"> + <Button Grid.Row="0" Grid.Column="1" DataContext="{Binding AvailablePins[4]}" + Classes="Connectable" /> + <Button Grid.Row="1" Grid.Column="1" DataContext="{Binding AvailablePins[2]}" + Classes="Connectable" /> + <Button Grid.Row="2" Grid.Column="1" DataContext="{Binding AvailablePins[47]}" + Classes="Connectable" /> + <Button Grid.Row="3" Grid.Column="1" DataContext="{Binding AvailablePins[45]}" + Classes="Connectable" /> + <Button Grid.Row="4" Grid.Column="1" Background="#0094FF" IsEnabled="False" /> + <Button Grid.Row="5" Grid.Column="1" Background="#F97063" IsEnabled="False" /> + + <Button Grid.Row="0" Grid.Column="2" DataContext="{Binding AvailablePins[3]}" + Classes="Connectable" /> + <Button Grid.Row="1" Grid.Column="2" DataContext="{Binding AvailablePins[48]}" + Classes="Connectable" /> + <Button Grid.Row="2" Grid.Column="2" DataContext="{Binding AvailablePins[46]}" + Classes="Connectable" /> + <Button Grid.Row="3" Grid.Column="2" DataContext="{Binding AvailablePins[44]}" + Classes="Connectable" /> + <Button Grid.Row="4" Grid.Column="2" Background="#0094FF" IsEnabled="False" /> + <Button Grid.Row="5" Grid.Column="2" Background="#F97063" IsEnabled="False" /> + </Grid> + + <Grid Classes="VertRight" HorizontalAlignment="Center" VerticalAlignment="Top" + ColumnDefinitions="0, 12, 12,0" + Margin="0, 10, 0, 0"> + <Button Grid.Column="1" Background="#F97063" IsEnabled="False" /> + <Button Grid.Column="2" Background="#0094FF" IsEnabled="False" /> + </Grid> + + <Grid Classes="VertRight" HorizontalAlignment="Center" VerticalAlignment="Top" + RowDefinitions="12, 12, 12, 12, 12, 12" + ColumnDefinitions="0,12,12,0" Margin="120, -20, 0, 0"> + <Button Grid.Row="0" Grid.Column="1" DataContext="{Binding AvailablePins[43]}" + Classes="Connectable" /> + <Button Grid.Row="1" Grid.Column="1" DataContext="{Binding AvailablePins[38]}" + Classes="Connectable" /> + <Button Grid.Row="2" Grid.Column="1" DataContext="{Binding AvailablePins[34]}" + Classes="Connectable" /> + <Button Grid.Row="3" Grid.Column="1" DataContext="{Binding AvailablePins[31]}" + Classes="Connectable" /> + <Button Grid.Row="4" Grid.Column="1" Background="#0094FF" IsEnabled="False" /> + <Button Grid.Row="5" Grid.Column="1" Background="#F97063" IsEnabled="False" /> + + <Button Grid.Row="0" Grid.Column="2" DataContext="{Binding AvailablePins[42]}" + Classes="Connectable" /> + <Button Grid.Row="1" Grid.Column="2" DataContext="{Binding AvailablePins[36]}" + Classes="Connectable" /> + <Button Grid.Row="2" Grid.Column="2" DataContext="{Binding AvailablePins[32]}" + Classes="Connectable" /> + <Button Grid.Row="3" Grid.Column="2" DataContext="{Binding AvailablePins[28]}" + Classes="Connectable" /> + <Button Grid.Row="4" Grid.Column="2" Background="#0094FF" IsEnabled="False" /> + <Button Grid.Row="5" Grid.Column="2" Background="#F97063" IsEnabled="False" /> + </Grid> + + <Grid Classes="VertRight" HorizontalAlignment="Center" VerticalAlignment="Bottom" + RowDefinitions="12, 12, 12, 12" + ColumnDefinitions="0,12,12,0" Margin="0, 0, 120, -8"> + <Button Grid.Row="0" Grid.Column="1" DataContext="{Binding AvailablePins[40]}" + Classes="Connectable" /> + <Button Grid.Row="1" Grid.Column="1" Background="#F97063" IsEnabled="False" /> + <Button Grid.Row="2" Grid.Column="1" Background="#0094FF" IsEnabled="False" /> + <Button Grid.Row="3" Grid.Column="1" Background="#F97063" IsEnabled="False" /> + + <Button Grid.Row="0" Grid.Column="2" DataContext="{Binding AvailablePins[39]}" + Classes="Connectable" /> + <Button Grid.Row="1" Grid.Column="2" DataContext="{Binding AvailablePins[41]}" + Classes="Connectable" /> + <Button Grid.Row="2" Grid.Column="2" Background="#0094FF" IsEnabled="False" /> + <Button Grid.Row="3" Grid.Column="2" Background="#F97063" IsEnabled="False" /> + </Grid> + + <Grid Classes="VertRight" HorizontalAlignment="Center" VerticalAlignment="Bottom" + RowDefinitions="12, 12, 12, 12, 12, 12, 12" + ColumnDefinitions="0,12,0" Margin="100, 0, 0, -31"> + <Button Grid.Row="0" Grid.Column="1" DataContext="{Binding AvailablePins[16]}" + Classes="Connectable" /> + <Button Grid.Row="1" Grid.Column="1" DataContext="{Binding AvailablePins[15]}" + Classes="Connectable" /> + <Button Grid.Row="2" Grid.Column="1" DataContext="{Binding AvailablePins[17]}" + Classes="Connectable" /> + <Button Grid.Row="3" Grid.Column="1" DataContext="{Binding AvailablePins[14]}" + Classes="Connectable" /> + <Button Grid.Row="4" Grid.Column="1" DataContext="{Binding AvailablePins[12]}" + Classes="Connectable" /> + <Button Grid.Row="5" Grid.Column="1" DataContext="{Binding AvailablePins[13]}" + Classes="Connectable" /> + <Button Grid.Row="6" Grid.Column="1" Background="#0094FF" IsEnabled="False" /> + </Grid> + </Grid> + </Border> + + <Grid Grid.Row="1" Grid.Column="2" Height="190"> + + <Border Background="#2F4362" Margin="0 50"></Border> + + <Border CornerRadius="50" Height="65" VerticalAlignment="Top" + Background="{DynamicResource ThemeBackgroundBrush}"> + </Border> + <Border CornerRadius="50" Height="40" Background="{DynamicResource ThemeBackgroundBrush}"></Border> + <Border CornerRadius="50" Height="65" VerticalAlignment="Bottom" + Background="{DynamicResource ThemeBackgroundBrush}"> + </Border> + </Grid> + + <Border Grid.Row="1" Grid.Column="3" Background="#2F4362" Width="100" Height="180" CornerRadius="10"> + <Grid> + <Ellipse Fill="{DynamicResource ThemeBackgroundBrush}" Height="16" Width="16" + VerticalAlignment="Center" + HorizontalAlignment="Center" Margin="0 0 0 70" /> + <Button DataContext="{Binding AvailablePins[23]}" Classes="Connectable" Background="Lime" + Width="14" Height="10" HorizontalAlignment="Center" VerticalAlignment="Center" + Margin="0 -30 0 0" /> + <Button DataContext="{Binding AvailablePins[27]}" Classes="Connectable" Background="Lime" + Width="10" Height="14" HorizontalAlignment="Center" VerticalAlignment="Center" + Margin="0 0 30 0" /> + <Button DataContext="{Binding AvailablePins[26]}" Classes="Connectable" Background="Red" + Width="10" Height="14" HorizontalAlignment="Center" VerticalAlignment="Center" /> + <Button DataContext="{Binding AvailablePins[25]}" Classes="Connectable" Background="Lime" + Width="10" Height="14" HorizontalAlignment="Center" VerticalAlignment="Center" + Margin="30 0 0 0" /> + <Button DataContext="{Binding AvailablePins[21]}" Classes="Connectable" Background="Lime" + Width="14" Height="10" HorizontalAlignment="Center" VerticalAlignment="Center" + Margin="0 30 0 0" /> + <Ellipse Fill="{DynamicResource ThemeBackgroundBrush}" Height="16" Width="16" + VerticalAlignment="Center" + HorizontalAlignment="Center" Margin="0 70 0 0" /> + + <Rectangle Fill="Gray" Width="20" Height="14" HorizontalAlignment="Right" VerticalAlignment="Center" + Margin="0, 0, 4, 70" /> + <Button DataContext="{Binding AvailablePins[20]}" Classes="Connectable" Background="#ffcc66" + Width="14" Height="10" HorizontalAlignment="Right" VerticalAlignment="Center" + Margin="0 0 7 70" /> + <Rectangle Fill="Gray" Width="20" Height="14" HorizontalAlignment="Right" VerticalAlignment="Center" + Margin="0, 0, 4, 0" /> + <Button DataContext="{Binding AvailablePins[19]}" Classes="Connectable" Background="#ffcc66" + Width="14" Height="10" HorizontalAlignment="Right" VerticalAlignment="Center" + Margin="0 0 7 0" /> + <Rectangle Fill="Gray" Width="20" Height="14" HorizontalAlignment="Right" VerticalAlignment="Center" + Margin="0, 70, 4, 0" /> + <Button DataContext="{Binding AvailablePins[18]}" Classes="Connectable" Background="#ffcc66" + Width="14" Height="10" HorizontalAlignment="Right" VerticalAlignment="Center" + Margin="0 70 7 0" /> + + <Grid HorizontalAlignment="Left" VerticalAlignment="Center" RowDefinitions="12, 12, 12, 12, 12, 12" + ColumnDefinitions="4,12,12,35" Margin="0, 0, 0, 0"> + <!-- + <TextBlock Grid.Row="0" Text="P2_1" Foreground="White" /> + <TextBlock Grid.Row="1" Text="P2_2" Foreground="White" /> + <TextBlock Grid.Row="2" Text="P2_3" Foreground="White" /> + <TextBlock Grid.Row="3" Text="P2_4" Foreground="White" /> + <TextBlock Grid.Row="4" Text="GND" Foreground="White" /> + <TextBlock Grid.Row="5" Text="3.3V" Foreground="White" />--> + + <Button Grid.Row="0" Grid.Column="1" DataContext="{Binding AvailablePins[26]}" + Classes="Connectable" /> + <Button Grid.Row="1" Grid.Column="1" DataContext="{Binding AvailablePins[23]}" + Classes="Connectable" /> + <Button Grid.Row="2" Grid.Column="1" DataContext="{Binding AvailablePins[20]}" + Classes="Connectable" /> + <Button Grid.Row="3" Grid.Column="1" DataContext="{Binding AvailablePins[18]}" + Classes="Connectable" /> + <Button Grid.Row="4" Grid.Column="1" Background="#0094FF" IsEnabled="False" /> + <Button Grid.Row="5" Grid.Column="1" Background="#F97063" IsEnabled="False" /> + + <Button Grid.Row="0" Grid.Column="2" DataContext="{Binding AvailablePins[27]}" + Classes="Connectable" /> + <Button Grid.Row="1" Grid.Column="2" DataContext="{Binding AvailablePins[25]}" + Classes="Connectable" /> + <Button Grid.Row="2" Grid.Column="2" DataContext="{Binding AvailablePins[21]}" + Classes="Connectable" /> + <Button Grid.Row="3" Grid.Column="2" DataContext="{Binding AvailablePins[19]}" + Classes="Connectable" /> + <Button Grid.Row="4" Grid.Column="2" Background="#0094FF" IsEnabled="False" /> + <Button Grid.Row="5" Grid.Column="2" Background="#F97063" IsEnabled="False" /> + + <!-- + <TextBlock Grid.Row="0" Grid.Column="3" Text="P2_7" Foreground="White" /> + <TextBlock Grid.Row="1" Grid.Column="3" Text="P2_8" Foreground="White" /> + <TextBlock Grid.Row="2" Grid.Column="3" Text="P2_9" Foreground="White" /> + <TextBlock Grid.Row="3" Grid.Column="3" Text="P2_10" Foreground="White" /> + <TextBlock Grid.Row="4" Grid.Column="3" Text="GND" Foreground="White" /> + <TextBlock Grid.Row="5" Grid.Column="3" Text="3.3V" Foreground="White" />--> + </Grid> + </Grid> + + </Border> + + + <Grid Grid.Row="1" Grid.Column="4"> + <TextBlock VerticalAlignment="Center" Text="Button 1" Margin="5 0 0 70"></TextBlock> + <TextBlock VerticalAlignment="Center" Text="Button 2" Margin="5 0 0 0"></TextBlock> + <TextBlock VerticalAlignment="Center" Text="Button 3" Margin="5 70 0 0"></TextBlock> + </Grid> + + <Border Grid.Row="0" Grid.Column="1" + IsVisible="{Binding CruviLsInterfaces[0].Extension, Converter={StaticResource ObjectNotNullConverter}}" + Width="150" Height="105" BoxShadow="0 0 5 5 #77000000" VerticalAlignment="Top" + HorizontalAlignment="Left" Margin="13, 115, 0,-20"> + <Border.RenderTransform> + <RotateTransform Angle="90" /> + </Border.RenderTransform> + <ContentPresenter Margin="-100, 0, 0,0" + DataContext="{Binding CruviLsInterfaces[0].Extension}" + Content="{Binding}" /> + </Border> + + <Border Grid.Row="0" Grid.Column="1" + IsVisible="{Binding CruviLsInterfaces[1].Extension, Converter={StaticResource ObjectNotNullConverter}}" + Width="150" Height="105" BoxShadow="0 0 5 5 #77000000" VerticalAlignment="Top" + HorizontalAlignment="Right" Margin="0, 115, 14,-20"> + <Border.RenderTransform> + <RotateTransform Angle="90" /> + </Border.RenderTransform> + <ContentPresenter Margin="-100, 0, 0,0" + DataContext="{Binding CruviLsInterfaces[1].Extension}" + Content="{Binding}" /> + </Border> + </Grid> + +</UserControl> \ No newline at end of file diff --git a/src/OneWare.UniversalFpgaProjectSystem/Views/IceBreakerV1_0e.axaml.cs b/src/OneWare.UniversalFpgaProjectSystem/Views/IceBreakerV1_0e.axaml.cs new file mode 100644 index 00000000..afbe657a --- /dev/null +++ b/src/OneWare.UniversalFpgaProjectSystem/Views/IceBreakerV1_0e.axaml.cs @@ -0,0 +1,13 @@ +using Avalonia; +using Avalonia.Controls; +using Avalonia.Markup.Xaml; + +namespace OneWare.UniversalFpgaProjectSystem.Views; + +public partial class IceBreakerV1_0e : UserControl +{ + public IceBreakerV1_0e() + { + InitializeComponent(); + } +} \ No newline at end of file diff --git a/src/OneWare.UniversalFpgaProjectSystem/Views/UniversalFpgaProjectCompileView.axaml b/src/OneWare.UniversalFpgaProjectSystem/Views/UniversalFpgaProjectCompileView.axaml index 4b35bfa0..8d144248 100644 --- a/src/OneWare.UniversalFpgaProjectSystem/Views/UniversalFpgaProjectCompileView.axaml +++ b/src/OneWare.UniversalFpgaProjectSystem/Views/UniversalFpgaProjectCompileView.axaml @@ -4,14 +4,36 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:viewModels="clr-namespace:OneWare.UniversalFpgaProjectSystem.ViewModels" xmlns:controls="clr-namespace:OneWare.Shared.Controls;assembly=OneWare.Shared" + xmlns:behaviours="clr-namespace:OneWare.Shared.Behaviours;assembly=OneWare.Shared" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" PrefHeight="750" PrefWidth="900" Padding="4" WindowStartupLocation="CenterOwner" Title="{Binding Title}" CustomIcon="{DynamicResource CreateIcon}" x:Class="OneWare.UniversalFpgaProjectSystem.Views.UniversalFpgaProjectCompileView" - x:DataType="viewModels:UniversalFpgaProjectCompileViewModel"> + x:DataType="viewModels:UniversalFpgaProjectCompileViewModel" + Name="UniversalFpgaProjectCompileViewView"> + <Interaction.Behaviors> + <behaviours:CommandOnEnterBehaviour Command="{Binding SaveAsync}" + CommandParameter="{Binding #UniversalFpgaProjectCompileViewView}" /> + </Interaction.Behaviors> <Grid RowDefinitions="*, Auto"> - <Editor Name="EditorControl" /> + <Border Padding="4"> + <StackPanel Orientation="Vertical"> + <StackPanel Orientation="Horizontal" Spacing="5"> + <TextBlock Text="Select FPGA:" VerticalAlignment="Center"/> + <ComboBox ItemsSource="{Binding FpgaModels}" MinWidth="150" + SelectedItem="{Binding SelectedFpgaModel, Mode=TwoWay}" /> + </StackPanel> + </StackPanel> + </Border> + + <StackPanel Grid.Row="1" DockPanel.Dock="Bottom" Margin="8" Classes="WindowButtons" HorizontalAlignment="Right" + VerticalAlignment="Bottom"> + <Button Background="{DynamicResource HighlightBrush}" Command="{Binding SaveAsync}" + CommandParameter="{Binding #UniversalFpgaProjectCompileViewView}"> + <TextBlock Text="Save" /> + </Button> + </StackPanel> </Grid> </controls:FlexibleWindow> \ No newline at end of file