diff --git a/OneWare.sln b/OneWare.sln index 4e083fae..3228575e 100644 --- a/OneWare.sln +++ b/OneWare.sln @@ -116,6 +116,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OneWare.ApplicationCommands EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OneWare.ImageViewer", "src\OneWare.ImageViewer\OneWare.ImageViewer.csproj", "{20969AC5-F5E0-439C-9217-6FAE0CA01F73}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "FpgaSupport", "FpgaSupport", "{52DDC84A-27F8-4AF0-93C4-903614BE613D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OneWare.IceBreaker", "src\OneWare.IceBreaker\OneWare.IceBreaker.csproj", "{B970E17F-ED6D-4A50-9477-BF2809198416}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -258,6 +262,10 @@ Global {20969AC5-F5E0-439C-9217-6FAE0CA01F73}.Debug|Any CPU.Build.0 = Debug|Any CPU {20969AC5-F5E0-439C-9217-6FAE0CA01F73}.Release|Any CPU.ActiveCfg = Release|Any CPU {20969AC5-F5E0-439C-9217-6FAE0CA01F73}.Release|Any CPU.Build.0 = Release|Any CPU + {B970E17F-ED6D-4A50-9477-BF2809198416}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B970E17F-ED6D-4A50-9477-BF2809198416}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B970E17F-ED6D-4A50-9477-BF2809198416}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B970E17F-ED6D-4A50-9477-BF2809198416}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(NestedProjects) = preSolution {F08B36E8-AB80-42CD-BD47-6B05E96DA390} = {0761690C-7DA0-4554-9F6B-211088412DCD} @@ -294,5 +302,7 @@ Global {D1794384-1BD7-43DA-9846-203350EC4F0F} = {09A7F503-8517-4D41-A396-C193931636A4} {5E74C94A-212C-404D-9B04-A362A9AA23BF} = {0761690C-7DA0-4554-9F6B-211088412DCD} {20969AC5-F5E0-439C-9217-6FAE0CA01F73} = {6FF7E7F6-DA3F-477E-AAD7-47E3655FA34D} + {52DDC84A-27F8-4AF0-93C4-903614BE613D} = {6FF7E7F6-DA3F-477E-AAD7-47E3655FA34D} + {B970E17F-ED6D-4A50-9477-BF2809198416} = {52DDC84A-27F8-4AF0-93C4-903614BE613D} EndGlobalSection EndGlobal diff --git a/demo/OneWare.Demo/DemoApp.cs b/demo/OneWare.Demo/DemoApp.cs index 4951e2ce..d75b5b80 100644 --- a/demo/OneWare.Demo/DemoApp.cs +++ b/demo/OneWare.Demo/DemoApp.cs @@ -3,6 +3,7 @@ using OneWare.Core; using OneWare.Core.Data; using OneWare.Core.Services; +using OneWare.IceBreaker; using OneWare.Json; using OneWare.Settings; using OneWare.Shared.Services; @@ -62,5 +63,7 @@ protected override void ConfigureModuleCatalog(IModuleCatalog moduleCatalog) moduleCatalog.AddModule(); moduleCatalog.AddModule(); moduleCatalog.AddModule(); + + moduleCatalog.AddModule(); } } \ No newline at end of file diff --git a/demo/OneWare.Demo/OneWare.Demo.csproj b/demo/OneWare.Demo/OneWare.Demo.csproj index 150d6b36..9eb3bc51 100644 --- a/demo/OneWare.Demo/OneWare.Demo.csproj +++ b/demo/OneWare.Demo/OneWare.Demo.csproj @@ -16,6 +16,7 @@ + diff --git a/src/OneWare.IceBreaker/IceBreakerFpga.cs b/src/OneWare.IceBreaker/IceBreakerFpga.cs new file mode 100644 index 00000000..cf4729d5 --- /dev/null +++ b/src/OneWare.IceBreaker/IceBreakerFpga.cs @@ -0,0 +1,13 @@ +using Avalonia.Controls; +using OneWare.IceBreaker.Views; +using OneWare.UniversalFpgaProjectSystem.Models; + +namespace OneWare.IceBreaker; + +public class IceBreakerFpga : FpgaModel +{ + public IceBreakerFpga() : base("IceBreaker V1_0E", new IceBreakerV1_0e()) + { + + } +} \ No newline at end of file diff --git a/src/OneWare.IceBreaker/IceBreakerModule.cs b/src/OneWare.IceBreaker/IceBreakerModule.cs new file mode 100644 index 00000000..443d283f --- /dev/null +++ b/src/OneWare.IceBreaker/IceBreakerModule.cs @@ -0,0 +1,19 @@ +using OneWare.IceBreaker.Views; +using OneWare.UniversalFpgaProjectSystem.Services; +using Prism.Ioc; +using Prism.Modularity; + +namespace OneWare.IceBreaker; + +public class IceBreakerModule : IModule +{ + public void RegisterTypes(IContainerRegistry containerRegistry) + { + + } + + public void OnInitialized(IContainerProvider containerProvider) + { + containerProvider.Resolve().AddFpga(new IceBreakerFpga()); + } +} \ No newline at end of file diff --git a/src/OneWare.IceBreaker/OneWare.IceBreaker.csproj b/src/OneWare.IceBreaker/OneWare.IceBreaker.csproj new file mode 100644 index 00000000..d400dd24 --- /dev/null +++ b/src/OneWare.IceBreaker/OneWare.IceBreaker.csproj @@ -0,0 +1,15 @@ + + + + + + + + + + + IceBreakerV1_0e.axaml + Code + + + diff --git a/src/OneWare.UniversalFpgaProjectSystem/Views/IceBreakerV1_0e.axaml b/src/OneWare.IceBreaker/Views/IceBreakerV1_0e.axaml similarity index 96% rename from src/OneWare.UniversalFpgaProjectSystem/Views/IceBreakerV1_0e.axaml rename to src/OneWare.IceBreaker/Views/IceBreakerV1_0e.axaml index 86145bb4..3239a04f 100644 --- a/src/OneWare.UniversalFpgaProjectSystem/Views/IceBreakerV1_0e.axaml +++ b/src/OneWare.IceBreaker/Views/IceBreakerV1_0e.axaml @@ -2,29 +2,25 @@ 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" + xmlns:models="clr-namespace:OneWare.UniversalFpgaProjectSystem.Models;assembly=OneWare.UniversalFpgaProjectSystem" mc:Ignorable="d" d:DesignHeight="500" d:DesignWidth="1000" - x:Class="OneWare.UniversalFpgaProjectSystem.Views.IceBreakerV1_0e" x:DataType="models:FpgaModel" + x:Class="OneWare.IceBreaker.Views.IceBreakerV1_0e" x:DataType="models:FpgaModel" x:CompileBindings="True"> - - + - - - - - + - + @@ -377,6 +376,7 @@ + \ No newline at end of file diff --git a/src/OneWare.UniversalFpgaProjectSystem/Views/IceBreakerV1_0e.axaml.cs b/src/OneWare.IceBreaker/Views/IceBreakerV1_0e.axaml.cs similarity index 50% rename from src/OneWare.UniversalFpgaProjectSystem/Views/IceBreakerV1_0e.axaml.cs rename to src/OneWare.IceBreaker/Views/IceBreakerV1_0e.axaml.cs index afbe657a..7398a457 100644 --- a/src/OneWare.UniversalFpgaProjectSystem/Views/IceBreakerV1_0e.axaml.cs +++ b/src/OneWare.IceBreaker/Views/IceBreakerV1_0e.axaml.cs @@ -1,8 +1,6 @@ -using Avalonia; -using Avalonia.Controls; -using Avalonia.Markup.Xaml; +using Avalonia.Controls; -namespace OneWare.UniversalFpgaProjectSystem.Views; +namespace OneWare.IceBreaker.Views; public partial class IceBreakerV1_0e : UserControl { diff --git a/src/OneWare.UniversalFpgaProjectSystem/Models/FpgaModel.cs b/src/OneWare.UniversalFpgaProjectSystem/Models/FpgaModel.cs index 451e3731..5f2fe8be 100644 --- a/src/OneWare.UniversalFpgaProjectSystem/Models/FpgaModel.cs +++ b/src/OneWare.UniversalFpgaProjectSystem/Models/FpgaModel.cs @@ -1,27 +1,39 @@ -using CommunityToolkit.Mvvm.ComponentModel; +using Avalonia.Controls; +using CommunityToolkit.Mvvm.ComponentModel; namespace OneWare.UniversalFpgaProjectSystem.Models; public class FpgaModel : ObservableObject { - public string Name { get; } - - public Dictionary AvailablePins { get; } = new(); - - private CompileConnectionModel _selectedConnection; + public Dictionary AvailablePins { get; } = new(); - private FpgaPin _selectedPin; - public FpgaPin SelectedPin + private FpgaPinModel? _selectedPinModel; + public FpgaPinModel? SelectedPinModel { - get => _selectedPin; - set => this.SetProperty(ref _selectedPin, value); + get => _selectedPinModel; + set => SetProperty(ref _selectedPinModel, value); } - private CompileSignalModel _selectedSignal; + private NodeModel? _selectedNode; + public NodeModel? SelectedNode + { + get => _selectedNode; + set => SetProperty(ref _selectedNode, value); + } + + public Control? UserInterface { get; } + + public string Name { get; } - public FpgaModel(string name) + public FpgaModel(string name, Control? userInterface = null) { Name = name; + UserInterface = userInterface; + } + + public void SelectPin(FpgaPinModel model) + { + SelectedPinModel = model; } public override string ToString() diff --git a/src/OneWare.UniversalFpgaProjectSystem/Models/FpgaPin.cs b/src/OneWare.UniversalFpgaProjectSystem/Models/FpgaPinModel.cs similarity index 79% rename from src/OneWare.UniversalFpgaProjectSystem/Models/FpgaPin.cs rename to src/OneWare.UniversalFpgaProjectSystem/Models/FpgaPinModel.cs index 7a8d41f0..a6aae0cb 100644 --- a/src/OneWare.UniversalFpgaProjectSystem/Models/FpgaPin.cs +++ b/src/OneWare.UniversalFpgaProjectSystem/Models/FpgaPinModel.cs @@ -2,7 +2,7 @@ namespace OneWare.UniversalFpgaProjectSystem.Models; -public class FpgaPin : ObservableObject +public class FpgaPinModel : ObservableObject { public FpgaModel Parent { get; } public string Name { get; } @@ -21,8 +21,8 @@ public string ToolTipText set => SetProperty(ref _toolTipText, value); } - private CompileSignalModel _connection; - public CompileSignalModel Connection + private NodeModel? _connection; + public NodeModel? Connection { get => _connection; set @@ -33,11 +33,10 @@ public CompileSignalModel Connection } } - public CompilePinModel(string name, string description, FpgaModel parent) + public FpgaPinModel(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/Models/NodeModel.cs b/src/OneWare.UniversalFpgaProjectSystem/Models/NodeModel.cs new file mode 100644 index 00000000..00793a79 --- /dev/null +++ b/src/OneWare.UniversalFpgaProjectSystem/Models/NodeModel.cs @@ -0,0 +1,16 @@ +namespace OneWare.UniversalFpgaProjectSystem.Models; + +public class NodeModel +{ + public string Name { get; } + + public NodeModel(string name) + { + Name = name; + } + + public override string ToString() + { + return Name; + } +} \ No newline at end of file diff --git a/src/OneWare.UniversalFpgaProjectSystem/Services/FpgaService.cs b/src/OneWare.UniversalFpgaProjectSystem/Services/FpgaService.cs new file mode 100644 index 00000000..94d787de --- /dev/null +++ b/src/OneWare.UniversalFpgaProjectSystem/Services/FpgaService.cs @@ -0,0 +1,14 @@ +using System.Collections.ObjectModel; +using OneWare.UniversalFpgaProjectSystem.Models; + +namespace OneWare.UniversalFpgaProjectSystem.Services; + +public class FpgaService +{ + public ObservableCollection FpgaModels { get; } = new(); + + public void AddFpga(FpgaModel fpgaModel) + { + FpgaModels.Add(fpgaModel); + } +} \ No newline at end of file diff --git a/src/OneWare.UniversalFpgaProjectSystem/Styles/Components.axaml b/src/OneWare.UniversalFpgaProjectSystem/Styles/Components.axaml index e614168b..f5472034 100644 --- a/src/OneWare.UniversalFpgaProjectSystem/Styles/Components.axaml +++ b/src/OneWare.UniversalFpgaProjectSystem/Styles/Components.axaml @@ -98,7 +98,7 @@ -