diff --git a/Directory.Build.props b/Directory.Build.props index cf52dd2..4026545 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,8 +1,8 @@ @@ -23,7 +23,7 @@ 8.2.2 1.0.7 NeoRF - Earth Model Studio + GC zh-Hans diff --git a/src/main/dotnet/EarthModelStudio/App.axaml b/GC-BOOT/App.axaml similarity index 89% rename from src/main/dotnet/EarthModelStudio/App.axaml rename to GC-BOOT/App.axaml index 925611b..5128788 100644 --- a/src/main/dotnet/EarthModelStudio/App.axaml +++ b/GC-BOOT/App.axaml @@ -1,8 +1,8 @@ @@ -43,6 +43,6 @@ - + diff --git a/src/main/dotnet/EarthModelStudio/App.axaml.cs b/GC-BOOT/App.axaml.cs similarity index 96% rename from src/main/dotnet/EarthModelStudio/App.axaml.cs rename to GC-BOOT/App.axaml.cs index 9d82968..91db551 100644 --- a/src/main/dotnet/EarthModelStudio/App.axaml.cs +++ b/GC-BOOT/App.axaml.cs @@ -4,11 +4,11 @@ using Avalonia; using Avalonia.Controls; using Avalonia.Controls.ApplicationLifetimes; using Avalonia.Markup.Xaml; -using EarthModelStudio.Services; -using EarthModelStudio.ViewModels; -using EarthModelStudio.Views; +using GC.Services; +using GC.ViewModels; +using GC.Views; -namespace EarthModelStudio; +namespace GC; public partial class App : Application { @@ -56,7 +56,7 @@ public partial class App : Application try { using var iconStream = Avalonia.Platform.AssetLoader.Open( - new Uri("avares://EarthModelStudio/Assets/icon.png")); + new Uri("avares://GC/Assets/icon.png")); window.Icon = new Avalonia.Controls.WindowIcon(iconStream); } catch { /* 图标缺失不影响启动 */ } diff --git a/src/main/dotnet/EarthModelStudio/Assets/i18n/en.json b/GC-BOOT/Assets/i18n/en.json similarity index 100% rename from src/main/dotnet/EarthModelStudio/Assets/i18n/en.json rename to GC-BOOT/Assets/i18n/en.json diff --git a/src/main/dotnet/EarthModelStudio/Assets/i18n/zh-CN.json b/GC-BOOT/Assets/i18n/zh-CN.json similarity index 100% rename from src/main/dotnet/EarthModelStudio/Assets/i18n/zh-CN.json rename to GC-BOOT/Assets/i18n/zh-CN.json diff --git a/src/main/dotnet/EarthModelStudio/Assets/icon-1024.png b/GC-BOOT/Assets/icon-1024.png similarity index 100% rename from src/main/dotnet/EarthModelStudio/Assets/icon-1024.png rename to GC-BOOT/Assets/icon-1024.png diff --git a/src/main/dotnet/EarthModelStudio/Assets/icon-128.png b/GC-BOOT/Assets/icon-128.png similarity index 100% rename from src/main/dotnet/EarthModelStudio/Assets/icon-128.png rename to GC-BOOT/Assets/icon-128.png diff --git a/src/main/dotnet/EarthModelStudio/Assets/icon-256.png b/GC-BOOT/Assets/icon-256.png similarity index 100% rename from src/main/dotnet/EarthModelStudio/Assets/icon-256.png rename to GC-BOOT/Assets/icon-256.png diff --git a/src/main/dotnet/EarthModelStudio/Assets/icon-32.png b/GC-BOOT/Assets/icon-32.png similarity index 100% rename from src/main/dotnet/EarthModelStudio/Assets/icon-32.png rename to GC-BOOT/Assets/icon-32.png diff --git a/src/main/dotnet/EarthModelStudio/Assets/icon-512.png b/GC-BOOT/Assets/icon-512.png similarity index 100% rename from src/main/dotnet/EarthModelStudio/Assets/icon-512.png rename to GC-BOOT/Assets/icon-512.png diff --git a/src/main/dotnet/EarthModelStudio/Assets/icon-64.png b/GC-BOOT/Assets/icon-64.png similarity index 100% rename from src/main/dotnet/EarthModelStudio/Assets/icon-64.png rename to GC-BOOT/Assets/icon-64.png diff --git a/src/main/dotnet/EarthModelStudio/Assets/icon.ico b/GC-BOOT/Assets/icon.ico similarity index 100% rename from src/main/dotnet/EarthModelStudio/Assets/icon.ico rename to GC-BOOT/Assets/icon.ico diff --git a/src/main/dotnet/EarthModelStudio/Assets/icon.png b/GC-BOOT/Assets/icon.png similarity index 100% rename from src/main/dotnet/EarthModelStudio/Assets/icon.png rename to GC-BOOT/Assets/icon.png diff --git a/src/main/dotnet/EarthModelStudio/EarthModelStudio.csproj b/GC-BOOT/GC.csproj similarity index 83% rename from src/main/dotnet/EarthModelStudio/EarthModelStudio.csproj rename to GC-BOOT/GC.csproj index f1a6f47..6fad61d 100644 --- a/src/main/dotnet/EarthModelStudio/EarthModelStudio.csproj +++ b/GC-BOOT/GC.csproj @@ -4,8 +4,8 @@ WinExe enable true - EarthModelStudio - EarthModelStudio + GC + GC app.manifest Assets\icon.ico @@ -16,6 +16,7 @@ + @@ -27,7 +28,7 @@ - + diff --git a/src/main/dotnet/EarthModelStudio/Models/AppSettings.cs b/GC-BOOT/Models/AppSettings.cs similarity index 98% rename from src/main/dotnet/EarthModelStudio/Models/AppSettings.cs rename to GC-BOOT/Models/AppSettings.cs index 5f62a11..d45567d 100644 --- a/src/main/dotnet/EarthModelStudio/Models/AppSettings.cs +++ b/GC-BOOT/Models/AppSettings.cs @@ -2,7 +2,7 @@ using System; using System.Collections.Generic; using System.Text.Json.Serialization; -namespace EarthModelStudio.Models; +namespace GC.Models; /// 应用设置,持久化到 data/settings.json。 public sealed class AppSettings diff --git a/src/main/dotnet/EarthModelStudio/Models/ModelManifest.cs b/GC-BOOT/Models/ModelManifest.cs similarity index 99% rename from src/main/dotnet/EarthModelStudio/Models/ModelManifest.cs rename to GC-BOOT/Models/ModelManifest.cs index 42a1cf6..22a4513 100644 --- a/src/main/dotnet/EarthModelStudio/Models/ModelManifest.cs +++ b/GC-BOOT/Models/ModelManifest.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using System.Text.Json.Serialization; -namespace EarthModelStudio.Models; +namespace GC.Models; /// model/<id>/<id>.json 的内容。 public sealed class ModelManifest diff --git a/src/main/dotnet/EarthModelStudio/Program.cs b/GC-BOOT/Program.cs similarity index 91% rename from src/main/dotnet/EarthModelStudio/Program.cs rename to GC-BOOT/Program.cs index eccd39e..16e33d1 100644 --- a/src/main/dotnet/EarthModelStudio/Program.cs +++ b/GC-BOOT/Program.cs @@ -1,8 +1,8 @@ using System; using Avalonia; -using EarthModelStudio.Services; +using GC.Services; -namespace EarthModelStudio; +namespace GC; internal static class Program { diff --git a/src/main/dotnet/EarthModelStudio/Services/AppPaths.cs b/GC-BOOT/Services/AppPaths.cs similarity index 94% rename from src/main/dotnet/EarthModelStudio/Services/AppPaths.cs rename to GC-BOOT/Services/AppPaths.cs index 001ce37..75c2aba 100644 --- a/src/main/dotnet/EarthModelStudio/Services/AppPaths.cs +++ b/GC-BOOT/Services/AppPaths.cs @@ -2,13 +2,13 @@ using System; using System.Threading.Tasks; using System.IO; -namespace EarthModelStudio.Services; +namespace GC.Services; /// /// 运行目录约定(可执行文件旁边,不内置任何模型): /// /// <安装目录>/ -/// EarthModelStudio(.exe | .app/...) +/// GC(.exe | .app/...) /// .GC/ /// settings.json 设置与已安装版本记录 /// model/ 模型(启动时下载;model 目录也在 .GC 里) @@ -20,6 +20,8 @@ namespace EarthModelStudio.Services; /// public sealed class AppPaths { + private Task _developmentModelsSync = Task.CompletedTask; + /// 安装目录(开发态为仓库根)。 public string AppRoot { get; private init; } = ""; @@ -48,7 +50,7 @@ public sealed class AppPaths // 判定「当前目录」:程序实际所在的位置。 // · 发布版:可执行文件所在目录(单文件时为 exe 旁,否则为 apphost 目录) - // · 源码版:仓库根(含 EarthModelStudio.sln 的目录) + // · 源码版:仓库根(含 GC.sln 的目录) // // 重要:源码版由 `dotnet run` 启动时 Environment.ProcessPath 指向 dotnet 宿主, // 直接用它会把 .GC 与更新包写到 dotnet 安装目录去,所以必须先识别源码版。 @@ -56,7 +58,7 @@ public sealed class AppPaths if (string.IsNullOrWhiteSpace(repoRoot) || !Directory.Exists(repoRoot)) repoRoot = FindRepoRoot(baseDir); var isDev = !string.IsNullOrEmpty(repoRoot) && - File.Exists(Path.Combine(repoRoot!, "EarthModelStudio.sln")); + File.Exists(Path.Combine(repoRoot!, "GC.sln")); string installDir; if (isDev) @@ -112,7 +114,7 @@ public sealed class AppPaths home = CanWrite(portableHome) ? portableHome : Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), - "EarthModelStudio", ".GC"); + "GC", ".GC"); } var envModels = Environment.GetEnvironmentVariable("EMS_MODELS"); @@ -148,7 +150,7 @@ public sealed class AppPaths } /// - /// 从程序所在位置向上找仓库根(含 EarthModelStudio.sln 的目录)。 + /// 从程序所在位置向上找仓库根(含 GC.sln 的目录)。 /// /// 关键:程序若位于 .app 包内(或 dist/ 等发布产物目录),**不算开发态**。 /// 否则把 .app 放在仓库的 dist/ 下运行时,会一路向上命中仓库根的 .sln, @@ -166,7 +168,7 @@ public sealed class AppPaths var name = dir.Name; if (string.Equals(name, "dist", StringComparison.OrdinalIgnoreCase)) return null; - if (File.Exists(Path.Combine(dir.FullName, "EarthModelStudio.sln"))) + if (File.Exists(Path.Combine(dir.FullName, "GC.sln"))) { // 再确认不是从「发布输出目录」里往上找来的 if (IsUnderPublishOutput(start, dir.FullName)) return null; @@ -249,13 +251,15 @@ public sealed class AppPaths // 放到后台线程:这一步要复制 coastline.json 等大文件,同步做会拖慢启动。 if (IsDevelopment && string.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable("EMS_MODELS"))) { - var root = HomeRoot; + var modelRoot = ModelRoot; var source = Path.Combine(AppRoot, "model"); if (Directory.Exists(source)) - Task.Run(() => SyncDevelopmentModels(root, source)); + _developmentModelsSync = Task.Run(() => SyncDevelopmentModels(modelRoot, source)); } } + public void WaitForDevelopmentModels() => _developmentModelsSync.GetAwaiter().GetResult(); + private static void SyncDevelopmentModels(string modelRoot, string source) { try diff --git a/src/main/dotnet/EarthModelStudio/Services/AppServices.cs b/GC-BOOT/Services/AppServices.cs similarity index 98% rename from src/main/dotnet/EarthModelStudio/Services/AppServices.cs rename to GC-BOOT/Services/AppServices.cs index c1befed..6ea91b8 100644 --- a/src/main/dotnet/EarthModelStudio/Services/AppServices.cs +++ b/GC-BOOT/Services/AppServices.cs @@ -1,6 +1,6 @@ using System; -namespace EarthModelStudio.Services; +namespace GC.Services; /// 组合根:一处初始化所有服务。 public sealed class AppServices diff --git a/src/main/dotnet/EarthModelStudio/Services/ContributorsService.cs b/GC-BOOT/Services/ContributorsService.cs similarity index 97% rename from src/main/dotnet/EarthModelStudio/Services/ContributorsService.cs rename to GC-BOOT/Services/ContributorsService.cs index 012b27c..517ab2f 100644 --- a/src/main/dotnet/EarthModelStudio/Services/ContributorsService.cs +++ b/GC-BOOT/Services/ContributorsService.cs @@ -5,7 +5,7 @@ using System.Text.Json; using System.Threading; using System.Threading.Tasks; -namespace EarthModelStudio.Services; +namespace GC.Services; /// GitCode 仓库的一位贡献者。 public sealed class Contributor @@ -54,7 +54,7 @@ public static class ContributorsService private static HttpClient CreateHttp() { var c = new HttpClient { Timeout = TimeSpan.FromSeconds(10) }; - c.DefaultRequestHeaders.UserAgent.ParseAdd("EarthModelStudio/1.0"); + c.DefaultRequestHeaders.UserAgent.ParseAdd("GC/1.0"); c.DefaultRequestHeaders.Accept.ParseAdd("application/json"); return c; } diff --git a/src/main/dotnet/EarthModelStudio/Services/DirectoryRemote.cs b/GC-BOOT/Services/DirectoryRemote.cs similarity index 99% rename from src/main/dotnet/EarthModelStudio/Services/DirectoryRemote.cs rename to GC-BOOT/Services/DirectoryRemote.cs index a634021..4cc19a2 100644 --- a/src/main/dotnet/EarthModelStudio/Services/DirectoryRemote.cs +++ b/GC-BOOT/Services/DirectoryRemote.cs @@ -5,7 +5,7 @@ using System.Net.Http; using System.Threading; using System.Threading.Tasks; -namespace EarthModelStudio.Services; +namespace GC.Services; /// /// 本地目录源:用于离线教学(U 盘 / 共享盘里的仓库副本)与自动化测试。 diff --git a/src/main/dotnet/EarthModelStudio/Services/DownloadCenter.cs b/GC-BOOT/Services/DownloadCenter.cs similarity index 98% rename from src/main/dotnet/EarthModelStudio/Services/DownloadCenter.cs rename to GC-BOOT/Services/DownloadCenter.cs index df5434a..cf1c8b3 100644 --- a/src/main/dotnet/EarthModelStudio/Services/DownloadCenter.cs +++ b/GC-BOOT/Services/DownloadCenter.cs @@ -5,9 +5,9 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; using CommunityToolkit.Mvvm.ComponentModel; -using EarthModelStudio.Models; +using GC.Models; -namespace EarthModelStudio.Services; +namespace GC.Services; public enum DownloadState { diff --git a/src/main/dotnet/EarthModelStudio/Services/GitCodeReleaseRemote.cs b/GC-BOOT/Services/GitCodeReleaseRemote.cs similarity index 98% rename from src/main/dotnet/EarthModelStudio/Services/GitCodeReleaseRemote.cs rename to GC-BOOT/Services/GitCodeReleaseRemote.cs index 2b04882..0e3a44a 100644 --- a/src/main/dotnet/EarthModelStudio/Services/GitCodeReleaseRemote.cs +++ b/GC-BOOT/Services/GitCodeReleaseRemote.cs @@ -5,7 +5,7 @@ using System.Text.Json; using System.Threading; using System.Threading.Tasks; -namespace EarthModelStudio.Services; +namespace GC.Services; /// /// 启动器更新走 GitCode Release,模型仍走仓库 contents API 的远端源。 @@ -32,7 +32,7 @@ public sealed class GitCodeReleaseRemote : IModelRemote private static HttpClient CreateHttp() { var client = new HttpClient { Timeout = TimeSpan.FromSeconds(15) }; - client.DefaultRequestHeaders.UserAgent.ParseAdd("EarthModelStudio-Updater/1.0"); + client.DefaultRequestHeaders.UserAgent.ParseAdd("GC-Updater/1.0"); client.DefaultRequestHeaders.Accept.ParseAdd("application/json"); return client; } diff --git a/src/main/dotnet/EarthModelStudio/Services/GitCodeRemote.cs b/GC-BOOT/Services/GitCodeRemote.cs similarity index 98% rename from src/main/dotnet/EarthModelStudio/Services/GitCodeRemote.cs rename to GC-BOOT/Services/GitCodeRemote.cs index 258d2d2..ce6478b 100644 --- a/src/main/dotnet/EarthModelStudio/Services/GitCodeRemote.cs +++ b/GC-BOOT/Services/GitCodeRemote.cs @@ -7,7 +7,7 @@ using System.Text.Json; using System.Threading; using System.Threading.Tasks; -namespace EarthModelStudio.Services; +namespace GC.Services; /// /// gitcode 仓库源。默认地址来自 AppSettings.UpdateRepository @@ -39,7 +39,7 @@ public sealed class GitCodeRemote : IModelRemote ? DefaultRepository : repository!.TrimEnd('/'); _http = new HttpClient { Timeout = TimeSpan.FromMinutes(2) }; - _http.DefaultRequestHeaders.UserAgent.ParseAdd("EarthModelStudio-Updater/1.0"); + _http.DefaultRequestHeaders.UserAgent.ParseAdd("GC-Updater/1.0"); _http.DefaultRequestHeaders.Accept.ParseAdd("application/json"); if (string.IsNullOrWhiteSpace(manifestUrl)) @@ -108,7 +108,7 @@ public sealed class GitCodeRemote : IModelRemote } if (!payload.TrimStart().StartsWith("{", StringComparison.Ordinal)) return null; var version = System.Text.Json.JsonSerializer.Deserialize( - payload, EarthModelStudio.Services.Json.Options); + payload, GC.Services.Json.Options); // 404 / 错误页也可能返回一个 JSON 对象,用 generated 确认这确实是版本清单 return version != null && !string.IsNullOrWhiteSpace(version.Generated) ? version : null; } diff --git a/src/main/dotnet/EarthModelStudio/Services/GiteaRemote.cs b/GC-BOOT/Services/GiteaRemote.cs similarity index 98% rename from src/main/dotnet/EarthModelStudio/Services/GiteaRemote.cs rename to GC-BOOT/Services/GiteaRemote.cs index 6da6c28..855eba5 100644 --- a/src/main/dotnet/EarthModelStudio/Services/GiteaRemote.cs +++ b/GC-BOOT/Services/GiteaRemote.cs @@ -6,7 +6,7 @@ using System.Text.Json; using System.Threading; using System.Threading.Tasks; -namespace EarthModelStudio.Services; +namespace GC.Services; /// /// Gitea / Forgejo 后端(Xhmcl 用的就是这个)。 @@ -27,7 +27,7 @@ public sealed class GiteaRemote : IModelRemote private static HttpClient CreateHttp() { var c = new HttpClient { Timeout = TimeSpan.FromSeconds(20) }; - c.DefaultRequestHeaders.UserAgent.ParseAdd("EarthModelStudio-Updater/1.0"); + c.DefaultRequestHeaders.UserAgent.ParseAdd("GC-Updater/1.0"); c.DefaultRequestHeaders.Accept.ParseAdd("application/json"); return c; } diff --git a/src/main/dotnet/EarthModelStudio/Services/Json.cs b/GC-BOOT/Services/Json.cs similarity index 96% rename from src/main/dotnet/EarthModelStudio/Services/Json.cs rename to GC-BOOT/Services/Json.cs index 3264bd7..2dde35c 100644 --- a/src/main/dotnet/EarthModelStudio/Services/Json.cs +++ b/GC-BOOT/Services/Json.cs @@ -2,7 +2,7 @@ using System.Text.Encodings.Web; using System.Text.Json; using System.Text.Json.Serialization; -namespace EarthModelStudio.Services; +namespace GC.Services; public static class Json { diff --git a/src/main/dotnet/EarthModelStudio/Services/LauncherUpdateFlow.cs b/GC-BOOT/Services/LauncherUpdateFlow.cs similarity index 98% rename from src/main/dotnet/EarthModelStudio/Services/LauncherUpdateFlow.cs rename to GC-BOOT/Services/LauncherUpdateFlow.cs index 8834519..55219ad 100644 --- a/src/main/dotnet/EarthModelStudio/Services/LauncherUpdateFlow.cs +++ b/GC-BOOT/Services/LauncherUpdateFlow.cs @@ -6,9 +6,9 @@ using Avalonia; using Avalonia.Controls; using Avalonia.Controls.ApplicationLifetimes; using Avalonia.Threading; -using EarthModelStudio.Views; +using GC.Views; -namespace EarthModelStudio.Services; +namespace GC.Services; /// /// 启动器更新的完整交互流程(「检查更新」与「重新下载启动器」共用): diff --git a/src/main/dotnet/EarthModelStudio/Services/LauncherUpdater.cs b/GC-BOOT/Services/LauncherUpdater.cs similarity index 98% rename from src/main/dotnet/EarthModelStudio/Services/LauncherUpdater.cs rename to GC-BOOT/Services/LauncherUpdater.cs index 814f8e2..19ffcd9 100644 --- a/src/main/dotnet/EarthModelStudio/Services/LauncherUpdater.cs +++ b/GC-BOOT/Services/LauncherUpdater.cs @@ -7,7 +7,7 @@ using System.Security.Cryptography; using System.Threading; using System.Threading.Tasks; -namespace EarthModelStudio.Services; +namespace GC.Services; // =========================================================================== // 启动器更新模块(唯一实现) @@ -211,14 +211,14 @@ public static class LauncherUpdater { using var ms = new MemoryStream(zip); using var archive = new System.IO.Compression.ZipArchive(ms, System.IO.Compression.ZipArchiveMode.Read); - // 找主程序:app 内的可执行文件 / EarthModelStudio.dll / 单文件 exe + // 找主程序:app 内的可执行文件 / GC.dll / 单文件 exe var entry = archive.Entries.FirstOrDefault(e => - e.Name.Equals("EarthModelStudio.dll", StringComparison.OrdinalIgnoreCase)) + e.Name.Equals("GC.dll", StringComparison.OrdinalIgnoreCase)) ?? archive.Entries.FirstOrDefault(e => - e.Name.Equals("EarthModelStudio", StringComparison.OrdinalIgnoreCase)) + e.Name.Equals("GC", StringComparison.OrdinalIgnoreCase)) ?? archive.Entries.FirstOrDefault(e => e.Name.EndsWith(".dll", StringComparison.OrdinalIgnoreCase) && - e.Name.StartsWith("EarthModelStudio", StringComparison.OrdinalIgnoreCase)); + e.Name.StartsWith("GC", StringComparison.OrdinalIgnoreCase)); if (entry == null) return null; await using var es = entry.Open(); @@ -395,7 +395,7 @@ public static class LauncherUpdater if (!File.Exists(marker)) return false; // 安全阀:绝不在源码目录执行替换(防止误删源码) - if (File.Exists(Path.Combine(paths.InstallDirectory, "EarthModelStudio.sln"))) + if (File.Exists(Path.Combine(paths.InstallDirectory, "GC.sln"))) { Console.Error.WriteLine("源码版:新版已下载,但拒绝在源码目录执行替换"); return false; diff --git a/src/main/dotnet/EarthModelStudio/Services/Localization.cs b/GC-BOOT/Services/Localization.cs similarity index 97% rename from src/main/dotnet/EarthModelStudio/Services/Localization.cs rename to GC-BOOT/Services/Localization.cs index d6755a0..96c2059 100644 --- a/src/main/dotnet/EarthModelStudio/Services/Localization.cs +++ b/GC-BOOT/Services/Localization.cs @@ -8,7 +8,7 @@ using Avalonia.Markup.Xaml; using Avalonia.Data; using Avalonia.Platform; -namespace EarthModelStudio.Services; +namespace GC.Services; /// 轻量 i18n:键值表 + 运行时切换(所有绑定自动刷新)。 public sealed class L : INotifyPropertyChanged @@ -75,7 +75,7 @@ public sealed class L : INotifyPropertyChanged { try { - var uri = new Uri($"avares://EarthModelStudio/Assets/i18n/{code}.json"); + var uri = new Uri($"avares://GC/Assets/i18n/{code}.json"); using var stream = AssetLoader.Open(uri); using var reader = new StreamReader(stream); return JsonSerializer.Deserialize>(reader.ReadToEnd(), diff --git a/src/main/dotnet/EarthModelStudio/Services/MemoryBudget.cs b/GC-BOOT/Services/MemoryBudget.cs similarity index 92% rename from src/main/dotnet/EarthModelStudio/Services/MemoryBudget.cs rename to GC-BOOT/Services/MemoryBudget.cs index b779411..da44456 100644 --- a/src/main/dotnet/EarthModelStudio/Services/MemoryBudget.cs +++ b/GC-BOOT/Services/MemoryBudget.cs @@ -1,6 +1,6 @@ using System; -namespace EarthModelStudio.Services; +namespace GC.Services; /// /// 启动时运行内存分配(类似启动器的 -Xmx)。 @@ -11,7 +11,7 @@ public sealed class MemoryBudget { public int BudgetMb { get; private set; } = 2048; public long BudgetBytes => (long)BudgetMb * 1024L * 1024L; - public long ManagedBytes => GC.GetTotalMemory(false); + public long ManagedBytes => System.GC.GetTotalMemory(false); public event Action? Changed; @@ -29,7 +29,7 @@ public sealed class MemoryBudget { try { - var info = GC.GetGCMemoryInfo(); + var info = System.GC.GetGCMemoryInfo(); var totalMb = info.TotalAvailableMemoryBytes / (1024.0 * 1024.0); if (totalMb > 0) return (int)Math.Clamp(Math.Round(totalMb / 4.0 / 256.0) * 256, 512, 8192); diff --git a/src/main/dotnet/EarthModelStudio/Services/ModelHost.cs b/GC-BOOT/Services/ModelHost.cs similarity index 98% rename from src/main/dotnet/EarthModelStudio/Services/ModelHost.cs rename to GC-BOOT/Services/ModelHost.cs index 5241211..4404cb6 100644 --- a/src/main/dotnet/EarthModelStudio/Services/ModelHost.cs +++ b/GC-BOOT/Services/ModelHost.cs @@ -5,10 +5,10 @@ using System.Reflection; using System.Runtime.Loader; using System.Threading.Tasks; using Avalonia.Controls; -using EarthModelStudio.Models; -using EarthModelStudio.ModelSdk; +using GC.Models; +using GC.ModelSdk; -namespace EarthModelStudio.Services; +namespace GC.Services; /// /// 模型宿主:按清单加载模型自己的程序集,拿到模型自带的界面。 @@ -176,7 +176,7 @@ public sealed class ModelLoadContext : AssemblyLoadContext { private static readonly HashSet Shared = new(StringComparer.OrdinalIgnoreCase) { - "EarthModelStudio.ModelSdk", + "GC.ModelSdk", "Avalonia", "Avalonia.Base", "Avalonia.Controls", diff --git a/src/main/dotnet/EarthModelStudio/Services/ModelInstaller.cs b/GC-BOOT/Services/ModelInstaller.cs similarity index 98% rename from src/main/dotnet/EarthModelStudio/Services/ModelInstaller.cs rename to GC-BOOT/Services/ModelInstaller.cs index d7336df..673a84f 100644 --- a/src/main/dotnet/EarthModelStudio/Services/ModelInstaller.cs +++ b/GC-BOOT/Services/ModelInstaller.cs @@ -2,9 +2,9 @@ using System; using System.IO; using System.Threading; using System.Threading.Tasks; -using EarthModelStudio.Models; +using GC.Models; -namespace EarthModelStudio.Services; +namespace GC.Services; public static class ModelInstaller { diff --git a/src/main/dotnet/EarthModelStudio/Services/ModelRepository.cs b/GC-BOOT/Services/ModelRepository.cs similarity index 94% rename from src/main/dotnet/EarthModelStudio/Services/ModelRepository.cs rename to GC-BOOT/Services/ModelRepository.cs index 29af023..8c155c9 100644 --- a/src/main/dotnet/EarthModelStudio/Services/ModelRepository.cs +++ b/GC-BOOT/Services/ModelRepository.cs @@ -2,9 +2,9 @@ using System; using System.Collections.Generic; using System.IO; using System.Linq; -using EarthModelStudio.Models; +using GC.Models; -namespace EarthModelStudio.Services; +namespace GC.Services; /// /// 本地模型库。启动器只**扫描 / 删除**模型包,不再解析或缓存任何场景数据 —— @@ -20,6 +20,7 @@ public sealed class ModelRepository public IReadOnlyList Scan() { + _paths.WaitForDevelopmentModels(); var result = new List(); foreach (var (manifest, dir) in ModelScanner.Scan(_paths.ModelRoot)) { diff --git a/src/main/dotnet/EarthModelStudio/Services/ModelScanner.cs b/GC-BOOT/Services/ModelScanner.cs similarity index 97% rename from src/main/dotnet/EarthModelStudio/Services/ModelScanner.cs rename to GC-BOOT/Services/ModelScanner.cs index 3f88f66..f6e5262 100644 --- a/src/main/dotnet/EarthModelStudio/Services/ModelScanner.cs +++ b/GC-BOOT/Services/ModelScanner.cs @@ -1,9 +1,9 @@ using System; using System.Collections.Generic; using System.IO; -using EarthModelStudio.Models; +using GC.Models; -namespace EarthModelStudio.Services; +namespace GC.Services; public static class ModelScanner { diff --git a/src/main/dotnet/EarthModelStudio/Services/ModelSourceClient.cs b/GC-BOOT/Services/ModelSourceClient.cs similarity index 98% rename from src/main/dotnet/EarthModelStudio/Services/ModelSourceClient.cs rename to GC-BOOT/Services/ModelSourceClient.cs index 1290ad9..bf81eaf 100644 --- a/src/main/dotnet/EarthModelStudio/Services/ModelSourceClient.cs +++ b/GC-BOOT/Services/ModelSourceClient.cs @@ -7,9 +7,9 @@ using System.Linq; using System.Net.Http; using System.Threading; using System.Threading.Tasks; -using EarthModelStudio.Models; +using GC.Models; -namespace EarthModelStudio.Services; +namespace GC.Services; /// /// 从链接导入模型源。 @@ -26,7 +26,7 @@ public sealed class ModelSourceClient private static HttpClient CreateHttp() { var client = new HttpClient { Timeout = TimeSpan.FromMinutes(5) }; - client.DefaultRequestHeaders.UserAgent.ParseAdd("EarthModelStudio/1.0 (+model-source)"); + client.DefaultRequestHeaders.UserAgent.ParseAdd("GC/1.0 (+model-source)"); return client; } diff --git a/src/main/dotnet/EarthModelStudio/Services/ReleaseModels.cs b/GC-BOOT/Services/ReleaseModels.cs similarity index 99% rename from src/main/dotnet/EarthModelStudio/Services/ReleaseModels.cs rename to GC-BOOT/Services/ReleaseModels.cs index f42e6fb..049dfb8 100644 --- a/src/main/dotnet/EarthModelStudio/Services/ReleaseModels.cs +++ b/GC-BOOT/Services/ReleaseModels.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -namespace EarthModelStudio.Services; +namespace GC.Services; /// /// GitCode/Gitee v5 releases API 的一条 Release(字段做宽松解析,兼容多种返回格式)。 diff --git a/src/main/dotnet/EarthModelStudio/Services/SettingsService.cs b/GC-BOOT/Services/SettingsService.cs similarity index 97% rename from src/main/dotnet/EarthModelStudio/Services/SettingsService.cs rename to GC-BOOT/Services/SettingsService.cs index a2b4fb1..e0e4237 100644 --- a/src/main/dotnet/EarthModelStudio/Services/SettingsService.cs +++ b/GC-BOOT/Services/SettingsService.cs @@ -2,9 +2,9 @@ using System; using System.Collections.Generic; using System.IO; using System.Linq; -using EarthModelStudio.Models; +using GC.Models; -namespace EarthModelStudio.Services; +namespace GC.Services; public sealed class SettingsService { diff --git a/src/main/dotnet/EarthModelStudio/Services/Shell.cs b/GC-BOOT/Services/Shell.cs similarity index 97% rename from src/main/dotnet/EarthModelStudio/Services/Shell.cs rename to GC-BOOT/Services/Shell.cs index 6791eec..96b203e 100644 --- a/src/main/dotnet/EarthModelStudio/Services/Shell.cs +++ b/GC-BOOT/Services/Shell.cs @@ -2,7 +2,7 @@ using System; using System.Diagnostics; using System.IO; -namespace EarthModelStudio.Services; +namespace GC.Services; public static class Shell { diff --git a/src/main/dotnet/EarthModelStudio/Services/SourcePreset.cs b/GC-BOOT/Services/SourcePreset.cs similarity index 98% rename from src/main/dotnet/EarthModelStudio/Services/SourcePreset.cs rename to GC-BOOT/Services/SourcePreset.cs index 9b41018..82a8523 100644 --- a/src/main/dotnet/EarthModelStudio/Services/SourcePreset.cs +++ b/GC-BOOT/Services/SourcePreset.cs @@ -2,7 +2,7 @@ using System; using System.Collections.Generic; using System.Linq; -namespace EarthModelStudio.Services; +namespace GC.Services; /// /// 内置下载源。只允许这两个,不再支持用户自定义源。 diff --git a/src/main/dotnet/EarthModelStudio/Services/SourceSelector.cs b/GC-BOOT/Services/SourceSelector.cs similarity index 97% rename from src/main/dotnet/EarthModelStudio/Services/SourceSelector.cs rename to GC-BOOT/Services/SourceSelector.cs index 08a430e..8c6be57 100644 --- a/src/main/dotnet/EarthModelStudio/Services/SourceSelector.cs +++ b/GC-BOOT/Services/SourceSelector.cs @@ -6,7 +6,7 @@ using System.Net.Http; using System.Threading; using System.Threading.Tasks; -namespace EarthModelStudio.Services; +namespace GC.Services; /// /// 双源选择:Xhmcl 与 GitCode 是同一份仓库的两个镜像。 @@ -22,7 +22,7 @@ public sealed class SourceSelector private static HttpClient CreateHttp() { var c = new HttpClient { Timeout = TimeSpan.FromSeconds(6) }; - c.DefaultRequestHeaders.UserAgent.ParseAdd("EarthModelStudio-Probe/1.0"); + c.DefaultRequestHeaders.UserAgent.ParseAdd("GC-Probe/1.0"); return c; } diff --git a/src/main/dotnet/EarthModelStudio/Services/UpdateModels.cs b/GC-BOOT/Services/UpdateModels.cs similarity index 98% rename from src/main/dotnet/EarthModelStudio/Services/UpdateModels.cs rename to GC-BOOT/Services/UpdateModels.cs index be88e6d..61bdd12 100644 --- a/src/main/dotnet/EarthModelStudio/Services/UpdateModels.cs +++ b/GC-BOOT/Services/UpdateModels.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; -namespace EarthModelStudio.Services; +namespace GC.Services; /// 仓库根 version.json:由构建脚本 VersionStamp 自动生成,模型一改版本就变。 public sealed class RepoVersion diff --git a/src/main/dotnet/EarthModelStudio/Services/UpdateService.cs b/GC-BOOT/Services/UpdateService.cs similarity index 99% rename from src/main/dotnet/EarthModelStudio/Services/UpdateService.cs rename to GC-BOOT/Services/UpdateService.cs index cdd425d..f5567f7 100644 --- a/src/main/dotnet/EarthModelStudio/Services/UpdateService.cs +++ b/GC-BOOT/Services/UpdateService.cs @@ -8,9 +8,9 @@ using System.Runtime.InteropServices; using System.Security.Cryptography; using System.Threading; using System.Threading.Tasks; -using EarthModelStudio.Models; +using GC.Models; -namespace EarthModelStudio.Services; +namespace GC.Services; /// /// 模型自动更新:读远端版本清单,把缺失/过期的模型下载到 cache 后原子替换 diff --git a/src/main/dotnet/EarthModelStudio/Services/VersionUtil.cs b/GC-BOOT/Services/VersionUtil.cs similarity index 97% rename from src/main/dotnet/EarthModelStudio/Services/VersionUtil.cs rename to GC-BOOT/Services/VersionUtil.cs index 9a5d8a1..98d96c3 100644 --- a/src/main/dotnet/EarthModelStudio/Services/VersionUtil.cs +++ b/GC-BOOT/Services/VersionUtil.cs @@ -1,7 +1,7 @@ using System; using System.Globalization; -namespace EarthModelStudio.Services; +namespace GC.Services; /// /// 版本号工具:Release tag 有 v1.0.6 / GC-1.0.6 / 1.0.6 等写法, diff --git a/src/main/dotnet/EarthModelStudio/Services/ZipSafety.cs b/GC-BOOT/Services/ZipSafety.cs similarity index 97% rename from src/main/dotnet/EarthModelStudio/Services/ZipSafety.cs rename to GC-BOOT/Services/ZipSafety.cs index 7a638a8..997d0b8 100644 --- a/src/main/dotnet/EarthModelStudio/Services/ZipSafety.cs +++ b/GC-BOOT/Services/ZipSafety.cs @@ -2,7 +2,7 @@ using System; using System.IO; using System.IO.Compression; -namespace EarthModelStudio.Services; +namespace GC.Services; /// /// 安全解压:拒绝 zip slip(条目名含 ../、绝对路径、盘符), diff --git a/src/main/dotnet/EarthModelStudio/Styles/AppTheme.axaml b/GC-BOOT/Styles/AppTheme.axaml similarity index 100% rename from src/main/dotnet/EarthModelStudio/Styles/AppTheme.axaml rename to GC-BOOT/Styles/AppTheme.axaml diff --git a/src/main/dotnet/EarthModelStudio/ViewModels/AboutViewModel.cs b/GC-BOOT/ViewModels/AboutViewModel.cs similarity index 97% rename from src/main/dotnet/EarthModelStudio/ViewModels/AboutViewModel.cs rename to GC-BOOT/ViewModels/AboutViewModel.cs index 6243674..706152b 100644 --- a/src/main/dotnet/EarthModelStudio/ViewModels/AboutViewModel.cs +++ b/GC-BOOT/ViewModels/AboutViewModel.cs @@ -4,9 +4,9 @@ using System.Collections.ObjectModel; using System.Threading.Tasks; using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.Input; -using EarthModelStudio.Services; +using GC.Services; -namespace EarthModelStudio.ViewModels; +namespace GC.ViewModels; /// 「关于」页面:版本号 + 开发者(读取仓库 contributors)。 public partial class AboutViewModel : ObservableObject diff --git a/src/main/dotnet/EarthModelStudio/ViewModels/DownloadViewModel.cs b/GC-BOOT/ViewModels/DownloadViewModel.cs similarity index 99% rename from src/main/dotnet/EarthModelStudio/ViewModels/DownloadViewModel.cs rename to GC-BOOT/ViewModels/DownloadViewModel.cs index bef5f9f..142278e 100644 --- a/src/main/dotnet/EarthModelStudio/ViewModels/DownloadViewModel.cs +++ b/GC-BOOT/ViewModels/DownloadViewModel.cs @@ -9,10 +9,10 @@ using System.Threading.Tasks; using System.Windows.Input; using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.Input; -using EarthModelStudio.Models; -using EarthModelStudio.Services; +using GC.Models; +using GC.Services; -namespace EarthModelStudio.ViewModels; +namespace GC.ViewModels; public partial class DownloadViewModel : ObservableObject { diff --git a/src/main/dotnet/EarthModelStudio/ViewModels/HomeViewModel.cs b/GC-BOOT/ViewModels/HomeViewModel.cs similarity index 97% rename from src/main/dotnet/EarthModelStudio/ViewModels/HomeViewModel.cs rename to GC-BOOT/ViewModels/HomeViewModel.cs index 40b9688..fe5f6e3 100644 --- a/src/main/dotnet/EarthModelStudio/ViewModels/HomeViewModel.cs +++ b/GC-BOOT/ViewModels/HomeViewModel.cs @@ -6,11 +6,11 @@ using System.Threading.Tasks; using System.Windows.Input; using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.Input; -using EarthModelStudio.Models; +using GC.Models; using Avalonia.Media.Imaging; -using EarthModelStudio.Services; +using GC.Services; -namespace EarthModelStudio.ViewModels; +namespace GC.ViewModels; public partial class HomeViewModel : ObservableObject { diff --git a/src/main/dotnet/EarthModelStudio/ViewModels/MainViewModel.cs b/GC-BOOT/ViewModels/MainViewModel.cs similarity index 98% rename from src/main/dotnet/EarthModelStudio/ViewModels/MainViewModel.cs rename to GC-BOOT/ViewModels/MainViewModel.cs index 885f8f1..3a3cf08 100644 --- a/src/main/dotnet/EarthModelStudio/ViewModels/MainViewModel.cs +++ b/GC-BOOT/ViewModels/MainViewModel.cs @@ -3,10 +3,10 @@ using System.Linq; using System.Threading.Tasks; using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.Input; -using EarthModelStudio.Models; -using EarthModelStudio.Services; +using GC.Models; +using GC.Services; -namespace EarthModelStudio.ViewModels; +namespace GC.ViewModels; public partial class MainViewModel : ObservableObject { diff --git a/src/main/dotnet/EarthModelStudio/ViewModels/SettingsViewModel.cs b/GC-BOOT/ViewModels/SettingsViewModel.cs similarity index 97% rename from src/main/dotnet/EarthModelStudio/ViewModels/SettingsViewModel.cs rename to GC-BOOT/ViewModels/SettingsViewModel.cs index 27e5dee..59aec31 100644 --- a/src/main/dotnet/EarthModelStudio/ViewModels/SettingsViewModel.cs +++ b/GC-BOOT/ViewModels/SettingsViewModel.cs @@ -5,10 +5,10 @@ using System.Runtime.InteropServices; using System.Windows.Input; using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.Input; -using EarthModelStudio.Models; -using EarthModelStudio.Services; +using GC.Models; +using GC.Services; -namespace EarthModelStudio.ViewModels; +namespace GC.ViewModels; public sealed class LanguageOption { @@ -156,8 +156,8 @@ public partial class SettingsViewModel : ObservableObject private void ClearCache() { // 模型数据由模型自己管理;这里只回收启动器侧托管内存 - GC.Collect(); - GC.WaitForPendingFinalizers(); + System.GC.Collect(); + System.GC.WaitForPendingFinalizers(); _services.Memory.Refresh(); StatusMessage = L.I["set.cacheCleared"]; OnPropertyChanged(nameof(UsageText)); diff --git a/src/main/dotnet/EarthModelStudio/Views/AboutView.axaml b/GC-BOOT/Views/AboutView.axaml similarity index 97% rename from src/main/dotnet/EarthModelStudio/Views/AboutView.axaml rename to GC-BOOT/Views/AboutView.axaml index 729a338..2373e9a 100644 --- a/src/main/dotnet/EarthModelStudio/Views/AboutView.axaml +++ b/GC-BOOT/Views/AboutView.axaml @@ -1,8 +1,8 @@ diff --git a/src/main/dotnet/EarthModelStudio/Views/AboutView.axaml.cs b/GC-BOOT/Views/AboutView.axaml.cs similarity index 86% rename from src/main/dotnet/EarthModelStudio/Views/AboutView.axaml.cs rename to GC-BOOT/Views/AboutView.axaml.cs index ce4bf9b..41f01c4 100644 --- a/src/main/dotnet/EarthModelStudio/Views/AboutView.axaml.cs +++ b/GC-BOOT/Views/AboutView.axaml.cs @@ -1,7 +1,7 @@ using Avalonia.Controls; using Avalonia.Markup.Xaml; -namespace EarthModelStudio.Views; +namespace GC.Views; public partial class AboutView : UserControl { diff --git a/src/main/dotnet/EarthModelStudio/Views/ConfirmWindow.axaml b/GC-BOOT/Views/ConfirmWindow.axaml similarity index 89% rename from src/main/dotnet/EarthModelStudio/Views/ConfirmWindow.axaml rename to GC-BOOT/Views/ConfirmWindow.axaml index 1081d75..ee3414e 100644 --- a/src/main/dotnet/EarthModelStudio/Views/ConfirmWindow.axaml +++ b/GC-BOOT/Views/ConfirmWindow.axaml @@ -1,7 +1,7 @@ + xmlns:loc="using:GC.Services" + x:Class="GC.Views.DownloadView"> diff --git a/src/main/dotnet/EarthModelStudio/Views/DownloadView.axaml.cs b/GC-BOOT/Views/DownloadView.axaml.cs similarity index 83% rename from src/main/dotnet/EarthModelStudio/Views/DownloadView.axaml.cs rename to GC-BOOT/Views/DownloadView.axaml.cs index 064ca9b..9b01258 100644 --- a/src/main/dotnet/EarthModelStudio/Views/DownloadView.axaml.cs +++ b/GC-BOOT/Views/DownloadView.axaml.cs @@ -1,7 +1,7 @@ using Avalonia.Controls; using Avalonia.Markup.Xaml; -namespace EarthModelStudio.Views; +namespace GC.Views; public partial class DownloadView : UserControl { diff --git a/src/main/dotnet/EarthModelStudio/Views/HomeView.axaml b/GC-BOOT/Views/HomeView.axaml similarity index 97% rename from src/main/dotnet/EarthModelStudio/Views/HomeView.axaml rename to GC-BOOT/Views/HomeView.axaml index e110bce..d7d23d9 100644 --- a/src/main/dotnet/EarthModelStudio/Views/HomeView.axaml +++ b/GC-BOOT/Views/HomeView.axaml @@ -1,8 +1,8 @@ + xmlns:loc="using:GC.Services" + xmlns:controls="using:GC.Controls" + x:Class="GC.Views.HomeView"> diff --git a/src/main/dotnet/EarthModelStudio/Views/HomeView.axaml.cs b/GC-BOOT/Views/HomeView.axaml.cs similarity index 82% rename from src/main/dotnet/EarthModelStudio/Views/HomeView.axaml.cs rename to GC-BOOT/Views/HomeView.axaml.cs index da3a9dc..3027178 100644 --- a/src/main/dotnet/EarthModelStudio/Views/HomeView.axaml.cs +++ b/GC-BOOT/Views/HomeView.axaml.cs @@ -1,7 +1,7 @@ using Avalonia.Controls; using Avalonia.Markup.Xaml; -namespace EarthModelStudio.Views; +namespace GC.Views; public partial class HomeView : UserControl { diff --git a/src/main/dotnet/EarthModelStudio/Views/LoadingWindow.cs b/GC-BOOT/Views/LoadingWindow.cs similarity index 98% rename from src/main/dotnet/EarthModelStudio/Views/LoadingWindow.cs rename to GC-BOOT/Views/LoadingWindow.cs index a9ae829..29ac741 100644 --- a/src/main/dotnet/EarthModelStudio/Views/LoadingWindow.cs +++ b/GC-BOOT/Views/LoadingWindow.cs @@ -8,7 +8,7 @@ using Avalonia.Layout; using Avalonia.Media; using Avalonia.Threading; -namespace EarthModelStudio.Views; +namespace GC.Views; /// /// 模型启动进度窗:加载模型程序集、生成地表纹理、构建界面的真实进度。 diff --git a/src/main/dotnet/EarthModelStudio/Views/MainWindow.axaml b/GC-BOOT/Views/MainWindow.axaml similarity index 98% rename from src/main/dotnet/EarthModelStudio/Views/MainWindow.axaml rename to GC-BOOT/Views/MainWindow.axaml index a49f698..0bc6ec9 100644 --- a/src/main/dotnet/EarthModelStudio/Views/MainWindow.axaml +++ b/GC-BOOT/Views/MainWindow.axaml @@ -1,7 +1,7 @@ + xmlns:loc="using:GC.Services" + x:Class="GC.Views.SettingsView"> diff --git a/src/main/dotnet/EarthModelStudio/Views/SettingsView.axaml.cs b/GC-BOOT/Views/SettingsView.axaml.cs similarity index 83% rename from src/main/dotnet/EarthModelStudio/Views/SettingsView.axaml.cs rename to GC-BOOT/Views/SettingsView.axaml.cs index 1939a4b..2cc532c 100644 --- a/src/main/dotnet/EarthModelStudio/Views/SettingsView.axaml.cs +++ b/GC-BOOT/Views/SettingsView.axaml.cs @@ -1,7 +1,7 @@ using Avalonia.Controls; using Avalonia.Markup.Xaml; -namespace EarthModelStudio.Views; +namespace GC.Views; public partial class SettingsView : UserControl { diff --git a/src/main/dotnet/EarthModelStudio/Views/UpdaterWindow.cs b/GC-BOOT/Views/UpdaterWindow.cs similarity index 98% rename from src/main/dotnet/EarthModelStudio/Views/UpdaterWindow.cs rename to GC-BOOT/Views/UpdaterWindow.cs index f2ef171..ebcba7f 100644 --- a/src/main/dotnet/EarthModelStudio/Views/UpdaterWindow.cs +++ b/GC-BOOT/Views/UpdaterWindow.cs @@ -4,9 +4,9 @@ using Avalonia.Controls; using Avalonia.Layout; using Avalonia.Media; using Avalonia.Threading; -using EarthModelStudio.Services; +using GC.Services; -namespace EarthModelStudio.Views; +namespace GC.Views; /// /// 启动器更新进度窗:更新期间主窗口已关闭,由这个独立小窗展示下载进度。 diff --git a/src/main/dotnet/EarthModelStudio/app.manifest b/GC-BOOT/app.manifest similarity index 90% rename from src/main/dotnet/EarthModelStudio/app.manifest rename to GC-BOOT/app.manifest index e3f03fe..4da72a7 100644 --- a/src/main/dotnet/EarthModelStudio/app.manifest +++ b/GC-BOOT/app.manifest @@ -1,6 +1,6 @@ - + true/pm diff --git a/src/main/dotnet/EarthModelStudio/Views/PlayerWindow.cs b/GC-DRAW/PlayerWindow.cs similarity index 99% rename from src/main/dotnet/EarthModelStudio/Views/PlayerWindow.cs rename to GC-DRAW/PlayerWindow.cs index 42f2193..c3f8139 100644 --- a/src/main/dotnet/EarthModelStudio/Views/PlayerWindow.cs +++ b/GC-DRAW/PlayerWindow.cs @@ -13,10 +13,10 @@ using Avalonia.Layout; using Avalonia.Media; using Shapes = Avalonia.Controls.Shapes; using Avalonia.VisualTree; -using EarthModelStudio.Models; -using EarthModelStudio.Services; +using GC.Models; +using GC.Services; -namespace EarthModelStudio.Views; +namespace GC.Views; /// /// 模型窗口:**只做窗口宿主**。 diff --git a/EarthModelStudio.sln b/GC.sln similarity index 84% rename from EarthModelStudio.sln rename to GC.sln index 0d3bc4c..8186988 100644 --- a/EarthModelStudio.sln +++ b/GC.sln @@ -3,23 +3,19 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.0.31903.59 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{827E0CD3-B72D-47B6-A68D-7590B98EB39B}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "GC-BOOT", "GC-BOOT", "{827E0CD3-B72D-47B6-A68D-7590B98EB39B}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "main", "main", "{ABAA6554-252E-13CE-1B40-0464A7DBA771}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GC", "GC-BOOT\GC.csproj", "{2E3BE2DB-1C4B-4EA0-9523-43EE910BD54C}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "dotnet", "dotnet", "{F2BBD9FE-F148-5687-ED21-3ABA515A9B22}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "GC", "GC", "{3E72BF5C-0B5E-D5BD-DCAE-6B991004B4A5}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EarthModelStudio", "src\main\dotnet\EarthModelStudio\EarthModelStudio.csproj", "{2E3BE2DB-1C4B-4EA0-9523-43EE910BD54C}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{09578AA7-0862-3E52-D2AA-D8F7E863B74B}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{3E72BF5C-0B5E-D5BD-DCAE-6B991004B4A5}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "dotnet", "dotnet", "{09578AA7-0862-3E52-D2AA-D8F7E863B74B}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EarthModelStudio.Tests", "src\test\dotnet\EarthModelStudio.Tests\EarthModelStudio.Tests.csproj", "{D15CB92F-5E5C-4516-8D07-C244FC0CD113}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GC.Tests", "GC\src\test\dotnet\GC.Tests\GC.Tests.csproj", "{D15CB92F-5E5C-4516-8D07-C244FC0CD113}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_sdk", "_sdk", "{26AABC0C-8B8D-F9B8-86B4-01B1A96D59F4}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EarthModelStudio.ModelSdk", "model\_sdk\EarthModelStudio.ModelSdk\EarthModelStudio.ModelSdk.csproj", "{C8FAB8D5-CAB7-42D7-8A1F-4B79771A2CE0}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GC.ModelSdk", "model\_sdk\GC.ModelSdk\GC.ModelSdk.csproj", "{C8FAB8D5-CAB7-42D7-8A1F-4B79771A2CE0}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "model", "model", "{62B8A37E-7066-D91A-6443-87D4E6CE63FE}" EndProject @@ -110,10 +106,7 @@ Global HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution - {ABAA6554-252E-13CE-1B40-0464A7DBA771} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B} - {F2BBD9FE-F148-5687-ED21-3ABA515A9B22} = {ABAA6554-252E-13CE-1B40-0464A7DBA771} - {2E3BE2DB-1C4B-4EA0-9523-43EE910BD54C} = {F2BBD9FE-F148-5687-ED21-3ABA515A9B22} - {3E72BF5C-0B5E-D5BD-DCAE-6B991004B4A5} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B} + {2E3BE2DB-1C4B-4EA0-9523-43EE910BD54C} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B} {09578AA7-0862-3E52-D2AA-D8F7E863B74B} = {3E72BF5C-0B5E-D5BD-DCAE-6B991004B4A5} {D15CB92F-5E5C-4516-8D07-C244FC0CD113} = {09578AA7-0862-3E52-D2AA-D8F7E863B74B} {C8FAB8D5-CAB7-42D7-8A1F-4B79771A2CE0} = {26AABC0C-8B8D-F9B8-86B4-01B1A96D59F4} diff --git a/src/test/dotnet/EarthModelStudio.Tests/EarthModelStudio.Tests.csproj b/GC/src/test/dotnet/GC.Tests/GC.Tests.csproj similarity index 66% rename from src/test/dotnet/EarthModelStudio.Tests/EarthModelStudio.Tests.csproj rename to GC/src/test/dotnet/GC.Tests/GC.Tests.csproj index ca5d3a8..9117925 100644 --- a/src/test/dotnet/EarthModelStudio.Tests/EarthModelStudio.Tests.csproj +++ b/GC/src/test/dotnet/GC.Tests/GC.Tests.csproj @@ -4,8 +4,8 @@ Exe enable true - EarthModelStudio.Tests - EarthModelStudio.Tests + GC.Tests + GC.Tests @@ -14,7 +14,7 @@ - + diff --git a/src/test/dotnet/EarthModelStudio.Tests/Program.cs b/GC/src/test/dotnet/GC.Tests/Program.cs similarity index 98% rename from src/test/dotnet/EarthModelStudio.Tests/Program.cs rename to GC/src/test/dotnet/GC.Tests/Program.cs index 0e6febf..1f58099 100644 --- a/src/test/dotnet/EarthModelStudio.Tests/Program.cs +++ b/GC/src/test/dotnet/GC.Tests/Program.cs @@ -5,22 +5,22 @@ using System.Threading; using System.IO; using System.IO.Compression; using System.Linq; -using EarthModelStudio.Models; +using GC.Models; using Avalonia; using Avalonia.Controls; using Avalonia.Headless; using Avalonia.Threading; using Avalonia.VisualTree; -using EarthModelStudio; -using EarthModelStudio.Services; -using EarthModelStudio.ViewModels; -using EarthModelStudio.Views; +using GC; +using GC.Services; +using GC.ViewModels; +using GC.Views; -namespace EarthModelStudio.Tests; +namespace GC.Tests; /// /// 离屏校验工具:把启动器页面和模型窗口渲染成 PNG。 -/// 用法:dotnet run --project src/test/dotnet/EarthModelStudio.Tests -- build/screenshots +/// 用法:dotnet run --project GC/src/test/dotnet/GC.Tests -- build/screenshots /// internal static class Program { @@ -221,7 +221,7 @@ internal static class Program var dir = new DirectoryInfo(AppContext.BaseDirectory); for (var i = 0; i < 10 && dir != null; i++, dir = dir.Parent) { - if (File.Exists(Path.Combine(dir.FullName, "EarthModelStudio.sln"))) return dir.FullName; + if (File.Exists(Path.Combine(dir.FullName, "GC.sln"))) return dir.FullName; } return Directory.GetCurrentDirectory(); } diff --git a/README.md b/README.md index 4c79305..bfd05e6 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Earth Model Studio +# GC 天文教学模型**启动器**:管理/启动模型、启动时自动检查并下载最新版模型与启动器、设置语言与内存。 @@ -17,7 +17,7 @@ ``` <安装目录>/ - EarthModelStudio.exe | EarthModelStudio.app/ + GC.exe | GC.app/ .GC/ settings.json 设置 + 已安装版本记录 model/ 启动时下载的模型 @@ -51,23 +51,23 @@ ## 目录结构 ``` -EarthModelStudio/ -├── EarthModelStudio.sln +Repository/ +├── GC.sln ├── Directory.Build.props # 公共构建属性 ├── version.json # ★ 自动生成的版本清单(推送到仓库后才生效) ├── build.sh / build.ps1 # 构建脚本 -├── src/ # ★ 启动器(没有渲染逻辑) -│ └── main/dotnet/EarthModelStudio/ -│ ├── Models/ Services/ # 清单/设置/目录探测/i18n/模型库/下载/自动更新 -│ │ # UpdateService · GitCodeRemote · DirectoryRemote · LauncherUpdate -│ ├── ViewModels/ Views/ # 主页、下载、设置、模型窗口壳、启动更新状态条 -│ └── Assets/i18n/ # 启动器界面语言包 -├── src/test/dotnet/…Tests/ # 离屏校验 + --update-test 离线更新链路验证 +├── GC/ # 原 src 内容 +│ └── src/test/dotnet/GC.Tests/ # 离屏校验 + --update-test 离线更新链路验证 +├── GC-BOOT/ # 启动器(不实现模型绘制) +│ ├── Models/ Services/ # 清单/设置/目录探测/i18n/模型库/下载/自动更新 +│ ├── ViewModels/ Views/ # 主页、下载、设置和启动更新状态 +│ └── Assets/i18n/ # 启动器界面语言包 +├── GC-DRAW/PlayerWindow.cs # 通用模型窗口宿主;实际绘制由模型提供 ├── model/ # ★ 模型的一切 │ ├── version.json # 与根 version.json 相同(便于按 model/ 地址读取) -│ ├── _sdk/EarthModelStudio.ModelSdk/ +│ ├── _sdk/GC.ModelSdk/ │ ├── _engine/ -│ │ ├── src/ # CelestialView / PlanetTexture / EarthModelView … +│ │ ├── src/ # 模型专用引擎与渲染,留在 model 内 │ │ ├── PreviewGen/ # 用模型渲染器生成封面 │ │ └── VersionStamp/ # 按内容指纹自动打版本、生成 version.json │ ├── earth-rotation/ @@ -99,9 +99,9 @@ Windows 用 `.\build.ps1`(参数相同)。 | 产物 | 平台 | | --- | --- | -| `dist/mac-arm64/EarthModelStudio.app` | macOS Apple Silicon | -| `dist/win-x64/EarthModelStudio.exe` | Windows x64 | -| `dist/win-arm64/EarthModelStudio.exe` | Windows on ARM | +| `dist/mac-arm64/GC.app` | macOS Apple Silicon | +| `dist/win-x64/GC.exe` | Windows x64 | +| `dist/win-arm64/GC.exe` | Windows on ARM | 均为自包含单文件启动器,**发布包内不含模型**。改完模型: `./build.sh models` → 把 `version.json` 和 `model/` 推送到 gitcode → 客户端下次启动自动更新。 diff --git a/build.ps1 b/build.ps1 index 4645ed4..7d94d78 100644 --- a/build.ps1 +++ b/build.ps1 @@ -1,5 +1,5 @@ # --------------------------------------------------------------------------- -# Earth Model Studio 构建入口(Windows PowerShell,薄封装) +# GC 构建入口(Windows PowerShell,薄封装) # 实际代码在 buildsh/ 里。Windows 上若无 sh,则走内置的最小实现。 # .\build.ps1 build | check | models | stamp | run | test | clean | doctor # --------------------------------------------------------------------------- @@ -15,10 +15,10 @@ $Root = $PSScriptRoot Set-Location $Root $env:AVALONIA_TELEMETRY_OPTOUT = '1' -$AppProj = 'src/main/dotnet/EarthModelStudio/EarthModelStudio.csproj' -$TestProj = 'src/test/dotnet/EarthModelStudio.Tests/EarthModelStudio.Tests.csproj' +$AppProj = 'GC-BOOT/GC.csproj' +$TestProj = 'GC/src/test/dotnet/GC.Tests/GC.Tests.csproj' $StampProj= 'model/_engine/VersionStamp/VersionStamp.csproj' -$Sln = 'EarthModelStudio.sln' +$Sln = 'GC.sln' $Version = ([regex]::Match((Get-Content Directory.Build.props -Raw), '(.*?)')).Groups[1].Value if (-not $Version) { $Version = '1.0.0' } New-Item -ItemType Directory -Force -Path "$Root/build/logs" | Out-Null diff --git a/build.sh b/build.sh index 37a2693..10572b6 100755 --- a/build.sh +++ b/build.sh @@ -1,6 +1,6 @@ #!/bin/sh # --------------------------------------------------------------------------- -# Earth Model Studio 构建入口(薄封装) +# GC 构建入口(薄封装) # # ./build.sh build 完整发布(原 publish),带 apt 风格进度条 # ./build.sh check 验证:编译 + 自检 + 离屏渲染 + 产物 @@ -21,11 +21,11 @@ export AVALONIA_TELEMETRY_OPTOUT=1 ROOT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) cd "$ROOT_DIR" -APP_PROJ="src/main/dotnet/EarthModelStudio/EarthModelStudio.csproj" +APP_PROJ="GC-BOOT/GC.csproj" PREVIEW_PROJ="model/_engine/PreviewGen/PreviewGen.csproj" STAMP_PROJ="model/_engine/VersionStamp/VersionStamp.csproj" -TEST_PROJ="src/test/dotnet/EarthModelStudio.Tests/EarthModelStudio.Tests.csproj" -SLN="EarthModelStudio.sln" +TEST_PROJ="GC/src/test/dotnet/GC.Tests/GC.Tests.csproj" +SLN="GC.sln" VERSION=$(sed -n 's/.*\(.*\)<\/Version>.*/\1/p' Directory.Build.props | head -1) [ -n "$VERSION" ] || VERSION="1.0.0" diff --git a/buildsh/build.sh b/buildsh/build.sh index e3e7aa6..b6efa4e 100644 --- a/buildsh/build.sh +++ b/buildsh/build.sh @@ -45,7 +45,7 @@ bs_build() { package_mac_app prepare_runtime_layout "dist/win-x64" prepare_runtime_layout "dist/win-arm64" - prepare_runtime_layout "dist/mac-arm64/EarthModelStudio.app/Contents/MacOS" + prepare_runtime_layout "dist/mac-arm64/GC.app/Contents/MacOS" progress_step "打包 zip"; progress_tick 100 pack_launcher diff --git a/buildsh/lib/build_funcs.sh b/buildsh/lib/build_funcs.sh index 82c203d..329f341 100644 --- a/buildsh/lib/build_funcs.sh +++ b/buildsh/lib/build_funcs.sh @@ -24,7 +24,7 @@ build_models() { for DLL in "$DIR"src/bin/Release/net8.0/*.dll; do [ -f "$DLL" ] || continue NAME=$(basename "$DLL") - [ "$NAME" = "EarthModelStudio.ModelSdk.dll" ] && continue + [ "$NAME" = "GC.ModelSdk.dll" ] && continue cp "$DLL" "$DIR$ID.model/" echo " -> model/$ID/$ID.model/$NAME" done @@ -131,12 +131,12 @@ pack_launcher() { done # --- macOS:先得到真实 .app 目录(改名 + 同步 Info.plist)--- - MACAPP="$ROOT_DIR/dist/mac-arm64/EarthModelStudio.app" + MACAPP="$ROOT_DIR/dist/mac-arm64/GC.app" if [ -d "$MACAPP" ]; then FINAL="$ROOT_DIR/dist/GC-${VERSION}-mac-arm64.app" rm -rf "$FINAL" mv "$MACAPP" "$FINAL" - chmod +x "$FINAL/Contents/MacOS/EarthModelStudio" 2>/dev/null || true + chmod +x "$FINAL/Contents/MacOS/GC" 2>/dev/null || true PLIST="$FINAL/Contents/Info.plist" if [ -f "$PLIST" ]; then /usr/libexec/PlistBuddy -c "Set :CFBundleName Morris GC" "$PLIST" 2>/dev/null || true @@ -192,7 +192,7 @@ strip_intermediate_dirs() { package_mac_app() { DIST="$ROOT_DIR/dist/mac-arm64" - APP="$DIST/EarthModelStudio.app" + APP="$DIST/GC.app" rm -rf "$APP" mkdir -p "$APP/Contents/MacOS" "$APP/Contents/Resources" cat > "$APP/Contents/Info.plist" < - CFBundleNameEarth Model Studio - CFBundleDisplayNameEarth Model Studio - CFBundleIdentifiercn.neorf.earthmodelstudio + CFBundleNameGC + CFBundleDisplayNameGC + CFBundleIdentifiercn.neorf.GC CFBundleVersion${VERSION} CFBundleShortVersionString${VERSION} CFBundlePackageTypeAPPL - CFBundleExecutableEarthModelStudio + CFBundleExecutableGC CFBundleInfoDictionaryVersion6.0 LSMinimumSystemVersion11.0 NSHighResolutionCapable @@ -215,12 +215,12 @@ package_mac_app() { PLIST for f in "$DIST"/*; do base=$(basename "$f") - [ "$base" = "EarthModelStudio.app" ] && continue + [ "$base" = "GC.app" ] && continue [ "$base" = ".DS_Store" ] && continue mv "$f" "$APP/Contents/MacOS/" done # 应用图标:由 Assets/icon-1024.png 生成 .icns - ICONSRC="$ROOT_DIR/src/main/dotnet/EarthModelStudio/Assets/icon-1024.png" + ICONSRC="$ROOT_DIR/GC-BOOT/Assets/icon-1024.png" if [ -f "$ICONSRC" ] && command -v iconutil >/dev/null 2>&1; then ICONSET="$DIST/AppIcon.iconset" rm -rf "$ICONSET"; mkdir -p "$ICONSET" @@ -241,7 +241,7 @@ PLIST # 发布包不带 .GC 运行骨架(用户首次启动自行创建),避免覆盖用户数据 rm -rf "$APP/Contents/MacOS/.GC" - chmod +x "$APP/Contents/MacOS/EarthModelStudio" + chmod +x "$APP/Contents/MacOS/GC" echo "==> 已打包 $APP" } diff --git a/model/README.md b/model/README.md index 270980c..e6d7800 100644 --- a/model/README.md +++ b/model/README.md @@ -17,7 +17,7 @@ ``` model/ version.json # 版本清单(与仓库根 version.json 相同,自动生成) - _sdk/EarthModelStudio.ModelSdk/ # 模型契约(启动器与模型唯一的共享代码) + _sdk/GC.ModelSdk/ # 模型契约(启动器与模型唯一的共享代码) _engine/ # 共享引擎源码 src/ # CelestialView / PlanetTexture / EarthModelView / SphereRaster… PreviewGen/ # 用模型渲染器生成封面的小工具 @@ -81,7 +81,7 @@ model/ ## 模型契约(model/_sdk) -模型只依赖一个极小的契约程序集 `EarthModelStudio.ModelSdk`(源码在 `model/_sdk/`): +模型只依赖一个极小的契约程序集 `GC.ModelSdk`(源码在 `model/_sdk/`): ```csharp public interface IModelFactory diff --git a/model/_engine/PreviewGen/PreviewGen.csproj b/model/_engine/PreviewGen/PreviewGen.csproj index abd17f0..63bd4be 100644 --- a/model/_engine/PreviewGen/PreviewGen.csproj +++ b/model/_engine/PreviewGen/PreviewGen.csproj @@ -23,7 +23,7 @@ - + diff --git a/model/_engine/PreviewGen/Program.cs b/model/_engine/PreviewGen/Program.cs index 227d6d2..1be0508 100644 --- a/model/_engine/PreviewGen/Program.cs +++ b/model/_engine/PreviewGen/Program.cs @@ -9,7 +9,7 @@ using Avalonia.Controls; using Avalonia.Headless; using Avalonia.Media.Imaging; using Avalonia.Platform; -using EarthModelStudio.ModelSdk; +using GC.ModelSdk; using NeoRF.EarthModels; namespace NeoRF.EarthModels.Preview; @@ -210,7 +210,7 @@ internal static class Program // 契约与 Avalonia 一律回到默认上下文,与启动器 ModelLoadContext 一致 if (name.Name is null) return null; if (name.Name.StartsWith("System", StringComparison.OrdinalIgnoreCase)) return null; - var shared = new[] { "EarthModelStudio.ModelSdk", "Avalonia", "Avalonia.Base", + var shared = new[] { "GC.ModelSdk", "Avalonia", "Avalonia.Base", "Avalonia.Controls", "Avalonia.Skia", "Avalonia.Themes.Fluent", "SkiaSharp", "HarfBuzzSharp" }; if (shared.Contains(name.Name, StringComparer.OrdinalIgnoreCase)) return null; var candidate = Path.Combine(dataDir, name.Name + ".dll"); diff --git a/model/_engine/src/CelestialView.cs b/model/_engine/src/CelestialView.cs index 23d39ce..6c3790b 100644 --- a/model/_engine/src/CelestialView.cs +++ b/model/_engine/src/CelestialView.cs @@ -403,7 +403,7 @@ public class CelestialView : Control, IDisposable _sphere?.Dispose(); _sphere = null; _sphereSize = 0; - GC.SuppressFinalize(this); + System.GC.SuppressFinalize(this); } private void OnTick(object? sender, EventArgs e) diff --git a/model/_engine/src/EarthModelView.cs b/model/_engine/src/EarthModelView.cs index 73a0638..53f5e5e 100644 --- a/model/_engine/src/EarthModelView.cs +++ b/model/_engine/src/EarthModelView.cs @@ -9,7 +9,7 @@ using Avalonia.Input; using Avalonia.Layout; using Avalonia.Media; using Avalonia.Threading; -using EarthModelStudio.ModelSdk; +using GC.ModelSdk; namespace NeoRF.EarthModels; @@ -187,7 +187,7 @@ public sealed class EarthModelView : UserControl, IDisposable } _canvas.Dispose(); _closeup.Dispose(); - GC.SuppressFinalize(this); + System.GC.SuppressFinalize(this); } private string CurrentView { get; set; } = "rotation"; diff --git a/model/_engine/src/EngineEntry.cs b/model/_engine/src/EngineEntry.cs index dc45319..20495fc 100644 --- a/model/_engine/src/EngineEntry.cs +++ b/model/_engine/src/EngineEntry.cs @@ -1,6 +1,6 @@ using System; using Avalonia.Controls; -using EarthModelStudio.ModelSdk; +using GC.ModelSdk; namespace NeoRF.EarthModels; @@ -40,6 +40,6 @@ public sealed class EarthModelRuntime : IModelRuntime public void Dispose() { _scene = null; - GC.SuppressFinalize(this); + System.GC.SuppressFinalize(this); } } diff --git a/model/_sdk/EarthModelStudio.ModelSdk/EarthModelStudio.ModelSdk.csproj b/model/_sdk/GC.ModelSdk/GC.ModelSdk.csproj similarity index 79% rename from model/_sdk/EarthModelStudio.ModelSdk/EarthModelStudio.ModelSdk.csproj rename to model/_sdk/GC.ModelSdk/GC.ModelSdk.csproj index 6905f6a..49910a7 100644 --- a/model/_sdk/EarthModelStudio.ModelSdk/EarthModelStudio.ModelSdk.csproj +++ b/model/_sdk/GC.ModelSdk/GC.ModelSdk.csproj @@ -4,8 +4,8 @@ net8.0 enable disable - EarthModelStudio.ModelSdk - EarthModelStudio.ModelSdk + GC.ModelSdk + GC.ModelSdk false Earth Model 模型契约:启动器与模型之间唯一的编译期依赖。 diff --git a/model/_sdk/EarthModelStudio.ModelSdk/IModelContracts.cs b/model/_sdk/GC.ModelSdk/IModelContracts.cs similarity index 98% rename from model/_sdk/EarthModelStudio.ModelSdk/IModelContracts.cs rename to model/_sdk/GC.ModelSdk/IModelContracts.cs index 73039a8..98f0891 100644 --- a/model/_sdk/EarthModelStudio.ModelSdk/IModelContracts.cs +++ b/model/_sdk/GC.ModelSdk/IModelContracts.cs @@ -1,7 +1,7 @@ using System; using Avalonia.Controls; -namespace EarthModelStudio.ModelSdk; +namespace GC.ModelSdk; /// /// 模型入口契约。模型程序集里必须有一个公开、无参构造的 实现, diff --git a/model/contour-map/contour-map.json b/model/contour-map/contour-map.json index e41ec57..4f7e95a 100644 --- a/model/contour-map/contour-map.json +++ b/model/contour-map/contour-map.json @@ -25,6 +25,6 @@ "button": "#9FB4D4", "frame": "#0A1524" }, - "updatedAt": "2026-11-14T02:48:20Z", - "build": "4d5485eed8" + "updatedAt": "2026-11-14T04:41:38Z", + "build": "e4299c5c99" } diff --git a/model/contour-map/contour-map.model/ContourMapModel.dll b/model/contour-map/contour-map.model/ContourMapModel.dll index db60c56..c44b4df 100644 Binary files a/model/contour-map/contour-map.model/ContourMapModel.dll and b/model/contour-map/contour-map.model/ContourMapModel.dll differ diff --git a/model/contour-map/src/ContourMapModel.csproj b/model/contour-map/src/ContourMapModel.csproj index 41e6934..302d6d1 100644 --- a/model/contour-map/src/ContourMapModel.csproj +++ b/model/contour-map/src/ContourMapModel.csproj @@ -15,7 +15,7 @@ - + false diff --git a/model/contour-map/src/ContourMapRuntime.cs b/model/contour-map/src/ContourMapRuntime.cs index 72769b6..5aaddb9 100644 --- a/model/contour-map/src/ContourMapRuntime.cs +++ b/model/contour-map/src/ContourMapRuntime.cs @@ -4,7 +4,7 @@ using Avalonia; using Avalonia.Controls; using Avalonia.Layout; using Avalonia.Media; -using EarthModelStudio.ModelSdk; +using GC.ModelSdk; namespace NeoRF.ContourMap; @@ -49,7 +49,7 @@ public sealed class ContourMapRuntime : IModelRuntime { _field = null; _texts = null; - GC.SuppressFinalize(this); + System.GC.SuppressFinalize(this); } private static Dictionary LoadTexts(string dataDir, string language) diff --git a/model/earth-geography/earth-geography.json b/model/earth-geography/earth-geography.json index 5a3a8c4..b251d13 100644 --- a/model/earth-geography/earth-geography.json +++ b/model/earth-geography/earth-geography.json @@ -18,7 +18,7 @@ ], "dataDir": "earth-geography.model", "version": "1.8", - "updatedAt": "2026-11-14T02:48:20Z", + "updatedAt": "2026-11-14T04:41:38Z", "chrome": { "titleBar": "#0C1828", "titleBorder": "#1B2740", @@ -26,5 +26,5 @@ "button": "#9FB4D4", "frame": "#0A1524" }, - "build": "ede9f2fdd0" + "build": "64b985e484" } diff --git a/model/earth-geography/earth-geography.model/EarthGeographyModel.dll b/model/earth-geography/earth-geography.model/EarthGeographyModel.dll index a87fa05..f2c87d9 100644 Binary files a/model/earth-geography/earth-geography.model/EarthGeographyModel.dll and b/model/earth-geography/earth-geography.model/EarthGeographyModel.dll differ diff --git a/model/earth-geography/src/EarthGeographyModel.csproj b/model/earth-geography/src/EarthGeographyModel.csproj index c11e9df..36ba399 100644 --- a/model/earth-geography/src/EarthGeographyModel.csproj +++ b/model/earth-geography/src/EarthGeographyModel.csproj @@ -21,7 +21,7 @@ - + false diff --git a/model/earth-geography/src/GeographyRuntime.cs b/model/earth-geography/src/GeographyRuntime.cs index f3c7ad8..f4fba6e 100644 --- a/model/earth-geography/src/GeographyRuntime.cs +++ b/model/earth-geography/src/GeographyRuntime.cs @@ -5,7 +5,7 @@ using Avalonia; using Avalonia.Controls; using Avalonia.Layout; using Avalonia.Media; -using EarthModelStudio.ModelSdk; +using GC.ModelSdk; namespace NeoRF.EarthModels; @@ -258,7 +258,7 @@ public sealed class GeographyRuntime : IModelRuntime _disposables.Clear(); _view?.StopAnimation(); _view = null; - GC.SuppressFinalize(this); + System.GC.SuppressFinalize(this); } } diff --git a/model/earth-geography/src/GeographyView.cs b/model/earth-geography/src/GeographyView.cs index de17ade..a052c68 100644 --- a/model/earth-geography/src/GeographyView.cs +++ b/model/earth-geography/src/GeographyView.cs @@ -6,7 +6,7 @@ using Avalonia; using Avalonia.Controls; using Avalonia.Input; using Avalonia.Media; -using EarthModelStudio.ModelSdk; +using GC.ModelSdk; namespace NeoRF.EarthModels; diff --git a/model/earth-revolution/earth-revolution.json b/model/earth-revolution/earth-revolution.json index 7860517..793e828 100644 --- a/model/earth-revolution/earth-revolution.json +++ b/model/earth-revolution/earth-revolution.json @@ -24,7 +24,7 @@ "preview": "preview.png", "apiVersion": 1, "version": "1.6", - "updatedAt": "2026-11-14T02:48:20Z", + "updatedAt": "2026-11-14T04:41:38Z", "chrome": { "titleBar": "#0C1828", "titleBorder": "#1B2740", @@ -32,5 +32,5 @@ "button": "#9FB4D4", "frame": "#0A1524" }, - "build": "bbd2908c17" + "build": "7fda246d48" } diff --git a/model/earth-revolution/earth-revolution.model/EarthRevolutionModel.dll b/model/earth-revolution/earth-revolution.model/EarthRevolutionModel.dll index 3c0d4e2..5bfe61b 100644 Binary files a/model/earth-revolution/earth-revolution.model/EarthRevolutionModel.dll and b/model/earth-revolution/earth-revolution.model/EarthRevolutionModel.dll differ diff --git a/model/earth-revolution/src/EarthRevolutionModel.csproj b/model/earth-revolution/src/EarthRevolutionModel.csproj index ced296f..c444249 100644 --- a/model/earth-revolution/src/EarthRevolutionModel.csproj +++ b/model/earth-revolution/src/EarthRevolutionModel.csproj @@ -20,7 +20,7 @@ - + false diff --git a/model/earth-revolution/src/RevolutionModelFactory.cs b/model/earth-revolution/src/RevolutionModelFactory.cs index ea0da18..a369e8e 100644 --- a/model/earth-revolution/src/RevolutionModelFactory.cs +++ b/model/earth-revolution/src/RevolutionModelFactory.cs @@ -1,4 +1,4 @@ -using EarthModelStudio.ModelSdk; +using GC.ModelSdk; namespace NeoRF.EarthModels; diff --git a/model/earth-rotation/earth-rotation.json b/model/earth-rotation/earth-rotation.json index 57d2a7e..61d8f5c 100644 --- a/model/earth-rotation/earth-rotation.json +++ b/model/earth-rotation/earth-rotation.json @@ -24,7 +24,7 @@ "preview": "preview.png", "apiVersion": 1, "version": "1.6", - "updatedAt": "2026-11-14T02:48:20Z", + "updatedAt": "2026-11-14T04:41:38Z", "chrome": { "titleBar": "#0C1828", "titleBorder": "#1B2740", @@ -32,5 +32,5 @@ "button": "#9FB4D4", "frame": "#0A1524" }, - "build": "b54f691efe" + "build": "446633f2b9" } diff --git a/model/earth-rotation/earth-rotation.model/EarthRotationModel.dll b/model/earth-rotation/earth-rotation.model/EarthRotationModel.dll index b97c59a..ff390db 100644 Binary files a/model/earth-rotation/earth-rotation.model/EarthRotationModel.dll and b/model/earth-rotation/earth-rotation.model/EarthRotationModel.dll differ diff --git a/model/earth-rotation/src/EarthRotationModel.csproj b/model/earth-rotation/src/EarthRotationModel.csproj index 5a9d098..20e843b 100644 --- a/model/earth-rotation/src/EarthRotationModel.csproj +++ b/model/earth-rotation/src/EarthRotationModel.csproj @@ -20,7 +20,7 @@ - + false diff --git a/model/earth-rotation/src/RotationModelFactory.cs b/model/earth-rotation/src/RotationModelFactory.cs index 764eab5..7b4cdc2 100644 --- a/model/earth-rotation/src/RotationModelFactory.cs +++ b/model/earth-rotation/src/RotationModelFactory.cs @@ -1,4 +1,4 @@ -using EarthModelStudio.ModelSdk; +using GC.ModelSdk; namespace NeoRF.EarthModels; diff --git a/model/scale-calculator/scale-calculator.json b/model/scale-calculator/scale-calculator.json index 3cf8f5e..ef205b4 100644 --- a/model/scale-calculator/scale-calculator.json +++ b/model/scale-calculator/scale-calculator.json @@ -25,7 +25,7 @@ "preview": "preview.png", "apiVersion": 1, "version": "1.5", - "updatedAt": "2026-11-14T02:48:20Z", + "updatedAt": "2026-11-14T04:41:38Z", "chrome": { "titleBar": "#FFFFFF", "titleBorder": "#E3E8F3", @@ -33,5 +33,5 @@ "button": "#5B6A86", "frame": "#F4F6FB" }, - "build": "f95a08e72a" + "build": "f7913ac484" } diff --git a/model/scale-calculator/scale-calculator.model/ScaleCalculatorModel.dll b/model/scale-calculator/scale-calculator.model/ScaleCalculatorModel.dll index a8d2f6c..3763f61 100644 Binary files a/model/scale-calculator/scale-calculator.model/ScaleCalculatorModel.dll and b/model/scale-calculator/scale-calculator.model/ScaleCalculatorModel.dll differ diff --git a/model/scale-calculator/scale-calculator.model/preview.png b/model/scale-calculator/scale-calculator.model/preview.png index 0a760e2..ace9b69 100644 Binary files a/model/scale-calculator/scale-calculator.model/preview.png and b/model/scale-calculator/scale-calculator.model/preview.png differ diff --git a/model/scale-calculator/src/ScaleCalculatorFactory.cs b/model/scale-calculator/src/ScaleCalculatorFactory.cs index 179465a..88c85dd 100644 --- a/model/scale-calculator/src/ScaleCalculatorFactory.cs +++ b/model/scale-calculator/src/ScaleCalculatorFactory.cs @@ -1,4 +1,4 @@ -using EarthModelStudio.ModelSdk; +using GC.ModelSdk; namespace NeoRF.ScaleCalculator; diff --git a/model/scale-calculator/src/ScaleCalculatorModel.csproj b/model/scale-calculator/src/ScaleCalculatorModel.csproj index 1e2de8f..1d18e91 100644 --- a/model/scale-calculator/src/ScaleCalculatorModel.csproj +++ b/model/scale-calculator/src/ScaleCalculatorModel.csproj @@ -16,7 +16,7 @@ - + false diff --git a/model/scale-calculator/src/ScaleCalculatorRuntime.cs b/model/scale-calculator/src/ScaleCalculatorRuntime.cs index e494d50..8a1f2ca 100644 --- a/model/scale-calculator/src/ScaleCalculatorRuntime.cs +++ b/model/scale-calculator/src/ScaleCalculatorRuntime.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.IO; using System.Text.Json; using Avalonia.Controls; -using EarthModelStudio.ModelSdk; +using GC.ModelSdk; namespace NeoRF.ScaleCalculator; @@ -43,7 +43,7 @@ public sealed class ScaleCalculatorRuntime : IModelRuntime { _data = null; _texts = null; - GC.SuppressFinalize(this); + System.GC.SuppressFinalize(this); } private static Dictionary LoadTexts(string dataDir, string language) diff --git a/model/scale-calculator/src/ScaleCalculatorView.cs b/model/scale-calculator/src/ScaleCalculatorView.cs index e9d115b..17b12e1 100644 --- a/model/scale-calculator/src/ScaleCalculatorView.cs +++ b/model/scale-calculator/src/ScaleCalculatorView.cs @@ -17,7 +17,7 @@ namespace NeoRF.ScaleCalculator; /// public sealed partial class ScaleCalculatorView : UserControl { - // 调色(与 src/main/dotnet/EarthModelStudio/Styles/AppTheme.axaml 一致) + // 调色(与 GC-BOOT/Styles/AppTheme.axaml 一致) internal static readonly Color CAppBg = Color.Parse("#F4F6FB"); internal static readonly Color CSurface = Color.Parse("#FFFFFF"); internal static readonly Color CSurfaceAlt = Color.Parse("#F7F9FE"); diff --git a/model/version.json b/model/version.json index 28b4018..81ff54a 100644 --- a/model/version.json +++ b/model/version.json @@ -1,12 +1,12 @@ { "schema": 1, - "generated": "2026-11-14T02:48:20Z", + "generated": "2026-11-14T04:41:38Z", "repository": "https://gitcode.com/2509_92447106/GC", "branch": "main", "modelDir": "model", "launcher": { "version": "1.0.7", - "revision": "79af318215", + "revision": "", "packages": { "win-x64": { "path": "dist/GC-win-x64.zip", @@ -34,31 +34,31 @@ { "id": "contour-map", "version": "1.0", - "build": "4d5485eed8", + "build": "e4299c5c99", "dir": "model/contour-map" }, { "id": "earth-geography", "version": "1.8", - "build": "ede9f2fdd0", + "build": "64b985e484", "dir": "model/earth-geography" }, { "id": "earth-revolution", "version": "1.6", - "build": "bbd2908c17", + "build": "7fda246d48", "dir": "model/earth-revolution" }, { "id": "earth-rotation", "version": "1.6", - "build": "b54f691efe", + "build": "446633f2b9", "dir": "model/earth-rotation" }, { "id": "scale-calculator", "version": "1.5", - "build": "f95a08e72a", + "build": "f7913ac484", "dir": "model/scale-calculator" } ] diff --git a/version.json b/version.json index 28b4018..81ff54a 100644 --- a/version.json +++ b/version.json @@ -1,12 +1,12 @@ { "schema": 1, - "generated": "2026-11-14T02:48:20Z", + "generated": "2026-11-14T04:41:38Z", "repository": "https://gitcode.com/2509_92447106/GC", "branch": "main", "modelDir": "model", "launcher": { "version": "1.0.7", - "revision": "79af318215", + "revision": "", "packages": { "win-x64": { "path": "dist/GC-win-x64.zip", @@ -34,31 +34,31 @@ { "id": "contour-map", "version": "1.0", - "build": "4d5485eed8", + "build": "e4299c5c99", "dir": "model/contour-map" }, { "id": "earth-geography", "version": "1.8", - "build": "ede9f2fdd0", + "build": "64b985e484", "dir": "model/earth-geography" }, { "id": "earth-revolution", "version": "1.6", - "build": "bbd2908c17", + "build": "7fda246d48", "dir": "model/earth-revolution" }, { "id": "earth-rotation", "version": "1.6", - "build": "b54f691efe", + "build": "446633f2b9", "dir": "model/earth-rotation" }, { "id": "scale-calculator", "version": "1.5", - "build": "f95a08e72a", + "build": "f7913ac484", "dir": "model/scale-calculator" } ]