Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
HendrikMennen committed Nov 14, 2023
2 parents f22174b + 98d8f37 commit 26fbeeb
Show file tree
Hide file tree
Showing 19 changed files with 392 additions and 104 deletions.
1 change: 1 addition & 0 deletions demo/OneWare.Demo.Browser/WebDemoApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ protected override async Task LoadContentAsync()
CopyAvaloniaAssetIntoFolder(new Uri("avares://OneWare.Demo/Assets/DemoFiles/VhdlTest.vhd"), Path.Combine(testProj, "VHDL", "VhdlTest.vhd"));
CopyAvaloniaAssetIntoFolder(new Uri("avares://OneWare.Demo/Assets/DemoFiles/VerilogTest.v"), Path.Combine(testProj, "Verilog", "VerilogTest.v"));
CopyAvaloniaAssetIntoFolder(new Uri("avares://OneWare.Demo/Assets/DemoFiles/VcdTest.vcd"), Path.Combine(testProj, "VCD", "VcdTest.vcd"));
CopyAvaloniaAssetIntoFolder(new Uri("avares://OneWare.Demo/Assets/DemoFiles/out.svg"), Path.Combine(testProj, "Net", "test.svg"));

var dummy = await Container.Resolve<UniversalFpgaProjectManager>().LoadProjectAsync(Path.Combine(testProj, "DemoProject.fpgaproj"));

Expand Down
3 changes: 2 additions & 1 deletion demo/OneWare.Demo/Assets/DemoFiles/DemoProject.fpgaproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"*.vhdl",
"*.v",
"*.cpp",
"*.vcd"
"*.vcd",
"*.svg"
],
"Exclude": [
"bin"
Expand Down
180 changes: 180 additions & 0 deletions demo/OneWare.Demo/Assets/DemoFiles/out.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions src/OneWare.Core/Styles/Icons.axaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">



<DrawingImage x:Key="BoxIcons.RegularLogOutCircle">
<GeometryDrawing Brush="{StaticResource IconColor}" Geometry="M-3.433E-009,7.2 L4,10.4 L4,8 L11.2,8 L11.2,6.4 L4,6.4 L4,4 z M8.8,1.887E-05 C8.794,1.190E-007 8.787,1.190E-007 8.78,1.190E-007 C6.798,1.190E-007 5.005,0.8064 3.71,2.109 L3.709,2.109 L4.84,3.24 C5.898,2.183 7.304,1.6 8.8,1.6 C10.3,1.6 11.7,2.183 12.76,3.24 C13.82,4.298 14.4,5.704 14.4,7.2 C14.4,8.696 13.82,10.1 12.76,11.16 C11.7,12.22 10.3,12.8 8.8,12.8 C7.304,12.8 5.898,12.22 4.84,11.16 L3.709,12.29 C5.068,13.65 6.876,14.4 8.8,14.4 C10.72,14.4 12.53,13.65 13.89,12.29 C15.25,10.93 16,9.124 16,7.2 C16,5.276 15.25,3.468 13.89,2.109 C12.6,0.8064 10.8,1.190E-007 8.82,1.190E-007 C8.813,1.190E-007 8.806,1.887E-05 8.799,3.762E-05 L8.8,3.762E-05 z" />
</DrawingImage>
<DrawingImage x:Key="BoxIcons.RegularLogInCircle">
<GeometryDrawing Brush="{StaticResource IconColor}" Geometry="M7.199,10.4 L11.2,7.2 L7.199,4 L7.199,6.4 L-2.060E-008,6.4 L-2.060E-008,8 L7.199,8 z M8.8,1.887E-05 C8.794,1.190E-007 8.787,1.190E-007 8.78,1.190E-007 C6.798,1.190E-007 5.005,0.8064 3.71,2.109 L3.709,2.109 L4.84,3.24 C5.898,2.183 7.304,1.6 8.8,1.6 C10.3,1.6 11.7,2.183 12.76,3.24 C13.82,4.298 14.4,5.704 14.4,7.2 C14.4,8.696 13.82,10.1 12.76,11.16 C11.7,12.22 10.3,12.8 8.8,12.8 C7.304,12.8 5.898,12.22 4.84,11.16 L3.709,12.29 C5.068,13.65 6.876,14.4 8.8,14.4 C10.72,14.4 12.53,13.65 13.89,12.29 C15.25,10.93 16,9.124 16,7.2 C16,5.276 15.25,3.468 13.89,2.109 C12.6,0.8064 10.8,1.190E-007 8.82,1.190E-007 C8.813,1.190E-007 8.806,1.887E-05 8.799,3.762E-05 L8.8,3.762E-05 z" />
</DrawingImage>

<DrawingImage x:Key="BoxIcons.RegularCheck">
<GeometryDrawing Brush="{StaticResource IconColor}"
Geometry="M5.225,9.205 L1.57,5.55 L-1.747E-007,7.12 L5.225,12.34 L16,1.57 L14.43,-1.651E-007 z" />
Expand Down
2 changes: 1 addition & 1 deletion src/OneWare.IceBreaker/IceBreakerModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ public void RegisterTypes(IContainerRegistry containerRegistry)

public void OnInitialized(IContainerProvider containerProvider)
{
containerProvider.Resolve<FpgaService>().AddFpga(new IceBreakerV10EViewModel());
containerProvider.Resolve<FpgaService>().AddFpga<IceBreakerV10EViewModel>();
}
}
20 changes: 0 additions & 20 deletions src/OneWare.PackageManager/ViewModels/PackageManagerViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,27 +99,7 @@ public async Task LoadPackagesAsync()
RegisterPackageCategory(new PackageCategoryModel("Toolchains", Application.Current?.GetResourceObservable("FeatherIcons.Tool")));
RegisterPackageCategory(new PackageCategoryModel("Simulators", Application.Current?.GetResourceObservable("Material.Pulse")));
RegisterPackageCategory(new PackageCategoryModel("Boards", Application.Current?.GetResourceObservable("NiosIcon")));

