Skip to content

Commit

Permalink
fix stations with dots in their name
Browse files Browse the repository at this point in the history
Fixes #103
  • Loading branch information
rkusa committed Jul 1, 2021
1 parent 47b5ee8 commit 7da13a2
Show file tree
Hide file tree
Showing 10 changed files with 48 additions and 14 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/datis-cmd/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "datis-cmd"
version = "3.1.1"
version = "3.1.2"
authors = ["Markus Ast <[email protected]>"]
edition = "2018"

Expand Down
2 changes: 1 addition & 1 deletion crates/datis-core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "datis-core"
version = "3.1.1"
version = "3.1.2"
authors = ["Markus Ast <[email protected]>"]
edition = "2018"

Expand Down
30 changes: 29 additions & 1 deletion crates/datis-core/src/extract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ pub fn extract_station_config_from_mission_description(
}

pub fn extract_atis_station_config(config: &str) -> Option<StationConfig> {
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();
Expand Down Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion crates/datis-module/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "datis"
version = "3.1.1"
version = "3.1.2"
authors = ["Markus Ast <[email protected]>"]
edition = "2018"

Expand Down
2 changes: 1 addition & 1 deletion crates/radio-station/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "dcs-radio-station"
version = "3.1.1"
version = "3.1.2"
authors = ["Markus Ast <[email protected]>"]
edition = "2018"

Expand Down
2 changes: 1 addition & 1 deletion crates/srs/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "srs"
version = "3.1.1"
version = "3.1.2"
authors = ["rkusa"]
edition = "2018"

Expand Down
2 changes: 1 addition & 1 deletion crates/win-tts/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "win-tts"
version = "3.1.1"
version = "3.1.2"
authors = ["Markus Ast <[email protected]>"]
edition = "2018"

Expand Down
2 changes: 1 addition & 1 deletion mod/Mods/services/DATIS/entry.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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."),
Expand Down

0 comments on commit 7da13a2

Please sign in to comment.