Compare commits
4 Commits
a131ed10f9
...
e723e939d7
@@ -1,3 +1,3 @@
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: AssemblyVersion("0.0.10")]
|
||||
[assembly: AssemblyVersion("0.0.11")]
|
||||
|
||||
@@ -58,6 +58,7 @@ namespace Cryville.EEW.Unity {
|
||||
[JsonDerivedType(typeof(CWAOpenDataEventSourceConfig), "CWAOpenData")]
|
||||
[JsonDerivedType(typeof(EMSCRealTimeEventSourceConfig), "EMSCRealTime")]
|
||||
[JsonDerivedType(typeof(FANStudioEventSourceConfig), "FANStudio")]
|
||||
[JsonDerivedType(typeof(FANStudioAllEventSourceConfig), "FANStudioAll")]
|
||||
[JsonDerivedType(typeof(GeoNetEventSourceConfig), "GeoNet")]
|
||||
[JsonDerivedType(typeof(GlobalQuakeServerEventSourceConfig), "GlobalQuakeServer")]
|
||||
[JsonDerivedType(typeof(GlobalQuakeServer15EventSourceConfig), "GlobalQuakeServer15")]
|
||||
@@ -71,6 +72,7 @@ namespace Cryville.EEW.Unity {
|
||||
record CWAOpenDataEventSourceConfig([property: JsonRequired] string Subtype, [property: JsonRequired] string Token) : EventSourceConfig;
|
||||
record EMSCRealTimeEventSourceConfig() : EventSourceConfig;
|
||||
record FANStudioEventSourceConfig([property: JsonRequired] string Subtype) : EventSourceConfig;
|
||||
record FANStudioAllEventSourceConfig(IReadOnlyCollection<string> Filter = null, bool IsFilterWhitelist = false) : EventSourceConfig;
|
||||
record GeoNetEventSourceConfig(int MinimumMMI = 3, bool DoGetFullHistory = false, bool DoGetStrongMotionInfo = true) : EventSourceConfig;
|
||||
record GlobalQuakeServerEventSourceConfig([property: JsonRequired] string Host, int Port = 38000) : EventSourceConfig;
|
||||
record GlobalQuakeServer15EventSourceConfig(string Host, int Port = 38000) : GlobalQuakeServerEventSourceConfig(Host, Port);
|
||||
|
||||
@@ -130,9 +130,11 @@ namespace Cryville.EEW.Unity.Map {
|
||||
}
|
||||
|
||||
readonly ContextedGeneratorManager<IMapGeneratorContext, MapElement> _gen = new(new IContextedGenerator<IMapGeneratorContext, MapElement>[] {
|
||||
new BeijingEarthquakeMapGenerator(),
|
||||
new BMKGEarthquakeMapGenerator(),
|
||||
new CEAEEWMapGenerator(),
|
||||
new CENCEarthquakeMapGenerator(),
|
||||
new FANStudio.Map.CENCEarthquakeMapGenerator(),
|
||||
new Wolfx.Map.CENCEarthquakeMapGenerator(),
|
||||
new CENCEEWMapGenerator(),
|
||||
new CWAEarthquakeMapGenerator(),
|
||||
new CWAEEWMapGenerator(),
|
||||
@@ -144,10 +146,13 @@ namespace Cryville.EEW.Unity.Map {
|
||||
new GeoNetQuakeMapGenerator(),
|
||||
new GeoNetStrongMapGenerator(),
|
||||
new GlobalQuakeMapViewGenerator(),
|
||||
new HKOEarthquakeMapGenerator(),
|
||||
new ICLEEWMapGenerator(),
|
||||
new JMAAtomMapGenerator(),
|
||||
new JMAEEWMapGenerator(),
|
||||
new NingxiaEarthquakeMapGenerator(),
|
||||
new NOAAMapGenerator(),
|
||||
new ShakeAlertEEWMapGenerator(),
|
||||
new FANStudio.Map.SichuanEEWMapGenerator(),
|
||||
new Wolfx.Map.SichuanEEWMapGenerator(),
|
||||
new QuakeMLEventMapGenerator(),
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
using SpeechLib;
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Cryville.EEW.Unity {
|
||||
class TTSWorker : Core.Audio.TTSWorker {
|
||||
@@ -33,15 +31,14 @@ namespace Cryville.EEW.Unity {
|
||||
return (status.dwRunningState & (uint)SpeechRunState.SRSEIsSpeaking) != 0;
|
||||
}
|
||||
|
||||
protected override Task Speak(CultureInfo culture, string content, CancellationToken cancellationToken) {
|
||||
if (_voice == null) return Task.CompletedTask;
|
||||
protected override void BeginSpeak(CultureInfo culture, string content) {
|
||||
if (_voice == null) return;
|
||||
_voice.Speak(
|
||||
string.Format(CultureInfo.InvariantCulture, "<LANG LANGID=\"{0:x}\">{1}</LANG>", culture.LCID, content),
|
||||
(uint)(SpeechVoiceSpeakFlags.SVSFlagsAsync | SpeechVoiceSpeakFlags.SVSFPurgeBeforeSpeak),
|
||||
out _
|
||||
);
|
||||
App.MainLogger.Log(0, "Audio", null, "TTS ({0}): {1}", culture, content);
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
protected override void StopCurrent() {
|
||||
|
||||
@@ -107,11 +107,13 @@ namespace Cryville.EEW.Unity {
|
||||
_ongoingReportManager.Dispose();
|
||||
}
|
||||
|
||||
CENCEarthquakeRVMGenerator _cencEarthquakeRVMGenerator;
|
||||
Wolfx.CENCEarthquakeRVMGenerator _cencEarthquakeRVMGenerator;
|
||||
void RegisterViewModelGenerators(CoreWorker worker) {
|
||||
worker.RegisterViewModelGenerator(new BeijingEarthquakeRVMGenerator());
|
||||
worker.RegisterViewModelGenerator(new BMKGEarthquakeRVMGenerator());
|
||||
worker.RegisterViewModelGenerator(new CEAEEWRVMGenerator());
|
||||
worker.RegisterViewModelGenerator(_cencEarthquakeRVMGenerator = new CENCEarthquakeRVMGenerator());
|
||||
worker.RegisterViewModelGenerator(new FANStudio.CENCEarthquakeRVMGenerator());
|
||||
worker.RegisterViewModelGenerator(_cencEarthquakeRVMGenerator = new());
|
||||
worker.RegisterViewModelGenerator(new CENCEEWRVMGenerator());
|
||||
worker.RegisterViewModelGenerator(new CWAEarthquakeRVMGenerator());
|
||||
worker.RegisterViewModelGenerator(new CWAEEWRVMGenerator());
|
||||
@@ -123,23 +125,28 @@ namespace Cryville.EEW.Unity {
|
||||
worker.RegisterViewModelGenerator(new GeoNetQuakeRVMGenerator());
|
||||
worker.RegisterViewModelGenerator(new GeoNetStrongRVMGenerator());
|
||||
worker.RegisterViewModelGenerator(new GlobalQuakeRVMGenerator());
|
||||
worker.RegisterViewModelGenerator(new HKOEarthquakeRVMGenerator());
|
||||
worker.RegisterViewModelGenerator(new ICLEEWRVMGenerator());
|
||||
worker.RegisterViewModelGenerator(new JMAAtomRVMGenerator());
|
||||
worker.RegisterViewModelGenerator(new JMAEEWRVMGenerator());
|
||||
worker.RegisterViewModelGenerator(new NingxiaEarthquakeRVMGenerator());
|
||||
worker.RegisterViewModelGenerator(new NOAAAtomRVMGenerator());
|
||||
var quakemlEventRVMGenerator = new QuakeMLEventRVMGenerator();
|
||||
quakemlEventRVMGenerator.AddExtension(new USGSQuakeMLExtension());
|
||||
worker.RegisterViewModelGenerator(quakemlEventRVMGenerator);
|
||||
worker.RegisterViewModelGenerator(new ShakeAlertEEWRVMGenerator());
|
||||
worker.RegisterViewModelGenerator(new FANStudio.SichuanEEWRVMGenerator());
|
||||
worker.RegisterViewModelGenerator(new Wolfx.SichuanEEWRVMGenerator());
|
||||
worker.RegisterViewModelGenerator(new USGSContoursRVMGenerator());
|
||||
worker.RegisterViewModelGenerator(new VersionRVMGenerator());
|
||||
}
|
||||
CENCEarthquakeTTSMessageGenerator _cencEarthquakeTTSMessageGenerator;
|
||||
Wolfx.TTS.CENCEarthquakeTTSMessageGenerator _cencEarthquakeTTSMessageGenerator;
|
||||
void RegisterTTSMessageGenerators(CoreWorker worker) {
|
||||
worker.RegisterTTSMessageGenerator(new BeijingEarthquakeTTSMessageGenerator());
|
||||
worker.RegisterTTSMessageGenerator(new BMKGEarthquakeTTSMessageGenerator());
|
||||
worker.RegisterTTSMessageGenerator(new CEAEEWTTSMessageGenerator());
|
||||
worker.RegisterTTSMessageGenerator(_cencEarthquakeTTSMessageGenerator = new CENCEarthquakeTTSMessageGenerator());
|
||||
worker.RegisterTTSMessageGenerator(new FANStudio.TTS.CENCEarthquakeTTSMessageGenerator());
|
||||
worker.RegisterTTSMessageGenerator(_cencEarthquakeTTSMessageGenerator = new());
|
||||
worker.RegisterTTSMessageGenerator(new CENCEEWTTSMessageGenerator());
|
||||
worker.RegisterTTSMessageGenerator(new CWAEarthquakeTTSMessageGenerator());
|
||||
worker.RegisterTTSMessageGenerator(new CWAEEWTTSMessageGenerator());
|
||||
@@ -149,10 +156,13 @@ namespace Cryville.EEW.Unity {
|
||||
worker.RegisterTTSMessageGenerator(new GeoNetQuakeHistoryTTSMessageGenerator());
|
||||
worker.RegisterTTSMessageGenerator(new GeoNetQuakeTTSMessageGenerator());
|
||||
worker.RegisterTTSMessageGenerator(new GeoNetStrongTTSMessageGenerator());
|
||||
worker.RegisterTTSMessageGenerator(new HKOEarthquakeTTSMessageGenerator());
|
||||
worker.RegisterTTSMessageGenerator(new ICLEEWTTSMessageGenerator());
|
||||
worker.RegisterTTSMessageGenerator(new JMAAtomTTSMessageGenerator());
|
||||
worker.RegisterTTSMessageGenerator(new JMAEEWTTSMessageGenerator());
|
||||
worker.RegisterTTSMessageGenerator(new NingxiaEarthquakeTTSMessageGenerator());
|
||||
worker.RegisterTTSMessageGenerator(new NOAATTSMessageGenerator());
|
||||
worker.RegisterTTSMessageGenerator(new ShakeAlertEEWTTSMessageGenerator());
|
||||
worker.RegisterTTSMessageGenerator(new FANStudio.TTS.SichuanEEWTTSMessageGenerator());
|
||||
worker.RegisterTTSMessageGenerator(new Wolfx.TTS.SichuanEEWTTSMessageGenerator());
|
||||
}
|
||||
@@ -184,11 +194,17 @@ namespace Cryville.EEW.Unity {
|
||||
},
|
||||
EMSCRealTimeEventSourceConfig => new EMSCRealTimeWorker(new("wss://www.seismicportal.eu/standing_order/websocket")),
|
||||
FANStudioEventSourceConfig fanStudio => fanStudio.Subtype switch {
|
||||
"cenc" => new FANStudioWorker<FANStudio.Model.CENCEarthquake>(new("wss://ws.fanstudio.tech/cenc")),
|
||||
"cea" => new FANStudioWorker<FANStudio.Model.CEAEEW>(new("wss://ws.fanstudio.tech/cea")),
|
||||
"sichuan" => new FANStudioWorker<FANStudio.Model.SichuanEEW>(new("wss://ws.fanstudio.tech/sichuan")),
|
||||
"ningxia" => new FANStudioWorker<FANStudio.Model.NingxiaEarthquake>(new("wss://ws.fanstudio.tech/ningxia")),
|
||||
"fujian" => new FANStudioWorker<FANStudio.Model.FujianEEW>(new("wss://ws.fanstudio.tech/fujian")),
|
||||
"beijing" => new FANStudioWorker<FANStudio.Model.BeijingEarthquake>(new("wss://ws.fanstudio.tech/beijing")),
|
||||
"hko" => new FANStudioWorker<FANStudio.Model.HKOEarthquake>(new("wss://ws.fanstudio.tech/hko")),
|
||||
"sa" => new FANStudioWorker<FANStudio.Model.ShakeAlertEEW>(new("wss://ws.fanstudio.tech/hko")),
|
||||
_ => throw new InvalidOperationException("Unknown FAN Studio sub-type."),
|
||||
},
|
||||
FANStudioAllEventSourceConfig fanStudioAll => BuildFANStudioAllWorkerFilter(new FANStudioAllWorker(new("wss://ws.fanstudio.tech/all")), fanStudioAll),
|
||||
GeoNetEventSourceConfig geoNet => BuildGeoNetWorker(new(new("https://api.geonet.org.nz/quake"), new("https://api.geonet.org.nz/quake/history/index"), new("https://api.geonet.org.nz/intensity/strong/processed/index")), geoNet),
|
||||
GlobalQuakeServer15EventSourceConfig gq => new GlobalQuakeWorker15(gq.Host, gq.Port),
|
||||
GlobalQuakeServerEventSourceConfig gq => new GlobalQuakeWorker(gq.Host, gq.Port),
|
||||
@@ -232,6 +248,11 @@ namespace Cryville.EEW.Unity {
|
||||
|
||||
return worker;
|
||||
}
|
||||
FANStudioAllWorker BuildFANStudioAllWorkerFilter(FANStudioAllWorker worker, FANStudioAllEventSourceConfig config) {
|
||||
if (config.Filter != null) worker.SetFilter(config.Filter);
|
||||
worker.IsFilterWhitelist = config.IsFilterWhitelist;
|
||||
return worker;
|
||||
}
|
||||
static BMKGOpenDataWorker BuildBMKGOpenDataWorkerUris(BMKGOpenDataWorker worker, BMKGOpenDataEventSourceConfig config) {
|
||||
worker.SetDataUris(config.Subtypes.Select(i => new Uri(string.Format(CultureInfo.InvariantCulture, "https://data.bmkg.go.id/DataMKG/TEWS/{0}.json", i))));
|
||||
return worker;
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -7,6 +7,7 @@
|
||||
"Serial": "#{0}",
|
||||
"SerialCancel": "取消",
|
||||
"SerialFinal": "#{0}終",
|
||||
"SoundPlayerError": "効果音プレーヤーでエラー",
|
||||
"TTSError": "エラーのため音声合成が動作を停止しました",
|
||||
"UnknownLocation": "地域不明",
|
||||
"WorkerConnected": "{0} に接続しました",
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user