// RegisterPackage(PackageCategories.Last(),
// new PackageModel("Max1000 Support", "Support for MAX1000 Development Board", "The MAX1000 FPGA Development Board is the most inexpensive way to start with FPGAs and OneWare Studio",
// await _httpService.DownloadImageAsync("https://vhdplus.com/assets/images/max1000-fd95dd816b048068dd3d9ce70c0f67c0.png"), new List<LinkModel>
// {
// new("Docs","https://vhdplus.com/docs/components/max1000/"),
// new("Get this Product!", "https://shop.vhdplus.com/product/max1000/")
// })
// );
//
// RegisterPackage(PackageCategories.Last(),
// new PackageModel("VHDPlus WiFi Extension", "Support for VHDPlus WiFi Extension Board", "The WiFi Extensions make it easy to use your FPGA as an IoT controller. You have to take a cheap ESP-01 and plug it in the connector. Then you can use the FPGA as a programmer and USB interface for the ESP8266 together with the onboard buttons. And when you only have one CRUVI connector left, you can just plug a second extension like the SCD40 CRUVI module on top of the extension.",
// await _httpService.DownloadImageAsync("https://vhdplus.com/assets/images/Wifi_Top-8e711729300fc78fb5ed8e74b75c8914.png"), new List<LinkModel>
// {
// new("Docs","https://vhdplus.com/docs/components/wifi/"),
// new("Get this Product!", "https://shop.vhdplus.com/product/vhdplus-wifi-extension/")
// })
// );

RegisterPackageCategory(new PackageCategoryModel("Libraries", Application.Current?.GetResourceObservable("BoxIcons.RegularLibrary")));

RegisterPackageCategory(new PackageCategoryModel("Misc", Application.Current?.GetResourceObservable("Module")));

await LoadPackageRepositoryAsync(
Expand Down
5 changes: 3 additions & 2 deletions src/OneWare.ProjectExplorer/Services/ProjectWatchInstance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,10 @@ private async Task ProcessAsync(string path, IReadOnlyCollection<FileSystemEvent
{
try
{
if (!File.Exists(path) && changes.Last().ChangeType is WatcherChangeTypes.Deleted && _root.Search(path) is {} deletedEntry)
if (!File.Exists(path))
{
await _projectExplorerService.RemoveAsync(deletedEntry);
if(changes.Last().ChangeType is WatcherChangeTypes.Deleted && _root.Search(path) is {} deletedEntry)
await _projectExplorerService.RemoveAsync(deletedEntry);
return;
}

Expand Down
15 changes: 12 additions & 3 deletions src/OneWare.ProjectExplorer/ViewModels/ProjectExplorerViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ public class ProjectExplorerViewModel : ProjectViewModelBase, IProjectExplorerSe

private IProjectRoot? _activeProject;

private readonly List<Func<IList<IProjectEntry>, IEnumerable<IMenuItem>?>> _registerContextMenu = new();

private IEnumerable<IMenuItem>? _treeViewContextMenu;

public IEnumerable<IMenuItem>? TreeViewContextMenu
Expand All @@ -56,9 +58,6 @@ public IProjectRoot? ActiveProject
}
}

public ICommand? DoubleTabCommand { get; protected set; }
public Action<Action<string>>? RequestRename { get; set; }

public event EventHandler<IFile>? FileRemoved;
public event EventHandler<IProjectRoot>? ProjectRemoved;

Expand Down Expand Up @@ -162,6 +161,11 @@ public void ConstructContextMenu(TopLevel topLevel)
break;
}

foreach (var reg in _registerContextMenu)
{
if(reg.Invoke(SelectedItems) is {} items) menuItems.AddRange(items);
}

if (manager != null) menuItems.AddRange(manager.ConstructContextMenu(entry));

if (entry is IProjectRoot root)
Expand Down Expand Up @@ -797,6 +801,11 @@ public async Task OpenLastProjectsFileAsync()
}
}

public void RegisterConstructContextMenu(Func<IList<IProjectEntry>, IEnumerable<IMenuItem>?> construct)
{
_registerContextMenu.Add(construct);
}

private class ProjectSerialization
{
public string ProjectType { get; set; }
Expand Down
1 change: 1 addition & 0 deletions src/OneWare.Shared/Services/IProjectExplorerService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ public interface IProjectExplorerService : IDockable, INotifyPropertyChanged
public Task SaveProjectAsync(IProjectRoot project);
public Task SaveLastProjectsFileAsync();
public Task OpenLastProjectsFileAsync();
public void RegisterConstructContextMenu(Func<IList<IProjectEntry>, IEnumerable<IMenuItem>?> construct);
}
Loading

0 comments on commit 26fbeeb

Please sign in to comment.