중간 저장
This commit is contained in:
96
tools/KarismaTcpProbe/CutDebugRecommendationCatalog.cs
Normal file
96
tools/KarismaTcpProbe/CutDebugRecommendationCatalog.cs
Normal file
@@ -0,0 +1,96 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Tornado3_2026Election.Domain;
|
||||
|
||||
internal readonly record struct CutDebugRecommendation(string Key, CutDebugItemKind Kind);
|
||||
|
||||
internal static class CutDebugRecommendationCatalog
|
||||
{
|
||||
private static readonly Lazy<IReadOnlyDictionary<string, CutDebugRecommendation>> Recommendations =
|
||||
new(LoadRecommendations);
|
||||
|
||||
public static bool TryGetRecommendation(string templateId, out CutDebugRecommendation recommendation)
|
||||
{
|
||||
return Recommendations.Value.TryGetValue(templateId, out recommendation);
|
||||
}
|
||||
|
||||
public static int Count => Recommendations.Value.Count;
|
||||
|
||||
private static IReadOnlyDictionary<string, CutDebugRecommendation> LoadRecommendations()
|
||||
{
|
||||
var path = FindRecommendationPath();
|
||||
if (path is null || !File.Exists(path))
|
||||
{
|
||||
return new Dictionary<string, CutDebugRecommendation>(StringComparer.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
var recommendations = new Dictionary<string, CutDebugRecommendation>(StringComparer.OrdinalIgnoreCase);
|
||||
foreach (var rawLine in File.ReadLines(path, Encoding.UTF8).Skip(1))
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(rawLine))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var columns = rawLine.Split('\t');
|
||||
if (columns.Length < 3)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var templateId = columns[0].Trim();
|
||||
var key = columns[1].Trim();
|
||||
if (!Enum.TryParse<CutDebugItemKind>(columns[2].Trim(), ignoreCase: true, out var kind) ||
|
||||
string.IsNullOrWhiteSpace(templateId) ||
|
||||
string.IsNullOrWhiteSpace(key))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
recommendations[templateId] = new CutDebugRecommendation(key, kind);
|
||||
}
|
||||
|
||||
return recommendations;
|
||||
}
|
||||
|
||||
private static string? FindRecommendationPath()
|
||||
{
|
||||
foreach (var root in EnumerateSearchRoots())
|
||||
{
|
||||
var candidate = Path.Combine(root, "tools", "KarismaTcpProbe", "cut-debug-recommendations.tsv");
|
||||
if (File.Exists(candidate))
|
||||
{
|
||||
return candidate;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private static IEnumerable<string> EnumerateSearchRoots()
|
||||
{
|
||||
var seen = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
foreach (var start in new[] { AppContext.BaseDirectory, Environment.CurrentDirectory })
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(start))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var directory = new DirectoryInfo(Path.GetFullPath(start));
|
||||
while (directory is not null)
|
||||
{
|
||||
if (seen.Add(directory.FullName))
|
||||
{
|
||||
yield return directory.FullName;
|
||||
}
|
||||
|
||||
directory = directory.Parent;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -25,6 +25,9 @@
|
||||
<Compile Include="..\..\Tornado3_2026Election\Domain\BroadcastStationProfile.cs" Link="AppSource\Domain\BroadcastStationProfile.cs" />
|
||||
<Compile Include="..\..\Tornado3_2026Election\Domain\CandidateEntry.cs" Link="AppSource\Domain\CandidateEntry.cs" />
|
||||
<Compile Include="..\..\Tornado3_2026Election\Domain\CandidateJudgement.cs" Link="AppSource\Domain\CandidateJudgement.cs" />
|
||||
<Compile Include="..\..\Tornado3_2026Election\Domain\CutDebugItemState.cs" Link="AppSource\Domain\CutDebugItemState.cs" />
|
||||
<Compile Include="..\..\Tornado3_2026Election\Domain\CutDebugOverride.cs" Link="AppSource\Domain\CutDebugOverride.cs" />
|
||||
<Compile Include="..\..\Tornado3_2026Election\Domain\CutDebugSettings.cs" Link="AppSource\Domain\CutDebugSettings.cs" />
|
||||
<Compile Include="..\..\Tornado3_2026Election\Domain\ElectionDataSnapshot.cs" Link="AppSource\Domain\ElectionDataSnapshot.cs" />
|
||||
<Compile Include="..\..\Tornado3_2026Election\Domain\FormatCutDefinition.cs" Link="AppSource\Domain\FormatCutDefinition.cs" />
|
||||
<Compile Include="..\..\Tornado3_2026Election\Domain\FormatTemplateDefinition.cs" Link="AppSource\Domain\FormatTemplateDefinition.cs" />
|
||||
@@ -33,10 +36,14 @@
|
||||
<Compile Include="..\..\Tornado3_2026Election\Domain\LoopMode.cs" Link="AppSource\Domain\LoopMode.cs" />
|
||||
<Compile Include="..\..\Tornado3_2026Election\Domain\PreElectionHistoryModels.cs" Link="AppSource\Domain\PreElectionHistoryModels.cs" />
|
||||
<Compile Include="..\..\Tornado3_2026Election\Domain\TornadoConnectionState.cs" Link="AppSource\Domain\TornadoConnectionState.cs" />
|
||||
<Compile Include="..\..\Tornado3_2026Election\Domain\VideoWallLayoutPreset.cs" Link="AppSource\Domain\VideoWallLayoutPreset.cs" />
|
||||
<Compile Include="..\..\Tornado3_2026Election\Services\CutDebugStateStore.cs" Link="AppSource\Services\CutDebugStateStore.cs" />
|
||||
<Compile Include="..\..\Tornado3_2026Election\Services\CutAppearancePolicyCatalog.cs" Link="AppSource\Services\CutAppearancePolicyCatalog.cs" />
|
||||
<Compile Include="..\..\Tornado3_2026Election\Services\FormatCatalogService.cs" Link="AppSource\Services\FormatCatalogService.cs" />
|
||||
<Compile Include="..\..\Tornado3_2026Election\Services\ITornado3Adapter.cs" Link="AppSource\Services\ITornado3Adapter.cs" />
|
||||
<Compile Include="..\..\Tornado3_2026Election\Services\KarismaCounterNumberKeyUpdate.cs" Link="AppSource\Services\KarismaCounterNumberKeyUpdate.cs" />
|
||||
<Compile Include="..\..\Tornado3_2026Election\Services\KarismaEventHandler.cs" Link="AppSource\Services\KarismaEventHandler.cs" />
|
||||
<Compile Include="..\..\Tornado3_2026Election\Services\KarismaSceneResolutionReader.cs" Link="AppSource\Services\KarismaSceneResolutionReader.cs" />
|
||||
<Compile Include="..\..\Tornado3_2026Election\Services\KarismaSceneResolver.cs" Link="AppSource\Services\KarismaSceneResolver.cs" />
|
||||
<Compile Include="..\..\Tornado3_2026Election\Services\KarismaSceneVariableCatalog.cs" Link="AppSource\Services\KarismaSceneVariableCatalog.cs" />
|
||||
<Compile Include="..\..\Tornado3_2026Election\Services\KarismaStyleColorUpdate.cs" Link="AppSource\Services\KarismaStyleColorUpdate.cs" />
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
68
tools/KarismaTcpProbe/cut-debug-recommendations.tsv
Normal file
68
tools/KarismaTcpProbe/cut-debug-recommendations.tsv
Normal file
@@ -0,0 +1,68 @@
|
||||
TemplateId Key Kind
|
||||
Elect2026_Bottom_민방\1-2위_광역단체장 후보사진01 ImageValue
|
||||
Elect2026_Bottom_민방\1-2위_기초단체장 후보사진01 ImageValue
|
||||
Elect2026_Bottom_민방\1-3위_광역단체장 후보사진01 ImageValue
|
||||
Elect2026_Bottom_민방\1-3위_기초단체장 후보사진01 ImageValue
|
||||
Elect2026_Bottom_민방\1위_광역단체장 후보사진01 ImageValue
|
||||
Elect2026_Bottom_민방\1위_기초단체장 후보사진01 ImageValue
|
||||
Elect2026_Bottom_민방\당선_광역단체장 후보사진01 ImageValue
|
||||
Elect2026_Bottom_민방\당선_광역의원 후보사진01 ImageValue
|
||||
Elect2026_Bottom_민방\당선_기초단체장 후보사진01 ImageValue
|
||||
Elect2026_Bottom_민방\당선_기초의원 후보사진01 ImageValue
|
||||
Elect2026_Bottom_민방\사전투표율 투표율01 Counter
|
||||
Elect2026_Bottom_민방\전후보_광역단체장 후보사진01 ImageValue
|
||||
Elect2026_Bottom_민방\전후보_교육감 후보사진01 ImageValue
|
||||
Elect2026_Bottom_민방\전후보_기초단체장 후보사진01 ImageValue
|
||||
Elect2026_Bottom_민방\투표율 투표율01 Counter
|
||||
Elect2026_Normal_민방\1-2위_ani_광역단체장 후보사진01 ImageValue
|
||||
Elect2026_Normal_민방\1-2위_ani_기초단체장 후보명01 TextValue
|
||||
Elect2026_Normal_민방\1-2위_광역단체장 후보사진01 ImageValue
|
||||
Elect2026_Normal_민방\1-2위_광역단체장_시도별영상 후보명01 TextValue
|
||||
Elect2026_Normal_민방\1-2위_교육감 후보사진01 ImageValue
|
||||
Elect2026_Normal_민방\1-2위_기초단체장 후보명01 TextValue
|
||||
Elect2026_Normal_민방\1-2위_기초단체장_시도별영상 후보명01 TextValue
|
||||
Elect2026_Normal_민방\1-2위_보궐선거 후보명01 TextValue
|
||||
Elect2026_Normal_민방\1-3위_ani_광역단체장 후보명01 TextValue
|
||||
Elect2026_Normal_민방\1-3위_ani_기초단체장 후보사진01 ImageValue
|
||||
Elect2026_Normal_민방\1-3위_보궐선거 후보명01 TextValue
|
||||
Elect2026_Normal_민방\경력_광역단체장_in 후보명01 TextValue
|
||||
Elect2026_Normal_민방\경력_기초단체장_in 후보사진01 ImageValue
|
||||
Elect2026_Normal_민방\광역의원표_HD 개표율01 TextValue
|
||||
Elect2026_Normal_민방\기초의원표_HD 개표율01 TextValue
|
||||
Elect2026_Normal_민방\당선_광역단체장_HD 후보사진01 ImageValue
|
||||
Elect2026_Normal_민방\당선_광역의원_HD 후보사진01 ImageValue
|
||||
Elect2026_Normal_민방\당선_교육감_HD 후보사진01 ImageValue
|
||||
Elect2026_Normal_민방\당선_기초단체장_HD 후보사진01 ImageValue
|
||||
Elect2026_Normal_민방\당선_기초의원_HD 후보사진01 ImageValue
|
||||
Elect2026_Normal_민방\모든후보_광역단체장 후보사진01 ImageValue
|
||||
Elect2026_Normal_민방\모든후보_교육감 후보사진01 ImageValue
|
||||
Elect2026_Normal_민방\모든후보_기초단체장 후보사진01 ImageValue
|
||||
Elect2026_Normal_민방\민방_타이틀_1920 후보사진01 ImageValue
|
||||
Elect2026_Normal_민방\민방_타이틀_1920_notext 후보사진02 ImageValue
|
||||
Elect2026_Normal_민방\사전_역대당선자 후보사진07 ImageValue
|
||||
Elect2026_Normal_민방\사전_역대당선자_교육감 후보사진05 ImageValue
|
||||
Elect2026_Normal_민방\사전_역대당선자_기초단체장 후보사진05 ImageValue
|
||||
Elect2026_Normal_민방\역대시도판세_광역단체장 득표율02 Counter
|
||||
Elect2026_Normal_민방\역대시도판세_기초단체장 후보명02 TextValue
|
||||
Elect2026_Normal_민방\이시각1위_광역단체장_HD 후보사진01 ImageValue
|
||||
Elect2026_Normal_민방\이시각1위_기초단체장_HD 후보사진01 ImageValue
|
||||
Elect2026_Normal_민방\접전_광역단체장 후보사진01 ImageValue
|
||||
Elect2026_Normal_민방\접전_기초단체장 후보사진01 ImageValue
|
||||
Elect2026_Normal_민방\초접전_광역단체장 후보사진01 ImageValue
|
||||
Elect2026_Normal_민방\초접전_기초단체장 후보사진01 ImageValue
|
||||
Elect2026_Normal_민방\투표율_사진 투표율01 Counter
|
||||
Elect2026_Normal_민방\투표율_선거구별 사전 투표율01 Counter
|
||||
Elect2026_Normal_민방\투표율_영상 투표율01 Counter
|
||||
Elect2026_Normal_민방\판세_광역단체장 개표율01 TextValue
|
||||
Elect2026_Normal_민방\판세_기초단체장 득표율01 Counter
|
||||
Elect2026_Top_민방\광역단체장_2인 후보사진01 ImageValue
|
||||
Elect2026_Top_민방\광역단체장_2인_텍스트 후보명01 TextValue
|
||||
Elect2026_Top_민방\기초단체장_2인 후보사진01 ImageValue
|
||||
Elect2026_Top_민방\기초단체장_2인_텍스트 득표율01 Counter
|
||||
Elect2026_Top_민방\투표율 전국투표율01 Counter
|
||||
Elect2026_Top_민방\투표율_선거구별 투표율01 Counter
|
||||
Elect2026_Top_민방\판세_광역단체장 정당명01 TextValue
|
||||
Elect2026_Top_민방\판세_광역의원 정당명01 TextValue
|
||||
Elect2026_Top_민방\판세_교육감 정당명01 TextValue
|
||||
Elect2026_Top_민방\판세_기초단체장 정당명01 TextValue
|
||||
Elect2026_Top_민방\판세_기초의원 정당명01 TextValue
|
||||
|
Reference in New Issue
Block a user