-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New EventCode API #32
Merged
Merged
Commits on Feb 8, 2024
-
Move `sameold::message::event` → `sameold::message::phenomenon` Move SignificanceLevel and errors to `sameold::message::significance` These moves do not impact the external API.
Configuration menu - View commit details
-
Copy full SHA for bc3da1e - Browse repository at this point
Copy the full SHA bc3da1eView commit details
Commits on Feb 22, 2024
-
sameold: overhaul Originator API
* Drop enum variant `WeatherService`, which was previously emitted if sameold could not determine if the originator was the NWS or Environment Canda. It's actually easy to tell: in Canada, SAME is only ever transmitted on Weatherradio stations. This means the station callsign will be an `EC/…` station. * Rename `Originator::as_str()` to `Originator::as_code_str()` for clarity * Support the "alternate" format code. * Originator is no longer `From<&str>`. Instead, it should be constructed via `Originator::from_org_and_call()`. * Originator now implements Default This is API-BREAKING for sameold. The samedec executable only reports the Display value, which is largely unchanged, but a `$SAMEDEC_ORIGINATOR` of "National Weather Service" will now be emitted instead of "Weather Service."
Configuration menu - View commit details
-
Copy full SHA for d48c218 - Browse repository at this point
Copy the full SHA d48c218View commit details -
sameold: message: infallible conversion to significance
* `SignificanceLevel::from()` constructs directly from significance code str. The conversion is infallible. A new `SignificanceLevel::Unknown` variant is returned when a significance level cannot be determined. It sorts higher than `Warning`. * The conversion from `str` to `SignificanceLevel` is now infallible. A new `SignificanceLevel::Unknown` variant, which is the new Default, represents cases when the significance level cannot be determined. * The UnknownSignificanceLevel is no longer required and is removed. * Renamed `SignificanceLevel::as_str()` → `SignificanceLevel::as_code_str()`. This method returns a one-character significance code. * The Unknown variant is the new Default. This is an API-BREAKING change.
Configuration menu - View commit details
-
Copy full SHA for 79eb1f9 - Browse repository at this point
Copy the full SHA 79eb1f9View commit details
Commits on Feb 23, 2024
-
sameold: message: EventCode API for more informative decodes
* The `EventCode` is now a struct which represents the combination of a `Phenomenon` and a `SignificanceLevel`. * The enum of all the SAME events is renamed to `Phenomenon`. * Phenomenon previously de-normalized into significance levels, like `TornadoWatch` and `TornadoWarning`, are represented as a single enum entry like `Tornado`. * Phenomenon from the 2022 revision of NWSI 10-1712 and more Canadian codes are added: * EAN: Renamed to National Emergency Message * NAT: National Audible Test * NST: National Silent Test * FSW: Flash Freeze Warning * FZW: Freeze Warning * HLS: Hurricane Local Statement * SQW: Snow Squall Warning * The alternate formatter for `EventCode` now displays only the phenomenon, like `Tornado`, without the significance level * The conversion of `EventCode` from str is now infallible. Drop the `UnrecognizedEventCode` error. * The `EventCodeIter` is not required and is dropped from the public API. * Fix bad code entry for ADR (Administrative Message) * Add dependency on `phf` This is an API-BREAKING change.
Configuration menu - View commit details
-
Copy full SHA for 03ff745 - Browse repository at this point
Copy the full SHA 03ff745View commit details -
samedec: update for breaking EventCode API
The new API is simpler and doesn't require matches for errors. The integration tests are also updated.
Configuration menu - View commit details
-
Copy full SHA for ec9f691 - Browse repository at this point
Copy the full SHA ec9f691View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.