aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-06-22 06:15:44 +0800
committer魏曹先生 <1992414357@qq.com>2026-06-22 06:15:44 +0800
commite6bf6f5091caf3b4366894643671bc4586794cda (patch)
tree18f1ed3eb8820218ebfb9b2fad3da97c3bdaaa10
parent7091f88c9f0bbbad6959874993145cbd06c1886a (diff)
feat: add GUI manager and integrate into build pipeline
-rw-r--r--Cargo.toml1
-rw-r--r--build.ps125
-rw-r--r--dmvop.sln34
-rw-r--r--manager/.gitignore3
-rw-r--r--manager/App.axaml10
-rw-r--r--manager/App.axaml.cs23
-rw-r--r--manager/MainWindow.axaml9
-rw-r--r--manager/MainWindow.axaml.cs11
-rw-r--r--manager/Program.cs21
-rw-r--r--manager/app.manifest18
-rw-r--r--manager/launcher/dmvop-gui.exebin0 -> 393728 bytes
-rw-r--r--manager/manager.csproj22
-rw-r--r--run-manager.ps11
13 files changed, 177 insertions, 1 deletions
diff --git a/Cargo.toml b/Cargo.toml
index ac781be..b6778b1 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -37,4 +37,3 @@ debug = false
panic = "abort"
incremental = false
codegen-units = 1
-lto = "fat"
diff --git a/build.ps1 b/build.ps1
index 05a77d7..12b63ee 100644
--- a/build.ps1
+++ b/build.ps1
@@ -20,6 +20,15 @@ if ($LASTEXITCODE -ne 0) {
exit 1
}
+# Build manager GUI
+Write-Host "=== Building dmvop-gui ===" -ForegroundColor Cyan
+dotnet publish manager/manager.csproj -c Release -o manager/publish
+if ($LASTEXITCODE -ne 0) {
+ Write-Host "GUI build failed!" -ForegroundColor Red
+ Set-Location $OrigDir
+ exit 1
+}
+
# Create build directory
if (-not (Test-Path $BuildDir)) {
New-Item -ItemType Directory -Path $BuildDir | Out-Null
@@ -31,6 +40,22 @@ Write-Host "=== Copying files ===" -ForegroundColor Cyan
Copy-Item (Join-Path $ReleaseDir "dmvop.exe") (Join-Path $BuildDir "dmvop.exe") -Force
Write-Host " [OK] dmvop.exe"
+# 1.5. gui launcher
+$LauncherSrc = Join-Path (Get-Location) "manager\launcher\dmvop-gui.exe"
+if (Test-Path $LauncherSrc) {
+ Copy-Item $LauncherSrc (Join-Path $BuildDir "dmvop-gui.exe") -Force
+ Write-Host " [OK] dmvop-gui.exe"
+}
+
+# 1.6. gui
+$GuiSrc = Join-Path (Get-Location) "manager\publish"
+$GuiDst = Join-Path $BuildDir "gui"
+if (Test-Path (Join-Path $GuiSrc "manager.exe")) {
+ if (-not (Test-Path $GuiDst)) { New-Item -ItemType Directory -Path $GuiDst | Out-Null }
+ Copy-Item "$GuiSrc\*" $GuiDst -Recurse -Force
+ Write-Host " [OK] gui\"
+}
+
# 2. CUDA backend
$CudaSrc = Join-Path $ReleaseDir "cuda"
$CudaDst = Join-Path $BuildDir "cuda"
diff --git a/dmvop.sln b/dmvop.sln
new file mode 100644
index 0000000..9beed64
--- /dev/null
+++ b/dmvop.sln
@@ -0,0 +1,34 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 17
+VisualStudioVersion = 17.0.31903.59
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "manager", "manager\manager.csproj", "{EA777682-06EE-464F-8609-EF37F586FD3C}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Debug|x64 = Debug|x64
+ Debug|x86 = Debug|x86
+ Release|Any CPU = Release|Any CPU
+ Release|x64 = Release|x64
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {EA777682-06EE-464F-8609-EF37F586FD3C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {EA777682-06EE-464F-8609-EF37F586FD3C}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {EA777682-06EE-464F-8609-EF37F586FD3C}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {EA777682-06EE-464F-8609-EF37F586FD3C}.Debug|x64.Build.0 = Debug|Any CPU
+ {EA777682-06EE-464F-8609-EF37F586FD3C}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {EA777682-06EE-464F-8609-EF37F586FD3C}.Debug|x86.Build.0 = Debug|Any CPU
+ {EA777682-06EE-464F-8609-EF37F586FD3C}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {EA777682-06EE-464F-8609-EF37F586FD3C}.Release|Any CPU.Build.0 = Release|Any CPU
+ {EA777682-06EE-464F-8609-EF37F586FD3C}.Release|x64.ActiveCfg = Release|Any CPU
+ {EA777682-06EE-464F-8609-EF37F586FD3C}.Release|x64.Build.0 = Release|Any CPU
+ {EA777682-06EE-464F-8609-EF37F586FD3C}.Release|x86.ActiveCfg = Release|Any CPU
+ {EA777682-06EE-464F-8609-EF37F586FD3C}.Release|x86.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/manager/.gitignore b/manager/.gitignore
new file mode 100644
index 0000000..df1d0c9
--- /dev/null
+++ b/manager/.gitignore
@@ -0,0 +1,3 @@
+bin
+obj
+publish
diff --git a/manager/App.axaml b/manager/App.axaml
new file mode 100644
index 0000000..d9eaaee
--- /dev/null
+++ b/manager/App.axaml
@@ -0,0 +1,10 @@
+<Application xmlns="https://github.com/avaloniaui"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ x:Class="manager.App"
+ RequestedThemeVariant="Default">
+ <!-- "Default" ThemeVariant follows system theme variant. "Dark" or "Light" are other available options. -->
+
+ <Application.Styles>
+ <FluentTheme />
+ </Application.Styles>
+</Application> \ No newline at end of file
diff --git a/manager/App.axaml.cs b/manager/App.axaml.cs
new file mode 100644
index 0000000..814a7de
--- /dev/null
+++ b/manager/App.axaml.cs
@@ -0,0 +1,23 @@
+using Avalonia;
+using Avalonia.Controls.ApplicationLifetimes;
+using Avalonia.Markup.Xaml;
+
+namespace manager;
+
+public partial class App : Application
+{
+ public override void Initialize()
+ {
+ AvaloniaXamlLoader.Load(this);
+ }
+
+ public override void OnFrameworkInitializationCompleted()
+ {
+ if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
+ {
+ desktop.MainWindow = new MainWindow();
+ }
+
+ base.OnFrameworkInitializationCompleted();
+ }
+} \ No newline at end of file
diff --git a/manager/MainWindow.axaml b/manager/MainWindow.axaml
new file mode 100644
index 0000000..1aa61b8
--- /dev/null
+++ b/manager/MainWindow.axaml
@@ -0,0 +1,9 @@
+<Window 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"
+ mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
+ x:Class="manager.MainWindow"
+ Title="manager">
+ Welcome to Avalonia!
+</Window>
diff --git a/manager/MainWindow.axaml.cs b/manager/MainWindow.axaml.cs
new file mode 100644
index 0000000..82d8dc2
--- /dev/null
+++ b/manager/MainWindow.axaml.cs
@@ -0,0 +1,11 @@
+using Avalonia.Controls;
+
+namespace manager;
+
+public partial class MainWindow : Window
+{
+ public MainWindow()
+ {
+ InitializeComponent();
+ }
+} \ No newline at end of file
diff --git a/manager/Program.cs b/manager/Program.cs
new file mode 100644
index 0000000..c2f6e74
--- /dev/null
+++ b/manager/Program.cs
@@ -0,0 +1,21 @@
+using Avalonia;
+using System;
+
+namespace manager;
+
+class Program
+{
+ // Initialization code. Don't use any Avalonia, third-party APIs or any
+ // SynchronizationContext-reliant code before AppMain is called: things aren't initialized
+ // yet and stuff might break.
+ [STAThread]
+ public static void Main(string[] args) => BuildAvaloniaApp()
+ .StartWithClassicDesktopLifetime(args);
+
+ // Avalonia configuration, don't remove; also used by visual designer.
+ public static AppBuilder BuildAvaloniaApp()
+ => AppBuilder.Configure<App>()
+ .UsePlatformDetect()
+ .WithInterFont()
+ .LogToTrace();
+}
diff --git a/manager/app.manifest b/manager/app.manifest
new file mode 100644
index 0000000..b22c3d2
--- /dev/null
+++ b/manager/app.manifest
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
+ <!-- This manifest is used on Windows only.
+ Don't remove it as it might cause problems with window transparency and embedded controls.
+ For more details visit https://learn.microsoft.com/en-us/windows/win32/sbscs/application-manifests -->
+ <assemblyIdentity version="1.0.0.0" name="manager.Desktop"/>
+
+ <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
+ <application>
+ <!-- A list of the Windows versions that this application has been tested on
+ and is designed to work with. Uncomment the appropriate elements
+ and Windows will automatically select the most compatible environment. -->
+
+ <!-- Windows 10 -->
+ <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
+ </application>
+ </compatibility>
+</assembly>
diff --git a/manager/launcher/dmvop-gui.exe b/manager/launcher/dmvop-gui.exe
new file mode 100644
index 0000000..56a7f39
--- /dev/null
+++ b/manager/launcher/dmvop-gui.exe
Binary files differ
diff --git a/manager/manager.csproj b/manager/manager.csproj
new file mode 100644
index 0000000..e21a361
--- /dev/null
+++ b/manager/manager.csproj
@@ -0,0 +1,22 @@
+<Project Sdk="Microsoft.NET.Sdk">
+ <PropertyGroup>
+ <OutputType>WinExe</OutputType>
+ <TargetFramework>net9.0</TargetFramework>
+ <Nullable>enable</Nullable>
+ <BuiltInComInteropSupport>true</BuiltInComInteropSupport>
+ <ApplicationManifest>app.manifest</ApplicationManifest>
+ <AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <PackageReference Include="Avalonia" Version="11.3.2" />
+ <PackageReference Include="Avalonia.Desktop" Version="11.3.2" />
+ <PackageReference Include="Avalonia.Themes.Fluent" Version="11.3.2" />
+ <PackageReference Include="Avalonia.Fonts.Inter" Version="11.3.2" />
+ <!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
+ <PackageReference Include="Avalonia.Diagnostics" Version="11.3.2">
+ <IncludeAssets Condition="'$(Configuration)' != 'Debug'">None</IncludeAssets>
+ <PrivateAssets Condition="'$(Configuration)' != 'Debug'">All</PrivateAssets>
+ </PackageReference>
+ </ItemGroup>
+</Project>
diff --git a/run-manager.ps1 b/run-manager.ps1
new file mode 100644
index 0000000..76d5c2f
--- /dev/null
+++ b/run-manager.ps1
@@ -0,0 +1 @@
+dotnet run --project .\manager