// @generated by `cargo xtask codegen` from the DATEX II 3.7 schemas. Do not edit.
//! Types of the DATEX II namespace `http://datex2.eu/schema/3/vms`.
//!
//! Names follow the standard; see <https://docs.datex2.eu/> for what each one means.
#[allow(unused_imports)]
use super::{common as com, common_extension as comx, location_referencing as loc, location_extension as locx, situation as sit, road_traffic_data as roa, parking as prk, energy_infrastructure as egi, afir_energy_infrastructure as aegi, facilities as fac, afir_facilities as afac, traffic_regulation as tro, controlled_zone as cz, traffic_management_plan as tmp, rerouting_management_enhanced as rer, urban_extensions as ubx, fault_and_status as fst, message_container as con, exchange_information as ex, information_management as inf, cis_information as cis};
#[allow(unused_imports)]
use crate::out::{Out, Pattern, Rules};
#[allow(unused_imports)]
use crate::json::{JsonReader, JsonWriter};
#[allow(unused_imports)]
use crate::{ErrorKind, WarningKind};
#[allow(unused_imports)]
use crate::xml::{Enumeration, Xml};
#[allow(unused_imports)]
use crate::{Date, DateTime, Decimal, Error, Extension, MultilingualString, Time};
/// XML enumeration `vms:ColourEnum`.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ColourEnum {
/// `amber`
Amber,
/// `blue`
Blue,
/// `green`
Green,
/// `red`
Red,
/// `white`
White,
/// `whiteYellow`
WhiteYellow,
/// A value outside the standard list.
Extended(String),
}
impl ColourEnum {
/// The value as written in a document.
pub fn as_str(&self) -> &str {
match self {
Self::Amber => "amber",
Self::Blue => "blue",
Self::Green => "green",
Self::Red => "red",
Self::White => "white",
Self::WhiteYellow => "whiteYellow",
Self::Extended(v) => v,
}
}
}
impl Enumeration for ColourEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"amber" => Some(Self::Amber),
"blue" => Some(Self::Blue),
"green" => Some(Self::Green),
"red" => Some(Self::Red),
"white" => Some(Self::White),
"whiteYellow" => Some(Self::WhiteYellow),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl ColourEnum {
/// The literal to write and, for a value outside the standard list, that value.
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
/// XML enumeration `vms:CompositePictogramEnum`.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum CompositePictogramEnum {
/// `conditionOnCurrentSectionAfterNextExit`
ConditionOnCurrentSectionAfterNextExit,
/// `conditionAtNextExit`
ConditionAtNextExit,
/// `conditionOnCurrentSectionAfterSecondtExit`
ConditionOnCurrentSectionAfterSecondtExit,
/// `conditionAtSecondExit`
ConditionAtSecondExit,
/// `restrictionOnCurrentSectionAfterNextExit`
RestrictionOnCurrentSectionAfterNextExit,
/// `restrictionAtNextExit`
RestrictionAtNextExit,
/// `restrictionOnCurrentSectionAfterSecondExit`
RestrictionOnCurrentSectionAfterSecondExit,
/// `restrictionAtSecondtExit`
RestrictionAtSecondtExit,
/// A value outside the standard list.
Extended(String),
}
impl CompositePictogramEnum {
/// The value as written in a document.
pub fn as_str(&self) -> &str {
match self {
Self::ConditionOnCurrentSectionAfterNextExit => "conditionOnCurrentSectionAfterNextExit",
Self::ConditionAtNextExit => "conditionAtNextExit",
Self::ConditionOnCurrentSectionAfterSecondtExit => "conditionOnCurrentSectionAfterSecondtExit",
Self::ConditionAtSecondExit => "conditionAtSecondExit",
Self::RestrictionOnCurrentSectionAfterNextExit => "restrictionOnCurrentSectionAfterNextExit",
Self::RestrictionAtNextExit => "restrictionAtNextExit",
Self::RestrictionOnCurrentSectionAfterSecondExit => "restrictionOnCurrentSectionAfterSecondExit",
Self::RestrictionAtSecondtExit => "restrictionAtSecondtExit",
Self::Extended(v) => v,
}
}
}
impl Enumeration for CompositePictogramEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"conditionOnCurrentSectionAfterNextExit" => Some(Self::ConditionOnCurrentSectionAfterNextExit),
"conditionAtNextExit" => Some(Self::ConditionAtNextExit),
"conditionOnCurrentSectionAfterSecondtExit" => Some(Self::ConditionOnCurrentSectionAfterSecondtExit),
"conditionAtSecondExit" => Some(Self::ConditionAtSecondExit),
"restrictionOnCurrentSectionAfterNextExit" => Some(Self::RestrictionOnCurrentSectionAfterNextExit),
"restrictionAtNextExit" => Some(Self::RestrictionAtNextExit),
"restrictionOnCurrentSectionAfterSecondExit" => Some(Self::RestrictionOnCurrentSectionAfterSecondExit),
"restrictionAtSecondtExit" => Some(Self::RestrictionAtSecondtExit),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl CompositePictogramEnum {
/// The literal to write and, for a value outside the standard list, that value.
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
/// XML enumeration `vms:DedicatedUsageEnum`.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum DedicatedUsageEnum {
/// `energyInformation`
EnergyInformation,
/// `inspectionArea`
InspectionArea,
/// `laneControlSystem`
LaneControlSystem,
/// `parkingInformation`
ParkingInformation,
/// `rampMetering`
RampMetering,
/// `tunnelManagement`
TunnelManagement,
/// `other`
Other,
/// A value outside the standard list.
Extended(String),
}
impl DedicatedUsageEnum {
/// The value as written in a document.
pub fn as_str(&self) -> &str {
match self {
Self::EnergyInformation => "energyInformation",
Self::InspectionArea => "inspectionArea",
Self::LaneControlSystem => "laneControlSystem",
Self::ParkingInformation => "parkingInformation",
Self::RampMetering => "rampMetering",
Self::TunnelManagement => "tunnelManagement",
Self::Other => "other",
Self::Extended(v) => v,
}
}
}
impl Enumeration for DedicatedUsageEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"energyInformation" => Some(Self::EnergyInformation),
"inspectionArea" => Some(Self::InspectionArea),
"laneControlSystem" => Some(Self::LaneControlSystem),
"parkingInformation" => Some(Self::ParkingInformation),
"rampMetering" => Some(Self::RampMetering),
"tunnelManagement" => Some(Self::TunnelManagement),
"other" => Some(Self::Other),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl DedicatedUsageEnum {
/// The literal to write and, for a value outside the standard list, that value.
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
/// XML enumeration `vms:DisplayedNumericalInformationTypeEnum`.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum DisplayedNumericalInformationTypeEnum {
/// `distance`
Distance,
/// `height`
Height,
/// `length`
Length,
/// `rateOfIncline`
RateOfIncline,
/// `sectionLength`
SectionLength,
/// `speed`
Speed,
/// `weight`
Weight,
/// `weightPerAxle`
WeightPerAxle,
/// `width`
Width,
/// A value outside the standard list.
Extended(String),
}
impl DisplayedNumericalInformationTypeEnum {
/// The value as written in a document.
pub fn as_str(&self) -> &str {
match self {
Self::Distance => "distance",
Self::Height => "height",
Self::Length => "length",
Self::RateOfIncline => "rateOfIncline",
Self::SectionLength => "sectionLength",
Self::Speed => "speed",
Self::Weight => "weight",
Self::WeightPerAxle => "weightPerAxle",
Self::Width => "width",
Self::Extended(v) => v,
}
}
}
impl Enumeration for DisplayedNumericalInformationTypeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"distance" => Some(Self::Distance),
"height" => Some(Self::Height),
"length" => Some(Self::Length),
"rateOfIncline" => Some(Self::RateOfIncline),
"sectionLength" => Some(Self::SectionLength),
"speed" => Some(Self::Speed),
"weight" => Some(Self::Weight),
"weightPerAxle" => Some(Self::WeightPerAxle),
"width" => Some(Self::Width),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl DisplayedNumericalInformationTypeEnum {
/// The literal to write and, for a value outside the standard list, that value.
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
/// XML simple type `vms:GddPictogramCategoryCode`.
pub type GddPictogramCategoryCode = u64;
/// XML enumeration `vms:GddServiceCategoryEnum`.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum GddServiceCategoryEnum {
/// `dangerWarning`
DangerWarning,
/// `regulatory`
Regulatory,
/// `informative`
Informative,
/// `publicFacilities`
PublicFacilities,
/// `ambientConditions`
AmbientConditions,
/// `roadConditions`
RoadConditions,
/// A value outside the standard list.
Extended(String),
}
impl GddServiceCategoryEnum {
/// The value as written in a document.
pub fn as_str(&self) -> &str {
match self {
Self::DangerWarning => "dangerWarning",
Self::Regulatory => "regulatory",
Self::Informative => "informative",
Self::PublicFacilities => "publicFacilities",
Self::AmbientConditions => "ambientConditions",
Self::RoadConditions => "roadConditions",
Self::Extended(v) => v,
}
}
}
impl Enumeration for GddServiceCategoryEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"dangerWarning" => Some(Self::DangerWarning),
"regulatory" => Some(Self::Regulatory),
"informative" => Some(Self::Informative),
"publicFacilities" => Some(Self::PublicFacilities),
"ambientConditions" => Some(Self::AmbientConditions),
"roadConditions" => Some(Self::RoadConditions),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl GddServiceCategoryEnum {
/// The literal to write and, for a value outside the standard list, that value.
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
/// XML enumeration `vms:ImageFormatEnum`.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ImageFormatEnum {
/// `bmp`
Bmp,
/// `gif`
Gif,
/// `jpeg`
Jpeg,
/// `png`
Png,
/// `tiff`
Tiff,
/// A value outside the standard list.
Extended(String),
}
impl ImageFormatEnum {
/// The value as written in a document.
pub fn as_str(&self) -> &str {
match self {
Self::Bmp => "bmp",
Self::Gif => "gif",
Self::Jpeg => "jpeg",
Self::Png => "png",
Self::Tiff => "tiff",
Self::Extended(v) => v,
}
}
}
impl Enumeration for ImageFormatEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"bmp" => Some(Self::Bmp),
"gif" => Some(Self::Gif),
"jpeg" => Some(Self::Jpeg),
"png" => Some(Self::Png),
"tiff" => Some(Self::Tiff),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl ImageFormatEnum {
/// The literal to write and, for a value outside the standard list, that value.
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
/// XML enumeration `vms:InformationTypeEnum`.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum InformationTypeEnum {
/// `situationInformation`
SituationInformation,
/// `warning`
Warning,
/// `prohibition`
Prohibition,
/// `obligation`
Obligation,
/// `destination`
Destination,
/// `travelTime`
TravelTime,
/// `delay`
Delay,
/// `location`
Location,
/// `vehicleType`
VehicleType,
/// `generalInformation`
GeneralInformation,
/// `blank`
Blank,
/// `other`
Other,
/// A value outside the standard list.
Extended(String),
}
impl InformationTypeEnum {
/// The value as written in a document.
pub fn as_str(&self) -> &str {
match self {
Self::SituationInformation => "situationInformation",
Self::Warning => "warning",
Self::Prohibition => "prohibition",
Self::Obligation => "obligation",
Self::Destination => "destination",
Self::TravelTime => "travelTime",
Self::Delay => "delay",
Self::Location => "location",
Self::VehicleType => "vehicleType",
Self::GeneralInformation => "generalInformation",
Self::Blank => "blank",
Self::Other => "other",
Self::Extended(v) => v,
}
}
}
impl Enumeration for InformationTypeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"situationInformation" => Some(Self::SituationInformation),
"warning" => Some(Self::Warning),
"prohibition" => Some(Self::Prohibition),
"obligation" => Some(Self::Obligation),
"destination" => Some(Self::Destination),
"travelTime" => Some(Self::TravelTime),
"delay" => Some(Self::Delay),
"location" => Some(Self::Location),
"vehicleType" => Some(Self::VehicleType),
"generalInformation" => Some(Self::GeneralInformation),
"blank" => Some(Self::Blank),
"other" => Some(Self::Other),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl InformationTypeEnum {
/// The literal to write and, for a value outside the standard list, that value.
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
/// XML enumeration `vms:MessageInformationTypeEnum`.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum MessageInformationTypeEnum {
/// `campaignMessage`
CampaignMessage,
/// `dateTime`
DateTime,
/// `futureInformation`
FutureInformation,
/// `instructionOrMessage`
InstructionOrMessage,
/// `situationWarning`
SituationWarning,
/// `temperature`
Temperature,
/// `trafficManagement`
TrafficManagement,
/// `travelTime`
TravelTime,
/// A value outside the standard list.
Extended(String),
}
impl MessageInformationTypeEnum {
/// The value as written in a document.
pub fn as_str(&self) -> &str {
match self {
Self::CampaignMessage => "campaignMessage",
Self::DateTime => "dateTime",
Self::FutureInformation => "futureInformation",
Self::InstructionOrMessage => "instructionOrMessage",
Self::SituationWarning => "situationWarning",
Self::Temperature => "temperature",
Self::TrafficManagement => "trafficManagement",
Self::TravelTime => "travelTime",
Self::Extended(v) => v,
}
}
}
impl Enumeration for MessageInformationTypeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"campaignMessage" => Some(Self::CampaignMessage),
"dateTime" => Some(Self::DateTime),
"futureInformation" => Some(Self::FutureInformation),
"instructionOrMessage" => Some(Self::InstructionOrMessage),
"situationWarning" => Some(Self::SituationWarning),
"temperature" => Some(Self::Temperature),
"trafficManagement" => Some(Self::TrafficManagement),
"travelTime" => Some(Self::TravelTime),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl MessageInformationTypeEnum {
/// The literal to write and, for a value outside the standard list, that value.
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
/// XML enumeration `vms:PhysicalSupportEnum`.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum PhysicalSupportEnum {
/// `centralReservationMounted`
CentralReservationMounted,
/// `gantryMounted`
GantryMounted,
/// `overheadBridgeMounted`
OverheadBridgeMounted,
/// `roadsideCantileverMounted`
RoadsideCantileverMounted,
/// `roadsideMounted`
RoadsideMounted,
/// `trailerMounted`
TrailerMounted,
/// `tunnelEntranceMounted`
TunnelEntranceMounted,
/// `vehicleMounted`
VehicleMounted,
/// A value outside the standard list.
Extended(String),
}
impl PhysicalSupportEnum {
/// The value as written in a document.
pub fn as_str(&self) -> &str {
match self {
Self::CentralReservationMounted => "centralReservationMounted",
Self::GantryMounted => "gantryMounted",
Self::OverheadBridgeMounted => "overheadBridgeMounted",
Self::RoadsideCantileverMounted => "roadsideCantileverMounted",
Self::RoadsideMounted => "roadsideMounted",
Self::TrailerMounted => "trailerMounted",
Self::TunnelEntranceMounted => "tunnelEntranceMounted",
Self::VehicleMounted => "vehicleMounted",
Self::Extended(v) => v,
}
}
}
impl Enumeration for PhysicalSupportEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"centralReservationMounted" => Some(Self::CentralReservationMounted),
"gantryMounted" => Some(Self::GantryMounted),
"overheadBridgeMounted" => Some(Self::OverheadBridgeMounted),
"roadsideCantileverMounted" => Some(Self::RoadsideCantileverMounted),
"roadsideMounted" => Some(Self::RoadsideMounted),
"trailerMounted" => Some(Self::TrailerMounted),
"tunnelEntranceMounted" => Some(Self::TunnelEntranceMounted),
"vehicleMounted" => Some(Self::VehicleMounted),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl PhysicalSupportEnum {
/// The literal to write and, for a value outside the standard list, that value.
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
/// XML enumeration `vms:PictogramEnum`.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum PictogramEnum {
/// `blankVoid`
BlankVoid,
/// `bridgeClosed`
BridgeClosed,
/// `carParkFull`
CarParkFull,
/// `carParkSpacesAvailable`
CarParkSpacesAvailable,
/// `corridorForEmergencyVehicleAccess`
CorridorForEmergencyVehicleAccess,
/// `curveArrowToLeft`
CurveArrowToLeft,
/// `curveArrowToRight`
CurveArrowToRight,
/// `dangerOfFire`
DangerOfFire,
/// `doubleExitToLeft`
DoubleExitToLeft,
/// `doubleExitToRight`
DoubleExitToRight,
/// `endOfAdvisorySpeed`
EndOfAdvisorySpeed,
/// `fastenChildrensSeatBelts`
FastenChildrensSeatBelts,
/// `fastenYourSeatBelt`
FastenYourSeatBelt,
/// `fire`
Fire,
/// `footballMatch`
FootballMatch,
/// `hardShoulderNotRunning`
HardShoulderNotRunning,
/// `hardShoulderRunning`
HardShoulderRunning,
/// `horizontalDiversionToLeft`
HorizontalDiversionToLeft,
/// `horizontalDiversionToRight`
HorizontalDiversionToRight,
/// `keepASafeDistance`
KeepASafeDistance,
/// `keepLeft`
KeepLeft,
/// `keepRight`
KeepRight,
/// `lane1ClosedOf2`
Lane1ClosedOf2,
/// `lane2ClosedOf2`
Lane2ClosedOf2,
/// `lane1ClosedOf3`
Lane1ClosedOf3,
/// `lane3ClosedOf3`
Lane3ClosedOf3,
/// `lanes1And2ClosedOf3`
Lanes1And2ClosedOf3,
/// `lanes2And3ClosedOf3`
Lanes2And3ClosedOf3,
/// `lane1ClosedOf4`
Lane1ClosedOf4,
/// `lane4ClosedOf4`
Lane4ClosedOf4,
/// `lanes1And2ClosedOf4`
Lanes1And2ClosedOf4,
/// `lanes3And4ClosedOf4`
Lanes3And4ClosedOf4,
/// `lanes1And2And3ClosedOf4`
Lanes1And2And3ClosedOf4,
/// `lanes2And3And4ClosedOf4`
Lanes2And3And4ClosedOf4,
/// `leftHandLaneClosed`
LeftHandLaneClosed,
/// `narrowLanesAhead`
NarrowLanesAhead,
/// `obliqueArrowToLeft`
ObliqueArrowToLeft,
/// `obliqueArrowToRight`
ObliqueArrowToRight,
/// `pollutionOrSmogAlert`
PollutionOrSmogAlert,
/// `rightHandLaneClosed`
RightHandLaneClosed,
/// `singleExitToLeft`
SingleExitToLeft,
/// `singleExitToRight`
SingleExitToRight,
/// `smoke`
Smoke,
/// `snowPloughInAction`
SnowPloughInAction,
/// `speedCamerasInAction`
SpeedCamerasInAction,
/// `straightVerticalArrow`
StraightVerticalArrow,
/// `trafficDeviatedToOppositeCarriagewayAhead`
TrafficDeviatedToOppositeCarriagewayAhead,
/// `trafficPartiallyDeviatedToOppositeCarriagewayAhead`
TrafficPartiallyDeviatedToOppositeCarriagewayAhead,
/// `tunnelClosed`
TunnelClosed,
/// `verticalDiversion`
VerticalDiversion,
/// `other`
Other,
/// A value outside the standard list.
Extended(String),
}
impl PictogramEnum {
/// The value as written in a document.
pub fn as_str(&self) -> &str {
match self {
Self::BlankVoid => "blankVoid",
Self::BridgeClosed => "bridgeClosed",
Self::CarParkFull => "carParkFull",
Self::CarParkSpacesAvailable => "carParkSpacesAvailable",
Self::CorridorForEmergencyVehicleAccess => "corridorForEmergencyVehicleAccess",
Self::CurveArrowToLeft => "curveArrowToLeft",
Self::CurveArrowToRight => "curveArrowToRight",
Self::DangerOfFire => "dangerOfFire",
Self::DoubleExitToLeft => "doubleExitToLeft",
Self::DoubleExitToRight => "doubleExitToRight",
Self::EndOfAdvisorySpeed => "endOfAdvisorySpeed",
Self::FastenChildrensSeatBelts => "fastenChildrensSeatBelts",
Self::FastenYourSeatBelt => "fastenYourSeatBelt",
Self::Fire => "fire",
Self::FootballMatch => "footballMatch",
Self::HardShoulderNotRunning => "hardShoulderNotRunning",
Self::HardShoulderRunning => "hardShoulderRunning",
Self::HorizontalDiversionToLeft => "horizontalDiversionToLeft",
Self::HorizontalDiversionToRight => "horizontalDiversionToRight",
Self::KeepASafeDistance => "keepASafeDistance",
Self::KeepLeft => "keepLeft",
Self::KeepRight => "keepRight",
Self::Lane1ClosedOf2 => "lane1ClosedOf2",
Self::Lane2ClosedOf2 => "lane2ClosedOf2",
Self::Lane1ClosedOf3 => "lane1ClosedOf3",
Self::Lane3ClosedOf3 => "lane3ClosedOf3",
Self::Lanes1And2ClosedOf3 => "lanes1And2ClosedOf3",
Self::Lanes2And3ClosedOf3 => "lanes2And3ClosedOf3",
Self::Lane1ClosedOf4 => "lane1ClosedOf4",
Self::Lane4ClosedOf4 => "lane4ClosedOf4",
Self::Lanes1And2ClosedOf4 => "lanes1And2ClosedOf4",
Self::Lanes3And4ClosedOf4 => "lanes3And4ClosedOf4",
Self::Lanes1And2And3ClosedOf4 => "lanes1And2And3ClosedOf4",
Self::Lanes2And3And4ClosedOf4 => "lanes2And3And4ClosedOf4",
Self::LeftHandLaneClosed => "leftHandLaneClosed",
Self::NarrowLanesAhead => "narrowLanesAhead",
Self::ObliqueArrowToLeft => "obliqueArrowToLeft",
Self::ObliqueArrowToRight => "obliqueArrowToRight",
Self::PollutionOrSmogAlert => "pollutionOrSmogAlert",
Self::RightHandLaneClosed => "rightHandLaneClosed",
Self::SingleExitToLeft => "singleExitToLeft",
Self::SingleExitToRight => "singleExitToRight",
Self::Smoke => "smoke",
Self::SnowPloughInAction => "snowPloughInAction",
Self::SpeedCamerasInAction => "speedCamerasInAction",
Self::StraightVerticalArrow => "straightVerticalArrow",
Self::TrafficDeviatedToOppositeCarriagewayAhead => "trafficDeviatedToOppositeCarriagewayAhead",
Self::TrafficPartiallyDeviatedToOppositeCarriagewayAhead => "trafficPartiallyDeviatedToOppositeCarriagewayAhead",
Self::TunnelClosed => "tunnelClosed",
Self::VerticalDiversion => "verticalDiversion",
Self::Other => "other",
Self::Extended(v) => v,
}
}
}
impl Enumeration for PictogramEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"blankVoid" => Some(Self::BlankVoid),
"bridgeClosed" => Some(Self::BridgeClosed),
"carParkFull" => Some(Self::CarParkFull),
"carParkSpacesAvailable" => Some(Self::CarParkSpacesAvailable),
"corridorForEmergencyVehicleAccess" => Some(Self::CorridorForEmergencyVehicleAccess),
"curveArrowToLeft" => Some(Self::CurveArrowToLeft),
"curveArrowToRight" => Some(Self::CurveArrowToRight),
"dangerOfFire" => Some(Self::DangerOfFire),
"doubleExitToLeft" => Some(Self::DoubleExitToLeft),
"doubleExitToRight" => Some(Self::DoubleExitToRight),
"endOfAdvisorySpeed" => Some(Self::EndOfAdvisorySpeed),
"fastenChildrensSeatBelts" => Some(Self::FastenChildrensSeatBelts),
"fastenYourSeatBelt" => Some(Self::FastenYourSeatBelt),
"fire" => Some(Self::Fire),
"footballMatch" => Some(Self::FootballMatch),
"hardShoulderNotRunning" => Some(Self::HardShoulderNotRunning),
"hardShoulderRunning" => Some(Self::HardShoulderRunning),
"horizontalDiversionToLeft" => Some(Self::HorizontalDiversionToLeft),
"horizontalDiversionToRight" => Some(Self::HorizontalDiversionToRight),
"keepASafeDistance" => Some(Self::KeepASafeDistance),
"keepLeft" => Some(Self::KeepLeft),
"keepRight" => Some(Self::KeepRight),
"lane1ClosedOf2" => Some(Self::Lane1ClosedOf2),
"lane2ClosedOf2" => Some(Self::Lane2ClosedOf2),
"lane1ClosedOf3" => Some(Self::Lane1ClosedOf3),
"lane3ClosedOf3" => Some(Self::Lane3ClosedOf3),
"lanes1And2ClosedOf3" => Some(Self::Lanes1And2ClosedOf3),
"lanes2And3ClosedOf3" => Some(Self::Lanes2And3ClosedOf3),
"lane1ClosedOf4" => Some(Self::Lane1ClosedOf4),
"lane4ClosedOf4" => Some(Self::Lane4ClosedOf4),
"lanes1And2ClosedOf4" => Some(Self::Lanes1And2ClosedOf4),
"lanes3And4ClosedOf4" => Some(Self::Lanes3And4ClosedOf4),
"lanes1And2And3ClosedOf4" => Some(Self::Lanes1And2And3ClosedOf4),
"lanes2And3And4ClosedOf4" => Some(Self::Lanes2And3And4ClosedOf4),
"leftHandLaneClosed" => Some(Self::LeftHandLaneClosed),
"narrowLanesAhead" => Some(Self::NarrowLanesAhead),
"obliqueArrowToLeft" => Some(Self::ObliqueArrowToLeft),
"obliqueArrowToRight" => Some(Self::ObliqueArrowToRight),
"pollutionOrSmogAlert" => Some(Self::PollutionOrSmogAlert),
"rightHandLaneClosed" => Some(Self::RightHandLaneClosed),
"singleExitToLeft" => Some(Self::SingleExitToLeft),
"singleExitToRight" => Some(Self::SingleExitToRight),
"smoke" => Some(Self::Smoke),
"snowPloughInAction" => Some(Self::SnowPloughInAction),
"speedCamerasInAction" => Some(Self::SpeedCamerasInAction),
"straightVerticalArrow" => Some(Self::StraightVerticalArrow),
"trafficDeviatedToOppositeCarriagewayAhead" => Some(Self::TrafficDeviatedToOppositeCarriagewayAhead),
"trafficPartiallyDeviatedToOppositeCarriagewayAhead" => Some(Self::TrafficPartiallyDeviatedToOppositeCarriagewayAhead),
"tunnelClosed" => Some(Self::TunnelClosed),
"verticalDiversion" => Some(Self::VerticalDiversion),
"other" => Some(Self::Other),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl PictogramEnum {
/// The literal to write and, for a value outside the standard list, that value.
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
/// XML enumeration `vms:PositionXAbsoluteEnum`.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum PositionXAbsoluteEnum {
/// `onLeft`
OnLeft,
/// `inTheMiddle`
InTheMiddle,
/// `onRight`
OnRight,
/// A value outside the standard list.
Extended(String),
}
impl PositionXAbsoluteEnum {
/// The value as written in a document.
pub fn as_str(&self) -> &str {
match self {
Self::OnLeft => "onLeft",
Self::InTheMiddle => "inTheMiddle",
Self::OnRight => "onRight",
Self::Extended(v) => v,
}
}
}
impl Enumeration for PositionXAbsoluteEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"onLeft" => Some(Self::OnLeft),
"inTheMiddle" => Some(Self::InTheMiddle),
"onRight" => Some(Self::OnRight),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl PositionXAbsoluteEnum {
/// The literal to write and, for a value outside the standard list, that value.
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
/// XML enumeration `vms:PositionXRelativeEnum`.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum PositionXRelativeEnum {
/// `toTheLeft`
ToTheLeft,
/// `alignedOnTheLeftSide`
AlignedOnTheLeftSide,
/// `centred`
Centred,
/// `alignedOnTheRightSide`
AlignedOnTheRightSide,
/// `toTheRight`
ToTheRight,
/// A value outside the standard list.
Extended(String),
}
impl PositionXRelativeEnum {
/// The value as written in a document.
pub fn as_str(&self) -> &str {
match self {
Self::ToTheLeft => "toTheLeft",
Self::AlignedOnTheLeftSide => "alignedOnTheLeftSide",
Self::Centred => "centred",
Self::AlignedOnTheRightSide => "alignedOnTheRightSide",
Self::ToTheRight => "toTheRight",
Self::Extended(v) => v,
}
}
}
impl Enumeration for PositionXRelativeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"toTheLeft" => Some(Self::ToTheLeft),
"alignedOnTheLeftSide" => Some(Self::AlignedOnTheLeftSide),
"centred" => Some(Self::Centred),
"alignedOnTheRightSide" => Some(Self::AlignedOnTheRightSide),
"toTheRight" => Some(Self::ToTheRight),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl PositionXRelativeEnum {
/// The literal to write and, for a value outside the standard list, that value.
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
/// XML enumeration `vms:PositionYAbsoluteEnum`.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum PositionYAbsoluteEnum {
/// `atTop`
AtTop,
/// `inTheMiddle`
InTheMiddle,
/// `atBottom`
AtBottom,
/// A value outside the standard list.
Extended(String),
}
impl PositionYAbsoluteEnum {
/// The value as written in a document.
pub fn as_str(&self) -> &str {
match self {
Self::AtTop => "atTop",
Self::InTheMiddle => "inTheMiddle",
Self::AtBottom => "atBottom",
Self::Extended(v) => v,
}
}
}
impl Enumeration for PositionYAbsoluteEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"atTop" => Some(Self::AtTop),
"inTheMiddle" => Some(Self::InTheMiddle),
"atBottom" => Some(Self::AtBottom),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl PositionYAbsoluteEnum {
/// The literal to write and, for a value outside the standard list, that value.
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
/// XML enumeration `vms:PositionYRelativeEnum`.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum PositionYRelativeEnum {
/// `above`
Above,
/// `alignedOnTheTopSide`
AlignedOnTheTopSide,
/// `centred`
Centred,
/// `alignedOnTheBottomSide`
AlignedOnTheBottomSide,
/// `below`
Below,
/// A value outside the standard list.
Extended(String),
}
impl PositionYRelativeEnum {
/// The value as written in a document.
pub fn as_str(&self) -> &str {
match self {
Self::Above => "above",
Self::AlignedOnTheTopSide => "alignedOnTheTopSide",
Self::Centred => "centred",
Self::AlignedOnTheBottomSide => "alignedOnTheBottomSide",
Self::Below => "below",
Self::Extended(v) => v,
}
}
}
impl Enumeration for PositionYRelativeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"above" => Some(Self::Above),
"alignedOnTheTopSide" => Some(Self::AlignedOnTheTopSide),
"centred" => Some(Self::Centred),
"alignedOnTheBottomSide" => Some(Self::AlignedOnTheBottomSide),
"below" => Some(Self::Below),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl PositionYRelativeEnum {
/// The literal to write and, for a value outside the standard list, that value.
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
/// XML enumeration `vms:SettingReasonEnum`.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum SettingReasonEnum {
/// `situation`
Situation,
/// `operatorCreated`
OperatorCreated,
/// `trafficManagement`
TrafficManagement,
/// `travelTime`
TravelTime,
/// `campaign`
Campaign,
/// `default`
Default,
/// A value outside the standard list.
Extended(String),
}
impl SettingReasonEnum {
/// The value as written in a document.
pub fn as_str(&self) -> &str {
match self {
Self::Situation => "situation",
Self::OperatorCreated => "operatorCreated",
Self::TrafficManagement => "trafficManagement",
Self::TravelTime => "travelTime",
Self::Campaign => "campaign",
Self::Default => "default",
Self::Extended(v) => v,
}
}
}
impl Enumeration for SettingReasonEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"situation" => Some(Self::Situation),
"operatorCreated" => Some(Self::OperatorCreated),
"trafficManagement" => Some(Self::TrafficManagement),
"travelTime" => Some(Self::TravelTime),
"campaign" => Some(Self::Campaign),
"default" => Some(Self::Default),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl SettingReasonEnum {
/// The literal to write and, for a value outside the standard list, that value.
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
/// XML enumeration `vms:SupplementalPictogramEnum`.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum SupplementalPictogramEnum {
/// `distanceToTheBeginningOfTheApplicationZone`
DistanceToTheBeginningOfTheApplicationZone,
/// `exceptAnyPowerDrivenVehicleDrawingTrailer`
ExceptAnyPowerDrivenVehicleDrawingTrailer,
/// `exceptBus`
ExceptBus,
/// `exceptGoodsVehicles`
ExceptGoodsVehicles,
/// `exceptSemitrailer`
ExceptSemitrailer,
/// `exceptVehiclesCarryingDangerousGoods`
ExceptVehiclesCarryingDangerousGoods,
/// `inCaseOfIceOrSnow`
InCaseOfIceOrSnow,
/// `lengthOfTheApplicationZone`
LengthOfTheApplicationZone,
/// `restrictedToAnyPowerDrivenVehicleDrawingTrailer`
RestrictedToAnyPowerDrivenVehicleDrawingTrailer,
/// `restrictedToBus`
RestrictedToBus,
/// `restrictedToGoodsVehicles`
RestrictedToGoodsVehicles,
/// `restrictedToSemiTrailer`
RestrictedToSemiTrailer,
/// `restrictedToVehiclesCarryingDangerousGoods`
RestrictedToVehiclesCarryingDangerousGoods,
/// `maintenanceVehicles`
MaintenanceVehicles,
/// `snowPloughs`
SnowPloughs,
/// `other`
Other,
/// A value outside the standard list.
Extended(String),
}
impl SupplementalPictogramEnum {
/// The value as written in a document.
pub fn as_str(&self) -> &str {
match self {
Self::DistanceToTheBeginningOfTheApplicationZone => "distanceToTheBeginningOfTheApplicationZone",
Self::ExceptAnyPowerDrivenVehicleDrawingTrailer => "exceptAnyPowerDrivenVehicleDrawingTrailer",
Self::ExceptBus => "exceptBus",
Self::ExceptGoodsVehicles => "exceptGoodsVehicles",
Self::ExceptSemitrailer => "exceptSemitrailer",
Self::ExceptVehiclesCarryingDangerousGoods => "exceptVehiclesCarryingDangerousGoods",
Self::InCaseOfIceOrSnow => "inCaseOfIceOrSnow",
Self::LengthOfTheApplicationZone => "lengthOfTheApplicationZone",
Self::RestrictedToAnyPowerDrivenVehicleDrawingTrailer => "restrictedToAnyPowerDrivenVehicleDrawingTrailer",
Self::RestrictedToBus => "restrictedToBus",
Self::RestrictedToGoodsVehicles => "restrictedToGoodsVehicles",
Self::RestrictedToSemiTrailer => "restrictedToSemiTrailer",
Self::RestrictedToVehiclesCarryingDangerousGoods => "restrictedToVehiclesCarryingDangerousGoods",
Self::MaintenanceVehicles => "maintenanceVehicles",
Self::SnowPloughs => "snowPloughs",
Self::Other => "other",
Self::Extended(v) => v,
}
}
}
impl Enumeration for SupplementalPictogramEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"distanceToTheBeginningOfTheApplicationZone" => Some(Self::DistanceToTheBeginningOfTheApplicationZone),
"exceptAnyPowerDrivenVehicleDrawingTrailer" => Some(Self::ExceptAnyPowerDrivenVehicleDrawingTrailer),
"exceptBus" => Some(Self::ExceptBus),
"exceptGoodsVehicles" => Some(Self::ExceptGoodsVehicles),
"exceptSemitrailer" => Some(Self::ExceptSemitrailer),
"exceptVehiclesCarryingDangerousGoods" => Some(Self::ExceptVehiclesCarryingDangerousGoods),
"inCaseOfIceOrSnow" => Some(Self::InCaseOfIceOrSnow),
"lengthOfTheApplicationZone" => Some(Self::LengthOfTheApplicationZone),
"restrictedToAnyPowerDrivenVehicleDrawingTrailer" => Some(Self::RestrictedToAnyPowerDrivenVehicleDrawingTrailer),
"restrictedToBus" => Some(Self::RestrictedToBus),
"restrictedToGoodsVehicles" => Some(Self::RestrictedToGoodsVehicles),
"restrictedToSemiTrailer" => Some(Self::RestrictedToSemiTrailer),
"restrictedToVehiclesCarryingDangerousGoods" => Some(Self::RestrictedToVehiclesCarryingDangerousGoods),
"maintenanceVehicles" => Some(Self::MaintenanceVehicles),
"snowPloughs" => Some(Self::SnowPloughs),
"other" => Some(Self::Other),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl SupplementalPictogramEnum {
/// The literal to write and, for a value outside the standard list, that value.
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
/// XML enumeration `vms:UnitOfMeasureEnum`.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum UnitOfMeasureEnum {
/// `feet`
Feet,
/// `feetAndInches`
FeetAndInches,
/// `kilometres`
Kilometres,
/// `kilometresPerHour`
KilometresPerHour,
/// `metres`
Metres,
/// `miles`
Miles,
/// `milesPerHour`
MilesPerHour,
/// `percentage`
Percentage,
/// `tonnes`
Tonnes,
/// `yards`
Yards,
/// A value outside the standard list.
Extended(String),
}
impl UnitOfMeasureEnum {
/// The value as written in a document.
pub fn as_str(&self) -> &str {
match self {
Self::Feet => "feet",
Self::FeetAndInches => "feetAndInches",
Self::Kilometres => "kilometres",
Self::KilometresPerHour => "kilometresPerHour",
Self::Metres => "metres",
Self::Miles => "miles",
Self::MilesPerHour => "milesPerHour",
Self::Percentage => "percentage",
Self::Tonnes => "tonnes",
Self::Yards => "yards",
Self::Extended(v) => v,
}
}
}
impl Enumeration for UnitOfMeasureEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"feet" => Some(Self::Feet),
"feetAndInches" => Some(Self::FeetAndInches),
"kilometres" => Some(Self::Kilometres),
"kilometresPerHour" => Some(Self::KilometresPerHour),
"metres" => Some(Self::Metres),
"miles" => Some(Self::Miles),
"milesPerHour" => Some(Self::MilesPerHour),
"percentage" => Some(Self::Percentage),
"tonnes" => Some(Self::Tonnes),
"yards" => Some(Self::Yards),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl UnitOfMeasureEnum {
/// The literal to write and, for a value outside the standard list, that value.
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
/// XML enumeration `vms:VmsControllerFaultEnum`.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum VmsControllerFaultEnum {
/// `communicationsFailure`
CommunicationsFailure,
/// `powerFailure`
PowerFailure,
/// `unknown`
Unknown,
/// `other`
Other,
/// A value outside the standard list.
Extended(String),
}
impl VmsControllerFaultEnum {
/// The value as written in a document.
pub fn as_str(&self) -> &str {
match self {
Self::CommunicationsFailure => "communicationsFailure",
Self::PowerFailure => "powerFailure",
Self::Unknown => "unknown",
Self::Other => "other",
Self::Extended(v) => v,
}
}
}
impl Enumeration for VmsControllerFaultEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"communicationsFailure" => Some(Self::CommunicationsFailure),
"powerFailure" => Some(Self::PowerFailure),
"unknown" => Some(Self::Unknown),
"other" => Some(Self::Other),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl VmsControllerFaultEnum {
/// The literal to write and, for a value outside the standard list, that value.
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
/// XML enumeration `vms:VmsFaultEnum`.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum VmsFaultEnum {
/// `incorrectMessageDisplayed`
IncorrectMessageDisplayed,
/// `incorrectPictogramDisplayed`
IncorrectPictogramDisplayed,
/// `outOfService`
OutOfService,
/// `unableToClearDown`
UnableToClearDown,
/// `unknown`
Unknown,
/// `other`
Other,
/// A value outside the standard list.
Extended(String),
}
impl VmsFaultEnum {
/// The value as written in a document.
pub fn as_str(&self) -> &str {
match self {
Self::IncorrectMessageDisplayed => "incorrectMessageDisplayed",
Self::IncorrectPictogramDisplayed => "incorrectPictogramDisplayed",
Self::OutOfService => "outOfService",
Self::UnableToClearDown => "unableToClearDown",
Self::Unknown => "unknown",
Self::Other => "other",
Self::Extended(v) => v,
}
}
}
impl Enumeration for VmsFaultEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"incorrectMessageDisplayed" => Some(Self::IncorrectMessageDisplayed),
"incorrectPictogramDisplayed" => Some(Self::IncorrectPictogramDisplayed),
"outOfService" => Some(Self::OutOfService),
"unableToClearDown" => Some(Self::UnableToClearDown),
"unknown" => Some(Self::Unknown),
"other" => Some(Self::Other),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl VmsFaultEnum {
/// The literal to write and, for a value outside the standard list, that value.
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
/// XML enumeration `vms:VmsTypeEnum`.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum VmsTypeEnum {
/// `colourGraphic`
ColourGraphic,
/// `rotatingPrismSign`
RotatingPrismSign,
/// `monochromeGraphic`
MonochromeGraphic,
/// `simpleMatrixSign`
SimpleMatrixSign,
/// `fullMatrixSign`
FullMatrixSign,
/// `rollerBlindSign`
RollerBlindSign,
/// `virtualVms`
VirtualVms,
/// `other`
Other,
/// A value outside the standard list.
Extended(String),
}
impl VmsTypeEnum {
/// The value as written in a document.
pub fn as_str(&self) -> &str {
match self {
Self::ColourGraphic => "colourGraphic",
Self::RotatingPrismSign => "rotatingPrismSign",
Self::MonochromeGraphic => "monochromeGraphic",
Self::SimpleMatrixSign => "simpleMatrixSign",
Self::FullMatrixSign => "fullMatrixSign",
Self::RollerBlindSign => "rollerBlindSign",
Self::VirtualVms => "virtualVms",
Self::Other => "other",
Self::Extended(v) => v,
}
}
}
impl Enumeration for VmsTypeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"colourGraphic" => Some(Self::ColourGraphic),
"rotatingPrismSign" => Some(Self::RotatingPrismSign),
"monochromeGraphic" => Some(Self::MonochromeGraphic),
"simpleMatrixSign" => Some(Self::SimpleMatrixSign),
"fullMatrixSign" => Some(Self::FullMatrixSign),
"rollerBlindSign" => Some(Self::RollerBlindSign),
"virtualVms" => Some(Self::VirtualVms),
"other" => Some(Self::Other),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl VmsTypeEnum {
/// The literal to write and, for a value outside the standard list, that value.
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
/// XML enumeration `vms:WorkingStatusEnum`.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum WorkingStatusEnum {
/// `blank`
Blank,
/// `covered`
Covered,
/// `notWorking`
NotWorking,
/// `working`
Working,
/// A value outside the standard list.
Extended(String),
}
impl WorkingStatusEnum {
/// The value as written in a document.
pub fn as_str(&self) -> &str {
match self {
Self::Blank => "blank",
Self::Covered => "covered",
Self::NotWorking => "notWorking",
Self::Working => "working",
Self::Extended(v) => v,
}
}
}
impl Enumeration for WorkingStatusEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"blank" => Some(Self::Blank),
"covered" => Some(Self::Covered),
"notWorking" => Some(Self::NotWorking),
"working" => Some(Self::Working),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl WorkingStatusEnum {
/// The literal to write and, for a value outside the standard list, that value.
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
/// XML type `vms:CompositePictogram`.
#[derive(Debug, Clone, Default, PartialEq)]
pub struct CompositePictogram {
/// XML element `vms:customPictogramCode`.
pub custom_pictogram_code: Option<String>,
/// XML element `vms:additionalDescription`.
pub additional_description: Option<MultilingualString>,
/// XML element `vms:pictogramFlashing`.
pub pictogram_flashing: Option<com::Boolean>,
/// XML element `vms:pictogramInInverseColour`.
pub pictogram_in_inverse_colour: Option<com::Boolean>,
/// XML element `vms:viennaConventionCompliant`.
pub vienna_convention_compliant: Option<com::Boolean>,
/// XML element `vms:pictogramInformationType`.
pub pictogram_information_type: Option<InformationTypeEnum>,
/// XML element `vms:gddStructure`.
pub gdd_structure: Option<Box<GddStructure>>,
/// XML element `vms:_pictogramExtension`.
pub pictogram_extension: Option<Box<Extension>>,
/// XML element `vms:pictogramDescription`.
pub pictogram_description: Option<CompositePictogramEnum>,
/// XML element `vms:regularPictogram`.
pub regular_pictogram: Option<Box<RegularPictogram>>,
/// XML element `vms:_compositePictogramExtension`.
pub composite_pictogram_extension: Option<Box<Extension>>,
}
impl CompositePictogram {
const FIELDS: &'static [u32] = &[0x170784, 0x1706b7, 0x170a7f, 0x170a80, 0x170cb2, 0x170a81, 0x170876, 0x17057d, 0x170a7d, 0x170b14, 0x17045c];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x170056);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = None;
let mut e7 = None;
let mut e8 = None;
let mut e9 = None;
let mut e10 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x170784 => { let v = r.string()?; r.set(&mut e0, v, 1924); }
0x1706b7 => { let v = r.multilingual()?; r.set(&mut e1, v, 1719); }
0x170a7f => { let v = r.value::<bool>()?; r.set(&mut e2, v, 2687); }
0x170a80 => { let v = r.value::<bool>()?; r.set(&mut e3, v, 2688); }
0x170cb2 => { let v = r.value::<bool>()?; r.set(&mut e4, v, 3250); }
0x170a81 => { let v = r.enumeration::<InformationTypeEnum>()?; r.set(&mut e5, v, 2689); }
0x170876 => { let v = Some(GddStructure::read(r)?); r.set(&mut e6, v.map(Box::new), 2166); }
0x17057d => { let v = r.raw()?; r.set(&mut e7, v.map(Box::new), 1405); }
0x170a7d => { let v = r.enumeration::<CompositePictogramEnum>()?; r.set(&mut e8, v, 2685); }
0x170b14 => { let v = Some(RegularPictogram::read(r)?); r.set(&mut e9, v.map(Box::new), 2836); }
0x17045c => { let v = r.raw()?; r.set(&mut e10, v.map(Box::new), 1116); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e8, 2685);
r.required(&e9, 2836);
let v = Self {
custom_pictogram_code: e0,
additional_description: e1,
pictogram_flashing: e2,
pictogram_in_inverse_colour: e3,
vienna_convention_compliant: e4,
pictogram_information_type: e5,
gdd_structure: e6,
pictogram_extension: e7,
pictogram_description: e8,
regular_pictogram: e9,
composite_pictogram_extension: e10,
};
r.close();
Ok(v)
}
}
impl CompositePictogram {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.custom_pictogram_code { w.max_len("customPictogramCode", "String", v, 1024)?; w.leaf("vms:customPictogramCode", v)?; }
if let Some(v) = &self.additional_description { w.multilingual("vms:additionalDescription", v)?; }
if let Some(v) = &self.pictogram_flashing { w.leaf("vms:pictogramFlashing", v)?; }
if let Some(v) = &self.pictogram_in_inverse_colour { w.leaf("vms:pictogramInInverseColour", v)?; }
if let Some(v) = &self.vienna_convention_compliant { w.leaf("vms:viennaConventionCompliant", v)?; }
if let Some(v) = &self.pictogram_information_type { w.enumeration("vms:pictogramInformationType", v.literal())?; }
if let Some(v) = &self.gdd_structure { v.write(w, "vms:gddStructure", "", "")?; }
if let Some(v) = &self.pictogram_extension { w.extension("vms:_pictogramExtension", v)?; }
match &self.pictogram_description {
Some(v) => { w.enumeration("vms:pictogramDescription", v.literal())?; }
None => return Err(w.missing("vms:pictogramDescription")),
}
match &self.regular_pictogram {
Some(v) => { v.write(w, "vms:regularPictogram", "", "")?; }
None => return Err(w.missing("vms:regularPictogram")),
}
if let Some(v) = &self.composite_pictogram_extension { w.extension("vms:_compositePictogramExtension", v)?; }
w.end(tag)
}
}
impl CompositePictogram {
pub(crate) fn read_json(r: &mut JsonReader<'_>) -> Result<Option<Self>, Error> {
if !r.begin_object()? {
return Ok(None);
}
Self::read_json_members(r, None).map(Some)
}
/// Reads the members of an object that is already open; `pending` is a member key read
/// already.
pub(crate) fn read_json_members(r: &mut JsonReader<'_>, mut pending: Option<u32>) -> Result<Self, Error> {
let mut seen = [false; 11];
let mut f0 = None;
let mut f1 = None;
let mut f2 = None;
let mut f3 = None;
let mut f4 = None;
let mut f5 = None;
let mut f6 = None;
let mut f7 = None;
let mut f8 = None;
let mut f9 = None;
let mut f10 = None;
loop {
let key = match pending.take() {
Some(key) => key,
None => match r.next_key()? {
Some(key) => key,
None => break,
},
};
match key {
482 => if r.first(&mut seen[0])? { f0 = r.string()?; },
59 => if r.first(&mut seen[1])? { f1 = r.multilingual()?; },
1585 => if r.first(&mut seen[2])? { f2 = r.boolean()?; },
1586 => if r.first(&mut seen[3])? { f3 = r.boolean()?; },
2583 => if r.first(&mut seen[4])? { f4 = r.boolean()?; },
1587 => if r.first(&mut seen[5])? { f5 = r.enumeration::<InformationTypeEnum>()?; },
911 => if r.first(&mut seen[6])? { f6 = GddStructure::read_json(r)?.map(Box::new); },
2620 => if r.first(&mut seen[7])? { f7 = r.raw_object()?.map(Box::new); },
1583 => if r.first(&mut seen[8])? { f8 = r.enumeration::<CompositePictogramEnum>()?; },
1836 => if r.first(&mut seen[9])? { f9 = RegularPictogram::read_json(r)?.map(Box::new); },
2588 => if r.first(&mut seen[10])? { f10 = r.raw_object()?.map(Box::new); },
_ => r.skip_unknown()?,
}
}
r.required(&f8, 1583);
r.required(&f9, 1836);
Ok(Self {
custom_pictogram_code: f0,
additional_description: f1,
pictogram_flashing: f2,
pictogram_in_inverse_colour: f3,
vienna_convention_compliant: f4,
pictogram_information_type: f5,
gdd_structure: f6,
pictogram_extension: f7,
pictogram_description: f8,
regular_pictogram: f9,
composite_pictogram_extension: f10,
})
}
pub(crate) fn write_json(&self, w: &mut JsonWriter<'_>, target_class: Option<&'static str>) -> Result<(), Error> {
w.begin_object(1054)?;
if let Some(class) = target_class {
w.target_class(class)?;
}
if let Some(v) = &self.custom_pictogram_code {
w.key(482)?;
w.max_len("customPictogramCode", "String", v, 1024)?; w.string(v)?;
}
if let Some(v) = &self.additional_description {
w.key(59)?;
w.multilingual(v)?;
}
if let Some(v) = &self.pictogram_flashing {
w.key(1585)?;
w.boolean(*v)?;
}
if let Some(v) = &self.pictogram_in_inverse_colour {
w.key(1586)?;
w.boolean(*v)?;
}
if let Some(v) = &self.vienna_convention_compliant {
w.key(2583)?;
w.boolean(*v)?;
}
if let Some(v) = &self.pictogram_information_type {
w.key(1587)?;
w.enumeration(1069, v.literal())?;
}
if let Some(v) = &self.gdd_structure {
w.key(911)?;
v.write_json(w, None)?;
}
if let Some(v) = &self.pictogram_extension {
w.key(2620)?;
w.extension(v)?;
}
match &self.pictogram_description {
Some(v) => {
w.key(1583)?;
w.enumeration(1055, v.literal())?;
}
None => w.absent(1583, w.missing("pictogramDescription"))?,
}
match &self.regular_pictogram {
Some(v) => {
w.key(1836)?;
v.write_json(w, None)?;
}
None => w.absent(1836, w.missing("regularPictogram"))?,
}
if let Some(v) = &self.composite_pictogram_extension {
w.key(2588)?;
w.extension(v)?;
}
w.end_object()
}
}
/// XML type `vms:DisplayArea`.
#[derive(Debug, Clone, Default, PartialEq)]
pub struct DisplayArea {
/// XML element `vms:sequencingCapable`.
pub sequencing_capable: Option<com::Boolean>,
/// XML element `vms:maxNumberOfSequentialPages`.
pub max_number_of_sequential_pages: Option<com::NonNegativeInteger>,
/// XML element `vms:positionXAbsolute`.
pub position_x_absolute: Option<PositionXAbsoluteEnum>,
/// XML element `vms:positionXRelativeToPrevious`.
pub position_x_relative_to_previous: Option<PositionXRelativeEnum>,
/// XML element `vms:positionYAbsolute`.
pub position_y_absolute: Option<PositionYAbsoluteEnum>,
/// XML element `vms:positionYRelativeToPrevious`.
pub position_y_relative_to_previous: Option<PositionYRelativeEnum>,
/// XML element `vms:displayGeometry`.
pub display_geometry: Option<Box<DisplayGeometry>>,
/// XML element `vms:overriddenLaneAssociation`.
pub overridden_lane_association: Vec<loc::Lane>,
/// XML element `vms:_displayAreaExtension`.
pub display_area_extension: Option<Box<Extension>>,
}
impl DisplayArea {
const FIELDS: &'static [u32] = &[0x170b7a, 0x17093f, 0x170a98, 0x170a99, 0x170a9b, 0x170a9c, 0x1707c8, 0x170a39, 0x170488];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x170083);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = None;
let mut e7 = Vec::new();
let mut e8 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x170b7a => { let v = r.value::<bool>()?; r.set(&mut e0, v, 2938); }
0x17093f => { let v = r.value::<u64>()?; r.set(&mut e1, v, 2367); }
0x170a98 => { let v = r.enumeration::<PositionXAbsoluteEnum>()?; r.set(&mut e2, v, 2712); }
0x170a99 => { let v = r.enumeration::<PositionXRelativeEnum>()?; r.set(&mut e3, v, 2713); }
0x170a9b => { let v = r.enumeration::<PositionYAbsoluteEnum>()?; r.set(&mut e4, v, 2715); }
0x170a9c => { let v = r.enumeration::<PositionYRelativeEnum>()?; r.set(&mut e5, v, 2716); }
0x1707c8 => { let v = Some(DisplayGeometry::read(r)?); r.set(&mut e6, v.map(Box::new), 1992); }
0x170a39 => { let v = Some(loc::Lane::read(r)?); e7.extend(v); }
0x170488 => { let v = r.raw()?; r.set(&mut e8, v.map(Box::new), 1160); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
sequencing_capable: e0,
max_number_of_sequential_pages: e1,
position_x_absolute: e2,
position_x_relative_to_previous: e3,
position_y_absolute: e4,
position_y_relative_to_previous: e5,
display_geometry: e6,
overridden_lane_association: e7,
display_area_extension: e8,
};
r.close();
Ok(v)
}
}
impl DisplayArea {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.sequencing_capable { w.leaf("vms:sequencingCapable", v)?; }
if let Some(v) = &self.max_number_of_sequential_pages { w.leaf("vms:maxNumberOfSequentialPages", v)?; }
if let Some(v) = &self.position_x_absolute { w.enumeration("vms:positionXAbsolute", v.literal())?; }
if let Some(v) = &self.position_x_relative_to_previous { w.enumeration("vms:positionXRelativeToPrevious", v.literal())?; }
if let Some(v) = &self.position_y_absolute { w.enumeration("vms:positionYAbsolute", v.literal())?; }
if let Some(v) = &self.position_y_relative_to_previous { w.enumeration("vms:positionYRelativeToPrevious", v.literal())?; }
if let Some(v) = &self.display_geometry { v.write(w, "vms:displayGeometry", "", "")?; }
for v in &self.overridden_lane_association { v.write(w, "vms:overriddenLaneAssociation", "", "")?; }
if let Some(v) = &self.display_area_extension { w.extension("vms:_displayAreaExtension", v)?; }
w.end(tag)
}
}
impl DisplayArea {
pub(crate) fn read_json(r: &mut JsonReader<'_>) -> Result<Option<Self>, Error> {
if !r.begin_object()? {
return Ok(None);
}
Self::read_json_members(r, None).map(Some)
}
/// Reads the members of an object that is already open; `pending` is a member key read
/// already.
pub(crate) fn read_json_members(r: &mut JsonReader<'_>, mut pending: Option<u32>) -> Result<Self, Error> {
let mut seen = [false; 9];
let mut f0 = None;
let mut f1 = None;
let mut f2 = None;
let mut f3 = None;
let mut f4 = None;
let mut f5 = None;
let mut f6 = None;
let mut f7 = Vec::new();
let mut f8 = None;
loop {
let key = match pending.take() {
Some(key) => key,
None => match r.next_key()? {
Some(key) => key,
None => break,
},
};
match key {
2025 => if r.first(&mut seen[0])? { f0 = r.boolean()?; },
1268 => if r.first(&mut seen[1])? { f1 = r.number::<u64>()?; },
1610 => if r.first(&mut seen[2])? { f2 = r.enumeration::<PositionXAbsoluteEnum>()?; },
1611 => if r.first(&mut seen[3])? { f3 = r.enumeration::<PositionXRelativeEnum>()?; },
1613 => if r.first(&mut seen[4])? { f4 = r.enumeration::<PositionYAbsoluteEnum>()?; },
1614 => if r.first(&mut seen[5])? { f5 = r.enumeration::<PositionYRelativeEnum>()?; },
577 => if r.first(&mut seen[6])? { f6 = DisplayGeometry::read_json(r)?.map(Box::new); },
1516 => if r.first(&mut seen[7])? { let mut l = r.list()?; while r.item(&mut l)? { if let Some(v) = loc::Lane::read_json(r)? { f7.push(v); } } },
2598 => if r.first(&mut seen[8])? { f8 = r.raw_object()?.map(Box::new); },
_ => r.skip_unknown()?,
}
}
Ok(Self {
sequencing_capable: f0,
max_number_of_sequential_pages: f1,
position_x_absolute: f2,
position_x_relative_to_previous: f3,
position_y_absolute: f4,
position_y_relative_to_previous: f5,
display_geometry: f6,
overridden_lane_association: f7,
display_area_extension: f8,
})
}
pub(crate) fn write_json(&self, w: &mut JsonWriter<'_>, target_class: Option<&'static str>) -> Result<(), Error> {
w.begin_object(1057)?;
if let Some(class) = target_class {
w.target_class(class)?;
}
if let Some(v) = &self.sequencing_capable {
w.key(2025)?;
w.boolean(*v)?;
}
if let Some(v) = &self.max_number_of_sequential_pages {
w.key(1268)?;
w.integer(*v)?;
}
if let Some(v) = &self.position_x_absolute {
w.key(1610)?;
w.enumeration(1078, v.literal())?;
}
if let Some(v) = &self.position_x_relative_to_previous {
w.key(1611)?;
w.enumeration(1079, v.literal())?;
}
if let Some(v) = &self.position_y_absolute {
w.key(1613)?;
w.enumeration(1080, v.literal())?;
}
if let Some(v) = &self.position_y_relative_to_previous {
w.key(1614)?;
w.enumeration(1081, v.literal())?;
}
if let Some(v) = &self.display_geometry {
w.key(577)?;
v.write_json(w, None)?;
}
if !self.overridden_lane_association.is_empty() {
w.key(1516)?;
w.begin_array()?;
for v in &self.overridden_lane_association {
w.item()?;
v.write_json(w, None)?;
}
w.end_array()?;
}
if let Some(v) = &self.display_area_extension {
w.key(2598)?;
w.extension(v)?;
}
w.end_object()
}
}
/// XML type `vms:DisplayGeometry`.
#[derive(Debug, Clone, Default, PartialEq)]
pub struct DisplayGeometry {
/// XML element `vms:pixelsAcross`.
pub pixels_across: Option<com::NonNegativeInteger>,
/// XML element `vms:pixelsDown`.
pub pixels_down: Option<com::NonNegativeInteger>,
/// XML element `vms:displayHeight`.
pub display_height: Option<com::MetresAsFloat>,
/// XML element `vms:displayWidth`.
pub display_width: Option<com::MetresAsFloat>,
/// XML element `vms:positionX`.
pub position_x: Option<com::MetresAsFloat>,
/// XML element `vms:positionY`.
pub position_y: Option<com::MetresAsFloat>,
/// XML element `vms:_displayGeometryExtension`.
pub display_geometry_extension: Option<Box<Extension>>,
}
impl DisplayGeometry {
const FIELDS: &'static [u32] = &[0x170a85, 0x170a86, 0x1707c9, 0x1707ca, 0x170a97, 0x170a9a, 0x17048a];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x170085);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x170a85 => { let v = r.value::<u64>()?; r.set(&mut e0, v, 2693); }
0x170a86 => { let v = r.value::<u64>()?; r.set(&mut e1, v, 2694); }
0x1707c9 => { let v = r.value::<f32>()?; r.set(&mut e2, v, 1993); }
0x1707ca => { let v = r.value::<f32>()?; r.set(&mut e3, v, 1994); }
0x170a97 => { let v = r.value::<f32>()?; r.set(&mut e4, v, 2711); }
0x170a9a => { let v = r.value::<f32>()?; r.set(&mut e5, v, 2714); }
0x17048a => { let v = r.raw()?; r.set(&mut e6, v.map(Box::new), 1162); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
pixels_across: e0,
pixels_down: e1,
display_height: e2,
display_width: e3,
position_x: e4,
position_y: e5,
display_geometry_extension: e6,
};
r.close();
Ok(v)
}
}
impl DisplayGeometry {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.pixels_across { w.leaf("vms:pixelsAcross", v)?; }
if let Some(v) = &self.pixels_down { w.leaf("vms:pixelsDown", v)?; }
if let Some(v) = &self.display_height { w.leaf("vms:displayHeight", v)?; }
if let Some(v) = &self.display_width { w.leaf("vms:displayWidth", v)?; }
if let Some(v) = &self.position_x { w.leaf("vms:positionX", v)?; }
if let Some(v) = &self.position_y { w.leaf("vms:positionY", v)?; }
if let Some(v) = &self.display_geometry_extension { w.extension("vms:_displayGeometryExtension", v)?; }
w.end(tag)
}
}
impl DisplayGeometry {
pub(crate) fn read_json(r: &mut JsonReader<'_>) -> Result<Option<Self>, Error> {
if !r.begin_object()? {
return Ok(None);
}
Self::read_json_members(r, None).map(Some)
}
/// Reads the members of an object that is already open; `pending` is a member key read
/// already.
pub(crate) fn read_json_members(r: &mut JsonReader<'_>, mut pending: Option<u32>) -> Result<Self, Error> {
let mut seen = [false; 7];
let mut f0 = None;
let mut f1 = None;
let mut f2 = None;
let mut f3 = None;
let mut f4 = None;
let mut f5 = None;
let mut f6 = None;
loop {
let key = match pending.take() {
Some(key) => key,
None => match r.next_key()? {
Some(key) => key,
None => break,
},
};
match key {
1591 => if r.first(&mut seen[0])? { f0 = r.number::<u64>()?; },
1592 => if r.first(&mut seen[1])? { f1 = r.number::<u64>()?; },
578 => if r.first(&mut seen[2])? { f2 = r.number::<f32>()?; },
579 => if r.first(&mut seen[3])? { f3 = r.number::<f32>()?; },
1609 => if r.first(&mut seen[4])? { f4 = r.number::<f32>()?; },
1612 => if r.first(&mut seen[5])? { f5 = r.number::<f32>()?; },
2600 => if r.first(&mut seen[6])? { f6 = r.raw_object()?.map(Box::new); },
_ => r.skip_unknown()?,
}
}
Ok(Self {
pixels_across: f0,
pixels_down: f1,
display_height: f2,
display_width: f3,
position_x: f4,
position_y: f5,
display_geometry_extension: f6,
})
}
pub(crate) fn write_json(&self, w: &mut JsonWriter<'_>, target_class: Option<&'static str>) -> Result<(), Error> {
w.begin_object(1060)?;
if let Some(class) = target_class {
w.target_class(class)?;
}
if let Some(v) = &self.pixels_across {
w.key(1591)?;
w.integer(*v)?;
}
if let Some(v) = &self.pixels_down {
w.key(1592)?;
w.integer(*v)?;
}
if let Some(v) = &self.display_height {
w.key(578)?;
w.float32(*v)?;
}
if let Some(v) = &self.display_width {
w.key(579)?;
w.float32(*v)?;
}
if let Some(v) = &self.position_x {
w.key(1609)?;
w.float32(*v)?;
}
if let Some(v) = &self.position_y {
w.key(1612)?;
w.float32(*v)?;
}
if let Some(v) = &self.display_geometry_extension {
w.key(2600)?;
w.extension(v)?;
}
w.end_object()
}
}
/// XML type `vms:DisplayedNumericalInformation`.
#[derive(Debug, Clone, Default, PartialEq)]
pub struct DisplayedNumericalInformation {
/// XML element `vms:numericalInformationType`.
pub numerical_information_type: Option<DisplayedNumericalInformationTypeEnum>,
/// XML element `vms:numericValue`.
pub numeric_value: Option<Decimal>,
/// XML element `vms:unitOfMeasure`.
pub unit_of_measure: Option<UnitOfMeasureEnum>,
/// XML element `vms:_displayedNumericalInformationExtension`.
pub displayed_numerical_information_extension: Option<Box<Extension>>,
}
impl DisplayedNumericalInformation {
const FIELDS: &'static [u32] = &[0x1709d5, 0x1709d3, 0x170c68, 0x17048b];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x170086);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x1709d5 => { let v = r.enumeration::<DisplayedNumericalInformationTypeEnum>()?; r.set(&mut e0, v, 2517); }
0x1709d3 => { let v = r.value::<Decimal>()?; r.set(&mut e1, v, 2515); }
0x170c68 => { let v = r.enumeration::<UnitOfMeasureEnum>()?; r.set(&mut e2, v, 3176); }
0x17048b => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1163); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 2517);
r.required(&e1, 2515);
r.required(&e2, 3176);
let v = Self {
numerical_information_type: e0,
numeric_value: e1,
unit_of_measure: e2,
displayed_numerical_information_extension: e3,
};
r.close();
Ok(v)
}
}
impl DisplayedNumericalInformation {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.numerical_information_type {
Some(v) => { w.enumeration("vms:numericalInformationType", v.literal())?; }
None => return Err(w.missing("vms:numericalInformationType")),
}
match &self.numeric_value {
Some(v) => { w.leaf("vms:numericValue", v)?; }
None => return Err(w.missing("vms:numericValue")),
}
match &self.unit_of_measure {
Some(v) => { w.enumeration("vms:unitOfMeasure", v.literal())?; }
None => return Err(w.missing("vms:unitOfMeasure")),
}
if let Some(v) = &self.displayed_numerical_information_extension { w.extension("vms:_displayedNumericalInformationExtension", v)?; }
w.end(tag)
}
}
impl DisplayedNumericalInformation {
pub(crate) fn read_json(r: &mut JsonReader<'_>) -> Result<Option<Self>, Error> {
if !r.begin_object()? {
return Ok(None);
}
Self::read_json_members(r, None).map(Some)
}
/// Reads the members of an object that is already open; `pending` is a member key read
/// already.
pub(crate) fn read_json_members(r: &mut JsonReader<'_>, mut pending: Option<u32>) -> Result<Self, Error> {
let mut seen = [false; 4];
let mut f0 = None;
let mut f1 = None;
let mut f2 = None;
let mut f3 = None;
loop {
let key = match pending.take() {
Some(key) => key,
None => match r.next_key()? {
Some(key) => key,
None => break,
},
};
match key {
1417 => if r.first(&mut seen[0])? { f0 = r.enumeration::<DisplayedNumericalInformationTypeEnum>()?; },
1415 => if r.first(&mut seen[1])? { f1 = r.number::<Decimal>()?; },
2509 => if r.first(&mut seen[2])? { f2 = r.enumeration::<UnitOfMeasureEnum>()?; },
2601 => if r.first(&mut seen[3])? { f3 = r.raw_object()?.map(Box::new); },
_ => r.skip_unknown()?,
}
}
r.required(&f0, 1417);
r.required(&f1, 1415);
r.required(&f2, 2509);
Ok(Self {
numerical_information_type: f0,
numeric_value: f1,
unit_of_measure: f2,
displayed_numerical_information_extension: f3,
})
}
pub(crate) fn write_json(&self, w: &mut JsonWriter<'_>, target_class: Option<&'static str>) -> Result<(), Error> {
w.begin_object(1061)?;
if let Some(class) = target_class {
w.target_class(class)?;
}
match &self.numerical_information_type {
Some(v) => {
w.key(1417)?;
w.enumeration(1062, v.literal())?;
}
None => w.absent(1417, w.missing("numericalInformationType"))?,
}
match &self.numeric_value {
Some(v) => {
w.key(1415)?;
w.decimal(v)?;
}
None => w.absent(1415, w.missing("numericValue"))?,
}
match &self.unit_of_measure {
Some(v) => {
w.key(2509)?;
w.enumeration(1092, v.literal())?;
}
None => w.absent(2509, w.missing("unitOfMeasure"))?,
}
if let Some(v) = &self.displayed_numerical_information_extension {
w.key(2601)?;
w.extension(v)?;
}
w.end_object()
}
}
/// XML type `vms:GddPictogramAttributes`.
#[derive(Debug, Clone, Default, PartialEq)]
pub struct GddPictogramAttributes {
/// XML element `vms:attributes`.
pub attributes: Option<com::Base64Binary>,
/// XML element `vms:_gddPictogramAttributesExtension`.
pub gdd_pictogram_attributes_extension: Option<Box<Extension>>,
}
impl GddPictogramAttributes {
const FIELDS: &'static [u32] = &[0x1706fe, 0x1704c1];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x1700bd);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x1706fe => { let v = r.base64()?; r.set(&mut e0, v, 1790); }
0x1704c1 => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1217); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 1790);
let v = Self {
attributes: e0,
gdd_pictogram_attributes_extension: e1,
};
r.close();
Ok(v)
}
}
impl GddPictogramAttributes {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.attributes {
Some(v) => { w.leaf("vms:attributes", v)?; }
None => return Err(w.missing("vms:attributes")),
}
if let Some(v) = &self.gdd_pictogram_attributes_extension { w.extension("vms:_gddPictogramAttributesExtension", v)?; }
w.end(tag)
}
}
impl GddPictogramAttributes {
pub(crate) fn read_json(r: &mut JsonReader<'_>) -> Result<Option<Self>, Error> {
if !r.begin_object()? {
return Ok(None);
}
Self::read_json_members(r, None).map(Some)
}
/// Reads the members of an object that is already open; `pending` is a member key read
/// already.
pub(crate) fn read_json_members(r: &mut JsonReader<'_>, mut pending: Option<u32>) -> Result<Self, Error> {
let mut seen = [false; 2];
let mut f0 = None;
let mut f1 = None;
loop {
let key = match pending.take() {
Some(key) => key,
None => match r.next_key()? {
Some(key) => key,
None => break,
},
};
match key {
265 => if r.first(&mut seen[0])? { f0 = r.base64()?; },
2604 => if r.first(&mut seen[1])? { f1 = r.raw_object()?.map(Box::new); },
_ => r.skip_unknown()?,
}
}
r.required(&f0, 265);
Ok(Self {
attributes: f0,
gdd_pictogram_attributes_extension: f1,
})
}
pub(crate) fn write_json(&self, w: &mut JsonWriter<'_>, target_class: Option<&'static str>) -> Result<(), Error> {
w.begin_object(1063)?;
if let Some(class) = target_class {
w.target_class(class)?;
}
match &self.attributes {
Some(v) => {
w.key(265)?;
w.base64(v)?;
}
None => w.absent(265, w.missing("attributes"))?,
}
if let Some(v) = &self.gdd_pictogram_attributes_extension {
w.key(2604)?;
w.extension(v)?;
}
w.end_object()
}
}
/// XML type `vms:GddPictogramIdentification`.
#[derive(Debug, Clone, Default, PartialEq)]
pub struct GddPictogramIdentification {
/// XML element `vms:country`.
pub country: Option<com::CountryCode>,
/// XML element `vms:serviceCategory`.
pub service_category: Option<GddServiceCategoryEnum>,
/// XML element `vms:pictogramCategoryCode`.
pub pictogram_category_code: Option<GddPictogramCategoryCode>,
/// XML element `vms:_gddPictogramIdentificationExtension`.
pub gdd_pictogram_identification_extension: Option<Box<Extension>>,
}
impl GddPictogramIdentification {
const FIELDS: &'static [u32] = &[0x170776, 0x170b7e, 0x170a7a, 0x1704c2];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x1700be);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x170776 => { let v = r.string()?; r.set(&mut e0, v, 1910); }
0x170b7e => { let v = r.enumeration::<GddServiceCategoryEnum>()?; r.set(&mut e1, v, 2942); }
0x170a7a => { let v = r.value::<u64>()?; r.set(&mut e2, v, 2682); }
0x1704c2 => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1218); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 1910);
r.required(&e1, 2942);
r.required(&e2, 2682);
let v = Self {
country: e0,
service_category: e1,
pictogram_category_code: e2,
gdd_pictogram_identification_extension: e3,
};
r.close();
Ok(v)
}
}
impl GddPictogramIdentification {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.country {
Some(v) => { w.max_len("country", "CountryCode", v, 2)?; w.leaf("vms:country", v)?; }
None => return Err(w.missing("vms:country")),
}
match &self.service_category {
Some(v) => { w.enumeration("vms:serviceCategory", v.literal())?; }
None => return Err(w.missing("vms:serviceCategory")),
}
match &self.pictogram_category_code {
Some(v) => { w.leaf("vms:pictogramCategoryCode", v)?; }
None => return Err(w.missing("vms:pictogramCategoryCode")),
}
if let Some(v) = &self.gdd_pictogram_identification_extension { w.extension("vms:_gddPictogramIdentificationExtension", v)?; }
w.end(tag)
}
}
impl GddPictogramIdentification {
pub(crate) fn read_json(r: &mut JsonReader<'_>) -> Result<Option<Self>, Error> {
if !r.begin_object()? {
return Ok(None);
}
Self::read_json_members(r, None).map(Some)
}
/// Reads the members of an object that is already open; `pending` is a member key read
/// already.
pub(crate) fn read_json_members(r: &mut JsonReader<'_>, mut pending: Option<u32>) -> Result<Self, Error> {
let mut seen = [false; 4];
let mut f0 = None;
let mut f1 = None;
let mut f2 = None;
let mut f3 = None;
loop {
let key = match pending.take() {
Some(key) => key,
None => match r.next_key()? {
Some(key) => key,
None => break,
},
};
match key {
468 => if r.first(&mut seen[0])? { f0 = r.string()?; },
2029 => if r.first(&mut seen[1])? { f1 = r.enumeration::<GddServiceCategoryEnum>()?; },
1580 => if r.first(&mut seen[2])? { f2 = r.number::<u64>()?; },
2605 => if r.first(&mut seen[3])? { f3 = r.raw_object()?.map(Box::new); },
_ => r.skip_unknown()?,
}
}
r.required(&f0, 468);
r.required(&f1, 2029);
r.required(&f2, 1580);
Ok(Self {
country: f0,
service_category: f1,
pictogram_category_code: f2,
gdd_pictogram_identification_extension: f3,
})
}
pub(crate) fn write_json(&self, w: &mut JsonWriter<'_>, target_class: Option<&'static str>) -> Result<(), Error> {
w.begin_object(1064)?;
if let Some(class) = target_class {
w.target_class(class)?;
}
match &self.country {
Some(v) => {
w.key(468)?;
w.max_len("country", "CountryCode", v, 2)?; w.string(v)?;
}
None => w.absent(468, w.missing("country"))?,
}
match &self.service_category {
Some(v) => {
w.key(2029)?;
w.enumeration(1065, v.literal())?;
}
None => w.absent(2029, w.missing("serviceCategory"))?,
}
match &self.pictogram_category_code {
Some(v) => {
w.key(1580)?;
w.integer(*v)?;
}
None => w.absent(1580, w.missing("pictogramCategoryCode"))?,
}
if let Some(v) = &self.gdd_pictogram_identification_extension {
w.key(2605)?;
w.extension(v)?;
}
w.end_object()
}
}
/// XML type `vms:GddStructure`.
#[derive(Debug, Clone, Default, PartialEq)]
pub struct GddStructure {
/// XML element `vms:gddPictogramIdentification`.
pub gdd_pictogram_identification: Option<Box<GddPictogramIdentification>>,
/// XML element `vms:gddPictogramAttributes`.
pub gdd_pictogram_attributes: Option<Box<GddPictogramAttributes>>,
/// XML element `vms:_gddStructureExtension`.
pub gdd_structure_extension: Option<Box<Extension>>,
}
impl GddStructure {
const FIELDS: &'static [u32] = &[0x170875, 0x170874, 0x1704c3];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x1700bf);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x170875 => { let v = Some(GddPictogramIdentification::read(r)?); r.set(&mut e0, v.map(Box::new), 2165); }
0x170874 => { let v = Some(GddPictogramAttributes::read(r)?); r.set(&mut e1, v.map(Box::new), 2164); }
0x1704c3 => { let v = r.raw()?; r.set(&mut e2, v.map(Box::new), 1219); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 2165);
let v = Self {
gdd_pictogram_identification: e0,
gdd_pictogram_attributes: e1,
gdd_structure_extension: e2,
};
r.close();
Ok(v)
}
}
impl GddStructure {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.gdd_pictogram_identification {
Some(v) => { v.write(w, "vms:gddPictogramIdentification", "", "")?; }
None => return Err(w.missing("vms:gddPictogramIdentification")),
}
if let Some(v) = &self.gdd_pictogram_attributes { v.write(w, "vms:gddPictogramAttributes", "", "")?; }
if let Some(v) = &self.gdd_structure_extension { w.extension("vms:_gddStructureExtension", v)?; }
w.end(tag)
}
}
impl GddStructure {
pub(crate) fn read_json(r: &mut JsonReader<'_>) -> Result<Option<Self>, Error> {
if !r.begin_object()? {
return Ok(None);
}
Self::read_json_members(r, None).map(Some)
}
/// Reads the members of an object that is already open; `pending` is a member key read
/// already.
pub(crate) fn read_json_members(r: &mut JsonReader<'_>, mut pending: Option<u32>) -> Result<Self, Error> {
let mut seen = [false; 3];
let mut f0 = None;
let mut f1 = None;
let mut f2 = None;
loop {
let key = match pending.take() {
Some(key) => key,
None => match r.next_key()? {
Some(key) => key,
None => break,
},
};
match key {
910 => if r.first(&mut seen[0])? { f0 = GddPictogramIdentification::read_json(r)?.map(Box::new); },
909 => if r.first(&mut seen[1])? { f1 = GddPictogramAttributes::read_json(r)?.map(Box::new); },
2606 => if r.first(&mut seen[2])? { f2 = r.raw_object()?.map(Box::new); },
_ => r.skip_unknown()?,
}
}
r.required(&f0, 910);
Ok(Self {
gdd_pictogram_identification: f0,
gdd_pictogram_attributes: f1,
gdd_structure_extension: f2,
})
}
pub(crate) fn write_json(&self, w: &mut JsonWriter<'_>, target_class: Option<&'static str>) -> Result<(), Error> {
w.begin_object(1066)?;
if let Some(class) = target_class {
w.target_class(class)?;
}
match &self.gdd_pictogram_identification {
Some(v) => {
w.key(910)?;
v.write_json(w, None)?;
}
None => w.absent(910, w.missing("gddPictogramIdentification"))?,
}
if let Some(v) = &self.gdd_pictogram_attributes {
w.key(909)?;
v.write_json(w, None)?;
}
if let Some(v) = &self.gdd_structure_extension {
w.key(2606)?;
w.extension(v)?;
}
w.end_object()
}
}
/// XML type `vms:Image`.
#[derive(Debug, Clone, Default, PartialEq)]
pub struct Image {
/// XML element `vms:imageData`.
pub image_data: Option<com::Base64Binary>,
/// XML element `vms:imageFormat`.
pub image_format: Option<ImageFormatEnum>,
/// XML element `vms:_imageExtension`.
pub image_extension: Option<Box<Extension>>,
}
impl Image {
const FIELDS: &'static [u32] = &[0x1708b2, 0x1708b3, 0x1704e5];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x1700e0);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x1708b2 => { let v = r.base64()?; r.set(&mut e0, v, 2226); }
0x1708b3 => { let v = r.enumeration::<ImageFormatEnum>()?; r.set(&mut e1, v, 2227); }
0x1704e5 => { let v = r.raw()?; r.set(&mut e2, v.map(Box::new), 1253); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 2226);
r.required(&e1, 2227);
let v = Self {
image_data: e0,
image_format: e1,
image_extension: e2,
};
r.close();
Ok(v)
}
}
impl Image {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.image_data {
Some(v) => { w.leaf("vms:imageData", v)?; }
None => return Err(w.missing("vms:imageData")),
}
match &self.image_format {
Some(v) => { w.enumeration("vms:imageFormat", v.literal())?; }
None => return Err(w.missing("vms:imageFormat")),
}
if let Some(v) = &self.image_extension { w.extension("vms:_imageExtension", v)?; }
w.end(tag)
}
}
impl Image {
pub(crate) fn read_json(r: &mut JsonReader<'_>) -> Result<Option<Self>, Error> {
if !r.begin_object()? {
return Ok(None);
}
Self::read_json_members(r, None).map(Some)
}
/// Reads the members of an object that is already open; `pending` is a member key read
/// already.
pub(crate) fn read_json_members(r: &mut JsonReader<'_>, mut pending: Option<u32>) -> Result<Self, Error> {
let mut seen = [false; 3];
let mut f0 = None;
let mut f1 = None;
let mut f2 = None;
loop {
let key = match pending.take() {
Some(key) => key,
None => match r.next_key()? {
Some(key) => key,
None => break,
},
};
match key {
971 => if r.first(&mut seen[0])? { f0 = r.base64()?; },
972 => if r.first(&mut seen[1])? { f1 = r.enumeration::<ImageFormatEnum>()?; },
2607 => if r.first(&mut seen[2])? { f2 = r.raw_object()?.map(Box::new); },
_ => r.skip_unknown()?,
}
}
r.required(&f0, 971);
r.required(&f1, 972);
Ok(Self {
image_data: f0,
image_format: f1,
image_extension: f2,
})
}
pub(crate) fn write_json(&self, w: &mut JsonWriter<'_>, target_class: Option<&'static str>) -> Result<(), Error> {
w.begin_object(1067)?;
if let Some(class) = target_class {
w.target_class(class)?;
}
match &self.image_data {
Some(v) => {
w.key(971)?;
w.base64(v)?;
}
None => w.absent(971, w.missing("imageData"))?,
}
match &self.image_format {
Some(v) => {
w.key(972)?;
w.enumeration(1068, v.literal())?;
}
None => w.absent(972, w.missing("imageFormat"))?,
}
if let Some(v) = &self.image_extension {
w.key(2607)?;
w.extension(v)?;
}
w.end_object()
}
}
/// XML type `vms:ManagedLogicalLocation`.
#[derive(Debug, Clone, Default, PartialEq)]
pub struct ManagedLogicalLocation {
/// XML element `vms:managedLogicalLocation`.
pub managed_logical_location: Option<MultilingualString>,
/// XML element `vms:distanceFromLogicalLocation`.
pub distance_from_logical_location: Option<com::MetresAsNonNegativeInteger>,
/// XML element `vms:managedLocation`.
pub managed_location: Option<loc::Location>,
/// XML element `vms:_managedLogicalLocationExtension`.
pub managed_logical_location_extension: Option<Box<Extension>>,
}
impl ManagedLogicalLocation {
const FIELDS: &'static [u32] = &[0x170930, 0x1707d0, 0x17092f, 0x170509];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x170106);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x170930 => { let v = r.multilingual()?; r.set(&mut e0, v, 2352); }
0x1707d0 => { let v = r.value::<u64>()?; r.set(&mut e1, v, 2000); }
0x17092f => { let v = loc::Location::read(r)?; r.set(&mut e2, v, 2351); }
0x170509 => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1289); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
managed_logical_location: e0,
distance_from_logical_location: e1,
managed_location: e2,
managed_logical_location_extension: e3,
};
r.close();
Ok(v)
}
}
impl ManagedLogicalLocation {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.managed_logical_location { w.multilingual("vms:managedLogicalLocation", v)?; }
if let Some(v) = &self.distance_from_logical_location { w.leaf("vms:distanceFromLogicalLocation", v)?; }
if let Some(v) = &self.managed_location { v.write(w, "vms:managedLocation")?; }
if let Some(v) = &self.managed_logical_location_extension { w.extension("vms:_managedLogicalLocationExtension", v)?; }
w.end(tag)
}
}
impl ManagedLogicalLocation {
pub(crate) fn read_json(r: &mut JsonReader<'_>) -> Result<Option<Self>, Error> {
if !r.begin_object()? {
return Ok(None);
}
Self::read_json_members(r, None).map(Some)
}
/// Reads the members of an object that is already open; `pending` is a member key read
/// already.
pub(crate) fn read_json_members(r: &mut JsonReader<'_>, mut pending: Option<u32>) -> Result<Self, Error> {
let mut seen = [false; 4];
let mut f0 = None;
let mut f1 = None;
let mut f2 = None;
let mut f3 = None;
loop {
let key = match pending.take() {
Some(key) => key,
None => match r.next_key()? {
Some(key) => key,
None => break,
},
};
match key {
1253 => if r.first(&mut seen[0])? { f0 = r.multilingual()?; },
585 => if r.first(&mut seen[1])? { f1 = r.number::<u64>()?; },
1252 => if r.first(&mut seen[2])? { f2 = loc::Location::read_json(r)?; },
2611 => if r.first(&mut seen[3])? { f3 = r.raw_object()?.map(Box::new); },
_ => r.skip_unknown()?,
}
}
Ok(Self {
managed_logical_location: f0,
distance_from_logical_location: f1,
managed_location: f2,
managed_logical_location_extension: f3,
})
}
pub(crate) fn write_json(&self, w: &mut JsonWriter<'_>, target_class: Option<&'static str>) -> Result<(), Error> {
w.begin_object(1070)?;
if let Some(class) = target_class {
w.target_class(class)?;
}
if let Some(v) = &self.managed_logical_location {
w.key(1253)?;
w.multilingual(v)?;
}
if let Some(v) = &self.distance_from_logical_location {
w.key(585)?;
w.integer(*v)?;
}
if let Some(v) = &self.managed_location {
w.key(1252)?;
v.write_json(w)?;
}
if let Some(v) = &self.managed_logical_location_extension {
w.key(2611)?;
w.extension(v)?;
}
w.end_object()
}
}
/// XML type `vms:MultiPageDisplay`.
#[derive(Debug, Clone, Default, PartialEq)]
pub struct MultiPageDisplay {
/// XML element `vms:isBlank`.
pub is_blank: Option<com::Boolean>,
/// XML element `vms:legallyBinding`.
pub legally_binding: Option<com::Boolean>,
/// XML element `vms:legalBasis`.
pub legal_basis: Option<MultilingualString>,
/// XML element `vms:_displayAreaSettingsExtension`.
pub display_area_settings_extension: Option<Box<Extension>>,
/// XML element `vms:sequenceGroupNumber`.
pub sequence_group_number: Option<com::NonNegativeInteger>,
/// XML element `vms:displayAreaSettings`.
pub display_area_settings: Vec<MultiPageDisplayPageNumberDisplayAreaSettings>,
/// XML element `vms:_multiPageDisplayExtension`.
pub multi_page_display_extension: Option<Box<Extension>>,
}
impl MultiPageDisplay {
const FIELDS: &'static [u32] = &[0x1708d7, 0x170902, 0x170900, 0x170489, 0x170b78, 0x1707c7, 0x17051c];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x170119);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = Vec::new();
let mut e6 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x1708d7 => { let v = r.value::<bool>()?; r.set(&mut e0, v, 2263); }
0x170902 => { let v = r.value::<bool>()?; r.set(&mut e1, v, 2306); }
0x170900 => { let v = r.multilingual()?; r.set(&mut e2, v, 2304); }
0x170489 => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1161); }
0x170b78 => { let v = r.value::<u64>()?; r.set(&mut e4, v, 2936); }
0x1707c7 => { let v = Some(MultiPageDisplayPageNumberDisplayAreaSettings::read(r)?); e5.extend(v); }
0x17051c => { let v = r.raw()?; r.set(&mut e6, v.map(Box::new), 1308); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
is_blank: e0,
legally_binding: e1,
legal_basis: e2,
display_area_settings_extension: e3,
sequence_group_number: e4,
display_area_settings: e5,
multi_page_display_extension: e6,
};
r.close();
Ok(v)
}
}
impl MultiPageDisplay {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.is_blank { w.leaf("vms:isBlank", v)?; }
if let Some(v) = &self.legally_binding { w.leaf("vms:legallyBinding", v)?; }
if let Some(v) = &self.legal_basis { w.multilingual("vms:legalBasis", v)?; }
if let Some(v) = &self.display_area_settings_extension { w.extension("vms:_displayAreaSettingsExtension", v)?; }
if let Some(v) = &self.sequence_group_number { w.leaf("vms:sequenceGroupNumber", v)?; }
for v in &self.display_area_settings { v.write(w, "vms:displayAreaSettings", "", "")?; }
if let Some(v) = &self.multi_page_display_extension { w.extension("vms:_multiPageDisplayExtension", v)?; }
w.end(tag)
}
}
impl MultiPageDisplay {
pub(crate) fn read_json(r: &mut JsonReader<'_>) -> Result<Option<Self>, Error> {
if !r.begin_object()? {
return Ok(None);
}
Self::read_json_members(r, None).map(Some)
}
/// Reads the members of an object that is already open; `pending` is a member key read
/// already.
pub(crate) fn read_json_members(r: &mut JsonReader<'_>, mut pending: Option<u32>) -> Result<Self, Error> {
let mut seen = [false; 7];
let mut f0 = None;
let mut f1 = None;
let mut f2 = None;
let mut f3 = None;
let mut f4 = None;
let mut f5 = Vec::new();
let mut f6 = None;
loop {
let key = match pending.take() {
Some(key) => key,
None => match r.next_key()? {
Some(key) => key,
None => break,
},
};
match key {
1010 => if r.first(&mut seen[0])? { f0 = r.boolean()?; },
1053 => if r.first(&mut seen[1])? { f1 = r.boolean()?; },
1051 => if r.first(&mut seen[2])? { f2 = r.multilingual()?; },
2599 => if r.first(&mut seen[3])? { f3 = r.raw_object()?.map(Box::new); },
2023 => if r.first(&mut seen[4])? { f4 = r.number::<u64>()?; },
576 => if r.first(&mut seen[5])? { let mut l = r.list()?; while r.item(&mut l)? { if let Some(v) = MultiPageDisplayPageNumberDisplayAreaSettings::read_json(r)? { f5.push(v); } } },
2614 => if r.first(&mut seen[6])? { f6 = r.raw_object()?.map(Box::new); },
_ => r.skip_unknown()?,
}
}
Ok(Self {
is_blank: f0,
legally_binding: f1,
legal_basis: f2,
display_area_settings_extension: f3,
sequence_group_number: f4,
display_area_settings: f5,
multi_page_display_extension: f6,
})
}
pub(crate) fn write_json(&self, w: &mut JsonWriter<'_>, target_class: Option<&'static str>) -> Result<(), Error> {
w.begin_object(1072)?;
if let Some(class) = target_class {
w.target_class(class)?;
}
if let Some(v) = &self.is_blank {
w.key(1010)?;
w.boolean(*v)?;
}
if let Some(v) = &self.legally_binding {
w.key(1053)?;
w.boolean(*v)?;
}
if let Some(v) = &self.legal_basis {
w.key(1051)?;
w.multilingual(v)?;
}
if let Some(v) = &self.display_area_settings_extension {
w.key(2599)?;
w.extension(v)?;
}
if let Some(v) = &self.sequence_group_number {
w.key(2023)?;
w.integer(*v)?;
}
if !self.display_area_settings.is_empty() {
w.key(576)?;
w.begin_array()?;
for v in &self.display_area_settings {
w.item()?;
v.write_json(w, None)?;
}
w.end_array()?;
}
if let Some(v) = &self.multi_page_display_extension {
w.key(2614)?;
w.extension(v)?;
}
w.end_object()
}
}
/// XML type `vms:PictogramDisplay`.
#[derive(Debug, Clone, Default, PartialEq)]
pub struct PictogramDisplay {
/// XML element `vms:isBlank`.
pub is_blank: Option<com::Boolean>,
/// XML element `vms:legallyBinding`.
pub legally_binding: Option<com::Boolean>,
/// XML element `vms:legalBasis`.
pub legal_basis: Option<MultilingualString>,
/// XML element `vms:_displayAreaSettingsExtension`.
pub display_area_settings_extension: Option<Box<Extension>>,
/// XML element `vms:isPrimaryPictogram`.
pub is_primary_pictogram: Option<com::Boolean>,
/// XML element `vms:pictogramDisplayUrl`.
pub pictogram_display_url: Option<com::Url>,
/// XML element `vms:pictogram`.
pub pictogram: Option<Pictogram>,
/// XML element `vms:supplementaryInformationDisplay`.
pub supplementary_information_display: Option<SupplementaryInformationDisplay>,
/// XML element `vms:image`.
pub image: Option<Box<Image>>,
/// XML element `vms:_pictogramDisplayExtension`.
pub pictogram_display_extension: Option<Box<Extension>>,
}
impl PictogramDisplay {
const FIELDS: &'static [u32] = &[0x1708d7, 0x170902, 0x170900, 0x170489, 0x1708da, 0x170a7e, 0x170a79, 0x170bf0, 0x1708b0, 0x17057c];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x17017f);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = None;
let mut e7 = None;
let mut e8 = None;
let mut e9 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x1708d7 => { let v = r.value::<bool>()?; r.set(&mut e0, v, 2263); }
0x170902 => { let v = r.value::<bool>()?; r.set(&mut e1, v, 2306); }
0x170900 => { let v = r.multilingual()?; r.set(&mut e2, v, 2304); }
0x170489 => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1161); }
0x1708da => { let v = r.value::<bool>()?; r.set(&mut e4, v, 2266); }
0x170a7e => { let v = r.string()?; r.set(&mut e5, v, 2686); }
0x170a79 => { let v = Pictogram::read(r)?; r.set(&mut e6, v, 2681); }
0x170bf0 => { let v = SupplementaryInformationDisplay::read(r)?; r.set(&mut e7, v, 3056); }
0x1708b0 => { let v = Some(Image::read(r)?); r.set(&mut e8, v.map(Box::new), 2224); }
0x17057c => { let v = r.raw()?; r.set(&mut e9, v.map(Box::new), 1404); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e6, 2681);
let v = Self {
is_blank: e0,
legally_binding: e1,
legal_basis: e2,
display_area_settings_extension: e3,
is_primary_pictogram: e4,
pictogram_display_url: e5,
pictogram: e6,
supplementary_information_display: e7,
image: e8,
pictogram_display_extension: e9,
};
r.close();
Ok(v)
}
}
impl PictogramDisplay {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.is_blank { w.leaf("vms:isBlank", v)?; }
if let Some(v) = &self.legally_binding { w.leaf("vms:legallyBinding", v)?; }
if let Some(v) = &self.legal_basis { w.multilingual("vms:legalBasis", v)?; }
if let Some(v) = &self.display_area_settings_extension { w.extension("vms:_displayAreaSettingsExtension", v)?; }
if let Some(v) = &self.is_primary_pictogram { w.leaf("vms:isPrimaryPictogram", v)?; }
if let Some(v) = &self.pictogram_display_url { w.leaf("vms:pictogramDisplayUrl", v)?; }
match &self.pictogram {
Some(v) => { v.write(w, "vms:pictogram")?; }
None => return Err(w.missing("vms:pictogram")),
}
if let Some(v) = &self.supplementary_information_display { v.write(w, "vms:supplementaryInformationDisplay")?; }
if let Some(v) = &self.image { v.write(w, "vms:image", "", "")?; }
if let Some(v) = &self.pictogram_display_extension { w.extension("vms:_pictogramDisplayExtension", v)?; }
w.end(tag)
}
}
impl PictogramDisplay {
pub(crate) fn read_json(r: &mut JsonReader<'_>) -> Result<Option<Self>, Error> {
if !r.begin_object()? {
return Ok(None);
}
Self::read_json_members(r, None).map(Some)
}
/// Reads the members of an object that is already open; `pending` is a member key read
/// already.
pub(crate) fn read_json_members(r: &mut JsonReader<'_>, mut pending: Option<u32>) -> Result<Self, Error> {
let mut seen = [false; 10];
let mut f0 = None;
let mut f1 = None;
let mut f2 = None;
let mut f3 = None;
let mut f4 = None;
let mut f5 = None;
let mut f6 = None;
let mut f7 = None;
let mut f8 = None;
let mut f9 = None;
loop {
let key = match pending.take() {
Some(key) => key,
None => match r.next_key()? {
Some(key) => key,
None => break,
},
};
match key {
1010 => if r.first(&mut seen[0])? { f0 = r.boolean()?; },
1053 => if r.first(&mut seen[1])? { f1 = r.boolean()?; },
1051 => if r.first(&mut seen[2])? { f2 = r.multilingual()?; },
2599 => if r.first(&mut seen[3])? { f3 = r.raw_object()?.map(Box::new); },
1013 => if r.first(&mut seen[4])? { f4 = r.boolean()?; },
1584 => if r.first(&mut seen[5])? { f5 = r.string()?; },
1579 => if r.first(&mut seen[6])? { f6 = Pictogram::read_json(r)?; },
2220 => if r.first(&mut seen[7])? { f7 = SupplementaryInformationDisplay::read_json(r)?; },
969 => if r.first(&mut seen[8])? { f8 = Image::read_json(r)?.map(Box::new); },
2619 => if r.first(&mut seen[9])? { f9 = r.raw_object()?.map(Box::new); },
_ => r.skip_unknown()?,
}
}
r.required(&f6, 1579);
Ok(Self {
is_blank: f0,
legally_binding: f1,
legal_basis: f2,
display_area_settings_extension: f3,
is_primary_pictogram: f4,
pictogram_display_url: f5,
pictogram: f6,
supplementary_information_display: f7,
image: f8,
pictogram_display_extension: f9,
})
}
pub(crate) fn write_json(&self, w: &mut JsonWriter<'_>, target_class: Option<&'static str>) -> Result<(), Error> {
w.begin_object(1074)?;
if let Some(class) = target_class {
w.target_class(class)?;
}
if let Some(v) = &self.is_blank {
w.key(1010)?;
w.boolean(*v)?;
}
if let Some(v) = &self.legally_binding {
w.key(1053)?;
w.boolean(*v)?;
}
if let Some(v) = &self.legal_basis {
w.key(1051)?;
w.multilingual(v)?;
}
if let Some(v) = &self.display_area_settings_extension {
w.key(2599)?;
w.extension(v)?;
}
if let Some(v) = &self.is_primary_pictogram {
w.key(1013)?;
w.boolean(*v)?;
}
if let Some(v) = &self.pictogram_display_url {
w.key(1584)?;
w.string(v)?;
}
match &self.pictogram {
Some(v) => {
w.key(1579)?;
v.write_json(w)?;
}
None => w.absent(1579, w.missing("pictogram"))?,
}
if let Some(v) = &self.supplementary_information_display {
w.key(2220)?;
v.write_json(w)?;
}
if let Some(v) = &self.image {
w.key(969)?;
v.write_json(w, None)?;
}
if let Some(v) = &self.pictogram_display_extension {
w.key(2619)?;
w.extension(v)?;
}
w.end_object()
}
}
/// XML type `vms:PictogramDisplayArea`.
#[derive(Debug, Clone, Default, PartialEq)]
pub struct PictogramDisplayArea {
/// XML element `vms:sequencingCapable`.
pub sequencing_capable: Option<com::Boolean>,
/// XML element `vms:maxNumberOfSequentialPages`.
pub max_number_of_sequential_pages: Option<com::NonNegativeInteger>,
/// XML element `vms:positionXAbsolute`.
pub position_x_absolute: Option<PositionXAbsoluteEnum>,
/// XML element `vms:positionXRelativeToPrevious`.
pub position_x_relative_to_previous: Option<PositionXRelativeEnum>,
/// XML element `vms:positionYAbsolute`.
pub position_y_absolute: Option<PositionYAbsoluteEnum>,
/// XML element `vms:positionYRelativeToPrevious`.
pub position_y_relative_to_previous: Option<PositionYRelativeEnum>,
/// XML element `vms:displayGeometry`.
pub display_geometry: Option<Box<DisplayGeometry>>,
/// XML element `vms:overriddenLaneAssociation`.
pub overridden_lane_association: Vec<loc::Lane>,
/// XML element `vms:_displayAreaExtension`.
pub display_area_extension: Option<Box<Extension>>,
/// XML element `vms:pictogramCodeListIdentifier`.
pub pictogram_code_list_identifier: Option<String>,
/// XML element `vms:pictogramNumberOfColours`.
pub pictogram_number_of_colours: Option<com::NonNegativeInteger>,
/// XML element `vms:_pictogramDisplayAreaExtension`.
pub pictogram_display_area_extension: Option<Box<Extension>>,
}
impl PictogramDisplayArea {
const FIELDS: &'static [u32] = &[0x170b7a, 0x17093f, 0x170a98, 0x170a99, 0x170a9b, 0x170a9c, 0x1707c8, 0x170a39, 0x170488, 0x170a7c, 0x170a82, 0x17057b];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x170180);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = None;
let mut e7 = Vec::new();
let mut e8 = None;
let mut e9 = None;
let mut e10 = None;
let mut e11 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x170b7a => { let v = r.value::<bool>()?; r.set(&mut e0, v, 2938); }
0x17093f => { let v = r.value::<u64>()?; r.set(&mut e1, v, 2367); }
0x170a98 => { let v = r.enumeration::<PositionXAbsoluteEnum>()?; r.set(&mut e2, v, 2712); }
0x170a99 => { let v = r.enumeration::<PositionXRelativeEnum>()?; r.set(&mut e3, v, 2713); }
0x170a9b => { let v = r.enumeration::<PositionYAbsoluteEnum>()?; r.set(&mut e4, v, 2715); }
0x170a9c => { let v = r.enumeration::<PositionYRelativeEnum>()?; r.set(&mut e5, v, 2716); }
0x1707c8 => { let v = Some(DisplayGeometry::read(r)?); r.set(&mut e6, v.map(Box::new), 1992); }
0x170a39 => { let v = Some(loc::Lane::read(r)?); e7.extend(v); }
0x170488 => { let v = r.raw()?; r.set(&mut e8, v.map(Box::new), 1160); }
0x170a7c => { let v = r.string()?; r.set(&mut e9, v, 2684); }
0x170a82 => { let v = r.value::<u64>()?; r.set(&mut e10, v, 2690); }
0x17057b => { let v = r.raw()?; r.set(&mut e11, v.map(Box::new), 1403); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
sequencing_capable: e0,
max_number_of_sequential_pages: e1,
position_x_absolute: e2,
position_x_relative_to_previous: e3,
position_y_absolute: e4,
position_y_relative_to_previous: e5,
display_geometry: e6,
overridden_lane_association: e7,
display_area_extension: e8,
pictogram_code_list_identifier: e9,
pictogram_number_of_colours: e10,
pictogram_display_area_extension: e11,
};
r.close();
Ok(v)
}
}
impl PictogramDisplayArea {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.sequencing_capable { w.leaf("vms:sequencingCapable", v)?; }
if let Some(v) = &self.max_number_of_sequential_pages { w.leaf("vms:maxNumberOfSequentialPages", v)?; }
if let Some(v) = &self.position_x_absolute { w.enumeration("vms:positionXAbsolute", v.literal())?; }
if let Some(v) = &self.position_x_relative_to_previous { w.enumeration("vms:positionXRelativeToPrevious", v.literal())?; }
if let Some(v) = &self.position_y_absolute { w.enumeration("vms:positionYAbsolute", v.literal())?; }
if let Some(v) = &self.position_y_relative_to_previous { w.enumeration("vms:positionYRelativeToPrevious", v.literal())?; }
if let Some(v) = &self.display_geometry { v.write(w, "vms:displayGeometry", "", "")?; }
for v in &self.overridden_lane_association { v.write(w, "vms:overriddenLaneAssociation", "", "")?; }
if let Some(v) = &self.display_area_extension { w.extension("vms:_displayAreaExtension", v)?; }
if let Some(v) = &self.pictogram_code_list_identifier { w.max_len("pictogramCodeListIdentifier", "String", v, 1024)?; w.leaf("vms:pictogramCodeListIdentifier", v)?; }
if let Some(v) = &self.pictogram_number_of_colours { w.leaf("vms:pictogramNumberOfColours", v)?; }
if let Some(v) = &self.pictogram_display_area_extension { w.extension("vms:_pictogramDisplayAreaExtension", v)?; }
w.end(tag)
}
}
impl PictogramDisplayArea {
pub(crate) fn read_json(r: &mut JsonReader<'_>) -> Result<Option<Self>, Error> {
if !r.begin_object()? {
return Ok(None);
}
Self::read_json_members(r, None).map(Some)
}
/// Reads the members of an object that is already open; `pending` is a member key read
/// already.
pub(crate) fn read_json_members(r: &mut JsonReader<'_>, mut pending: Option<u32>) -> Result<Self, Error> {
let mut seen = [false; 12];
let mut f0 = None;
let mut f1 = None;
let mut f2 = None;
let mut f3 = None;
let mut f4 = None;
let mut f5 = None;
let mut f6 = None;
let mut f7 = Vec::new();
let mut f8 = None;
let mut f9 = None;
let mut f10 = None;
let mut f11 = None;
loop {
let key = match pending.take() {
Some(key) => key,
None => match r.next_key()? {
Some(key) => key,
None => break,
},
};
match key {
2025 => if r.first(&mut seen[0])? { f0 = r.boolean()?; },
1268 => if r.first(&mut seen[1])? { f1 = r.number::<u64>()?; },
1610 => if r.first(&mut seen[2])? { f2 = r.enumeration::<PositionXAbsoluteEnum>()?; },
1611 => if r.first(&mut seen[3])? { f3 = r.enumeration::<PositionXRelativeEnum>()?; },
1613 => if r.first(&mut seen[4])? { f4 = r.enumeration::<PositionYAbsoluteEnum>()?; },
1614 => if r.first(&mut seen[5])? { f5 = r.enumeration::<PositionYRelativeEnum>()?; },
577 => if r.first(&mut seen[6])? { f6 = DisplayGeometry::read_json(r)?.map(Box::new); },
1516 => if r.first(&mut seen[7])? { let mut l = r.list()?; while r.item(&mut l)? { if let Some(v) = loc::Lane::read_json(r)? { f7.push(v); } } },
2598 => if r.first(&mut seen[8])? { f8 = r.raw_object()?.map(Box::new); },
1582 => if r.first(&mut seen[9])? { f9 = r.string()?; },
1588 => if r.first(&mut seen[10])? { f10 = r.number::<u64>()?; },
2618 => if r.first(&mut seen[11])? { f11 = r.raw_object()?.map(Box::new); },
_ => r.skip_unknown()?,
}
}
Ok(Self {
sequencing_capable: f0,
max_number_of_sequential_pages: f1,
position_x_absolute: f2,
position_x_relative_to_previous: f3,
position_y_absolute: f4,
position_y_relative_to_previous: f5,
display_geometry: f6,
overridden_lane_association: f7,
display_area_extension: f8,
pictogram_code_list_identifier: f9,
pictogram_number_of_colours: f10,
pictogram_display_area_extension: f11,
})
}
pub(crate) fn write_json(&self, w: &mut JsonWriter<'_>, target_class: Option<&'static str>) -> Result<(), Error> {
w.begin_object(1075)?;
if let Some(class) = target_class {
w.target_class(class)?;
}
if let Some(v) = &self.sequencing_capable {
w.key(2025)?;
w.boolean(*v)?;
}
if let Some(v) = &self.max_number_of_sequential_pages {
w.key(1268)?;
w.integer(*v)?;
}
if let Some(v) = &self.position_x_absolute {
w.key(1610)?;
w.enumeration(1078, v.literal())?;
}
if let Some(v) = &self.position_x_relative_to_previous {
w.key(1611)?;
w.enumeration(1079, v.literal())?;
}
if let Some(v) = &self.position_y_absolute {
w.key(1613)?;
w.enumeration(1080, v.literal())?;
}
if let Some(v) = &self.position_y_relative_to_previous {
w.key(1614)?;
w.enumeration(1081, v.literal())?;
}
if let Some(v) = &self.display_geometry {
w.key(577)?;
v.write_json(w, None)?;
}
if !self.overridden_lane_association.is_empty() {
w.key(1516)?;
w.begin_array()?;
for v in &self.overridden_lane_association {
w.item()?;
v.write_json(w, None)?;
}
w.end_array()?;
}
if let Some(v) = &self.display_area_extension {
w.key(2598)?;
w.extension(v)?;
}
if let Some(v) = &self.pictogram_code_list_identifier {
w.key(1582)?;
w.max_len("pictogramCodeListIdentifier", "String", v, 1024)?; w.string(v)?;
}
if let Some(v) = &self.pictogram_number_of_colours {
w.key(1588)?;
w.integer(*v)?;
}
if let Some(v) = &self.pictogram_display_area_extension {
w.key(2618)?;
w.extension(v)?;
}
w.end_object()
}
}
/// XML type `vms:RegularPictogram`.
#[derive(Debug, Clone, Default, PartialEq)]
pub struct RegularPictogram {
/// XML element `vms:customPictogramCode`.
pub custom_pictogram_code: Option<String>,
/// XML element `vms:additionalDescription`.
pub additional_description: Option<MultilingualString>,
/// XML element `vms:pictogramFlashing`.
pub pictogram_flashing: Option<com::Boolean>,
/// XML element `vms:pictogramInInverseColour`.
pub pictogram_in_inverse_colour: Option<com::Boolean>,
/// XML element `vms:viennaConventionCompliant`.
pub vienna_convention_compliant: Option<com::Boolean>,
/// XML element `vms:pictogramInformationType`.
pub pictogram_information_type: Option<InformationTypeEnum>,
/// XML element `vms:gddStructure`.
pub gdd_structure: Option<Box<GddStructure>>,
/// XML element `vms:_pictogramExtension`.
pub pictogram_extension: Option<Box<Extension>>,
/// XML element `vms:pictogramDescription`.
pub pictogram_description: Vec<PictogramEnum>,
/// XML element `vms:presenceOfRedTriangle`.
pub presence_of_red_triangle: Option<com::Boolean>,
/// XML element `vms:displayedNumericalInformation`.
pub displayed_numerical_information: Vec<DisplayedNumericalInformation>,
/// XML element `vms:_regularPictogramExtension`.
pub regular_pictogram_extension: Option<Box<Extension>>,
}
impl RegularPictogram {
const FIELDS: &'static [u32] = &[0x170784, 0x1706b7, 0x170a7f, 0x170a80, 0x170cb2, 0x170a81, 0x170876, 0x17057d, 0x170a7d, 0x170ab5, 0x1707cb, 0x1705b7];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x1701bb);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = None;
let mut e7 = None;
let mut e8 = Vec::new();
let mut e9 = None;
let mut e10 = Vec::new();
let mut e11 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x170784 => { let v = r.string()?; r.set(&mut e0, v, 1924); }
0x1706b7 => { let v = r.multilingual()?; r.set(&mut e1, v, 1719); }
0x170a7f => { let v = r.value::<bool>()?; r.set(&mut e2, v, 2687); }
0x170a80 => { let v = r.value::<bool>()?; r.set(&mut e3, v, 2688); }
0x170cb2 => { let v = r.value::<bool>()?; r.set(&mut e4, v, 3250); }
0x170a81 => { let v = r.enumeration::<InformationTypeEnum>()?; r.set(&mut e5, v, 2689); }
0x170876 => { let v = Some(GddStructure::read(r)?); r.set(&mut e6, v.map(Box::new), 2166); }
0x17057d => { let v = r.raw()?; r.set(&mut e7, v.map(Box::new), 1405); }
0x170a7d => { let v = r.enumeration::<PictogramEnum>()?; e8.extend(v); }
0x170ab5 => { let v = r.value::<bool>()?; r.set(&mut e9, v, 2741); }
0x1707cb => { let v = Some(DisplayedNumericalInformation::read(r)?); e10.extend(v); }
0x1705b7 => { let v = r.raw()?; r.set(&mut e11, v.map(Box::new), 1463); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
custom_pictogram_code: e0,
additional_description: e1,
pictogram_flashing: e2,
pictogram_in_inverse_colour: e3,
vienna_convention_compliant: e4,
pictogram_information_type: e5,
gdd_structure: e6,
pictogram_extension: e7,
pictogram_description: e8,
presence_of_red_triangle: e9,
displayed_numerical_information: e10,
regular_pictogram_extension: e11,
};
r.close();
Ok(v)
}
}
impl RegularPictogram {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.custom_pictogram_code { w.max_len("customPictogramCode", "String", v, 1024)?; w.leaf("vms:customPictogramCode", v)?; }
if let Some(v) = &self.additional_description { w.multilingual("vms:additionalDescription", v)?; }
if let Some(v) = &self.pictogram_flashing { w.leaf("vms:pictogramFlashing", v)?; }
if let Some(v) = &self.pictogram_in_inverse_colour { w.leaf("vms:pictogramInInverseColour", v)?; }
if let Some(v) = &self.vienna_convention_compliant { w.leaf("vms:viennaConventionCompliant", v)?; }
if let Some(v) = &self.pictogram_information_type { w.enumeration("vms:pictogramInformationType", v.literal())?; }
if let Some(v) = &self.gdd_structure { v.write(w, "vms:gddStructure", "", "")?; }
if let Some(v) = &self.pictogram_extension { w.extension("vms:_pictogramExtension", v)?; }
for v in &self.pictogram_description { w.enumeration("vms:pictogramDescription", v.literal())?; }
if let Some(v) = &self.presence_of_red_triangle { w.leaf("vms:presenceOfRedTriangle", v)?; }
w.count("vms:displayedNumericalInformation", self.displayed_numerical_information.len(), 0, 2)?;
for v in &self.displayed_numerical_information { v.write(w, "vms:displayedNumericalInformation", "", "")?; }
if let Some(v) = &self.regular_pictogram_extension { w.extension("vms:_regularPictogramExtension", v)?; }
w.end(tag)
}
}
impl RegularPictogram {
pub(crate) fn read_json(r: &mut JsonReader<'_>) -> Result<Option<Self>, Error> {
if !r.begin_object()? {
return Ok(None);
}
Self::read_json_members(r, None).map(Some)
}
/// Reads the members of an object that is already open; `pending` is a member key read
/// already.
pub(crate) fn read_json_members(r: &mut JsonReader<'_>, mut pending: Option<u32>) -> Result<Self, Error> {
let mut seen = [false; 12];
let mut f0 = None;
let mut f1 = None;
let mut f2 = None;
let mut f3 = None;
let mut f4 = None;
let mut f5 = None;
let mut f6 = None;
let mut f7 = None;
let mut f8 = Vec::new();
let mut f9 = None;
let mut f10 = Vec::new();
let mut f11 = None;
loop {
let key = match pending.take() {
Some(key) => key,
None => match r.next_key()? {
Some(key) => key,
None => break,
},
};
match key {
482 => if r.first(&mut seen[0])? { f0 = r.string()?; },
59 => if r.first(&mut seen[1])? { f1 = r.multilingual()?; },
1585 => if r.first(&mut seen[2])? { f2 = r.boolean()?; },
1586 => if r.first(&mut seen[3])? { f3 = r.boolean()?; },
2583 => if r.first(&mut seen[4])? { f4 = r.boolean()?; },
1587 => if r.first(&mut seen[5])? { f5 = r.enumeration::<InformationTypeEnum>()?; },
911 => if r.first(&mut seen[6])? { f6 = GddStructure::read_json(r)?.map(Box::new); },
2620 => if r.first(&mut seen[7])? { f7 = r.raw_object()?.map(Box::new); },
1583 => if r.first(&mut seen[8])? { let mut l = r.list()?; while r.item(&mut l)? { if let Some(v) = r.enumeration::<PictogramEnum>()? { f8.push(v); } } },
1639 => if r.first(&mut seen[9])? { f9 = r.boolean()?; },
580 => if r.first(&mut seen[10])? { let mut l = r.list()?; while r.item(&mut l)? { if let Some(v) = DisplayedNumericalInformation::read_json(r)? { f10.push(v); } } },
2622 => if r.first(&mut seen[11])? { f11 = r.raw_object()?.map(Box::new); },
_ => r.skip_unknown()?,
}
}
Ok(Self {
custom_pictogram_code: f0,
additional_description: f1,
pictogram_flashing: f2,
pictogram_in_inverse_colour: f3,
vienna_convention_compliant: f4,
pictogram_information_type: f5,
gdd_structure: f6,
pictogram_extension: f7,
pictogram_description: f8,
presence_of_red_triangle: f9,
displayed_numerical_information: f10,
regular_pictogram_extension: f11,
})
}
pub(crate) fn write_json(&self, w: &mut JsonWriter<'_>, target_class: Option<&'static str>) -> Result<(), Error> {
w.begin_object(1082)?;
if let Some(class) = target_class {
w.target_class(class)?;
}
if let Some(v) = &self.custom_pictogram_code {
w.key(482)?;
w.max_len("customPictogramCode", "String", v, 1024)?; w.string(v)?;
}
if let Some(v) = &self.additional_description {
w.key(59)?;
w.multilingual(v)?;
}
if let Some(v) = &self.pictogram_flashing {
w.key(1585)?;
w.boolean(*v)?;
}
if let Some(v) = &self.pictogram_in_inverse_colour {
w.key(1586)?;
w.boolean(*v)?;
}
if let Some(v) = &self.vienna_convention_compliant {
w.key(2583)?;
w.boolean(*v)?;
}
if let Some(v) = &self.pictogram_information_type {
w.key(1587)?;
w.enumeration(1069, v.literal())?;
}
if let Some(v) = &self.gdd_structure {
w.key(911)?;
v.write_json(w, None)?;
}
if let Some(v) = &self.pictogram_extension {
w.key(2620)?;
w.extension(v)?;
}
if !self.pictogram_description.is_empty() {
w.key(1583)?;
w.begin_array()?;
for v in &self.pictogram_description {
w.item()?;
w.enumeration(1076, v.literal())?;
}
w.end_array()?;
}
if let Some(v) = &self.presence_of_red_triangle {
w.key(1639)?;
w.boolean(*v)?;
}
w.count("displayedNumericalInformation", self.displayed_numerical_information.len(), 0, 2)?;
if !self.displayed_numerical_information.is_empty() {
w.key(580)?;
w.begin_array()?;
for v in &self.displayed_numerical_information {
w.item()?;
v.write_json(w, None)?;
}
w.end_array()?;
}
if let Some(v) = &self.regular_pictogram_extension {
w.key(2622)?;
w.extension(v)?;
}
w.end_object()
}
}
/// XML type `vms:SupplementaryPanelArea`.
#[derive(Debug, Clone, Default, PartialEq)]
pub struct SupplementaryPanelArea {
/// XML element `vms:sequencingCapable`.
pub sequencing_capable: Option<com::Boolean>,
/// XML element `vms:maxNumberOfSequentialPages`.
pub max_number_of_sequential_pages: Option<com::NonNegativeInteger>,
/// XML element `vms:positionXAbsolute`.
pub position_x_absolute: Option<PositionXAbsoluteEnum>,
/// XML element `vms:positionXRelativeToPrevious`.
pub position_x_relative_to_previous: Option<PositionXRelativeEnum>,
/// XML element `vms:positionYAbsolute`.
pub position_y_absolute: Option<PositionYAbsoluteEnum>,
/// XML element `vms:positionYRelativeToPrevious`.
pub position_y_relative_to_previous: Option<PositionYRelativeEnum>,
/// XML element `vms:displayGeometry`.
pub display_geometry: Option<Box<DisplayGeometry>>,
/// XML element `vms:overriddenLaneAssociation`.
pub overridden_lane_association: Vec<loc::Lane>,
/// XML element `vms:_displayAreaExtension`.
pub display_area_extension: Option<Box<Extension>>,
/// XML element `vms:supplementaryPictogramCodeListIdentifier`.
pub supplementary_pictogram_code_list_identifier: Option<String>,
/// XML element `vms:relatedPictogramArea`.
pub related_pictogram_area: Option<com::Integer>,
/// XML element `vms:_supplementaryPanelAreaExtension`.
pub supplementary_panel_area_extension: Option<Box<Extension>>,
}
impl SupplementaryPanelArea {
const FIELDS: &'static [u32] = &[0x170b7a, 0x17093f, 0x170a98, 0x170a99, 0x170a9b, 0x170a9c, 0x1707c8, 0x170a39, 0x170488, 0x170bf1, 0x170b1b, 0x170609];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x170211);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = None;
let mut e7 = Vec::new();
let mut e8 = None;
let mut e9 = None;
let mut e10 = None;
let mut e11 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x170b7a => { let v = r.value::<bool>()?; r.set(&mut e0, v, 2938); }
0x17093f => { let v = r.value::<u64>()?; r.set(&mut e1, v, 2367); }
0x170a98 => { let v = r.enumeration::<PositionXAbsoluteEnum>()?; r.set(&mut e2, v, 2712); }
0x170a99 => { let v = r.enumeration::<PositionXRelativeEnum>()?; r.set(&mut e3, v, 2713); }
0x170a9b => { let v = r.enumeration::<PositionYAbsoluteEnum>()?; r.set(&mut e4, v, 2715); }
0x170a9c => { let v = r.enumeration::<PositionYRelativeEnum>()?; r.set(&mut e5, v, 2716); }
0x1707c8 => { let v = Some(DisplayGeometry::read(r)?); r.set(&mut e6, v.map(Box::new), 1992); }
0x170a39 => { let v = Some(loc::Lane::read(r)?); e7.extend(v); }
0x170488 => { let v = r.raw()?; r.set(&mut e8, v.map(Box::new), 1160); }
0x170bf1 => { let v = r.string()?; r.set(&mut e9, v, 3057); }
0x170b1b => { let v = r.value::<i64>()?; r.set(&mut e10, v, 2843); }
0x170609 => { let v = r.raw()?; r.set(&mut e11, v.map(Box::new), 1545); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
sequencing_capable: e0,
max_number_of_sequential_pages: e1,
position_x_absolute: e2,
position_x_relative_to_previous: e3,
position_y_absolute: e4,
position_y_relative_to_previous: e5,
display_geometry: e6,
overridden_lane_association: e7,
display_area_extension: e8,
supplementary_pictogram_code_list_identifier: e9,
related_pictogram_area: e10,
supplementary_panel_area_extension: e11,
};
r.close();
Ok(v)
}
}
impl SupplementaryPanelArea {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.sequencing_capable { w.leaf("vms:sequencingCapable", v)?; }
if let Some(v) = &self.max_number_of_sequential_pages { w.leaf("vms:maxNumberOfSequentialPages", v)?; }
if let Some(v) = &self.position_x_absolute { w.enumeration("vms:positionXAbsolute", v.literal())?; }
if let Some(v) = &self.position_x_relative_to_previous { w.enumeration("vms:positionXRelativeToPrevious", v.literal())?; }
if let Some(v) = &self.position_y_absolute { w.enumeration("vms:positionYAbsolute", v.literal())?; }
if let Some(v) = &self.position_y_relative_to_previous { w.enumeration("vms:positionYRelativeToPrevious", v.literal())?; }
if let Some(v) = &self.display_geometry { v.write(w, "vms:displayGeometry", "", "")?; }
for v in &self.overridden_lane_association { v.write(w, "vms:overriddenLaneAssociation", "", "")?; }
if let Some(v) = &self.display_area_extension { w.extension("vms:_displayAreaExtension", v)?; }
if let Some(v) = &self.supplementary_pictogram_code_list_identifier { w.max_len("supplementaryPictogramCodeListIdentifier", "String", v, 1024)?; w.leaf("vms:supplementaryPictogramCodeListIdentifier", v)?; }
if let Some(v) = &self.related_pictogram_area { w.leaf("vms:relatedPictogramArea", v)?; }
if let Some(v) = &self.supplementary_panel_area_extension { w.extension("vms:_supplementaryPanelAreaExtension", v)?; }
w.end(tag)
}
}
impl SupplementaryPanelArea {
pub(crate) fn read_json(r: &mut JsonReader<'_>) -> Result<Option<Self>, Error> {
if !r.begin_object()? {
return Ok(None);
}
Self::read_json_members(r, None).map(Some)
}
/// Reads the members of an object that is already open; `pending` is a member key read
/// already.
pub(crate) fn read_json_members(r: &mut JsonReader<'_>, mut pending: Option<u32>) -> Result<Self, Error> {
let mut seen = [false; 12];
let mut f0 = None;
let mut f1 = None;
let mut f2 = None;
let mut f3 = None;
let mut f4 = None;
let mut f5 = None;
let mut f6 = None;
let mut f7 = Vec::new();
let mut f8 = None;
let mut f9 = None;
let mut f10 = None;
let mut f11 = None;
loop {
let key = match pending.take() {
Some(key) => key,
None => match r.next_key()? {
Some(key) => key,
None => break,
},
};
match key {
2025 => if r.first(&mut seen[0])? { f0 = r.boolean()?; },
1268 => if r.first(&mut seen[1])? { f1 = r.number::<u64>()?; },
1610 => if r.first(&mut seen[2])? { f2 = r.enumeration::<PositionXAbsoluteEnum>()?; },
1611 => if r.first(&mut seen[3])? { f3 = r.enumeration::<PositionXRelativeEnum>()?; },
1613 => if r.first(&mut seen[4])? { f4 = r.enumeration::<PositionYAbsoluteEnum>()?; },
1614 => if r.first(&mut seen[5])? { f5 = r.enumeration::<PositionYRelativeEnum>()?; },
577 => if r.first(&mut seen[6])? { f6 = DisplayGeometry::read_json(r)?.map(Box::new); },
1516 => if r.first(&mut seen[7])? { let mut l = r.list()?; while r.item(&mut l)? { if let Some(v) = loc::Lane::read_json(r)? { f7.push(v); } } },
2598 => if r.first(&mut seen[8])? { f8 = r.raw_object()?.map(Box::new); },
2221 => if r.first(&mut seen[9])? { f9 = r.string()?; },
1843 => if r.first(&mut seen[10])? { f10 = r.number::<i64>()?; },
2626 => if r.first(&mut seen[11])? { f11 = r.raw_object()?.map(Box::new); },
_ => r.skip_unknown()?,
}
}
Ok(Self {
sequencing_capable: f0,
max_number_of_sequential_pages: f1,
position_x_absolute: f2,
position_x_relative_to_previous: f3,
position_y_absolute: f4,
position_y_relative_to_previous: f5,
display_geometry: f6,
overridden_lane_association: f7,
display_area_extension: f8,
supplementary_pictogram_code_list_identifier: f9,
related_pictogram_area: f10,
supplementary_panel_area_extension: f11,
})
}
pub(crate) fn write_json(&self, w: &mut JsonWriter<'_>, target_class: Option<&'static str>) -> Result<(), Error> {
w.begin_object(1086)?;
if let Some(class) = target_class {
w.target_class(class)?;
}
if let Some(v) = &self.sequencing_capable {
w.key(2025)?;
w.boolean(*v)?;
}
if let Some(v) = &self.max_number_of_sequential_pages {
w.key(1268)?;
w.integer(*v)?;
}
if let Some(v) = &self.position_x_absolute {
w.key(1610)?;
w.enumeration(1078, v.literal())?;
}
if let Some(v) = &self.position_x_relative_to_previous {
w.key(1611)?;
w.enumeration(1079, v.literal())?;
}
if let Some(v) = &self.position_y_absolute {
w.key(1613)?;
w.enumeration(1080, v.literal())?;
}
if let Some(v) = &self.position_y_relative_to_previous {
w.key(1614)?;
w.enumeration(1081, v.literal())?;
}
if let Some(v) = &self.display_geometry {
w.key(577)?;
v.write_json(w, None)?;
}
if !self.overridden_lane_association.is_empty() {
w.key(1516)?;
w.begin_array()?;
for v in &self.overridden_lane_association {
w.item()?;
v.write_json(w, None)?;
}
w.end_array()?;
}
if let Some(v) = &self.display_area_extension {
w.key(2598)?;
w.extension(v)?;
}
if let Some(v) = &self.supplementary_pictogram_code_list_identifier {
w.key(2221)?;
w.max_len("supplementaryPictogramCodeListIdentifier", "String", v, 1024)?; w.string(v)?;
}
if let Some(v) = &self.related_pictogram_area {
w.key(1843)?;
w.integer(*v)?;
}
if let Some(v) = &self.supplementary_panel_area_extension {
w.key(2626)?;
w.extension(v)?;
}
w.end_object()
}
}
/// XML type `vms:SupplementaryPictogram`.
#[derive(Debug, Clone, Default, PartialEq)]
pub struct SupplementaryPictogram {
/// XML element `vms:isBlank`.
pub is_blank: Option<com::Boolean>,
/// XML element `vms:legallyBinding`.
pub legally_binding: Option<com::Boolean>,
/// XML element `vms:legalBasis`.
pub legal_basis: Option<MultilingualString>,
/// XML element `vms:_displayAreaSettingsExtension`.
pub display_area_settings_extension: Option<Box<Extension>>,
/// XML element `vms:_supplementaryInformationDisplayExtension`.
pub supplementary_information_display_extension: Option<Box<Extension>>,
/// XML element `vms:pictogramDescription`.
pub pictogram_description: Option<SupplementalPictogramEnum>,
/// XML element `vms:pictogramCode`.
pub pictogram_code: Option<String>,
/// XML element `vms:pictogramUrl`.
pub pictogram_url: Option<com::Url>,
/// XML element `vms:additionalDescription`.
pub additional_description: Option<MultilingualString>,
/// XML element `vms:pictogramFlashing`.
pub pictogram_flashing: Option<com::Boolean>,
/// XML element `vms:pictogramInformationType`.
pub pictogram_information_type: Option<InformationTypeEnum>,
/// XML element `vms:_supplementaryPictogramExtension`.
pub supplementary_pictogram_extension: Option<Box<Extension>>,
}
impl SupplementaryPictogram {
const FIELDS: &'static [u32] = &[0x1708d7, 0x170902, 0x170900, 0x170489, 0x170608, 0x170a7d, 0x170a7b, 0x170a83, 0x1706b7, 0x170a7f, 0x170a81, 0x17060b];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x170212);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = None;
let mut e7 = None;
let mut e8 = None;
let mut e9 = None;
let mut e10 = None;
let mut e11 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x1708d7 => { let v = r.value::<bool>()?; r.set(&mut e0, v, 2263); }
0x170902 => { let v = r.value::<bool>()?; r.set(&mut e1, v, 2306); }
0x170900 => { let v = r.multilingual()?; r.set(&mut e2, v, 2304); }
0x170489 => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1161); }
0x170608 => { let v = r.raw()?; r.set(&mut e4, v.map(Box::new), 1544); }
0x170a7d => { let v = r.enumeration::<SupplementalPictogramEnum>()?; r.set(&mut e5, v, 2685); }
0x170a7b => { let v = r.string()?; r.set(&mut e6, v, 2683); }
0x170a83 => { let v = r.string()?; r.set(&mut e7, v, 2691); }
0x1706b7 => { let v = r.multilingual()?; r.set(&mut e8, v, 1719); }
0x170a7f => { let v = r.value::<bool>()?; r.set(&mut e9, v, 2687); }
0x170a81 => { let v = r.enumeration::<InformationTypeEnum>()?; r.set(&mut e10, v, 2689); }
0x17060b => { let v = r.raw()?; r.set(&mut e11, v.map(Box::new), 1547); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
is_blank: e0,
legally_binding: e1,
legal_basis: e2,
display_area_settings_extension: e3,
supplementary_information_display_extension: e4,
pictogram_description: e5,
pictogram_code: e6,
pictogram_url: e7,
additional_description: e8,
pictogram_flashing: e9,
pictogram_information_type: e10,
supplementary_pictogram_extension: e11,
};
r.close();
Ok(v)
}
}
impl SupplementaryPictogram {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.is_blank { w.leaf("vms:isBlank", v)?; }
if let Some(v) = &self.legally_binding { w.leaf("vms:legallyBinding", v)?; }
if let Some(v) = &self.legal_basis { w.multilingual("vms:legalBasis", v)?; }
if let Some(v) = &self.display_area_settings_extension { w.extension("vms:_displayAreaSettingsExtension", v)?; }
if let Some(v) = &self.supplementary_information_display_extension { w.extension("vms:_supplementaryInformationDisplayExtension", v)?; }
if let Some(v) = &self.pictogram_description { w.enumeration("vms:pictogramDescription", v.literal())?; }
if let Some(v) = &self.pictogram_code { w.max_len("pictogramCode", "String", v, 1024)?; w.leaf("vms:pictogramCode", v)?; }
if let Some(v) = &self.pictogram_url { w.leaf("vms:pictogramUrl", v)?; }
if let Some(v) = &self.additional_description { w.multilingual("vms:additionalDescription", v)?; }
if let Some(v) = &self.pictogram_flashing { w.leaf("vms:pictogramFlashing", v)?; }
if let Some(v) = &self.pictogram_information_type { w.enumeration("vms:pictogramInformationType", v.literal())?; }
if let Some(v) = &self.supplementary_pictogram_extension { w.extension("vms:_supplementaryPictogramExtension", v)?; }
w.end(tag)
}
}
impl SupplementaryPictogram {
pub(crate) fn read_json(r: &mut JsonReader<'_>) -> Result<Option<Self>, Error> {
if !r.begin_object()? {
return Ok(None);
}
Self::read_json_members(r, None).map(Some)
}
/// Reads the members of an object that is already open; `pending` is a member key read
/// already.
pub(crate) fn read_json_members(r: &mut JsonReader<'_>, mut pending: Option<u32>) -> Result<Self, Error> {
let mut seen = [false; 12];
let mut f0 = None;
let mut f1 = None;
let mut f2 = None;
let mut f3 = None;
let mut f4 = None;
let mut f5 = None;
let mut f6 = None;
let mut f7 = None;
let mut f8 = None;
let mut f9 = None;
let mut f10 = None;
let mut f11 = None;
loop {
let key = match pending.take() {
Some(key) => key,
None => match r.next_key()? {
Some(key) => key,
None => break,
},
};
match key {
1010 => if r.first(&mut seen[0])? { f0 = r.boolean()?; },
1053 => if r.first(&mut seen[1])? { f1 = r.boolean()?; },
1051 => if r.first(&mut seen[2])? { f2 = r.multilingual()?; },
2599 => if r.first(&mut seen[3])? { f3 = r.raw_object()?.map(Box::new); },
2624 => if r.first(&mut seen[4])? { f4 = r.raw_object()?.map(Box::new); },
1583 => if r.first(&mut seen[5])? { f5 = r.enumeration::<SupplementalPictogramEnum>()?; },
1581 => if r.first(&mut seen[6])? { f6 = r.string()?; },
1589 => if r.first(&mut seen[7])? { f7 = r.string()?; },
59 => if r.first(&mut seen[8])? { f8 = r.multilingual()?; },
1585 => if r.first(&mut seen[9])? { f9 = r.boolean()?; },
1587 => if r.first(&mut seen[10])? { f10 = r.enumeration::<InformationTypeEnum>()?; },
2628 => if r.first(&mut seen[11])? { f11 = r.raw_object()?.map(Box::new); },
_ => r.skip_unknown()?,
}
}
Ok(Self {
is_blank: f0,
legally_binding: f1,
legal_basis: f2,
display_area_settings_extension: f3,
supplementary_information_display_extension: f4,
pictogram_description: f5,
pictogram_code: f6,
pictogram_url: f7,
additional_description: f8,
pictogram_flashing: f9,
pictogram_information_type: f10,
supplementary_pictogram_extension: f11,
})
}
pub(crate) fn write_json(&self, w: &mut JsonWriter<'_>, target_class: Option<&'static str>) -> Result<(), Error> {
w.begin_object(1087)?;
if let Some(class) = target_class {
w.target_class(class)?;
}
if let Some(v) = &self.is_blank {
w.key(1010)?;
w.boolean(*v)?;
}
if let Some(v) = &self.legally_binding {
w.key(1053)?;
w.boolean(*v)?;
}
if let Some(v) = &self.legal_basis {
w.key(1051)?;
w.multilingual(v)?;
}
if let Some(v) = &self.display_area_settings_extension {
w.key(2599)?;
w.extension(v)?;
}
if let Some(v) = &self.supplementary_information_display_extension {
w.key(2624)?;
w.extension(v)?;
}
if let Some(v) = &self.pictogram_description {
w.key(1583)?;
w.enumeration(1084, v.literal())?;
}
if let Some(v) = &self.pictogram_code {
w.key(1581)?;
w.max_len("pictogramCode", "String", v, 1024)?; w.string(v)?;
}
if let Some(v) = &self.pictogram_url {
w.key(1589)?;
w.string(v)?;
}
if let Some(v) = &self.additional_description {
w.key(59)?;
w.multilingual(v)?;
}
if let Some(v) = &self.pictogram_flashing {
w.key(1585)?;
w.boolean(*v)?;
}
if let Some(v) = &self.pictogram_information_type {
w.key(1587)?;
w.enumeration(1069, v.literal())?;
}
if let Some(v) = &self.supplementary_pictogram_extension {
w.key(2628)?;
w.extension(v)?;
}
w.end_object()
}
}
/// XML type `vms:SupplementaryText`.
#[derive(Debug, Clone, Default, PartialEq)]
pub struct SupplementaryText {
/// XML element `vms:isBlank`.
pub is_blank: Option<com::Boolean>,
/// XML element `vms:legallyBinding`.
pub legally_binding: Option<com::Boolean>,
/// XML element `vms:legalBasis`.
pub legal_basis: Option<MultilingualString>,
/// XML element `vms:_displayAreaSettingsExtension`.
pub display_area_settings_extension: Option<Box<Extension>>,
/// XML element `vms:_supplementaryInformationDisplayExtension`.
pub supplementary_information_display_extension: Option<Box<Extension>>,
/// XML element `vms:textLine`.
pub text_line: Option<Box<TextLine>>,
/// XML element `vms:_supplementaryTextExtension`.
pub supplementary_text_extension: Option<Box<Extension>>,
}
impl SupplementaryText {
const FIELDS: &'static [u32] = &[0x1708d7, 0x170902, 0x170900, 0x170489, 0x170608, 0x170c10, 0x17060d];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x170215);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x1708d7 => { let v = r.value::<bool>()?; r.set(&mut e0, v, 2263); }
0x170902 => { let v = r.value::<bool>()?; r.set(&mut e1, v, 2306); }
0x170900 => { let v = r.multilingual()?; r.set(&mut e2, v, 2304); }
0x170489 => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1161); }
0x170608 => { let v = r.raw()?; r.set(&mut e4, v.map(Box::new), 1544); }
0x170c10 => { let v = Some(TextLine::read(r)?); r.set(&mut e5, v.map(Box::new), 3088); }
0x17060d => { let v = r.raw()?; r.set(&mut e6, v.map(Box::new), 1549); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e5, 3088);
let v = Self {
is_blank: e0,
legally_binding: e1,
legal_basis: e2,
display_area_settings_extension: e3,
supplementary_information_display_extension: e4,
text_line: e5,
supplementary_text_extension: e6,
};
r.close();
Ok(v)
}
}
impl SupplementaryText {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.is_blank { w.leaf("vms:isBlank", v)?; }
if let Some(v) = &self.legally_binding { w.leaf("vms:legallyBinding", v)?; }
if let Some(v) = &self.legal_basis { w.multilingual("vms:legalBasis", v)?; }
if let Some(v) = &self.display_area_settings_extension { w.extension("vms:_displayAreaSettingsExtension", v)?; }
if let Some(v) = &self.supplementary_information_display_extension { w.extension("vms:_supplementaryInformationDisplayExtension", v)?; }
match &self.text_line {
Some(v) => { v.write(w, "vms:textLine", "", "")?; }
None => return Err(w.missing("vms:textLine")),
}
if let Some(v) = &self.supplementary_text_extension { w.extension("vms:_supplementaryTextExtension", v)?; }
w.end(tag)
}
}
impl SupplementaryText {
pub(crate) fn read_json(r: &mut JsonReader<'_>) -> Result<Option<Self>, Error> {
if !r.begin_object()? {
return Ok(None);
}
Self::read_json_members(r, None).map(Some)
}
/// Reads the members of an object that is already open; `pending` is a member key read
/// already.
pub(crate) fn read_json_members(r: &mut JsonReader<'_>, mut pending: Option<u32>) -> Result<Self, Error> {
let mut seen = [false; 7];
let mut f0 = None;
let mut f1 = None;
let mut f2 = None;
let mut f3 = None;
let mut f4 = None;
let mut f5 = None;
let mut f6 = None;
loop {
let key = match pending.take() {
Some(key) => key,
None => match r.next_key()? {
Some(key) => key,
None => break,
},
};
match key {
1010 => if r.first(&mut seen[0])? { f0 = r.boolean()?; },
1053 => if r.first(&mut seen[1])? { f1 = r.boolean()?; },
1051 => if r.first(&mut seen[2])? { f2 = r.multilingual()?; },
2599 => if r.first(&mut seen[3])? { f3 = r.raw_object()?.map(Box::new); },
2624 => if r.first(&mut seen[4])? { f4 = r.raw_object()?.map(Box::new); },
2251 => if r.first(&mut seen[5])? { f5 = TextLine::read_json(r)?.map(Box::new); },
2630 => if r.first(&mut seen[6])? { f6 = r.raw_object()?.map(Box::new); },
_ => r.skip_unknown()?,
}
}
r.required(&f5, 2251);
Ok(Self {
is_blank: f0,
legally_binding: f1,
legal_basis: f2,
display_area_settings_extension: f3,
supplementary_information_display_extension: f4,
text_line: f5,
supplementary_text_extension: f6,
})
}
pub(crate) fn write_json(&self, w: &mut JsonWriter<'_>, target_class: Option<&'static str>) -> Result<(), Error> {
w.begin_object(1088)?;
if let Some(class) = target_class {
w.target_class(class)?;
}
if let Some(v) = &self.is_blank {
w.key(1010)?;
w.boolean(*v)?;
}
if let Some(v) = &self.legally_binding {
w.key(1053)?;
w.boolean(*v)?;
}
if let Some(v) = &self.legal_basis {
w.key(1051)?;
w.multilingual(v)?;
}
if let Some(v) = &self.display_area_settings_extension {
w.key(2599)?;
w.extension(v)?;
}
if let Some(v) = &self.supplementary_information_display_extension {
w.key(2624)?;
w.extension(v)?;
}
match &self.text_line {
Some(v) => {
w.key(2251)?;
v.write_json(w, None)?;
}
None => w.absent(2251, w.missing("textLine"))?,
}
if let Some(v) = &self.supplementary_text_extension {
w.key(2630)?;
w.extension(v)?;
}
w.end_object()
}
}
/// XML type `vms:TextDisplay`.
#[derive(Debug, Clone, Default, PartialEq)]
pub struct TextDisplay {
/// XML element `vms:isBlank`.
pub is_blank: Option<com::Boolean>,
/// XML element `vms:legallyBinding`.
pub legally_binding: Option<com::Boolean>,
/// XML element `vms:legalBasis`.
pub legal_basis: Option<MultilingualString>,
/// XML element `vms:_displayAreaSettingsExtension`.
pub display_area_settings_extension: Option<Box<Extension>>,
/// XML element `vms:textCode`.
pub text_code: Option<String>,
/// XML element `vms:textImageUrl`.
pub text_image_url: Option<com::Url>,
/// XML element `vms:textLine`.
pub text_line: Vec<TextDisplayLineIndexTextLine>,
/// XML element `vms:_textDisplayExtension`.
pub text_display_extension: Option<Box<Extension>>,
}
impl TextDisplay {
const FIELDS: &'static [u32] = &[0x1708d7, 0x170902, 0x170900, 0x170489, 0x170c0c, 0x170c0e, 0x170c10, 0x170617];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x17021e);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = Vec::new();
let mut e7 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x1708d7 => { let v = r.value::<bool>()?; r.set(&mut e0, v, 2263); }
0x170902 => { let v = r.value::<bool>()?; r.set(&mut e1, v, 2306); }
0x170900 => { let v = r.multilingual()?; r.set(&mut e2, v, 2304); }
0x170489 => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1161); }
0x170c0c => { let v = r.string()?; r.set(&mut e4, v, 3084); }
0x170c0e => { let v = r.string()?; r.set(&mut e5, v, 3086); }
0x170c10 => { let v = Some(TextDisplayLineIndexTextLine::read(r)?); e6.extend(v); }
0x170617 => { let v = r.raw()?; r.set(&mut e7, v.map(Box::new), 1559); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
is_blank: e0,
legally_binding: e1,
legal_basis: e2,
display_area_settings_extension: e3,
text_code: e4,
text_image_url: e5,
text_line: e6,
text_display_extension: e7,
};
r.close();
Ok(v)
}
}
impl TextDisplay {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.is_blank { w.leaf("vms:isBlank", v)?; }
if let Some(v) = &self.legally_binding { w.leaf("vms:legallyBinding", v)?; }
if let Some(v) = &self.legal_basis { w.multilingual("vms:legalBasis", v)?; }
if let Some(v) = &self.display_area_settings_extension { w.extension("vms:_displayAreaSettingsExtension", v)?; }
if let Some(v) = &self.text_code { w.max_len("textCode", "String", v, 1024)?; w.leaf("vms:textCode", v)?; }
if let Some(v) = &self.text_image_url { w.leaf("vms:textImageUrl", v)?; }
for v in &self.text_line { v.write(w, "vms:textLine", "", "")?; }
if let Some(v) = &self.text_display_extension { w.extension("vms:_textDisplayExtension", v)?; }
w.end(tag)
}
}
impl TextDisplay {
pub(crate) fn read_json(r: &mut JsonReader<'_>) -> Result<Option<Self>, Error> {
if !r.begin_object()? {
return Ok(None);
}
Self::read_json_members(r, None).map(Some)
}
/// Reads the members of an object that is already open; `pending` is a member key read
/// already.
pub(crate) fn read_json_members(r: &mut JsonReader<'_>, mut pending: Option<u32>) -> Result<Self, Error> {
let mut seen = [false; 8];
let mut f0 = None;
let mut f1 = None;
let mut f2 = None;
let mut f3 = None;
let mut f4 = None;
let mut f5 = None;
let mut f6 = Vec::new();
let mut f7 = None;
loop {
let key = match pending.take() {
Some(key) => key,
None => match r.next_key()? {
Some(key) => key,
None => break,
},
};
match key {
1010 => if r.first(&mut seen[0])? { f0 = r.boolean()?; },
1053 => if r.first(&mut seen[1])? { f1 = r.boolean()?; },
1051 => if r.first(&mut seen[2])? { f2 = r.multilingual()?; },
2599 => if r.first(&mut seen[3])? { f3 = r.raw_object()?.map(Box::new); },
2247 => if r.first(&mut seen[4])? { f4 = r.string()?; },
2249 => if r.first(&mut seen[5])? { f5 = r.string()?; },
2251 => if r.first(&mut seen[6])? { let mut l = r.list()?; while r.item(&mut l)? { if let Some(v) = TextDisplayLineIndexTextLine::read_json(r)? { f6.push(v); } } },
2634 => if r.first(&mut seen[7])? { f7 = r.raw_object()?.map(Box::new); },
_ => r.skip_unknown()?,
}
}
Ok(Self {
is_blank: f0,
legally_binding: f1,
legal_basis: f2,
display_area_settings_extension: f3,
text_code: f4,
text_image_url: f5,
text_line: f6,
text_display_extension: f7,
})
}
pub(crate) fn write_json(&self, w: &mut JsonWriter<'_>, target_class: Option<&'static str>) -> Result<(), Error> {
w.begin_object(1089)?;
if let Some(class) = target_class {
w.target_class(class)?;
}
if let Some(v) = &self.is_blank {
w.key(1010)?;
w.boolean(*v)?;
}
if let Some(v) = &self.legally_binding {
w.key(1053)?;
w.boolean(*v)?;
}
if let Some(v) = &self.legal_basis {
w.key(1051)?;
w.multilingual(v)?;
}
if let Some(v) = &self.display_area_settings_extension {
w.key(2599)?;
w.extension(v)?;
}
if let Some(v) = &self.text_code {
w.key(2247)?;
w.max_len("textCode", "String", v, 1024)?; w.string(v)?;
}
if let Some(v) = &self.text_image_url {
w.key(2249)?;
w.string(v)?;
}
if !self.text_line.is_empty() {
w.key(2251)?;
w.begin_array()?;
for v in &self.text_line {
w.item()?;
v.write_json(w, None)?;
}
w.end_array()?;
}
if let Some(v) = &self.text_display_extension {
w.key(2634)?;
w.extension(v)?;
}
w.end_object()
}
}
/// XML type `vms:TextDisplayArea`.
#[derive(Debug, Clone, Default, PartialEq)]
pub struct TextDisplayArea {
/// XML element `vms:sequencingCapable`.
pub sequencing_capable: Option<com::Boolean>,
/// XML element `vms:maxNumberOfSequentialPages`.
pub max_number_of_sequential_pages: Option<com::NonNegativeInteger>,
/// XML element `vms:positionXAbsolute`.
pub position_x_absolute: Option<PositionXAbsoluteEnum>,
/// XML element `vms:positionXRelativeToPrevious`.
pub position_x_relative_to_previous: Option<PositionXRelativeEnum>,
/// XML element `vms:positionYAbsolute`.
pub position_y_absolute: Option<PositionYAbsoluteEnum>,
/// XML element `vms:positionYRelativeToPrevious`.
pub position_y_relative_to_previous: Option<PositionYRelativeEnum>,
/// XML element `vms:displayGeometry`.
pub display_geometry: Option<Box<DisplayGeometry>>,
/// XML element `vms:overriddenLaneAssociation`.
pub overridden_lane_association: Vec<loc::Lane>,
/// XML element `vms:_displayAreaExtension`.
pub display_area_extension: Option<Box<Extension>>,
/// XML element `vms:proportionalFont`.
pub proportional_font: Option<com::Boolean>,
/// XML element `vms:maxNumberOfCharacters`.
pub max_number_of_characters: Option<com::NonNegativeInteger>,
/// XML element `vms:maxNumberOfRows`.
pub max_number_of_rows: Option<com::NonNegativeInteger>,
/// XML element `vms:textCodeListIdentifier`.
pub text_code_list_identifier: Option<String>,
/// XML element `vms:maxFontHeight`.
pub max_font_height: Option<com::NonNegativeInteger>,
/// XML element `vms:minFontHeight`.
pub min_font_height: Option<com::NonNegativeInteger>,
/// XML element `vms:maxFontWidth`.
pub max_font_width: Option<com::NonNegativeInteger>,
/// XML element `vms:minFontWidth`.
pub min_font_width: Option<com::NonNegativeInteger>,
/// XML element `vms:maxFontSpacing`.
pub max_font_spacing: Option<com::NonNegativeInteger>,
/// XML element `vms:minFontSpacing`.
pub min_font_spacing: Option<com::NonNegativeInteger>,
/// XML element `vms:_textDisplayAreaExtension`.
pub text_display_area_extension: Option<Box<Extension>>,
}
impl TextDisplayArea {
const FIELDS: &'static [u32] = &[0x170b7a, 0x17093f, 0x170a98, 0x170a99, 0x170a9b, 0x170a9c, 0x1707c8, 0x170a39, 0x170488, 0x170acb, 0x17093d, 0x17093e, 0x170c0d, 0x17093a, 0x170971, 0x17093c, 0x170973, 0x17093b, 0x170972, 0x170616];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x17021f);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = None;
let mut e7 = Vec::new();
let mut e8 = None;
let mut e9 = None;
let mut e10 = None;
let mut e11 = None;
let mut e12 = None;
let mut e13 = None;
let mut e14 = None;
let mut e15 = None;
let mut e16 = None;
let mut e17 = None;
let mut e18 = None;
let mut e19 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x170b7a => { let v = r.value::<bool>()?; r.set(&mut e0, v, 2938); }
0x17093f => { let v = r.value::<u64>()?; r.set(&mut e1, v, 2367); }
0x170a98 => { let v = r.enumeration::<PositionXAbsoluteEnum>()?; r.set(&mut e2, v, 2712); }
0x170a99 => { let v = r.enumeration::<PositionXRelativeEnum>()?; r.set(&mut e3, v, 2713); }
0x170a9b => { let v = r.enumeration::<PositionYAbsoluteEnum>()?; r.set(&mut e4, v, 2715); }
0x170a9c => { let v = r.enumeration::<PositionYRelativeEnum>()?; r.set(&mut e5, v, 2716); }
0x1707c8 => { let v = Some(DisplayGeometry::read(r)?); r.set(&mut e6, v.map(Box::new), 1992); }
0x170a39 => { let v = Some(loc::Lane::read(r)?); e7.extend(v); }
0x170488 => { let v = r.raw()?; r.set(&mut e8, v.map(Box::new), 1160); }
0x170acb => { let v = r.value::<bool>()?; r.set(&mut e9, v, 2763); }
0x17093d => { let v = r.value::<u64>()?; r.set(&mut e10, v, 2365); }
0x17093e => { let v = r.value::<u64>()?; r.set(&mut e11, v, 2366); }
0x170c0d => { let v = r.string()?; r.set(&mut e12, v, 3085); }
0x17093a => { let v = r.value::<u64>()?; r.set(&mut e13, v, 2362); }
0x170971 => { let v = r.value::<u64>()?; r.set(&mut e14, v, 2417); }
0x17093c => { let v = r.value::<u64>()?; r.set(&mut e15, v, 2364); }
0x170973 => { let v = r.value::<u64>()?; r.set(&mut e16, v, 2419); }
0x17093b => { let v = r.value::<u64>()?; r.set(&mut e17, v, 2363); }
0x170972 => { let v = r.value::<u64>()?; r.set(&mut e18, v, 2418); }
0x170616 => { let v = r.raw()?; r.set(&mut e19, v.map(Box::new), 1558); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
sequencing_capable: e0,
max_number_of_sequential_pages: e1,
position_x_absolute: e2,
position_x_relative_to_previous: e3,
position_y_absolute: e4,
position_y_relative_to_previous: e5,
display_geometry: e6,
overridden_lane_association: e7,
display_area_extension: e8,
proportional_font: e9,
max_number_of_characters: e10,
max_number_of_rows: e11,
text_code_list_identifier: e12,
max_font_height: e13,
min_font_height: e14,
max_font_width: e15,
min_font_width: e16,
max_font_spacing: e17,
min_font_spacing: e18,
text_display_area_extension: e19,
};
r.close();
Ok(v)
}
}
impl TextDisplayArea {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.sequencing_capable { w.leaf("vms:sequencingCapable", v)?; }
if let Some(v) = &self.max_number_of_sequential_pages { w.leaf("vms:maxNumberOfSequentialPages", v)?; }
if let Some(v) = &self.position_x_absolute { w.enumeration("vms:positionXAbsolute", v.literal())?; }
if let Some(v) = &self.position_x_relative_to_previous { w.enumeration("vms:positionXRelativeToPrevious", v.literal())?; }
if let Some(v) = &self.position_y_absolute { w.enumeration("vms:positionYAbsolute", v.literal())?; }
if let Some(v) = &self.position_y_relative_to_previous { w.enumeration("vms:positionYRelativeToPrevious", v.literal())?; }
if let Some(v) = &self.display_geometry { v.write(w, "vms:displayGeometry", "", "")?; }
for v in &self.overridden_lane_association { v.write(w, "vms:overriddenLaneAssociation", "", "")?; }
if let Some(v) = &self.display_area_extension { w.extension("vms:_displayAreaExtension", v)?; }
if let Some(v) = &self.proportional_font { w.leaf("vms:proportionalFont", v)?; }
if let Some(v) = &self.max_number_of_characters { w.leaf("vms:maxNumberOfCharacters", v)?; }
if let Some(v) = &self.max_number_of_rows { w.leaf("vms:maxNumberOfRows", v)?; }
if let Some(v) = &self.text_code_list_identifier { w.max_len("textCodeListIdentifier", "String", v, 1024)?; w.leaf("vms:textCodeListIdentifier", v)?; }
if let Some(v) = &self.max_font_height { w.leaf("vms:maxFontHeight", v)?; }
if let Some(v) = &self.min_font_height { w.leaf("vms:minFontHeight", v)?; }
if let Some(v) = &self.max_font_width { w.leaf("vms:maxFontWidth", v)?; }
if let Some(v) = &self.min_font_width { w.leaf("vms:minFontWidth", v)?; }
if let Some(v) = &self.max_font_spacing { w.leaf("vms:maxFontSpacing", v)?; }
if let Some(v) = &self.min_font_spacing { w.leaf("vms:minFontSpacing", v)?; }
if let Some(v) = &self.text_display_area_extension { w.extension("vms:_textDisplayAreaExtension", v)?; }
w.end(tag)
}
}
impl TextDisplayArea {
pub(crate) fn read_json(r: &mut JsonReader<'_>) -> Result<Option<Self>, Error> {
if !r.begin_object()? {
return Ok(None);
}
Self::read_json_members(r, None).map(Some)
}
/// Reads the members of an object that is already open; `pending` is a member key read
/// already.
pub(crate) fn read_json_members(r: &mut JsonReader<'_>, mut pending: Option<u32>) -> Result<Self, Error> {
let mut seen = [false; 20];
let mut f0 = None;
let mut f1 = None;
let mut f2 = None;
let mut f3 = None;
let mut f4 = None;
let mut f5 = None;
let mut f6 = None;
let mut f7 = Vec::new();
let mut f8 = None;
let mut f9 = None;
let mut f10 = None;
let mut f11 = None;
let mut f12 = None;
let mut f13 = None;
let mut f14 = None;
let mut f15 = None;
let mut f16 = None;
let mut f17 = None;
let mut f18 = None;
let mut f19 = None;
loop {
let key = match pending.take() {
Some(key) => key,
None => match r.next_key()? {
Some(key) => key,
None => break,
},
};
match key {
2025 => if r.first(&mut seen[0])? { f0 = r.boolean()?; },
1268 => if r.first(&mut seen[1])? { f1 = r.number::<u64>()?; },
1610 => if r.first(&mut seen[2])? { f2 = r.enumeration::<PositionXAbsoluteEnum>()?; },
1611 => if r.first(&mut seen[3])? { f3 = r.enumeration::<PositionXRelativeEnum>()?; },
1613 => if r.first(&mut seen[4])? { f4 = r.enumeration::<PositionYAbsoluteEnum>()?; },
1614 => if r.first(&mut seen[5])? { f5 = r.enumeration::<PositionYRelativeEnum>()?; },
577 => if r.first(&mut seen[6])? { f6 = DisplayGeometry::read_json(r)?.map(Box::new); },
1516 => if r.first(&mut seen[7])? { let mut l = r.list()?; while r.item(&mut l)? { if let Some(v) = loc::Lane::read_json(r)? { f7.push(v); } } },
2598 => if r.first(&mut seen[8])? { f8 = r.raw_object()?.map(Box::new); },
1763 => if r.first(&mut seen[9])? { f9 = r.boolean()?; },
1266 => if r.first(&mut seen[10])? { f10 = r.number::<u64>()?; },
1267 => if r.first(&mut seen[11])? { f11 = r.number::<u64>()?; },
2248 => if r.first(&mut seen[12])? { f12 = r.string()?; },
1263 => if r.first(&mut seen[13])? { f13 = r.number::<u64>()?; },
1319 => if r.first(&mut seen[14])? { f14 = r.number::<u64>()?; },
1265 => if r.first(&mut seen[15])? { f15 = r.number::<u64>()?; },
1321 => if r.first(&mut seen[16])? { f16 = r.number::<u64>()?; },
1264 => if r.first(&mut seen[17])? { f17 = r.number::<u64>()?; },
1320 => if r.first(&mut seen[18])? { f18 = r.number::<u64>()?; },
2633 => if r.first(&mut seen[19])? { f19 = r.raw_object()?.map(Box::new); },
_ => r.skip_unknown()?,
}
}
Ok(Self {
sequencing_capable: f0,
max_number_of_sequential_pages: f1,
position_x_absolute: f2,
position_x_relative_to_previous: f3,
position_y_absolute: f4,
position_y_relative_to_previous: f5,
display_geometry: f6,
overridden_lane_association: f7,
display_area_extension: f8,
proportional_font: f9,
max_number_of_characters: f10,
max_number_of_rows: f11,
text_code_list_identifier: f12,
max_font_height: f13,
min_font_height: f14,
max_font_width: f15,
min_font_width: f16,
max_font_spacing: f17,
min_font_spacing: f18,
text_display_area_extension: f19,
})
}
pub(crate) fn write_json(&self, w: &mut JsonWriter<'_>, target_class: Option<&'static str>) -> Result<(), Error> {
w.begin_object(1090)?;
if let Some(class) = target_class {
w.target_class(class)?;
}
if let Some(v) = &self.sequencing_capable {
w.key(2025)?;
w.boolean(*v)?;
}
if let Some(v) = &self.max_number_of_sequential_pages {
w.key(1268)?;
w.integer(*v)?;
}
if let Some(v) = &self.position_x_absolute {
w.key(1610)?;
w.enumeration(1078, v.literal())?;
}
if let Some(v) = &self.position_x_relative_to_previous {
w.key(1611)?;
w.enumeration(1079, v.literal())?;
}
if let Some(v) = &self.position_y_absolute {
w.key(1613)?;
w.enumeration(1080, v.literal())?;
}
if let Some(v) = &self.position_y_relative_to_previous {
w.key(1614)?;
w.enumeration(1081, v.literal())?;
}
if let Some(v) = &self.display_geometry {
w.key(577)?;
v.write_json(w, None)?;
}
if !self.overridden_lane_association.is_empty() {
w.key(1516)?;
w.begin_array()?;
for v in &self.overridden_lane_association {
w.item()?;
v.write_json(w, None)?;
}
w.end_array()?;
}
if let Some(v) = &self.display_area_extension {
w.key(2598)?;
w.extension(v)?;
}
if let Some(v) = &self.proportional_font {
w.key(1763)?;
w.boolean(*v)?;
}
if let Some(v) = &self.max_number_of_characters {
w.key(1266)?;
w.integer(*v)?;
}
if let Some(v) = &self.max_number_of_rows {
w.key(1267)?;
w.integer(*v)?;
}
if let Some(v) = &self.text_code_list_identifier {
w.key(2248)?;
w.max_len("textCodeListIdentifier", "String", v, 1024)?; w.string(v)?;
}
if let Some(v) = &self.max_font_height {
w.key(1263)?;
w.integer(*v)?;
}
if let Some(v) = &self.min_font_height {
w.key(1319)?;
w.integer(*v)?;
}
if let Some(v) = &self.max_font_width {
w.key(1265)?;
w.integer(*v)?;
}
if let Some(v) = &self.min_font_width {
w.key(1321)?;
w.integer(*v)?;
}
if let Some(v) = &self.max_font_spacing {
w.key(1264)?;
w.integer(*v)?;
}
if let Some(v) = &self.min_font_spacing {
w.key(1320)?;
w.integer(*v)?;
}
if let Some(v) = &self.text_display_area_extension {
w.key(2633)?;
w.extension(v)?;
}
w.end_object()
}
}
/// XML type `vms:TextLine`.
#[derive(Debug, Clone, Default, PartialEq)]
pub struct TextLine {
/// XML attribute `lineLanguage`.
pub line_language: Option<com::Language>,
/// XML element `vms:textLine`.
pub text_line: Option<String>,
/// XML element `vms:lineColour`.
pub line_colour: Option<ColourEnum>,
/// XML element `vms:lineFlashing`.
pub line_flashing: Option<com::Boolean>,
/// XML element `vms:lineHtml`.
pub line_html: Option<String>,
/// XML element `vms:isExactTextOnSign`.
pub is_exact_text_on_sign: Option<com::Boolean>,
/// XML element `vms:textInformationType`.
pub text_information_type: Vec<InformationTypeEnum>,
/// XML element `vms:_textLineExtension`.
pub text_line_extension: Option<Box<Extension>>,
}
impl TextLine {
const FIELDS: &'static [u32] = &[0x170c10, 0x170909, 0x17090a, 0x17090b, 0x1708d8, 0x170c0f, 0x170618];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x170220);
let a0 = r.attr(2317);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = Vec::new();
let mut e6 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x170c10 => { let v = r.string()?; r.set(&mut e0, v, 3088); }
0x170909 => { let v = r.enumeration::<ColourEnum>()?; r.set(&mut e1, v, 2313); }
0x17090a => { let v = r.value::<bool>()?; r.set(&mut e2, v, 2314); }
0x17090b => { let v = r.string()?; r.set(&mut e3, v, 2315); }
0x1708d8 => { let v = r.value::<bool>()?; r.set(&mut e4, v, 2264); }
0x170c0f => { let v = r.enumeration::<InformationTypeEnum>()?; e5.extend(v); }
0x170618 => { let v = r.raw()?; r.set(&mut e6, v.map(Box::new), 1560); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 3088);
let v = Self {
line_language: a0,
text_line: e0,
line_colour: e1,
line_flashing: e2,
line_html: e3,
is_exact_text_on_sign: e4,
text_information_type: e5,
text_line_extension: e6,
};
r.close();
Ok(v)
}
}
impl TextLine {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.line_language { w.pattern("lineLanguage", "Language", v, Pattern::Language)?; w.attr("lineLanguage", v)?; }
match &self.text_line {
Some(v) => { w.max_len("textLine", "String", v, 1024)?; w.leaf("vms:textLine", v)?; }
None => return Err(w.missing("vms:textLine")),
}
if let Some(v) = &self.line_colour { w.enumeration("vms:lineColour", v.literal())?; }
if let Some(v) = &self.line_flashing { w.leaf("vms:lineFlashing", v)?; }
if let Some(v) = &self.line_html { w.max_len("lineHtml", "String", v, 1024)?; w.leaf("vms:lineHtml", v)?; }
if let Some(v) = &self.is_exact_text_on_sign { w.leaf("vms:isExactTextOnSign", v)?; }
for v in &self.text_information_type { w.enumeration("vms:textInformationType", v.literal())?; }
if let Some(v) = &self.text_line_extension { w.extension("vms:_textLineExtension", v)?; }
w.end(tag)
}
}
impl TextLine {
pub(crate) fn read_json(r: &mut JsonReader<'_>) -> Result<Option<Self>, Error> {
if !r.begin_object()? {
return Ok(None);
}
Self::read_json_members(r, None).map(Some)
}
/// Reads the members of an object that is already open; `pending` is a member key read
/// already.
pub(crate) fn read_json_members(r: &mut JsonReader<'_>, mut pending: Option<u32>) -> Result<Self, Error> {
let mut seen = [false; 8];
let mut f0 = None;
let mut f1 = None;
let mut f2 = None;
let mut f3 = None;
let mut f4 = None;
let mut f5 = None;
let mut f6 = Vec::new();
let mut f7 = None;
loop {
let key = match pending.take() {
Some(key) => key,
None => match r.next_key()? {
Some(key) => key,
None => break,
},
};
match key {
1064 => if r.first(&mut seen[0])? { f0 = r.string()?; },
2251 => if r.first(&mut seen[1])? { f1 = r.string()?; },
1060 => if r.first(&mut seen[2])? { f2 = r.enumeration::<ColourEnum>()?; },
1061 => if r.first(&mut seen[3])? { f3 = r.boolean()?; },
1062 => if r.first(&mut seen[4])? { f4 = r.string()?; },
1011 => if r.first(&mut seen[5])? { f5 = r.boolean()?; },
2250 => if r.first(&mut seen[6])? { let mut l = r.list()?; while r.item(&mut l)? { if let Some(v) = r.enumeration::<InformationTypeEnum>()? { f6.push(v); } } },
2635 => if r.first(&mut seen[7])? { f7 = r.raw_object()?.map(Box::new); },
_ => r.skip_unknown()?,
}
}
r.required(&f1, 2251);
Ok(Self {
line_language: f0,
text_line: f1,
line_colour: f2,
line_flashing: f3,
line_html: f4,
is_exact_text_on_sign: f5,
text_information_type: f6,
text_line_extension: f7,
})
}
pub(crate) fn write_json(&self, w: &mut JsonWriter<'_>, target_class: Option<&'static str>) -> Result<(), Error> {
w.begin_object(1091)?;
if let Some(class) = target_class {
w.target_class(class)?;
}
if let Some(v) = &self.line_language {
w.key(1064)?;
w.pattern("lineLanguage", "Language", v, Pattern::Language)?; w.string(v)?;
}
match &self.text_line {
Some(v) => {
w.key(2251)?;
w.max_len("textLine", "String", v, 1024)?; w.string(v)?;
}
None => w.absent(2251, w.missing("textLine"))?,
}
if let Some(v) = &self.line_colour {
w.key(1060)?;
w.enumeration(1053, v.literal())?;
}
if let Some(v) = &self.line_flashing {
w.key(1061)?;
w.boolean(*v)?;
}
if let Some(v) = &self.line_html {
w.key(1062)?;
w.max_len("lineHtml", "String", v, 1024)?; w.string(v)?;
}
if let Some(v) = &self.is_exact_text_on_sign {
w.key(1011)?;
w.boolean(*v)?;
}
if !self.text_information_type.is_empty() {
w.key(2250)?;
w.begin_array()?;
for v in &self.text_information_type {
w.item()?;
w.enumeration(1069, v.literal())?;
}
w.end_array()?;
}
if let Some(v) = &self.text_line_extension {
w.key(2635)?;
w.extension(v)?;
}
w.end_object()
}
}
/// XML type `vms:Vms`.
#[derive(Debug, Clone, Default, PartialEq)]
pub struct Vms {
/// XML element `vms:lanternsPresent`.
pub lanterns_present: Option<com::Boolean>,
/// XML element `vms:description`.
pub description: Option<MultilingualString>,
/// XML element `vms:owner`.
pub owner: Option<MultilingualString>,
/// XML element `vms:physicalSupport`.
pub physical_support: Option<PhysicalSupportEnum>,
/// XML element `vms:vmsType`.
pub vms_type: Option<VmsTypeEnum>,
/// XML element `vms:vmsTypeCode`.
pub vms_type_code: Option<String>,
/// XML element `vms:dynamicallyConfigurable`.
pub dynamically_configurable: Option<com::Boolean>,
/// XML element `vms:displayHeight`.
pub display_height: Option<com::MetresAsFloat>,
/// XML element `vms:displayWidth`.
pub display_width: Option<com::MetresAsFloat>,
/// XML element `vms:heightAboveCarriageway`.
pub height_above_carriageway: Option<com::MetresAsFloat>,
/// XML element `vms:dedicatedUsage`.
pub dedicated_usage: Option<DedicatedUsageEnum>,
/// XML element `vms:vmsConfiguration`.
pub vms_configuration: Option<Box<VmsConfiguration>>,
/// XML element `vms:vmsLocation`.
pub vms_location: Option<loc::Location>,
/// XML element `vms:managedLogicalLocation`.
pub managed_logical_location: Option<Box<ManagedLogicalLocation>>,
/// XML element `vms:imageLink`.
pub image_link: Option<Box<com::UrlLink>>,
/// XML element `vms:_vmsExtension`.
pub vms_extension: Option<Box<Extension>>,
}
impl Vms {
const FIELDS: &'static [u32] = &[0x1708ef, 0x1707a8, 0x170a3d, 0x170a78, 0x170cc6, 0x170cc7, 0x1707e3, 0x1707c9, 0x1707ca, 0x170898, 0x170795, 0x170cb6, 0x170cc1, 0x170930, 0x1708b4, 0x170676];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x17027b);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = None;
let mut e7 = None;
let mut e8 = None;
let mut e9 = None;
let mut e10 = None;
let mut e11 = None;
let mut e12 = None;
let mut e13 = None;
let mut e14 = None;
let mut e15 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x1708ef => { let v = r.value::<bool>()?; r.set(&mut e0, v, 2287); }
0x1707a8 => { let v = r.multilingual()?; r.set(&mut e1, v, 1960); }
0x170a3d => { let v = r.multilingual()?; r.set(&mut e2, v, 2621); }
0x170a78 => { let v = r.enumeration::<PhysicalSupportEnum>()?; r.set(&mut e3, v, 2680); }
0x170cc6 => { let v = r.enumeration::<VmsTypeEnum>()?; r.set(&mut e4, v, 3270); }
0x170cc7 => { let v = r.string()?; r.set(&mut e5, v, 3271); }
0x1707e3 => { let v = r.value::<bool>()?; r.set(&mut e6, v, 2019); }
0x1707c9 => { let v = r.value::<f32>()?; r.set(&mut e7, v, 1993); }
0x1707ca => { let v = r.value::<f32>()?; r.set(&mut e8, v, 1994); }
0x170898 => { let v = r.value::<f32>()?; r.set(&mut e9, v, 2200); }
0x170795 => { let v = r.enumeration::<DedicatedUsageEnum>()?; r.set(&mut e10, v, 1941); }
0x170cb6 => { let v = Some(VmsConfiguration::read(r)?); r.set(&mut e11, v.map(Box::new), 3254); }
0x170cc1 => { let v = loc::Location::read(r)?; r.set(&mut e12, v, 3265); }
0x170930 => { let v = Some(ManagedLogicalLocation::read(r)?); r.set(&mut e13, v.map(Box::new), 2352); }
0x1708b4 => { let v = Some(com::UrlLink::read(r)?); r.set(&mut e14, v.map(Box::new), 2228); }
0x170676 => { let v = r.raw()?; r.set(&mut e15, v.map(Box::new), 1654); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e11, 3254);
let v = Self {
lanterns_present: e0,
description: e1,
owner: e2,
physical_support: e3,
vms_type: e4,
vms_type_code: e5,
dynamically_configurable: e6,
display_height: e7,
display_width: e8,
height_above_carriageway: e9,
dedicated_usage: e10,
vms_configuration: e11,
vms_location: e12,
managed_logical_location: e13,
image_link: e14,
vms_extension: e15,
};
r.close();
Ok(v)
}
}
impl Vms {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.lanterns_present { w.leaf("vms:lanternsPresent", v)?; }
if let Some(v) = &self.description { w.multilingual("vms:description", v)?; }
if let Some(v) = &self.owner { w.multilingual("vms:owner", v)?; }
if let Some(v) = &self.physical_support { w.enumeration("vms:physicalSupport", v.literal())?; }
if let Some(v) = &self.vms_type { w.enumeration("vms:vmsType", v.literal())?; }
if let Some(v) = &self.vms_type_code { w.max_len("vmsTypeCode", "String", v, 1024)?; w.leaf("vms:vmsTypeCode", v)?; }
if let Some(v) = &self.dynamically_configurable { w.leaf("vms:dynamicallyConfigurable", v)?; }
if let Some(v) = &self.display_height { w.leaf("vms:displayHeight", v)?; }
if let Some(v) = &self.display_width { w.leaf("vms:displayWidth", v)?; }
if let Some(v) = &self.height_above_carriageway { w.leaf("vms:heightAboveCarriageway", v)?; }
if let Some(v) = &self.dedicated_usage { w.enumeration("vms:dedicatedUsage", v.literal())?; }
match &self.vms_configuration {
Some(v) => { v.write(w, "vms:vmsConfiguration", "", "")?; }
None => return Err(w.missing("vms:vmsConfiguration")),
}
if let Some(v) = &self.vms_location { v.write(w, "vms:vmsLocation")?; }
if let Some(v) = &self.managed_logical_location { v.write(w, "vms:managedLogicalLocation", "", "")?; }
if let Some(v) = &self.image_link { v.write(w, "vms:imageLink", "", "")?; }
if let Some(v) = &self.vms_extension { w.extension("vms:_vmsExtension", v)?; }
w.end(tag)
}
}
impl Vms {
pub(crate) fn read_json(r: &mut JsonReader<'_>) -> Result<Option<Self>, Error> {
if !r.begin_object()? {
return Ok(None);
}
Self::read_json_members(r, None).map(Some)
}
/// Reads the members of an object that is already open; `pending` is a member key read
/// already.
pub(crate) fn read_json_members(r: &mut JsonReader<'_>, mut pending: Option<u32>) -> Result<Self, Error> {
let mut seen = [false; 16];
let mut f0 = None;
let mut f1 = None;
let mut f2 = None;
let mut f3 = None;
let mut f4 = None;
let mut f5 = None;
let mut f6 = None;
let mut f7 = None;
let mut f8 = None;
let mut f9 = None;
let mut f10 = None;
let mut f11 = None;
let mut f12 = None;
let mut f13 = None;
let mut f14 = None;
let mut f15 = None;
loop {
let key = match pending.take() {
Some(key) => key,
None => match r.next_key()? {
Some(key) => key,
None => break,
},
};
match key {
1034 => if r.first(&mut seen[0])? { f0 = r.boolean()?; },
545 => if r.first(&mut seen[1])? { f1 = r.multilingual()?; },
1520 => if r.first(&mut seen[2])? { f2 = r.multilingual()?; },
1578 => if r.first(&mut seen[3])? { f3 = r.enumeration::<PhysicalSupportEnum>()?; },
2636 => if r.first(&mut seen[4])? { f4 = r.enumeration::<VmsTypeEnum>()?; },
2637 => if r.first(&mut seen[5])? { f5 = r.string()?; },
604 => if r.first(&mut seen[6])? { f6 = r.boolean()?; },
578 => if r.first(&mut seen[7])? { f7 = r.number::<f32>()?; },
579 => if r.first(&mut seen[8])? { f8 = r.number::<f32>()?; },
945 => if r.first(&mut seen[9])? { f9 = r.number::<f32>()?; },
526 => if r.first(&mut seen[10])? { f10 = r.enumeration::<DedicatedUsageEnum>()?; },
2589 => if r.first(&mut seen[11])? { f11 = VmsConfiguration::read_json(r)?.map(Box::new); },
2609 => if r.first(&mut seen[12])? { f12 = loc::Location::read_json(r)?; },
1253 => if r.first(&mut seen[13])? { f13 = ManagedLogicalLocation::read_json(r)?.map(Box::new); },
973 => if r.first(&mut seen[14])? { f14 = com::UrlLink::read_json(r)?.map(Box::new); },
2647 => if r.first(&mut seen[15])? { f15 = r.raw_object()?.map(Box::new); },
_ => r.skip_unknown()?,
}
}
r.required(&f11, 2589);
Ok(Self {
lanterns_present: f0,
description: f1,
owner: f2,
physical_support: f3,
vms_type: f4,
vms_type_code: f5,
dynamically_configurable: f6,
display_height: f7,
display_width: f8,
height_above_carriageway: f9,
dedicated_usage: f10,
vms_configuration: f11,
vms_location: f12,
managed_logical_location: f13,
image_link: f14,
vms_extension: f15,
})
}
pub(crate) fn write_json(&self, w: &mut JsonWriter<'_>, target_class: Option<&'static str>) -> Result<(), Error> {
w.begin_object(1093)?;
if let Some(class) = target_class {
w.target_class(class)?;
}
if let Some(v) = &self.lanterns_present {
w.key(1034)?;
w.boolean(*v)?;
}
if let Some(v) = &self.description {
w.key(545)?;
w.multilingual(v)?;
}
if let Some(v) = &self.owner {
w.key(1520)?;
w.multilingual(v)?;
}
if let Some(v) = &self.physical_support {
w.key(1578)?;
w.enumeration(1073, v.literal())?;
}
if let Some(v) = &self.vms_type {
w.key(2636)?;
w.enumeration(1106, v.literal())?;
}
if let Some(v) = &self.vms_type_code {
w.key(2637)?;
w.max_len("vmsTypeCode", "String", v, 1024)?; w.string(v)?;
}
if let Some(v) = &self.dynamically_configurable {
w.key(604)?;
w.boolean(*v)?;
}
if let Some(v) = &self.display_height {
w.key(578)?;
w.float32(*v)?;
}
if let Some(v) = &self.display_width {
w.key(579)?;
w.float32(*v)?;
}
if let Some(v) = &self.height_above_carriageway {
w.key(945)?;
w.float32(*v)?;
}
if let Some(v) = &self.dedicated_usage {
w.key(526)?;
w.enumeration(1056, v.literal())?;
}
match &self.vms_configuration {
Some(v) => {
w.key(2589)?;
v.write_json(w, None)?;
}
None => w.absent(2589, w.missing("vmsConfiguration"))?,
}
if let Some(v) = &self.vms_location {
w.key(2609)?;
v.write_json(w)?;
}
if let Some(v) = &self.managed_logical_location {
w.key(1253)?;
v.write_json(w, None)?;
}
if let Some(v) = &self.image_link {
w.key(973)?;
v.write_json(w, None)?;
}
if let Some(v) = &self.vms_extension {
w.key(2647)?;
w.extension(v)?;
}
w.end_object()
}
}
/// XML type `vms:VmsConfiguration`.
#[derive(Debug, Clone, Default, PartialEq)]
pub struct VmsConfiguration {
/// XML element `vms:numberOfDisplayAreas`.
pub number_of_display_areas: Option<com::NonNegativeInteger>,
/// XML element `vms:displayArea`.
pub display_area: Vec<VmsConfigurationDisplayAreaIndexDisplayArea>,
/// XML element `vms:_vmsConfigurationExtension`.
pub vms_configuration_extension: Option<Box<Extension>>,
}
impl VmsConfiguration {
const FIELDS: &'static [u32] = &[0x1709b7, 0x1707c5, 0x170671];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x17027c);
r.attrs_done();
let mut e0 = None;
let mut e1 = Vec::new();
let mut e2 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x1709b7 => { let v = r.value::<u64>()?; r.set(&mut e0, v, 2487); }
0x1707c5 => { let v = Some(VmsConfigurationDisplayAreaIndexDisplayArea::read(r)?); e1.extend(v); }
0x170671 => { let v = r.raw()?; r.set(&mut e2, v.map(Box::new), 1649); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
number_of_display_areas: e0,
display_area: e1,
vms_configuration_extension: e2,
};
r.close();
Ok(v)
}
}
impl VmsConfiguration {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.number_of_display_areas { w.leaf("vms:numberOfDisplayAreas", v)?; }
for v in &self.display_area { v.write(w, "vms:displayArea", "", "")?; }
if let Some(v) = &self.vms_configuration_extension { w.extension("vms:_vmsConfigurationExtension", v)?; }
w.end(tag)
}
}
impl VmsConfiguration {
pub(crate) fn read_json(r: &mut JsonReader<'_>) -> Result<Option<Self>, Error> {
if !r.begin_object()? {
return Ok(None);
}
Self::read_json_members(r, None).map(Some)
}
/// Reads the members of an object that is already open; `pending` is a member key read
/// already.
pub(crate) fn read_json_members(r: &mut JsonReader<'_>, mut pending: Option<u32>) -> Result<Self, Error> {
let mut seen = [false; 3];
let mut f0 = None;
let mut f1 = Vec::new();
let mut f2 = None;
loop {
let key = match pending.take() {
Some(key) => key,
None => match r.next_key()? {
Some(key) => key,
None => break,
},
};
match key {
1387 => if r.first(&mut seen[0])? { f0 = r.number::<u64>()?; },
574 => if r.first(&mut seen[1])? { let mut l = r.list()?; while r.item(&mut l)? { if let Some(v) = VmsConfigurationDisplayAreaIndexDisplayArea::read_json(r)? { f1.push(v); } } },
2641 => if r.first(&mut seen[2])? { f2 = r.raw_object()?.map(Box::new); },
_ => r.skip_unknown()?,
}
}
Ok(Self {
number_of_display_areas: f0,
display_area: f1,
vms_configuration_extension: f2,
})
}
pub(crate) fn write_json(&self, w: &mut JsonWriter<'_>, target_class: Option<&'static str>) -> Result<(), Error> {
w.begin_object(1094)?;
if let Some(class) = target_class {
w.target_class(class)?;
}
if let Some(v) = &self.number_of_display_areas {
w.key(1387)?;
w.integer(*v)?;
}
if !self.display_area.is_empty() {
w.key(574)?;
w.begin_array()?;
for v in &self.display_area {
w.item()?;
v.write_json(w, None)?;
}
w.end_array()?;
}
if let Some(v) = &self.vms_configuration_extension {
w.key(2641)?;
w.extension(v)?;
}
w.end_object()
}
}
/// XML type `vms:VmsController`.
#[derive(Debug, Clone, Default, PartialEq)]
pub struct VmsController {
/// XML attribute `id`.
pub id: Option<String>,
/// XML attribute `version`.
pub version: Option<String>,
/// XML element `vms:numberOfVms`.
pub number_of_vms: Option<com::NonNegativeInteger>,
/// XML element `vms:externalIdentifier`.
pub external_identifier: Option<String>,
/// XML element `vms:ipAddress`.
pub ip_address: Option<String>,
/// XML element `vms:electronicAddress`.
pub electronic_address: Option<String>,
/// XML element `vms:vms`.
pub vms: Vec<VmsControllerVmsIndexVms>,
/// XML element `vms:_vmsControllerExtension`.
pub vms_controller_extension: Option<Box<Extension>>,
}
impl VmsController {
const FIELDS: &'static [u32] = &[0x1709d1, 0x170840, 0x1708d5, 0x1707ee, 0x170cb5, 0x170672];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x17027d);
let a0 = r.req_attr(2219);
let a1 = r.req_attr(3245);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = Vec::new();
let mut e5 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x1709d1 => { let v = r.value::<u64>()?; r.set(&mut e0, v, 2513); }
0x170840 => { let v = r.string()?; r.set(&mut e1, v, 2112); }
0x1708d5 => { let v = r.string()?; r.set(&mut e2, v, 2261); }
0x1707ee => { let v = r.string()?; r.set(&mut e3, v, 2030); }
0x170cb5 => { let v = Some(VmsControllerVmsIndexVms::read(r)?); e4.extend(v); }
0x170672 => { let v = r.raw()?; r.set(&mut e5, v.map(Box::new), 1650); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
id: a0,
version: a1,
number_of_vms: e0,
external_identifier: e1,
ip_address: e2,
electronic_address: e3,
vms: e4,
vms_controller_extension: e5,
};
r.close();
Ok(v)
}
}
impl VmsController {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.id {
Some(v) => { w.attr("id", v)?; }
None => return Err(w.missing_attr("id")),
}
match &self.version {
Some(v) => { w.attr("version", v)?; }
None => return Err(w.missing_attr("version")),
}
if let Some(v) = &self.number_of_vms { w.leaf("vms:numberOfVms", v)?; }
if let Some(v) = &self.external_identifier { w.max_len("externalIdentifier", "String", v, 1024)?; w.leaf("vms:externalIdentifier", v)?; }
if let Some(v) = &self.ip_address { w.max_len("ipAddress", "String", v, 1024)?; w.leaf("vms:ipAddress", v)?; }
if let Some(v) = &self.electronic_address { w.max_len("electronicAddress", "String", v, 1024)?; w.leaf("vms:electronicAddress", v)?; }
for v in &self.vms { v.write(w, "vms:vms", "", "")?; }
if let Some(v) = &self.vms_controller_extension { w.extension("vms:_vmsControllerExtension", v)?; }
w.end(tag)
}
}
impl VmsController {
pub(crate) fn read_json(r: &mut JsonReader<'_>) -> Result<Option<Self>, Error> {
if !r.begin_object()? {
return Ok(None);
}
Self::read_json_members(r, None).map(Some)
}
/// Reads the members of an object that is already open; `pending` is a member key read
/// already.
pub(crate) fn read_json_members(r: &mut JsonReader<'_>, mut pending: Option<u32>) -> Result<Self, Error> {
let mut seen = [false; 8];
let mut f0 = None;
let mut f1 = None;
let mut f2 = None;
let mut f3 = None;
let mut f4 = None;
let mut f5 = None;
let mut f6 = Vec::new();
let mut f7 = None;
loop {
let key = match pending.take() {
Some(key) => key,
None => match r.next_key()? {
Some(key) => key,
None => break,
},
};
match key {
964 => if r.first(&mut seen[0])? { f0 = r.string()?; },
2578 => if r.first(&mut seen[1])? { f1 = r.string()?; },
1413 => if r.first(&mut seen[2])? { f2 = r.number::<u64>()?; },
739 => if r.first(&mut seen[3])? { f3 = r.string()?; },
1008 => if r.first(&mut seen[4])? { f4 = r.string()?; },
650 => if r.first(&mut seen[5])? { f5 = r.string()?; },
2586 => if r.first(&mut seen[6])? { let mut l = r.list()?; while r.item(&mut l)? { if let Some(v) = VmsControllerVmsIndexVms::read_json(r)? { f6.push(v); } } },
2642 => if r.first(&mut seen[7])? { f7 = r.raw_object()?.map(Box::new); },
_ => r.skip_unknown()?,
}
}
r.required(&f0, 964);
r.required(&f1, 2578);
Ok(Self {
id: f0,
version: f1,
number_of_vms: f2,
external_identifier: f3,
ip_address: f4,
electronic_address: f5,
vms: f6,
vms_controller_extension: f7,
})
}
pub(crate) fn write_json(&self, w: &mut JsonWriter<'_>, target_class: Option<&'static str>) -> Result<(), Error> {
w.begin_object(1095)?;
if let Some(class) = target_class {
w.target_class(class)?;
}
match &self.id {
Some(v) => {
w.key(964)?;
w.string(v)?;
}
None => w.absent(964, w.missing_attr("idG"))?,
}
match &self.version {
Some(v) => {
w.key(2578)?;
w.string(v)?;
}
None => w.absent(2578, w.missing_attr("versionG"))?,
}
if let Some(v) = &self.number_of_vms {
w.key(1413)?;
w.integer(*v)?;
}
if let Some(v) = &self.external_identifier {
w.key(739)?;
w.max_len("externalIdentifier", "String", v, 1024)?; w.string(v)?;
}
if let Some(v) = &self.ip_address {
w.key(1008)?;
w.max_len("ipAddress", "String", v, 1024)?; w.string(v)?;
}
if let Some(v) = &self.electronic_address {
w.key(650)?;
w.max_len("electronicAddress", "String", v, 1024)?; w.string(v)?;
}
if !self.vms.is_empty() {
w.key(2586)?;
w.begin_array()?;
for v in &self.vms {
w.item()?;
v.write_json(w, None)?;
}
w.end_array()?;
}
if let Some(v) = &self.vms_controller_extension {
w.key(2642)?;
w.extension(v)?;
}
w.end_object()
}
}
/// XML type `vms:VmsControllerFault`.
#[derive(Debug, Clone, Default, PartialEq)]
pub struct VmsControllerFault {
/// XML element `com:faultIdentifier`.
pub fault_identifier: Option<String>,
/// XML element `com:faultDescription`.
pub fault_description: Option<MultilingualString>,
/// XML element `com:faultCreationTime`.
pub fault_creation_time: Option<DateTime>,
/// XML element `com:faultLastUpdateTime`.
pub fault_last_update_time: Option<DateTime>,
/// XML element `com:faultImpactSeverity`.
pub fault_impact_severity: Option<com::FaultSeverityEnum>,
/// XML element `com:faultUrgencyToRectify`.
pub fault_urgency_to_rectify: Option<com::FaultUrgencyEnum>,
/// XML element `com:manufacturerFaultCode`.
pub manufacturer_fault_code: Option<String>,
/// XML element `com:_faultExtension`.
pub fault_extension: Option<Box<Extension>>,
/// XML element `vms:vmsControllerFault`.
pub vms_controller_fault: Option<VmsControllerFaultEnum>,
/// XML element `vms:_vmsControllerFaultExtension`.
pub vms_controller_fault_extension: Option<Box<Extension>>,
}
impl VmsControllerFault {
const FIELDS: &'static [u32] = &[0x4084e, 0x4084d, 0x4084c, 0x40852, 0x40850, 0x40855, 0x40935, 0x404ba, 0x170cb8, 0x170673];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x17027e);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = None;
let mut e7 = None;
let mut e8 = None;
let mut e9 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x4084e => { let v = r.string()?; r.set(&mut e0, v, 2126); }
0x4084d => { let v = r.multilingual()?; r.set(&mut e1, v, 2125); }
0x4084c => { let v = r.date_time()?; r.set(&mut e2, v, 2124); }
0x40852 => { let v = r.date_time()?; r.set(&mut e3, v, 2130); }
0x40850 => { let v = r.enumeration::<com::FaultSeverityEnum>()?; r.set(&mut e4, v, 2128); }
0x40855 => { let v = r.enumeration::<com::FaultUrgencyEnum>()?; r.set(&mut e5, v, 2133); }
0x40935 => { let v = r.string()?; r.set(&mut e6, v, 2357); }
0x404ba => { let v = r.raw()?; r.set(&mut e7, v.map(Box::new), 1210); }
0x170cb8 => { let v = r.enumeration::<VmsControllerFaultEnum>()?; r.set(&mut e8, v, 3256); }
0x170673 => { let v = r.raw()?; r.set(&mut e9, v.map(Box::new), 1651); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e3, 2130);
r.required(&e8, 3256);
let v = Self {
fault_identifier: e0,
fault_description: e1,
fault_creation_time: e2,
fault_last_update_time: e3,
fault_impact_severity: e4,
fault_urgency_to_rectify: e5,
manufacturer_fault_code: e6,
fault_extension: e7,
vms_controller_fault: e8,
vms_controller_fault_extension: e9,
};
r.close();
Ok(v)
}
}
impl VmsControllerFault {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.fault_identifier { w.max_len("faultIdentifier", "String", v, 1024)?; w.leaf("com:faultIdentifier", v)?; }
if let Some(v) = &self.fault_description { w.multilingual("com:faultDescription", v)?; }
if let Some(v) = &self.fault_creation_time { w.leaf("com:faultCreationTime", v)?; }
match &self.fault_last_update_time {
Some(v) => { w.leaf("com:faultLastUpdateTime", v)?; }
None => return Err(w.missing("com:faultLastUpdateTime")),
}
if let Some(v) = &self.fault_impact_severity { w.enumeration("com:faultImpactSeverity", v.literal())?; }
if let Some(v) = &self.fault_urgency_to_rectify { w.enumeration("com:faultUrgencyToRectify", v.literal())?; }
if let Some(v) = &self.manufacturer_fault_code { w.max_len("manufacturerFaultCode", "String", v, 1024)?; w.leaf("com:manufacturerFaultCode", v)?; }
if let Some(v) = &self.fault_extension { w.extension("com:_faultExtension", v)?; }
match &self.vms_controller_fault {
Some(v) => { w.enumeration("vms:vmsControllerFault", v.literal())?; }
None => return Err(w.missing("vms:vmsControllerFault")),
}
if let Some(v) = &self.vms_controller_fault_extension { w.extension("vms:_vmsControllerFaultExtension", v)?; }
w.end(tag)
}
}
impl VmsControllerFault {
pub(crate) fn read_json(r: &mut JsonReader<'_>) -> Result<Option<Self>, Error> {
if !r.begin_object()? {
return Ok(None);
}
Self::read_json_members(r, None).map(Some)
}
/// Reads the members of an object that is already open; `pending` is a member key read
/// already.
pub(crate) fn read_json_members(r: &mut JsonReader<'_>, mut pending: Option<u32>) -> Result<Self, Error> {
let mut seen = [false; 10];
let mut f0 = None;
let mut f1 = None;
let mut f2 = None;
let mut f3 = None;
let mut f4 = None;
let mut f5 = None;
let mut f6 = None;
let mut f7 = None;
let mut f8 = None;
let mut f9 = None;
loop {
let key = match pending.take() {
Some(key) => key,
None => match r.next_key()? {
Some(key) => key,
None => break,
},
};
match key {
836 => if r.first(&mut seen[0])? { f0 = r.string()?; },
835 => if r.first(&mut seen[1])? { f1 = r.multilingual()?; },
834 => if r.first(&mut seen[2])? { f2 = r.date_time()?; },
840 => if r.first(&mut seen[3])? { f3 = r.date_time()?; },
838 => if r.first(&mut seen[4])? { f4 = r.enumeration::<com::FaultSeverityEnum>()?; },
843 => if r.first(&mut seen[5])? { f5 = r.enumeration::<com::FaultUrgencyEnum>()?; },
1258 => if r.first(&mut seen[6])? { f6 = r.string()?; },
363 => if r.first(&mut seen[7])? { f7 = r.raw_object()?.map(Box::new); },
2591 => if r.first(&mut seen[8])? { f8 = r.enumeration::<VmsControllerFaultEnum>()?; },
2644 => if r.first(&mut seen[9])? { f9 = r.raw_object()?.map(Box::new); },
_ => r.skip_unknown()?,
}
}
r.required(&f3, 840);
r.required(&f8, 2591);
Ok(Self {
fault_identifier: f0,
fault_description: f1,
fault_creation_time: f2,
fault_last_update_time: f3,
fault_impact_severity: f4,
fault_urgency_to_rectify: f5,
manufacturer_fault_code: f6,
fault_extension: f7,
vms_controller_fault: f8,
vms_controller_fault_extension: f9,
})
}
pub(crate) fn write_json(&self, w: &mut JsonWriter<'_>, target_class: Option<&'static str>) -> Result<(), Error> {
w.begin_object(1096)?;
if let Some(class) = target_class {
w.target_class(class)?;
}
if let Some(v) = &self.fault_identifier {
w.key(836)?;
w.max_len("faultIdentifier", "String", v, 1024)?; w.string(v)?;
}
if let Some(v) = &self.fault_description {
w.key(835)?;
w.multilingual(v)?;
}
if let Some(v) = &self.fault_creation_time {
w.key(834)?;
w.date_time(v)?;
}
match &self.fault_last_update_time {
Some(v) => {
w.key(840)?;
w.date_time(v)?;
}
None => w.absent(840, w.missing("faultLastUpdateTime"))?,
}
if let Some(v) = &self.fault_impact_severity {
w.key(838)?;
w.enumeration(173, v.literal())?;
}
if let Some(v) = &self.fault_urgency_to_rectify {
w.key(843)?;
w.enumeration(174, v.literal())?;
}
if let Some(v) = &self.manufacturer_fault_code {
w.key(1258)?;
w.max_len("manufacturerFaultCode", "String", v, 1024)?; w.string(v)?;
}
if let Some(v) = &self.fault_extension {
w.key(363)?;
w.extension(v)?;
}
match &self.vms_controller_fault {
Some(v) => {
w.key(2591)?;
w.enumeration(1097, v.literal())?;
}
None => w.absent(2591, w.missing("vmsControllerFault"))?,
}
if let Some(v) = &self.vms_controller_fault_extension {
w.key(2644)?;
w.extension(v)?;
}
w.end_object()
}
}
/// XML type `vms:VmsControllerStatus`.
#[derive(Debug, Clone, Default, PartialEq)]
pub struct VmsControllerStatus {
/// XML element `vms:vmsControllerTableReference`.
pub vms_controller_table_reference: Option<Box<com::VersionedReference>>,
/// XML element `vms:vmsControllerReference`.
pub vms_controller_reference: Option<Box<com::VersionedReference>>,
/// XML element `vms:statusUpdateTime`.
pub status_update_time: Option<DateTime>,
/// XML element `vms:informationManagerOverride`.
pub information_manager_override: Option<Box<com::InternationalIdentifier>>,
/// XML element `vms:vmsStatus`.
pub vms_status: Vec<VmsControllerStatusVmsIndexVmsStatus>,
/// XML element `vms:vmsControllerFault`.
pub vms_controller_fault: Vec<VmsControllerFault>,
/// XML element `vms:_vmsControllerStatusExtension`.
pub vms_controller_status_extension: Option<Box<Extension>>,
}
impl VmsControllerStatus {
const FIELDS: &'static [u32] = &[0x170cbd, 0x170cb9, 0x170bd7, 0x1708c3, 0x170cc5, 0x170cb8, 0x170674];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x17027f);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = Vec::new();
let mut e5 = Vec::new();
let mut e6 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x170cbd => { let v = Some(com::VersionedReference::read(r)?); r.set(&mut e0, v.map(Box::new), 3261); }
0x170cb9 => { let v = Some(com::VersionedReference::read(r)?); r.set(&mut e1, v.map(Box::new), 3257); }
0x170bd7 => { let v = r.date_time()?; r.set(&mut e2, v, 3031); }
0x1708c3 => { let v = Some(com::InternationalIdentifier::read(r)?); r.set(&mut e3, v.map(Box::new), 2243); }
0x170cc5 => { let v = Some(VmsControllerStatusVmsIndexVmsStatus::read(r)?); e4.extend(v); }
0x170cb8 => { let v = Some(VmsControllerFault::read(r)?); e5.extend(v); }
0x170674 => { let v = r.raw()?; r.set(&mut e6, v.map(Box::new), 1652); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 3261);
r.required(&e1, 3257);
let v = Self {
vms_controller_table_reference: e0,
vms_controller_reference: e1,
status_update_time: e2,
information_manager_override: e3,
vms_status: e4,
vms_controller_fault: e5,
vms_controller_status_extension: e6,
};
r.close();
Ok(v)
}
}
impl VmsControllerStatus {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.vms_controller_table_reference {
Some(v) => { v.write(w, "vms:vmsControllerTableReference", "", " targetClass=\"vms:VmsControllerTable\"")?; }
None => return Err(w.missing("vms:vmsControllerTableReference")),
}
match &self.vms_controller_reference {
Some(v) => { v.write(w, "vms:vmsControllerReference", "", " targetClass=\"vms:VmsController\"")?; }
None => return Err(w.missing("vms:vmsControllerReference")),
}
if let Some(v) = &self.status_update_time { w.leaf("vms:statusUpdateTime", v)?; }
if let Some(v) = &self.information_manager_override { v.write(w, "vms:informationManagerOverride", "", "")?; }
for v in &self.vms_status { v.write(w, "vms:vmsStatus", "", "")?; }
for v in &self.vms_controller_fault { v.write(w, "vms:vmsControllerFault", "", "")?; }
if let Some(v) = &self.vms_controller_status_extension { w.extension("vms:_vmsControllerStatusExtension", v)?; }
w.end(tag)
}
}
impl VmsControllerStatus {
pub(crate) fn read_json(r: &mut JsonReader<'_>) -> Result<Option<Self>, Error> {
if !r.begin_object()? {
return Ok(None);
}
Self::read_json_members(r, None).map(Some)
}
/// Reads the members of an object that is already open; `pending` is a member key read
/// already.
pub(crate) fn read_json_members(r: &mut JsonReader<'_>, mut pending: Option<u32>) -> Result<Self, Error> {
let mut seen = [false; 7];
let mut f0 = None;
let mut f1 = None;
let mut f2 = None;
let mut f3 = None;
let mut f4 = Vec::new();
let mut f5 = Vec::new();
let mut f6 = None;
loop {
let key = match pending.take() {
Some(key) => key,
None => match r.next_key()? {
Some(key) => key,
None => break,
},
};
match key {
2596 => if r.first(&mut seen[0])? { f0 = com::VersionedReference::read_json(r)?.map(Box::new); },
2592 => if r.first(&mut seen[1])? { f1 = com::VersionedReference::read_json(r)?.map(Box::new); },
2196 => if r.first(&mut seen[2])? { f2 = r.date_time()?; },
990 => if r.first(&mut seen[3])? { f3 = com::InternationalIdentifier::read_json(r)?.map(Box::new); },
2623 => if r.first(&mut seen[4])? { let mut l = r.list()?; while r.item(&mut l)? { if let Some(v) = VmsControllerStatusVmsIndexVmsStatus::read_json(r)? { f4.push(v); } } },
2591 => if r.first(&mut seen[5])? { let mut l = r.list()?; while r.item(&mut l)? { if let Some(v) = VmsControllerFault::read_json(r)? { f5.push(v); } } },
2645 => if r.first(&mut seen[6])? { f6 = r.raw_object()?.map(Box::new); },
_ => r.skip_unknown()?,
}
}
r.required(&f0, 2596);
r.required(&f1, 2592);
Ok(Self {
vms_controller_table_reference: f0,
vms_controller_reference: f1,
status_update_time: f2,
information_manager_override: f3,
vms_status: f4,
vms_controller_fault: f5,
vms_controller_status_extension: f6,
})
}
pub(crate) fn write_json(&self, w: &mut JsonWriter<'_>, target_class: Option<&'static str>) -> Result<(), Error> {
w.begin_object(1098)?;
if let Some(class) = target_class {
w.target_class(class)?;
}
match &self.vms_controller_table_reference {
Some(v) => {
w.key(2596)?;
v.write_json(w, Some("VmsControllerTable"))?;
}
None => w.absent(2596, w.missing("vmsControllerTableReference"))?,
}
match &self.vms_controller_reference {
Some(v) => {
w.key(2592)?;
v.write_json(w, Some("VmsController"))?;
}
None => w.absent(2592, w.missing("vmsControllerReference"))?,
}
if let Some(v) = &self.status_update_time {
w.key(2196)?;
w.date_time(v)?;
}
if let Some(v) = &self.information_manager_override {
w.key(990)?;
v.write_json(w, None)?;
}
if !self.vms_status.is_empty() {
w.key(2623)?;
w.begin_array()?;
for v in &self.vms_status {
w.item()?;
v.write_json(w, None)?;
}
w.end_array()?;
}
if !self.vms_controller_fault.is_empty() {
w.key(2591)?;
w.begin_array()?;
for v in &self.vms_controller_fault {
w.item()?;
v.write_json(w, None)?;
}
w.end_array()?;
}
if let Some(v) = &self.vms_controller_status_extension {
w.key(2645)?;
w.extension(v)?;
}
w.end_object()
}
}
/// XML type `vms:VmsControllerTable`.
#[derive(Debug, Clone, Default, PartialEq)]
pub struct VmsControllerTable {
/// XML attribute `id`.
pub id: Option<String>,
/// XML attribute `version`.
pub version: Option<String>,
/// XML element `vms:vmsControllerTableIdentification`.
pub vms_controller_table_identification: Option<String>,
/// XML element `vms:informationManager`.
pub information_manager: Option<Box<com::InternationalIdentifier>>,
/// XML element `vms:vmsController`.
pub vms_controller: Vec<VmsController>,
/// XML element `vms:_vmsControllerTableExtension`.
pub vms_controller_table_extension: Option<Box<Extension>>,
}
impl VmsControllerTable {
const FIELDS: &'static [u32] = &[0x170cbc, 0x1708c2, 0x170cb7, 0x170675];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x170280);
let a0 = r.req_attr(2219);
let a1 = r.req_attr(3245);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = Vec::new();
let mut e3 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x170cbc => { let v = r.string()?; r.set(&mut e0, v, 3260); }
0x1708c2 => { let v = Some(com::InternationalIdentifier::read(r)?); r.set(&mut e1, v.map(Box::new), 2242); }
0x170cb7 => { let v = Some(VmsController::read(r)?); e2.extend(v); }
0x170675 => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1653); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
id: a0,
version: a1,
vms_controller_table_identification: e0,
information_manager: e1,
vms_controller: e2,
vms_controller_table_extension: e3,
};
r.close();
Ok(v)
}
}
impl VmsControllerTable {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.id {
Some(v) => { w.attr("id", v)?; }
None => return Err(w.missing_attr("id")),
}
match &self.version {
Some(v) => { w.attr("version", v)?; }
None => return Err(w.missing_attr("version")),
}
if let Some(v) = &self.vms_controller_table_identification { w.max_len("vmsControllerTableIdentification", "String", v, 1024)?; w.leaf("vms:vmsControllerTableIdentification", v)?; }
if let Some(v) = &self.information_manager { v.write(w, "vms:informationManager", "", "")?; }
w.count("vms:vmsController", self.vms_controller.len(), 1, usize::MAX)?;
for v in &self.vms_controller { v.write(w, "vms:vmsController", "", "")?; }
if let Some(v) = &self.vms_controller_table_extension { w.extension("vms:_vmsControllerTableExtension", v)?; }
w.end(tag)
}
}
impl VmsControllerTable {
pub(crate) fn read_json(r: &mut JsonReader<'_>) -> Result<Option<Self>, Error> {
if !r.begin_object()? {
return Ok(None);
}
Self::read_json_members(r, None).map(Some)
}
/// Reads the members of an object that is already open; `pending` is a member key read
/// already.
pub(crate) fn read_json_members(r: &mut JsonReader<'_>, mut pending: Option<u32>) -> Result<Self, Error> {
let mut seen = [false; 6];
let mut f0 = None;
let mut f1 = None;
let mut f2 = None;
let mut f3 = None;
let mut f4 = Vec::new();
let mut f5 = None;
loop {
let key = match pending.take() {
Some(key) => key,
None => match r.next_key()? {
Some(key) => key,
None => break,
},
};
match key {
964 => if r.first(&mut seen[0])? { f0 = r.string()?; },
2578 => if r.first(&mut seen[1])? { f1 = r.string()?; },
2595 => if r.first(&mut seen[2])? { f2 = r.string()?; },
989 => if r.first(&mut seen[3])? { f3 = com::InternationalIdentifier::read_json(r)?.map(Box::new); },
2590 => if r.first(&mut seen[4])? { let mut l = r.list()?; while r.item(&mut l)? { if let Some(v) = VmsController::read_json(r)? { f4.push(v); } } },
2646 => if r.first(&mut seen[5])? { f5 = r.raw_object()?.map(Box::new); },
_ => r.skip_unknown()?,
}
}
r.required(&f0, 964);
r.required(&f1, 2578);
Ok(Self {
id: f0,
version: f1,
vms_controller_table_identification: f2,
information_manager: f3,
vms_controller: f4,
vms_controller_table_extension: f5,
})
}
pub(crate) fn write_json(&self, w: &mut JsonWriter<'_>, target_class: Option<&'static str>) -> Result<(), Error> {
w.begin_object(1099)?;
if let Some(class) = target_class {
w.target_class(class)?;
}
match &self.id {
Some(v) => {
w.key(964)?;
w.string(v)?;
}
None => w.absent(964, w.missing_attr("idG"))?,
}
match &self.version {
Some(v) => {
w.key(2578)?;
w.string(v)?;
}
None => w.absent(2578, w.missing_attr("versionG"))?,
}
if let Some(v) = &self.vms_controller_table_identification {
w.key(2595)?;
w.max_len("vmsControllerTableIdentification", "String", v, 1024)?; w.string(v)?;
}
if let Some(v) = &self.information_manager {
w.key(989)?;
v.write_json(w, None)?;
}
w.count("vmsController", self.vms_controller.len(), 1, usize::MAX)?;
if !self.vms_controller.is_empty() {
w.key(2590)?;
w.begin_array()?;
for v in &self.vms_controller {
w.item()?;
v.write_json(w, None)?;
}
w.end_array()?;
}
if let Some(v) = &self.vms_controller_table_extension {
w.key(2646)?;
w.extension(v)?;
}
w.end_object()
}
}
/// XML type `vms:VmsFault`.
#[derive(Debug, Clone, Default, PartialEq)]
pub struct VmsFault {
/// XML element `com:faultIdentifier`.
pub fault_identifier: Option<String>,
/// XML element `com:faultDescription`.
pub fault_description: Option<MultilingualString>,
/// XML element `com:faultCreationTime`.
pub fault_creation_time: Option<DateTime>,
/// XML element `com:faultLastUpdateTime`.
pub fault_last_update_time: Option<DateTime>,
/// XML element `com:faultImpactSeverity`.
pub fault_impact_severity: Option<com::FaultSeverityEnum>,
/// XML element `com:faultUrgencyToRectify`.
pub fault_urgency_to_rectify: Option<com::FaultUrgencyEnum>,
/// XML element `com:manufacturerFaultCode`.
pub manufacturer_fault_code: Option<String>,
/// XML element `com:_faultExtension`.
pub fault_extension: Option<Box<Extension>>,
/// XML element `vms:vmsFault`.
pub vms_fault: Option<VmsFaultEnum>,
/// XML element `vms:_vmsFaultExtension`.
pub vms_fault_extension: Option<Box<Extension>>,
}
impl VmsFault {
const FIELDS: &'static [u32] = &[0x4084e, 0x4084d, 0x4084c, 0x40852, 0x40850, 0x40855, 0x40935, 0x404ba, 0x170cbf, 0x170677];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x170281);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = None;
let mut e7 = None;
let mut e8 = None;
let mut e9 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x4084e => { let v = r.string()?; r.set(&mut e0, v, 2126); }
0x4084d => { let v = r.multilingual()?; r.set(&mut e1, v, 2125); }
0x4084c => { let v = r.date_time()?; r.set(&mut e2, v, 2124); }
0x40852 => { let v = r.date_time()?; r.set(&mut e3, v, 2130); }
0x40850 => { let v = r.enumeration::<com::FaultSeverityEnum>()?; r.set(&mut e4, v, 2128); }
0x40855 => { let v = r.enumeration::<com::FaultUrgencyEnum>()?; r.set(&mut e5, v, 2133); }
0x40935 => { let v = r.string()?; r.set(&mut e6, v, 2357); }
0x404ba => { let v = r.raw()?; r.set(&mut e7, v.map(Box::new), 1210); }
0x170cbf => { let v = r.enumeration::<VmsFaultEnum>()?; r.set(&mut e8, v, 3263); }
0x170677 => { let v = r.raw()?; r.set(&mut e9, v.map(Box::new), 1655); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e3, 2130);
r.required(&e8, 3263);
let v = Self {
fault_identifier: e0,
fault_description: e1,
fault_creation_time: e2,
fault_last_update_time: e3,
fault_impact_severity: e4,
fault_urgency_to_rectify: e5,
manufacturer_fault_code: e6,
fault_extension: e7,
vms_fault: e8,
vms_fault_extension: e9,
};
r.close();
Ok(v)
}
}
impl VmsFault {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.fault_identifier { w.max_len("faultIdentifier", "String", v, 1024)?; w.leaf("com:faultIdentifier", v)?; }
if let Some(v) = &self.fault_description { w.multilingual("com:faultDescription", v)?; }
if let Some(v) = &self.fault_creation_time { w.leaf("com:faultCreationTime", v)?; }
match &self.fault_last_update_time {
Some(v) => { w.leaf("com:faultLastUpdateTime", v)?; }
None => return Err(w.missing("com:faultLastUpdateTime")),
}
if let Some(v) = &self.fault_impact_severity { w.enumeration("com:faultImpactSeverity", v.literal())?; }
if let Some(v) = &self.fault_urgency_to_rectify { w.enumeration("com:faultUrgencyToRectify", v.literal())?; }
if let Some(v) = &self.manufacturer_fault_code { w.max_len("manufacturerFaultCode", "String", v, 1024)?; w.leaf("com:manufacturerFaultCode", v)?; }
if let Some(v) = &self.fault_extension { w.extension("com:_faultExtension", v)?; }
match &self.vms_fault {
Some(v) => { w.enumeration("vms:vmsFault", v.literal())?; }
None => return Err(w.missing("vms:vmsFault")),
}
if let Some(v) = &self.vms_fault_extension { w.extension("vms:_vmsFaultExtension", v)?; }
w.end(tag)
}
}
impl VmsFault {
pub(crate) fn read_json(r: &mut JsonReader<'_>) -> Result<Option<Self>, Error> {
if !r.begin_object()? {
return Ok(None);
}
Self::read_json_members(r, None).map(Some)
}
/// Reads the members of an object that is already open; `pending` is a member key read
/// already.
pub(crate) fn read_json_members(r: &mut JsonReader<'_>, mut pending: Option<u32>) -> Result<Self, Error> {
let mut seen = [false; 10];
let mut f0 = None;
let mut f1 = None;
let mut f2 = None;
let mut f3 = None;
let mut f4 = None;
let mut f5 = None;
let mut f6 = None;
let mut f7 = None;
let mut f8 = None;
let mut f9 = None;
loop {
let key = match pending.take() {
Some(key) => key,
None => match r.next_key()? {
Some(key) => key,
None => break,
},
};
match key {
836 => if r.first(&mut seen[0])? { f0 = r.string()?; },
835 => if r.first(&mut seen[1])? { f1 = r.multilingual()?; },
834 => if r.first(&mut seen[2])? { f2 = r.date_time()?; },
840 => if r.first(&mut seen[3])? { f3 = r.date_time()?; },
838 => if r.first(&mut seen[4])? { f4 = r.enumeration::<com::FaultSeverityEnum>()?; },
843 => if r.first(&mut seen[5])? { f5 = r.enumeration::<com::FaultUrgencyEnum>()?; },
1258 => if r.first(&mut seen[6])? { f6 = r.string()?; },
363 => if r.first(&mut seen[7])? { f7 = r.raw_object()?.map(Box::new); },
2603 => if r.first(&mut seen[8])? { f8 = r.enumeration::<VmsFaultEnum>()?; },
2649 => if r.first(&mut seen[9])? { f9 = r.raw_object()?.map(Box::new); },
_ => r.skip_unknown()?,
}
}
r.required(&f3, 840);
r.required(&f8, 2603);
Ok(Self {
fault_identifier: f0,
fault_description: f1,
fault_creation_time: f2,
fault_last_update_time: f3,
fault_impact_severity: f4,
fault_urgency_to_rectify: f5,
manufacturer_fault_code: f6,
fault_extension: f7,
vms_fault: f8,
vms_fault_extension: f9,
})
}
pub(crate) fn write_json(&self, w: &mut JsonWriter<'_>, target_class: Option<&'static str>) -> Result<(), Error> {
w.begin_object(1100)?;
if let Some(class) = target_class {
w.target_class(class)?;
}
if let Some(v) = &self.fault_identifier {
w.key(836)?;
w.max_len("faultIdentifier", "String", v, 1024)?; w.string(v)?;
}
if let Some(v) = &self.fault_description {
w.key(835)?;
w.multilingual(v)?;
}
if let Some(v) = &self.fault_creation_time {
w.key(834)?;
w.date_time(v)?;
}
match &self.fault_last_update_time {
Some(v) => {
w.key(840)?;
w.date_time(v)?;
}
None => w.absent(840, w.missing("faultLastUpdateTime"))?,
}
if let Some(v) = &self.fault_impact_severity {
w.key(838)?;
w.enumeration(173, v.literal())?;
}
if let Some(v) = &self.fault_urgency_to_rectify {
w.key(843)?;
w.enumeration(174, v.literal())?;
}
if let Some(v) = &self.manufacturer_fault_code {
w.key(1258)?;
w.max_len("manufacturerFaultCode", "String", v, 1024)?; w.string(v)?;
}
if let Some(v) = &self.fault_extension {
w.key(363)?;
w.extension(v)?;
}
match &self.vms_fault {
Some(v) => {
w.key(2603)?;
w.enumeration(1101, v.literal())?;
}
None => w.absent(2603, w.missing("vmsFault"))?,
}
if let Some(v) = &self.vms_fault_extension {
w.key(2649)?;
w.extension(v)?;
}
w.end_object()
}
}
/// XML type `vms:VmsMessage`.
#[derive(Debug, Clone, Default, PartialEq)]
pub struct VmsMessage {
/// XML element `vms:associatedTrafficManagementPlan`.
pub associated_traffic_management_plan: Option<String>,
/// XML element `vms:messageSetBy`.
pub message_set_by: Option<MultilingualString>,
/// XML element `vms:setBySystem`.
pub set_by_system: Option<com::Boolean>,
/// XML element `vms:reasonForSetting`.
pub reason_for_setting: Option<MultilingualString>,
/// XML element `vms:codedReasonForSetting`.
pub coded_reason_for_setting: Option<SettingReasonEnum>,
/// XML element `vms:messageInformationType`.
pub message_information_type: Vec<MessageInformationTypeEnum>,
/// XML element `vms:primarySetting`.
pub primary_setting: Option<com::Boolean>,
/// XML element `vms:mareNostrumCompliant`.
pub mare_nostrum_compliant: Option<com::Boolean>,
/// XML element `vms:timeLastSet`.
pub time_last_set: Option<DateTime>,
/// XML element `vms:requestedBy`.
pub requested_by: Option<MultilingualString>,
/// XML element `vms:relatedSituation`.
pub related_situation: Vec<com::VersionedReference>,
/// XML element `vms:relatedSituationRecord`.
pub related_situation_record: Vec<com::VersionedReference>,
/// XML element `vms:distanceFromClosestSituationRecord`.
pub distance_from_closest_situation_record: Option<com::MetresAsFloat>,
/// XML element `vms:sequencingInterval`.
pub sequencing_interval: Option<com::Seconds>,
/// XML element `vms:displayAreaSettings`.
pub display_area_settings: Vec<VmsMessageDisplayAreaIndexDisplayAreaSettings>,
/// XML element `vms:image`.
pub image: Option<Box<Image>>,
/// XML element `vms:_vmsMessageExtension`.
pub vms_message_extension: Option<Box<Extension>>,
}
impl VmsMessage {
const FIELDS: &'static [u32] = &[0x1706fd, 0x17096d, 0x170b8f, 0x170afa, 0x17074d, 0x17096b, 0x170abe, 0x170936, 0x170c18, 0x170b29, 0x170b1c, 0x170b1d, 0x1707cf, 0x170b7b, 0x1707c7, 0x1708b0, 0x170678];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x170282);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = Vec::new();
let mut e6 = None;
let mut e7 = None;
let mut e8 = None;
let mut e9 = None;
let mut e10 = Vec::new();
let mut e11 = Vec::new();
let mut e12 = None;
let mut e13 = None;
let mut e14 = Vec::new();
let mut e15 = None;
let mut e16 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x1706fd => { let v = r.string()?; r.set(&mut e0, v, 1789); }
0x17096d => { let v = r.multilingual()?; r.set(&mut e1, v, 2413); }
0x170b8f => { let v = r.value::<bool>()?; r.set(&mut e2, v, 2959); }
0x170afa => { let v = r.multilingual()?; r.set(&mut e3, v, 2810); }
0x17074d => { let v = r.enumeration::<SettingReasonEnum>()?; r.set(&mut e4, v, 1869); }
0x17096b => { let v = r.enumeration::<MessageInformationTypeEnum>()?; e5.extend(v); }
0x170abe => { let v = r.value::<bool>()?; r.set(&mut e6, v, 2750); }
0x170936 => { let v = r.value::<bool>()?; r.set(&mut e7, v, 2358); }
0x170c18 => { let v = r.date_time()?; r.set(&mut e8, v, 3096); }
0x170b29 => { let v = r.multilingual()?; r.set(&mut e9, v, 2857); }
0x170b1c => { let v = Some(com::VersionedReference::read(r)?); e10.extend(v); }
0x170b1d => { let v = Some(com::VersionedReference::read(r)?); e11.extend(v); }
0x1707cf => { let v = r.value::<f32>()?; r.set(&mut e12, v, 1999); }
0x170b7b => { let v = r.value::<f32>()?; r.set(&mut e13, v, 2939); }
0x1707c7 => { let v = Some(VmsMessageDisplayAreaIndexDisplayAreaSettings::read(r)?); e14.extend(v); }
0x1708b0 => { let v = Some(Image::read(r)?); r.set(&mut e15, v.map(Box::new), 2224); }
0x170678 => { let v = r.raw()?; r.set(&mut e16, v.map(Box::new), 1656); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e8, 3096);
let v = Self {
associated_traffic_management_plan: e0,
message_set_by: e1,
set_by_system: e2,
reason_for_setting: e3,
coded_reason_for_setting: e4,
message_information_type: e5,
primary_setting: e6,
mare_nostrum_compliant: e7,
time_last_set: e8,
requested_by: e9,
related_situation: e10,
related_situation_record: e11,
distance_from_closest_situation_record: e12,
sequencing_interval: e13,
display_area_settings: e14,
image: e15,
vms_message_extension: e16,
};
r.close();
Ok(v)
}
}
impl VmsMessage {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.associated_traffic_management_plan { w.max_len("associatedTrafficManagementPlan", "String", v, 1024)?; w.leaf("vms:associatedTrafficManagementPlan", v)?; }
if let Some(v) = &self.message_set_by { w.multilingual("vms:messageSetBy", v)?; }
if let Some(v) = &self.set_by_system { w.leaf("vms:setBySystem", v)?; }
if let Some(v) = &self.reason_for_setting { w.multilingual("vms:reasonForSetting", v)?; }
if let Some(v) = &self.coded_reason_for_setting { w.enumeration("vms:codedReasonForSetting", v.literal())?; }
for v in &self.message_information_type { w.enumeration("vms:messageInformationType", v.literal())?; }
if let Some(v) = &self.primary_setting { w.leaf("vms:primarySetting", v)?; }
if let Some(v) = &self.mare_nostrum_compliant { w.leaf("vms:mareNostrumCompliant", v)?; }
match &self.time_last_set {
Some(v) => { w.leaf("vms:timeLastSet", v)?; }
None => return Err(w.missing("vms:timeLastSet")),
}
if let Some(v) = &self.requested_by { w.multilingual("vms:requestedBy", v)?; }
for v in &self.related_situation { v.write(w, "vms:relatedSituation", "", " targetClass=\"sit:Situation\"")?; }
for v in &self.related_situation_record { v.write(w, "vms:relatedSituationRecord", "", " targetClass=\"sit:SituationRecord\"")?; }
if let Some(v) = &self.distance_from_closest_situation_record { w.leaf("vms:distanceFromClosestSituationRecord", v)?; }
if let Some(v) = &self.sequencing_interval { w.leaf("vms:sequencingInterval", v)?; }
for v in &self.display_area_settings { v.write(w, "vms:displayAreaSettings", "", "")?; }
if let Some(v) = &self.image { v.write(w, "vms:image", "", "")?; }
if let Some(v) = &self.vms_message_extension { w.extension("vms:_vmsMessageExtension", v)?; }
w.end(tag)
}
}
impl VmsMessage {
pub(crate) fn read_json(r: &mut JsonReader<'_>) -> Result<Option<Self>, Error> {
if !r.begin_object()? {
return Ok(None);
}
Self::read_json_members(r, None).map(Some)
}
/// Reads the members of an object that is already open; `pending` is a member key read
/// already.
pub(crate) fn read_json_members(r: &mut JsonReader<'_>, mut pending: Option<u32>) -> Result<Self, Error> {
let mut seen = [false; 17];
let mut f0 = None;
let mut f1 = None;
let mut f2 = None;
let mut f3 = None;
let mut f4 = None;
let mut f5 = Vec::new();
let mut f6 = None;
let mut f7 = None;
let mut f8 = None;
let mut f9 = None;
let mut f10 = Vec::new();
let mut f11 = Vec::new();
let mut f12 = None;
let mut f13 = None;
let mut f14 = Vec::new();
let mut f15 = None;
let mut f16 = None;
loop {
let key = match pending.take() {
Some(key) => key,
None => match r.next_key()? {
Some(key) => key,
None => break,
},
};
match key {
264 => if r.first(&mut seen[0])? { f0 = r.string()?; },
1315 => if r.first(&mut seen[1])? { f1 = r.multilingual()?; },
2046 => if r.first(&mut seen[2])? { f2 = r.boolean()?; },
1810 => if r.first(&mut seen[3])? { f3 = r.multilingual()?; },
347 => if r.first(&mut seen[4])? { f4 = r.enumeration::<SettingReasonEnum>()?; },
1313 => if r.first(&mut seen[5])? { let mut l = r.list()?; while r.item(&mut l)? { if let Some(v) = r.enumeration::<MessageInformationTypeEnum>()? { f5.push(v); } } },
1648 => if r.first(&mut seen[6])? { f6 = r.boolean()?; },
1259 => if r.first(&mut seen[7])? { f7 = r.boolean()?; },
2259 => if r.first(&mut seen[8])? { f8 = r.date_time()?; },
1857 => if r.first(&mut seen[9])? { f9 = r.multilingual()?; },
1844 => if r.first(&mut seen[10])? { let mut l = r.list()?; while r.item(&mut l)? { if let Some(v) = com::VersionedReference::read_json(r)? { f10.push(v); } } },
1845 => if r.first(&mut seen[11])? { let mut l = r.list()?; while r.item(&mut l)? { if let Some(v) = com::VersionedReference::read_json(r)? { f11.push(v); } } },
584 => if r.first(&mut seen[12])? { f12 = r.number::<f32>()?; },
2026 => if r.first(&mut seen[13])? { f13 = r.number::<f32>()?; },
576 => if r.first(&mut seen[14])? { let mut l = r.list()?; while r.item(&mut l)? { if let Some(v) = VmsMessageDisplayAreaIndexDisplayAreaSettings::read_json(r)? { f14.push(v); } } },
969 => if r.first(&mut seen[15])? { f15 = Image::read_json(r)?.map(Box::new); },
2650 => if r.first(&mut seen[16])? { f16 = r.raw_object()?.map(Box::new); },
_ => r.skip_unknown()?,
}
}
r.required(&f8, 2259);
Ok(Self {
associated_traffic_management_plan: f0,
message_set_by: f1,
set_by_system: f2,
reason_for_setting: f3,
coded_reason_for_setting: f4,
message_information_type: f5,
primary_setting: f6,
mare_nostrum_compliant: f7,
time_last_set: f8,
requested_by: f9,
related_situation: f10,
related_situation_record: f11,
distance_from_closest_situation_record: f12,
sequencing_interval: f13,
display_area_settings: f14,
image: f15,
vms_message_extension: f16,
})
}
pub(crate) fn write_json(&self, w: &mut JsonWriter<'_>, target_class: Option<&'static str>) -> Result<(), Error> {
w.begin_object(1102)?;
if let Some(class) = target_class {
w.target_class(class)?;
}
if let Some(v) = &self.associated_traffic_management_plan {
w.key(264)?;
w.max_len("associatedTrafficManagementPlan", "String", v, 1024)?; w.string(v)?;
}
if let Some(v) = &self.message_set_by {
w.key(1315)?;
w.multilingual(v)?;
}
if let Some(v) = &self.set_by_system {
w.key(2046)?;
w.boolean(*v)?;
}
if let Some(v) = &self.reason_for_setting {
w.key(1810)?;
w.multilingual(v)?;
}
if let Some(v) = &self.coded_reason_for_setting {
w.key(347)?;
w.enumeration(1083, v.literal())?;
}
if !self.message_information_type.is_empty() {
w.key(1313)?;
w.begin_array()?;
for v in &self.message_information_type {
w.item()?;
w.enumeration(1071, v.literal())?;
}
w.end_array()?;
}
if let Some(v) = &self.primary_setting {
w.key(1648)?;
w.boolean(*v)?;
}
if let Some(v) = &self.mare_nostrum_compliant {
w.key(1259)?;
w.boolean(*v)?;
}
match &self.time_last_set {
Some(v) => {
w.key(2259)?;
w.date_time(v)?;
}
None => w.absent(2259, w.missing("timeLastSet"))?,
}
if let Some(v) = &self.requested_by {
w.key(1857)?;
w.multilingual(v)?;
}
if !self.related_situation.is_empty() {
w.key(1844)?;
w.begin_array()?;
for v in &self.related_situation {
w.item()?;
v.write_json(w, Some("Situation"))?;
}
w.end_array()?;
}
if !self.related_situation_record.is_empty() {
w.key(1845)?;
w.begin_array()?;
for v in &self.related_situation_record {
w.item()?;
v.write_json(w, Some("SituationRecord"))?;
}
w.end_array()?;
}
if let Some(v) = &self.distance_from_closest_situation_record {
w.key(584)?;
w.float32(*v)?;
}
if let Some(v) = &self.sequencing_interval {
w.key(2026)?;
w.float32(*v)?;
}
if !self.display_area_settings.is_empty() {
w.key(576)?;
w.begin_array()?;
for v in &self.display_area_settings {
w.item()?;
v.write_json(w, None)?;
}
w.end_array()?;
}
if let Some(v) = &self.image {
w.key(969)?;
v.write_json(w, None)?;
}
if let Some(v) = &self.vms_message_extension {
w.key(2650)?;
w.extension(v)?;
}
w.end_object()
}
}
/// XML type `vms:VmsPublication`.
#[derive(Debug, Clone, Default, PartialEq)]
pub struct VmsPublication {
/// XML attribute `lang`.
pub lang: Option<com::Language>,
/// XML attribute `extensionName`.
pub extension_name: Option<String>,
/// XML attribute `extensionVersion`.
pub extension_version: Option<String>,
/// XML attribute `profileName`.
pub profile_name: Option<String>,
/// XML attribute `profileVersion`.
pub profile_version: Option<String>,
/// XML element `com:feedDescription`.
pub feed_description: Option<MultilingualString>,
/// XML element `com:feedType`.
pub feed_type: Option<String>,
/// XML element `com:publicationTime`.
pub publication_time: Option<DateTime>,
/// XML element `com:publicationCreator`.
pub publication_creator: Option<Box<com::InternationalIdentifier>>,
/// XML element `com:_payloadPublicationExtension`.
pub payload_publication_extension: Option<Box<Extension>>,
/// XML element `vms:headerInformation`.
pub header_information: Option<Box<com::HeaderInformation>>,
/// XML element `vms:vmsControllerStatus`.
pub vms_controller_status: Vec<VmsControllerStatus>,
/// XML element `vms:_vmsPublicationExtension`.
pub vms_publication_extension: Option<Box<Extension>>,
}
impl VmsPublication {
const FIELDS: &'static [u32] = &[0x40859, 0x4085a, 0x40adb, 0x40ada, 0x4056a, 0x170893, 0x170cba, 0x170679];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x170283);
let a0 = r.req_attr(2285);
let _ = r.attr(2439);
let a2 = r.attr(2104);
let a3 = r.attr(2105);
let a4 = r.attr(2760);
let a5 = r.attr(2761);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = Vec::new();
let mut e7 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x40859 => { let v = r.multilingual()?; r.set(&mut e0, v, 2137); }
0x4085a => { let v = r.string()?; r.set(&mut e1, v, 2138); }
0x40adb => { let v = r.date_time()?; r.set(&mut e2, v, 2779); }
0x40ada => { let v = Some(com::InternationalIdentifier::read(r)?); r.set(&mut e3, v.map(Box::new), 2778); }
0x4056a => { let v = r.raw()?; r.set(&mut e4, v.map(Box::new), 1386); }
0x170893 => { let v = Some(com::HeaderInformation::read(r)?); r.set(&mut e5, v.map(Box::new), 2195); }
0x170cba => { let v = Some(VmsControllerStatus::read(r)?); e6.extend(v); }
0x170679 => { let v = r.raw()?; r.set(&mut e7, v.map(Box::new), 1657); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e2, 2779);
r.required(&e3, 2778);
r.required(&e5, 2195);
let v = Self {
lang: a0,
extension_name: a2,
extension_version: a3,
profile_name: a4,
profile_version: a5,
feed_description: e0,
feed_type: e1,
publication_time: e2,
publication_creator: e3,
payload_publication_extension: e4,
header_information: e5,
vms_controller_status: e6,
vms_publication_extension: e7,
};
r.close();
Ok(v)
}
}
impl VmsPublication {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
w.constant_attrs(" modelBaseVersion=\"3\"")?;
match &self.lang {
Some(v) => { w.pattern("lang", "Language", v, Pattern::Language)?; w.attr("lang", v)?; }
None => return Err(w.missing_attr("lang")),
}
if let Some(v) = &self.extension_name { w.attr("extensionName", v)?; }
if let Some(v) = &self.extension_version { w.attr("extensionVersion", v)?; }
if let Some(v) = &self.profile_name { w.attr("profileName", v)?; }
if let Some(v) = &self.profile_version { w.attr("profileVersion", v)?; }
if let Some(v) = &self.feed_description { w.multilingual("com:feedDescription", v)?; }
if let Some(v) = &self.feed_type { w.max_len("feedType", "String", v, 1024)?; w.leaf("com:feedType", v)?; }
match &self.publication_time {
Some(v) => { w.leaf("com:publicationTime", v)?; }
None => return Err(w.missing("com:publicationTime")),
}
match &self.publication_creator {
Some(v) => { v.write(w, "com:publicationCreator", "", "")?; }
None => return Err(w.missing("com:publicationCreator")),
}
if let Some(v) = &self.payload_publication_extension { w.extension("com:_payloadPublicationExtension", v)?; }
match &self.header_information {
Some(v) => { v.write(w, "vms:headerInformation", "", "")?; }
None => return Err(w.missing("vms:headerInformation")),
}
w.count("vms:vmsControllerStatus", self.vms_controller_status.len(), 1, usize::MAX)?;
for v in &self.vms_controller_status { v.write(w, "vms:vmsControllerStatus", "", "")?; }
if let Some(v) = &self.vms_publication_extension { w.extension("vms:_vmsPublicationExtension", v)?; }
w.end(tag)
}
}
impl VmsPublication {
pub(crate) fn read_json(r: &mut JsonReader<'_>) -> Result<Option<Self>, Error> {
if !r.begin_object()? {
return Ok(None);
}
Self::read_json_members(r, None).map(Some)
}
/// Reads the members of an object that is already open; `pending` is a member key read
/// already.
pub(crate) fn read_json_members(r: &mut JsonReader<'_>, mut pending: Option<u32>) -> Result<Self, Error> {
let mut seen = [false; 13];
let mut f0 = None;
let mut f1 = None;
let mut f2 = None;
let mut f3 = None;
let mut f4 = None;
let mut f5 = None;
let mut f6 = None;
let mut f7 = None;
let mut f8 = None;
let mut f9 = None;
let mut f10 = None;
let mut f11 = Vec::new();
let mut f12 = None;
loop {
let key = match pending.take() {
Some(key) => key,
None => match r.next_key()? {
Some(key) => key,
None => break,
},
};
match key {
1032 => if r.first(&mut seen[0])? { f0 = r.string()?; },
847 => if r.first(&mut seen[5])? { f5 = r.multilingual()?; },
848 => if r.first(&mut seen[6])? { f6 = r.string()?; },
1779 => if r.first(&mut seen[7])? { f7 = r.date_time()?; },
1778 => if r.first(&mut seen[8])? { f8 = com::InternationalIdentifier::read_json(r)?.map(Box::new); },
387 => if r.first(&mut seen[9])? { f9 = r.raw_object()?.map(Box::new); },
940 => if r.first(&mut seen[10])? { f10 = com::HeaderInformation::read_json(r)?.map(Box::new); },
2593 => if r.first(&mut seen[11])? { let mut l = r.list()?; while r.item(&mut l)? { if let Some(v) = VmsControllerStatus::read_json(r)? { f11.push(v); } } },
2652 => if r.first(&mut seen[12])? { f12 = r.raw_object()?.map(Box::new); },
_ => r.skip_unknown()?,
}
}
r.required(&f0, 1032);
r.required(&f7, 1779);
r.required(&f8, 1778);
r.required(&f10, 940);
Ok(Self {
lang: f0,
extension_name: f1,
extension_version: f2,
profile_name: f3,
profile_version: f4,
feed_description: f5,
feed_type: f6,
publication_time: f7,
publication_creator: f8,
payload_publication_extension: f9,
header_information: f10,
vms_controller_status: f11,
vms_publication_extension: f12,
})
}
pub(crate) fn write_json(&self, w: &mut JsonWriter<'_>, target_class: Option<&'static str>) -> Result<(), Error> {
w.begin_object(1103)?;
if let Some(class) = target_class {
w.target_class(class)?;
}
match &self.lang {
Some(v) => {
w.key(1032)?;
w.pattern("lang", "Language", v, Pattern::Language)?; w.string(v)?;
}
None => w.absent(1032, w.missing_attr("lang"))?,
}
if let Some(v) = &self.feed_description {
w.key(847)?;
w.multilingual(v)?;
}
if let Some(v) = &self.feed_type {
w.key(848)?;
w.max_len("feedType", "String", v, 1024)?; w.string(v)?;
}
match &self.publication_time {
Some(v) => {
w.key(1779)?;
w.date_time(v)?;
}
None => w.absent(1779, w.missing("publicationTime"))?,
}
match &self.publication_creator {
Some(v) => {
w.key(1778)?;
v.write_json(w, None)?;
}
None => w.absent(1778, w.missing("publicationCreator"))?,
}
if let Some(v) = &self.payload_publication_extension {
w.key(387)?;
w.extension(v)?;
}
match &self.header_information {
Some(v) => {
w.key(940)?;
v.write_json(w, None)?;
}
None => w.absent(940, w.missing("headerInformation"))?,
}
w.count("vmsControllerStatus", self.vms_controller_status.len(), 1, usize::MAX)?;
if !self.vms_controller_status.is_empty() {
w.key(2593)?;
w.begin_array()?;
for v in &self.vms_controller_status {
w.item()?;
v.write_json(w, None)?;
}
w.end_array()?;
}
if let Some(v) = &self.vms_publication_extension {
w.key(2652)?;
w.extension(v)?;
}
w.end_object()
}
}
/// XML type `vms:VmsStatus`.
#[derive(Debug, Clone, Default, PartialEq)]
pub struct VmsStatus {
/// XML element `vms:flashingLightsOn`.
pub flashing_lights_on: Option<com::Boolean>,
/// XML element `vms:remainingPowerCapacity`.
pub remaining_power_capacity: Option<com::Seconds>,
/// XML element `vms:statusUpdateTime`.
pub status_update_time: Option<DateTime>,
/// XML element `vms:sequencingInterval`.
pub sequencing_interval: Option<com::Seconds>,
/// XML element `vms:workingStatus`.
pub working_status: Option<WorkingStatusEnum>,
/// XML element `vms:vmsDynamicConfiguration`.
pub vms_dynamic_configuration: Option<Box<VmsConfiguration>>,
/// XML element `vms:vmsMessage`.
pub vms_message: Vec<VmsStatusMessageIndexVmsMessage>,
/// XML element `vms:vmsLocationOverride`.
pub vms_location_override: Option<loc::Location>,
/// XML element `vms:managedLogicalLocationOverride`.
pub managed_logical_location_override: Option<Box<ManagedLogicalLocation>>,
/// XML element `vms:vmsFault`.
pub vms_fault: Vec<VmsFault>,
/// XML element `vms:_vmsStatusExtension`.
pub vms_status_extension: Option<Box<Extension>>,
}
impl VmsStatus {
const FIELDS: &'static [u32] = &[0x170860, 0x170b23, 0x170bd7, 0x170b7b, 0x170ce1, 0x170cbe, 0x170cc3, 0x170cc2, 0x170931, 0x170cbf, 0x17067a];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x170284);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = Vec::new();
let mut e7 = None;
let mut e8 = None;
let mut e9 = Vec::new();
let mut e10 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x170860 => { let v = r.value::<bool>()?; r.set(&mut e0, v, 2144); }
0x170b23 => { let v = r.value::<f32>()?; r.set(&mut e1, v, 2851); }
0x170bd7 => { let v = r.date_time()?; r.set(&mut e2, v, 3031); }
0x170b7b => { let v = r.value::<f32>()?; r.set(&mut e3, v, 2939); }
0x170ce1 => { let v = r.enumeration::<WorkingStatusEnum>()?; r.set(&mut e4, v, 3297); }
0x170cbe => { let v = Some(VmsConfiguration::read(r)?); r.set(&mut e5, v.map(Box::new), 3262); }
0x170cc3 => { let v = Some(VmsStatusMessageIndexVmsMessage::read(r)?); e6.extend(v); }
0x170cc2 => { let v = loc::Location::read(r)?; r.set(&mut e7, v, 3266); }
0x170931 => { let v = Some(ManagedLogicalLocation::read(r)?); r.set(&mut e8, v.map(Box::new), 2353); }
0x170cbf => { let v = Some(VmsFault::read(r)?); e9.extend(v); }
0x17067a => { let v = r.raw()?; r.set(&mut e10, v.map(Box::new), 1658); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
flashing_lights_on: e0,
remaining_power_capacity: e1,
status_update_time: e2,
sequencing_interval: e3,
working_status: e4,
vms_dynamic_configuration: e5,
vms_message: e6,
vms_location_override: e7,
managed_logical_location_override: e8,
vms_fault: e9,
vms_status_extension: e10,
};
r.close();
Ok(v)
}
}
impl VmsStatus {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.flashing_lights_on { w.leaf("vms:flashingLightsOn", v)?; }
if let Some(v) = &self.remaining_power_capacity { w.leaf("vms:remainingPowerCapacity", v)?; }
if let Some(v) = &self.status_update_time { w.leaf("vms:statusUpdateTime", v)?; }
if let Some(v) = &self.sequencing_interval { w.leaf("vms:sequencingInterval", v)?; }
if let Some(v) = &self.working_status { w.enumeration("vms:workingStatus", v.literal())?; }
if let Some(v) = &self.vms_dynamic_configuration { v.write(w, "vms:vmsDynamicConfiguration", "", "")?; }
for v in &self.vms_message { v.write(w, "vms:vmsMessage", "", "")?; }
if let Some(v) = &self.vms_location_override { v.write(w, "vms:vmsLocationOverride")?; }
if let Some(v) = &self.managed_logical_location_override { v.write(w, "vms:managedLogicalLocationOverride", "", "")?; }
for v in &self.vms_fault { v.write(w, "vms:vmsFault", "", "")?; }
if let Some(v) = &self.vms_status_extension { w.extension("vms:_vmsStatusExtension", v)?; }
w.end(tag)
}
}
impl VmsStatus {
pub(crate) fn read_json(r: &mut JsonReader<'_>) -> Result<Option<Self>, Error> {
if !r.begin_object()? {
return Ok(None);
}
Self::read_json_members(r, None).map(Some)
}
/// Reads the members of an object that is already open; `pending` is a member key read
/// already.
pub(crate) fn read_json_members(r: &mut JsonReader<'_>, mut pending: Option<u32>) -> Result<Self, Error> {
let mut seen = [false; 11];
let mut f0 = None;
let mut f1 = None;
let mut f2 = None;
let mut f3 = None;
let mut f4 = None;
let mut f5 = None;
let mut f6 = Vec::new();
let mut f7 = None;
let mut f8 = None;
let mut f9 = Vec::new();
let mut f10 = None;
loop {
let key = match pending.take() {
Some(key) => key,
None => match r.next_key()? {
Some(key) => key,
None => break,
},
};
match key {
854 => if r.first(&mut seen[0])? { f0 = r.boolean()?; },
1851 => if r.first(&mut seen[1])? { f1 = r.number::<f32>()?; },
2196 => if r.first(&mut seen[2])? { f2 = r.date_time()?; },
2026 => if r.first(&mut seen[3])? { f3 = r.number::<f32>()?; },
2678 => if r.first(&mut seen[4])? { f4 = r.enumeration::<WorkingStatusEnum>()?; },
2602 => if r.first(&mut seen[5])? { f5 = VmsConfiguration::read_json(r)?.map(Box::new); },
2612 => if r.first(&mut seen[6])? { let mut l = r.list()?; while r.item(&mut l)? { if let Some(v) = VmsStatusMessageIndexVmsMessage::read_json(r)? { f6.push(v); } } },
2610 => if r.first(&mut seen[7])? { f7 = loc::Location::read_json(r)?; },
1254 => if r.first(&mut seen[8])? { f8 = ManagedLogicalLocation::read_json(r)?.map(Box::new); },
2603 => if r.first(&mut seen[9])? { let mut l = r.list()?; while r.item(&mut l)? { if let Some(v) = VmsFault::read_json(r)? { f9.push(v); } } },
2653 => if r.first(&mut seen[10])? { f10 = r.raw_object()?.map(Box::new); },
_ => r.skip_unknown()?,
}
}
Ok(Self {
flashing_lights_on: f0,
remaining_power_capacity: f1,
status_update_time: f2,
sequencing_interval: f3,
working_status: f4,
vms_dynamic_configuration: f5,
vms_message: f6,
vms_location_override: f7,
managed_logical_location_override: f8,
vms_fault: f9,
vms_status_extension: f10,
})
}
pub(crate) fn write_json(&self, w: &mut JsonWriter<'_>, target_class: Option<&'static str>) -> Result<(), Error> {
w.begin_object(1104)?;
if let Some(class) = target_class {
w.target_class(class)?;
}
if let Some(v) = &self.flashing_lights_on {
w.key(854)?;
w.boolean(*v)?;
}
if let Some(v) = &self.remaining_power_capacity {
w.key(1851)?;
w.float32(*v)?;
}
if let Some(v) = &self.status_update_time {
w.key(2196)?;
w.date_time(v)?;
}
if let Some(v) = &self.sequencing_interval {
w.key(2026)?;
w.float32(*v)?;
}
if let Some(v) = &self.working_status {
w.key(2678)?;
w.enumeration(1107, v.literal())?;
}
if let Some(v) = &self.vms_dynamic_configuration {
w.key(2602)?;
v.write_json(w, None)?;
}
if !self.vms_message.is_empty() {
w.key(2612)?;
w.begin_array()?;
for v in &self.vms_message {
w.item()?;
v.write_json(w, None)?;
}
w.end_array()?;
}
if let Some(v) = &self.vms_location_override {
w.key(2610)?;
v.write_json(w)?;
}
if let Some(v) = &self.managed_logical_location_override {
w.key(1254)?;
v.write_json(w, None)?;
}
if !self.vms_fault.is_empty() {
w.key(2603)?;
w.begin_array()?;
for v in &self.vms_fault {
w.item()?;
v.write_json(w, None)?;
}
w.end_array()?;
}
if let Some(v) = &self.vms_status_extension {
w.key(2653)?;
w.extension(v)?;
}
w.end_object()
}
}
/// XML type `vms:VmsTablePublication`.
#[derive(Debug, Clone, Default, PartialEq)]
pub struct VmsTablePublication {
/// XML attribute `lang`.
pub lang: Option<com::Language>,
/// XML attribute `extensionName`.
pub extension_name: Option<String>,
/// XML attribute `extensionVersion`.
pub extension_version: Option<String>,
/// XML attribute `profileName`.
pub profile_name: Option<String>,
/// XML attribute `profileVersion`.
pub profile_version: Option<String>,
/// XML element `com:feedDescription`.
pub feed_description: Option<MultilingualString>,
/// XML element `com:feedType`.
pub feed_type: Option<String>,
/// XML element `com:publicationTime`.
pub publication_time: Option<DateTime>,
/// XML element `com:publicationCreator`.
pub publication_creator: Option<Box<com::InternationalIdentifier>>,
/// XML element `com:_payloadPublicationExtension`.
pub payload_publication_extension: Option<Box<Extension>>,
/// XML element `vms:headerInformation`.
pub header_information: Option<Box<com::HeaderInformation>>,
/// XML element `vms:vmsControllerTable`.
pub vms_controller_table: Vec<VmsControllerTable>,
/// XML element `vms:_vmsTablePublicationExtension`.
pub vms_table_publication_extension: Option<Box<Extension>>,
}
impl VmsTablePublication {
const FIELDS: &'static [u32] = &[0x40859, 0x4085a, 0x40adb, 0x40ada, 0x4056a, 0x170893, 0x170cbb, 0x17067b];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x170285);
let a0 = r.req_attr(2285);
let _ = r.attr(2439);
let a2 = r.attr(2104);
let a3 = r.attr(2105);
let a4 = r.attr(2760);
let a5 = r.attr(2761);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = Vec::new();
let mut e7 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x40859 => { let v = r.multilingual()?; r.set(&mut e0, v, 2137); }
0x4085a => { let v = r.string()?; r.set(&mut e1, v, 2138); }
0x40adb => { let v = r.date_time()?; r.set(&mut e2, v, 2779); }
0x40ada => { let v = Some(com::InternationalIdentifier::read(r)?); r.set(&mut e3, v.map(Box::new), 2778); }
0x4056a => { let v = r.raw()?; r.set(&mut e4, v.map(Box::new), 1386); }
0x170893 => { let v = Some(com::HeaderInformation::read(r)?); r.set(&mut e5, v.map(Box::new), 2195); }
0x170cbb => { let v = Some(VmsControllerTable::read(r)?); e6.extend(v); }
0x17067b => { let v = r.raw()?; r.set(&mut e7, v.map(Box::new), 1659); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e2, 2779);
r.required(&e3, 2778);
r.required(&e5, 2195);
let v = Self {
lang: a0,
extension_name: a2,
extension_version: a3,
profile_name: a4,
profile_version: a5,
feed_description: e0,
feed_type: e1,
publication_time: e2,
publication_creator: e3,
payload_publication_extension: e4,
header_information: e5,
vms_controller_table: e6,
vms_table_publication_extension: e7,
};
r.close();
Ok(v)
}
}
impl VmsTablePublication {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
w.constant_attrs(" modelBaseVersion=\"3\"")?;
match &self.lang {
Some(v) => { w.pattern("lang", "Language", v, Pattern::Language)?; w.attr("lang", v)?; }
None => return Err(w.missing_attr("lang")),
}
if let Some(v) = &self.extension_name { w.attr("extensionName", v)?; }
if let Some(v) = &self.extension_version { w.attr("extensionVersion", v)?; }
if let Some(v) = &self.profile_name { w.attr("profileName", v)?; }
if let Some(v) = &self.profile_version { w.attr("profileVersion", v)?; }
if let Some(v) = &self.feed_description { w.multilingual("com:feedDescription", v)?; }
if let Some(v) = &self.feed_type { w.max_len("feedType", "String", v, 1024)?; w.leaf("com:feedType", v)?; }
match &self.publication_time {
Some(v) => { w.leaf("com:publicationTime", v)?; }
None => return Err(w.missing("com:publicationTime")),
}
match &self.publication_creator {
Some(v) => { v.write(w, "com:publicationCreator", "", "")?; }
None => return Err(w.missing("com:publicationCreator")),
}
if let Some(v) = &self.payload_publication_extension { w.extension("com:_payloadPublicationExtension", v)?; }
match &self.header_information {
Some(v) => { v.write(w, "vms:headerInformation", "", "")?; }
None => return Err(w.missing("vms:headerInformation")),
}
w.count("vms:vmsControllerTable", self.vms_controller_table.len(), 1, usize::MAX)?;
for v in &self.vms_controller_table { v.write(w, "vms:vmsControllerTable", "", "")?; }
if let Some(v) = &self.vms_table_publication_extension { w.extension("vms:_vmsTablePublicationExtension", v)?; }
w.end(tag)
}
}
impl VmsTablePublication {
pub(crate) fn read_json(r: &mut JsonReader<'_>) -> Result<Option<Self>, Error> {
if !r.begin_object()? {
return Ok(None);
}
Self::read_json_members(r, None).map(Some)
}
/// Reads the members of an object that is already open; `pending` is a member key read
/// already.
pub(crate) fn read_json_members(r: &mut JsonReader<'_>, mut pending: Option<u32>) -> Result<Self, Error> {
let mut seen = [false; 13];
let mut f0 = None;
let mut f1 = None;
let mut f2 = None;
let mut f3 = None;
let mut f4 = None;
let mut f5 = None;
let mut f6 = None;
let mut f7 = None;
let mut f8 = None;
let mut f9 = None;
let mut f10 = None;
let mut f11 = Vec::new();
let mut f12 = None;
loop {
let key = match pending.take() {
Some(key) => key,
None => match r.next_key()? {
Some(key) => key,
None => break,
},
};
match key {
1032 => if r.first(&mut seen[0])? { f0 = r.string()?; },
847 => if r.first(&mut seen[5])? { f5 = r.multilingual()?; },
848 => if r.first(&mut seen[6])? { f6 = r.string()?; },
1779 => if r.first(&mut seen[7])? { f7 = r.date_time()?; },
1778 => if r.first(&mut seen[8])? { f8 = com::InternationalIdentifier::read_json(r)?.map(Box::new); },
387 => if r.first(&mut seen[9])? { f9 = r.raw_object()?.map(Box::new); },
940 => if r.first(&mut seen[10])? { f10 = com::HeaderInformation::read_json(r)?.map(Box::new); },
2594 => if r.first(&mut seen[11])? { let mut l = r.list()?; while r.item(&mut l)? { if let Some(v) = VmsControllerTable::read_json(r)? { f11.push(v); } } },
2655 => if r.first(&mut seen[12])? { f12 = r.raw_object()?.map(Box::new); },
_ => r.skip_unknown()?,
}
}
r.required(&f0, 1032);
r.required(&f7, 1779);
r.required(&f8, 1778);
r.required(&f10, 940);
Ok(Self {
lang: f0,
extension_name: f1,
extension_version: f2,
profile_name: f3,
profile_version: f4,
feed_description: f5,
feed_type: f6,
publication_time: f7,
publication_creator: f8,
payload_publication_extension: f9,
header_information: f10,
vms_controller_table: f11,
vms_table_publication_extension: f12,
})
}
pub(crate) fn write_json(&self, w: &mut JsonWriter<'_>, target_class: Option<&'static str>) -> Result<(), Error> {
w.begin_object(1105)?;
if let Some(class) = target_class {
w.target_class(class)?;
}
match &self.lang {
Some(v) => {
w.key(1032)?;
w.pattern("lang", "Language", v, Pattern::Language)?; w.string(v)?;
}
None => w.absent(1032, w.missing_attr("lang"))?,
}
if let Some(v) = &self.feed_description {
w.key(847)?;
w.multilingual(v)?;
}
if let Some(v) = &self.feed_type {
w.key(848)?;
w.max_len("feedType", "String", v, 1024)?; w.string(v)?;
}
match &self.publication_time {
Some(v) => {
w.key(1779)?;
w.date_time(v)?;
}
None => w.absent(1779, w.missing("publicationTime"))?,
}
match &self.publication_creator {
Some(v) => {
w.key(1778)?;
v.write_json(w, None)?;
}
None => w.absent(1778, w.missing("publicationCreator"))?,
}
if let Some(v) = &self.payload_publication_extension {
w.key(387)?;
w.extension(v)?;
}
match &self.header_information {
Some(v) => {
w.key(940)?;
v.write_json(w, None)?;
}
None => w.absent(940, w.missing("headerInformation"))?,
}
w.count("vmsControllerTable", self.vms_controller_table.len(), 1, usize::MAX)?;
if !self.vms_controller_table.is_empty() {
w.key(2594)?;
w.begin_array()?;
for v in &self.vms_controller_table {
w.item()?;
v.write_json(w, None)?;
}
w.end_array()?;
}
if let Some(v) = &self.vms_table_publication_extension {
w.key(2655)?;
w.extension(v)?;
}
w.end_object()
}
}
/// XML type `vms:_MultiPageDisplayPageNumberDisplayAreaSettings`.
#[derive(Debug, Clone, Default, PartialEq)]
pub struct MultiPageDisplayPageNumberDisplayAreaSettings {
/// XML attribute `pageNumber`.
pub page_number: Option<i32>,
/// XML element `vms:displayAreaSettings`.
pub display_area_settings: Option<DisplayAreaSettings>,
}
impl MultiPageDisplayPageNumberDisplayAreaSettings {
const FIELDS: &'static [u32] = &[0x1707c7];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x170331);
let a0 = r.req_attr_value::<i32>(2624)?;
r.attrs_done();
let mut e0 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x1707c7 => { let v = DisplayAreaSettings::read(r)?; r.set(&mut e0, v, 1991); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 1991);
let v = Self {
page_number: a0,
display_area_settings: e0,
};
r.close();
Ok(v)
}
}
impl MultiPageDisplayPageNumberDisplayAreaSettings {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.page_number {
Some(v) => { w.attr_value("pageNumber", v)?; }
None => return Err(w.missing_attr("pageNumber")),
}
match &self.display_area_settings {
Some(v) => { v.write(w, "vms:displayAreaSettings")?; }
None => return Err(w.missing("vms:displayAreaSettings")),
}
w.end(tag)
}
}
impl MultiPageDisplayPageNumberDisplayAreaSettings {
pub(crate) fn read_json(r: &mut JsonReader<'_>) -> Result<Option<Self>, Error> {
if !r.begin_object()? {
return Ok(None);
}
Self::read_json_members(r, None).map(Some)
}
/// Reads the members of an object that is already open; `pending` is a member key read
/// already.
pub(crate) fn read_json_members(r: &mut JsonReader<'_>, mut pending: Option<u32>) -> Result<Self, Error> {
let mut seen = [false; 2];
let mut f0 = None;
let mut f1 = None;
loop {
let key = match pending.take() {
Some(key) => key,
None => match r.next_key()? {
Some(key) => key,
None => break,
},
};
match key {
1523 => if r.first(&mut seen[0])? { f0 = r.number::<i32>()?; },
576 => if r.first(&mut seen[1])? { f1 = DisplayAreaSettings::read_json(r)?; },
_ => r.skip_unknown()?,
}
}
r.required(&f0, 1523);
r.required(&f1, 576);
Ok(Self {
page_number: f0,
display_area_settings: f1,
})
}
pub(crate) fn write_json(&self, w: &mut JsonWriter<'_>, target_class: Option<&'static str>) -> Result<(), Error> {
w.begin_object(1108)?;
if let Some(class) = target_class {
w.target_class(class)?;
}
match &self.page_number {
Some(v) => {
w.key(1523)?;
w.integer(*v)?;
}
None => w.absent(1523, w.missing_attr("pageNumber"))?,
}
match &self.display_area_settings {
Some(v) => {
w.key(576)?;
v.write_json(w)?;
}
None => w.absent(576, w.missing("displayAreaSettings"))?,
}
w.end_object()
}
}
/// XML type `vms:_TextDisplayLineIndexTextLine`.
#[derive(Debug, Clone, Default, PartialEq)]
pub struct TextDisplayLineIndexTextLine {
/// XML attribute `lineIndex`.
pub line_index: Option<i32>,
/// XML element `vms:textLine`.
pub text_line: Option<Box<TextLine>>,
}
impl TextDisplayLineIndexTextLine {
const FIELDS: &'static [u32] = &[0x170c10];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x1703ce);
let a0 = r.req_attr_value::<i32>(2316)?;
r.attrs_done();
let mut e0 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x170c10 => { let v = Some(TextLine::read(r)?); r.set(&mut e0, v.map(Box::new), 3088); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 3088);
let v = Self {
line_index: a0,
text_line: e0,
};
r.close();
Ok(v)
}
}
impl TextDisplayLineIndexTextLine {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.line_index {
Some(v) => { w.attr_value("lineIndex", v)?; }
None => return Err(w.missing_attr("lineIndex")),
}
match &self.text_line {
Some(v) => { v.write(w, "vms:textLine", "", "")?; }
None => return Err(w.missing("vms:textLine")),
}
w.end(tag)
}
}
impl TextDisplayLineIndexTextLine {
pub(crate) fn read_json(r: &mut JsonReader<'_>) -> Result<Option<Self>, Error> {
if !r.begin_object()? {
return Ok(None);
}
Self::read_json_members(r, None).map(Some)
}
/// Reads the members of an object that is already open; `pending` is a member key read
/// already.
pub(crate) fn read_json_members(r: &mut JsonReader<'_>, mut pending: Option<u32>) -> Result<Self, Error> {
let mut seen = [false; 2];
let mut f0 = None;
let mut f1 = None;
loop {
let key = match pending.take() {
Some(key) => key,
None => match r.next_key()? {
Some(key) => key,
None => break,
},
};
match key {
1063 => if r.first(&mut seen[0])? { f0 = r.number::<i32>()?; },
2251 => if r.first(&mut seen[1])? { f1 = TextLine::read_json(r)?.map(Box::new); },
_ => r.skip_unknown()?,
}
}
r.required(&f0, 1063);
r.required(&f1, 2251);
Ok(Self {
line_index: f0,
text_line: f1,
})
}
pub(crate) fn write_json(&self, w: &mut JsonWriter<'_>, target_class: Option<&'static str>) -> Result<(), Error> {
w.begin_object(1109)?;
if let Some(class) = target_class {
w.target_class(class)?;
}
match &self.line_index {
Some(v) => {
w.key(1063)?;
w.integer(*v)?;
}
None => w.absent(1063, w.missing_attr("lineIndex"))?,
}
match &self.text_line {
Some(v) => {
w.key(2251)?;
v.write_json(w, None)?;
}
None => w.absent(2251, w.missing("textLine"))?,
}
w.end_object()
}
}
/// XML type `vms:_VmsConfigurationDisplayAreaIndexDisplayArea`.
#[derive(Debug, Clone, Default, PartialEq)]
pub struct VmsConfigurationDisplayAreaIndexDisplayArea {
/// XML attribute `displayAreaIndex`.
pub display_area_index: Option<i32>,
/// XML element `vms:displayArea`.
pub display_area: Option<AnyDisplayArea>,
}
impl VmsConfigurationDisplayAreaIndexDisplayArea {
const FIELDS: &'static [u32] = &[0x1707c5];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x1703fb);
let a0 = r.req_attr_value::<i32>(1990)?;
r.attrs_done();
let mut e0 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x1707c5 => { let v = AnyDisplayArea::read(r)?; r.set(&mut e0, v, 1989); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 1989);
let v = Self {
display_area_index: a0,
display_area: e0,
};
r.close();
Ok(v)
}
}
impl VmsConfigurationDisplayAreaIndexDisplayArea {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.display_area_index {
Some(v) => { w.attr_value("displayAreaIndex", v)?; }
None => return Err(w.missing_attr("displayAreaIndex")),
}
match &self.display_area {
Some(v) => { v.write(w, "vms:displayArea")?; }
None => return Err(w.missing("vms:displayArea")),
}
w.end(tag)
}
}
impl VmsConfigurationDisplayAreaIndexDisplayArea {
pub(crate) fn read_json(r: &mut JsonReader<'_>) -> Result<Option<Self>, Error> {
if !r.begin_object()? {
return Ok(None);
}
Self::read_json_members(r, None).map(Some)
}
/// Reads the members of an object that is already open; `pending` is a member key read
/// already.
pub(crate) fn read_json_members(r: &mut JsonReader<'_>, mut pending: Option<u32>) -> Result<Self, Error> {
let mut seen = [false; 2];
let mut f0 = None;
let mut f1 = None;
loop {
let key = match pending.take() {
Some(key) => key,
None => match r.next_key()? {
Some(key) => key,
None => break,
},
};
match key {
575 => if r.first(&mut seen[0])? { f0 = r.number::<i32>()?; },
574 => if r.first(&mut seen[1])? { f1 = AnyDisplayArea::read_json(r)?; },
_ => r.skip_unknown()?,
}
}
r.required(&f0, 575);
r.required(&f1, 574);
Ok(Self {
display_area_index: f0,
display_area: f1,
})
}
pub(crate) fn write_json(&self, w: &mut JsonWriter<'_>, target_class: Option<&'static str>) -> Result<(), Error> {
w.begin_object(1110)?;
if let Some(class) = target_class {
w.target_class(class)?;
}
match &self.display_area_index {
Some(v) => {
w.key(575)?;
w.integer(*v)?;
}
None => w.absent(575, w.missing_attr("displayAreaIndex"))?,
}
match &self.display_area {
Some(v) => {
w.key(574)?;
v.write_json(w)?;
}
None => w.absent(574, w.missing("displayArea"))?,
}
w.end_object()
}
}
/// XML type `vms:_VmsControllerStatusVmsIndexVmsStatus`.
#[derive(Debug, Clone, Default, PartialEq)]
pub struct VmsControllerStatusVmsIndexVmsStatus {
/// XML attribute `vmsIndex`.
pub vms_index: Option<i32>,
/// XML element `vms:vmsStatus`.
pub vms_status: Option<Box<VmsStatus>>,
}
impl VmsControllerStatusVmsIndexVmsStatus {
const FIELDS: &'static [u32] = &[0x170cc5];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x1703fd);
let a0 = r.req_attr_value::<i32>(3264)?;
r.attrs_done();
let mut e0 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x170cc5 => { let v = Some(VmsStatus::read(r)?); r.set(&mut e0, v.map(Box::new), 3269); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 3269);
let v = Self {
vms_index: a0,
vms_status: e0,
};
r.close();
Ok(v)
}
}
impl VmsControllerStatusVmsIndexVmsStatus {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.vms_index {
Some(v) => { w.attr_value("vmsIndex", v)?; }
None => return Err(w.missing_attr("vmsIndex")),
}
match &self.vms_status {
Some(v) => { v.write(w, "vms:vmsStatus", "", "")?; }
None => return Err(w.missing("vms:vmsStatus")),
}
w.end(tag)
}
}
impl VmsControllerStatusVmsIndexVmsStatus {
pub(crate) fn read_json(r: &mut JsonReader<'_>) -> Result<Option<Self>, Error> {
if !r.begin_object()? {
return Ok(None);
}
Self::read_json_members(r, None).map(Some)
}
/// Reads the members of an object that is already open; `pending` is a member key read
/// already.
pub(crate) fn read_json_members(r: &mut JsonReader<'_>, mut pending: Option<u32>) -> Result<Self, Error> {
let mut seen = [false; 2];
let mut f0 = None;
let mut f1 = None;
loop {
let key = match pending.take() {
Some(key) => key,
None => match r.next_key()? {
Some(key) => key,
None => break,
},
};
match key {
2608 => if r.first(&mut seen[0])? { f0 = r.number::<i32>()?; },
2623 => if r.first(&mut seen[1])? { f1 = VmsStatus::read_json(r)?.map(Box::new); },
_ => r.skip_unknown()?,
}
}
r.required(&f0, 2608);
r.required(&f1, 2623);
Ok(Self {
vms_index: f0,
vms_status: f1,
})
}
pub(crate) fn write_json(&self, w: &mut JsonWriter<'_>, target_class: Option<&'static str>) -> Result<(), Error> {
w.begin_object(1111)?;
if let Some(class) = target_class {
w.target_class(class)?;
}
match &self.vms_index {
Some(v) => {
w.key(2608)?;
w.integer(*v)?;
}
None => w.absent(2608, w.missing_attr("vmsIndex"))?,
}
match &self.vms_status {
Some(v) => {
w.key(2623)?;
v.write_json(w, None)?;
}
None => w.absent(2623, w.missing("vmsStatus"))?,
}
w.end_object()
}
}
/// XML type `vms:_VmsControllerVmsIndexVms`.
#[derive(Debug, Clone, Default, PartialEq)]
pub struct VmsControllerVmsIndexVms {
/// XML attribute `vmsIndex`.
pub vms_index: Option<i32>,
/// XML element `vms:vms`.
pub vms: Option<Box<Vms>>,
}
impl VmsControllerVmsIndexVms {
const FIELDS: &'static [u32] = &[0x170cb5];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x170400);
let a0 = r.req_attr_value::<i32>(3264)?;
r.attrs_done();
let mut e0 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x170cb5 => { let v = Some(Vms::read(r)?); r.set(&mut e0, v.map(Box::new), 3253); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 3253);
let v = Self {
vms_index: a0,
vms: e0,
};
r.close();
Ok(v)
}
}
impl VmsControllerVmsIndexVms {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.vms_index {
Some(v) => { w.attr_value("vmsIndex", v)?; }
None => return Err(w.missing_attr("vmsIndex")),
}
match &self.vms {
Some(v) => { v.write(w, "vms:vms", "", "")?; }
None => return Err(w.missing("vms:vms")),
}
w.end(tag)
}
}
impl VmsControllerVmsIndexVms {
pub(crate) fn read_json(r: &mut JsonReader<'_>) -> Result<Option<Self>, Error> {
if !r.begin_object()? {
return Ok(None);
}
Self::read_json_members(r, None).map(Some)
}
/// Reads the members of an object that is already open; `pending` is a member key read
/// already.
pub(crate) fn read_json_members(r: &mut JsonReader<'_>, mut pending: Option<u32>) -> Result<Self, Error> {
let mut seen = [false; 2];
let mut f0 = None;
let mut f1 = None;
loop {
let key = match pending.take() {
Some(key) => key,
None => match r.next_key()? {
Some(key) => key,
None => break,
},
};
match key {
2608 => if r.first(&mut seen[0])? { f0 = r.number::<i32>()?; },
2586 => if r.first(&mut seen[1])? { f1 = Vms::read_json(r)?.map(Box::new); },
_ => r.skip_unknown()?,
}
}
r.required(&f0, 2608);
r.required(&f1, 2586);
Ok(Self {
vms_index: f0,
vms: f1,
})
}
pub(crate) fn write_json(&self, w: &mut JsonWriter<'_>, target_class: Option<&'static str>) -> Result<(), Error> {
w.begin_object(1112)?;
if let Some(class) = target_class {
w.target_class(class)?;
}
match &self.vms_index {
Some(v) => {
w.key(2608)?;
w.integer(*v)?;
}
None => w.absent(2608, w.missing_attr("vmsIndex"))?,
}
match &self.vms {
Some(v) => {
w.key(2586)?;
v.write_json(w, None)?;
}
None => w.absent(2586, w.missing("vms"))?,
}
w.end_object()
}
}
/// XML type `vms:_VmsMessageDisplayAreaIndexDisplayAreaSettings`.
#[derive(Debug, Clone, Default, PartialEq)]
pub struct VmsMessageDisplayAreaIndexDisplayAreaSettings {
/// XML attribute `displayAreaIndex`.
pub display_area_index: Option<i32>,
/// XML element `vms:displayAreaSettings`.
pub display_area_settings: Option<DisplayAreaSettings>,
}
impl VmsMessageDisplayAreaIndexDisplayAreaSettings {
const FIELDS: &'static [u32] = &[0x1707c7];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x170402);
let a0 = r.req_attr_value::<i32>(1990)?;
r.attrs_done();
let mut e0 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x1707c7 => { let v = DisplayAreaSettings::read(r)?; r.set(&mut e0, v, 1991); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 1991);
let v = Self {
display_area_index: a0,
display_area_settings: e0,
};
r.close();
Ok(v)
}
}
impl VmsMessageDisplayAreaIndexDisplayAreaSettings {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.display_area_index {
Some(v) => { w.attr_value("displayAreaIndex", v)?; }
None => return Err(w.missing_attr("displayAreaIndex")),
}
match &self.display_area_settings {
Some(v) => { v.write(w, "vms:displayAreaSettings")?; }
None => return Err(w.missing("vms:displayAreaSettings")),
}
w.end(tag)
}
}
impl VmsMessageDisplayAreaIndexDisplayAreaSettings {
pub(crate) fn read_json(r: &mut JsonReader<'_>) -> Result<Option<Self>, Error> {
if !r.begin_object()? {
return Ok(None);
}
Self::read_json_members(r, None).map(Some)
}
/// Reads the members of an object that is already open; `pending` is a member key read
/// already.
pub(crate) fn read_json_members(r: &mut JsonReader<'_>, mut pending: Option<u32>) -> Result<Self, Error> {
let mut seen = [false; 2];
let mut f0 = None;
let mut f1 = None;
loop {
let key = match pending.take() {
Some(key) => key,
None => match r.next_key()? {
Some(key) => key,
None => break,
},
};
match key {
575 => if r.first(&mut seen[0])? { f0 = r.number::<i32>()?; },
576 => if r.first(&mut seen[1])? { f1 = DisplayAreaSettings::read_json(r)?; },
_ => r.skip_unknown()?,
}
}
r.required(&f0, 575);
r.required(&f1, 576);
Ok(Self {
display_area_index: f0,
display_area_settings: f1,
})
}
pub(crate) fn write_json(&self, w: &mut JsonWriter<'_>, target_class: Option<&'static str>) -> Result<(), Error> {
w.begin_object(1113)?;
if let Some(class) = target_class {
w.target_class(class)?;
}
match &self.display_area_index {
Some(v) => {
w.key(575)?;
w.integer(*v)?;
}
None => w.absent(575, w.missing_attr("displayAreaIndex"))?,
}
match &self.display_area_settings {
Some(v) => {
w.key(576)?;
v.write_json(w)?;
}
None => w.absent(576, w.missing("displayAreaSettings"))?,
}
w.end_object()
}
}
/// XML type `vms:_VmsStatusMessageIndexVmsMessage`.
#[derive(Debug, Clone, Default, PartialEq)]
pub struct VmsStatusMessageIndexVmsMessage {
/// XML attribute `messageIndex`.
pub message_index: Option<i32>,
/// XML element `vms:vmsMessage`.
pub vms_message: Option<Box<VmsMessage>>,
}
impl VmsStatusMessageIndexVmsMessage {
const FIELDS: &'static [u32] = &[0x170cc3];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x170403);
let a0 = r.req_attr_value::<i32>(2410)?;
r.attrs_done();
let mut e0 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x170cc3 => { let v = Some(VmsMessage::read(r)?); r.set(&mut e0, v.map(Box::new), 3267); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 3267);
let v = Self {
message_index: a0,
vms_message: e0,
};
r.close();
Ok(v)
}
}
impl VmsStatusMessageIndexVmsMessage {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.message_index {
Some(v) => { w.attr_value("messageIndex", v)?; }
None => return Err(w.missing_attr("messageIndex")),
}
match &self.vms_message {
Some(v) => { v.write(w, "vms:vmsMessage", "", "")?; }
None => return Err(w.missing("vms:vmsMessage")),
}
w.end(tag)
}
}
impl VmsStatusMessageIndexVmsMessage {
pub(crate) fn read_json(r: &mut JsonReader<'_>) -> Result<Option<Self>, Error> {
if !r.begin_object()? {
return Ok(None);
}
Self::read_json_members(r, None).map(Some)
}
/// Reads the members of an object that is already open; `pending` is a member key read
/// already.
pub(crate) fn read_json_members(r: &mut JsonReader<'_>, mut pending: Option<u32>) -> Result<Self, Error> {
let mut seen = [false; 2];
let mut f0 = None;
let mut f1 = None;
loop {
let key = match pending.take() {
Some(key) => key,
None => match r.next_key()? {
Some(key) => key,
None => break,
},
};
match key {
1312 => if r.first(&mut seen[0])? { f0 = r.number::<i32>()?; },
2612 => if r.first(&mut seen[1])? { f1 = VmsMessage::read_json(r)?.map(Box::new); },
_ => r.skip_unknown()?,
}
}
r.required(&f0, 1312);
r.required(&f1, 2612);
Ok(Self {
message_index: f0,
vms_message: f1,
})
}
pub(crate) fn write_json(&self, w: &mut JsonWriter<'_>, target_class: Option<&'static str>) -> Result<(), Error> {
w.begin_object(1114)?;
if let Some(class) = target_class {
w.target_class(class)?;
}
match &self.message_index {
Some(v) => {
w.key(1312)?;
w.integer(*v)?;
}
None => w.absent(1312, w.missing_attr("messageIndex"))?,
}
match &self.vms_message {
Some(v) => {
w.key(2612)?;
v.write_json(w, None)?;
}
None => w.absent(2612, w.missing("vmsMessage"))?,
}
w.end_object()
}
}
/// Any concrete kind of XML type `vms:DisplayArea`, chosen by `xsi:type`.
#[derive(Debug, Clone, PartialEq)]
pub enum AnyDisplayArea {
/// XML type `vms:DisplayArea`.
DisplayArea(Box<DisplayArea>),
/// XML type `vms:PictogramDisplayArea`.
PictogramDisplayArea(Box<PictogramDisplayArea>),
/// XML type `vms:SupplementaryPanelArea`.
SupplementaryPanelArea(Box<SupplementaryPanelArea>),
/// XML type `vms:TextDisplayArea`.
TextDisplayArea(Box<TextDisplayArea>),
}
impl AnyDisplayArea {
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Option<Self>, Error> {
Self::read_as(r, r.xsi_type())
}
pub(crate) fn read_as(r: &mut Xml<'_>, kind: Option<u32>) -> Result<Option<Self>, Error> {
Ok(Some(match kind {
Some(0x170083) => Self::DisplayArea(Box::new(DisplayArea::read(r)?)),
Some(0x170180) => Self::PictogramDisplayArea(Box::new(PictogramDisplayArea::read(r)?)),
Some(0x170211) => Self::SupplementaryPanelArea(Box::new(SupplementaryPanelArea::read(r)?)),
Some(0x17021f) => Self::TextDisplayArea(Box::new(TextDisplayArea::read(r)?)),
None => Self::DisplayArea(Box::new(DisplayArea::read(r)?)),
_ => {
r.unknown_type_as("DisplayArea");
Self::DisplayArea(Box::new(DisplayArea::read(r)?))
}
}))
}
/// XML element `vms:sequencingCapable`, which every kind has.
pub fn sequencing_capable(&self) -> Option<&com::Boolean> {
match self {
Self::DisplayArea(v) => v.sequencing_capable.as_ref(),
Self::PictogramDisplayArea(v) => v.sequencing_capable.as_ref(),
Self::SupplementaryPanelArea(v) => v.sequencing_capable.as_ref(),
Self::TextDisplayArea(v) => v.sequencing_capable.as_ref(),
}
}
/// XML element `vms:maxNumberOfSequentialPages`, which every kind has.
pub fn max_number_of_sequential_pages(&self) -> Option<&com::NonNegativeInteger> {
match self {
Self::DisplayArea(v) => v.max_number_of_sequential_pages.as_ref(),
Self::PictogramDisplayArea(v) => v.max_number_of_sequential_pages.as_ref(),
Self::SupplementaryPanelArea(v) => v.max_number_of_sequential_pages.as_ref(),
Self::TextDisplayArea(v) => v.max_number_of_sequential_pages.as_ref(),
}
}
/// XML element `vms:positionXAbsolute`, which every kind has.
pub fn position_x_absolute(&self) -> Option<&PositionXAbsoluteEnum> {
match self {
Self::DisplayArea(v) => v.position_x_absolute.as_ref(),
Self::PictogramDisplayArea(v) => v.position_x_absolute.as_ref(),
Self::SupplementaryPanelArea(v) => v.position_x_absolute.as_ref(),
Self::TextDisplayArea(v) => v.position_x_absolute.as_ref(),
}
}
/// XML element `vms:positionXRelativeToPrevious`, which every kind has.
pub fn position_x_relative_to_previous(&self) -> Option<&PositionXRelativeEnum> {
match self {
Self::DisplayArea(v) => v.position_x_relative_to_previous.as_ref(),
Self::PictogramDisplayArea(v) => v.position_x_relative_to_previous.as_ref(),
Self::SupplementaryPanelArea(v) => v.position_x_relative_to_previous.as_ref(),
Self::TextDisplayArea(v) => v.position_x_relative_to_previous.as_ref(),
}
}
/// XML element `vms:positionYAbsolute`, which every kind has.
pub fn position_y_absolute(&self) -> Option<&PositionYAbsoluteEnum> {
match self {
Self::DisplayArea(v) => v.position_y_absolute.as_ref(),
Self::PictogramDisplayArea(v) => v.position_y_absolute.as_ref(),
Self::SupplementaryPanelArea(v) => v.position_y_absolute.as_ref(),
Self::TextDisplayArea(v) => v.position_y_absolute.as_ref(),
}
}
/// XML element `vms:positionYRelativeToPrevious`, which every kind has.
pub fn position_y_relative_to_previous(&self) -> Option<&PositionYRelativeEnum> {
match self {
Self::DisplayArea(v) => v.position_y_relative_to_previous.as_ref(),
Self::PictogramDisplayArea(v) => v.position_y_relative_to_previous.as_ref(),
Self::SupplementaryPanelArea(v) => v.position_y_relative_to_previous.as_ref(),
Self::TextDisplayArea(v) => v.position_y_relative_to_previous.as_ref(),
}
}
/// XML element `vms:displayGeometry`, which every kind has.
pub fn display_geometry(&self) -> Option<&DisplayGeometry> {
match self {
Self::DisplayArea(v) => v.display_geometry.as_deref(),
Self::PictogramDisplayArea(v) => v.display_geometry.as_deref(),
Self::SupplementaryPanelArea(v) => v.display_geometry.as_deref(),
Self::TextDisplayArea(v) => v.display_geometry.as_deref(),
}
}
/// XML element `vms:overriddenLaneAssociation`, which every kind has.
pub fn overridden_lane_association(&self) -> &[loc::Lane] {
match self {
Self::DisplayArea(v) => &v.overridden_lane_association,
Self::PictogramDisplayArea(v) => &v.overridden_lane_association,
Self::SupplementaryPanelArea(v) => &v.overridden_lane_association,
Self::TextDisplayArea(v) => &v.overridden_lane_association,
}
}
/// XML element `vms:_displayAreaExtension`, which every kind has.
pub fn display_area_extension(&self) -> Option<&Extension> {
match self {
Self::DisplayArea(v) => v.display_area_extension.as_deref(),
Self::PictogramDisplayArea(v) => v.display_area_extension.as_deref(),
Self::SupplementaryPanelArea(v) => v.display_area_extension.as_deref(),
Self::TextDisplayArea(v) => v.display_area_extension.as_deref(),
}
}
}
impl AnyDisplayArea {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str) -> Result<(), Error> {
match self {
Self::DisplayArea(v) => v.write(w, tag, "", ""),
Self::PictogramDisplayArea(v) => v.write(w, tag, " xsi:type=\"vms:PictogramDisplayArea\"", ""),
Self::SupplementaryPanelArea(v) => v.write(w, tag, " xsi:type=\"vms:SupplementaryPanelArea\"", ""),
Self::TextDisplayArea(v) => v.write(w, tag, " xsi:type=\"vms:TextDisplayArea\"", ""),
}
}
}
impl AnyDisplayArea {
pub(crate) fn read_json(r: &mut JsonReader<'_>) -> Result<Option<Self>, Error> {
if !r.begin_object()? {
return Ok(None);
}
let mut pending = r.next_key()?;
// The concrete base may come without its wrapper.
if let Some(key) = pending {
if !matches!(key, 2597 | 2617 | 2625 | 2632) {
return DisplayArea::read_json_members(r, Some(key)).map(|v| Some(Self::DisplayArea(Box::new(v))));
}
}
let mut seen = false;
let mut value = None;
loop {
let key = match pending.take() {
Some(key) => key,
None => match r.next_key()? {
Some(key) => key,
None => break,
},
};
match key {
2597 => if r.first(&mut seen)? { value = DisplayArea::read_json(r)?.map(|v| Self::DisplayArea(Box::new(v))); },
2617 => if r.first(&mut seen)? { value = PictogramDisplayArea::read_json(r)?.map(|v| Self::PictogramDisplayArea(Box::new(v))); },
2625 => if r.first(&mut seen)? { value = SupplementaryPanelArea::read_json(r)?.map(|v| Self::SupplementaryPanelArea(Box::new(v))); },
2632 => if r.first(&mut seen)? { value = TextDisplayArea::read_json(r)?.map(|v| Self::TextDisplayArea(Box::new(v))); },
_ => r.skip_unknown()?,
}
}
if !seen {
r.warn(WarningKind::UnknownType, "no known kind of DisplayArea in its wrapper".to_owned());
}
Ok(value)
}
pub(crate) fn write_json(&self, w: &mut JsonWriter<'_>) -> Result<(), Error> {
match self {
Self::DisplayArea(v) => {
if w.wrapper(2597)? {
w.begin_object(1058)?;
w.key(2597)?;
v.write_json(w, None)?;
w.end_object()
} else {
v.write_json(w, None)
}
}
Self::PictogramDisplayArea(v) => {
if w.wrapper(2617)? {
w.begin_object(1058)?;
w.key(2617)?;
v.write_json(w, None)?;
w.end_object()
} else {
v.write_json(w, None)
}
}
Self::SupplementaryPanelArea(v) => {
if w.wrapper(2625)? {
w.begin_object(1058)?;
w.key(2625)?;
v.write_json(w, None)?;
w.end_object()
} else {
v.write_json(w, None)
}
}
Self::TextDisplayArea(v) => {
if w.wrapper(2632)? {
w.begin_object(1058)?;
w.key(2632)?;
v.write_json(w, None)?;
w.end_object()
} else {
v.write_json(w, None)
}
}
}
}
}
/// Any concrete kind of XML type `vms:DisplayAreaSettings`, chosen by `xsi:type`.
#[derive(Debug, Clone, PartialEq)]
pub enum DisplayAreaSettings {
/// XML type `vms:MultiPageDisplay`.
MultiPageDisplay(Box<MultiPageDisplay>),
/// XML type `vms:PictogramDisplay`.
PictogramDisplay(Box<PictogramDisplay>),
/// XML type `vms:SupplementaryPictogram`.
SupplementaryPictogram(Box<SupplementaryPictogram>),
/// XML type `vms:SupplementaryText`.
SupplementaryText(Box<SupplementaryText>),
/// XML type `vms:TextDisplay`.
TextDisplay(Box<TextDisplay>),
}
impl DisplayAreaSettings {
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Option<Self>, Error> {
Self::read_as(r, r.xsi_type())
}
pub(crate) fn read_as(r: &mut Xml<'_>, kind: Option<u32>) -> Result<Option<Self>, Error> {
Ok(Some(match kind {
Some(0x170119) => Self::MultiPageDisplay(Box::new(MultiPageDisplay::read(r)?)),
Some(0x17017f) => Self::PictogramDisplay(Box::new(PictogramDisplay::read(r)?)),
Some(0x170212) => Self::SupplementaryPictogram(Box::new(SupplementaryPictogram::read(r)?)),
Some(0x170215) => Self::SupplementaryText(Box::new(SupplementaryText::read(r)?)),
Some(0x17021e) => Self::TextDisplay(Box::new(TextDisplay::read(r)?)),
_ => {
r.unknown_type("DisplayAreaSettings")?;
return Ok(None);
}
}))
}
/// XML element `vms:isBlank`, which every kind has.
pub fn is_blank(&self) -> Option<&com::Boolean> {
match self {
Self::MultiPageDisplay(v) => v.is_blank.as_ref(),
Self::PictogramDisplay(v) => v.is_blank.as_ref(),
Self::SupplementaryPictogram(v) => v.is_blank.as_ref(),
Self::SupplementaryText(v) => v.is_blank.as_ref(),
Self::TextDisplay(v) => v.is_blank.as_ref(),
}
}
/// XML element `vms:legallyBinding`, which every kind has.
pub fn legally_binding(&self) -> Option<&com::Boolean> {
match self {
Self::MultiPageDisplay(v) => v.legally_binding.as_ref(),
Self::PictogramDisplay(v) => v.legally_binding.as_ref(),
Self::SupplementaryPictogram(v) => v.legally_binding.as_ref(),
Self::SupplementaryText(v) => v.legally_binding.as_ref(),
Self::TextDisplay(v) => v.legally_binding.as_ref(),
}
}
/// XML element `vms:legalBasis`, which every kind has.
pub fn legal_basis(&self) -> Option<&MultilingualString> {
match self {
Self::MultiPageDisplay(v) => v.legal_basis.as_ref(),
Self::PictogramDisplay(v) => v.legal_basis.as_ref(),
Self::SupplementaryPictogram(v) => v.legal_basis.as_ref(),
Self::SupplementaryText(v) => v.legal_basis.as_ref(),
Self::TextDisplay(v) => v.legal_basis.as_ref(),
}
}
/// XML element `vms:_displayAreaSettingsExtension`, which every kind has.
pub fn display_area_settings_extension(&self) -> Option<&Extension> {
match self {
Self::MultiPageDisplay(v) => v.display_area_settings_extension.as_deref(),
Self::PictogramDisplay(v) => v.display_area_settings_extension.as_deref(),
Self::SupplementaryPictogram(v) => v.display_area_settings_extension.as_deref(),
Self::SupplementaryText(v) => v.display_area_settings_extension.as_deref(),
Self::TextDisplay(v) => v.display_area_settings_extension.as_deref(),
}
}
}
impl DisplayAreaSettings {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str) -> Result<(), Error> {
match self {
Self::MultiPageDisplay(v) => v.write(w, tag, " xsi:type=\"vms:MultiPageDisplay\"", ""),
Self::PictogramDisplay(v) => v.write(w, tag, " xsi:type=\"vms:PictogramDisplay\"", ""),
Self::SupplementaryPictogram(v) => v.write(w, tag, " xsi:type=\"vms:SupplementaryPictogram\"", ""),
Self::SupplementaryText(v) => v.write(w, tag, " xsi:type=\"vms:SupplementaryText\"", ""),
Self::TextDisplay(v) => v.write(w, tag, " xsi:type=\"vms:TextDisplay\"", ""),
}
}
}
impl DisplayAreaSettings {
pub(crate) fn read_json(r: &mut JsonReader<'_>) -> Result<Option<Self>, Error> {
if !r.begin_object()? {
return Ok(None);
}
let mut pending = r.next_key()?;
let mut seen = false;
let mut value = None;
loop {
let key = match pending.take() {
Some(key) => key,
None => match r.next_key()? {
Some(key) => key,
None => break,
},
};
match key {
2613 => if r.first(&mut seen)? { value = MultiPageDisplay::read_json(r)?.map(|v| Self::MultiPageDisplay(Box::new(v))); },
2616 => if r.first(&mut seen)? { value = PictogramDisplay::read_json(r)?.map(|v| Self::PictogramDisplay(Box::new(v))); },
2627 => if r.first(&mut seen)? { value = SupplementaryPictogram::read_json(r)?.map(|v| Self::SupplementaryPictogram(Box::new(v))); },
2629 => if r.first(&mut seen)? { value = SupplementaryText::read_json(r)?.map(|v| Self::SupplementaryText(Box::new(v))); },
2631 => if r.first(&mut seen)? { value = TextDisplay::read_json(r)?.map(|v| Self::TextDisplay(Box::new(v))); },
_ => r.skip_unknown()?,
}
}
if !seen {
r.warn(WarningKind::UnknownType, "no known kind of DisplayAreaSettings in its wrapper".to_owned());
}
Ok(value)
}
pub(crate) fn write_json(&self, w: &mut JsonWriter<'_>) -> Result<(), Error> {
match self {
Self::MultiPageDisplay(v) => {
if w.wrapper(2613)? {
w.begin_object(1059)?;
w.key(2613)?;
v.write_json(w, None)?;
w.end_object()
} else {
v.write_json(w, None)
}
}
Self::PictogramDisplay(v) => {
if w.wrapper(2616)? {
w.begin_object(1059)?;
w.key(2616)?;
v.write_json(w, None)?;
w.end_object()
} else {
v.write_json(w, None)
}
}
Self::SupplementaryPictogram(v) => {
if w.wrapper(2627)? {
w.begin_object(1059)?;
w.key(2627)?;
v.write_json(w, None)?;
w.end_object()
} else {
v.write_json(w, None)
}
}
Self::SupplementaryText(v) => {
if w.wrapper(2629)? {
w.begin_object(1059)?;
w.key(2629)?;
v.write_json(w, None)?;
w.end_object()
} else {
v.write_json(w, None)
}
}
Self::TextDisplay(v) => {
if w.wrapper(2631)? {
w.begin_object(1059)?;
w.key(2631)?;
v.write_json(w, None)?;
w.end_object()
} else {
v.write_json(w, None)
}
}
}
}
}
/// Any concrete kind of XML type `vms:Pictogram`, chosen by `xsi:type`.
#[derive(Debug, Clone, PartialEq)]
pub enum Pictogram {
/// XML type `vms:CompositePictogram`.
CompositePictogram(Box<CompositePictogram>),
/// XML type `vms:RegularPictogram`.
RegularPictogram(Box<RegularPictogram>),
}
impl Pictogram {
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Option<Self>, Error> {
Self::read_as(r, r.xsi_type())
}
pub(crate) fn read_as(r: &mut Xml<'_>, kind: Option<u32>) -> Result<Option<Self>, Error> {
Ok(Some(match kind {
Some(0x170056) => Self::CompositePictogram(Box::new(CompositePictogram::read(r)?)),
Some(0x1701bb) => Self::RegularPictogram(Box::new(RegularPictogram::read(r)?)),
_ => {
r.unknown_type("Pictogram")?;
return Ok(None);
}
}))
}
/// XML element `vms:customPictogramCode`, which every kind has.
pub fn custom_pictogram_code(&self) -> Option<&str> {
match self {
Self::CompositePictogram(v) => v.custom_pictogram_code.as_deref(),
Self::RegularPictogram(v) => v.custom_pictogram_code.as_deref(),
}
}
/// XML element `vms:additionalDescription`, which every kind has.
pub fn additional_description(&self) -> Option<&MultilingualString> {
match self {
Self::CompositePictogram(v) => v.additional_description.as_ref(),
Self::RegularPictogram(v) => v.additional_description.as_ref(),
}
}
/// XML element `vms:pictogramFlashing`, which every kind has.
pub fn pictogram_flashing(&self) -> Option<&com::Boolean> {
match self {
Self::CompositePictogram(v) => v.pictogram_flashing.as_ref(),
Self::RegularPictogram(v) => v.pictogram_flashing.as_ref(),
}
}
/// XML element `vms:pictogramInInverseColour`, which every kind has.
pub fn pictogram_in_inverse_colour(&self) -> Option<&com::Boolean> {
match self {
Self::CompositePictogram(v) => v.pictogram_in_inverse_colour.as_ref(),
Self::RegularPictogram(v) => v.pictogram_in_inverse_colour.as_ref(),
}
}
/// XML element `vms:viennaConventionCompliant`, which every kind has.
pub fn vienna_convention_compliant(&self) -> Option<&com::Boolean> {
match self {
Self::CompositePictogram(v) => v.vienna_convention_compliant.as_ref(),
Self::RegularPictogram(v) => v.vienna_convention_compliant.as_ref(),
}
}
/// XML element `vms:pictogramInformationType`, which every kind has.
pub fn pictogram_information_type(&self) -> Option<&InformationTypeEnum> {
match self {
Self::CompositePictogram(v) => v.pictogram_information_type.as_ref(),
Self::RegularPictogram(v) => v.pictogram_information_type.as_ref(),
}
}
/// XML element `vms:gddStructure`, which every kind has.
pub fn gdd_structure(&self) -> Option<&GddStructure> {
match self {
Self::CompositePictogram(v) => v.gdd_structure.as_deref(),
Self::RegularPictogram(v) => v.gdd_structure.as_deref(),
}
}
/// XML element `vms:_pictogramExtension`, which every kind has.
pub fn pictogram_extension(&self) -> Option<&Extension> {
match self {
Self::CompositePictogram(v) => v.pictogram_extension.as_deref(),
Self::RegularPictogram(v) => v.pictogram_extension.as_deref(),
}
}
}
impl Pictogram {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str) -> Result<(), Error> {
match self {
Self::CompositePictogram(v) => v.write(w, tag, " xsi:type=\"vms:CompositePictogram\"", ""),
Self::RegularPictogram(v) => v.write(w, tag, " xsi:type=\"vms:RegularPictogram\"", ""),
}
}
}
impl Pictogram {
pub(crate) fn read_json(r: &mut JsonReader<'_>) -> Result<Option<Self>, Error> {
if !r.begin_object()? {
return Ok(None);
}
let mut pending = r.next_key()?;
let mut seen = false;
let mut value = None;
loop {
let key = match pending.take() {
Some(key) => key,
None => match r.next_key()? {
Some(key) => key,
None => break,
},
};
match key {
2587 => if r.first(&mut seen)? { value = CompositePictogram::read_json(r)?.map(|v| Self::CompositePictogram(Box::new(v))); },
2621 => if r.first(&mut seen)? { value = RegularPictogram::read_json(r)?.map(|v| Self::RegularPictogram(Box::new(v))); },
_ => r.skip_unknown()?,
}
}
if !seen {
r.warn(WarningKind::UnknownType, "no known kind of Pictogram in its wrapper".to_owned());
}
Ok(value)
}
pub(crate) fn write_json(&self, w: &mut JsonWriter<'_>) -> Result<(), Error> {
match self {
Self::CompositePictogram(v) => {
if w.wrapper(2587)? {
w.begin_object(1077)?;
w.key(2587)?;
v.write_json(w, None)?;
w.end_object()
} else {
v.write_json(w, None)
}
}
Self::RegularPictogram(v) => {
if w.wrapper(2621)? {
w.begin_object(1077)?;
w.key(2621)?;
v.write_json(w, None)?;
w.end_object()
} else {
v.write_json(w, None)
}
}
}
}
}
/// Any concrete kind of XML type `vms:SupplementaryInformationDisplay`, chosen by `xsi:type`.
#[derive(Debug, Clone, PartialEq)]
pub enum SupplementaryInformationDisplay {
/// XML type `vms:SupplementaryPictogram`.
SupplementaryPictogram(Box<SupplementaryPictogram>),
/// XML type `vms:SupplementaryText`.
SupplementaryText(Box<SupplementaryText>),
}
impl SupplementaryInformationDisplay {
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Option<Self>, Error> {
Self::read_as(r, r.xsi_type())
}
pub(crate) fn read_as(r: &mut Xml<'_>, kind: Option<u32>) -> Result<Option<Self>, Error> {
Ok(Some(match kind {
Some(0x170212) => Self::SupplementaryPictogram(Box::new(SupplementaryPictogram::read(r)?)),
Some(0x170215) => Self::SupplementaryText(Box::new(SupplementaryText::read(r)?)),
_ => {
r.unknown_type("SupplementaryInformationDisplay")?;
return Ok(None);
}
}))
}
/// XML element `vms:isBlank`, which every kind has.
pub fn is_blank(&self) -> Option<&com::Boolean> {
match self {
Self::SupplementaryPictogram(v) => v.is_blank.as_ref(),
Self::SupplementaryText(v) => v.is_blank.as_ref(),
}
}
/// XML element `vms:legallyBinding`, which every kind has.
pub fn legally_binding(&self) -> Option<&com::Boolean> {
match self {
Self::SupplementaryPictogram(v) => v.legally_binding.as_ref(),
Self::SupplementaryText(v) => v.legally_binding.as_ref(),
}
}
/// XML element `vms:legalBasis`, which every kind has.
pub fn legal_basis(&self) -> Option<&MultilingualString> {
match self {
Self::SupplementaryPictogram(v) => v.legal_basis.as_ref(),
Self::SupplementaryText(v) => v.legal_basis.as_ref(),
}
}
/// XML element `vms:_displayAreaSettingsExtension`, which every kind has.
pub fn display_area_settings_extension(&self) -> Option<&Extension> {
match self {
Self::SupplementaryPictogram(v) => v.display_area_settings_extension.as_deref(),
Self::SupplementaryText(v) => v.display_area_settings_extension.as_deref(),
}
}
/// XML element `vms:_supplementaryInformationDisplayExtension`, which every kind has.
pub fn supplementary_information_display_extension(&self) -> Option<&Extension> {
match self {
Self::SupplementaryPictogram(v) => v.supplementary_information_display_extension.as_deref(),
Self::SupplementaryText(v) => v.supplementary_information_display_extension.as_deref(),
}
}
}
impl SupplementaryInformationDisplay {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str) -> Result<(), Error> {
match self {
Self::SupplementaryPictogram(v) => v.write(w, tag, " xsi:type=\"vms:SupplementaryPictogram\"", ""),
Self::SupplementaryText(v) => v.write(w, tag, " xsi:type=\"vms:SupplementaryText\"", ""),
}
}
}
impl SupplementaryInformationDisplay {
pub(crate) fn read_json(r: &mut JsonReader<'_>) -> Result<Option<Self>, Error> {
if !r.begin_object()? {
return Ok(None);
}
let mut pending = r.next_key()?;
let mut seen = false;
let mut value = None;
loop {
let key = match pending.take() {
Some(key) => key,
None => match r.next_key()? {
Some(key) => key,
None => break,
},
};
match key {
2627 => if r.first(&mut seen)? { value = SupplementaryPictogram::read_json(r)?.map(|v| Self::SupplementaryPictogram(Box::new(v))); },
2629 => if r.first(&mut seen)? { value = SupplementaryText::read_json(r)?.map(|v| Self::SupplementaryText(Box::new(v))); },
_ => r.skip_unknown()?,
}
}
if !seen {
r.warn(WarningKind::UnknownType, "no known kind of SupplementaryInformationDisplay in its wrapper".to_owned());
}
Ok(value)
}
pub(crate) fn write_json(&self, w: &mut JsonWriter<'_>) -> Result<(), Error> {
match self {
Self::SupplementaryPictogram(v) => {
if w.wrapper(2627)? {
w.begin_object(1085)?;
w.key(2627)?;
v.write_json(w, None)?;
w.end_object()
} else {
v.write_json(w, None)
}
}
Self::SupplementaryText(v) => {
if w.wrapper(2629)? {
w.begin_object(1085)?;
w.key(2629)?;
v.write_json(w, None)?;
w.end_object()
} else {
v.write_json(w, None)
}
}
}
}
}