feat: 自定义站台占用图车次颜色

This commit is contained in:
denglihong2007
2026-01-01 18:59:24 +08:00
parent a25a047f14
commit 8e6f70a67d
31 changed files with 290 additions and 82 deletions

View File

@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CRSim.Core.Models
namespace CRSim.Core.Models
{
public class Json
{

View File

@@ -0,0 +1,14 @@
using CRSim.Core.Converters;
using System.Drawing;
using System.Text.Json.Serialization;
namespace CRSim.Core.Models.PlatformDiagram
{
public class TrainColor
{
public required string Prefix { get; set; }
[JsonConverter(typeof(ColorJsonConverter))]
public required Color Color { get; set; }
}
}

View File

@@ -1,5 +1,8 @@
using CRSim.Core.Abstractions;
using CRSim.Core.Converters;
using CRSim.Core.Models.PlatformDiagram;
using CRSim.Core.Services;
using System.Drawing;
using System.Text.Json.Serialization;
namespace CRSim.Core.Models
@@ -29,5 +32,18 @@ namespace CRSim.Core.Models
public string UserKey { get; set; } = "";
public bool LoadTodayOnly { get; set; } = false;
public bool ReopenUnclosedScreensOnLoad { get; set; } = true;
public List<TrainColor> TrainColors { get; set; } =
[
new TrainColor { Prefix = "G", Color = Color.Magenta },
new TrainColor { Prefix = "D", Color = Color.SteelBlue },
new TrainColor { Prefix = "C", Color = Color.Teal },
new TrainColor { Prefix = "T", Color = Color.Blue },
new TrainColor { Prefix = "Z", Color = Color.SaddleBrown },
new TrainColor { Prefix = "K", Color = Color.Red },
new TrainColor { Prefix = "Y", Color = Color.Red },
new TrainColor { Prefix = "L", Color = Color.Green },
new TrainColor { Prefix = "默认", Color = Color.Green }
];
}
}

View File

@@ -1,11 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.Json.Serialization;
using System.Threading.Tasks;
namespace CRSim.Core.Models
namespace CRSim.Core.Models
{
public class Station
{