Skip to content

Commit

Permalink
update to newest oneware
Browse files Browse the repository at this point in the history
  • Loading branch information
HendrikMennen committed Feb 29, 2024
1 parent 734bf3b commit 669f411
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 15 deletions.
7 changes: 4 additions & 3 deletions src/OneWare.NetlistSvg/NetlistSvgModule.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
using CommunityToolkit.Mvvm.Input;
using OneWare.NetlistSvg.Services;
using OneWare.SDK.Models;
using OneWare.SDK.Services;
using OneWare.Essentials.Models;
using OneWare.Essentials.Services;
using OneWare.Essentials.ViewModels;
using Prism.Ioc;
using Prism.Modularity;

Expand All @@ -24,7 +25,7 @@ public void OnInitialized(IContainerProvider containerProvider)
{
return new[]
{
new MenuItemModel("NetlistSvg")
new MenuItemViewModel("NetlistSvg")
{
Header = "Convert to SVG",
Command = new AsyncRelayCommand(() => netListSvgService.ShowSchemeAsync(json))
Expand Down
2 changes: 1 addition & 1 deletion src/OneWare.NetlistSvg/OneWare.NetlistSvg.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="OneWare.SDK" Version="0.12.1.0" Private="false" ExcludeAssets="runtime;Native"/>
<PackageReference Include="OneWare.Essentials" Version="0.1" Private="false" ExcludeAssets="runtime;Native"/>
</ItemGroup>

</Project>
16 changes: 8 additions & 8 deletions src/OneWare.NetlistSvg/Services/NetlistSvgService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,26 @@
using Esprima;
using Esprima.Ast;
using Jint;
using OneWare.SDK.Enums;
using OneWare.SDK.Models;
using OneWare.SDK.Services;
using OneWare.Essentials.Enums;
using OneWare.Essentials.Models;
using OneWare.Essentials.Services;
using Color = Avalonia.Media.Color;

namespace OneWare.NetlistSvg.Services;

public class NetlistSvgService
{
private readonly ILogger _logger;
private readonly IActive _active;
private readonly IApplicationStateService _applicationStateService;
private readonly IDockService _dockService;

private Script? _script1;
private Script? _script2;

public NetlistSvgService(ILogger logger, IActive active, IDockService dockService)
public NetlistSvgService(ILogger logger, IApplicationStateService active, IDockService dockService)
{
_logger = logger;
_active = active;
_applicationStateService = active;
_dockService = dockService;

_ = LoadScriptsAsync();
Expand Down Expand Up @@ -74,7 +74,7 @@ public async Task ShowSchemeAsync(IProjectFile jsonFile)
_output = string.Empty;

var cancel = new CancellationTokenSource();
var state = _active.AddState("Rendering Scheme...", AppState.Loading, () => cancel.Cancel());
var state = _applicationStateService.AddState("Rendering Scheme...", AppState.Loading, () => cancel.Cancel());

var theme = Application.Current!.ActualThemeVariant;
var skin = LoadSkin(theme);
Expand Down Expand Up @@ -149,7 +149,7 @@ await Task.Run(() =>
return null;
}

_active.RemoveState(state);
_applicationStateService.RemoveState(state);
return cancel.IsCancellationRequested ? null : _output;
}

Expand Down
6 changes: 3 additions & 3 deletions src/OneWare.NetlistSvg/oneware.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"Dependencies": [
{
"Name": "OneWare.SDK",
"MinVersion": "0.12.1.0",
"MaxVersion": "0.12.1.0"
"Name": "OneWare.Essentials",
"MinVersion": "0.1.0.0",
"MaxVersion": "0.1.0.0"
}
]
}

0 comments on commit 669f411

Please sign in to comment.