fix: Remove SeverityColorMapping config
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Cryville.EEW.Unity {
|
||||
record Config(
|
||||
string SeverityScheme,
|
||||
string SeverityColorMapping,
|
||||
float SeverityColorMappingLuminanceMultiplier,
|
||||
bool UseContinuousColor,
|
||||
string ColorScheme,
|
||||
@@ -16,7 +16,6 @@ namespace Cryville.EEW.Unity {
|
||||
IReadOnlyCollection<EventSourceConfig> EventSources
|
||||
) {
|
||||
public static Config Default => new(
|
||||
"Default",
|
||||
"Default",
|
||||
1f,
|
||||
false,
|
||||
@@ -27,9 +26,9 @@ namespace Cryville.EEW.Unity {
|
||||
true,
|
||||
|
||||
new List<EventSourceConfig> {
|
||||
new JMAAtomEventSourceConfig(),
|
||||
new JMAAtomEventSourceConfig(Array.Empty<string>()),
|
||||
new UpdateCheckerEventSourceConfig(),
|
||||
new WolfxEventSourceConfig(),
|
||||
new WolfxEventSourceConfig(Array.Empty<string>()),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
@@ -69,11 +69,14 @@ namespace Cryville.EEW.Unity {
|
||||
"Legacy" => new LegacySeverityScheme(),
|
||||
_ => throw new InvalidOperationException("Unknown severity scheme."),
|
||||
};
|
||||
SeverityColorMapping = config.SeverityColorMapping switch {
|
||||
SeverityColorMapping = config.ColorScheme switch {
|
||||
"Default" => new DefaultSeverityColorMapping(config.SeverityColorMappingLuminanceMultiplier),
|
||||
"SREV" => new SREVSeverityColorMapping(config.SeverityColorMappingLuminanceMultiplier),
|
||||
"SREVBorder" => new SREVBorderSeverityColorMapping(config.SeverityColorMappingLuminanceMultiplier),
|
||||
_ => throw new InvalidOperationException("Unknown severity color mapping."),
|
||||
"DichromaticYB" => new DichromaticSeverityColorMapping(0.62f, 0.20f, 90, config.SeverityColorMappingLuminanceMultiplier),
|
||||
"DichromaticRC" => new DichromaticSeverityColorMapping(0.62f, 0.25f, 30, config.SeverityColorMappingLuminanceMultiplier),
|
||||
"DichromaticPG" => new DichromaticSeverityColorMapping(0.62f, 0.30f, -30, config.SeverityColorMappingLuminanceMultiplier),
|
||||
"Monochromatic" => new MonochromaticSeverityColorMapping(config.SeverityColorMappingLuminanceMultiplier),
|
||||
_ => throw new InvalidOperationException("Unknown color scheme."),
|
||||
};
|
||||
UseContinuousColor = config.UseContinuousColor;
|
||||
ColorScheme = config.ColorScheme switch {
|
||||
|
Reference in New Issue
Block a user