diff --git a/.gitignore b/.gitignore index 82b552e..9ff1194 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,10 @@ # 运行数据目录(settings/model/cache/update),绝不入库 .GC/ +# .NET 构建中间产物(已跟踪的历史文件不动,只防新增) +bin/ +obj/ + .venv/ venv/ env/ diff --git a/model/_engine/PreviewGen/PreviewGen.csproj b/model/_engine/PreviewGen/PreviewGen.csproj index f8477ab..abd17f0 100644 --- a/model/_engine/PreviewGen/PreviewGen.csproj +++ b/model/_engine/PreviewGen/PreviewGen.csproj @@ -18,6 +18,8 @@ + + diff --git a/model/_engine/PreviewGen/Program.cs b/model/_engine/PreviewGen/Program.cs index 7c7d80b..227d6d2 100644 --- a/model/_engine/PreviewGen/Program.cs +++ b/model/_engine/PreviewGen/Program.cs @@ -1,24 +1,44 @@ using System; +using System.Collections.Generic; using System.IO; using System.Linq; +using System.Reflection; +using System.Runtime.Loader; using Avalonia; using Avalonia.Controls; using Avalonia.Headless; using Avalonia.Media.Imaging; +using Avalonia.Platform; +using EarthModelStudio.ModelSdk; using NeoRF.EarthModels; namespace NeoRF.EarthModels.Preview; /// -/// 封面生成工具:用模型自己的渲染器给每个模型画一张封面 preview.png。 -/// 封面在模型包里,启动器只负责显示 —— 所以公转模型的封面一定就是公转场景。 -/// 用法:dotnet run --project model-src/tools/PreviewGen -- <仓库根> +/// 封面生成工具:给每个模型画一张 preview.png。 +/// +/// 两条路径: +/// 1) 通用路径(默认):按模型清单的 assembly + type 加载模型程序集, +/// 调它自己的 IModelRuntime.CreateView 做 headless 渲染 —— 任何新模型都能自动出封面。 +/// 2) 地球模型路径:仍走共享引擎的 CelestialView(保留 --bench 基准测试能力)。 +/// +/// 封面在模型包里,启动器只负责显示。用法: +/// dotnet run --project model/_engine/PreviewGen -- <仓库根> [--bench] /// internal static class Program { private const int Width = 768; private const int Height = 316; + /// headless 封面应用:带上 Fluent 主题,UserControl 才有模板可渲染。 + private sealed class PreviewApp : Application + { + public override void Initialize() + { + Styles.Add(new Avalonia.Themes.Fluent.FluentTheme()); + } + } + [STAThread] public static int Main(string[] args) { @@ -32,23 +52,53 @@ internal static class Program var bench = args.Contains("--bench"); - AppBuilder.Configure() + AppBuilder.Configure() .UseSkia() .UseHeadless(new AvaloniaHeadlessPlatformOptions { UseHeadlessDrawing = false }) .SetupWithoutStarting(); - foreach (var modelDir in Directory.GetDirectories(modelRoot)) + foreach (var modelDir in Directory.GetDirectories(modelRoot).OrderBy(p => p, StringComparer.Ordinal)) { var id = Path.GetFileName(modelDir); - if (id.StartsWith(".")) continue; - var dataDir = Path.Combine(modelDir, id + ".model"); - var sceneFile = Path.Combine(dataDir, "scene.json"); - if (!File.Exists(sceneFile)) continue; + if (id.StartsWith('.') || id.StartsWith('_')) continue; + var dataDir = Path.Combine(modelDir, id + ".model"); + if (!Directory.Exists(dataDir)) continue; + + var outFile = Path.Combine(dataDir, "preview.png"); + var hasScene = File.Exists(Path.Combine(dataDir, "scene.json")); + + // 基准测试只对地球模型(依赖 CelestialView) + if (bench) + { + if (!hasScene) continue; + BenchEarthModel(dataDir, id); + continue; + } + + var ok = false; + string? err = null; + if (hasScene) + ok = TryRenderEarthModel(dataDir, outFile, out err); + if (!ok) + ok = TryRenderViaContract(modelDir, dataDir, outFile, out err); + if (!ok) + Console.Error.WriteLine($"preview 跳过 {id}:{err}"); + } + + return 0; + } + + // ─────────────────────────────────────────── 地球模型(保留原渲染器,封面一定是真场景) + + private static bool TryRenderEarthModel(string dataDir, string outFile, out string? error) + { + error = null; + try + { var runtime = SceneRuntime.Load(dataDir, 2048); var texts = ModelStrings.Load(dataDir, "zh-CN"); var revolution = string.Equals(runtime.Scene.DefaultView, "revolution", StringComparison.OrdinalIgnoreCase); - var view = new CelestialView { Scene = runtime, @@ -62,52 +112,181 @@ internal static class Program Width = Width, Height = Height }; - view.Measure(new Size(Width, Height)); - view.Arrange(new Rect(0, 0, Width, Height)); + PrepareView(view, Width, Height); view.JumpToOrbit(revolution ? 45 : 0); view.JumpToSpin(20); - - if (bench) - { - // 真实窗口尺寸下的帧耗时 - view.Width = 1240; - view.Height = 820; - view.Measure(new Size(1240, 820)); - view.Arrange(new Rect(0, 0, 1240, 820)); - // 模拟播放态(运动时降分辨率),分别测静止高清帧与运动帧 - var animField = typeof(NeoRF.EarthModels.CelestialView) - .GetField("_animating", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance); - var sw = System.Diagnostics.Stopwatch.StartNew(); - for (var frame = 0; frame < 20; frame++) - { - view.JumpToSpin(20 + frame * 3); - using var tmp = new RenderTargetBitmap(new PixelSize(1240, 820), new Vector(96, 96)); - tmp.Render(view); - } - sw.Stop(); - var still = sw.Elapsed.TotalMilliseconds / 20; - animField?.SetValue(view, true); - sw.Restart(); - for (var frame = 0; frame < 20; frame++) - { - view.JumpToSpin(20 + frame * 3); - using var tmp = new RenderTargetBitmap(new PixelSize(1240, 820), new Vector(96, 96)); - tmp.Render(view); - } - sw.Stop(); - Console.WriteLine($"{id}: 静止 {still:0.0} ms/frame · 播放 {sw.Elapsed.TotalMilliseconds / 20:0.0} ms/frame"); - continue; - } - - var outFile = Path.Combine(dataDir, "preview.png"); - using (var bitmap = new RenderTargetBitmap(new PixelSize(Width, Height), new Vector(96, 96))) - { - bitmap.Render(view); - bitmap.Save(outFile); - } - Console.WriteLine($"preview -> {outFile}"); + Save(view, outFile); + return true; } + catch (Exception ex) + { + error = ex.Message; + return false; + } + } - return 0; + private static void BenchEarthModel(string dataDir, string id) + { + var runtime = SceneRuntime.Load(dataDir, 2048); + var texts = ModelStrings.Load(dataDir, "zh-CN"); + var revolution = string.Equals(runtime.Scene.DefaultView, "revolution", StringComparison.OrdinalIgnoreCase); + var view = new CelestialView + { + Scene = runtime, + Texts = texts, + View = revolution ? SceneView.Revolution : SceneView.Rotation, + IsPlaying = false, + ShowHud = false, + ShowLabels = false, + ShowOrbit = true, + ShowGraticule = true, + Width = Width, + Height = Height + }; + PrepareView(view, Width, Height); + view.JumpToOrbit(revolution ? 45 : 0); + view.JumpToSpin(20); + + view.Width = 1240; + view.Height = 820; + view.Measure(new Size(1240, 820)); + view.Arrange(new Rect(0, 0, 1240, 820)); + var animField = typeof(CelestialView) + .GetField("_animating", BindingFlags.NonPublic | BindingFlags.Instance); + var sw = System.Diagnostics.Stopwatch.StartNew(); + for (var frame = 0; frame < 20; frame++) + { + view.JumpToSpin(20 + frame * 3); + using var tmp = new RenderTargetBitmap(new PixelSize(1240, 820), new Vector(96, 96)); + tmp.Render(view); + } + sw.Stop(); + var still = sw.Elapsed.TotalMilliseconds / 20; + animField?.SetValue(view, true); + sw.Restart(); + for (var frame = 0; frame < 20; frame++) + { + view.JumpToSpin(20 + frame * 3); + using var tmp = new RenderTargetBitmap(new PixelSize(1240, 820), new Vector(96, 96)); + tmp.Render(view); + } + sw.Stop(); + Console.WriteLine($"{id}: 静止 {still:0.0} ms/frame · 播放 {sw.Elapsed.TotalMilliseconds / 20:0.0} ms/frame"); + } + + // ─────────────────────────────────────────── 通用路径:按契约加载模型自己的界面 + + private sealed class PreviewContext : IModelContext + { + public string ModelId { get; init; } = ""; + public string ModelDirectory { get; init; } = ""; + public string DataDirectory { get; init; } = ""; + public string Language => "zh-CN"; + public int MemoryBudgetMb => 512; + public void RequestClose() { } + public void ReportProgress(double value, string? message = null) { } + public void Log(string message) => Console.WriteLine(" " + message); + } + + private static bool TryRenderViaContract(string modelDir, string dataDir, string outFile, out string? error) + { + error = null; + var manifestPath = Path.Combine(modelDir, Path.GetFileName(modelDir) + ".json"); + if (!File.Exists(manifestPath)) { error = "缺少模型清单"; return false; } + + try + { + using var doc = System.Text.Json.JsonDocument.Parse(File.ReadAllText(manifestPath)); + var root = doc.RootElement; + var id = Path.GetFileName(modelDir); + var asmName = GetString(root, "assembly") ?? (id + ".dll"); + var typeName = GetString(root, "type"); + var asmPath = Path.Combine(dataDir, asmName); + if (!File.Exists(asmPath)) { error = $"找不到功能程序集 {asmName}"; return false; } + + var alc = new AssemblyLoadContext("preview:" + id, isCollectible: true); + alc.Resolving += (_, name) => + { + // 契约与 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", + "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"); + return File.Exists(candidate) ? alc.LoadFromAssemblyPath(candidate) : null; + }; + + var asm = alc.LoadFromAssemblyPath(asmPath); + Type? factoryType = null; + if (!string.IsNullOrWhiteSpace(typeName)) + factoryType = asm.GetType(typeName!, throwOnError: false); + factoryType ??= asm.GetTypes().FirstOrDefault(t => + !t.IsAbstract && !t.IsInterface && typeof(IModelFactory).IsAssignableFrom(t)); + if (factoryType == null) { error = "程序集里没有 IModelFactory 实现"; return false; } + if (Activator.CreateInstance(factoryType) is not IModelFactory factory) + { error = "无法创建模型入口"; return false; } + + var runtime = factory.Create(); + var ctx = new PreviewContext + { + ModelId = id, + ModelDirectory = modelDir, + DataDirectory = dataDir + }; + runtime.Prepare(ctx); + var view = runtime.CreateView(ctx); + if (view == null) { error = "模型没有返回界面"; return false; } + + PrepareView(view, Width, Height); + Save(view, outFile); + runtime.Dispose(); + (view as IDisposable)?.Dispose(); + alc.Unload(); + return true; + } + catch (Exception ex) + { + error = ex.ToString(); + return false; + } + } + + private static string? GetString(System.Text.Json.JsonElement e, string name) + => e.TryGetProperty(name, out var v) && v.ValueKind == System.Text.Json.JsonValueKind.String + ? v.GetString() : null; + + // ─────────────────────────────────────────── 公共 + + private static void PrepareView(Control view, double w, double h) + { + // 封面是宽幅(768×316),模型界面按设计尺寸是 1240×820;这里把布局直接按封面 + // 尺寸 Measure/Arrange,让卡片上看到的是完整布局而不是被裁掉一角。 + view.Width = w; + view.Height = h; + view.Measure(new Size(w, h)); + view.Arrange(new Rect(0, 0, w, h)); + } + + private static void Save(Control view, string outFile) + { + // headless 下 UserControl 必须挂进 Window 才有视觉树;直接 Render(Control) + // 会得到一张全黑的图(实测)。地球模型的裸 Control 走同一路径也正常工作。 + var win = new Window + { + Width = Width, + Height = Height, + Background = Avalonia.Media.Brushes.White, + Content = view, + SystemDecorations = SystemDecorations.None, + ShowInTaskbar = false + }; + win.Show(); + using var bitmap = new RenderTargetBitmap(new PixelSize(Width, Height), new Vector(96, 96)); + bitmap.Render(win); + bitmap.Save(outFile); + win.Content = null; + win.Close(); + Console.WriteLine($"preview -> {outFile}"); } } diff --git a/model/_engine/VersionStamp/bin/Release/net8.0/VersionStamp.dll b/model/_engine/VersionStamp/bin/Release/net8.0/VersionStamp.dll index bc7cfec..d14a62d 100644 Binary files a/model/_engine/VersionStamp/bin/Release/net8.0/VersionStamp.dll and b/model/_engine/VersionStamp/bin/Release/net8.0/VersionStamp.dll differ diff --git a/model/_engine/VersionStamp/bin/Release/net8.0/VersionStamp.pdb b/model/_engine/VersionStamp/bin/Release/net8.0/VersionStamp.pdb index 82cfaca..6d8b00c 100644 Binary files a/model/_engine/VersionStamp/bin/Release/net8.0/VersionStamp.pdb and b/model/_engine/VersionStamp/bin/Release/net8.0/VersionStamp.pdb differ diff --git a/model/_engine/VersionStamp/obj/Release/net8.0/VersionStamp.AssemblyInfo.cs b/model/_engine/VersionStamp/obj/Release/net8.0/VersionStamp.AssemblyInfo.cs index fd4b40e..f0c63a2 100644 --- a/model/_engine/VersionStamp/obj/Release/net8.0/VersionStamp.AssemblyInfo.cs +++ b/model/_engine/VersionStamp/obj/Release/net8.0/VersionStamp.AssemblyInfo.cs @@ -13,7 +13,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("NeoRF")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Release")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.4.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.4+f69a8fbb7fa563800802d3c2e319ed56365c3b8c")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.4+936aec81850fb15f55014c66116d174dc9e2f967")] [assembly: System.Reflection.AssemblyProductAttribute("Earth Model Studio")] [assembly: System.Reflection.AssemblyTitleAttribute("VersionStamp")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.4.0")] diff --git a/model/_engine/VersionStamp/obj/Release/net8.0/VersionStamp.AssemblyInfoInputs.cache b/model/_engine/VersionStamp/obj/Release/net8.0/VersionStamp.AssemblyInfoInputs.cache index ca6c729..d833a98 100644 --- a/model/_engine/VersionStamp/obj/Release/net8.0/VersionStamp.AssemblyInfoInputs.cache +++ b/model/_engine/VersionStamp/obj/Release/net8.0/VersionStamp.AssemblyInfoInputs.cache @@ -1 +1 @@ -3b8298611572abd644375ee2ce7c50d06658f3258c6e704cac568afa265ab293 +227dfd55e1626217a9b4b76559607d369bc84a173b8c542681a836eb300be0a1 diff --git a/model/_engine/VersionStamp/obj/Release/net8.0/VersionStamp.dll b/model/_engine/VersionStamp/obj/Release/net8.0/VersionStamp.dll index bc7cfec..d14a62d 100644 Binary files a/model/_engine/VersionStamp/obj/Release/net8.0/VersionStamp.dll and b/model/_engine/VersionStamp/obj/Release/net8.0/VersionStamp.dll differ diff --git a/model/_engine/VersionStamp/obj/Release/net8.0/VersionStamp.pdb b/model/_engine/VersionStamp/obj/Release/net8.0/VersionStamp.pdb index 82cfaca..6d8b00c 100644 Binary files a/model/_engine/VersionStamp/obj/Release/net8.0/VersionStamp.pdb and b/model/_engine/VersionStamp/obj/Release/net8.0/VersionStamp.pdb differ diff --git a/model/_engine/VersionStamp/obj/Release/net8.0/ref/VersionStamp.dll b/model/_engine/VersionStamp/obj/Release/net8.0/ref/VersionStamp.dll index 27f6733..71b4f51 100644 Binary files a/model/_engine/VersionStamp/obj/Release/net8.0/ref/VersionStamp.dll and b/model/_engine/VersionStamp/obj/Release/net8.0/ref/VersionStamp.dll differ diff --git a/model/_engine/VersionStamp/obj/Release/net8.0/refint/VersionStamp.dll b/model/_engine/VersionStamp/obj/Release/net8.0/refint/VersionStamp.dll index 27f6733..71b4f51 100644 Binary files a/model/_engine/VersionStamp/obj/Release/net8.0/refint/VersionStamp.dll and b/model/_engine/VersionStamp/obj/Release/net8.0/refint/VersionStamp.dll differ diff --git a/model/_sdk/EarthModelStudio.ModelSdk/bin/Release/net8.0/EarthModelStudio.ModelSdk.dll b/model/_sdk/EarthModelStudio.ModelSdk/bin/Release/net8.0/EarthModelStudio.ModelSdk.dll index 8e46e48..6f098ca 100644 Binary files a/model/_sdk/EarthModelStudio.ModelSdk/bin/Release/net8.0/EarthModelStudio.ModelSdk.dll and b/model/_sdk/EarthModelStudio.ModelSdk/bin/Release/net8.0/EarthModelStudio.ModelSdk.dll differ diff --git a/model/_sdk/EarthModelStudio.ModelSdk/obj/EarthModelStudio.ModelSdk.csproj.nuget.dgspec.json b/model/_sdk/EarthModelStudio.ModelSdk/obj/EarthModelStudio.ModelSdk.csproj.nuget.dgspec.json index 8973a95..d9a1beb 100644 --- a/model/_sdk/EarthModelStudio.ModelSdk/obj/EarthModelStudio.ModelSdk.csproj.nuget.dgspec.json +++ b/model/_sdk/EarthModelStudio.ModelSdk/obj/EarthModelStudio.ModelSdk.csproj.nuget.dgspec.json @@ -49,6 +49,12 @@ "Avalonia": { "target": "Package", "version": "[11.3.9, )" + }, + "Microsoft.NET.ILLink.Tasks": { + "suppressParent": "All", + "target": "Package", + "version": "[8.0.31, )", + "autoReferenced": true } }, "imports": [ @@ -62,6 +68,16 @@ ], "assetTargetFallback": true, "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Runtime.win-arm64", + "version": "[8.0.31, 8.0.31]" + }, + { + "name": "Microsoft.NETCore.App.Runtime.win-arm64", + "version": "[8.0.31, 8.0.31]" + } + ], "frameworkReferences": { "Microsoft.NETCore.App": { "privateAssets": "all" @@ -69,6 +85,11 @@ }, "runtimeIdentifierGraphPath": "/usr/local/share/dotnet/sdk/10.0.401/PortableRuntimeIdentifierGraph.json" } + }, + "runtimes": { + "win-arm64": { + "#import": [] + } } } } diff --git a/model/_sdk/EarthModelStudio.ModelSdk/obj/EarthModelStudio.ModelSdk.csproj.nuget.g.props b/model/_sdk/EarthModelStudio.ModelSdk/obj/EarthModelStudio.ModelSdk.csproj.nuget.g.props index 49d666c..8d169b0 100644 --- a/model/_sdk/EarthModelStudio.ModelSdk/obj/EarthModelStudio.ModelSdk.csproj.nuget.g.props +++ b/model/_sdk/EarthModelStudio.ModelSdk/obj/EarthModelStudio.ModelSdk.csproj.nuget.g.props @@ -13,9 +13,11 @@ + + /Users/morris/.nuget/packages/microsoft.net.illink.tasks/8.0.31 /Users/morris/.nuget/packages/avalonia.buildservices/11.3.2 /Users/morris/.nuget/packages/avalonia/11.3.9 diff --git a/model/_sdk/EarthModelStudio.ModelSdk/obj/Release/net8.0/EarthModelStudio.ModelSdk.AssemblyInfo.cs b/model/_sdk/EarthModelStudio.ModelSdk/obj/Release/net8.0/EarthModelStudio.ModelSdk.AssemblyInfo.cs index a8a8b1b..8f530c2 100644 --- a/model/_sdk/EarthModelStudio.ModelSdk/obj/Release/net8.0/EarthModelStudio.ModelSdk.AssemblyInfo.cs +++ b/model/_sdk/EarthModelStudio.ModelSdk/obj/Release/net8.0/EarthModelStudio.ModelSdk.AssemblyInfo.cs @@ -14,7 +14,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyConfigurationAttribute("Release")] [assembly: System.Reflection.AssemblyDescriptionAttribute("Earth Model 模型契约:启动器与模型之间唯一的编译期依赖。")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.4.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.4+f69a8fbb7fa563800802d3c2e319ed56365c3b8c")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.4+936aec81850fb15f55014c66116d174dc9e2f967")] [assembly: System.Reflection.AssemblyProductAttribute("Earth Model Studio")] [assembly: System.Reflection.AssemblyTitleAttribute("EarthModelStudio.ModelSdk")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.4.0")] diff --git a/model/_sdk/EarthModelStudio.ModelSdk/obj/Release/net8.0/EarthModelStudio.ModelSdk.AssemblyInfoInputs.cache b/model/_sdk/EarthModelStudio.ModelSdk/obj/Release/net8.0/EarthModelStudio.ModelSdk.AssemblyInfoInputs.cache index e64d77c..0bd2cec 100644 --- a/model/_sdk/EarthModelStudio.ModelSdk/obj/Release/net8.0/EarthModelStudio.ModelSdk.AssemblyInfoInputs.cache +++ b/model/_sdk/EarthModelStudio.ModelSdk/obj/Release/net8.0/EarthModelStudio.ModelSdk.AssemblyInfoInputs.cache @@ -1 +1 @@ -b9b8447b2594c792cbc333c84cc292043141fc69d483deb7c3e65d16b2166d2f +1f535105af85de59d3ced8e39e19db7d5ce25d28d2d77df0d87a42c9c0bf481e diff --git a/model/_sdk/EarthModelStudio.ModelSdk/obj/Release/net8.0/EarthModelStudio.ModelSdk.dll b/model/_sdk/EarthModelStudio.ModelSdk/obj/Release/net8.0/EarthModelStudio.ModelSdk.dll index 8e46e48..6f098ca 100644 Binary files a/model/_sdk/EarthModelStudio.ModelSdk/obj/Release/net8.0/EarthModelStudio.ModelSdk.dll and b/model/_sdk/EarthModelStudio.ModelSdk/obj/Release/net8.0/EarthModelStudio.ModelSdk.dll differ diff --git a/model/_sdk/EarthModelStudio.ModelSdk/obj/Release/net8.0/ref/EarthModelStudio.ModelSdk.dll b/model/_sdk/EarthModelStudio.ModelSdk/obj/Release/net8.0/ref/EarthModelStudio.ModelSdk.dll index 6af9c7d..b50bfdf 100644 Binary files a/model/_sdk/EarthModelStudio.ModelSdk/obj/Release/net8.0/ref/EarthModelStudio.ModelSdk.dll and b/model/_sdk/EarthModelStudio.ModelSdk/obj/Release/net8.0/ref/EarthModelStudio.ModelSdk.dll differ diff --git a/model/_sdk/EarthModelStudio.ModelSdk/obj/Release/net8.0/refint/EarthModelStudio.ModelSdk.dll b/model/_sdk/EarthModelStudio.ModelSdk/obj/Release/net8.0/refint/EarthModelStudio.ModelSdk.dll index 6af9c7d..b50bfdf 100644 Binary files a/model/_sdk/EarthModelStudio.ModelSdk/obj/Release/net8.0/refint/EarthModelStudio.ModelSdk.dll and b/model/_sdk/EarthModelStudio.ModelSdk/obj/Release/net8.0/refint/EarthModelStudio.ModelSdk.dll differ diff --git a/model/_sdk/EarthModelStudio.ModelSdk/obj/project.assets.json b/model/_sdk/EarthModelStudio.ModelSdk/obj/project.assets.json index 5e1f0ac..5f52cca 100644 --- a/model/_sdk/EarthModelStudio.ModelSdk/obj/project.assets.json +++ b/model/_sdk/EarthModelStudio.ModelSdk/obj/project.assets.json @@ -111,6 +111,130 @@ "runtime": { "lib/net5.0/MicroCom.Runtime.dll": {} } + }, + "Microsoft.NET.ILLink.Tasks/8.0.31": { + "type": "package", + "build": { + "build/Microsoft.NET.ILLink.Tasks.props": {} + } + } + }, + "net8.0/win-arm64": { + "Avalonia/11.3.9": { + "type": "package", + "dependencies": { + "Avalonia.BuildServices": "11.3.2", + "Avalonia.Remote.Protocol": "11.3.9", + "MicroCom.Runtime": "0.11.0" + }, + "compile": { + "ref/net8.0/Avalonia.Base.dll": { + "related": ".xml" + }, + "ref/net8.0/Avalonia.Controls.dll": { + "related": ".xml" + }, + "ref/net8.0/Avalonia.DesignerSupport.dll": { + "related": ".xml" + }, + "ref/net8.0/Avalonia.Dialogs.dll": { + "related": ".xml" + }, + "ref/net8.0/Avalonia.Markup.Xaml.dll": { + "related": ".xml" + }, + "ref/net8.0/Avalonia.Markup.dll": { + "related": ".Xaml.xml;.xml" + }, + "ref/net8.0/Avalonia.Metal.dll": { + "related": ".xml" + }, + "ref/net8.0/Avalonia.MicroCom.dll": { + "related": ".xml" + }, + "ref/net8.0/Avalonia.OpenGL.dll": { + "related": ".xml" + }, + "ref/net8.0/Avalonia.Vulkan.dll": { + "related": ".xml" + }, + "ref/net8.0/Avalonia.dll": { + "related": ".Base.xml;.Controls.xml;.DesignerSupport.xml;.Dialogs.xml;.Markup.Xaml.xml;.Markup.xml;.Metal.xml;.MicroCom.xml;.OpenGL.xml;.Vulkan.xml;.xml" + } + }, + "runtime": { + "lib/net8.0/Avalonia.Base.dll": { + "related": ".xml" + }, + "lib/net8.0/Avalonia.Controls.dll": { + "related": ".xml" + }, + "lib/net8.0/Avalonia.DesignerSupport.dll": { + "related": ".xml" + }, + "lib/net8.0/Avalonia.Dialogs.dll": { + "related": ".xml" + }, + "lib/net8.0/Avalonia.Markup.Xaml.dll": { + "related": ".xml" + }, + "lib/net8.0/Avalonia.Markup.dll": { + "related": ".Xaml.xml;.xml" + }, + "lib/net8.0/Avalonia.Metal.dll": { + "related": ".xml" + }, + "lib/net8.0/Avalonia.MicroCom.dll": { + "related": ".xml" + }, + "lib/net8.0/Avalonia.OpenGL.dll": { + "related": ".xml" + }, + "lib/net8.0/Avalonia.Vulkan.dll": { + "related": ".xml" + }, + "lib/net8.0/Avalonia.dll": { + "related": ".Base.xml;.Controls.xml;.DesignerSupport.xml;.Dialogs.xml;.Markup.Xaml.xml;.Markup.xml;.Metal.xml;.MicroCom.xml;.OpenGL.xml;.Vulkan.xml;.xml" + } + }, + "build": { + "buildTransitive/Avalonia.props": {}, + "buildTransitive/Avalonia.targets": {} + } + }, + "Avalonia.BuildServices/11.3.2": { + "type": "package", + "build": { + "buildTransitive/Avalonia.BuildServices.targets": {} + } + }, + "Avalonia.Remote.Protocol/11.3.9": { + "type": "package", + "compile": { + "lib/net8.0/Avalonia.Remote.Protocol.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net8.0/Avalonia.Remote.Protocol.dll": { + "related": ".xml" + } + } + }, + "MicroCom.Runtime/0.11.0": { + "type": "package", + "compile": { + "lib/net5.0/MicroCom.Runtime.dll": {} + }, + "runtime": { + "lib/net5.0/MicroCom.Runtime.dll": {} + } + }, + "Microsoft.NET.ILLink.Tasks/8.0.31": { + "type": "package", + "build": { + "build/Microsoft.NET.ILLink.Tasks.props": {} + } } } }, @@ -333,11 +457,63 @@ "microcom.runtime.0.11.0.nupkg.sha512", "microcom.runtime.nuspec" ] + }, + "Microsoft.NET.ILLink.Tasks/8.0.31": { + "sha512": "OJdAGATV2QoVWL11zlDLEluA06q8rK+cgZR47ohrO8V+Qj5z9dlvN7bG9/0e5t0IOe+yD8tREC0bpsEgDGrzIQ==", + "type": "package", + "path": "microsoft.net.illink.tasks/8.0.31", + "hasTools": true, + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "Sdk/Sdk.props", + "THIRD-PARTY-NOTICES.TXT", + "analyzers/dotnet/cs/ILLink.CodeFixProvider.dll", + "analyzers/dotnet/cs/ILLink.RoslynAnalyzer.dll", + "build/Microsoft.NET.ILLink.Analyzers.props", + "build/Microsoft.NET.ILLink.Tasks.props", + "build/Microsoft.NET.ILLink.targets", + "microsoft.net.illink.tasks.8.0.31.nupkg.sha512", + "microsoft.net.illink.tasks.nuspec", + "tools/net472/ILLink.Tasks.dll", + "tools/net472/ILLink.Tasks.dll.config", + "tools/net472/Mono.Cecil.Mdb.dll", + "tools/net472/Mono.Cecil.Pdb.dll", + "tools/net472/Mono.Cecil.Rocks.dll", + "tools/net472/Mono.Cecil.dll", + "tools/net472/Sdk/Sdk.props", + "tools/net472/System.Buffers.dll", + "tools/net472/System.Collections.Immutable.dll", + "tools/net472/System.Memory.dll", + "tools/net472/System.Numerics.Vectors.dll", + "tools/net472/System.Reflection.Metadata.dll", + "tools/net472/System.Runtime.CompilerServices.Unsafe.dll", + "tools/net472/build/Microsoft.NET.ILLink.Analyzers.props", + "tools/net472/build/Microsoft.NET.ILLink.Tasks.props", + "tools/net472/build/Microsoft.NET.ILLink.targets", + "tools/net8.0/ILLink.Tasks.deps.json", + "tools/net8.0/ILLink.Tasks.dll", + "tools/net8.0/Mono.Cecil.Mdb.dll", + "tools/net8.0/Mono.Cecil.Pdb.dll", + "tools/net8.0/Mono.Cecil.Rocks.dll", + "tools/net8.0/Mono.Cecil.dll", + "tools/net8.0/Sdk/Sdk.props", + "tools/net8.0/build/Microsoft.NET.ILLink.Analyzers.props", + "tools/net8.0/build/Microsoft.NET.ILLink.Tasks.props", + "tools/net8.0/build/Microsoft.NET.ILLink.targets", + "tools/net8.0/illink.deps.json", + "tools/net8.0/illink.dll", + "tools/net8.0/illink.runtimeconfig.json", + "useSharedDesignerContext.txt" + ] } }, "projectFileDependencyGroups": { "net8.0": [ - "Avalonia >= 11.3.9" + "Avalonia >= 11.3.9", + "Microsoft.NET.ILLink.Tasks >= 8.0.31" ] }, "packageFolders": { @@ -388,6 +564,12 @@ "Avalonia": { "target": "Package", "version": "[11.3.9, )" + }, + "Microsoft.NET.ILLink.Tasks": { + "suppressParent": "All", + "target": "Package", + "version": "[8.0.31, )", + "autoReferenced": true } }, "imports": [ @@ -401,6 +583,16 @@ ], "assetTargetFallback": true, "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Runtime.win-arm64", + "version": "[8.0.31, 8.0.31]" + }, + { + "name": "Microsoft.NETCore.App.Runtime.win-arm64", + "version": "[8.0.31, 8.0.31]" + } + ], "frameworkReferences": { "Microsoft.NETCore.App": { "privateAssets": "all" @@ -408,6 +600,11 @@ }, "runtimeIdentifierGraphPath": "/usr/local/share/dotnet/sdk/10.0.401/PortableRuntimeIdentifierGraph.json" } + }, + "runtimes": { + "win-arm64": { + "#import": [] + } } } } \ No newline at end of file diff --git a/model/_sdk/EarthModelStudio.ModelSdk/obj/project.nuget.cache b/model/_sdk/EarthModelStudio.ModelSdk/obj/project.nuget.cache index d3eb6b2..839ed83 100644 --- a/model/_sdk/EarthModelStudio.ModelSdk/obj/project.nuget.cache +++ b/model/_sdk/EarthModelStudio.ModelSdk/obj/project.nuget.cache @@ -1,13 +1,16 @@ { "version": 2, - "dgSpecHash": "XCy7zfNs4zI=", + "dgSpecHash": "1rhPDKvFVIw=", "success": true, "projectFilePath": "/Users/morris/Downloads/GC#/model/_sdk/EarthModelStudio.ModelSdk/EarthModelStudio.ModelSdk.csproj", "expectedPackageFiles": [ "/Users/morris/.nuget/packages/avalonia/11.3.9/avalonia.11.3.9.nupkg.sha512", "/Users/morris/.nuget/packages/avalonia.buildservices/11.3.2/avalonia.buildservices.11.3.2.nupkg.sha512", "/Users/morris/.nuget/packages/avalonia.remote.protocol/11.3.9/avalonia.remote.protocol.11.3.9.nupkg.sha512", - "/Users/morris/.nuget/packages/microcom.runtime/0.11.0/microcom.runtime.0.11.0.nupkg.sha512" + "/Users/morris/.nuget/packages/microcom.runtime/0.11.0/microcom.runtime.0.11.0.nupkg.sha512", + "/Users/morris/.nuget/packages/microsoft.net.illink.tasks/8.0.31/microsoft.net.illink.tasks.8.0.31.nupkg.sha512", + "/Users/morris/.nuget/packages/microsoft.netcore.app.runtime.win-arm64/8.0.31/microsoft.netcore.app.runtime.win-arm64.8.0.31.nupkg.sha512", + "/Users/morris/.nuget/packages/microsoft.aspnetcore.app.runtime.win-arm64/8.0.31/microsoft.aspnetcore.app.runtime.win-arm64.8.0.31.nupkg.sha512" ], "logs": [] } \ No newline at end of file diff --git a/model/earth-geography/earth-geography.json b/model/earth-geography/earth-geography.json index 8722c13..bbecdf2 100644 --- a/model/earth-geography/earth-geography.json +++ b/model/earth-geography/earth-geography.json @@ -17,7 +17,7 @@ "atlas" ], "dataDir": "earth-geography.model", - "version": "1.1", - "updatedAt": "2026-11-08T10:20:04Z", - "build": "82846c81ab" + "version": "1.2", + "updatedAt": "2026-11-08T12:19:03Z", + "build": "5e12cd2ee1" } diff --git a/model/earth-geography/earth-geography.model/EarthGeographyModel.dll b/model/earth-geography/earth-geography.model/EarthGeographyModel.dll index 146b4f8..baf6111 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/earth-geography.model/borders.json b/model/earth-geography/earth-geography.model/borders.json index ff51aab..ce9ae14 100644 --- a/model/earth-geography/earth-geography.model/borders.json +++ b/model/earth-geography/earth-geography.model/borders.json @@ -1 +1 @@ -{"borders":[{"between":"亚洲-非洲","name":"苏伊士运河","lines":[[[32.6,31.3],[32.4,30.5],[32.3,29.9]]]},{"between":"亚洲-欧洲","name":"亚欧分界(乌拉尔山—乌拉尔河—里海—大高加索山—黑海—土耳其海峡)","segments":[{"name":"乌拉尔山","nameI18n":{"zh-CN":"乌拉尔山","en":"Ural Mts."},"lines":[[[66.0,68.5],[64.0,64.0],[60.5,60.0],[58.5,54.0],[57.0,51.0]]]},{"name":"乌拉尔河","nameI18n":{"zh-CN":"乌拉尔河","en":"Ural River"},"lines":[[[57.0,51.0],[55.5,49.0],[53.0,47.0],[51.5,46.5]]]},{"name":"里海","nameI18n":{"zh-CN":"里海","en":"Caspian Sea"},"lines":[[[51.5,46.5],[50.5,44.0],[49.5,41.0],[50.0,38.0],[51.0,36.5]]]},{"name":"大高加索山","nameI18n":{"zh-CN":"大高加索山","en":"Greater Caucasus"},"lines":[[[51.0,36.5],[46.0,42.5],[43.0,42.8],[41.0,43.2]]]},{"name":"黑海","nameI18n":{"zh-CN":"黑海","en":"Black Sea"},"lines":[[[41.0,43.2],[36.0,44.5],[31.0,44.0],[29.0,41.5]]]},{"name":"土耳其海峡","nameI18n":{"zh-CN":"土耳其海峡","en":"Turkish Straits"},"lines":[[[29.0,41.5],[28.0,40.5],[26.5,40.0],[26.2,39.5]]]}],"lines":[[[66.0,68.5],[64.0,64.0],[60.5,60.0],[58.5,54.0],[57.0,51.0],[57.0,51.0],[55.5,49.0],[53.0,47.0],[51.5,46.5],[51.5,46.5],[50.5,44.0],[49.5,41.0],[50.0,38.0],[51.0,36.5],[51.0,36.5],[46.0,42.5],[43.0,42.8],[41.0,43.2],[41.0,43.2],[36.0,44.5],[31.0,44.0],[29.0,41.5],[29.0,41.5],[28.0,40.5],[26.5,40.0],[26.2,39.5]]]},{"between":"亚洲-非洲","name":"红海","lines":[[[43.3,12.6],[40.0,18.0],[38.5,22.0],[35.0,27.0],[34.5,29.0]]]},{"between":"欧洲-非洲","name":"直布罗陀海峡","lines":[[[-5.6,36.0],[-4.0,36.2],[0.0,36.5]]]},{"between":"北美-南美","name":"巴拿马运河","lines":[[[-79.6,9.1],[-78.5,8.9],[-77.5,8.6]]]},{"between":"亚洲-北美","name":"白令海峡","lines":[[[-169.0,65.5],[-170.5,65.8],[-172.0,66.0]]]},{"between":"亚洲-大洋洲","name":"印尼群岛","lines":[[[120.0,-1.0],[125.0,-2.0],[130.0,-3.0]]]},{"between":"南极洲","name":"南极圈","lines":[[[-180.0,-66.5],[-170.0,-66.5],[-160.0,-66.5],[-150.0,-66.5],[-140.0,-66.5],[-130.0,-66.5],[-120.0,-66.5],[-110.0,-66.5],[-100.0,-66.5],[-90.0,-66.5],[-80.0,-66.5],[-70.0,-66.5],[-60.0,-66.5],[-50.0,-66.5],[-40.0,-66.5],[-30.0,-66.5],[-20.0,-66.5],[-10.0,-66.5],[0.0,-66.5],[10.0,-66.5],[20.0,-66.5],[30.0,-66.5],[40.0,-66.5],[50.0,-66.5],[60.0,-66.5],[70.0,-66.5],[80.0,-66.5],[90.0,-66.5],[100.0,-66.5],[110.0,-66.5],[120.0,-66.5],[130.0,-66.5],[140.0,-66.5],[150.0,-66.5],[160.0,-66.5],[170.0,-66.5],[180.0,-66.5]]]}]} \ No newline at end of file +{"borders":[{"between":"亚洲-非洲","name":"苏伊士运河","lines":[[[32.6,31.3],[32.4,30.5],[32.3,29.9]]]},{"between":"亚洲-欧洲","name":"亚欧分界(乌拉尔山—乌拉尔河—里海—大高加索山—黑海—土耳其海峡)","segments":[{"name":"乌拉尔山","nameI18n":{"zh-CN":"乌拉尔山","en":"Ural Mts."},"lines":[[[66.0,68.5],[64.0,64.0],[60.5,60.0],[58.5,54.0],[57.0,51.0]]]},{"name":"乌拉尔河","nameI18n":{"zh-CN":"乌拉尔河","en":"Ural River"},"lines":[[[57.0,51.0],[55.5,49.0],[53.0,47.0],[51.5,46.5]]]},{"name":"里海","nameI18n":{"zh-CN":"里海","en":"Caspian Sea"},"lines":[[[51.5,46.5],[50.5,44.0],[49.5,41.0],[50.0,38.0],[51.0,36.5]]]},{"name":"大高加索山","nameI18n":{"zh-CN":"大高加索山","en":"Greater Caucasus"},"lines":[[[51.0,36.5],[46.0,42.5],[43.0,42.8],[41.0,43.2]]]},{"name":"黑海","nameI18n":{"zh-CN":"黑海","en":"Black Sea"},"lines":[[[41.0,43.2],[36.0,44.5],[31.0,44.0],[29.0,41.5]]]},{"name":"土耳其海峡","nameI18n":{"zh-CN":"土耳其海峡","en":"Turkish Straits"},"lines":[[[29.0,41.5],[28.0,40.5],[26.5,40.0],[26.2,39.5]]]}],"lines":[[[66.0,68.5],[64.0,64.0],[60.5,60.0],[58.5,54.0],[57.0,51.0],[57.0,51.0],[55.5,49.0],[53.0,47.0],[51.5,46.5],[51.5,46.5],[50.5,44.0],[49.5,41.0],[50.0,38.0],[51.0,36.5],[51.0,36.5],[46.0,42.5],[43.0,42.8],[41.0,43.2],[41.0,43.2],[36.0,44.5],[31.0,44.0],[29.0,41.5],[29.0,41.5],[28.0,40.5],[26.5,40.0],[26.2,39.5]]]},{"between":"欧洲-非洲","name":"直布罗陀海峡","lines":[[[-5.6,36.0],[-4.0,36.2],[0.0,36.5]]]},{"between":"北美-南美","name":"巴拿马运河","lines":[[[-79.6,9.1],[-78.5,8.9],[-77.5,8.6]]]},{"between":"南美-南极","name":"德雷克海峡","nameI18n":{"zh-CN":"德雷克海峡","en":"Drake Passage"},"lines":[[[-68.0,-56.0],[-66.5,-57.5],[-65.0,-59.0],[-63.5,-60.5],[-62.0,-62.0]]]},{"between":"亚洲-北美","name":"白令海峡","lines":[[[-169.0,65.5],[-170.5,65.8],[-172.0,66.0]]]},{"between":"亚洲-大洋洲","name":"印尼群岛","lines":[[[120.0,-1.0],[125.0,-2.0],[130.0,-3.0]]]},{"between":"南极洲","name":"南极圈","lines":[[[-180.0,-66.5],[-170.0,-66.5],[-160.0,-66.5],[-150.0,-66.5],[-140.0,-66.5],[-130.0,-66.5],[-120.0,-66.5],[-110.0,-66.5],[-100.0,-66.5],[-90.0,-66.5],[-80.0,-66.5],[-70.0,-66.5],[-60.0,-66.5],[-50.0,-66.5],[-40.0,-66.5],[-30.0,-66.5],[-20.0,-66.5],[-10.0,-66.5],[0.0,-66.5],[10.0,-66.5],[20.0,-66.5],[30.0,-66.5],[40.0,-66.5],[50.0,-66.5],[60.0,-66.5],[70.0,-66.5],[80.0,-66.5],[90.0,-66.5],[100.0,-66.5],[110.0,-66.5],[120.0,-66.5],[130.0,-66.5],[140.0,-66.5],[150.0,-66.5],[160.0,-66.5],[170.0,-66.5],[180.0,-66.5]]]}]} \ No newline at end of file diff --git a/model/earth-geography/earth-geography.model/preview.png b/model/earth-geography/earth-geography.model/preview.png index a0baeb3..024d7b8 100644 Binary files a/model/earth-geography/earth-geography.model/preview.png and b/model/earth-geography/earth-geography.model/preview.png differ diff --git a/model/earth-geography/src/GeographyView.cs b/model/earth-geography/src/GeographyView.cs index 5fe7658..1beb359 100644 --- a/model/earth-geography/src/GeographyView.cs +++ b/model/earth-geography/src/GeographyView.cs @@ -570,6 +570,7 @@ public sealed class GeographyView : Control "亚洲-欧洲" => Color.FromRgb(120, 226, 255), // 青 "欧洲-非洲" => Color.FromRgb(168, 148, 255), // 紫 "北美-南美" => Color.FromRgb(120, 255, 176), // 绿 + "南美-南极" => Color.FromRgb(96, 232, 222), // 青绿(德雷克海峡) "亚洲-北美" => Color.FromRgb(255, 140, 220), // 粉 "亚洲-大洋洲" => Color.FromRgb(255, 160, 96), // 橙 "南极洲" => Color.FromRgb(200, 225, 255), // 冰蓝 diff --git a/model/earth-geography/src/bin/Release/net8.0/EarthGeographyModel.deps.json b/model/earth-geography/src/bin/Release/net8.0/EarthGeographyModel.deps.json index 1421767..f92258d 100644 --- a/model/earth-geography/src/bin/Release/net8.0/EarthGeographyModel.deps.json +++ b/model/earth-geography/src/bin/Release/net8.0/EarthGeographyModel.deps.json @@ -6,7 +6,7 @@ "compilationOptions": {}, "targets": { ".NETCoreApp,Version=v8.0": { - "EarthGeographyModel/1.0.3": { + "EarthGeographyModel/1.0.4": { "dependencies": { "Avalonia": "11.3.9" }, @@ -85,7 +85,7 @@ } }, "libraries": { - "EarthGeographyModel/1.0.3": { + "EarthGeographyModel/1.0.4": { "type": "project", "serviceable": false, "sha512": "" diff --git a/model/earth-geography/src/bin/Release/net8.0/EarthGeographyModel.dll b/model/earth-geography/src/bin/Release/net8.0/EarthGeographyModel.dll index 146b4f8..baf6111 100644 Binary files a/model/earth-geography/src/bin/Release/net8.0/EarthGeographyModel.dll and b/model/earth-geography/src/bin/Release/net8.0/EarthGeographyModel.dll differ diff --git a/model/earth-geography/src/bin/Release/net8.0/EarthGeographyModel.pdb b/model/earth-geography/src/bin/Release/net8.0/EarthGeographyModel.pdb index 92ad5a3..a9811b7 100644 Binary files a/model/earth-geography/src/bin/Release/net8.0/EarthGeographyModel.pdb and b/model/earth-geography/src/bin/Release/net8.0/EarthGeographyModel.pdb differ diff --git a/model/earth-geography/src/obj/EarthGeographyModel.csproj.nuget.dgspec.json b/model/earth-geography/src/obj/EarthGeographyModel.csproj.nuget.dgspec.json index 786ee67..1988b6b 100644 --- a/model/earth-geography/src/obj/EarthGeographyModel.csproj.nuget.dgspec.json +++ b/model/earth-geography/src/obj/EarthGeographyModel.csproj.nuget.dgspec.json @@ -5,7 +5,7 @@ }, "projects": { "/Users/morris/Downloads/GC#/model/earth-geography/src/EarthGeographyModel.csproj": { - "version": "1.0.3", + "version": "1.0.4", "restore": { "projectUniqueName": "/Users/morris/Downloads/GC#/model/earth-geography/src/EarthGeographyModel.csproj", "projectName": "EarthGeographyModel", @@ -76,7 +76,7 @@ } }, "/Users/morris/Downloads/GC#/model/_sdk/EarthModelStudio.ModelSdk/EarthModelStudio.ModelSdk.csproj": { - "version": "1.0.3", + "version": "1.0.4", "restore": { "projectUniqueName": "/Users/morris/Downloads/GC#/model/_sdk/EarthModelStudio.ModelSdk/EarthModelStudio.ModelSdk.csproj", "projectName": "EarthModelStudio.ModelSdk", diff --git a/model/earth-geography/src/obj/Release/net8.0/Avalonia/Resources.Inputs.cache b/model/earth-geography/src/obj/Release/net8.0/Avalonia/Resources.Inputs.cache index d176387..2c6e493 100644 --- a/model/earth-geography/src/obj/Release/net8.0/Avalonia/Resources.Inputs.cache +++ b/model/earth-geography/src/obj/Release/net8.0/Avalonia/Resources.Inputs.cache @@ -1 +1 @@ -c5f16ca9fce0f0594ebc177c2ecb2b54604734e59fc765d9f79f6e5986cc8840 +53167376ca320a2883b3ea70457ba5caa49ab452af81a313044551fea9319e36 diff --git a/model/earth-geography/src/obj/Release/net8.0/EarthGeographyModel.AssemblyInfo.cs b/model/earth-geography/src/obj/Release/net8.0/EarthGeographyModel.AssemblyInfo.cs index 772a7db..c397542 100644 --- a/model/earth-geography/src/obj/Release/net8.0/EarthGeographyModel.AssemblyInfo.cs +++ b/model/earth-geography/src/obj/Release/net8.0/EarthGeographyModel.AssemblyInfo.cs @@ -12,11 +12,11 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("NeoRF")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Release")] -[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.3.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.3+5e0b46b3f3cd9800af177571c7809a7cdc8e9249")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.4.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.4+936aec81850fb15f55014c66116d174dc9e2f967")] [assembly: System.Reflection.AssemblyProductAttribute("Earth Model Studio")] [assembly: System.Reflection.AssemblyTitleAttribute("EarthGeographyModel")] -[assembly: System.Reflection.AssemblyVersionAttribute("1.0.3.0")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.4.0")] [assembly: System.Resources.NeutralResourcesLanguageAttribute("zh-Hans")] // Generated by the MSBuild WriteCodeFragment class. diff --git a/model/earth-geography/src/obj/Release/net8.0/EarthGeographyModel.AssemblyInfoInputs.cache b/model/earth-geography/src/obj/Release/net8.0/EarthGeographyModel.AssemblyInfoInputs.cache index 3bc87c1..2eb646e 100644 --- a/model/earth-geography/src/obj/Release/net8.0/EarthGeographyModel.AssemblyInfoInputs.cache +++ b/model/earth-geography/src/obj/Release/net8.0/EarthGeographyModel.AssemblyInfoInputs.cache @@ -1 +1 @@ -64d244f4a14d63a2a4b7a2c2c5d4c77c5e5f540fcf0498aa4b7729198e9b47da +ed259fd40e43f2cdb14b0deef0da4645edb339d430e473fbc89582da08e3d2b5 diff --git a/model/earth-geography/src/obj/Release/net8.0/EarthGeographyModel.assets.cache b/model/earth-geography/src/obj/Release/net8.0/EarthGeographyModel.assets.cache index a20549e..15d0132 100644 Binary files a/model/earth-geography/src/obj/Release/net8.0/EarthGeographyModel.assets.cache and b/model/earth-geography/src/obj/Release/net8.0/EarthGeographyModel.assets.cache differ diff --git a/model/earth-geography/src/obj/Release/net8.0/EarthGeographyModel.csproj.AssemblyReference.cache b/model/earth-geography/src/obj/Release/net8.0/EarthGeographyModel.csproj.AssemblyReference.cache index fd28939..1324542 100644 Binary files a/model/earth-geography/src/obj/Release/net8.0/EarthGeographyModel.csproj.AssemblyReference.cache and b/model/earth-geography/src/obj/Release/net8.0/EarthGeographyModel.csproj.AssemblyReference.cache differ diff --git a/model/earth-geography/src/obj/Release/net8.0/EarthGeographyModel.dll b/model/earth-geography/src/obj/Release/net8.0/EarthGeographyModel.dll index 146b4f8..baf6111 100644 Binary files a/model/earth-geography/src/obj/Release/net8.0/EarthGeographyModel.dll and b/model/earth-geography/src/obj/Release/net8.0/EarthGeographyModel.dll differ diff --git a/model/earth-geography/src/obj/Release/net8.0/EarthGeographyModel.pdb b/model/earth-geography/src/obj/Release/net8.0/EarthGeographyModel.pdb index 92ad5a3..a9811b7 100644 Binary files a/model/earth-geography/src/obj/Release/net8.0/EarthGeographyModel.pdb and b/model/earth-geography/src/obj/Release/net8.0/EarthGeographyModel.pdb differ diff --git a/model/earth-geography/src/obj/Release/net8.0/ref/EarthGeographyModel.dll b/model/earth-geography/src/obj/Release/net8.0/ref/EarthGeographyModel.dll index 959196a..9c427ff 100644 Binary files a/model/earth-geography/src/obj/Release/net8.0/ref/EarthGeographyModel.dll and b/model/earth-geography/src/obj/Release/net8.0/ref/EarthGeographyModel.dll differ diff --git a/model/earth-geography/src/obj/Release/net8.0/refint/EarthGeographyModel.dll b/model/earth-geography/src/obj/Release/net8.0/refint/EarthGeographyModel.dll index 959196a..9c427ff 100644 Binary files a/model/earth-geography/src/obj/Release/net8.0/refint/EarthGeographyModel.dll and b/model/earth-geography/src/obj/Release/net8.0/refint/EarthGeographyModel.dll differ diff --git a/model/earth-geography/src/obj/project.assets.json b/model/earth-geography/src/obj/project.assets.json index ca026a9..13f6de3 100644 --- a/model/earth-geography/src/obj/project.assets.json +++ b/model/earth-geography/src/obj/project.assets.json @@ -112,7 +112,7 @@ "lib/net5.0/MicroCom.Runtime.dll": {} } }, - "EarthModelStudio.ModelSdk/1.0.3": { + "EarthModelStudio.ModelSdk/1.0.4": { "type": "project", "framework": ".NETCoreApp,Version=v8.0", "dependencies": { @@ -347,7 +347,7 @@ "microcom.runtime.nuspec" ] }, - "EarthModelStudio.ModelSdk/1.0.3": { + "EarthModelStudio.ModelSdk/1.0.4": { "type": "project", "path": "../../_sdk/EarthModelStudio.ModelSdk/EarthModelStudio.ModelSdk.csproj", "msbuildProject": "../../_sdk/EarthModelStudio.ModelSdk/EarthModelStudio.ModelSdk.csproj" @@ -356,14 +356,14 @@ "projectFileDependencyGroups": { "net8.0": [ "Avalonia >= 11.3.9", - "EarthModelStudio.ModelSdk >= 1.0.3" + "EarthModelStudio.ModelSdk >= 1.0.4" ] }, "packageFolders": { "/Users/morris/.nuget/packages/": {} }, "project": { - "version": "1.0.3", + "version": "1.0.4", "restore": { "projectUniqueName": "/Users/morris/Downloads/GC#/model/earth-geography/src/EarthGeographyModel.csproj", "projectName": "EarthGeographyModel", @@ -432,5 +432,13 @@ "runtimeIdentifierGraphPath": "/usr/local/share/dotnet/sdk/10.0.401/PortableRuntimeIdentifierGraph.json" } } - } + }, + "logs": [ + { + "code": "NU1900", + "level": "Warning", + "warningLevel": 1, + "message": "获取包漏洞数据时出错: Access to the path '/Users/morris/.local/share/NuGet/http-cache/670c1461c29885f9aa22c281d8b7da90845b38e4$ps:_api.nuget.org_v3_index.json/vuln_index.dat-new' is denied." + } + ] } \ No newline at end of file diff --git a/model/earth-geography/src/obj/project.nuget.cache b/model/earth-geography/src/obj/project.nuget.cache index ae6e18d..a1f57dc 100644 --- a/model/earth-geography/src/obj/project.nuget.cache +++ b/model/earth-geography/src/obj/project.nuget.cache @@ -1,6 +1,6 @@ { "version": 2, - "dgSpecHash": "3ZSn38nmvSY=", + "dgSpecHash": "8duKn1xFDI4=", "success": true, "projectFilePath": "/Users/morris/Downloads/GC#/model/earth-geography/src/EarthGeographyModel.csproj", "expectedPackageFiles": [ @@ -9,5 +9,15 @@ "/Users/morris/.nuget/packages/avalonia.remote.protocol/11.3.9/avalonia.remote.protocol.11.3.9.nupkg.sha512", "/Users/morris/.nuget/packages/microcom.runtime/0.11.0/microcom.runtime.0.11.0.nupkg.sha512" ], - "logs": [] + "logs": [ + { + "code": "NU1900", + "level": "Warning", + "message": "获取包漏洞数据时出错: Access to the path '/Users/morris/.local/share/NuGet/http-cache/670c1461c29885f9aa22c281d8b7da90845b38e4$ps:_api.nuget.org_v3_index.json/vuln_index.dat-new' is denied.", + "projectPath": "/Users/morris/Downloads/GC#/model/earth-geography/src/EarthGeographyModel.csproj", + "warningLevel": 1, + "filePath": "/Users/morris/Downloads/GC#/model/earth-geography/src/EarthGeographyModel.csproj", + "targetGraphs": [] + } + ] } \ No newline at end of file diff --git a/model/earth-revolution/earth-revolution.json b/model/earth-revolution/earth-revolution.json index 48054f7..1b2960e 100644 --- a/model/earth-revolution/earth-revolution.json +++ b/model/earth-revolution/earth-revolution.json @@ -24,6 +24,6 @@ "preview": "preview.png", "apiVersion": 1, "version": "1.1", - "updatedAt": "2026-11-08T10:20:04Z", - "build": "a9110f4ecf" + "updatedAt": "2026-11-08T12:19:03Z", + "build": "92a820f30c" } diff --git a/model/earth-rotation/earth-rotation.json b/model/earth-rotation/earth-rotation.json index 2c70179..4dccf49 100644 --- a/model/earth-rotation/earth-rotation.json +++ b/model/earth-rotation/earth-rotation.json @@ -24,6 +24,6 @@ "preview": "preview.png", "apiVersion": 1, "version": "1.1", - "updatedAt": "2026-11-08T10:20:04Z", - "build": "b6d88b8214" + "updatedAt": "2026-11-08T12:19:03Z", + "build": "e9e9851c56" } diff --git a/model/scale-calculator/scale-calculator.json b/model/scale-calculator/scale-calculator.json new file mode 100644 index 0000000..a32bac5 --- /dev/null +++ b/model/scale-calculator/scale-calculator.json @@ -0,0 +1,30 @@ +{ + "schemaVersion": 1, + "id": "scale-calculator", + "name": "Scale Calculator", + "nameI18n": { + "zh-CN": "比例尺计算器", + "en": "Scale Calculator" + }, + "author": "Morris GC", + "description": "把比例尺变成可以拖、可以量的可视化标尺", + "descriptionI18n": { + "zh-CN": "三种求解模式、图上/实地双条对比、线段式比例尺自动换挡、比例尺光谱、真实地标实地尺与练习闯关。", + "en": "Three solve modes, dual map/real bars, auto-ranging graphic scale, scale spectrum, real-world landmarks and practice quizzes." + }, + "tags": [ + "geography", + "map", + "scale", + "calculator" + ], + "entry": "scales.json", + "license": "MIT", + "assembly": "ScaleCalculatorModel.dll", + "type": "NeoRF.ScaleCalculator.ScaleCalculatorFactory", + "preview": "preview.png", + "apiVersion": 1, + "version": "1.0", + "updatedAt": "2026-11-08T12:19:03Z", + "build": "4cb6aafff8" +} diff --git a/model/scale-calculator/scale-calculator.model/ScaleCalculatorModel.dll b/model/scale-calculator/scale-calculator.model/ScaleCalculatorModel.dll new file mode 100644 index 0000000..a8d2f6c Binary files /dev/null and b/model/scale-calculator/scale-calculator.model/ScaleCalculatorModel.dll differ diff --git a/model/scale-calculator/scale-calculator.model/i18n/en.json b/model/scale-calculator/scale-calculator.model/i18n/en.json new file mode 100644 index 0000000..ed7d13d --- /dev/null +++ b/model/scale-calculator/scale-calculator.model/i18n/en.json @@ -0,0 +1,106 @@ +{ + "app.title": "Scale Calculator", + "app.subtitle": "Turn map-distance ÷ real-distance into a ruler you can drag and measure", + "mode.real": "Find real distance", + "mode.map": "Find map distance", + "mode.scale": "Find scale", + "mode.hint": "Pick what to solve; the blue card is the answer", + "input.title": "Given", + "input.map": "Map distance", + "input.real": "Real distance", + "input.scale": "Scale denominator N", + "input.nPrefix": "1 :", + "input.unit": "Unit", + "input.reset": "Reset", + "input.presets": "Common scales", + "input.dragHint": "Drag the slider or type a number — everything updates live", + "result.title": "Result", + "result.real": "Real distance", + "result.map": "Map distance", + "result.scale": "Scale", + "result.formula": "Formula", + "forms.title": "Three ways to write a scale", + "forms.digital": "Numeric", + "forms.verbal": "Verbal", + "forms.segment": "Graphic (bar)", + "forms.verbalTpl": "1 cm on the map = {0} on the ground", + "forms.segmentDesc": "Each division {0}, {1} divisions", + "steps.title": "Worked solution", + "steps.show": "Show steps", + "steps.hide": "Hide steps", + "steps.1.unify": "① Unify units: convert the real distance to cm (1 km = 100000 cm)", + "steps.2.formulaReal": "② Real distance = map distance × scale denominator", + "steps.2.formulaMap": "② Map distance = real distance ÷ scale denominator", + "steps.2.formulaScale": "② Scale denominator = real distance ÷ map distance", + "steps.3.substitute": "③ Substitute: {0}", + "steps.4.result": "④ Result: {0}", + "steps.5.convert": "⑤ Convert to a sensible unit (cm → m → km)", + "grade.title": "Large / small scale", + "grade.large": "Large scale", + "grade.medium": "Medium scale", + "grade.small": "Small scale", + "grade.largeNote": "Small area · detailed · e.g. campus plan", + "grade.mediumNote": "Medium area · e.g. city map", + "grade.smallNote": "Large area · simplified · e.g. world map", + "grade.rule": "Bigger denominator → smaller scale → larger area → less detail", + "pit.title": "Common mistakes", + "pit.1": "① Forgetting to unify units: km ×100000 = cm", + "pit.2": "② \"Zoom 2×\" means denominator ÷ 2, not × 2", + "pit.3": "③ Don't swap map distance and real distance", + "field.title": "Real-world ruler · how long on the map", + "field.hint": "Pick a real distance and change the scale to see its map length", + "field.mapLength": "On map {0}", + "field.tooLong": "too long", + "field.tooShort": "barely visible", + "quiz.title": "Practice", + "quiz.promptReal": "Scale 1:{0}, map distance {1} cm — what is the real distance? (enter the number in the shown unit)", + "quiz.promptMap": "Scale 1:{0}, real distance {1} — what is the map distance in cm?", + "quiz.promptScale": "{0} cm on the map = {1} on the ground — what is the scale denominator?", + "quiz.answer": "Your answer", + "quiz.check": "Check", + "quiz.next": "Next", + "quiz.correct": "✓ Correct!", + "quiz.wrong": "✗ Try again — read the steps", + "quiz.streak": "{0} in a row", + "quiz.showSteps": "Show solution", + "quiz.unit": "Unit: {0}", + "ruler.title": "Visual ruler", + "ruler.mapBar": "Map distance (real cm)", + "ruler.realBar": "Real distance (compressed by the same scale)", + "ruler.sameWidth": "same width as above", + "ruler.equals": "equals", + "ruler.segment": "Graphic scale", + "ruler.segmentHint": "auto-ranging ticks", + "ruler.spectrum": "Scale spectrum", + "ruler.scopeUp": "◀ larger area", + "ruler.detailDown": "more detail ▶", + "ruler.hint": "Blue is the real map length; green is the same real distance compressed by the scale", + "ruler.overflowMap": "This map distance overflows the sheet — use a smaller scale", + "ruler.overflowReal": "This real distance won't fit at this scale — use a smaller scale", + "unit.cm": "cm", + "unit.m": "m", + "unit.km": "km", + "unit.none": "(unitless)", + "spec.campus": "Campus", + "spec.city": "City", + "spec.china": "China", + "spec.world": "World", + "preset.campus": "Campus 1:10k", + "preset.campusNote": "Buildings clearly drawn", + "preset.town": "Town 1:50k", + "preset.townNote": "Villages and roads", + "preset.city": "City 1:250k", + "preset.cityNote": "Urban area and arterials", + "preset.province": "Province 1:1M", + "preset.provinceNote": "Cities and rivers", + "preset.china": "China 1:10M", + "preset.chinaNote": "Province outlines", + "preset.world": "World 1:100M", + "preset.worldNote": "Continents & oceans", + "lm.classroom": "Classroom 10 m", + "lm.track": "Running track 400 m", + "lm.marathon": "Marathon 42.195 km", + "lm.beijingShanghai": "Beijing–Shanghai 1080 km", + "lm.equator": "Equator 40,000 km", + "common.footer": "Scale = map distance ÷ real distance · unify units first · bigger denominator = smaller scale" +} diff --git a/model/scale-calculator/scale-calculator.model/i18n/zh-CN.json b/model/scale-calculator/scale-calculator.model/i18n/zh-CN.json new file mode 100644 index 0000000..f12a9d7 --- /dev/null +++ b/model/scale-calculator/scale-calculator.model/i18n/zh-CN.json @@ -0,0 +1,106 @@ +{ + "app.title": "比例尺计算器", + "app.subtitle": "把「图上距离 ÷ 实地距离」变成可以拖、可以量的可视化标尺", + "mode.real": "求实地距离", + "mode.map": "求图上距离", + "mode.scale": "求比例尺", + "mode.hint": "选择要求什么,蓝色结果卡就是答案", + "input.title": "已知量", + "input.map": "图上距离", + "input.real": "实地距离", + "input.scale": "比例尺分母 N", + "input.nPrefix": "1 :", + "input.unit": "单位", + "input.reset": "重置", + "input.presets": "常用比例尺", + "input.dragHint": "拖动滑块或直接输入数字,读数实时联动", + "result.title": "计算结果", + "result.real": "实地距离", + "result.map": "图上距离", + "result.scale": "比例尺", + "result.formula": "计算公式", + "forms.title": "比例尺的三种写法", + "forms.digital": "数字式", + "forms.verbal": "文字式", + "forms.segment": "线段式", + "forms.verbalTpl": "图上 1 厘米代表实地 {0}", + "forms.segmentDesc": "每格 {0},共 {1} 格", + "steps.title": "解题步骤", + "steps.show": "展开步骤", + "steps.hide": "收起步骤", + "steps.1.unify": "① 统一单位:把实地距离化成厘米(1 km = 100000 cm,去掉 5 个 0)", + "steps.2.formulaReal": "② 实地距离 = 图上距离 × 比例尺分母", + "steps.2.formulaMap": "② 图上距离 = 实地距离 ÷ 比例尺分母", + "steps.2.formulaScale": "② 比例尺分母 = 实地距离 ÷ 图上距离", + "steps.3.substitute": "③ 代入数值:{0}", + "steps.4.result": "④ 算出结果:{0}", + "steps.5.convert": "⑤ 换算成合适单位(cm → m → km)", + "grade.title": "大小判读", + "grade.large": "大比例尺", + "grade.medium": "中比例尺", + "grade.small": "小比例尺", + "grade.largeNote": "范围小 · 内容详细 · 如校园平面图", + "grade.mediumNote": "范围中等 · 如城市交通图", + "grade.smallNote": "范围大 · 内容简略 · 如世界地图", + "grade.rule": "分母越大 → 比例尺越小 → 范围越大 → 越简略", + "pit.title": "易错点", + "pit.1": "① 忘记统一单位:km 要 ×100000 才成 cm", + "pit.2": "② 「放大 2 倍」是分母 ÷ 2,不是 × 2", + "pit.3": "③ 图上距离与实地距离别代反了", + "field.title": "实地尺 · 这段距离画到图上多长", + "field.hint": "选一个真实距离,改变比例尺看它在图上的长度", + "field.mapLength": "图上 {0}", + "field.tooLong": "画不下", + "field.tooShort": "几乎看不见", + "quiz.title": "练习闯关", + "quiz.promptReal": "比例尺 1:{0},图上 {1} 厘米,实地距离是多少?(按提示单位填数字)", + "quiz.promptMap": "比例尺 1:{0},实地 {1},图上距离是多少厘米?", + "quiz.promptScale": "图上 {0} 厘米代表实地 {1},比例尺分母是多少?", + "quiz.answer": "输入答案", + "quiz.check": "检查", + "quiz.next": "下一题", + "quiz.correct": "✓ 答对了!", + "quiz.wrong": "✗ 再想想,看看解题步骤", + "quiz.streak": "连对 {0} 题", + "quiz.showSteps": "查看解题步骤", + "quiz.unit": "单位:{0}", + "ruler.title": "可视化标尺", + "ruler.mapBar": "图上距离(真实厘米)", + "ruler.realBar": "实地距离(按同一比例尺压缩)", + "ruler.sameWidth": "与上方同宽", + "ruler.equals": "等于", + "ruler.segment": "线段式比例尺", + "ruler.segmentHint": "刻度自动换挡", + "ruler.spectrum": "比例尺光谱", + "ruler.scopeUp": "◀ 范围越大", + "ruler.detailDown": "内容越详细 ▶", + "ruler.hint": "蓝色是图上真实长度;绿色是同一段实地按比例尺压缩后的长度", + "ruler.overflowMap": "这段图上距离超出图幅,需要更小的比例尺", + "ruler.overflowReal": "这段实地距离在该比例尺下画不下,需要更小的比例尺", + "unit.cm": "厘米", + "unit.m": "米", + "unit.km": "千米", + "unit.none": "(无单位)", + "spec.campus": "校园", + "spec.city": "城市", + "spec.china": "中国", + "spec.world": "世界", + "preset.campus": "校园 1:1万", + "preset.campusNote": "操场、教学楼都画得清", + "preset.town": "乡镇 1:5万", + "preset.townNote": "村镇与道路", + "preset.city": "城市 1:25万", + "preset.cityNote": "城区与主干道", + "preset.province": "省区 1:100万", + "preset.provinceNote": "地级市与河流", + "preset.china": "中国 1:1000万", + "preset.chinaNote": "省级轮廓", + "preset.world": "世界 1:1亿", + "preset.worldNote": "大洲大洋", + "lm.classroom": "教室 10 m", + "lm.track": "操场一圈 400 m", + "lm.marathon": "马拉松 42.195 km", + "lm.beijingShanghai": "北京—上海 1080 km", + "lm.equator": "赤道 4 万 km", + "common.footer": "比例尺 = 图上距离 ÷ 实地距离 · 单位统一是第一步 · 分母越大,比例尺越小" +} diff --git a/model/scale-calculator/scale-calculator.model/preview.png b/model/scale-calculator/scale-calculator.model/preview.png new file mode 100644 index 0000000..8a816a4 Binary files /dev/null and b/model/scale-calculator/scale-calculator.model/preview.png differ diff --git a/model/scale-calculator/scale-calculator.model/scales.json b/model/scale-calculator/scale-calculator.model/scales.json new file mode 100644 index 0000000..aa23424 --- /dev/null +++ b/model/scale-calculator/scale-calculator.model/scales.json @@ -0,0 +1,23 @@ +{ + "presets": [ + { "n": 10000, "nameKey": "preset.campus", "noteKey": "preset.campusNote" }, + { "n": 50000, "nameKey": "preset.town", "noteKey": "preset.townNote" }, + { "n": 250000, "nameKey": "preset.city", "noteKey": "preset.cityNote" }, + { "n": 1000000, "nameKey": "preset.province", "noteKey": "preset.provinceNote" }, + { "n": 10000000, "nameKey": "preset.china", "noteKey": "preset.chinaNote" }, + { "n": 100000000, "nameKey": "preset.world", "noteKey": "preset.worldNote" } + ], + "spectrum": [ + { "n": 10000, "labelKey": "spec.campus", "scopeKey": "spec.campusScope" }, + { "n": 250000, "labelKey": "spec.city", "scopeKey": "spec.cityScope" }, + { "n": 10000000, "labelKey": "spec.china", "scopeKey": "spec.chinaScope" }, + { "n": 100000000, "labelKey": "spec.world", "scopeKey": "spec.worldScope" } + ], + "landmarks": [ + { "nameKey": "lm.classroom", "meters": 10 }, + { "nameKey": "lm.track", "meters": 400 }, + { "nameKey": "lm.marathon", "meters": 42195 }, + { "nameKey": "lm.beijingShanghai", "meters": 1080000 }, + { "nameKey": "lm.equator", "meters": 40000000 } + ] +} diff --git a/model/scale-calculator/src/DefaultTexts.cs b/model/scale-calculator/src/DefaultTexts.cs new file mode 100644 index 0000000..f2b0f05 --- /dev/null +++ b/model/scale-calculator/src/DefaultTexts.cs @@ -0,0 +1,251 @@ +using System.Collections.Generic; + +namespace NeoRF.ScaleCalculator; + +/// 内置全量文案兜底:即使模型包里没有语言包也能完整显示。 +internal static class DefaultTexts +{ + public static readonly Dictionary Zh = new() + { + ["app.title"] = "比例尺计算器", + ["app.subtitle"] = "把「图上距离 ÷ 实地距离」变成可以拖、可以量的可视化标尺", + ["mode.real"] = "求实地距离", + ["mode.map"] = "求图上距离", + ["mode.scale"] = "求比例尺", + ["mode.hint"] = "选择要求什么,蓝色结果卡就是答案", + + ["input.title"] = "已知量", + ["input.map"] = "图上距离", + ["input.real"] = "实地距离", + ["input.scale"] = "比例尺分母 N", + ["input.nPrefix"] = "1 :", + ["input.unit"] = "单位", + ["input.reset"] = "重置", + ["input.presets"] = "常用比例尺", + ["input.dragHint"] = "拖动滑块或直接输入数字,读数实时联动", + + ["result.title"] = "计算结果", + ["result.real"] = "实地距离", + ["result.map"] = "图上距离", + ["result.scale"] = "比例尺", + ["result.formula"] = "计算公式", + + ["forms.title"] = "比例尺的三种写法", + ["forms.digital"] = "数字式", + ["forms.verbal"] = "文字式", + ["forms.segment"] = "线段式", + ["forms.verbalTpl"] = "图上 1 厘米代表实地 {0}", + ["forms.segmentDesc"] = "每格 {0},共 {1} 格", + + ["steps.title"] = "解题步骤", + ["steps.show"] = "展开步骤", + ["steps.hide"] = "收起步骤", + ["steps.1.unify"] = "① 统一单位:把实地距离化成厘米(1 km = 100000 cm,去掉 5 个 0)", + ["steps.2.formulaReal"] = "② 实地距离 = 图上距离 × 比例尺分母", + ["steps.2.formulaMap"] = "② 图上距离 = 实地距离 ÷ 比例尺分母", + ["steps.2.formulaScale"] = "② 比例尺分母 = 实地距离 ÷ 图上距离", + ["steps.3.substitute"] = "③ 代入数值:{0}", + ["steps.4.result"] = "④ 算出结果:{0}", + ["steps.5.convert"] = "⑤ 换算成合适单位(cm → m → km)", + + ["grade.title"] = "大小判读", + ["grade.large"] = "大比例尺", + ["grade.medium"] = "中比例尺", + ["grade.small"] = "小比例尺", + ["grade.largeNote"] = "范围小 · 内容详细 · 如校园平面图", + ["grade.mediumNote"] = "范围中等 · 如城市交通图", + ["grade.smallNote"] = "范围大 · 内容简略 · 如世界地图", + ["grade.rule"] = "分母越大 → 比例尺越小 → 范围越大 → 越简略", + + ["pit.title"] = "易错点", + ["pit.1"] = "① 忘记统一单位:km 要 ×100000 才成 cm", + ["pit.2"] = "② 「放大 2 倍」是分母 ÷ 2,不是 × 2", + ["pit.3"] = "③ 图上距离与实地距离别代反了", + + ["field.title"] = "实地尺 · 这段距离画到图上多长", + ["field.hint"] = "选一个真实距离,改变比例尺看它在图上的长度", + ["field.mapLength"] = "图上 {0}", + ["field.tooLong"] = "画不下", + ["field.tooShort"] = "几乎看不见", + + ["quiz.title"] = "练习闯关", + ["quiz.promptReal"] = "比例尺 1:{0},图上 {1} 厘米,实地距离是多少?(按提示单位填数字)", + ["quiz.promptMap"] = "比例尺 1:{0},实地 {1},图上距离是多少厘米?", + ["quiz.promptScale"] = "图上 {0} 厘米代表实地 {1},比例尺分母是多少?", + ["quiz.answer"] = "输入答案", + ["quiz.check"] = "检查", + ["quiz.next"] = "下一题", + ["quiz.correct"] = "✓ 答对了!", + ["quiz.wrong"] = "✗ 再想想,看看解题步骤", + ["quiz.streak"] = "连对 {0} 题", + ["quiz.showSteps"] = "查看解题步骤", + ["quiz.unit"] = "单位:{0}", + + ["ruler.title"] = "可视化标尺", + ["ruler.mapBar"] = "图上距离(真实厘米)", + ["ruler.realBar"] = "实地距离(按同一比例尺压缩)", + ["ruler.sameWidth"] = "与上方同宽", + ["ruler.equals"] = "等于", + ["ruler.segment"] = "线段式比例尺", + ["ruler.segmentHint"] = "刻度自动换挡", + ["ruler.spectrum"] = "比例尺光谱", + ["ruler.scopeUp"] = "◀ 范围越大", + ["ruler.detailDown"] = "内容越详细 ▶", + ["ruler.hint"] = "蓝色是图上真实长度;绿色是同一段实地按比例尺压缩后的长度", + ["ruler.overflowMap"] = "这段图上距离超出图幅,需要更小的比例尺", + ["ruler.overflowReal"] = "这段实地距离在该比例尺下画不下,需要更小的比例尺", + + ["unit.cm"] = "厘米", + ["unit.m"] = "米", + ["unit.km"] = "千米", + ["unit.none"] = "(无单位)", + + ["spec.campus"] = "校园", + ["spec.city"] = "城市", + ["spec.china"] = "中国", + ["spec.world"] = "世界", + + ["preset.campus"] = "校园 1:1万", + ["preset.campusNote"] = "操场、教学楼都画得清", + ["preset.town"] = "乡镇 1:5万", + ["preset.townNote"] = "村镇与道路", + ["preset.city"] = "城市 1:25万", + ["preset.cityNote"] = "城区与主干道", + ["preset.province"] = "省区 1:100万", + ["preset.provinceNote"] = "地级市与河流", + ["preset.china"] = "中国 1:1000万", + ["preset.chinaNote"] = "省级轮廓", + ["preset.world"] = "世界 1:1亿", + ["preset.worldNote"] = "大洲大洋", + + ["lm.classroom"] = "教室 10 m", + ["lm.track"] = "操场一圈 400 m", + ["lm.marathon"] = "马拉松 42.195 km", + ["lm.beijingShanghai"] = "北京—上海 1080 km", + ["lm.equator"] = "赤道 4 万 km", + + ["common.footer"] = "比例尺 = 图上距离 ÷ 实地距离 · 单位统一是第一步 · 分母越大,比例尺越小" + }; + + public static readonly Dictionary En = new() + { + ["app.title"] = "Scale Calculator", + ["app.subtitle"] = "Turn map-distance ÷ real-distance into a ruler you can drag and measure", + ["mode.real"] = "Find real distance", + ["mode.map"] = "Find map distance", + ["mode.scale"] = "Find scale", + ["mode.hint"] = "Pick what to solve; the blue card is the answer", + + ["input.title"] = "Given", + ["input.map"] = "Map distance", + ["input.real"] = "Real distance", + ["input.scale"] = "Scale denominator N", + ["input.nPrefix"] = "1 :", + ["input.unit"] = "Unit", + ["input.reset"] = "Reset", + ["input.presets"] = "Common scales", + ["input.dragHint"] = "Drag the slider or type a number — everything updates live", + + ["result.title"] = "Result", + ["result.real"] = "Real distance", + ["result.map"] = "Map distance", + ["result.scale"] = "Scale", + ["result.formula"] = "Formula", + + ["forms.title"] = "Three ways to write a scale", + ["forms.digital"] = "Numeric", + ["forms.verbal"] = "Verbal", + ["forms.segment"] = "Graphic (bar)", + ["forms.verbalTpl"] = "1 cm on the map = {0} on the ground", + ["forms.segmentDesc"] = "Each division {0}, {1} divisions", + + ["steps.title"] = "Worked solution", + ["steps.show"] = "Show steps", + ["steps.hide"] = "Hide steps", + ["steps.1.unify"] = "① Unify units: convert the real distance to cm (1 km = 100000 cm)", + ["steps.2.formulaReal"] = "② Real distance = map distance × scale denominator", + ["steps.2.formulaMap"] = "② Map distance = real distance ÷ scale denominator", + ["steps.2.formulaScale"] = "② Scale denominator = real distance ÷ map distance", + ["steps.3.substitute"] = "③ Substitute: {0}", + ["steps.4.result"] = "④ Result: {0}", + ["steps.5.convert"] = "⑤ Convert to a sensible unit (cm → m → km)", + + ["grade.title"] = "Large / small scale", + ["grade.large"] = "Large scale", + ["grade.medium"] = "Medium scale", + ["grade.small"] = "Small scale", + ["grade.largeNote"] = "Small area · detailed · e.g. campus plan", + ["grade.mediumNote"] = "Medium area · e.g. city map", + ["grade.smallNote"] = "Large area · simplified · e.g. world map", + ["grade.rule"] = "Bigger denominator → smaller scale → larger area → less detail", + + ["pit.title"] = "Common mistakes", + ["pit.1"] = "① Forgetting to unify units: km ×100000 = cm", + ["pit.2"] = "② \"Zoom 2×\" means denominator ÷ 2, not × 2", + ["pit.3"] = "③ Don't swap map distance and real distance", + + ["field.title"] = "Real-world ruler · how long on the map", + ["field.hint"] = "Pick a real distance and change the scale to see its map length", + ["field.mapLength"] = "On map {0}", + ["field.tooLong"] = "too long", + ["field.tooShort"] = "barely visible", + + ["quiz.title"] = "Practice", + ["quiz.promptReal"] = "Scale 1:{0}, map distance {1} cm — what is the real distance? (enter the number in the shown unit)", + ["quiz.promptMap"] = "Scale 1:{0}, real distance {1} — what is the map distance in cm?", + ["quiz.promptScale"] = "{0} cm on the map = {1} on the ground — what is the scale denominator?", + ["quiz.answer"] = "Your answer", + ["quiz.check"] = "Check", + ["quiz.next"] = "Next", + ["quiz.correct"] = "✓ Correct!", + ["quiz.wrong"] = "✗ Try again — read the steps", + ["quiz.streak"] = "{0} in a row", + ["quiz.showSteps"] = "Show solution", + ["quiz.unit"] = "Unit: {0}", + + ["ruler.title"] = "Visual ruler", + ["ruler.mapBar"] = "Map distance (real cm)", + ["ruler.realBar"] = "Real distance (compressed by the same scale)", + ["ruler.sameWidth"] = "same width as above", + ["ruler.equals"] = "equals", + ["ruler.segment"] = "Graphic scale", + ["ruler.segmentHint"] = "auto-ranging ticks", + ["ruler.spectrum"] = "Scale spectrum", + ["ruler.scopeUp"] = "◀ larger area", + ["ruler.detailDown"] = "more detail ▶", + ["ruler.hint"] = "Blue is the real map length; green is the same real distance compressed by the scale", + ["ruler.overflowMap"] = "This map distance overflows the sheet — use a smaller scale", + ["ruler.overflowReal"] = "This real distance won't fit at this scale — use a smaller scale", + + ["unit.cm"] = "cm", + ["unit.m"] = "m", + ["unit.km"] = "km", + ["unit.none"] = "(unitless)", + + ["spec.campus"] = "Campus", + ["spec.city"] = "City", + ["spec.china"] = "China", + ["spec.world"] = "World", + + ["preset.campus"] = "Campus 1:10k", + ["preset.campusNote"] = "Buildings clearly drawn", + ["preset.town"] = "Town 1:50k", + ["preset.townNote"] = "Villages and roads", + ["preset.city"] = "City 1:250k", + ["preset.cityNote"] = "Urban area and arterials", + ["preset.province"] = "Province 1:1M", + ["preset.provinceNote"] = "Cities and rivers", + ["preset.china"] = "China 1:10M", + ["preset.chinaNote"] = "Province outlines", + ["preset.world"] = "World 1:100M", + ["preset.worldNote"] = "Continents & oceans", + + ["lm.classroom"] = "Classroom 10 m", + ["lm.track"] = "Running track 400 m", + ["lm.marathon"] = "Marathon 42.195 km", + ["lm.beijingShanghai"] = "Beijing–Shanghai 1080 km", + ["lm.equator"] = "Equator 40,000 km", + + ["common.footer"] = "Scale = map distance ÷ real distance · unify units first · bigger denominator = smaller scale" + }; +} diff --git a/model/scale-calculator/src/ScaleCalculatorFactory.cs b/model/scale-calculator/src/ScaleCalculatorFactory.cs new file mode 100644 index 0000000..179465a --- /dev/null +++ b/model/scale-calculator/src/ScaleCalculatorFactory.cs @@ -0,0 +1,10 @@ +using EarthModelStudio.ModelSdk; + +namespace NeoRF.ScaleCalculator; + +/// 比例尺计算器模型入口(清单里的 type 指向这里)。 +public sealed class ScaleCalculatorFactory : IModelFactory +{ + public int ApiVersion => 1; + public IModelRuntime Create() => new ScaleCalculatorRuntime(); +} diff --git a/model/scale-calculator/src/ScaleCalculatorModel.csproj b/model/scale-calculator/src/ScaleCalculatorModel.csproj new file mode 100644 index 0000000..1e2de8f --- /dev/null +++ b/model/scale-calculator/src/ScaleCalculatorModel.csproj @@ -0,0 +1,24 @@ + + + + net8.0 + enable + disable + NeoRF.ScaleCalculator + ScaleCalculatorModel + true + false + + + + + + + + + + false + + + + diff --git a/model/scale-calculator/src/ScaleCalculatorRuntime.cs b/model/scale-calculator/src/ScaleCalculatorRuntime.cs new file mode 100644 index 0000000..e494d50 --- /dev/null +++ b/model/scale-calculator/src/ScaleCalculatorRuntime.cs @@ -0,0 +1,78 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; +using Avalonia.Controls; +using EarthModelStudio.ModelSdk; + +namespace NeoRF.ScaleCalculator; + +/// +/// 比例尺计算器运行时。Prepare 在后台线程读数据/语言包,CreateView 在 UI 线程构建界面。 +/// 不依赖 _engine(没有球面渲染),只用 Avalonia 基础控件 + 一个自绘标尺。 +/// +public sealed class ScaleCalculatorRuntime : IModelRuntime +{ + private ScaleData? _data; + private Dictionary? _texts; + + public void Prepare(IModelContext context) + { + context.ReportProgress(0.1, "载入预设数据"); + _data = ScaleData.Load(context.DataDirectory); + + context.ReportProgress(0.55, "载入语言包"); + _texts = LoadTexts(context.DataDirectory, context.Language); + + context.ReportProgress(0.9, "准备界面"); + context.Log($"[scale-calculator] 语言 {context.Language}," + + $"预设 {_data.Presets.Count} 档 / 地标 {_data.Landmarks.Count} 个"); + } + + public Control CreateView(IModelContext context) + { + context.ReportProgress(0.96, "构建界面"); + _data ??= ScaleData.Load(context.DataDirectory); + _texts ??= LoadTexts(context.DataDirectory, context.Language); + var view = new ScaleCalculatorView(_data, _texts, context.Language); + context.ReportProgress(1.0, "准备就绪"); + return view; + } + + public void Dispose() + { + _data = null; + _texts = null; + GC.SuppressFinalize(this); + } + + private static Dictionary LoadTexts(string dataDir, string language) + { + // 先内置中文兜底,再按 language 覆盖,最后用 zh-CN 补齐缺键 + var map = new Dictionary(DefaultTexts.Zh); + var isEn = language.StartsWith("en", StringComparison.OrdinalIgnoreCase); + if (isEn) + foreach (var kv in DefaultTexts.En) map[kv.Key] = kv.Value; + + Overlay(Path.Combine(dataDir, "i18n", "zh-CN.json"), map); + if (isEn) Overlay(Path.Combine(dataDir, "i18n", "en.json"), map); + else Overlay(Path.Combine(dataDir, "i18n", language + ".json"), map); + return map; + } + + private static void Overlay(string path, Dictionary target) + { + if (!File.Exists(path)) return; + try + { + var extra = JsonSerializer.Deserialize>(File.ReadAllText(path), + new JsonSerializerOptions { ReadCommentHandling = JsonCommentHandling.Skip, AllowTrailingCommas = true }); + if (extra == null) return; + foreach (var kv in extra) target[kv.Key] = kv.Value; + } + catch (Exception ex) + { + Console.Error.WriteLine($"[scale-calculator] 语言包读取失败 {path}: {ex.Message}"); + } + } +} diff --git a/model/scale-calculator/src/ScaleCalculatorView.Layout.cs b/model/scale-calculator/src/ScaleCalculatorView.Layout.cs new file mode 100644 index 0000000..ccde528 --- /dev/null +++ b/model/scale-calculator/src/ScaleCalculatorView.Layout.cs @@ -0,0 +1,489 @@ +using System; +using Avalonia; +using Avalonia.Controls; +using Avalonia.Controls.Primitives; +using Avalonia.Layout; +using Avalonia.Media; + +namespace NeoRF.ScaleCalculator; + +public sealed partial class ScaleCalculatorView +{ + // 模式条 + private Button _btnReal = null!, _btnMap = null!, _btnScale = null!; + + // 左栏输入 + private Slider _mapSlider = null!; + private TextBox _mapBox = null!, _realBox = null!, _nBox = null!; + private ComboBox _unitBox = null!; + private TextBlock _mapCardLabel = null!, _realCardLabel = null!, _scaleCardLabel = null!; + private TextBlock _mapResultText = null!, _realResultText = null!, _scaleResultText = null!; + private Border _mapCard = null!, _realCard = null!, _scaleCard = null!; + private WrapPanel _presetPanel = null!; + + // 中栏 + private ScaleRuler _ruler = null!; + + // 右栏 + private TextBlock _digitalText = null!, _verbalText = null!, _segmentText = null!; + private TextBlock _gradeTitle = null!, _gradeNote = null!, _gradeRule = null!; + private Border _gradeChip = null!; + private StackPanel _stepsPanel = null!; + private Button _stepsToggle = null!; + private bool _stepsOpen; + + // 底部:实地尺 + private ComboBox _landmarkBox = null!; + private TextBlock _landmarkResult = null!; + + // 底部:练习 + private TextBlock _quizPrompt = null!, _quizFeedback = null!, _quizStreak = null!, _quizUnit = null!; + private TextBox _quizInput = null!; + private Button _quizCheck = null!, _quizNext = null!; + private StackPanel _quizSteps = null!; + + private void BuildLayout() + { + var root = new Grid { Background = B(CAppBg) }; + root.RowDefinitions.Add(new RowDefinition(GridLength.Auto)); // 顶部 + root.RowDefinitions.Add(new RowDefinition(GridLength.Star)); // 三栏 + root.RowDefinitions.Add(new RowDefinition(GridLength.Auto)); // 底部 + root.RowDefinitions.Add(new RowDefinition(GridLength.Auto)); // 页脚 + + var header = BuildHeader(); + Grid.SetRow(header, 0); + root.Children.Add(header); + + var columns = new Grid { Margin = new Thickness(16, 12, 16, 8) }; + columns.ColumnDefinitions.Add(new ColumnDefinition(new GridLength(300))); + columns.ColumnDefinitions.Add(new ColumnDefinition(new GridLength(16))); + columns.ColumnDefinitions.Add(new ColumnDefinition(GridLength.Star)); + columns.ColumnDefinitions.Add(new ColumnDefinition(new GridLength(16))); + columns.ColumnDefinitions.Add(new ColumnDefinition(new GridLength(320))); + + var left = BuildLeft(); + Grid.SetColumn(left, 0); + columns.Children.Add(left); + var mid = BuildMiddle(); + Grid.SetColumn(mid, 2); + columns.Children.Add(mid); + var right = BuildRight(); + Grid.SetColumn(right, 4); + columns.Children.Add(right); + Grid.SetRow(columns, 1); + root.Children.Add(columns); + + var bottom = BuildBottom(); + Grid.SetRow(bottom, 2); + root.Children.Add(bottom); + + var footer = new Border + { + Background = B(CSurfaceAlt), + BorderBrush = B(CLine), + BorderThickness = new Thickness(0, 1, 0, 0), + Padding = new Thickness(20, 9), + Child = Tb(T("common.footer"), 11, CInkFaint) + }; + Grid.SetRow(footer, 3); + root.Children.Add(footer); + + Content = root; + } + + private Control BuildHeader() + { + var title = Tb(T("app.title"), 22, CInk, FontWeight.SemiBold); + var sub = Tb(T("app.subtitle"), 12, CInkDim); + + _btnReal = Btn(T("mode.real")); + _btnMap = Btn(T("mode.map")); + _btnScale = Btn(T("mode.scale")); + + var modes = H(8); + modes.Children.Add(_btnReal); + modes.Children.Add(_btnMap); + modes.Children.Add(_btnScale); + + var leftStack = V(2); + leftStack.Children.Add(title); + leftStack.Children.Add(sub); + + var grid = new Grid + { + Background = B(CSurface), + Margin = new Thickness(0) + }; + grid.ColumnDefinitions.Add(new ColumnDefinition(GridLength.Star)); + grid.ColumnDefinitions.Add(new ColumnDefinition(GridLength.Auto)); + var leftBorder = new Border { Padding = new Thickness(20, 14, 10, 14), Child = leftStack }; + Grid.SetColumn(leftBorder, 0); + grid.Children.Add(leftBorder); + var rightBorder = new Border + { + Padding = new Thickness(10, 14, 20, 14), + VerticalAlignment = VerticalAlignment.Center, + Child = V(4) + }; + // 右侧:提示 + 模式按钮 + var rv = (StackPanel)rightBorder.Child!; + rv.Children.Add(Tb(T("mode.hint"), 10.5, CInkFaint, align: TextAlignment.Right)); + rv.Children.Add(modes); + Grid.SetColumn(rightBorder, 1); + grid.Children.Add(rightBorder); + + var outer = new Border + { + Background = B(CSurface), + BorderBrush = B(CLine), + BorderThickness = new Thickness(0, 0, 0, 1), + Child = grid + }; + return outer; + } + + private Control BuildLeft() + { + var panel = V(10); + + var head = H(6); + head.Children.Add(new Border + { + Width = 4, Height = 16, Background = B(CAccent), + CornerRadius = new CornerRadius(2) + }); + head.Children.Add(H3(T("input.title"))); + panel.Children.Add(head); + + // ── 图上距离卡 + panel.Children.Add(BuildInputCard( + "input.map", "unit.cm", out _mapCard, out _mapCardLabel, out _mapResultText, + out _mapSlider, out _mapBox, withSlider: true)); + + // ── 实地距离卡 + panel.Children.Add(BuildRealCard()); + + // ── 比例尺卡 + panel.Children.Add(BuildScaleCard()); + + // 预设 + panel.Children.Add(Label(T("input.presets"), 11.5, CInkFaint)); + _presetPanel = new WrapPanel { Orientation = Orientation.Horizontal }; + foreach (var p in _data.Presets) + { + var b = Btn(T(p.NameKey)); + b.Tag = p; + b.Click += (_, _) => ApplyPreset((PresetItem)b.Tag!); + b.Margin = new Thickness(0, 0, 6, 6); + _presetPanel.Children.Add(b); + } + panel.Children.Add(_presetPanel); + + panel.Children.Add(Divider()); + var reset = Btn(T("input.reset")); + reset.Click += (_, _) => ResetState(); + panel.Children.Add(reset); + panel.Children.Add(Tb(T("input.dragHint"), 10.5, CInkFaint)); + + var scroll = new ScrollViewer + { + Content = new Border { Padding = new Thickness(14), Child = panel }, + VerticalScrollBarVisibility = ScrollBarVisibility.Auto, + HorizontalScrollBarVisibility = ScrollBarVisibility.Disabled + }; + return Card(scroll); + } + + private Control BuildInputCard(string labelKey, string unitKey, + out Border card, out TextBlock label, out TextBlock resultText, + out Slider slider, out TextBox box, bool withSlider) + { + label = Label(T(labelKey), 11.5); + resultText = Tb("—", 15, CInk, FontWeight.SemiBold); + var top = new DockPanel(); + top.Children.Add(resultText); + DockPanel.SetDock(resultText, Dock.Right); + top.Children.Add(label); + + box = Input("3"); + box.Width = 110; + box.HorizontalAlignment = HorizontalAlignment.Left; + + slider = new Slider + { + Minimum = 0.1, + Maximum = 20, + Value = 3, + TickFrequency = 0.5, + IsSnapToTickEnabled = false, + Foreground = B(CAccent), + Margin = new Thickness(0, 2, 0, 0) + }; + + var stack = V(6); + stack.Children.Add(top); + stack.Children.Add(box); + if (withSlider) stack.Children.Add(slider); + + card = new Border + { + Background = B(CSurfaceAlt), + BorderBrush = B(CLine), + BorderThickness = new Thickness(1), + CornerRadius = new CornerRadius(10), + Padding = new Thickness(12), + Child = stack + }; + return card; + } + + private Control BuildRealCard() + { + _realCardLabel = Label(T("input.real"), 11.5); + _realResultText = Tb("—", 15, CInk, FontWeight.SemiBold); + var top = new DockPanel(); + top.Children.Add(_realResultText); + DockPanel.SetDock(_realResultText, Dock.Right); + top.Children.Add(_realCardLabel); + + _realBox = Input("3"); + _unitBox = new ComboBox + { + FontSize = 12.5, + Background = B(CSurface), + Foreground = B(CInk), + BorderBrush = B(CLineStrong), + BorderThickness = new Thickness(1), + CornerRadius = new CornerRadius(9), + Padding = new Thickness(10, 6), + MinHeight = 34, + Width = 92, + ItemsSource = new[] { "unit.km", "unit.m", "unit.cm" }, + SelectedIndex = 0 + }; + // 显示本地化单位名 + _unitBox.SelectionChanged += (_, _) => { SyncUnitDisplay(); RefreshAll(syncInputs: true); }; + + var row = H(8); + row.Children.Add(_realBox); + row.Children.Add(_unitBox); + + var stack = V(6); + stack.Children.Add(top); + stack.Children.Add(row); + + _realCard = new Border + { + Background = B(CSurfaceAlt), + BorderBrush = B(CLine), + BorderThickness = new Thickness(1), + CornerRadius = new CornerRadius(10), + Padding = new Thickness(12), + Child = stack + }; + return _realCard; + } + + private Control BuildScaleCard() + { + _scaleCardLabel = Label(T("input.scale"), 11.5); + _scaleResultText = Tb("—", 15, CInk, FontWeight.SemiBold); + var top = new DockPanel(); + top.Children.Add(_scaleResultText); + DockPanel.SetDock(_scaleResultText, Dock.Right); + top.Children.Add(_scaleCardLabel); + + _nBox = Input("100000"); + var prefix = Tb(T("input.nPrefix"), 13, CInkDim, FontWeight.SemiBold); + var row = H(8); + row.Children.Add(prefix); + row.Children.Add(_nBox); + + var stack = V(6); + stack.Children.Add(top); + stack.Children.Add(row); + + _scaleCard = new Border + { + Background = B(CSurfaceAlt), + BorderBrush = B(CLine), + BorderThickness = new Thickness(1), + CornerRadius = new CornerRadius(10), + Padding = new Thickness(12), + Child = stack + }; + return _scaleCard; + } + + private Control BuildMiddle() + { + _ruler = new ScaleRuler + { + Data = _data, + State = _state, + T = T, + Height = 470, + VerticalAlignment = VerticalAlignment.Top + }; + var holder = new Border + { + Background = B(CSurface), + BorderBrush = B(CLine), + BorderThickness = new Thickness(1), + CornerRadius = new CornerRadius(14), + Padding = new Thickness(6), + Child = _ruler + }; + return holder; + } + + private Control BuildRight() + { + var panel = V(10); + + // 三种写法 + panel.Children.Add(SectionTitle(T("forms.title"))); + _digitalText = Tb("", 16, CAccentDark, FontWeight.SemiBold); + _verbalText = Tb("", 12, CInk); + _segmentText = Tb("", 12, CInk); + var forms = V(8); + forms.Children.Add(FormRow(T("forms.digital"), _digitalText)); + forms.Children.Add(FormRow(T("forms.verbal"), _verbalText)); + forms.Children.Add(FormRow(T("forms.segment"), _segmentText)); + panel.Children.Add(forms); + + panel.Children.Add(Divider()); + + // 解题步骤 + _stepsToggle = Btn(T("steps.show")); + _stepsToggle.Click += (_, _) => ToggleSteps(); + var sh = new DockPanel(); + DockPanel.SetDock(_stepsToggle, Dock.Right); + sh.Children.Add(_stepsToggle); + sh.Children.Add(SectionTitle(T("steps.title"))); + panel.Children.Add(sh); + _stepsPanel = V(4); + _stepsPanel.IsVisible = false; + panel.Children.Add(_stepsPanel); + + panel.Children.Add(Divider()); + + // 判读 + panel.Children.Add(SectionTitle(T("grade.title"))); + _gradeChip = Chip("", CAccentSoft, CAccentDark); + _gradeChip.HorizontalAlignment = HorizontalAlignment.Left; + _gradeTitle = Tb("", 13, CInk, FontWeight.SemiBold); + _gradeNote = Tb("", 11.5, CInkDim); + _gradeRule = Tb(T("grade.rule"), 11, CAccentDark, FontWeight.SemiBold); + var gradeBox = V(6); + gradeBox.Children.Add(_gradeChip); + gradeBox.Children.Add(_gradeNote); + gradeBox.Children.Add(_gradeRule); + panel.Children.Add(gradeBox); + + panel.Children.Add(Divider()); + + // 易错点 + panel.Children.Add(SectionTitle(T("pit.title"))); + var pit = V(4); + pit.Children.Add(Tb(T("pit.1"), 11, CInkDim)); + pit.Children.Add(Tb(T("pit.2"), 11, CInkDim)); + pit.Children.Add(Tb(T("pit.3"), 11, CInkDim)); + panel.Children.Add(pit); + + var scroll = new ScrollViewer + { + Content = new Border { Padding = new Thickness(14), Child = panel }, + VerticalScrollBarVisibility = ScrollBarVisibility.Auto, + HorizontalScrollBarVisibility = ScrollBarVisibility.Disabled + }; + return Card(scroll); + } + + private Control FormRow(string name, TextBlock value) + { + var g = new Grid(); + g.ColumnDefinitions.Add(new ColumnDefinition(new GridLength(62))); + g.ColumnDefinitions.Add(new ColumnDefinition(GridLength.Star)); + var n = Tb(name, 11, CInkFaint); + Grid.SetColumn(n, 0); + g.Children.Add(n); + Grid.SetColumn(value, 1); + g.Children.Add(value); + return g; + } + + private Control SectionTitle(string text) + => Tb(text, 12.5, CInk, FontWeight.SemiBold); + + private Control BuildBottom() + { + var grid = new Grid { Margin = new Thickness(16, 4, 16, 12) }; + grid.ColumnDefinitions.Add(new ColumnDefinition(GridLength.Star)); + grid.ColumnDefinitions.Add(new ColumnDefinition(new GridLength(12))); + grid.ColumnDefinitions.Add(new ColumnDefinition(new GridLength(1.4, GridUnitType.Star))); + + // ── 实地尺 + var field = V(8); + field.Children.Add(SectionTitle(T("field.title"))); + field.Children.Add(Tb(T("field.hint"), 10.5, CInkFaint)); + _landmarkBox = new ComboBox + { + FontSize = 12.5, + Background = B(CSurface), + Foreground = B(CInk), + BorderBrush = B(CLineStrong), + BorderThickness = new Thickness(1), + CornerRadius = new CornerRadius(9), + Padding = new Thickness(10, 6), + MinHeight = 34, + HorizontalAlignment = HorizontalAlignment.Stretch + }; + foreach (var lm in _data.Landmarks) _landmarkBox.Items!.Add(T(lm.NameKey)); + _landmarkBox.SelectedIndex = 0; + _landmarkBox.SelectionChanged += (_, _) => RefreshField(); + field.Children.Add(_landmarkBox); + _landmarkResult = Tb("", 14, CSuccess, FontWeight.SemiBold); + field.Children.Add(_landmarkResult); + var fieldCard = Card(field); + Grid.SetColumn(fieldCard, 0); + grid.Children.Add(fieldCard); + + // ── 练习 + var quiz = V(8); + _quizStreak = Tb(TF("quiz.streak", 0), 11, CAccentDark, FontWeight.SemiBold); + var qh = new DockPanel(); + DockPanel.SetDock(_quizStreak, Dock.Right); + qh.Children.Add(_quizStreak); + qh.Children.Add(SectionTitle(T("quiz.title"))); + quiz.Children.Add(qh); + + _quizPrompt = Tb("", 12, CInk); + quiz.Children.Add(_quizPrompt); + _quizUnit = Tb("", 10.5, CInkFaint); + quiz.Children.Add(_quizUnit); + + var qrow = H(8); + _quizInput = Input(""); + _quizInput.Width = 140; + _quizCheck = Btn(T("quiz.check"), primary: true); + _quizNext = Btn(T("quiz.next")); + _quizCheck.Click += (_, _) => CheckQuiz(); + _quizNext.Click += (_, _) => NewQuiz(); + qrow.Children.Add(_quizInput); + qrow.Children.Add(_quizCheck); + qrow.Children.Add(_quizNext); + quiz.Children.Add(qrow); + + _quizFeedback = Tb("", 12, CInkDim, FontWeight.SemiBold); + quiz.Children.Add(_quizFeedback); + _quizSteps = V(2); + quiz.Children.Add(_quizSteps); + + var quizCard = Card(quiz); + Grid.SetColumn(quizCard, 2); + grid.Children.Add(quizCard); + + return grid; + } +} diff --git a/model/scale-calculator/src/ScaleCalculatorView.Logic.cs b/model/scale-calculator/src/ScaleCalculatorView.Logic.cs new file mode 100644 index 0000000..09a6592 --- /dev/null +++ b/model/scale-calculator/src/ScaleCalculatorView.Logic.cs @@ -0,0 +1,312 @@ +using System; +using System.Globalization; +using Avalonia; +using Avalonia.Controls; +using Avalonia.Controls.Primitives; +using Avalonia.Media; + +namespace NeoRF.ScaleCalculator; + +public sealed partial class ScaleCalculatorView +{ + private readonly ScaleState _state = new(); + private bool _suppress; + private string _realUnit = "unit.km"; + private QuizItem _quiz = new(); + private int _streak; + private bool _quizAnswered; + + private void WireEvents() + { + _btnReal.Click += (_, _) => SetMode(SolveMode.Real); + _btnMap.Click += (_, _) => SetMode(SolveMode.Map); + _btnScale.Click += (_, _) => SetMode(SolveMode.Scale); + + _mapSlider.ValueChanged += (_, e) => + { + if (_suppress) return; + _state.MapCm = e.NewValue; + _suppress = true; + _mapBox.Text = ScaleMath.Num(_state.MapCm); + _suppress = false; + RefreshAll(syncInputs: false); + }; + _mapBox.TextChanged += (_, _) => OnTextInput(_mapBox, v => { _state.MapCm = v; }, v => + { + _suppress = true; + _mapSlider.Value = Math.Clamp(v, 0.1, 20); + _suppress = false; + }); + _realBox.TextChanged += (_, _) => + { + if (_suppress) return; + if (ScaleMath.TryParseReal(_realBox.Text ?? "", _realUnit, out var cm)) + { + _state.RealCm = cm; + RefreshAll(syncInputs: false); + } + }; + _nBox.TextChanged += (_, _) => OnTextInput(_nBox, v => { _state.N = v; }, null); + + _quizInput.KeyDown += (_, e) => + { + if (e.Key == Avalonia.Input.Key.Enter) CheckQuiz(); + }; + } + + private void OnTextInput(TextBox box, Action apply, Action? extra) + { + if (_suppress) return; + if (!double.TryParse((box.Text ?? "").Replace(",", "").Trim(), NumberStyles.Float, + CultureInfo.InvariantCulture, out var v) || v < 0 || double.IsNaN(v) || double.IsInfinity(v)) + return; + apply(v); + extra?.Invoke(v); + RefreshAll(syncInputs: false); + } + + private void SetMode(SolveMode mode, bool initial = false) + { + _state.Mode = mode; + if (!initial) ScaleMath.Solve(_state); + UpdateModeButtons(); + RefreshAll(syncInputs: true); + } + + private void UpdateModeButtons() + { + StyleMode(_btnReal, _state.Mode == SolveMode.Real); + StyleMode(_btnMap, _state.Mode == SolveMode.Map); + StyleMode(_btnScale, _state.Mode == SolveMode.Scale); + + // 结果卡高亮:待求的那一张变蓝 + StyleCard(_mapCard, _state.Mode == SolveMode.Map); + StyleCard(_realCard, _state.Mode == SolveMode.Real); + StyleCard(_scaleCard, _state.Mode == SolveMode.Scale); + + _mapResultText.Foreground = B(_state.Mode == SolveMode.Map ? CAccentDark : CInk); + _realResultText.Foreground = B(_state.Mode == SolveMode.Real ? CAccentDark : CInk); + _scaleResultText.Foreground = B(_state.Mode == SolveMode.Scale ? CAccentDark : CInk); + } + + private void StyleMode(Button b, bool active) + { + b.Background = B(active ? CAccent : CSurface); + b.BorderBrush = B(active ? CAccent : CLineStrong); + b.BorderThickness = new Thickness(active ? 0 : 1); + if (b.Content is TextBlock t) + t.Foreground = B(active ? Colors.White : CInk); + } + + private static void StyleCard(Border card, bool active) + { + card.Background = B(active ? Color.Parse("#F0F5FF") : Color.Parse("#F7F9FE")); + card.BorderBrush = B(active ? Color.Parse("#2F6BFF") : Color.Parse("#E3E8F3")); + card.BorderThickness = new Thickness(active ? 1.5 : 1); + } + + private void ApplyPreset(PresetItem p) + { + _state.N = p.N; + ScaleMath.Solve(_state); + RefreshAll(syncInputs: true); + } + + private void ResetState() + { + _state.MapCm = 3.0; + _state.N = 100000.0; + ScaleMath.Solve(_state); + RefreshAll(syncInputs: true); + } + + private void SyncUnitDisplay() + { + // ComboBox 的 ItemsSource 是 "unit.km" 等键;这里只记录选择,显示由下拉项本身处理 + var idx = _unitBox.SelectedIndex; + _realUnit = idx switch { 1 => "unit.m", 2 => "unit.cm", _ => "unit.km" }; + } + + /// + /// 全量刷新。syncInputs=true 时把三个输入框/滑块同步成 state(切换模式、预设、重置后需要); + /// false 时保留用户正在输入的文本(避免光标跳动)。 + /// + private void RefreshAll(bool syncInputs) + { + ScaleMath.Solve(_state); + + if (syncInputs) + { + _suppress = true; + _mapBox.Text = ScaleMath.Num(_state.MapCm); + _mapSlider.Value = Math.Clamp(_state.MapCm, 0.1, 20); + _nBox.Text = ScaleMath.FormatN(_state.N); + var (rv, _) = ScaleMath.HumanReal(_state.RealCm); + // 用当前选择的单位显示 + _realBox.Text = ScaleMath.Num(ScaleMath.ToUnit(_state.RealCm, _realUnit)); + _suppress = false; + } + + UpdateModeButtons(); + + // 结果卡读数(三张都显示当前值,蓝色那张是"答案") + _mapResultText.Text = ScaleMath.Num(_state.MapCm) + " " + T("unit.cm"); + var (rv2, rkey2) = ScaleMath.HumanReal(_state.RealCm); + _realResultText.Text = ScaleMath.Num(rv2) + " " + T(rkey2); + _scaleResultText.Text = "1 : " + ScaleMath.FormatN(_state.N); + + // 三种写法 + _digitalText.Text = ScaleMath.Digital(_state.N); + _verbalText.Text = TF("forms.verbalTpl", ScaleMath.VerbalDistance(_state.N)); + _segmentText.Text = TF("forms.segmentDesc", + ScaleMath.SegmentLabel(_ruler.Segment.MetersPerDiv), _ruler.Segment.DivCount); + + // 判读 + var gradeKey = ScaleMath.GradeKey(_state.N); + _gradeTitle.Text = T(gradeKey); + _gradeChip.Child = Tb(T(gradeKey), 11, CAccentDark, FontWeight.SemiBold); + _gradeNote.Text = T(gradeKey + "Note"); + _gradeRule.Text = T("grade.rule"); + + // 标尺 + _ruler.State = _state.Clone(); + _ruler.Refresh(); + _segmentText.Text = TF("forms.segmentDesc", + ScaleMath.SegmentLabel(_ruler.Segment.MetersPerDiv), _ruler.Segment.DivCount); + + BuildSteps(); + RefreshField(); + } + + private void BuildSteps() + { + _stepsPanel.Children.Clear(); + var map = ScaleMath.Num(_state.MapCm); + var realCm = ScaleMath.Num(_state.RealCm); + var n = ScaleMath.FormatN(_state.N); + var (rv, rk) = ScaleMath.HumanReal(_state.RealCm); + var result = _state.Mode switch + { + SolveMode.Real => ScaleMath.Num(rv) + " " + T(rk), + SolveMode.Map => ScaleMath.Num(_state.MapCm) + " " + T("unit.cm"), + _ => "1 : " + ScaleMath.FormatN(_state.N) + }; + var formulaKey = _state.Mode switch + { + SolveMode.Real => "steps.2.formulaReal", + SolveMode.Map => "steps.2.formulaMap", + _ => "steps.2.formulaScale" + }; + var substitute = _state.Mode switch + { + SolveMode.Real => map + " cm × " + n, + SolveMode.Map => realCm + " cm ÷ " + n, + _ => realCm + " cm ÷ " + map + " cm" + }; + + var lines = new System.Collections.Generic.List + { + T("steps.1.unify"), + T(formulaKey), + TF("steps.3.substitute", substitute), + TF("steps.4.result", result), + T("steps.5.convert") + }; + var i = 0; + foreach (var line in lines) + { + _stepsPanel.Children.Add(Tb(line, 11, i == 3 ? CAccentDark : CInkDim, + i == 3 ? FontWeight.SemiBold : null)); + i++; + } + } + + private void ToggleSteps() + { + _stepsOpen = !_stepsOpen; + _stepsPanel.IsVisible = _stepsOpen; + _stepsToggle.Content = Tb(T(_stepsOpen ? "steps.hide" : "steps.show"), 12.5, CInk, FontWeight.SemiBold); + } + + private void RefreshField() + { + var idx = _landmarkBox.SelectedIndex; + if (idx < 0 || idx >= _data.Landmarks.Count) return; + var meters = _data.Landmarks[idx].Meters; + var realCm = meters * ScaleMath.CmPerM; + var mapCm = ScaleMath.RealToMapCm(realCm, _state.N); + var px = ScaleMath.CmToPx(mapCm, _ruler.PxPerCm); + // mapCm 是厘米,按 HumanReal 换算成"图上长度"的合适单位 + var (mv, mk) = ScaleMath.HumanReal(mapCm); + + string text; + if (px > _ruler.MaxBarWidth) + text = TF("field.mapLength", ScaleMath.Num(mv) + " " + T(mk)) + " · " + T("field.tooLong"); + else if (px < 1) + text = TF("field.mapLength", ScaleMath.Num(mv) + " " + T(mk)) + " · " + T("field.tooShort"); + else + text = TF("field.mapLength", ScaleMath.Num(mv) + " " + T(mk)); + _landmarkResult.Text = text; + _landmarkResult.Foreground = B(px > _ruler.MaxBarWidth ? CDanger : px < 1 ? CWarn : CSuccess); + } + + // ────────────────────────────────────────────────────────── 练习 + + private void NewQuiz() + { + _quiz = ScaleMath.GenerateQuiz(_rnd); + _quizAnswered = false; + _quizInput.Text = ""; + _quizFeedback.Text = ""; + _quizSteps.Children.Clear(); + _quizPrompt.Text = TF(_quiz.PromptKey, _quiz.PromptArgs); + var unitText = _quiz.AnswerUnitKey == "unit.none" ? T("unit.none") : T(_quiz.AnswerUnitKey); + _quizUnit.Text = TF("quiz.unit", unitText); + _quizStreak.Text = TF("quiz.streak", _streak); + } + + private void CheckQuiz() + { + if (_quizAnswered) return; + if (!double.TryParse((_quizInput.Text ?? "").Replace(",", "").Trim(), NumberStyles.Float, + CultureInfo.InvariantCulture, out var v)) + { + _quizFeedback.Text = T("quiz.wrong"); + _quizFeedback.Foreground = B(CDanger); + return; + } + + if (ScaleMath.CheckAnswer(_quiz, v)) + { + _streak++; + _quizFeedback.Text = T("quiz.correct"); + _quizFeedback.Foreground = B(CSuccess); + } + else + { + _streak = 0; + _quizFeedback.Text = T("quiz.wrong"); + _quizFeedback.Foreground = B(CDanger); + ShowQuizSteps(); + } + _quizAnswered = true; + _quizStreak.Text = TF("quiz.streak", _streak); + } + + private void ShowQuizSteps() + { + _quizSteps.Children.Clear(); + _quizSteps.Children.Add(Tb(T("quiz.showSteps"), 10.5, CInkFaint, FontWeight.SemiBold)); + foreach (var key in _quiz.StepKeys) + { + var line = T(key); + if (line.Contains("{0}")) line = TF(key, ScaleMath.Num(_quiz.Answer) + " " + + (_quiz.AnswerUnitKey == "unit.none" ? "" : T(_quiz.AnswerUnitKey))); + _quizSteps.Children.Add(Tb(line, 10.5, CInkDim)); + } + _quizSteps.Children.Add(Tb(TF("steps.4.result", + ScaleMath.Num(_quiz.Answer) + " " + + (_quiz.AnswerUnitKey == "unit.none" ? "" : T(_quiz.AnswerUnitKey))), + 10.5, CAccentDark, FontWeight.SemiBold)); + } +} diff --git a/model/scale-calculator/src/ScaleCalculatorView.cs b/model/scale-calculator/src/ScaleCalculatorView.cs new file mode 100644 index 0000000..e9d115b --- /dev/null +++ b/model/scale-calculator/src/ScaleCalculatorView.cs @@ -0,0 +1,141 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using Avalonia; +using Avalonia.Controls; +using Avalonia.Controls.Primitives; +using Avalonia.Input; +using Avalonia.Layout; +using Avalonia.Media; + +namespace NeoRF.ScaleCalculator; + +/// +/// 比例尺计算器主界面。三栏(已知量 / 可视化标尺 / 三种写法与判读)+ 底部实地尺与练习。 +/// 全部用显式画刷(与启动器 AppTheme 同色),不依赖 DynamicResource —— 模型 dll 在 +/// 独立 ALC 里加载,headless 生成封面时也没有 Application 样式。 +/// +public sealed partial class ScaleCalculatorView : UserControl +{ + // 调色(与 src/main/dotnet/EarthModelStudio/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"); + internal static readonly Color CLine = Color.Parse("#E3E8F3"); + internal static readonly Color CLineStrong = Color.Parse("#D2DAEA"); + internal static readonly Color CInk = Color.Parse("#111A2E"); + internal static readonly Color CInkDim = Color.Parse("#5B6A86"); + internal static readonly Color CInkFaint = Color.Parse("#8A97B1"); + internal static readonly Color CAccent = Color.Parse("#2F6BFF"); + internal static readonly Color CAccentDark = Color.Parse("#1F4FD0"); + internal static readonly Color CAccentSoft = Color.Parse("#EAF1FF"); + internal static readonly Color CSuccess = Color.Parse("#1F9D6B"); + internal static readonly Color CDanger = Color.Parse("#D64545"); + internal static readonly Color CWarn = Color.Parse("#D98613"); + internal static readonly Color CHero = Color.Parse("#12203C"); + + internal static SolidColorBrush B(Color c) => new(c); + internal static SolidColorBrush Brush(string hex) => new(Color.Parse(hex)); + + private readonly ScaleData _data; + private readonly Dictionary _texts; + private readonly string _language; + private readonly Random _rnd = new(); + + public string T(string key) + => _texts.TryGetValue(key, out var v) ? v + : DefaultTexts.Zh.TryGetValue(key, out var f) ? f : key; + + public string TF(string key, params object[] args) + => string.Format(CultureInfo.InvariantCulture, T(key), args); + + public ScaleCalculatorView(ScaleData data, Dictionary texts, string language) + { + _data = data; + _texts = texts; + _language = language; + + BuildLayout(); + WireEvents(); + SetMode(SolveMode.Real, initial: true); + NewQuiz(); + RefreshAll(syncInputs: true); + } + + // ────────────────────────────────────────────────────────── 小工具 + + internal static Border Card(Control content, double radius = 14) + => new() + { + Background = B(CSurface), + BorderBrush = B(CLine), + BorderThickness = new Thickness(1), + CornerRadius = new CornerRadius(radius), + Padding = new Thickness(14), + Child = content + }; + + internal static TextBlock Tb(string text, double size, Color color, FontWeight? weight = null, + TextAlignment align = TextAlignment.Left) + => new() + { + Text = text, + FontSize = size, + Foreground = B(color), + FontWeight = weight ?? FontWeight.Normal, + TextAlignment = align, + TextWrapping = TextWrapping.Wrap + }; + + internal static TextBlock Label(string text, double size = 12, Color? color = null) + => Tb(text, size, color ?? CInkDim); + + internal static TextBlock H3(string text) => Tb(text, 13.5, CInk, FontWeight.SemiBold); + + internal static Border Chip(string text, Color bg, Color fg, double radius = 8) + => new() + { + Background = B(bg), + CornerRadius = new CornerRadius(radius), + Padding = new Thickness(10, 4), + Child = Tb(text, 11, fg, FontWeight.SemiBold) + }; + + internal static Button Btn(string text, bool primary = false) + => new() + { + Content = Tb(text, 12.5, primary ? Colors.White : CInk, FontWeight.SemiBold), + Background = B(primary ? CAccent : CSurface), + BorderBrush = B(primary ? CAccent : CLineStrong), + BorderThickness = new Thickness(primary ? 0 : 1), + CornerRadius = new CornerRadius(9), + Padding = new Thickness(12, 7), + HorizontalContentAlignment = HorizontalAlignment.Center, + VerticalContentAlignment = VerticalAlignment.Center, + Cursor = new Cursor(StandardCursorType.Hand) + }; + + internal static TextBox Input(string text = "") + => new() + { + Text = text, + FontSize = 12.5, + Background = B(CSurface), + Foreground = B(CInk), + BorderBrush = B(CLineStrong), + BorderThickness = new Thickness(1), + CornerRadius = new CornerRadius(9), + Padding = new Thickness(10, 7), + VerticalContentAlignment = VerticalAlignment.Center, + MinHeight = 34 + }; + + internal static Border Divider(double h = 1) + => new() { Background = B(CLine), Height = h, Margin = new Thickness(0, 10, 0, 10) }; + + internal static StackPanel V(double spacing = 8) + => new() { Orientation = Orientation.Vertical, Spacing = spacing }; + + internal static StackPanel H(double spacing = 8) + => new() { Orientation = Orientation.Horizontal, Spacing = spacing, VerticalAlignment = VerticalAlignment.Center }; +} diff --git a/model/scale-calculator/src/ScaleData.cs b/model/scale-calculator/src/ScaleData.cs new file mode 100644 index 0000000..9c22c6e --- /dev/null +++ b/model/scale-calculator/src/ScaleData.cs @@ -0,0 +1,88 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace NeoRF.ScaleCalculator; + +public sealed class PresetItem +{ + public double N { get; set; } + public string NameKey { get; set; } = ""; + public string NoteKey { get; set; } = ""; +} + +public sealed class SpectrumItem +{ + public double N { get; set; } + public string LabelKey { get; set; } = ""; + public string ScopeKey { get; set; } = ""; +} + +public sealed class LandmarkItem +{ + public string NameKey { get; set; } = ""; + /// 实地距离(米)。 + public double Meters { get; set; } +} + +public sealed class ScaleData +{ + public List Presets { get; set; } = new(); + public List Spectrum { get; set; } = new(); + public List Landmarks { get; set; } = new(); + + private static readonly JsonSerializerOptions Opts = new() + { + PropertyNameCaseInsensitive = true, + ReadCommentHandling = JsonCommentHandling.Skip, + AllowTrailingCommas = true, + NumberHandling = JsonNumberHandling.AllowReadingFromString + }; + + public static ScaleData Load(string dataDir) + { + var path = Path.Combine(dataDir, "scales.json"); + if (!File.Exists(path)) return Fallback(); + try + { + var d = JsonSerializer.Deserialize(File.ReadAllText(path), Opts); + if (d == null || d.Presets.Count == 0) return Fallback(); + return d; + } + catch (Exception ex) + { + Console.Error.WriteLine($"[scale-calculator] 读取 scales.json 失败: {ex.Message}"); + return Fallback(); + } + } + + private static ScaleData Fallback() => new() + { + Presets = new List + { + new() { N = 10000, NameKey = "preset.campus", NoteKey = "preset.campusNote" }, + new() { N = 50000, NameKey = "preset.town", NoteKey = "preset.townNote" }, + new() { N = 250000, NameKey = "preset.city", NoteKey = "preset.cityNote" }, + new() { N = 1000000, NameKey = "preset.province", NoteKey = "preset.provinceNote" }, + new() { N = 10000000, NameKey = "preset.china", NoteKey = "preset.chinaNote" }, + new() { N = 100000000, NameKey = "preset.world", NoteKey = "preset.worldNote" } + }, + Spectrum = new List + { + new() { N = 10000, LabelKey = "spec.campus", ScopeKey = "spec.campusScope" }, + new() { N = 250000, LabelKey = "spec.city", ScopeKey = "spec.cityScope" }, + new() { N = 10000000, LabelKey = "spec.china", ScopeKey = "spec.chinaScope" }, + new() { N = 100000000, LabelKey = "spec.world", ScopeKey = "spec.worldScope" } + }, + Landmarks = new List + { + new() { NameKey = "lm.classroom", Meters = 10 }, + new() { NameKey = "lm.track", Meters = 400 }, + new() { NameKey = "lm.marathon", Meters = 42195 }, + new() { NameKey = "lm.beijingShanghai", Meters = 1080000 }, + new() { NameKey = "lm.equator", Meters = 40000000 } + } + }; +} diff --git a/model/scale-calculator/src/ScaleMath.cs b/model/scale-calculator/src/ScaleMath.cs new file mode 100644 index 0000000..879b27d --- /dev/null +++ b/model/scale-calculator/src/ScaleMath.cs @@ -0,0 +1,291 @@ +using System; +using System.Globalization; + +namespace NeoRF.ScaleCalculator; + +/// 三种求解模式:待求的量。 +public enum SolveMode +{ + /// 求实地距离 + Real, + /// 求图上距离 + Map, + /// 求比例尺 + Scale +} + +public enum ScaleGrade { Large, Medium, Small } + +/// +/// 三个量始终同时存在:图上距离(cm)、实地距离(cm)、比例尺分母 N。 +/// 指定哪个是"待求结果",另两个是输入; +/// 只由两个输入重算结果量,切换模式时数值保持连续。 +/// +public sealed class ScaleState +{ + public double MapCm = 3.0; + public double RealCm = 300000.0; // 3 km + public double N = 100000.0; // 1:100000 + public SolveMode Mode = SolveMode.Real; + + public ScaleState Clone() => new() + { + MapCm = MapCm, RealCm = RealCm, N = N, Mode = Mode + }; +} + +/// 线段式比例尺换挡结果。 +public sealed class SegmentScale +{ + /// 每一格代表的实地距离(米)。 + public double MetersPerDiv; + /// 每一格在屏幕上的像素宽度。 + public double DivPx; + /// 绘制的格数。 + public int DivCount = 5; +} + +/// 一道练习题。 +public sealed class QuizItem +{ + public SolveMode Mode; + public string PromptKey = ""; + public object[] PromptArgs = Array.Empty(); + public double Answer; + /// 相对容差。 + public double Tolerance = 0.02; + public string AnswerUnitKey = "unit.cm"; + public string[] StepKeys = Array.Empty(); +} + +public static class ScaleMath +{ + public const double CmPerM = 100.0; + public const double CmPerKm = 100000.0; + + /// 由两个输入量重算"待求"量。 + public static void Solve(ScaleState s) + { + // 先做一次合法性收敛,避免 0 / 负数进入除法 + if (s.MapCm < 0) s.MapCm = 0; + if (s.RealCm < 0) s.RealCm = 0; + if (s.N < 1) s.N = 1; + + switch (s.Mode) + { + case SolveMode.Real: + s.RealCm = s.MapCm * s.N; + break; + case SolveMode.Map: + s.MapCm = s.N > 0 ? s.RealCm / s.N : 0; + break; + case SolveMode.Scale: + s.N = s.MapCm > 1e-9 ? s.RealCm / s.MapCm : 1; + if (s.N < 1) s.N = 1; + break; + } + } + + /// 厘米 → 更合适的单位与数值。 + public static (double value, string unitKey) HumanReal(double cm) + { + if (cm < 1) return (cm, "unit.cm"); + if (cm < CmPerM) return (cm, "unit.cm"); + if (cm < CmPerKm) return (cm / CmPerM, "unit.m"); + return (cm / CmPerKm, "unit.km"); + } + + public static string Num(double v) + { + if (double.IsNaN(v) || double.IsInfinity(v)) return "—"; + var a = Math.Abs(v); + if (a >= 1000) return v.ToString("#,##0", CultureInfo.InvariantCulture); + if (a >= 10) return v.ToString("0.#", CultureInfo.InvariantCulture); + if (a >= 1) return v.ToString("0.##", CultureInfo.InvariantCulture); + if (a >= 0.01) return v.ToString("0.###", CultureInfo.InvariantCulture); + if (a == 0) return "0"; + return v.ToString("0.####", CultureInfo.InvariantCulture); + } + + public static string FormatRealCm(double cm) + { + var (v, key) = HumanReal(cm); + return Num(v) + " " + key; + } + + public static string FormatN(double n) => Num(Math.Round(n)); + + /// 数字式写法 1:N。 + public static string Digital(double n) => "1 : " + FormatN(n); + + /// "文字式"里那一段实地距离(含单位),由调用方套 i18n 模板。 + public static string VerbalDistance(double n) + { + // 图上 1 厘米代表实地 n 厘米 + var (v, key) = HumanReal(n); + return Num(v) + " " + key; + } + + /// 按当前比例尺,把一段实地距离换算成图上厘米。 + public static double RealToMapCm(double realCm, double n) => n > 0 ? realCm / n : 0; + + /// 把图上厘米换算为屏幕像素。 + public static double CmToPx(double cm, double pxPerCm) => cm * pxPerCm; + + /// 把一段实地距离按当前比例尺换算成屏幕像素。 + public static double RealToMapPx(double realCm, double n, double pxPerCm) + => RealToMapCm(realCm, n) * pxPerCm; + + /// + /// 线段式比例尺自动换挡:在 1/2/5×10^k(米)里挑一个, + /// 使每格画出来最接近 targetPx,保证任何比例尺都画得下、刻度又是整数。 + /// + public static SegmentScale PickSegment(double n, double pxPerCm, double targetPx) + { + if (n < 1) n = 1; + if (pxPerCm < 1) pxPerCm = 1; + // 每格实地米数(理想值):px = m*100/n*pxPerCm + var idealMeters = targetPx * n / (100.0 * pxPerCm); + if (idealMeters <= 0) idealMeters = 1; + + double best = 1; + double bestErr = double.MaxValue; + var logIdeal = Math.Log10(idealMeters); + for (var k = -3; k <= 9; k++) + { + foreach (var m in new[] { 1.0, 2.0, 5.0 }) + { + var cand = m * Math.Pow(10, k); + var err = Math.Abs(Math.Log10(cand) - logIdeal); + if (err < bestErr) { bestErr = err; best = cand; } + } + } + + var divPx = best * 100.0 / n * pxPerCm; + // 极端情况下(换挡后仍过长/过短)把格数收敛一下,保证总长在合理区间 + var count = 5; + var total = divPx * count; + if (total > targetPx * 9) count = 4; + else if (total < targetPx * 2.5) count = 6; + + return new SegmentScale { MetersPerDiv = best, DivPx = divPx, DivCount = count }; + } + + /// 线段式每格的标注文字(不带 i18n,纯数值+单位)。 + public static string SegmentLabel(double meters) + { + if (meters < 1) return Num(meters * 100) + " cm"; + if (meters < 1000) return Num(meters) + " m"; + return Num(meters / 1000) + " km"; + } + + public static ScaleGrade Grade(double n) + { + if (n <= 100000) return ScaleGrade.Large; + if (n <= 1000000) return ScaleGrade.Medium; + return ScaleGrade.Small; + } + + public static string GradeKey(double n) => Grade(n) switch + { + ScaleGrade.Large => "grade.large", + ScaleGrade.Medium => "grade.medium", + _ => "grade.small" + }; + + /// 光谱上 0..1 的位置(对数刻度,1:1千 ~ 1:10亿)。 + public static double SpectrumPosition(double n) + { + if (n < 1) n = 1; + var p = (Math.Log10(n) - 3.0) / 6.0; + return p < 0 ? 0 : p > 1 ? 1 : p; + } + + /// 把用户输入的"数值+单位"解析成厘米。 + public static bool TryParseReal(string text, string unitKey, out double cm) + { + cm = 0; + if (!double.TryParse(text.Replace(",", "").Trim(), NumberStyles.Float, + CultureInfo.InvariantCulture, out var v) || v < 0 || double.IsNaN(v) || double.IsInfinity(v)) + return false; + cm = unitKey switch + { + "unit.m" => v * CmPerM, + "unit.km" => v * CmPerKm, + _ => v * 1.0 + }; + return true; + } + + /// 由厘米得到该单位下的数值(用于输入框显示)。 + public static double ToUnit(double cm, string unitKey) => unitKey switch + { + "unit.m" => cm / CmPerM, + "unit.km" => cm / CmPerKm, + _ => cm + }; + + // ------------------------------------------------------------------ 练习 + + public static QuizItem GenerateQuiz(Random rnd) + { + var mode = (SolveMode)rnd.Next(0, 3); + // 用整齐的数,方便心算 + var mapCm = new[] { 1.0, 2.0, 2.5, 3.0, 4.0, 5.0, 6.0, 8.0, 10.0, 12.0 }[rnd.Next(0, 10)]; + var ns = new[] { 1000.0, 5000.0, 10000.0, 25000.0, 50000.0, 100000.0, 500000.0, 1000000.0, 5000000.0, 10000000.0 }; + var n = ns[rnd.Next(0, ns.Length)]; + + switch (mode) + { + case SolveMode.Real: + { + var realCm = mapCm * n; + var (v, key) = HumanReal(realCm); + return new QuizItem + { + Mode = SolveMode.Real, + PromptKey = "quiz.promptReal", + PromptArgs = new object[] { FormatN(n), Num(mapCm) }, + Answer = v, + AnswerUnitKey = key, + StepKeys = new[] { "steps.2.formulaReal", "steps.4.result" } + }; + } + case SolveMode.Map: + { + // 让实地距离是整齐数字,反推图上距离也是整齐数字 + var realCm = mapCm * n; + var (v, key) = HumanReal(realCm); + return new QuizItem + { + Mode = SolveMode.Map, + PromptKey = "quiz.promptMap", + PromptArgs = new object[] { FormatN(n), Num(v) }, + Answer = mapCm, + AnswerUnitKey = "unit.cm", + StepKeys = new[] { "steps.2.formulaMap", "steps.4.result" } + }; + } + default: + { + var realCm = mapCm * n; + var (v, key) = HumanReal(realCm); + return new QuizItem + { + Mode = SolveMode.Scale, + PromptKey = "quiz.promptScale", + PromptArgs = new object[] { Num(mapCm), Num(v) }, + Answer = n, + AnswerUnitKey = "unit.none", + StepKeys = new[] { "steps.1.unify", "steps.2.formulaScale", "steps.4.result" } + }; + } + } + } + + public static bool CheckAnswer(QuizItem q, double input) + { + if (q.Answer <= 0) return false; + return Math.Abs(input - q.Answer) / q.Answer <= q.Tolerance; + } +} diff --git a/model/scale-calculator/src/ScaleRuler.cs b/model/scale-calculator/src/ScaleRuler.cs new file mode 100644 index 0000000..850de93 --- /dev/null +++ b/model/scale-calculator/src/ScaleRuler.cs @@ -0,0 +1,347 @@ +using System; +using System.Globalization; +using Avalonia; +using Avalonia.Controls; +using Avalonia.Media; + +namespace NeoRF.ScaleCalculator; + +/// +/// 自绘可视化标尺:上条「图上距离」按真实厘米画,下条「实地距离」按同一比例尺压缩, +/// 再画线段式比例尺(自动换挡)与比例尺光谱。全部在 Render 里完成,不产生子控件。 +/// +public sealed class ScaleRuler : Control +{ + // 与启动器 AppTheme 保持一致的调色(模型 dll 独立加载,取不到 DynamicResource 时也能显示) + private static readonly Color CInk = Color.Parse("#111A2E"); + private static readonly Color CInkDim = Color.Parse("#5B6A86"); + private static readonly Color CInkFaint = Color.Parse("#8A97B1"); + private static readonly Color CLine = Color.Parse("#E3E8F3"); + private static readonly Color CLineStrong = Color.Parse("#D2DAEA"); + private static readonly Color CAccent = Color.Parse("#2F6BFF"); + private static readonly Color CAccentSoft = Color.Parse("#EAF1FF"); + private static readonly Color CAccentDark = Color.Parse("#1F4FD0"); + private static readonly Color CSuccess = Color.Parse("#1F9D6B"); + private static readonly Color CWarn = Color.Parse("#D98613"); + private static readonly Color CDanger = Color.Parse("#D64545"); + private static readonly Color CSurfaceAlt = Color.Parse("#F7F9FE"); + private static readonly Color CSurface = Color.Parse("#FFFFFF"); + + private static readonly Typeface Font = new("Noto Sans CJK SC, Microsoft YaHei, Arial"); + + /// 1 厘米对应多少屏幕像素。 + public double PxPerCm = 46; + + /// 能画下的最大宽度(超出即溢出提示)。 + public double MaxBarWidth = 520; + + public ScaleState State { get; set; } = new(); + public ScaleData Data { get; set; } = new(); + public Func T { get; set; } = k => k; + + /// 线段式比例尺换挡结果(供界面读数)。 + public SegmentScale Segment { get; private set; } = new() { MetersPerDiv = 1000, DivPx = 46 }; + + /// 图上距离是否超出可画范围。 + public bool MapOverflow { get; private set; } + + /// 实地条溢出(按当前比例尺,这段实地图上也画不下)。 + public bool RealOverflow { get; private set; } + + public void Refresh() => InvalidateVisual(); + + private static FormattedText MakeText(string text, double size, Color color, FontWeight? weight = null) + { + var ft = new FormattedText(text, CultureInfo.InvariantCulture, FlowDirection.LeftToRight, + new Typeface(Font.FontFamily, FontStyle.Normal, weight ?? FontWeight.Normal), size, + new SolidColorBrush(color)); + return ft; + } + + private static void Text(DrawingContext dc, string s, double x, double y, double size, Color color, + FontWeight? weight = null, TextAlignment align = TextAlignment.Left) + { + var ft = MakeText(s, size, color, weight); + ft.TextAlignment = align; + dc.DrawText(ft, new Point(align == TextAlignment.Center ? x - ft.Width / 2 : x, y)); + } + + private static void RoundRect(DrawingContext dc, Rect r, double radius, IBrush fill, IPen? pen = null) + => dc.DrawRectangle(fill, pen, new RoundedRect(r, radius)); + + private static void Dot(DrawingContext dc, double x, double y, double r, IBrush fill) + => dc.DrawEllipse(fill, null, new Point(x, y), r, r); + + public override void Render(DrawingContext dc) + { + base.Render(dc); + var w = Bounds.Width; + var h = Bounds.Height; + if (w < 40 || h < 40) return; + + // 背景 + dc.FillRectangle(new SolidColorBrush(CSurface), new Rect(0, 0, w, h)); + + var padL = 34.0; + var padR = 30.0; + var barW = Math.Max(60, w - padL - padR); + MaxBarWidth = barW; + + var mapPx = ScaleMath.CmToPx(State.MapCm, PxPerCm); + var realPx = ScaleMath.RealToMapPx(State.RealCm, State.N, PxPerCm); + MapOverflow = mapPx > barW + 0.5; + RealOverflow = realPx > barW + 0.5; + + // 线段式比例尺换挡,取"每格约 60px" + Segment = ScaleMath.PickSegment(State.N, PxPerCm, 62); + + var y = 16.0; + + // ── 标题 + Text(dc, T("ruler.title"), padL, y, 13, CInk, FontWeight.SemiBold); + Text(dc, ScaleMath.Digital(State.N), w - padR, y + 1, 14, CAccentDark, + FontWeight.SemiBold, TextAlignment.Right); + y += 30; + + // ═══════════════════════════════════════════ 1. 图上距离条 + y = DrawMapBar(dc, padL, y, barW, mapPx); + y += 22; + + // ═══════════════════════════════════════════ 2. 等式连接 + DrawEquation(dc, padL, y, barW); + y += 30; + + // ═══════════════════════════════════════════ 3. 实地距离条(压缩) + y = DrawRealBar(dc, padL, y, barW, realPx); + y += 24; + + // ═══════════════════════════════════════════ 4. 线段式比例尺 + y = DrawSegmentScale(dc, padL, y, barW); + y += 24; + + // ═══════════════════════════════════════════ 5. 比例尺光谱 + y = DrawSpectrum(dc, padL, y, barW); + y += 34; + + // ═══════════════════════════════════════════ 6. 提示 / 溢出 + DrawFooter(dc, padL, y, barW); + } + + private double DrawMapBar(DrawingContext dc, double x, double y, double barW, double mapPx) + { + Text(dc, T("ruler.mapBar"), x, y, 11.5, CInkDim, FontWeight.SemiBold); + Text(dc, ScaleMath.Num(State.MapCm) + " " + T("unit.cm"), x + barW, y, 12.5, CAccent, + FontWeight.SemiBold, TextAlignment.Right); + y += 20; + + var barH = 34.0; + var r = new Rect(x, y, barW, barH); + RoundRect(dc, r, 9, new SolidColorBrush(CSurfaceAlt), new Pen(new SolidColorBrush(CLine), 1)); + + // 底上的厘米刻度(每 1cm 一格,最多画 30 格) + var maxTicks = Math.Min(30, (int)(barW / PxPerCm) + 1); + for (var i = 1; i <= maxTicks; i++) + { + var tx = x + i * PxPerCm; + if (tx > x + barW - 2) break; + dc.DrawLine(new Pen(new SolidColorBrush(CLineStrong), 1), + new Point(tx, y + barH - 7), new Point(tx, y + barH)); + if (i % 2 == 0) + Text(dc, i.ToString(CultureInfo.InvariantCulture), tx, y + barH + 2, 9.5, CInkFaint, + align: TextAlignment.Center); + } + + // 实长(蓝色),超出则截断并染红 + var drawW = Math.Min(mapPx, barW); + if (drawW > 0.5) + { + var fill = new LinearGradientBrush + { + StartPoint = new RelativePoint(0, 0, RelativeUnit.Relative), + EndPoint = new RelativePoint(1, 0, RelativeUnit.Relative), + GradientStops = new GradientStops + { + new(CAccentSoft, 0), new(CAccent, 1) + } + }; + RoundRect(dc, new Rect(x + 1, y + 1, drawW - 2, barH - 2), 8, fill, + new Pen(new SolidColorBrush(MapOverflow ? CDanger : CAccentDark), 1.5)); + } + + // 端点 + var endX = x + Math.Min(mapPx, barW); + Dot(dc, x + 2, y + barH / 2, 4, new SolidColorBrush(CSurface)); + if (!MapOverflow) + { + Dot(dc, endX - 2, y + barH / 2, 5, new SolidColorBrush(CSurface)); + Dot(dc, endX - 2, y + barH / 2, 3, new SolidColorBrush(CAccentDark)); + // 长度标注 + Text(dc, ScaleMath.Num(State.MapCm) + " " + T("unit.cm"), + endX - 4, y - 16, 11, CAccentDark, FontWeight.SemiBold, TextAlignment.Right); + } + else + { + Text(dc, "»", x + barW - 14, y + barH / 2 - 9, 16, CDanger, FontWeight.Bold); + } + + return y + barH; + } + + private void DrawEquation(DrawingContext dc, double x, double y, double barW) + { + var cx = x + barW / 2; + dc.DrawLine(new Pen(new SolidColorBrush(CLineStrong), 1, dashStyle: DashStyle.Dash), + new Point(x, y + 10), new Point(x + barW, y + 10)); + var label = T("ruler.equals"); + var ft = MakeText(label, 11, CInkDim, FontWeight.SemiBold); + var bw = ft.Width + 22; + RoundRect(dc, new Rect(cx - bw / 2, y, bw, 21), 10, new SolidColorBrush(CSurface), + new Pen(new SolidColorBrush(CLine), 1)); + Text(dc, label, cx, y + 4, 11, CInkDim, FontWeight.SemiBold, TextAlignment.Center); + } + + private double DrawRealBar(DrawingContext dc, double x, double y, double barW, double realPx) + { + var (rv, rkey) = ScaleMath.HumanReal(State.RealCm); + Text(dc, T("ruler.realBar"), x, y, 11.5, CInkDim, FontWeight.SemiBold); + Text(dc, ScaleMath.Num(rv) + " " + T(rkey), x + barW, y, 12.5, CSuccess, + FontWeight.SemiBold, TextAlignment.Right); + y += 20; + + var barH = 30.0; + RoundRect(dc, new Rect(x, y, barW, barH), 9, new SolidColorBrush(CSurfaceAlt), + new Pen(new SolidColorBrush(CLine), 1)); + + // 用"按同一比例尺压缩后"的长度表现:与上图同宽才直观 + var drawW = Math.Min(realPx, barW); + if (drawW > 0.5) + { + var fill = new LinearGradientBrush + { + StartPoint = new RelativePoint(0, 0, RelativeUnit.Relative), + EndPoint = new RelativePoint(1, 0, RelativeUnit.Relative), + GradientStops = new GradientStops { new(Color.Parse("#DFF5EA"), 0), new(CSuccess, 1) } + }; + RoundRect(dc, new Rect(x + 1, y + 1, drawW - 2, barH - 2), 8, fill, + new Pen(new SolidColorBrush(RealOverflow ? CDanger : CSuccess), 1.5)); + } + + // 画上"实地"的等分虚线,表达这段距离很长 + for (var i = 1; i < 6; i++) + { + var tx = x + barW * i / 6.0; + dc.DrawLine(new Pen(new SolidColorBrush(Color.Parse("#80FFFFFF")), 1, dashStyle: DashStyle.Dash), + new Point(tx, y + 5), new Point(tx, y + barH - 5)); + } + + if (!RealOverflow) + { + Dot(dc, x + drawW - 2, y + barH / 2, 4, new SolidColorBrush(CSurface)); + } + else + { + Text(dc, "»", x + barW - 14, y + barH / 2 - 9, 16, CDanger, FontWeight.Bold); + } + + // 中间写"= 图上这段" + Text(dc, T("ruler.sameWidth"), x + barW / 2, y + barH / 2 - 7, 10.5, CInkDim, + align: TextAlignment.Center); + + return y + barH; + } + + private double DrawSegmentScale(DrawingContext dc, double x, double y, double barW) + { + Text(dc, T("ruler.segment"), x, y, 11.5, CInkDim, FontWeight.SemiBold); + Text(dc, T("ruler.segmentHint"), x + barW, y + 1, 10, CInkFaint, align: TextAlignment.Right); + y += 20; + + var seg = Segment; + var total = seg.DivPx * seg.DivCount; + if (total > barW) + { + // 再降一档,避免画不下 + seg = ScaleMath.PickSegment(State.N * 3, PxPerCm, 62); + Segment = seg; + total = seg.DivPx * seg.DivCount; + } + var sx = x + Math.Max(0, (barW - total) / 2); + var sy = y; + var segH = 13.0; + + for (var i = 0; i < seg.DivCount; i++) + { + var r = new Rect(sx + i * seg.DivPx, sy, seg.DivPx, segH); + dc.FillRectangle(new SolidColorBrush(i % 2 == 0 ? CInk : CSurface), r); + dc.DrawRectangle(null, new Pen(new SolidColorBrush(CInk), 1), r); + Text(dc, i == 0 ? "0" : ScaleMath.SegmentLabel(seg.MetersPerDiv * i), + sx + (i + 1) * seg.DivPx, sy + segH + 3, 9.5, CInkDim, align: TextAlignment.Center); + } + Text(dc, ScaleMath.SegmentLabel(seg.MetersPerDiv), sx + total / 2, sy + segH + 17, 10, + CInkDim, FontWeight.SemiBold, TextAlignment.Center); + + return sy + segH + 32; + } + + private double DrawSpectrum(DrawingContext dc, double x, double y, double barW) + { + Text(dc, T("ruler.spectrum"), x, y, 11.5, CInkDim, FontWeight.SemiBold); + y += 20; + + var trackY = y + 6; + var trackH = 8.0; + var grad = new LinearGradientBrush + { + StartPoint = new RelativePoint(0, 0, RelativeUnit.Relative), + EndPoint = new RelativePoint(1, 0, RelativeUnit.Relative), + GradientStops = new GradientStops + { + new(CAccent, 0), new(Color.Parse("#5B8DEF"), 0.4), + new(Color.Parse("#8FB4F5"), 0.7), new(Color.Parse("#C9DAF8"), 1) + } + }; + RoundRect(dc, new Rect(x, trackY, barW, trackH), 4, grad); + + // 光谱层级刻度 + foreach (var item in Data.Spectrum) + { + var p = ScaleMath.SpectrumPosition(item.N); + var px = x + barW * p; + dc.DrawLine(new Pen(new SolidColorBrush(CSurface), 1.5), + new Point(px, trackY), new Point(px, trackY + trackH)); + Text(dc, T(item.LabelKey), px, trackY + trackH + 3, 9.5, CInkFaint, + align: TextAlignment.Center); + } + + // 当前值指针 + var pos = ScaleMath.SpectrumPosition(State.N); + var cx = x + barW * pos; + dc.DrawLine(new Pen(new SolidColorBrush(CInk), 2), + new Point(cx, trackY - 7), new Point(cx, trackY + trackH + 5)); + Dot(dc, cx, trackY - 9, 5, new SolidColorBrush(CAccent)); + Dot(dc, cx, trackY - 9, 2.5, new SolidColorBrush(CSurface)); + + // 两端说明 + Text(dc, T("ruler.scopeUp"), x, trackY + trackH + 20, 10, CInkFaint); + Text(dc, T("ruler.detailDown"), x + barW, trackY + trackH + 20, 10, CInkFaint, + align: TextAlignment.Right); + + return trackY + trackH + 36; + } + + private void DrawFooter(DrawingContext dc, double x, double y, double barW) + { + if (MapOverflow || RealOverflow) + { + var msg = T(MapOverflow ? "ruler.overflowMap" : "ruler.overflowReal"); + var r = new Rect(x, y, barW, 30); + RoundRect(dc, r, 8, new SolidColorBrush(Color.Parse("#FDECEC")), + new Pen(new SolidColorBrush(Color.Parse("#F5C2C2")), 1)); + Text(dc, "⚠ " + msg, x + 12, y + 7, 11, CDanger, FontWeight.SemiBold); + } + else + { + Text(dc, T("ruler.hint"), x, y + 4, 10.5, CInkFaint); + } + } +} diff --git a/model/version.json b/model/version.json index 83b663f..f1291bb 100644 --- a/model/version.json +++ b/model/version.json @@ -1,12 +1,12 @@ { "schema": 1, - "generated": "2026-11-08T10:20:04Z", + "generated": "2026-11-08T12:19:03Z", "repository": "https://gitcode.com/2509_92447106/GC", "branch": "main", "modelDir": "model", "launcher": { "version": "1.0.4", - "revision": "467f9b4402", + "revision": "e8d68d13ed", "packages": { "win-x64": { "path": "dist/GC-win-x64.zip", @@ -33,21 +33,27 @@ "models": [ { "id": "earth-geography", - "version": "1.1", - "build": "82846c81ab", + "version": "1.2", + "build": "5e12cd2ee1", "dir": "model/earth-geography" }, { "id": "earth-revolution", "version": "1.1", - "build": "a9110f4ecf", + "build": "92a820f30c", "dir": "model/earth-revolution" }, { "id": "earth-rotation", "version": "1.1", - "build": "b6d88b8214", + "build": "e9e9851c56", "dir": "model/earth-rotation" + }, + { + "id": "scale-calculator", + "version": "1.0", + "build": "4cb6aafff8", + "dir": "model/scale-calculator" } ] } diff --git a/src/main/dotnet/EarthModelStudio/bin/Release/net8.0/osx-arm64/EarthModelStudio.ModelSdk.dll b/src/main/dotnet/EarthModelStudio/bin/Release/net8.0/osx-arm64/EarthModelStudio.ModelSdk.dll index 8e46e48..6f098ca 100644 Binary files a/src/main/dotnet/EarthModelStudio/bin/Release/net8.0/osx-arm64/EarthModelStudio.ModelSdk.dll and b/src/main/dotnet/EarthModelStudio/bin/Release/net8.0/osx-arm64/EarthModelStudio.ModelSdk.dll differ diff --git a/src/main/dotnet/EarthModelStudio/bin/Release/net8.0/osx-arm64/EarthModelStudio.dll b/src/main/dotnet/EarthModelStudio/bin/Release/net8.0/osx-arm64/EarthModelStudio.dll index 8c71af1..af010f6 100644 Binary files a/src/main/dotnet/EarthModelStudio/bin/Release/net8.0/osx-arm64/EarthModelStudio.dll and b/src/main/dotnet/EarthModelStudio/bin/Release/net8.0/osx-arm64/EarthModelStudio.dll differ diff --git a/src/main/dotnet/EarthModelStudio/bin/Release/net8.0/win-arm64/EarthModelStudio.ModelSdk.dll b/src/main/dotnet/EarthModelStudio/bin/Release/net8.0/win-arm64/EarthModelStudio.ModelSdk.dll index 8e46e48..6f098ca 100644 Binary files a/src/main/dotnet/EarthModelStudio/bin/Release/net8.0/win-arm64/EarthModelStudio.ModelSdk.dll and b/src/main/dotnet/EarthModelStudio/bin/Release/net8.0/win-arm64/EarthModelStudio.ModelSdk.dll differ diff --git a/src/main/dotnet/EarthModelStudio/bin/Release/net8.0/win-arm64/EarthModelStudio.dll b/src/main/dotnet/EarthModelStudio/bin/Release/net8.0/win-arm64/EarthModelStudio.dll index 8c71af1..af010f6 100644 Binary files a/src/main/dotnet/EarthModelStudio/bin/Release/net8.0/win-arm64/EarthModelStudio.dll and b/src/main/dotnet/EarthModelStudio/bin/Release/net8.0/win-arm64/EarthModelStudio.dll differ diff --git a/src/main/dotnet/EarthModelStudio/bin/Release/net8.0/win-arm64/EarthModelStudio.exe b/src/main/dotnet/EarthModelStudio/bin/Release/net8.0/win-arm64/EarthModelStudio.exe index 6a165da..bd9ec98 100755 Binary files a/src/main/dotnet/EarthModelStudio/bin/Release/net8.0/win-arm64/EarthModelStudio.exe and b/src/main/dotnet/EarthModelStudio/bin/Release/net8.0/win-arm64/EarthModelStudio.exe differ diff --git a/src/main/dotnet/EarthModelStudio/bin/Release/net8.0/win-x64/EarthModelStudio.ModelSdk.dll b/src/main/dotnet/EarthModelStudio/bin/Release/net8.0/win-x64/EarthModelStudio.ModelSdk.dll index 8e46e48..6f098ca 100644 Binary files a/src/main/dotnet/EarthModelStudio/bin/Release/net8.0/win-x64/EarthModelStudio.ModelSdk.dll and b/src/main/dotnet/EarthModelStudio/bin/Release/net8.0/win-x64/EarthModelStudio.ModelSdk.dll differ diff --git a/src/main/dotnet/EarthModelStudio/bin/Release/net8.0/win-x64/EarthModelStudio.dll b/src/main/dotnet/EarthModelStudio/bin/Release/net8.0/win-x64/EarthModelStudio.dll index 460e693..4682031 100644 Binary files a/src/main/dotnet/EarthModelStudio/bin/Release/net8.0/win-x64/EarthModelStudio.dll and b/src/main/dotnet/EarthModelStudio/bin/Release/net8.0/win-x64/EarthModelStudio.dll differ diff --git a/src/main/dotnet/EarthModelStudio/bin/Release/net8.0/win-x64/EarthModelStudio.exe b/src/main/dotnet/EarthModelStudio/bin/Release/net8.0/win-x64/EarthModelStudio.exe index 4210d59..fff6ca8 100755 Binary files a/src/main/dotnet/EarthModelStudio/bin/Release/net8.0/win-x64/EarthModelStudio.exe and b/src/main/dotnet/EarthModelStudio/bin/Release/net8.0/win-x64/EarthModelStudio.exe differ diff --git a/src/main/dotnet/EarthModelStudio/obj/EarthModelStudio.csproj.nuget.dgspec.json b/src/main/dotnet/EarthModelStudio/obj/EarthModelStudio.csproj.nuget.dgspec.json index c01ac11..292728e 100644 --- a/src/main/dotnet/EarthModelStudio/obj/EarthModelStudio.csproj.nuget.dgspec.json +++ b/src/main/dotnet/EarthModelStudio/obj/EarthModelStudio.csproj.nuget.dgspec.json @@ -49,6 +49,12 @@ "Avalonia": { "target": "Package", "version": "[11.3.9, )" + }, + "Microsoft.NET.ILLink.Tasks": { + "suppressParent": "All", + "target": "Package", + "version": "[8.0.31, )", + "autoReferenced": true } }, "imports": [ @@ -62,6 +68,16 @@ ], "assetTargetFallback": true, "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Runtime.win-arm64", + "version": "[8.0.31, 8.0.31]" + }, + { + "name": "Microsoft.NETCore.App.Runtime.win-arm64", + "version": "[8.0.31, 8.0.31]" + } + ], "frameworkReferences": { "Microsoft.NETCore.App": { "privateAssets": "all" @@ -69,6 +85,11 @@ }, "runtimeIdentifierGraphPath": "/usr/local/share/dotnet/sdk/10.0.401/PortableRuntimeIdentifierGraph.json" } + }, + "runtimes": { + "win-arm64": { + "#import": [] + } } }, "/Users/morris/Downloads/GC#/src/main/dotnet/EarthModelStudio/EarthModelStudio.csproj": { @@ -132,6 +153,12 @@ "CommunityToolkit.Mvvm": { "target": "Package", "version": "[8.2.2, )" + }, + "Microsoft.NET.ILLink.Tasks": { + "suppressParent": "All", + "target": "Package", + "version": "[8.0.31, )", + "autoReferenced": true } }, "imports": [ @@ -145,6 +172,20 @@ ], "assetTargetFallback": true, "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Runtime.win-arm64", + "version": "[8.0.31, 8.0.31]" + }, + { + "name": "Microsoft.NETCore.App.Host.win-arm64", + "version": "[8.0.31, 8.0.31]" + }, + { + "name": "Microsoft.NETCore.App.Runtime.win-arm64", + "version": "[8.0.31, 8.0.31]" + } + ], "frameworkReferences": { "Microsoft.NETCore.App": { "privateAssets": "all" @@ -152,6 +193,11 @@ }, "runtimeIdentifierGraphPath": "/usr/local/share/dotnet/sdk/10.0.401/PortableRuntimeIdentifierGraph.json" } + }, + "runtimes": { + "win-arm64": { + "#import": [] + } } } } diff --git a/src/main/dotnet/EarthModelStudio/obj/EarthModelStudio.csproj.nuget.g.props b/src/main/dotnet/EarthModelStudio/obj/EarthModelStudio.csproj.nuget.g.props index cb99f02..aed745f 100644 --- a/src/main/dotnet/EarthModelStudio/obj/EarthModelStudio.csproj.nuget.g.props +++ b/src/main/dotnet/EarthModelStudio/obj/EarthModelStudio.csproj.nuget.g.props @@ -14,10 +14,12 @@ + + /Users/morris/.nuget/packages/microsoft.net.illink.tasks/8.0.31 /Users/morris/.nuget/packages/avalonia.buildservices/11.3.2 /Users/morris/.nuget/packages/avalonia/11.3.9 diff --git a/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/osx-arm64/Avalonia/Resources.Inputs.cache b/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/osx-arm64/Avalonia/Resources.Inputs.cache index 09c1689..dcbc0c4 100644 --- a/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/osx-arm64/Avalonia/Resources.Inputs.cache +++ b/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/osx-arm64/Avalonia/Resources.Inputs.cache @@ -1 +1 @@ -0aef3705cc5861ae47f166e26ea2e3b27fd85cb1df12754a1e85eb4400e855e9 +b5b025787ddcf020e4af544e7291049bae132a2a48645e60ce75f9c17a36c04e diff --git a/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/osx-arm64/EarthModelStudio.AssemblyInfo.cs b/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/osx-arm64/EarthModelStudio.AssemblyInfo.cs index 5eee16e..87469a8 100644 --- a/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/osx-arm64/EarthModelStudio.AssemblyInfo.cs +++ b/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/osx-arm64/EarthModelStudio.AssemblyInfo.cs @@ -13,7 +13,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("NeoRF")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Release")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.4.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.4+f69a8fbb7fa563800802d3c2e319ed56365c3b8c")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.4+936aec81850fb15f55014c66116d174dc9e2f967")] [assembly: System.Reflection.AssemblyProductAttribute("Earth Model Studio")] [assembly: System.Reflection.AssemblyTitleAttribute("EarthModelStudio")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.4.0")] diff --git a/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/osx-arm64/EarthModelStudio.AssemblyInfoInputs.cache b/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/osx-arm64/EarthModelStudio.AssemblyInfoInputs.cache index b849ae9..9602e7d 100644 --- a/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/osx-arm64/EarthModelStudio.AssemblyInfoInputs.cache +++ b/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/osx-arm64/EarthModelStudio.AssemblyInfoInputs.cache @@ -1 +1 @@ -f5f6f7aaca707ee47caaff226938ba40218288fdd12005017dae3507e893fbe2 +205198c382e84cfd75294cd5a2c03ad33c681429a1f83e23c148c445c43cf0bf diff --git a/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/osx-arm64/EarthModelStudio.csproj.AssemblyReference.cache b/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/osx-arm64/EarthModelStudio.csproj.AssemblyReference.cache index 6259c41..5807425 100644 Binary files a/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/osx-arm64/EarthModelStudio.csproj.AssemblyReference.cache and b/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/osx-arm64/EarthModelStudio.csproj.AssemblyReference.cache differ diff --git a/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/osx-arm64/EarthModelStudio.dll b/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/osx-arm64/EarthModelStudio.dll index 8c71af1..af010f6 100644 Binary files a/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/osx-arm64/EarthModelStudio.dll and b/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/osx-arm64/EarthModelStudio.dll differ diff --git a/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/osx-arm64/ref/EarthModelStudio.dll b/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/osx-arm64/ref/EarthModelStudio.dll index 752215b..9b1143f 100644 Binary files a/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/osx-arm64/ref/EarthModelStudio.dll and b/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/osx-arm64/ref/EarthModelStudio.dll differ diff --git a/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/osx-arm64/refint/EarthModelStudio.dll b/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/osx-arm64/refint/EarthModelStudio.dll index 752215b..9b1143f 100644 Binary files a/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/osx-arm64/refint/EarthModelStudio.dll and b/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/osx-arm64/refint/EarthModelStudio.dll differ diff --git a/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/win-arm64/EarthModelStudio.AssemblyInfo.cs b/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/win-arm64/EarthModelStudio.AssemblyInfo.cs index 5eee16e..87469a8 100644 --- a/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/win-arm64/EarthModelStudio.AssemblyInfo.cs +++ b/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/win-arm64/EarthModelStudio.AssemblyInfo.cs @@ -13,7 +13,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("NeoRF")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Release")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.4.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.4+f69a8fbb7fa563800802d3c2e319ed56365c3b8c")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.4+936aec81850fb15f55014c66116d174dc9e2f967")] [assembly: System.Reflection.AssemblyProductAttribute("Earth Model Studio")] [assembly: System.Reflection.AssemblyTitleAttribute("EarthModelStudio")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.4.0")] diff --git a/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/win-arm64/EarthModelStudio.AssemblyInfoInputs.cache b/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/win-arm64/EarthModelStudio.AssemblyInfoInputs.cache index b849ae9..9602e7d 100644 --- a/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/win-arm64/EarthModelStudio.AssemblyInfoInputs.cache +++ b/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/win-arm64/EarthModelStudio.AssemblyInfoInputs.cache @@ -1 +1 @@ -f5f6f7aaca707ee47caaff226938ba40218288fdd12005017dae3507e893fbe2 +205198c382e84cfd75294cd5a2c03ad33c681429a1f83e23c148c445c43cf0bf diff --git a/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/win-arm64/EarthModelStudio.csproj.AssemblyReference.cache b/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/win-arm64/EarthModelStudio.csproj.AssemblyReference.cache index dd75242..f39ab3f 100644 Binary files a/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/win-arm64/EarthModelStudio.csproj.AssemblyReference.cache and b/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/win-arm64/EarthModelStudio.csproj.AssemblyReference.cache differ diff --git a/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/win-arm64/EarthModelStudio.dll b/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/win-arm64/EarthModelStudio.dll index 8c71af1..af010f6 100644 Binary files a/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/win-arm64/EarthModelStudio.dll and b/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/win-arm64/EarthModelStudio.dll differ diff --git a/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/win-arm64/apphost.exe b/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/win-arm64/apphost.exe index 6a165da..bd9ec98 100755 Binary files a/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/win-arm64/apphost.exe and b/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/win-arm64/apphost.exe differ diff --git a/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/win-arm64/ref/EarthModelStudio.dll b/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/win-arm64/ref/EarthModelStudio.dll index 752215b..9b1143f 100644 Binary files a/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/win-arm64/ref/EarthModelStudio.dll and b/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/win-arm64/ref/EarthModelStudio.dll differ diff --git a/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/win-arm64/refint/EarthModelStudio.dll b/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/win-arm64/refint/EarthModelStudio.dll index 752215b..9b1143f 100644 Binary files a/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/win-arm64/refint/EarthModelStudio.dll and b/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/win-arm64/refint/EarthModelStudio.dll differ diff --git a/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/win-arm64/singlefilehost.exe b/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/win-arm64/singlefilehost.exe index bb43a54..7087f50 100755 Binary files a/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/win-arm64/singlefilehost.exe and b/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/win-arm64/singlefilehost.exe differ diff --git a/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/win-x64/EarthModelStudio.AssemblyInfo.cs b/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/win-x64/EarthModelStudio.AssemblyInfo.cs index 5eee16e..87469a8 100644 --- a/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/win-x64/EarthModelStudio.AssemblyInfo.cs +++ b/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/win-x64/EarthModelStudio.AssemblyInfo.cs @@ -13,7 +13,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("NeoRF")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Release")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.4.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.4+f69a8fbb7fa563800802d3c2e319ed56365c3b8c")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.4+936aec81850fb15f55014c66116d174dc9e2f967")] [assembly: System.Reflection.AssemblyProductAttribute("Earth Model Studio")] [assembly: System.Reflection.AssemblyTitleAttribute("EarthModelStudio")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.4.0")] diff --git a/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/win-x64/EarthModelStudio.AssemblyInfoInputs.cache b/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/win-x64/EarthModelStudio.AssemblyInfoInputs.cache index b849ae9..9602e7d 100644 --- a/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/win-x64/EarthModelStudio.AssemblyInfoInputs.cache +++ b/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/win-x64/EarthModelStudio.AssemblyInfoInputs.cache @@ -1 +1 @@ -f5f6f7aaca707ee47caaff226938ba40218288fdd12005017dae3507e893fbe2 +205198c382e84cfd75294cd5a2c03ad33c681429a1f83e23c148c445c43cf0bf diff --git a/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/win-x64/EarthModelStudio.csproj.AssemblyReference.cache b/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/win-x64/EarthModelStudio.csproj.AssemblyReference.cache index dd75242..f39ab3f 100644 Binary files a/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/win-x64/EarthModelStudio.csproj.AssemblyReference.cache and b/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/win-x64/EarthModelStudio.csproj.AssemblyReference.cache differ diff --git a/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/win-x64/EarthModelStudio.dll b/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/win-x64/EarthModelStudio.dll index 460e693..4682031 100644 Binary files a/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/win-x64/EarthModelStudio.dll and b/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/win-x64/EarthModelStudio.dll differ diff --git a/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/win-x64/apphost.exe b/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/win-x64/apphost.exe index 4210d59..fff6ca8 100755 Binary files a/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/win-x64/apphost.exe and b/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/win-x64/apphost.exe differ diff --git a/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/win-x64/ref/EarthModelStudio.dll b/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/win-x64/ref/EarthModelStudio.dll index 4dfc12a..e1b6723 100644 Binary files a/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/win-x64/ref/EarthModelStudio.dll and b/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/win-x64/ref/EarthModelStudio.dll differ diff --git a/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/win-x64/refint/EarthModelStudio.dll b/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/win-x64/refint/EarthModelStudio.dll index 4dfc12a..e1b6723 100644 Binary files a/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/win-x64/refint/EarthModelStudio.dll and b/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/win-x64/refint/EarthModelStudio.dll differ diff --git a/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/win-x64/singlefilehost.exe b/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/win-x64/singlefilehost.exe index f79b073..0f765f6 100755 Binary files a/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/win-x64/singlefilehost.exe and b/src/main/dotnet/EarthModelStudio/obj/Release/net8.0/win-x64/singlefilehost.exe differ diff --git a/src/main/dotnet/EarthModelStudio/obj/project.assets.json b/src/main/dotnet/EarthModelStudio/obj/project.assets.json index f58ec85..b4fd148 100644 --- a/src/main/dotnet/EarthModelStudio/obj/project.assets.json +++ b/src/main/dotnet/EarthModelStudio/obj/project.assets.json @@ -406,6 +406,12 @@ "lib/net5.0/MicroCom.Runtime.dll": {} } }, + "Microsoft.NET.ILLink.Tasks/8.0.31": { + "type": "package", + "build": { + "build/Microsoft.NET.ILLink.Tasks.props": {} + } + }, "SkiaSharp/2.88.9": { "type": "package", "dependencies": { @@ -545,6 +551,442 @@ "bin/placeholder/EarthModelStudio.ModelSdk.dll": {} } } + }, + "net8.0/win-arm64": { + "Avalonia/11.3.9": { + "type": "package", + "dependencies": { + "Avalonia.BuildServices": "11.3.2", + "Avalonia.Remote.Protocol": "11.3.9", + "MicroCom.Runtime": "0.11.0" + }, + "compile": { + "ref/net8.0/Avalonia.Base.dll": { + "related": ".xml" + }, + "ref/net8.0/Avalonia.Controls.dll": { + "related": ".xml" + }, + "ref/net8.0/Avalonia.DesignerSupport.dll": { + "related": ".xml" + }, + "ref/net8.0/Avalonia.Dialogs.dll": { + "related": ".xml" + }, + "ref/net8.0/Avalonia.Markup.Xaml.dll": { + "related": ".xml" + }, + "ref/net8.0/Avalonia.Markup.dll": { + "related": ".Xaml.xml;.xml" + }, + "ref/net8.0/Avalonia.Metal.dll": { + "related": ".xml" + }, + "ref/net8.0/Avalonia.MicroCom.dll": { + "related": ".xml" + }, + "ref/net8.0/Avalonia.OpenGL.dll": { + "related": ".xml" + }, + "ref/net8.0/Avalonia.Vulkan.dll": { + "related": ".xml" + }, + "ref/net8.0/Avalonia.dll": { + "related": ".Base.xml;.Controls.xml;.DesignerSupport.xml;.Dialogs.xml;.Markup.Xaml.xml;.Markup.xml;.Metal.xml;.MicroCom.xml;.OpenGL.xml;.Vulkan.xml;.xml" + } + }, + "runtime": { + "lib/net8.0/Avalonia.Base.dll": { + "related": ".xml" + }, + "lib/net8.0/Avalonia.Controls.dll": { + "related": ".xml" + }, + "lib/net8.0/Avalonia.DesignerSupport.dll": { + "related": ".xml" + }, + "lib/net8.0/Avalonia.Dialogs.dll": { + "related": ".xml" + }, + "lib/net8.0/Avalonia.Markup.Xaml.dll": { + "related": ".xml" + }, + "lib/net8.0/Avalonia.Markup.dll": { + "related": ".Xaml.xml;.xml" + }, + "lib/net8.0/Avalonia.Metal.dll": { + "related": ".xml" + }, + "lib/net8.0/Avalonia.MicroCom.dll": { + "related": ".xml" + }, + "lib/net8.0/Avalonia.OpenGL.dll": { + "related": ".xml" + }, + "lib/net8.0/Avalonia.Vulkan.dll": { + "related": ".xml" + }, + "lib/net8.0/Avalonia.dll": { + "related": ".Base.xml;.Controls.xml;.DesignerSupport.xml;.Dialogs.xml;.Markup.Xaml.xml;.Markup.xml;.Metal.xml;.MicroCom.xml;.OpenGL.xml;.Vulkan.xml;.xml" + } + }, + "build": { + "buildTransitive/Avalonia.props": {}, + "buildTransitive/Avalonia.targets": {} + } + }, + "Avalonia.Angle.Windows.Natives/2.1.25547.20250602": { + "type": "package", + "native": { + "runtimes/win-arm64/native/av_libglesv2.dll": {} + } + }, + "Avalonia.BuildServices/11.3.2": { + "type": "package", + "build": { + "buildTransitive/Avalonia.BuildServices.targets": {} + } + }, + "Avalonia.Desktop/11.3.9": { + "type": "package", + "dependencies": { + "Avalonia": "11.3.9", + "Avalonia.Native": "11.3.9", + "Avalonia.Skia": "11.3.9", + "Avalonia.Win32": "11.3.9", + "Avalonia.X11": "11.3.9" + }, + "compile": { + "lib/net8.0/Avalonia.Desktop.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net8.0/Avalonia.Desktop.dll": { + "related": ".xml" + } + } + }, + "Avalonia.FreeDesktop/11.3.9": { + "type": "package", + "dependencies": { + "Avalonia": "11.3.9", + "Tmds.DBus.Protocol": "0.21.2" + }, + "compile": { + "lib/net8.0/Avalonia.FreeDesktop.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net8.0/Avalonia.FreeDesktop.dll": { + "related": ".xml" + } + } + }, + "Avalonia.Native/11.3.9": { + "type": "package", + "dependencies": { + "Avalonia": "11.3.9" + }, + "compile": { + "lib/net8.0/Avalonia.Native.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net8.0/Avalonia.Native.dll": { + "related": ".xml" + } + } + }, + "Avalonia.Remote.Protocol/11.3.9": { + "type": "package", + "compile": { + "lib/net8.0/Avalonia.Remote.Protocol.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net8.0/Avalonia.Remote.Protocol.dll": { + "related": ".xml" + } + } + }, + "Avalonia.Skia/11.3.9": { + "type": "package", + "dependencies": { + "Avalonia": "11.3.9", + "HarfBuzzSharp": "8.3.1.1", + "HarfBuzzSharp.NativeAssets.Linux": "8.3.1.1", + "HarfBuzzSharp.NativeAssets.WebAssembly": "8.3.1.1", + "SkiaSharp": "2.88.9", + "SkiaSharp.NativeAssets.Linux": "2.88.9", + "SkiaSharp.NativeAssets.WebAssembly": "2.88.9" + }, + "compile": { + "lib/net8.0/Avalonia.Skia.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net8.0/Avalonia.Skia.dll": { + "related": ".xml" + } + } + }, + "Avalonia.Themes.Fluent/11.3.9": { + "type": "package", + "dependencies": { + "Avalonia": "11.3.9" + }, + "compile": { + "lib/net8.0/Avalonia.Themes.Fluent.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net8.0/Avalonia.Themes.Fluent.dll": { + "related": ".xml" + } + } + }, + "Avalonia.Win32/11.3.9": { + "type": "package", + "dependencies": { + "Avalonia": "11.3.9", + "Avalonia.Angle.Windows.Natives": "2.1.25547.20250602" + }, + "compile": { + "lib/net8.0/Avalonia.Win32.Automation.dll": { + "related": ".xml" + }, + "lib/net8.0/Avalonia.Win32.dll": { + "related": ".Automation.xml;.xml" + } + }, + "runtime": { + "lib/net8.0/Avalonia.Win32.Automation.dll": { + "related": ".xml" + }, + "lib/net8.0/Avalonia.Win32.dll": { + "related": ".Automation.xml;.xml" + } + } + }, + "Avalonia.X11/11.3.9": { + "type": "package", + "dependencies": { + "Avalonia": "11.3.9", + "Avalonia.FreeDesktop": "11.3.9", + "Avalonia.Skia": "11.3.9" + }, + "compile": { + "lib/net8.0/Avalonia.X11.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net8.0/Avalonia.X11.dll": { + "related": ".xml" + } + } + }, + "CommunityToolkit.Mvvm/8.2.2": { + "type": "package", + "compile": { + "lib/net6.0/CommunityToolkit.Mvvm.dll": { + "related": ".pdb;.xml" + } + }, + "runtime": { + "lib/net6.0/CommunityToolkit.Mvvm.dll": { + "related": ".pdb;.xml" + } + }, + "build": { + "buildTransitive/netstandard2.1/CommunityToolkit.Mvvm.targets": {} + } + }, + "HarfBuzzSharp/8.3.1.1": { + "type": "package", + "dependencies": { + "HarfBuzzSharp.NativeAssets.Win32": "8.3.1.1", + "HarfBuzzSharp.NativeAssets.macOS": "8.3.1.1" + }, + "compile": { + "lib/net8.0/HarfBuzzSharp.dll": { + "related": ".pdb" + } + }, + "runtime": { + "lib/net8.0/HarfBuzzSharp.dll": { + "related": ".pdb" + } + } + }, + "HarfBuzzSharp.NativeAssets.Linux/8.3.1.1": { + "type": "package", + "compile": { + "lib/net8.0/_._": {} + }, + "runtime": { + "lib/net8.0/_._": {} + } + }, + "HarfBuzzSharp.NativeAssets.macOS/8.3.1.1": { + "type": "package", + "compile": { + "lib/net8.0/_._": {} + }, + "runtime": { + "lib/net8.0/_._": {} + } + }, + "HarfBuzzSharp.NativeAssets.WebAssembly/8.3.1.1": { + "type": "package", + "compile": { + "lib/net8.0/_._": {} + }, + "runtime": { + "lib/net8.0/_._": {} + }, + "build": { + "buildTransitive/netstandard1.0/HarfBuzzSharp.NativeAssets.WebAssembly.props": {}, + "buildTransitive/netstandard1.0/HarfBuzzSharp.NativeAssets.WebAssembly.targets": {} + } + }, + "HarfBuzzSharp.NativeAssets.Win32/8.3.1.1": { + "type": "package", + "compile": { + "lib/net8.0/_._": {} + }, + "runtime": { + "lib/net8.0/_._": {} + }, + "native": { + "runtimes/win-arm64/native/libHarfBuzzSharp.dll": {} + } + }, + "MicroCom.Runtime/0.11.0": { + "type": "package", + "compile": { + "lib/net5.0/MicroCom.Runtime.dll": {} + }, + "runtime": { + "lib/net5.0/MicroCom.Runtime.dll": {} + } + }, + "Microsoft.NET.ILLink.Tasks/8.0.31": { + "type": "package", + "build": { + "build/Microsoft.NET.ILLink.Tasks.props": {} + } + }, + "SkiaSharp/2.88.9": { + "type": "package", + "dependencies": { + "SkiaSharp.NativeAssets.Win32": "2.88.9", + "SkiaSharp.NativeAssets.macOS": "2.88.9" + }, + "compile": { + "lib/net6.0/SkiaSharp.dll": { + "related": ".pdb;.xml" + } + }, + "runtime": { + "lib/net6.0/SkiaSharp.dll": { + "related": ".pdb;.xml" + } + } + }, + "SkiaSharp.NativeAssets.Linux/2.88.9": { + "type": "package", + "dependencies": { + "SkiaSharp": "2.88.9" + }, + "compile": { + "lib/net6.0/_._": {} + }, + "runtime": { + "lib/net6.0/_._": {} + } + }, + "SkiaSharp.NativeAssets.macOS/2.88.9": { + "type": "package", + "compile": { + "lib/net6.0/_._": {} + }, + "runtime": { + "lib/net6.0/_._": {} + } + }, + "SkiaSharp.NativeAssets.WebAssembly/2.88.9": { + "type": "package", + "compile": { + "lib/netstandard1.0/_._": {} + }, + "runtime": { + "lib/netstandard1.0/_._": {} + }, + "build": { + "buildTransitive/netstandard1.0/SkiaSharp.NativeAssets.WebAssembly.props": {}, + "buildTransitive/netstandard1.0/SkiaSharp.NativeAssets.WebAssembly.targets": {} + } + }, + "SkiaSharp.NativeAssets.Win32/2.88.9": { + "type": "package", + "compile": { + "lib/net6.0/_._": {} + }, + "runtime": { + "lib/net6.0/_._": {} + }, + "native": { + "runtimes/win-arm64/native/libSkiaSharp.dll": {} + } + }, + "System.IO.Pipelines/8.0.0": { + "type": "package", + "compile": { + "lib/net8.0/System.IO.Pipelines.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net8.0/System.IO.Pipelines.dll": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net6.0/_._": {} + } + }, + "Tmds.DBus.Protocol/0.21.2": { + "type": "package", + "dependencies": { + "System.IO.Pipelines": "8.0.0" + }, + "compile": { + "lib/net8.0/Tmds.DBus.Protocol.dll": {} + }, + "runtime": { + "lib/net8.0/Tmds.DBus.Protocol.dll": {} + } + }, + "EarthModelStudio.ModelSdk/1.0.4": { + "type": "project", + "framework": ".NETCoreApp,Version=v8.0", + "dependencies": { + "Avalonia": "11.3.9" + }, + "compile": { + "bin/placeholder/EarthModelStudio.ModelSdk.dll": {} + }, + "runtime": { + "bin/placeholder/EarthModelStudio.ModelSdk.dll": {} + } + } } }, "libraries": { @@ -1105,6 +1547,57 @@ "microcom.runtime.nuspec" ] }, + "Microsoft.NET.ILLink.Tasks/8.0.31": { + "sha512": "OJdAGATV2QoVWL11zlDLEluA06q8rK+cgZR47ohrO8V+Qj5z9dlvN7bG9/0e5t0IOe+yD8tREC0bpsEgDGrzIQ==", + "type": "package", + "path": "microsoft.net.illink.tasks/8.0.31", + "hasTools": true, + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "Sdk/Sdk.props", + "THIRD-PARTY-NOTICES.TXT", + "analyzers/dotnet/cs/ILLink.CodeFixProvider.dll", + "analyzers/dotnet/cs/ILLink.RoslynAnalyzer.dll", + "build/Microsoft.NET.ILLink.Analyzers.props", + "build/Microsoft.NET.ILLink.Tasks.props", + "build/Microsoft.NET.ILLink.targets", + "microsoft.net.illink.tasks.8.0.31.nupkg.sha512", + "microsoft.net.illink.tasks.nuspec", + "tools/net472/ILLink.Tasks.dll", + "tools/net472/ILLink.Tasks.dll.config", + "tools/net472/Mono.Cecil.Mdb.dll", + "tools/net472/Mono.Cecil.Pdb.dll", + "tools/net472/Mono.Cecil.Rocks.dll", + "tools/net472/Mono.Cecil.dll", + "tools/net472/Sdk/Sdk.props", + "tools/net472/System.Buffers.dll", + "tools/net472/System.Collections.Immutable.dll", + "tools/net472/System.Memory.dll", + "tools/net472/System.Numerics.Vectors.dll", + "tools/net472/System.Reflection.Metadata.dll", + "tools/net472/System.Runtime.CompilerServices.Unsafe.dll", + "tools/net472/build/Microsoft.NET.ILLink.Analyzers.props", + "tools/net472/build/Microsoft.NET.ILLink.Tasks.props", + "tools/net472/build/Microsoft.NET.ILLink.targets", + "tools/net8.0/ILLink.Tasks.deps.json", + "tools/net8.0/ILLink.Tasks.dll", + "tools/net8.0/Mono.Cecil.Mdb.dll", + "tools/net8.0/Mono.Cecil.Pdb.dll", + "tools/net8.0/Mono.Cecil.Rocks.dll", + "tools/net8.0/Mono.Cecil.dll", + "tools/net8.0/Sdk/Sdk.props", + "tools/net8.0/build/Microsoft.NET.ILLink.Analyzers.props", + "tools/net8.0/build/Microsoft.NET.ILLink.Tasks.props", + "tools/net8.0/build/Microsoft.NET.ILLink.targets", + "tools/net8.0/illink.deps.json", + "tools/net8.0/illink.dll", + "tools/net8.0/illink.runtimeconfig.json", + "useSharedDesignerContext.txt" + ] + }, "SkiaSharp/2.88.9": { "sha512": "3MD5VHjXXieSHCleRLuaTXmL2pD0mB7CcOB1x2kA1I4bhptf4e3R27iM93264ZYuAq6mkUyX5XbcxnZvMJYc1Q==", "type": "package", @@ -1339,7 +1832,8 @@ "Avalonia.Desktop >= 11.3.9", "Avalonia.Themes.Fluent >= 11.3.9", "CommunityToolkit.Mvvm >= 8.2.2", - "EarthModelStudio.ModelSdk >= 1.0.4" + "EarthModelStudio.ModelSdk >= 1.0.4", + "Microsoft.NET.ILLink.Tasks >= 8.0.31" ] }, "packageFolders": { @@ -1406,6 +1900,12 @@ "CommunityToolkit.Mvvm": { "target": "Package", "version": "[8.2.2, )" + }, + "Microsoft.NET.ILLink.Tasks": { + "suppressParent": "All", + "target": "Package", + "version": "[8.0.31, )", + "autoReferenced": true } }, "imports": [ @@ -1419,6 +1919,20 @@ ], "assetTargetFallback": true, "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Runtime.win-arm64", + "version": "[8.0.31, 8.0.31]" + }, + { + "name": "Microsoft.NETCore.App.Host.win-arm64", + "version": "[8.0.31, 8.0.31]" + }, + { + "name": "Microsoft.NETCore.App.Runtime.win-arm64", + "version": "[8.0.31, 8.0.31]" + } + ], "frameworkReferences": { "Microsoft.NETCore.App": { "privateAssets": "all" @@ -1426,6 +1940,11 @@ }, "runtimeIdentifierGraphPath": "/usr/local/share/dotnet/sdk/10.0.401/PortableRuntimeIdentifierGraph.json" } + }, + "runtimes": { + "win-arm64": { + "#import": [] + } } } } \ No newline at end of file diff --git a/src/main/dotnet/EarthModelStudio/obj/project.nuget.cache b/src/main/dotnet/EarthModelStudio/obj/project.nuget.cache index c68f270..bb70d4b 100644 --- a/src/main/dotnet/EarthModelStudio/obj/project.nuget.cache +++ b/src/main/dotnet/EarthModelStudio/obj/project.nuget.cache @@ -1,6 +1,6 @@ { "version": 2, - "dgSpecHash": "sgJrxHi8SXg=", + "dgSpecHash": "DW3Kb36/Row=", "success": true, "projectFilePath": "/Users/morris/Downloads/GC#/src/main/dotnet/EarthModelStudio/EarthModelStudio.csproj", "expectedPackageFiles": [ @@ -22,13 +22,17 @@ "/Users/morris/.nuget/packages/harfbuzzsharp.nativeassets.webassembly/8.3.1.1/harfbuzzsharp.nativeassets.webassembly.8.3.1.1.nupkg.sha512", "/Users/morris/.nuget/packages/harfbuzzsharp.nativeassets.win32/8.3.1.1/harfbuzzsharp.nativeassets.win32.8.3.1.1.nupkg.sha512", "/Users/morris/.nuget/packages/microcom.runtime/0.11.0/microcom.runtime.0.11.0.nupkg.sha512", + "/Users/morris/.nuget/packages/microsoft.net.illink.tasks/8.0.31/microsoft.net.illink.tasks.8.0.31.nupkg.sha512", "/Users/morris/.nuget/packages/skiasharp/2.88.9/skiasharp.2.88.9.nupkg.sha512", "/Users/morris/.nuget/packages/skiasharp.nativeassets.linux/2.88.9/skiasharp.nativeassets.linux.2.88.9.nupkg.sha512", "/Users/morris/.nuget/packages/skiasharp.nativeassets.macos/2.88.9/skiasharp.nativeassets.macos.2.88.9.nupkg.sha512", "/Users/morris/.nuget/packages/skiasharp.nativeassets.webassembly/2.88.9/skiasharp.nativeassets.webassembly.2.88.9.nupkg.sha512", "/Users/morris/.nuget/packages/skiasharp.nativeassets.win32/2.88.9/skiasharp.nativeassets.win32.2.88.9.nupkg.sha512", "/Users/morris/.nuget/packages/system.io.pipelines/8.0.0/system.io.pipelines.8.0.0.nupkg.sha512", - "/Users/morris/.nuget/packages/tmds.dbus.protocol/0.21.2/tmds.dbus.protocol.0.21.2.nupkg.sha512" + "/Users/morris/.nuget/packages/tmds.dbus.protocol/0.21.2/tmds.dbus.protocol.0.21.2.nupkg.sha512", + "/Users/morris/.nuget/packages/microsoft.netcore.app.runtime.win-arm64/8.0.31/microsoft.netcore.app.runtime.win-arm64.8.0.31.nupkg.sha512", + "/Users/morris/.nuget/packages/microsoft.aspnetcore.app.runtime.win-arm64/8.0.31/microsoft.aspnetcore.app.runtime.win-arm64.8.0.31.nupkg.sha512", + "/Users/morris/.nuget/packages/microsoft.netcore.app.host.win-arm64/8.0.31/microsoft.netcore.app.host.win-arm64.8.0.31.nupkg.sha512" ], "logs": [] } \ No newline at end of file diff --git a/version.json b/version.json index 83b663f..f1291bb 100644 --- a/version.json +++ b/version.json @@ -1,12 +1,12 @@ { "schema": 1, - "generated": "2026-11-08T10:20:04Z", + "generated": "2026-11-08T12:19:03Z", "repository": "https://gitcode.com/2509_92447106/GC", "branch": "main", "modelDir": "model", "launcher": { "version": "1.0.4", - "revision": "467f9b4402", + "revision": "e8d68d13ed", "packages": { "win-x64": { "path": "dist/GC-win-x64.zip", @@ -33,21 +33,27 @@ "models": [ { "id": "earth-geography", - "version": "1.1", - "build": "82846c81ab", + "version": "1.2", + "build": "5e12cd2ee1", "dir": "model/earth-geography" }, { "id": "earth-revolution", "version": "1.1", - "build": "a9110f4ecf", + "build": "92a820f30c", "dir": "model/earth-revolution" }, { "id": "earth-rotation", "version": "1.1", - "build": "b6d88b8214", + "build": "e9e9851c56", "dir": "model/earth-rotation" + }, + { + "id": "scale-calculator", + "version": "1.0", + "build": "4cb6aafff8", + "dir": "model/scale-calculator" } ] }