Compare commits
4 Commits
a8f46113d4
...
4758b65159
Author | SHA1 | Date | |
---|---|---|---|
4758b65159 | |||
de3196d38a | |||
c2311fb7a4 | |||
7562be2c09 |
@@ -1,3 +1,3 @@
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: AssemblyVersion("0.0.7")]
|
||||
[assembly: AssemblyVersion("0.0.8")]
|
||||
|
@@ -61,7 +61,7 @@ namespace Cryville.EEW.Unity {
|
||||
[JsonDerivedType(typeof(JMAAtomEventSourceConfig), "JMAAtom")]
|
||||
[JsonDerivedType(typeof(NOAAEventSourceConfig), "NOAA")]
|
||||
[JsonDerivedType(typeof(UpdateCheckerEventSourceConfig), "UpdateChecker")]
|
||||
[JsonDerivedType(typeof(USGSQuakeMLEventSourceConfig), "USGSQuakeML")]
|
||||
[JsonDerivedType(typeof(USGSEventSourceConfig), "USGSQuakeML")]
|
||||
[JsonDerivedType(typeof(WolfxEventSourceConfig), "Wolfx")]
|
||||
abstract record EventSourceConfig();
|
||||
record BMKGOpenDataEventSourceConfig([property: JsonRequired] string[] Subtypes) : EventSourceConfig;
|
||||
@@ -73,7 +73,7 @@ namespace Cryville.EEW.Unity {
|
||||
record JMAAtomEventSourceConfig(IReadOnlyCollection<string> Filter = null, bool IsFilterWhitelist = false) : EventSourceConfig;
|
||||
record NOAAEventSourceConfig([property: JsonRequired] string Subtype) : EventSourceConfig;
|
||||
record UpdateCheckerEventSourceConfig : EventSourceConfig;
|
||||
record USGSQuakeMLEventSourceConfig([property: JsonRequired] string Subtype) : EventSourceConfig;
|
||||
record USGSEventSourceConfig([property: JsonRequired] string Subtype, bool UseGeoJSONFeeds, string[] Products) : EventSourceConfig;
|
||||
record WolfxEventSourceConfig(IReadOnlyCollection<string> Filter = null, bool IsFilterWhitelist = false, bool UseRawCENCLocationName = false) : EventSourceConfig;
|
||||
|
||||
[JsonSerializable(typeof(Config))]
|
||||
|
@@ -9,6 +9,7 @@ using Cryville.EEW.Map;
|
||||
using Cryville.EEW.NOAA.Map;
|
||||
using Cryville.EEW.QuakeML.Map;
|
||||
using Cryville.EEW.Report;
|
||||
using Cryville.EEW.USGS.Map;
|
||||
using Cryville.EEW.Wolfx.Map;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
@@ -145,6 +146,7 @@ namespace Cryville.EEW.Unity.Map {
|
||||
new NOAAMapGenerator(),
|
||||
new QuakeMLEventMapGenerator(),
|
||||
new SichuanEEWMapGenerator(),
|
||||
new USGSContoursMapGenerator(),
|
||||
});
|
||||
public UnityMapElement Build(object e, out CultureInfo culture, out int order) {
|
||||
culture = CultureInfo.InvariantCulture;
|
||||
|
@@ -111,8 +111,11 @@ namespace Cryville.EEW.Unity {
|
||||
worker.RegisterViewModelGenerator(new JMAAtomRVMGenerator());
|
||||
worker.RegisterViewModelGenerator(new JMAEEWRVMGenerator());
|
||||
worker.RegisterViewModelGenerator(new NOAAAtomRVMGenerator());
|
||||
worker.RegisterViewModelGenerator(new QuakeMLEventRVMGenerator());
|
||||
var quakemlEventRVMGenerator = new QuakeMLEventRVMGenerator();
|
||||
quakemlEventRVMGenerator.AddExtension(new USGSQuakeMLExtension());
|
||||
worker.RegisterViewModelGenerator(quakemlEventRVMGenerator);
|
||||
worker.RegisterViewModelGenerator(new SichuanEEWRVMGenerator());
|
||||
worker.RegisterViewModelGenerator(new USGSContoursRVMGenerator());
|
||||
worker.RegisterViewModelGenerator(new VersionRVMGenerator());
|
||||
}
|
||||
CENCEarthquakeTTSMessageGenerator _cencEarthquakeTTSMessageGenerator;
|
||||
@@ -168,7 +171,10 @@ namespace Cryville.EEW.Unity {
|
||||
_ => throw new InvalidOperationException("Unknown NOAA sub-type."),
|
||||
},
|
||||
UpdateCheckerEventSourceConfig => new UpdateCheckerWorker(typeof(Worker).Assembly.GetName().Version?.ToString(3) ?? "", "unity"),
|
||||
USGSQuakeMLEventSourceConfig usgsQuakeML => BuildUSGSQuakeMLWorkerUri(new USGSQuakeMLWorker(new("https://earthquake.usgs.gov/earthquakes/feed/v1.0/quakeml.php")), usgsQuakeML),
|
||||
USGSEventSourceConfig usgs => BuildUSGSWorker(usgs.UseGeoJSONFeeds
|
||||
? new USGSGeoJSONWorker(new Uri("https://earthquake.usgs.gov/earthquakes/feed/v1.0/geojson.php"))
|
||||
: new USGSQuakeMLWorker(new Uri("https://earthquake.usgs.gov/earthquakes/feed/v1.0/quakeml.php"))
|
||||
, usgs),
|
||||
WolfxEventSourceConfig wolfx => BuildWolfxWorkerFilter(new WolfxWorker(new("wss://ws-api.wolfx.jp/all_eew")), wolfx),
|
||||
_ => throw new InvalidOperationException("Unknown event source type."),
|
||||
});
|
||||
@@ -208,8 +214,16 @@ namespace Cryville.EEW.Unity {
|
||||
worker.DoGetStrongMotionInfo = pref.DoGetStrongMotionInfo;
|
||||
return worker;
|
||||
}
|
||||
static USGSQuakeMLWorker BuildUSGSQuakeMLWorkerUri(USGSQuakeMLWorker worker, USGSQuakeMLEventSourceConfig config) {
|
||||
worker.SetFeedRelativeUri(new(string.Format(CultureInfo.InvariantCulture, "/earthquakes/feed/v1.0/summary/{0}.quakeml", config.Subtype), UriKind.Relative));
|
||||
static USGSWorker BuildUSGSWorker(USGSWorker worker, USGSEventSourceConfig config) {
|
||||
worker.SetFeedRelativeUri(new(string.Format(CultureInfo.InvariantCulture, "/earthquakes/feed/v1.0/summary/{0}{1}", config.Subtype, config.UseGeoJSONFeeds ? ".geojson" : ".quakeml"), UriKind.Relative));
|
||||
if (worker is USGSGeoJSONWorker geojsonWorker) {
|
||||
geojsonWorker.SetFilter(
|
||||
config.Products
|
||||
.Select(i => i.Split('/', 2))
|
||||
.GroupBy(i => i[0])
|
||||
.ToDictionary(g => g.Key, g => g.Select(i => i[1]))
|
||||
);
|
||||
}
|
||||
return worker;
|
||||
}
|
||||
|
||||
@@ -218,7 +232,7 @@ namespace Cryville.EEW.Unity {
|
||||
ReportViewModel _latestHistoryReport;
|
||||
void OnReported(object sender, ReportViewModel e) {
|
||||
if (e.Model is Exception && e.Model is not SourceWorkerNetworkException)
|
||||
App.MainLogger.Log(4, "Map", null, "Received an error from {0}: {1}", sender.GetType(), e.Model);
|
||||
App.MainLogger.Log(4, "App", null, "Received an error from {0}: {1}", sender.GetType(), e.Model);
|
||||
_grouper.Report(e);
|
||||
_ongoingReportManager.Report(e);
|
||||
_uiActionQueue.Enqueue(() => {
|
||||
|
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.
BIN
Assets/Plugins/Cryville.EEW.USGS.Map.dll
Normal file
BIN
Assets/Plugins/Cryville.EEW.USGS.Map.dll
Normal file
Binary file not shown.
33
Assets/Plugins/Cryville.EEW.USGS.Map.dll.meta
Normal file
33
Assets/Plugins/Cryville.EEW.USGS.Map.dll.meta
Normal file
@@ -0,0 +1,33 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 123d46d01924a434fbe65219e8baba1e
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
Windows Store Apps: WindowsStoreApps
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1587,6 +1587,11 @@
|
||||
The parent type.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Cryville.EEW.Report.ReportViewModelPropertyType.Root">
|
||||
<summary>
|
||||
The root type.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Cryville.EEW.Report.ReportViewModelPropertyType.OfSubtype(System.String)">
|
||||
<summary>
|
||||
Creates a sub-type from this type.
|
||||
|
@@ -1,6 +1,39 @@
|
||||
{
|
||||
"Culture": "en-US",
|
||||
"Strings": {
|
||||
"AuthorityName": "USGS",
|
||||
"AuthorityNameForwarded": "{0} | {1}",
|
||||
"PropertyDepth": "Depth",
|
||||
"PropertyDepthValue": "{0}km",
|
||||
"PropertyMagnitude": "M",
|
||||
"PropertyValue": "{0}{1}",
|
||||
"ShakeMapTitle": "ShakeMap ({0})",
|
||||
"SourceName": "USGS"
|
||||
},
|
||||
"StringSets": {
|
||||
"ContoursName": {
|
||||
"Strings": {
|
||||
"cont_mi": "Intensity Contours",
|
||||
"cont_mmi": "Intensity Contours",
|
||||
"cont_pga": "PGA Contours",
|
||||
"cont_pgv": "PGV Contours"
|
||||
}
|
||||
},
|
||||
"ContoursPropertyName": {
|
||||
"Strings": {
|
||||
"cont_mi": "Max intensity",
|
||||
"cont_mmi": "Max intensity",
|
||||
"cont_pga": "Max PGA",
|
||||
"cont_pgv": "Max PGV"
|
||||
}
|
||||
},
|
||||
"PropertyUnits": {
|
||||
"Strings": {
|
||||
"mmi": "",
|
||||
"pctg": "%g",
|
||||
"g": "g",
|
||||
"cms": "cm/s"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
39
Assets/StreamingAssets/Messages/Cryville.EEW.USGS/yue.json
Normal file
39
Assets/StreamingAssets/Messages/Cryville.EEW.USGS/yue.json
Normal file
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"Culture": "yue-HK",
|
||||
"Strings": {
|
||||
"AuthorityName": "USGS",
|
||||
"AuthorityNameForwarded": "{0} | {1}",
|
||||
"PropertyDepth": "深度",
|
||||
"PropertyDepthValue": "{0}km",
|
||||
"PropertyMagnitude": "M",
|
||||
"PropertyValue": "{0}{1}",
|
||||
"ShakeMapTitle": "地震動圖({0})",
|
||||
"SourceName": "USGS"
|
||||
},
|
||||
"StringSets": {
|
||||
"ContoursName": {
|
||||
"Strings": {
|
||||
"cont_mi": "等烈度綫",
|
||||
"cont_mmi": "等烈度綫",
|
||||
"cont_pga": "等最大地面加速度綫",
|
||||
"cont_pgv": "等最大地面速度綫"
|
||||
}
|
||||
},
|
||||
"ContoursPropertyName": {
|
||||
"Strings": {
|
||||
"cont_mi": "最大烈度",
|
||||
"cont_mmi": "最大烈度",
|
||||
"cont_pga": "最大PGA",
|
||||
"cont_pgv": "最大PGV"
|
||||
}
|
||||
},
|
||||
"PropertyUnits": {
|
||||
"Strings": {
|
||||
"mmi": "",
|
||||
"pctg": "%g",
|
||||
"g": "g",
|
||||
"cms": "cm/s"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6f321e8c7c214c648a5dc5abfae0a628
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"Culture": "zh-TW",
|
||||
"Strings": {
|
||||
"AuthorityName": "USGS",
|
||||
"AuthorityNameForwarded": "{0} | {1}",
|
||||
"PropertyDepth": "深度",
|
||||
"PropertyDepthValue": "{0}km",
|
||||
"PropertyMagnitude": "M",
|
||||
"PropertyValue": "{0}{1}",
|
||||
"ShakeMapTitle": "地震動圖({0})",
|
||||
"SourceName": "USGS"
|
||||
},
|
||||
"StringSets": {
|
||||
"ContoursName": {
|
||||
"Strings": {
|
||||
"cont_mi": "等震度綫",
|
||||
"cont_mmi": "等震度綫",
|
||||
"cont_pga": "等最大地面加速度綫",
|
||||
"cont_pgv": "等最大地面速度綫"
|
||||
}
|
||||
},
|
||||
"ContoursPropertyName": {
|
||||
"Strings": {
|
||||
"cont_mi": "最大震度",
|
||||
"cont_mmi": "最大震度",
|
||||
"cont_pga": "最大PGA",
|
||||
"cont_pgv": "最大PGV"
|
||||
}
|
||||
},
|
||||
"PropertyUnits": {
|
||||
"Strings": {
|
||||
"mmi": "",
|
||||
"pctg": "%g",
|
||||
"g": "g",
|
||||
"cms": "cm/s"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 44c3032bb65e45441be984876fd9a89e
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
39
Assets/StreamingAssets/Messages/Cryville.EEW.USGS/zh.json
Normal file
39
Assets/StreamingAssets/Messages/Cryville.EEW.USGS/zh.json
Normal file
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"Culture": "zh-CN",
|
||||
"Strings": {
|
||||
"AuthorityName": "USGS",
|
||||
"AuthorityNameForwarded": "{0} | {1}",
|
||||
"PropertyDepth": "深度",
|
||||
"PropertyDepthValue": "{0}km",
|
||||
"PropertyMagnitude": "M",
|
||||
"PropertyValue": "{0}{1}",
|
||||
"ShakeMapTitle": "地震动图({0})",
|
||||
"SourceName": "USGS"
|
||||
},
|
||||
"StringSets": {
|
||||
"ContoursName": {
|
||||
"Strings": {
|
||||
"cont_mi": "等烈度线",
|
||||
"cont_mmi": "等烈度线",
|
||||
"cont_pga": "等峰值地面加速度线",
|
||||
"cont_pgv": "等峰值地面速度线"
|
||||
}
|
||||
},
|
||||
"ContoursPropertyName": {
|
||||
"Strings": {
|
||||
"cont_mi": "最大烈度",
|
||||
"cont_mmi": "最大烈度",
|
||||
"cont_pga": "最大PGA",
|
||||
"cont_pgv": "最大PGV"
|
||||
}
|
||||
},
|
||||
"PropertyUnits": {
|
||||
"Strings": {
|
||||
"mmi": "",
|
||||
"pctg": "%g",
|
||||
"g": "g",
|
||||
"cms": "cm/s"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b3c804718aac7954ab4e4949d15b7904
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -134,7 +134,7 @@ PlayerSettings:
|
||||
16:10: 1
|
||||
16:9: 1
|
||||
Others: 1
|
||||
bundleVersion: 0.0.7
|
||||
bundleVersion: 0.0.8
|
||||
preloadedAssets: []
|
||||
metroInputSource: 0
|
||||
wsaTransparentSwapchain: 0
|
||||
@@ -654,7 +654,7 @@ PlayerSettings:
|
||||
allowUnsafeCode: 1
|
||||
useDeterministicCompilation: 1
|
||||
enableRoslynAnalyzers: 1
|
||||
selectedPlatform: 2
|
||||
selectedPlatform: 0
|
||||
additionalIl2CppArgs:
|
||||
scriptingRuntimeVersion: 1
|
||||
gcIncremental: 1
|
||||
|
Reference in New Issue
Block a user