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