From 7da13a285edd4a8680d3c808c4899315fd45d820 Mon Sep 17 00:00:00 2001 From: Markus Ast Date: Thu, 1 Jul 2021 10:49:08 +0200 Subject: [PATCH] fix stations with dots in their name Fixes #103 --- CHANGELOG.md | 6 ++++++ Cargo.lock | 12 ++++++------ crates/datis-cmd/Cargo.toml | 2 +- crates/datis-core/Cargo.toml | 2 +- crates/datis-core/src/extract.rs | 30 +++++++++++++++++++++++++++++- crates/datis-module/Cargo.toml | 2 +- crates/radio-station/Cargo.toml | 2 +- crates/srs/Cargo.toml | 2 +- crates/win-tts/Cargo.toml | 2 +- mod/Mods/services/DATIS/entry.lua | 2 +- 10 files changed, 48 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 65806db..e0349ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +## [3.1.2] - 2021-07-01 + +### Fixed + +- Fixed ATIS stations for airfields that have a dot (`.`) in their name (e.g. Antonio B. Won Pat Intl on Marina) [#103](https://github.com/rkusa/DATIS/issues/103) + ## [3.1.1] - 2021-06-22 ### Fixed diff --git a/Cargo.lock b/Cargo.lock index 9df2ea7..bef88a8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -416,7 +416,7 @@ dependencies = [ [[package]] name = "datis" -version = "3.1.1" +version = "3.1.2" dependencies = [ "datis-core", "log", @@ -431,7 +431,7 @@ dependencies = [ [[package]] name = "datis-cmd" -version = "3.1.1" +version = "3.1.2" dependencies = [ "clap", "ctrlc", @@ -443,7 +443,7 @@ dependencies = [ [[package]] name = "datis-core" -version = "3.1.1" +version = "3.1.2" dependencies = [ "anyhow", "async-trait", @@ -486,7 +486,7 @@ dependencies = [ [[package]] name = "dcs-radio-station" -version = "3.1.1" +version = "3.1.2" dependencies = [ "anyhow", "async-std", @@ -1842,7 +1842,7 @@ dependencies = [ [[package]] name = "srs" -version = "3.1.1" +version = "3.1.2" dependencies = [ "base64", "byteorder", @@ -2382,7 +2382,7 @@ dependencies = [ [[package]] name = "win-tts" -version = "3.1.1" +version = "3.1.2" dependencies = [ "futures", "log", diff --git a/crates/datis-cmd/Cargo.toml b/crates/datis-cmd/Cargo.toml index d388ad5..3f5d902 100644 --- a/crates/datis-cmd/Cargo.toml +++ b/crates/datis-cmd/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "datis-cmd" -version = "3.1.1" +version = "3.1.2" authors = ["Markus Ast "] edition = "2018" diff --git a/crates/datis-core/Cargo.toml b/crates/datis-core/Cargo.toml index 455a5e8..1f8d513 100644 --- a/crates/datis-core/Cargo.toml +++ b/crates/datis-core/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "datis-core" -version = "3.1.1" +version = "3.1.2" authors = ["Markus Ast "] edition = "2018" diff --git a/crates/datis-core/src/extract.rs b/crates/datis-core/src/extract.rs index b2a31c0..941efd7 100644 --- a/crates/datis-core/src/extract.rs +++ b/crates/datis-core/src/extract.rs @@ -48,7 +48,7 @@ pub fn extract_station_config_from_mission_description( } pub fn extract_atis_station_config(config: &str) -> Option { - let re = RegexBuilder::new(r"ATIS ([a-zA-Z0-9- ]+) ([1-3]\d{2}(\.\d{1,3})?)(,(.+))?") + let re = RegexBuilder::new(r"ATIS ([a-zA-Z0-9-\. ]+) ([1-3]\d{2}(\.\d{1,3})?)(,(.+))?") .case_insensitive(true) .build() .unwrap(); @@ -370,6 +370,34 @@ mod test { ); } + #[test] + fn test_airfield_names_with_dot() { + let freqs = extract_station_config_from_mission_description( + r#" + ATIS Antonio B. Won Pat Intl 251.000 + "#, + ); + + assert_eq!( + freqs, + vec![( + "Antonio B. Won Pat Intl".to_string(), + StationConfig { + name: "Antonio B. Won Pat Intl".to_string(), + atis: 251_000_000, + traffic: None, + tts: None, + info_ltr_override: None, + active_rwy_override: None, + no_hpa: false, + no_qfe: false, + } + ),] + .into_iter() + .collect() + ); + } + #[test] fn test_advanced_mission_descriptiopn_extraction() { let freqs = extract_station_config_from_mission_description( diff --git a/crates/datis-module/Cargo.toml b/crates/datis-module/Cargo.toml index 2d14ab1..c494852 100644 --- a/crates/datis-module/Cargo.toml +++ b/crates/datis-module/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "datis" -version = "3.1.1" +version = "3.1.2" authors = ["Markus Ast "] edition = "2018" diff --git a/crates/radio-station/Cargo.toml b/crates/radio-station/Cargo.toml index 50e951d..0ff5770 100644 --- a/crates/radio-station/Cargo.toml +++ b/crates/radio-station/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dcs-radio-station" -version = "3.1.1" +version = "3.1.2" authors = ["Markus Ast "] edition = "2018" diff --git a/crates/srs/Cargo.toml b/crates/srs/Cargo.toml index b0f99b9..492f4f8 100644 --- a/crates/srs/Cargo.toml +++ b/crates/srs/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "srs" -version = "3.1.1" +version = "3.1.2" authors = ["rkusa"] edition = "2018" diff --git a/crates/win-tts/Cargo.toml b/crates/win-tts/Cargo.toml index 61e7ff6..d10ee69 100644 --- a/crates/win-tts/Cargo.toml +++ b/crates/win-tts/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "win-tts" -version = "3.1.1" +version = "3.1.2" authors = ["Markus Ast "] edition = "2018" diff --git a/mod/Mods/services/DATIS/entry.lua b/mod/Mods/services/DATIS/entry.lua index e742a46..fe0bc03 100644 --- a/mod/Mods/services/DATIS/entry.lua +++ b/mod/Mods/services/DATIS/entry.lua @@ -5,7 +5,7 @@ declare_plugin("DATIS", { "datis.dll", }, - version = "3.1.1", + version = "3.1.2", state = "installed", developerName = "github.com/rkusa", info = _("DATIS enables a DCS server with an SRS server running on the same machine (TCP=127.0.0.1) to get weather from the mission for stations and frequencies set in the mission editor, and then to report same in a standardized format over SRS using either the Amazon or Google text to speech engines."),