diff --git a/build/props/Base.props b/build/props/Base.props index b5400e63..fe92edc5 100644 --- a/build/props/Base.props +++ b/build/props/Base.props @@ -1,7 +1,7 @@  - 0.12.0.5 + 0.12.0.6 Hendrik Mennen Protop Solutions UG The FPGA Programming Revolution diff --git a/src/OneWare.Core/Styles/Icons.axaml b/src/OneWare.Core/Styles/Icons.axaml index 706399f7..4433ea53 100644 --- a/src/OneWare.Core/Styles/Icons.axaml +++ b/src/OneWare.Core/Styles/Icons.axaml @@ -1,8 +1,14 @@  - - + + + + + + + + diff --git a/src/OneWare.Core/Styles/IdeStyles.axaml b/src/OneWare.Core/Styles/IdeStyles.axaml index d7420fda..152cbe92 100644 --- a/src/OneWare.Core/Styles/IdeStyles.axaml +++ b/src/OneWare.Core/Styles/IdeStyles.axaml @@ -6,6 +6,41 @@ + + + + + + + + + + + + + + + + + + + + + + @@ -18,11 +53,11 @@ - + - + - + @@ -134,5 +169,5 @@ - + \ No newline at end of file diff --git a/src/OneWare.ImageViewer/ViewModels/ImageViewModel.cs b/src/OneWare.ImageViewer/ViewModels/ImageViewModel.cs index b6d6edee..aed29cd0 100644 --- a/src/OneWare.ImageViewer/ViewModels/ImageViewModel.cs +++ b/src/OneWare.ImageViewer/ViewModels/ImageViewModel.cs @@ -34,7 +34,7 @@ protected override void UpdateCurrentFile(IFile? oldFile) case ".svg": var svg = new SvgSource(); var picture = svg.Load(FullPath); - if (picture is { }) + if (picture is not null) { Image = new SvgImage() { diff --git a/src/OneWare.OssCadSuiteIntegration/OssCadSuiteIntegrationModule.cs b/src/OneWare.OssCadSuiteIntegration/OssCadSuiteIntegrationModule.cs index ee4dc741..a1547229 100644 --- a/src/OneWare.OssCadSuiteIntegration/OssCadSuiteIntegrationModule.cs +++ b/src/OneWare.OssCadSuiteIntegration/OssCadSuiteIntegrationModule.cs @@ -5,6 +5,7 @@ using OneWare.Shared.Models; using OneWare.Shared.Services; using OneWare.UniversalFpgaProjectSystem.Models; +using OneWare.UniversalFpgaProjectSystem.Services; using Prism.Ioc; using Prism.Modularity; // ReSharper disable StringLiteralTypo @@ -23,6 +24,8 @@ public void OnInitialized(IContainerProvider containerProvider) var settingsService = containerProvider.Resolve(); var yosysService = containerProvider.Resolve(); + containerProvider.Resolve().FpgaToolchains.Add(new YosysToolchain()); + settingsService.RegisterTitledPath("Tools", "OSS Cad Suite", "OssCadSuite_Path", "OSS CAD Suite Path", "Sets the path for the Yosys OSS CAD Suite", "", null, null, IsOssPathValid); diff --git a/src/OneWare.OssCadSuiteIntegration/Yosys/YosysToolchain.cs b/src/OneWare.OssCadSuiteIntegration/Yosys/YosysToolchain.cs new file mode 100644 index 00000000..54cb7930 --- /dev/null +++ b/src/OneWare.OssCadSuiteIntegration/Yosys/YosysToolchain.cs @@ -0,0 +1,8 @@ +using OneWare.UniversalFpgaProjectSystem.Models; + +namespace OneWare.OssCadSuiteIntegration.Yosys; + +public class YosysToolchain : IFpgaToolchain +{ + public string Name => "Yosys"; +} \ No newline at end of file diff --git a/src/OneWare.UniversalFpgaProjectSystem/Models/IFpgaToolchain.cs b/src/OneWare.UniversalFpgaProjectSystem/Models/IFpgaToolchain.cs new file mode 100644 index 00000000..db147ce5 --- /dev/null +++ b/src/OneWare.UniversalFpgaProjectSystem/Models/IFpgaToolchain.cs @@ -0,0 +1,6 @@ +namespace OneWare.UniversalFpgaProjectSystem.Models; + +public interface IFpgaToolchain +{ + public string Name { get; } +} \ No newline at end of file diff --git a/src/OneWare.UniversalFpgaProjectSystem/Models/UniversalFpgaProjectRoot.cs b/src/OneWare.UniversalFpgaProjectSystem/Models/UniversalFpgaProjectRoot.cs index c9a95694..e6bc4496 100644 --- a/src/OneWare.UniversalFpgaProjectSystem/Models/UniversalFpgaProjectRoot.cs +++ b/src/OneWare.UniversalFpgaProjectSystem/Models/UniversalFpgaProjectRoot.cs @@ -44,6 +44,14 @@ public IProjectEntry? TopEntity } } + private IFpgaToolchain? _toolchain; + + public IFpgaToolchain? Toolchain + { + get => _toolchain; + set => SetProperty(ref _toolchain, value); + } + public UniversalFpgaProjectRoot(string projectFilePath, JsonObject properties) : base(Path.GetDirectoryName(projectFilePath) ?? throw new NullReferenceException("Invalid Project Path")) { ProjectFilePath = projectFilePath; diff --git a/src/OneWare.UniversalFpgaProjectSystem/Services/FpgaService.cs b/src/OneWare.UniversalFpgaProjectSystem/Services/FpgaService.cs index 86a9bac7..16daf213 100644 --- a/src/OneWare.UniversalFpgaProjectSystem/Services/FpgaService.cs +++ b/src/OneWare.UniversalFpgaProjectSystem/Services/FpgaService.cs @@ -5,7 +5,9 @@ namespace OneWare.UniversalFpgaProjectSystem.Services; public class FpgaService { - public ObservableCollection FpgaModels { get; } = new(); + private ObservableCollection FpgaModels { get; } = new(); + + public ObservableCollection FpgaToolchains { get; } = new(); public void AddFpga() where T : FpgaModelBase { diff --git a/src/OneWare.UniversalFpgaProjectSystem/ViewModels/UniversalFpgaProjectToolBarViewModel.cs b/src/OneWare.UniversalFpgaProjectSystem/ViewModels/UniversalFpgaProjectToolBarViewModel.cs index 3310cb35..f57ac552 100644 --- a/src/OneWare.UniversalFpgaProjectSystem/ViewModels/UniversalFpgaProjectToolBarViewModel.cs +++ b/src/OneWare.UniversalFpgaProjectSystem/ViewModels/UniversalFpgaProjectToolBarViewModel.cs @@ -1,6 +1,7 @@ using CommunityToolkit.Mvvm.ComponentModel; using OneWare.Shared.Services; using OneWare.UniversalFpgaProjectSystem.Models; +using OneWare.UniversalFpgaProjectSystem.Services; using OneWare.UniversalFpgaProjectSystem.Views; using Prism.Ioc; @@ -8,8 +9,9 @@ namespace OneWare.UniversalFpgaProjectSystem.ViewModels; public class UniversalFpgaProjectToolBarViewModel : ObservableObject { + public FpgaService FpgaService { get; } + public IProjectExplorerService ProjectExplorerService { get; } private readonly IWindowService _windowService; - private readonly IProjectExplorerService _projectExplorerService; private bool _longTermProgramming; @@ -19,15 +21,25 @@ public bool LongTermProgramming set => SetProperty(ref _longTermProgramming, value); } - public UniversalFpgaProjectToolBarViewModel(IWindowService windowService, IProjectExplorerService projectExplorerService) + public UniversalFpgaProjectToolBarViewModel(IWindowService windowService, IProjectExplorerService projectExplorerService, FpgaService fpgaService) { _windowService = windowService; - _projectExplorerService = projectExplorerService; + ProjectExplorerService = projectExplorerService; + FpgaService = fpgaService; + } + + public void ToggleProjectToolchain(IFpgaToolchain toolchain) + { + if (ProjectExplorerService.ActiveProject is UniversalFpgaProjectRoot project) + { + if (project.Toolchain != toolchain) project.Toolchain = toolchain; + else project.Toolchain = null; + } } public async Task CompileAsync() { - if (_projectExplorerService.ActiveProject is UniversalFpgaProjectRoot project) + if (ProjectExplorerService.ActiveProject is UniversalFpgaProjectRoot project) { await _windowService.ShowDialogAsync(new UniversalFpgaProjectCompileView() { diff --git a/src/OneWare.UniversalFpgaProjectSystem/Views/UniversalFpgaProjectToolBarView.axaml b/src/OneWare.UniversalFpgaProjectSystem/Views/UniversalFpgaProjectToolBarView.axaml index 5883b4a9..7f5c12fe 100644 --- a/src/OneWare.UniversalFpgaProjectSystem/Views/UniversalFpgaProjectToolBarView.axaml +++ b/src/OneWare.UniversalFpgaProjectSystem/Views/UniversalFpgaProjectToolBarView.axaml @@ -3,7 +3,9 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:viewModels="clr-namespace:OneWare.UniversalFpgaProjectSystem.ViewModels" - mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" + xmlns:models="clr-namespace:OneWare.UniversalFpgaProjectSystem.Models" + xmlns:converters="clr-namespace:OneWare.Shared.Converters;assembly=OneWare.Shared" + mc:Ignorable="d" x:Class="OneWare.UniversalFpgaProjectSystem.Views.UniversalFpgaProjectToolBarView" x:DataType="viewModels:UniversalFpgaProjectToolBarViewModel"> @@ -16,6 +18,33 @@ +