#[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};
#[allow(unused_imports)]
use crate::out::{Out, Pattern};
#[allow(unused_imports)]
use crate::xml::{Enumeration, Xml};
#[allow(unused_imports)]
use crate::{Date, DateTime, Decimal, Error, Extension, MultilingualString, Time};
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ColourEnum {
Amber,
Blue,
Green,
Red,
White,
WhiteYellow,
Extended(String),
}
impl ColourEnum {
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 {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum CompositePictogramEnum {
ConditionOnCurrentSectionAfterNextExit,
ConditionAtNextExit,
ConditionOnCurrentSectionAfterSecondtExit,
ConditionAtSecondExit,
RestrictionOnCurrentSectionAfterNextExit,
RestrictionAtNextExit,
RestrictionOnCurrentSectionAfterSecondExit,
RestrictionAtSecondtExit,
Extended(String),
}
impl CompositePictogramEnum {
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 {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum DedicatedUsageEnum {
EnergyInformation,
InspectionArea,
LaneControlSystem,
ParkingInformation,
RampMetering,
TunnelManagement,
Other,
Extended(String),
}
impl DedicatedUsageEnum {
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 {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum DisplayedNumericalInformationTypeEnum {
Distance,
Height,
Length,
RateOfIncline,
SectionLength,
Speed,
Weight,
WeightPerAxle,
Width,
Extended(String),
}
impl DisplayedNumericalInformationTypeEnum {
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 {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
pub type GddPictogramCategoryCode = u64;
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum GddServiceCategoryEnum {
DangerWarning,
Regulatory,
Informative,
PublicFacilities,
AmbientConditions,
RoadConditions,
Extended(String),
}
impl GddServiceCategoryEnum {
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 {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ImageFormatEnum {
Bmp,
Gif,
Jpeg,
Png,
Tiff,
Extended(String),
}
impl ImageFormatEnum {
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 {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum InformationTypeEnum {
SituationInformation,
Warning,
Prohibition,
Obligation,
Destination,
TravelTime,
Delay,
Location,
VehicleType,
GeneralInformation,
Blank,
Other,
Extended(String),
}
impl InformationTypeEnum {
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 {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum MessageInformationTypeEnum {
CampaignMessage,
DateTime,
FutureInformation,
InstructionOrMessage,
SituationWarning,
Temperature,
TrafficManagement,
TravelTime,
Extended(String),
}
impl MessageInformationTypeEnum {
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 {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum PhysicalSupportEnum {
CentralReservationMounted,
GantryMounted,
OverheadBridgeMounted,
RoadsideCantileverMounted,
RoadsideMounted,
TrailerMounted,
TunnelEntranceMounted,
VehicleMounted,
Extended(String),
}
impl PhysicalSupportEnum {
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 {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum PictogramEnum {
BlankVoid,
BridgeClosed,
CarParkFull,
CarParkSpacesAvailable,
CorridorForEmergencyVehicleAccess,
CurveArrowToLeft,
CurveArrowToRight,
DangerOfFire,
DoubleExitToLeft,
DoubleExitToRight,
EndOfAdvisorySpeed,
FastenChildrensSeatBelts,
FastenYourSeatBelt,
Fire,
FootballMatch,
HardShoulderNotRunning,
HardShoulderRunning,
HorizontalDiversionToLeft,
HorizontalDiversionToRight,
KeepASafeDistance,
KeepLeft,
KeepRight,
Lane1ClosedOf2,
Lane2ClosedOf2,
Lane1ClosedOf3,
Lane3ClosedOf3,
Lanes1And2ClosedOf3,
Lanes2And3ClosedOf3,
Lane1ClosedOf4,
Lane4ClosedOf4,
Lanes1And2ClosedOf4,
Lanes3And4ClosedOf4,
Lanes1And2And3ClosedOf4,
Lanes2And3And4ClosedOf4,
LeftHandLaneClosed,
NarrowLanesAhead,
ObliqueArrowToLeft,
ObliqueArrowToRight,
PollutionOrSmogAlert,
RightHandLaneClosed,
SingleExitToLeft,
SingleExitToRight,
Smoke,
SnowPloughInAction,
SpeedCamerasInAction,
StraightVerticalArrow,
TrafficDeviatedToOppositeCarriagewayAhead,
TrafficPartiallyDeviatedToOppositeCarriagewayAhead,
TunnelClosed,
VerticalDiversion,
Other,
Extended(String),
}
impl PictogramEnum {
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 {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum PositionXAbsoluteEnum {
OnLeft,
InTheMiddle,
OnRight,
Extended(String),
}
impl PositionXAbsoluteEnum {
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 {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum PositionXRelativeEnum {
ToTheLeft,
AlignedOnTheLeftSide,
Centred,
AlignedOnTheRightSide,
ToTheRight,
Extended(String),
}
impl PositionXRelativeEnum {
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 {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum PositionYAbsoluteEnum {
AtTop,
InTheMiddle,
AtBottom,
Extended(String),
}
impl PositionYAbsoluteEnum {
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 {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum PositionYRelativeEnum {
Above,
AlignedOnTheTopSide,
Centred,
AlignedOnTheBottomSide,
Below,
Extended(String),
}
impl PositionYRelativeEnum {
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 {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum SettingReasonEnum {
Situation,
OperatorCreated,
TrafficManagement,
TravelTime,
Campaign,
Default,
Extended(String),
}
impl SettingReasonEnum {
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 {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum SupplementalPictogramEnum {
DistanceToTheBeginningOfTheApplicationZone,
ExceptAnyPowerDrivenVehicleDrawingTrailer,
ExceptBus,
ExceptGoodsVehicles,
ExceptSemitrailer,
ExceptVehiclesCarryingDangerousGoods,
InCaseOfIceOrSnow,
LengthOfTheApplicationZone,
RestrictedToAnyPowerDrivenVehicleDrawingTrailer,
RestrictedToBus,
RestrictedToGoodsVehicles,
RestrictedToSemiTrailer,
RestrictedToVehiclesCarryingDangerousGoods,
MaintenanceVehicles,
SnowPloughs,
Other,
Extended(String),
}
impl SupplementalPictogramEnum {
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 {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum UnitOfMeasureEnum {
Feet,
FeetAndInches,
Kilometres,
KilometresPerHour,
Metres,
Miles,
MilesPerHour,
Percentage,
Tonnes,
Yards,
Extended(String),
}
impl UnitOfMeasureEnum {
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 {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum VmsControllerFaultEnum {
CommunicationsFailure,
PowerFailure,
Unknown,
Other,
Extended(String),
}
impl VmsControllerFaultEnum {
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 {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum VmsFaultEnum {
IncorrectMessageDisplayed,
IncorrectPictogramDisplayed,
OutOfService,
UnableToClearDown,
Unknown,
Other,
Extended(String),
}
impl VmsFaultEnum {
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 {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum VmsTypeEnum {
ColourGraphic,
RotatingPrismSign,
MonochromeGraphic,
SimpleMatrixSign,
FullMatrixSign,
RollerBlindSign,
VirtualVms,
Other,
Extended(String),
}
impl VmsTypeEnum {
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 {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum WorkingStatusEnum {
Blank,
Covered,
NotWorking,
Working,
Extended(String),
}
impl WorkingStatusEnum {
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 {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct CompositePictogram {
pub custom_pictogram_code: Option<String>,
pub additional_description: Option<MultilingualString>,
pub pictogram_flashing: Option<com::Boolean>,
pub pictogram_in_inverse_colour: Option<com::Boolean>,
pub vienna_convention_compliant: Option<com::Boolean>,
pub pictogram_information_type: Option<InformationTypeEnum>,
pub gdd_structure: Option<Box<GddStructure>>,
pub pictogram_extension: Option<Box<Extension>>,
pub pictogram_description: Option<CompositePictogramEnum>,
pub regular_pictogram: Option<Box<RegularPictogram>>,
pub composite_pictogram_extension: Option<Box<Extension>>,
}
impl CompositePictogram {
const FIELDS: &'static [u32] = &[0x130755, 0x13068e, 0x130a39, 0x130a3a, 0x130c50, 0x130a3b, 0x13083a, 0x13055a, 0x130a37, 0x130acb, 0x130440];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x130054);
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 {
0x130755 => { let v = r.string()?; r.set(&mut e0, v, 1877); }
0x13068e => { let v = r.multilingual()?; r.set(&mut e1, v, 1678); }
0x130a39 => { let v = r.value::<bool>()?; r.set(&mut e2, v, 2617); }
0x130a3a => { let v = r.value::<bool>()?; r.set(&mut e3, v, 2618); }
0x130c50 => { let v = r.value::<bool>()?; r.set(&mut e4, v, 3152); }
0x130a3b => { let v = r.enumeration::<InformationTypeEnum>()?; r.set(&mut e5, v, 2619); }
0x13083a => { let v = Some(GddStructure::read(r)?); r.set(&mut e6, v.map(Box::new), 2106); }
0x13055a => { let v = r.raw()?; r.set(&mut e7, v.map(Box::new), 1370); }
0x130a37 => { let v = r.enumeration::<CompositePictogramEnum>()?; r.set(&mut e8, v, 2615); }
0x130acb => { let v = Some(RegularPictogram::read(r)?); r.set(&mut e9, v.map(Box::new), 2763); }
0x130440 => { let v = r.raw()?; r.set(&mut e10, v.map(Box::new), 1088); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e8, 2615);
r.required(&e9, 2763);
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", 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)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct DisplayArea {
pub sequencing_capable: Option<com::Boolean>,
pub max_number_of_sequential_pages: Option<com::NonNegativeInteger>,
pub position_x_absolute: Option<PositionXAbsoluteEnum>,
pub position_x_relative_to_previous: Option<PositionXRelativeEnum>,
pub position_y_absolute: Option<PositionYAbsoluteEnum>,
pub position_y_relative_to_previous: Option<PositionYRelativeEnum>,
pub display_geometry: Option<Box<DisplayGeometry>>,
pub overridden_lane_association: Vec<loc::Lane>,
pub display_area_extension: Option<Box<Extension>>,
}
impl DisplayArea {
const FIELDS: &'static [u32] = &[0x130b2d, 0x130900, 0x130a52, 0x130a53, 0x130a55, 0x130a56, 0x130797, 0x1309f4, 0x13046c];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x130081);
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 {
0x130b2d => { let v = r.value::<bool>()?; r.set(&mut e0, v, 2861); }
0x130900 => { let v = r.value::<u64>()?; r.set(&mut e1, v, 2304); }
0x130a52 => { let v = r.enumeration::<PositionXAbsoluteEnum>()?; r.set(&mut e2, v, 2642); }
0x130a53 => { let v = r.enumeration::<PositionXRelativeEnum>()?; r.set(&mut e3, v, 2643); }
0x130a55 => { let v = r.enumeration::<PositionYAbsoluteEnum>()?; r.set(&mut e4, v, 2645); }
0x130a56 => { let v = r.enumeration::<PositionYRelativeEnum>()?; r.set(&mut e5, v, 2646); }
0x130797 => { let v = Some(DisplayGeometry::read(r)?); r.set(&mut e6, v.map(Box::new), 1943); }
0x1309f4 => { let v = Some(loc::Lane::read(r)?); e7.extend(v); }
0x13046c => { let v = r.raw()?; r.set(&mut e8, v.map(Box::new), 1132); }
_ => 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)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct DisplayGeometry {
pub pixels_across: Option<com::NonNegativeInteger>,
pub pixels_down: Option<com::NonNegativeInteger>,
pub display_height: Option<com::MetresAsFloat>,
pub display_width: Option<com::MetresAsFloat>,
pub position_x: Option<com::MetresAsFloat>,
pub position_y: Option<com::MetresAsFloat>,
pub display_geometry_extension: Option<Box<Extension>>,
}
impl DisplayGeometry {
const FIELDS: &'static [u32] = &[0x130a3f, 0x130a40, 0x130798, 0x130799, 0x130a51, 0x130a54, 0x13046e];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x130083);
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 {
0x130a3f => { let v = r.value::<u64>()?; r.set(&mut e0, v, 2623); }
0x130a40 => { let v = r.value::<u64>()?; r.set(&mut e1, v, 2624); }
0x130798 => { let v = r.value::<f32>()?; r.set(&mut e2, v, 1944); }
0x130799 => { let v = r.value::<f32>()?; r.set(&mut e3, v, 1945); }
0x130a51 => { let v = r.value::<f32>()?; r.set(&mut e4, v, 2641); }
0x130a54 => { let v = r.value::<f32>()?; r.set(&mut e5, v, 2644); }
0x13046e => { let v = r.raw()?; r.set(&mut e6, v.map(Box::new), 1134); }
_ => 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)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct DisplayedNumericalInformation {
pub numerical_information_type: Option<DisplayedNumericalInformationTypeEnum>,
pub numeric_value: Option<Decimal>,
pub unit_of_measure: Option<UnitOfMeasureEnum>,
pub displayed_numerical_information_extension: Option<Box<Extension>>,
}
impl DisplayedNumericalInformation {
const FIELDS: &'static [u32] = &[0x130991, 0x13098f, 0x130c09, 0x13046f];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x130084);
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 {
0x130991 => { let v = r.enumeration::<DisplayedNumericalInformationTypeEnum>()?; r.set(&mut e0, v, 2449); }
0x13098f => { let v = r.value::<Decimal>()?; r.set(&mut e1, v, 2447); }
0x130c09 => { let v = r.enumeration::<UnitOfMeasureEnum>()?; r.set(&mut e2, v, 3081); }
0x13046f => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1135); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 2449);
r.required(&e1, 2447);
r.required(&e2, 3081);
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)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct GddPictogramAttributes {
pub attributes: Option<com::Base64Binary>,
pub gdd_pictogram_attributes_extension: Option<Box<Extension>>,
}
impl GddPictogramAttributes {
const FIELDS: &'static [u32] = &[0x1306d5, 0x1304a1];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x1300b7);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x1306d5 => { let v = r.base64()?; r.set(&mut e0, v, 1749); }
0x1304a1 => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1185); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 1749);
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)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct GddPictogramIdentification {
pub country: Option<com::CountryCode>,
pub service_category: Option<GddServiceCategoryEnum>,
pub pictogram_category_code: Option<GddPictogramCategoryCode>,
pub gdd_pictogram_identification_extension: Option<Box<Extension>>,
}
impl GddPictogramIdentification {
const FIELDS: &'static [u32] = &[0x130747, 0x130b31, 0x130a34, 0x1304a2];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x1300b8);
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 {
0x130747 => { let v = r.string()?; r.set(&mut e0, v, 1863); }
0x130b31 => { let v = r.enumeration::<GddServiceCategoryEnum>()?; r.set(&mut e1, v, 2865); }
0x130a34 => { let v = r.value::<u64>()?; r.set(&mut e2, v, 2612); }
0x1304a2 => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1186); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 1863);
r.required(&e1, 2865);
r.required(&e2, 2612);
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", 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)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct GddStructure {
pub gdd_pictogram_identification: Option<Box<GddPictogramIdentification>>,
pub gdd_pictogram_attributes: Option<Box<GddPictogramAttributes>>,
pub gdd_structure_extension: Option<Box<Extension>>,
}
impl GddStructure {
const FIELDS: &'static [u32] = &[0x130839, 0x130838, 0x1304a3];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x1300b9);
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 {
0x130839 => { let v = Some(GddPictogramIdentification::read(r)?); r.set(&mut e0, v.map(Box::new), 2105); }
0x130838 => { let v = Some(GddPictogramAttributes::read(r)?); r.set(&mut e1, v.map(Box::new), 2104); }
0x1304a3 => { let v = r.raw()?; r.set(&mut e2, v.map(Box::new), 1187); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 2105);
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)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct Image {
pub image_data: Option<com::Base64Binary>,
pub image_format: Option<ImageFormatEnum>,
pub image_extension: Option<Box<Extension>>,
}
impl Image {
const FIELDS: &'static [u32] = &[0x130876, 0x130877, 0x1304c5];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x1300da);
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 {
0x130876 => { let v = r.base64()?; r.set(&mut e0, v, 2166); }
0x130877 => { let v = r.enumeration::<ImageFormatEnum>()?; r.set(&mut e1, v, 2167); }
0x1304c5 => { let v = r.raw()?; r.set(&mut e2, v.map(Box::new), 1221); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 2166);
r.required(&e1, 2167);
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)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct ManagedLogicalLocation {
pub managed_logical_location: Option<MultilingualString>,
pub distance_from_logical_location: Option<com::MetresAsNonNegativeInteger>,
pub managed_location: Option<loc::Location>,
pub managed_logical_location_extension: Option<Box<Extension>>,
}
impl ManagedLogicalLocation {
const FIELDS: &'static [u32] = &[0x1308f2, 0x13079f, 0x1308f1, 0x1304e7];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x1300fe);
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 {
0x1308f2 => { let v = r.multilingual()?; r.set(&mut e0, v, 2290); }
0x13079f => { let v = r.value::<u64>()?; r.set(&mut e1, v, 1951); }
0x1308f1 => { let v = loc::Location::read(r)?; r.set(&mut e2, v, 2289); }
0x1304e7 => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1255); }
_ => 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)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct MultiPageDisplay {
pub is_blank: Option<com::Boolean>,
pub legally_binding: Option<com::Boolean>,
pub legal_basis: Option<MultilingualString>,
pub display_area_settings_extension: Option<Box<Extension>>,
pub sequence_group_number: Option<com::NonNegativeInteger>,
pub display_area_settings: Vec<MultiPageDisplayPageNumberDisplayAreaSettings>,
pub multi_page_display_extension: Option<Box<Extension>>,
}
impl MultiPageDisplay {
const FIELDS: &'static [u32] = &[0x130899, 0x1308c4, 0x1308c2, 0x13046d, 0x130b2b, 0x130796, 0x1304f9];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x130110);
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 {
0x130899 => { let v = r.value::<bool>()?; r.set(&mut e0, v, 2201); }
0x1308c4 => { let v = r.value::<bool>()?; r.set(&mut e1, v, 2244); }
0x1308c2 => { let v = r.multilingual()?; r.set(&mut e2, v, 2242); }
0x13046d => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1133); }
0x130b2b => { let v = r.value::<u64>()?; r.set(&mut e4, v, 2859); }
0x130796 => { let v = Some(MultiPageDisplayPageNumberDisplayAreaSettings::read(r)?); e5.extend(v); }
0x1304f9 => { let v = r.raw()?; r.set(&mut e6, v.map(Box::new), 1273); }
_ => 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)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct PictogramDisplay {
pub is_blank: Option<com::Boolean>,
pub legally_binding: Option<com::Boolean>,
pub legal_basis: Option<MultilingualString>,
pub display_area_settings_extension: Option<Box<Extension>>,
pub is_primary_pictogram: Option<com::Boolean>,
pub pictogram_display_url: Option<com::Url>,
pub pictogram: Option<Pictogram>,
pub supplementary_information_display: Option<SupplementaryInformationDisplay>,
pub image: Option<Box<Image>>,
pub pictogram_display_extension: Option<Box<Extension>>,
}
impl PictogramDisplay {
const FIELDS: &'static [u32] = &[0x130899, 0x1308c4, 0x1308c2, 0x13046d, 0x13089c, 0x130a38, 0x130a33, 0x130b92, 0x130874, 0x130559];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x130176);
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 {
0x130899 => { let v = r.value::<bool>()?; r.set(&mut e0, v, 2201); }
0x1308c4 => { let v = r.value::<bool>()?; r.set(&mut e1, v, 2244); }
0x1308c2 => { let v = r.multilingual()?; r.set(&mut e2, v, 2242); }
0x13046d => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1133); }
0x13089c => { let v = r.value::<bool>()?; r.set(&mut e4, v, 2204); }
0x130a38 => { let v = r.string()?; r.set(&mut e5, v, 2616); }
0x130a33 => { let v = Pictogram::read(r)?; r.set(&mut e6, v, 2611); }
0x130b92 => { let v = SupplementaryInformationDisplay::read(r)?; r.set(&mut e7, v, 2962); }
0x130874 => { let v = Some(Image::read(r)?); r.set(&mut e8, v.map(Box::new), 2164); }
0x130559 => { let v = r.raw()?; r.set(&mut e9, v.map(Box::new), 1369); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e6, 2611);
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)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct PictogramDisplayArea {
pub sequencing_capable: Option<com::Boolean>,
pub max_number_of_sequential_pages: Option<com::NonNegativeInteger>,
pub position_x_absolute: Option<PositionXAbsoluteEnum>,
pub position_x_relative_to_previous: Option<PositionXRelativeEnum>,
pub position_y_absolute: Option<PositionYAbsoluteEnum>,
pub position_y_relative_to_previous: Option<PositionYRelativeEnum>,
pub display_geometry: Option<Box<DisplayGeometry>>,
pub overridden_lane_association: Vec<loc::Lane>,
pub display_area_extension: Option<Box<Extension>>,
pub pictogram_code_list_identifier: Option<String>,
pub pictogram_number_of_colours: Option<com::NonNegativeInteger>,
pub pictogram_display_area_extension: Option<Box<Extension>>,
}
impl PictogramDisplayArea {
const FIELDS: &'static [u32] = &[0x130b2d, 0x130900, 0x130a52, 0x130a53, 0x130a55, 0x130a56, 0x130797, 0x1309f4, 0x13046c, 0x130a36, 0x130a3c, 0x130558];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x130177);
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 {
0x130b2d => { let v = r.value::<bool>()?; r.set(&mut e0, v, 2861); }
0x130900 => { let v = r.value::<u64>()?; r.set(&mut e1, v, 2304); }
0x130a52 => { let v = r.enumeration::<PositionXAbsoluteEnum>()?; r.set(&mut e2, v, 2642); }
0x130a53 => { let v = r.enumeration::<PositionXRelativeEnum>()?; r.set(&mut e3, v, 2643); }
0x130a55 => { let v = r.enumeration::<PositionYAbsoluteEnum>()?; r.set(&mut e4, v, 2645); }
0x130a56 => { let v = r.enumeration::<PositionYRelativeEnum>()?; r.set(&mut e5, v, 2646); }
0x130797 => { let v = Some(DisplayGeometry::read(r)?); r.set(&mut e6, v.map(Box::new), 1943); }
0x1309f4 => { let v = Some(loc::Lane::read(r)?); e7.extend(v); }
0x13046c => { let v = r.raw()?; r.set(&mut e8, v.map(Box::new), 1132); }
0x130a36 => { let v = r.string()?; r.set(&mut e9, v, 2614); }
0x130a3c => { let v = r.value::<u64>()?; r.set(&mut e10, v, 2620); }
0x130558 => { let v = r.raw()?; r.set(&mut e11, v.map(Box::new), 1368); }
_ => 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", 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)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct RegularPictogram {
pub custom_pictogram_code: Option<String>,
pub additional_description: Option<MultilingualString>,
pub pictogram_flashing: Option<com::Boolean>,
pub pictogram_in_inverse_colour: Option<com::Boolean>,
pub vienna_convention_compliant: Option<com::Boolean>,
pub pictogram_information_type: Option<InformationTypeEnum>,
pub gdd_structure: Option<Box<GddStructure>>,
pub pictogram_extension: Option<Box<Extension>>,
pub pictogram_description: Vec<PictogramEnum>,
pub presence_of_red_triangle: Option<com::Boolean>,
pub displayed_numerical_information: Vec<DisplayedNumericalInformation>,
pub regular_pictogram_extension: Option<Box<Extension>>,
}
impl RegularPictogram {
const FIELDS: &'static [u32] = &[0x130755, 0x13068e, 0x130a39, 0x130a3a, 0x130c50, 0x130a3b, 0x13083a, 0x13055a, 0x130a37, 0x130a6e, 0x13079a, 0x130594];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x1301b2);
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 {
0x130755 => { let v = r.string()?; r.set(&mut e0, v, 1877); }
0x13068e => { let v = r.multilingual()?; r.set(&mut e1, v, 1678); }
0x130a39 => { let v = r.value::<bool>()?; r.set(&mut e2, v, 2617); }
0x130a3a => { let v = r.value::<bool>()?; r.set(&mut e3, v, 2618); }
0x130c50 => { let v = r.value::<bool>()?; r.set(&mut e4, v, 3152); }
0x130a3b => { let v = r.enumeration::<InformationTypeEnum>()?; r.set(&mut e5, v, 2619); }
0x13083a => { let v = Some(GddStructure::read(r)?); r.set(&mut e6, v.map(Box::new), 2106); }
0x13055a => { let v = r.raw()?; r.set(&mut e7, v.map(Box::new), 1370); }
0x130a37 => { let v = r.enumeration::<PictogramEnum>()?; e8.extend(v); }
0x130a6e => { let v = r.value::<bool>()?; r.set(&mut e9, v, 2670); }
0x13079a => { let v = Some(DisplayedNumericalInformation::read(r)?); e10.extend(v); }
0x130594 => { let v = r.raw()?; r.set(&mut e11, v.map(Box::new), 1428); }
_ => 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", 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)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct SupplementaryPanelArea {
pub sequencing_capable: Option<com::Boolean>,
pub max_number_of_sequential_pages: Option<com::NonNegativeInteger>,
pub position_x_absolute: Option<PositionXAbsoluteEnum>,
pub position_x_relative_to_previous: Option<PositionXRelativeEnum>,
pub position_y_absolute: Option<PositionYAbsoluteEnum>,
pub position_y_relative_to_previous: Option<PositionYRelativeEnum>,
pub display_geometry: Option<Box<DisplayGeometry>>,
pub overridden_lane_association: Vec<loc::Lane>,
pub display_area_extension: Option<Box<Extension>>,
pub supplementary_pictogram_code_list_identifier: Option<String>,
pub related_pictogram_area: Option<com::Integer>,
pub supplementary_panel_area_extension: Option<Box<Extension>>,
}
impl SupplementaryPanelArea {
const FIELDS: &'static [u32] = &[0x130b2d, 0x130900, 0x130a52, 0x130a53, 0x130a55, 0x130a56, 0x130797, 0x1309f4, 0x13046c, 0x130b93, 0x130ad2, 0x1305e0];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x130202);
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 {
0x130b2d => { let v = r.value::<bool>()?; r.set(&mut e0, v, 2861); }
0x130900 => { let v = r.value::<u64>()?; r.set(&mut e1, v, 2304); }
0x130a52 => { let v = r.enumeration::<PositionXAbsoluteEnum>()?; r.set(&mut e2, v, 2642); }
0x130a53 => { let v = r.enumeration::<PositionXRelativeEnum>()?; r.set(&mut e3, v, 2643); }
0x130a55 => { let v = r.enumeration::<PositionYAbsoluteEnum>()?; r.set(&mut e4, v, 2645); }
0x130a56 => { let v = r.enumeration::<PositionYRelativeEnum>()?; r.set(&mut e5, v, 2646); }
0x130797 => { let v = Some(DisplayGeometry::read(r)?); r.set(&mut e6, v.map(Box::new), 1943); }
0x1309f4 => { let v = Some(loc::Lane::read(r)?); e7.extend(v); }
0x13046c => { let v = r.raw()?; r.set(&mut e8, v.map(Box::new), 1132); }
0x130b93 => { let v = r.string()?; r.set(&mut e9, v, 2963); }
0x130ad2 => { let v = r.value::<i64>()?; r.set(&mut e10, v, 2770); }
0x1305e0 => { let v = r.raw()?; r.set(&mut e11, v.map(Box::new), 1504); }
_ => 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", 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)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct SupplementaryPictogram {
pub is_blank: Option<com::Boolean>,
pub legally_binding: Option<com::Boolean>,
pub legal_basis: Option<MultilingualString>,
pub display_area_settings_extension: Option<Box<Extension>>,
pub supplementary_information_display_extension: Option<Box<Extension>>,
pub pictogram_description: Option<SupplementalPictogramEnum>,
pub pictogram_code: Option<String>,
pub pictogram_url: Option<com::Url>,
pub additional_description: Option<MultilingualString>,
pub pictogram_flashing: Option<com::Boolean>,
pub pictogram_information_type: Option<InformationTypeEnum>,
pub supplementary_pictogram_extension: Option<Box<Extension>>,
}
impl SupplementaryPictogram {
const FIELDS: &'static [u32] = &[0x130899, 0x1308c4, 0x1308c2, 0x13046d, 0x1305df, 0x130a37, 0x130a35, 0x130a3d, 0x13068e, 0x130a39, 0x130a3b, 0x1305e2];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x130203);
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 {
0x130899 => { let v = r.value::<bool>()?; r.set(&mut e0, v, 2201); }
0x1308c4 => { let v = r.value::<bool>()?; r.set(&mut e1, v, 2244); }
0x1308c2 => { let v = r.multilingual()?; r.set(&mut e2, v, 2242); }
0x13046d => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1133); }
0x1305df => { let v = r.raw()?; r.set(&mut e4, v.map(Box::new), 1503); }
0x130a37 => { let v = r.enumeration::<SupplementalPictogramEnum>()?; r.set(&mut e5, v, 2615); }
0x130a35 => { let v = r.string()?; r.set(&mut e6, v, 2613); }
0x130a3d => { let v = r.string()?; r.set(&mut e7, v, 2621); }
0x13068e => { let v = r.multilingual()?; r.set(&mut e8, v, 1678); }
0x130a39 => { let v = r.value::<bool>()?; r.set(&mut e9, v, 2617); }
0x130a3b => { let v = r.enumeration::<InformationTypeEnum>()?; r.set(&mut e10, v, 2619); }
0x1305e2 => { let v = r.raw()?; r.set(&mut e11, v.map(Box::new), 1506); }
_ => 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", 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)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct SupplementaryText {
pub is_blank: Option<com::Boolean>,
pub legally_binding: Option<com::Boolean>,
pub legal_basis: Option<MultilingualString>,
pub display_area_settings_extension: Option<Box<Extension>>,
pub supplementary_information_display_extension: Option<Box<Extension>>,
pub text_line: Option<Box<TextLine>>,
pub supplementary_text_extension: Option<Box<Extension>>,
}
impl SupplementaryText {
const FIELDS: &'static [u32] = &[0x130899, 0x1308c4, 0x1308c2, 0x13046d, 0x1305df, 0x130bb1, 0x1305e4];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x130206);
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 {
0x130899 => { let v = r.value::<bool>()?; r.set(&mut e0, v, 2201); }
0x1308c4 => { let v = r.value::<bool>()?; r.set(&mut e1, v, 2244); }
0x1308c2 => { let v = r.multilingual()?; r.set(&mut e2, v, 2242); }
0x13046d => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1133); }
0x1305df => { let v = r.raw()?; r.set(&mut e4, v.map(Box::new), 1503); }
0x130bb1 => { let v = Some(TextLine::read(r)?); r.set(&mut e5, v.map(Box::new), 2993); }
0x1305e4 => { let v = r.raw()?; r.set(&mut e6, v.map(Box::new), 1508); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e5, 2993);
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)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct TextDisplay {
pub is_blank: Option<com::Boolean>,
pub legally_binding: Option<com::Boolean>,
pub legal_basis: Option<MultilingualString>,
pub display_area_settings_extension: Option<Box<Extension>>,
pub text_code: Option<String>,
pub text_image_url: Option<com::Url>,
pub text_line: Vec<TextDisplayLineIndexTextLine>,
pub text_display_extension: Option<Box<Extension>>,
}
impl TextDisplay {
const FIELDS: &'static [u32] = &[0x130899, 0x1308c4, 0x1308c2, 0x13046d, 0x130bad, 0x130baf, 0x130bb1, 0x1305ee];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x13020f);
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 {
0x130899 => { let v = r.value::<bool>()?; r.set(&mut e0, v, 2201); }
0x1308c4 => { let v = r.value::<bool>()?; r.set(&mut e1, v, 2244); }
0x1308c2 => { let v = r.multilingual()?; r.set(&mut e2, v, 2242); }
0x13046d => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1133); }
0x130bad => { let v = r.string()?; r.set(&mut e4, v, 2989); }
0x130baf => { let v = r.string()?; r.set(&mut e5, v, 2991); }
0x130bb1 => { let v = Some(TextDisplayLineIndexTextLine::read(r)?); e6.extend(v); }
0x1305ee => { let v = r.raw()?; r.set(&mut e7, v.map(Box::new), 1518); }
_ => 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", 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)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct TextDisplayArea {
pub sequencing_capable: Option<com::Boolean>,
pub max_number_of_sequential_pages: Option<com::NonNegativeInteger>,
pub position_x_absolute: Option<PositionXAbsoluteEnum>,
pub position_x_relative_to_previous: Option<PositionXRelativeEnum>,
pub position_y_absolute: Option<PositionYAbsoluteEnum>,
pub position_y_relative_to_previous: Option<PositionYRelativeEnum>,
pub display_geometry: Option<Box<DisplayGeometry>>,
pub overridden_lane_association: Vec<loc::Lane>,
pub display_area_extension: Option<Box<Extension>>,
pub proportional_font: Option<com::Boolean>,
pub max_number_of_characters: Option<com::NonNegativeInteger>,
pub max_number_of_rows: Option<com::NonNegativeInteger>,
pub text_code_list_identifier: Option<String>,
pub max_font_height: Option<com::NonNegativeInteger>,
pub min_font_height: Option<com::NonNegativeInteger>,
pub max_font_width: Option<com::NonNegativeInteger>,
pub min_font_width: Option<com::NonNegativeInteger>,
pub max_font_spacing: Option<com::NonNegativeInteger>,
pub min_font_spacing: Option<com::NonNegativeInteger>,
pub text_display_area_extension: Option<Box<Extension>>,
}
impl TextDisplayArea {
const FIELDS: &'static [u32] = &[0x130b2d, 0x130900, 0x130a52, 0x130a53, 0x130a55, 0x130a56, 0x130797, 0x1309f4, 0x13046c, 0x130a84, 0x1308fe, 0x1308ff, 0x130bae, 0x1308fb, 0x13092f, 0x1308fd, 0x130931, 0x1308fc, 0x130930, 0x1305ed];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x130210);
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 {
0x130b2d => { let v = r.value::<bool>()?; r.set(&mut e0, v, 2861); }
0x130900 => { let v = r.value::<u64>()?; r.set(&mut e1, v, 2304); }
0x130a52 => { let v = r.enumeration::<PositionXAbsoluteEnum>()?; r.set(&mut e2, v, 2642); }
0x130a53 => { let v = r.enumeration::<PositionXRelativeEnum>()?; r.set(&mut e3, v, 2643); }
0x130a55 => { let v = r.enumeration::<PositionYAbsoluteEnum>()?; r.set(&mut e4, v, 2645); }
0x130a56 => { let v = r.enumeration::<PositionYRelativeEnum>()?; r.set(&mut e5, v, 2646); }
0x130797 => { let v = Some(DisplayGeometry::read(r)?); r.set(&mut e6, v.map(Box::new), 1943); }
0x1309f4 => { let v = Some(loc::Lane::read(r)?); e7.extend(v); }
0x13046c => { let v = r.raw()?; r.set(&mut e8, v.map(Box::new), 1132); }
0x130a84 => { let v = r.value::<bool>()?; r.set(&mut e9, v, 2692); }
0x1308fe => { let v = r.value::<u64>()?; r.set(&mut e10, v, 2302); }
0x1308ff => { let v = r.value::<u64>()?; r.set(&mut e11, v, 2303); }
0x130bae => { let v = r.string()?; r.set(&mut e12, v, 2990); }
0x1308fb => { let v = r.value::<u64>()?; r.set(&mut e13, v, 2299); }
0x13092f => { let v = r.value::<u64>()?; r.set(&mut e14, v, 2351); }
0x1308fd => { let v = r.value::<u64>()?; r.set(&mut e15, v, 2301); }
0x130931 => { let v = r.value::<u64>()?; r.set(&mut e16, v, 2353); }
0x1308fc => { let v = r.value::<u64>()?; r.set(&mut e17, v, 2300); }
0x130930 => { let v = r.value::<u64>()?; r.set(&mut e18, v, 2352); }
0x1305ed => { let v = r.raw()?; r.set(&mut e19, v.map(Box::new), 1517); }
_ => 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", 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)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct TextLine {
pub line_language: Option<com::Language>,
pub text_line: Option<String>,
pub line_colour: Option<ColourEnum>,
pub line_flashing: Option<com::Boolean>,
pub line_html: Option<String>,
pub is_exact_text_on_sign: Option<com::Boolean>,
pub text_information_type: Vec<InformationTypeEnum>,
pub text_line_extension: Option<Box<Extension>>,
}
impl TextLine {
const FIELDS: &'static [u32] = &[0x130bb1, 0x1308cb, 0x1308cc, 0x1308cd, 0x13089a, 0x130bb0, 0x1305ef];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x130211);
let a0 = r.attr(2255);
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 {
0x130bb1 => { let v = r.string()?; r.set(&mut e0, v, 2993); }
0x1308cb => { let v = r.enumeration::<ColourEnum>()?; r.set(&mut e1, v, 2251); }
0x1308cc => { let v = r.value::<bool>()?; r.set(&mut e2, v, 2252); }
0x1308cd => { let v = r.string()?; r.set(&mut e3, v, 2253); }
0x13089a => { let v = r.value::<bool>()?; r.set(&mut e4, v, 2202); }
0x130bb0 => { let v = r.enumeration::<InformationTypeEnum>()?; e5.extend(v); }
0x1305ef => { let v = r.raw()?; r.set(&mut e6, v.map(Box::new), 1519); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 2993);
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", v, Pattern::Language)?; w.attr("lineLanguage", v)?; }
match &self.text_line {
Some(v) => { w.max_len("textLine", 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", 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)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct Vms {
pub lanterns_present: Option<com::Boolean>,
pub description: Option<MultilingualString>,
pub owner: Option<MultilingualString>,
pub physical_support: Option<PhysicalSupportEnum>,
pub vms_type: Option<VmsTypeEnum>,
pub vms_type_code: Option<String>,
pub dynamically_configurable: Option<com::Boolean>,
pub display_height: Option<com::MetresAsFloat>,
pub display_width: Option<com::MetresAsFloat>,
pub height_above_carriageway: Option<com::MetresAsFloat>,
pub dedicated_usage: Option<DedicatedUsageEnum>,
pub vms_configuration: Option<Box<VmsConfiguration>>,
pub vms_location: Option<loc::Location>,
pub managed_logical_location: Option<Box<ManagedLogicalLocation>>,
pub image_link: Option<Box<com::UrlLink>>,
pub vms_extension: Option<Box<Extension>>,
}
impl Vms {
const FIELDS: &'static [u32] = &[0x1308b1, 0x130777, 0x1309f8, 0x130a32, 0x130c64, 0x130c65, 0x1307b1, 0x130798, 0x130799, 0x13085c, 0x130765, 0x130c54, 0x130c5f, 0x1308f2, 0x130878, 0x13064d];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x13026c);
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 {
0x1308b1 => { let v = r.value::<bool>()?; r.set(&mut e0, v, 2225); }
0x130777 => { let v = r.multilingual()?; r.set(&mut e1, v, 1911); }
0x1309f8 => { let v = r.multilingual()?; r.set(&mut e2, v, 2552); }
0x130a32 => { let v = r.enumeration::<PhysicalSupportEnum>()?; r.set(&mut e3, v, 2610); }
0x130c64 => { let v = r.enumeration::<VmsTypeEnum>()?; r.set(&mut e4, v, 3172); }
0x130c65 => { let v = r.string()?; r.set(&mut e5, v, 3173); }
0x1307b1 => { let v = r.value::<bool>()?; r.set(&mut e6, v, 1969); }
0x130798 => { let v = r.value::<f32>()?; r.set(&mut e7, v, 1944); }
0x130799 => { let v = r.value::<f32>()?; r.set(&mut e8, v, 1945); }
0x13085c => { let v = r.value::<f32>()?; r.set(&mut e9, v, 2140); }
0x130765 => { let v = r.enumeration::<DedicatedUsageEnum>()?; r.set(&mut e10, v, 1893); }
0x130c54 => { let v = Some(VmsConfiguration::read(r)?); r.set(&mut e11, v.map(Box::new), 3156); }
0x130c5f => { let v = loc::Location::read(r)?; r.set(&mut e12, v, 3167); }
0x1308f2 => { let v = Some(ManagedLogicalLocation::read(r)?); r.set(&mut e13, v.map(Box::new), 2290); }
0x130878 => { let v = Some(com::UrlLink::read(r)?); r.set(&mut e14, v.map(Box::new), 2168); }
0x13064d => { let v = r.raw()?; r.set(&mut e15, v.map(Box::new), 1613); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e11, 3156);
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", 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)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct VmsConfiguration {
pub number_of_display_areas: Option<com::NonNegativeInteger>,
pub display_area: Vec<VmsConfigurationDisplayAreaIndexDisplayArea>,
pub vms_configuration_extension: Option<Box<Extension>>,
}
impl VmsConfiguration {
const FIELDS: &'static [u32] = &[0x130973, 0x130794, 0x130648];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x13026d);
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 {
0x130973 => { let v = r.value::<u64>()?; r.set(&mut e0, v, 2419); }
0x130794 => { let v = Some(VmsConfigurationDisplayAreaIndexDisplayArea::read(r)?); e1.extend(v); }
0x130648 => { let v = r.raw()?; r.set(&mut e2, v.map(Box::new), 1608); }
_ => 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)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct VmsController {
pub id: Option<String>,
pub version: Option<String>,
pub number_of_vms: Option<com::NonNegativeInteger>,
pub external_identifier: Option<String>,
pub ip_address: Option<String>,
pub electronic_address: Option<String>,
pub vms: Vec<VmsControllerVmsIndexVms>,
pub vms_controller_extension: Option<Box<Extension>>,
}
impl VmsController {
const FIELDS: &'static [u32] = &[0x13098d, 0x130805, 0x130897, 0x1307bc, 0x130c53, 0x130649];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x13026e);
let a0 = r.req_attr(2159);
let a1 = r.req_attr(3149);
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 {
0x13098d => { let v = r.value::<u64>()?; r.set(&mut e0, v, 2445); }
0x130805 => { let v = r.string()?; r.set(&mut e1, v, 2053); }
0x130897 => { let v = r.string()?; r.set(&mut e2, v, 2199); }
0x1307bc => { let v = r.string()?; r.set(&mut e3, v, 1980); }
0x130c53 => { let v = Some(VmsControllerVmsIndexVms::read(r)?); e4.extend(v); }
0x130649 => { let v = r.raw()?; r.set(&mut e5, v.map(Box::new), 1609); }
_ => 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", v, 1024)?; w.leaf("vms:externalIdentifier", v)?; }
if let Some(v) = &self.ip_address { w.max_len("ipAddress", v, 1024)?; w.leaf("vms:ipAddress", v)?; }
if let Some(v) = &self.electronic_address { w.max_len("electronicAddress", 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)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct VmsControllerFault {
pub fault_identifier: Option<String>,
pub fault_description: Option<MultilingualString>,
pub fault_creation_time: Option<DateTime>,
pub fault_last_update_time: Option<DateTime>,
pub fault_impact_severity: Option<com::FaultSeverityEnum>,
pub fault_urgency_to_rectify: Option<com::FaultUrgencyEnum>,
pub manufacturer_fault_code: Option<String>,
pub fault_extension: Option<Box<Extension>>,
pub vms_controller_fault: Option<VmsControllerFaultEnum>,
pub vms_controller_fault_extension: Option<Box<Extension>>,
}
impl VmsControllerFault {
const FIELDS: &'static [u32] = &[0x30812, 0x30811, 0x30810, 0x30816, 0x30814, 0x30819, 0x308f6, 0x3049a, 0x130c56, 0x13064a];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x13026f);
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 {
0x30812 => { let v = r.string()?; r.set(&mut e0, v, 2066); }
0x30811 => { let v = r.multilingual()?; r.set(&mut e1, v, 2065); }
0x30810 => { let v = r.date_time()?; r.set(&mut e2, v, 2064); }
0x30816 => { let v = r.date_time()?; r.set(&mut e3, v, 2070); }
0x30814 => { let v = r.enumeration::<com::FaultSeverityEnum>()?; r.set(&mut e4, v, 2068); }
0x30819 => { let v = r.enumeration::<com::FaultUrgencyEnum>()?; r.set(&mut e5, v, 2073); }
0x308f6 => { let v = r.string()?; r.set(&mut e6, v, 2294); }
0x3049a => { let v = r.raw()?; r.set(&mut e7, v.map(Box::new), 1178); }
0x130c56 => { let v = r.enumeration::<VmsControllerFaultEnum>()?; r.set(&mut e8, v, 3158); }
0x13064a => { let v = r.raw()?; r.set(&mut e9, v.map(Box::new), 1610); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e3, 2070);
r.required(&e8, 3158);
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", 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", 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)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct VmsControllerStatus {
pub vms_controller_table_reference: Option<Box<com::VersionedReference>>,
pub vms_controller_reference: Option<Box<com::VersionedReference>>,
pub status_update_time: Option<DateTime>,
pub information_manager_override: Option<Box<com::InternationalIdentifier>>,
pub vms_status: Vec<VmsControllerStatusVmsIndexVmsStatus>,
pub vms_controller_fault: Vec<VmsControllerFault>,
pub vms_controller_status_extension: Option<Box<Extension>>,
}
impl VmsControllerStatus {
const FIELDS: &'static [u32] = &[0x130c5b, 0x130c57, 0x130b7c, 0x130885, 0x130c63, 0x130c56, 0x13064b];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x130270);
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 {
0x130c5b => { let v = Some(com::VersionedReference::read(r)?); r.set(&mut e0, v.map(Box::new), 3163); }
0x130c57 => { let v = Some(com::VersionedReference::read(r)?); r.set(&mut e1, v.map(Box::new), 3159); }
0x130b7c => { let v = r.date_time()?; r.set(&mut e2, v, 2940); }
0x130885 => { let v = Some(com::InternationalIdentifier::read(r)?); r.set(&mut e3, v.map(Box::new), 2181); }
0x130c63 => { let v = Some(VmsControllerStatusVmsIndexVmsStatus::read(r)?); e4.extend(v); }
0x130c56 => { let v = Some(VmsControllerFault::read(r)?); e5.extend(v); }
0x13064b => { let v = r.raw()?; r.set(&mut e6, v.map(Box::new), 1611); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 3163);
r.required(&e1, 3159);
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)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct VmsControllerTable {
pub id: Option<String>,
pub version: Option<String>,
pub vms_controller_table_identification: Option<String>,
pub information_manager: Option<Box<com::InternationalIdentifier>>,
pub vms_controller: Vec<VmsController>,
pub vms_controller_table_extension: Option<Box<Extension>>,
}
impl VmsControllerTable {
const FIELDS: &'static [u32] = &[0x130c5a, 0x130884, 0x130c55, 0x13064c];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x130271);
let a0 = r.req_attr(2159);
let a1 = r.req_attr(3149);
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 {
0x130c5a => { let v = r.string()?; r.set(&mut e0, v, 3162); }
0x130884 => { let v = Some(com::InternationalIdentifier::read(r)?); r.set(&mut e1, v.map(Box::new), 2180); }
0x130c55 => { let v = Some(VmsController::read(r)?); e2.extend(v); }
0x13064c => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1612); }
_ => 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", 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)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct VmsFault {
pub fault_identifier: Option<String>,
pub fault_description: Option<MultilingualString>,
pub fault_creation_time: Option<DateTime>,
pub fault_last_update_time: Option<DateTime>,
pub fault_impact_severity: Option<com::FaultSeverityEnum>,
pub fault_urgency_to_rectify: Option<com::FaultUrgencyEnum>,
pub manufacturer_fault_code: Option<String>,
pub fault_extension: Option<Box<Extension>>,
pub vms_fault: Option<VmsFaultEnum>,
pub vms_fault_extension: Option<Box<Extension>>,
}
impl VmsFault {
const FIELDS: &'static [u32] = &[0x30812, 0x30811, 0x30810, 0x30816, 0x30814, 0x30819, 0x308f6, 0x3049a, 0x130c5d, 0x13064e];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x130272);
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 {
0x30812 => { let v = r.string()?; r.set(&mut e0, v, 2066); }
0x30811 => { let v = r.multilingual()?; r.set(&mut e1, v, 2065); }
0x30810 => { let v = r.date_time()?; r.set(&mut e2, v, 2064); }
0x30816 => { let v = r.date_time()?; r.set(&mut e3, v, 2070); }
0x30814 => { let v = r.enumeration::<com::FaultSeverityEnum>()?; r.set(&mut e4, v, 2068); }
0x30819 => { let v = r.enumeration::<com::FaultUrgencyEnum>()?; r.set(&mut e5, v, 2073); }
0x308f6 => { let v = r.string()?; r.set(&mut e6, v, 2294); }
0x3049a => { let v = r.raw()?; r.set(&mut e7, v.map(Box::new), 1178); }
0x130c5d => { let v = r.enumeration::<VmsFaultEnum>()?; r.set(&mut e8, v, 3165); }
0x13064e => { let v = r.raw()?; r.set(&mut e9, v.map(Box::new), 1614); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e3, 2070);
r.required(&e8, 3165);
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", 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", 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)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct VmsMessage {
pub associated_traffic_management_plan: Option<String>,
pub message_set_by: Option<MultilingualString>,
pub set_by_system: Option<com::Boolean>,
pub reason_for_setting: Option<MultilingualString>,
pub coded_reason_for_setting: Option<SettingReasonEnum>,
pub message_information_type: Vec<MessageInformationTypeEnum>,
pub primary_setting: Option<com::Boolean>,
pub mare_nostrum_compliant: Option<com::Boolean>,
pub time_last_set: Option<DateTime>,
pub requested_by: Option<MultilingualString>,
pub related_situation: Vec<com::VersionedReference>,
pub related_situation_record: Vec<com::VersionedReference>,
pub distance_from_closest_situation_record: Option<com::MetresAsFloat>,
pub sequencing_interval: Option<com::Seconds>,
pub display_area_settings: Vec<VmsMessageDisplayAreaIndexDisplayAreaSettings>,
pub image: Option<Box<Image>>,
pub vms_message_extension: Option<Box<Extension>>,
}
impl VmsMessage {
const FIELDS: &'static [u32] = &[0x1306d4, 0x13092c, 0x130b35, 0x130ab3, 0x130720, 0x13092b, 0x130a77, 0x1308f7, 0x130bb9, 0x130adf, 0x130ad3, 0x130ad4, 0x13079e, 0x130b2e, 0x130796, 0x130874, 0x13064f];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x130273);
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 {
0x1306d4 => { let v = r.string()?; r.set(&mut e0, v, 1748); }
0x13092c => { let v = r.multilingual()?; r.set(&mut e1, v, 2348); }
0x130b35 => { let v = r.value::<bool>()?; r.set(&mut e2, v, 2869); }
0x130ab3 => { let v = r.multilingual()?; r.set(&mut e3, v, 2739); }
0x130720 => { let v = r.enumeration::<SettingReasonEnum>()?; r.set(&mut e4, v, 1824); }
0x13092b => { let v = r.enumeration::<MessageInformationTypeEnum>()?; e5.extend(v); }
0x130a77 => { let v = r.value::<bool>()?; r.set(&mut e6, v, 2679); }
0x1308f7 => { let v = r.value::<bool>()?; r.set(&mut e7, v, 2295); }
0x130bb9 => { let v = r.date_time()?; r.set(&mut e8, v, 3001); }
0x130adf => { let v = r.multilingual()?; r.set(&mut e9, v, 2783); }
0x130ad3 => { let v = Some(com::VersionedReference::read(r)?); e10.extend(v); }
0x130ad4 => { let v = Some(com::VersionedReference::read(r)?); e11.extend(v); }
0x13079e => { let v = r.value::<f32>()?; r.set(&mut e12, v, 1950); }
0x130b2e => { let v = r.value::<f32>()?; r.set(&mut e13, v, 2862); }
0x130796 => { let v = Some(VmsMessageDisplayAreaIndexDisplayAreaSettings::read(r)?); e14.extend(v); }
0x130874 => { let v = Some(Image::read(r)?); r.set(&mut e15, v.map(Box::new), 2164); }
0x13064f => { let v = r.raw()?; r.set(&mut e16, v.map(Box::new), 1615); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e8, 3001);
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", 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)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct VmsPublication {
pub lang: Option<com::Language>,
pub extension_name: Option<String>,
pub extension_version: Option<String>,
pub profile_name: Option<String>,
pub profile_version: Option<String>,
pub feed_description: Option<MultilingualString>,
pub feed_type: Option<String>,
pub publication_time: Option<DateTime>,
pub publication_creator: Option<Box<com::InternationalIdentifier>>,
pub payload_publication_extension: Option<Box<Extension>>,
pub header_information: Option<Box<com::HeaderInformation>>,
pub vms_controller_status: Vec<VmsControllerStatus>,
pub vms_publication_extension: Option<Box<Extension>>,
}
impl VmsPublication {
const FIELDS: &'static [u32] = &[0x3081d, 0x3081e, 0x30a94, 0x30a93, 0x30547, 0x130857, 0x130c58, 0x130650];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x130274);
let a0 = r.req_attr(2223);
let _ = r.attr(2373);
let a2 = r.attr(2046);
let a3 = r.attr(2047);
let a4 = r.attr(2689);
let a5 = r.attr(2690);
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 {
0x3081d => { let v = r.multilingual()?; r.set(&mut e0, v, 2077); }
0x3081e => { let v = r.string()?; r.set(&mut e1, v, 2078); }
0x30a94 => { let v = r.date_time()?; r.set(&mut e2, v, 2708); }
0x30a93 => { let v = Some(com::InternationalIdentifier::read(r)?); r.set(&mut e3, v.map(Box::new), 2707); }
0x30547 => { let v = r.raw()?; r.set(&mut e4, v.map(Box::new), 1351); }
0x130857 => { let v = Some(com::HeaderInformation::read(r)?); r.set(&mut e5, v.map(Box::new), 2135); }
0x130c58 => { let v = Some(VmsControllerStatus::read(r)?); e6.extend(v); }
0x130650 => { let v = r.raw()?; r.set(&mut e7, v.map(Box::new), 1616); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e2, 2708);
r.required(&e3, 2707);
r.required(&e5, 2135);
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", 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", 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)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct VmsStatus {
pub flashing_lights_on: Option<com::Boolean>,
pub remaining_power_capacity: Option<com::Seconds>,
pub status_update_time: Option<DateTime>,
pub sequencing_interval: Option<com::Seconds>,
pub working_status: Option<WorkingStatusEnum>,
pub vms_dynamic_configuration: Option<Box<VmsConfiguration>>,
pub vms_message: Vec<VmsStatusMessageIndexVmsMessage>,
pub vms_location_override: Option<loc::Location>,
pub managed_logical_location_override: Option<Box<ManagedLogicalLocation>>,
pub vms_fault: Vec<VmsFault>,
pub vms_status_extension: Option<Box<Extension>>,
}
impl VmsStatus {
const FIELDS: &'static [u32] = &[0x130824, 0x130ada, 0x130b7c, 0x130b2e, 0x130c7f, 0x130c5c, 0x130c61, 0x130c60, 0x1308f3, 0x130c5d, 0x130651];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x130275);
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 {
0x130824 => { let v = r.value::<bool>()?; r.set(&mut e0, v, 2084); }
0x130ada => { let v = r.value::<f32>()?; r.set(&mut e1, v, 2778); }
0x130b7c => { let v = r.date_time()?; r.set(&mut e2, v, 2940); }
0x130b2e => { let v = r.value::<f32>()?; r.set(&mut e3, v, 2862); }
0x130c7f => { let v = r.enumeration::<WorkingStatusEnum>()?; r.set(&mut e4, v, 3199); }
0x130c5c => { let v = Some(VmsConfiguration::read(r)?); r.set(&mut e5, v.map(Box::new), 3164); }
0x130c61 => { let v = Some(VmsStatusMessageIndexVmsMessage::read(r)?); e6.extend(v); }
0x130c60 => { let v = loc::Location::read(r)?; r.set(&mut e7, v, 3168); }
0x1308f3 => { let v = Some(ManagedLogicalLocation::read(r)?); r.set(&mut e8, v.map(Box::new), 2291); }
0x130c5d => { let v = Some(VmsFault::read(r)?); e9.extend(v); }
0x130651 => { let v = r.raw()?; r.set(&mut e10, v.map(Box::new), 1617); }
_ => 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)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct VmsTablePublication {
pub lang: Option<com::Language>,
pub extension_name: Option<String>,
pub extension_version: Option<String>,
pub profile_name: Option<String>,
pub profile_version: Option<String>,
pub feed_description: Option<MultilingualString>,
pub feed_type: Option<String>,
pub publication_time: Option<DateTime>,
pub publication_creator: Option<Box<com::InternationalIdentifier>>,
pub payload_publication_extension: Option<Box<Extension>>,
pub header_information: Option<Box<com::HeaderInformation>>,
pub vms_controller_table: Vec<VmsControllerTable>,
pub vms_table_publication_extension: Option<Box<Extension>>,
}
impl VmsTablePublication {
const FIELDS: &'static [u32] = &[0x3081d, 0x3081e, 0x30a94, 0x30a93, 0x30547, 0x130857, 0x130c59, 0x130652];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x130276);
let a0 = r.req_attr(2223);
let _ = r.attr(2373);
let a2 = r.attr(2046);
let a3 = r.attr(2047);
let a4 = r.attr(2689);
let a5 = r.attr(2690);
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 {
0x3081d => { let v = r.multilingual()?; r.set(&mut e0, v, 2077); }
0x3081e => { let v = r.string()?; r.set(&mut e1, v, 2078); }
0x30a94 => { let v = r.date_time()?; r.set(&mut e2, v, 2708); }
0x30a93 => { let v = Some(com::InternationalIdentifier::read(r)?); r.set(&mut e3, v.map(Box::new), 2707); }
0x30547 => { let v = r.raw()?; r.set(&mut e4, v.map(Box::new), 1351); }
0x130857 => { let v = Some(com::HeaderInformation::read(r)?); r.set(&mut e5, v.map(Box::new), 2135); }
0x130c59 => { let v = Some(VmsControllerTable::read(r)?); e6.extend(v); }
0x130652 => { let v = r.raw()?; r.set(&mut e7, v.map(Box::new), 1618); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e2, 2708);
r.required(&e3, 2707);
r.required(&e5, 2135);
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", 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", 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)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct MultiPageDisplayPageNumberDisplayAreaSettings {
pub page_number: Option<i32>,
pub display_area_settings: Option<DisplayAreaSettings>,
}
impl MultiPageDisplayPageNumberDisplayAreaSettings {
const FIELDS: &'static [u32] = &[0x130796];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x13031d);
let a0 = r.req_attr_value::<i32>(2555)?;
r.attrs_done();
let mut e0 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x130796 => { let v = DisplayAreaSettings::read(r)?; r.set(&mut e0, v, 1942); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 1942);
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)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct TextDisplayLineIndexTextLine {
pub line_index: Option<i32>,
pub text_line: Option<Box<TextLine>>,
}
impl TextDisplayLineIndexTextLine {
const FIELDS: &'static [u32] = &[0x130bb1];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x1303b5);
let a0 = r.req_attr_value::<i32>(2254)?;
r.attrs_done();
let mut e0 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x130bb1 => { let v = Some(TextLine::read(r)?); r.set(&mut e0, v.map(Box::new), 2993); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 2993);
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)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct VmsConfigurationDisplayAreaIndexDisplayArea {
pub display_area_index: Option<i32>,
pub display_area: Option<AnyDisplayArea>,
}
impl VmsConfigurationDisplayAreaIndexDisplayArea {
const FIELDS: &'static [u32] = &[0x130794];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x1303e1);
let a0 = r.req_attr_value::<i32>(1941)?;
r.attrs_done();
let mut e0 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x130794 => { let v = AnyDisplayArea::read(r)?; r.set(&mut e0, v, 1940); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 1940);
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)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct VmsControllerStatusVmsIndexVmsStatus {
pub vms_index: Option<i32>,
pub vms_status: Option<Box<VmsStatus>>,
}
impl VmsControllerStatusVmsIndexVmsStatus {
const FIELDS: &'static [u32] = &[0x130c63];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x1303e3);
let a0 = r.req_attr_value::<i32>(3166)?;
r.attrs_done();
let mut e0 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x130c63 => { let v = Some(VmsStatus::read(r)?); r.set(&mut e0, v.map(Box::new), 3171); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 3171);
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)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct VmsControllerVmsIndexVms {
pub vms_index: Option<i32>,
pub vms: Option<Box<Vms>>,
}
impl VmsControllerVmsIndexVms {
const FIELDS: &'static [u32] = &[0x130c53];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x1303e6);
let a0 = r.req_attr_value::<i32>(3166)?;
r.attrs_done();
let mut e0 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x130c53 => { let v = Some(Vms::read(r)?); r.set(&mut e0, v.map(Box::new), 3155); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 3155);
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)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct VmsMessageDisplayAreaIndexDisplayAreaSettings {
pub display_area_index: Option<i32>,
pub display_area_settings: Option<DisplayAreaSettings>,
}
impl VmsMessageDisplayAreaIndexDisplayAreaSettings {
const FIELDS: &'static [u32] = &[0x130796];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x1303e8);
let a0 = r.req_attr_value::<i32>(1941)?;
r.attrs_done();
let mut e0 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x130796 => { let v = DisplayAreaSettings::read(r)?; r.set(&mut e0, v, 1942); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 1942);
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)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct VmsStatusMessageIndexVmsMessage {
pub message_index: Option<i32>,
pub vms_message: Option<Box<VmsMessage>>,
}
impl VmsStatusMessageIndexVmsMessage {
const FIELDS: &'static [u32] = &[0x130c61];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x1303e9);
let a0 = r.req_attr_value::<i32>(2346)?;
r.attrs_done();
let mut e0 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x130c61 => { let v = Some(VmsMessage::read(r)?); r.set(&mut e0, v.map(Box::new), 3169); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 3169);
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)
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum AnyDisplayArea {
DisplayArea(Box<DisplayArea>),
PictogramDisplayArea(Box<PictogramDisplayArea>),
SupplementaryPanelArea(Box<SupplementaryPanelArea>),
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(0x130081) => Self::DisplayArea(Box::new(DisplayArea::read(r)?)),
Some(0x130177) => Self::PictogramDisplayArea(Box::new(PictogramDisplayArea::read(r)?)),
Some(0x130202) => Self::SupplementaryPanelArea(Box::new(SupplementaryPanelArea::read(r)?)),
Some(0x130210) => 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)?))
}
}))
}
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(),
}
}
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(),
}
}
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(),
}
}
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(),
}
}
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(),
}
}
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(),
}
}
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(),
}
}
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,
}
}
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\"", ""),
}
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum DisplayAreaSettings {
MultiPageDisplay(Box<MultiPageDisplay>),
PictogramDisplay(Box<PictogramDisplay>),
SupplementaryPictogram(Box<SupplementaryPictogram>),
SupplementaryText(Box<SupplementaryText>),
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(0x130110) => Self::MultiPageDisplay(Box::new(MultiPageDisplay::read(r)?)),
Some(0x130176) => Self::PictogramDisplay(Box::new(PictogramDisplay::read(r)?)),
Some(0x130203) => Self::SupplementaryPictogram(Box::new(SupplementaryPictogram::read(r)?)),
Some(0x130206) => Self::SupplementaryText(Box::new(SupplementaryText::read(r)?)),
Some(0x13020f) => Self::TextDisplay(Box::new(TextDisplay::read(r)?)),
_ => {
r.unknown_type("DisplayAreaSettings")?;
return Ok(None);
}
}))
}
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(),
}
}
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(),
}
}
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(),
}
}
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\"", ""),
}
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum Pictogram {
CompositePictogram(Box<CompositePictogram>),
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(0x130054) => Self::CompositePictogram(Box::new(CompositePictogram::read(r)?)),
Some(0x1301b2) => Self::RegularPictogram(Box::new(RegularPictogram::read(r)?)),
_ => {
r.unknown_type("Pictogram")?;
return Ok(None);
}
}))
}
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(),
}
}
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(),
}
}
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(),
}
}
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(),
}
}
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(),
}
}
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(),
}
}
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(),
}
}
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\"", ""),
}
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum SupplementaryInformationDisplay {
SupplementaryPictogram(Box<SupplementaryPictogram>),
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(0x130203) => Self::SupplementaryPictogram(Box::new(SupplementaryPictogram::read(r)?)),
Some(0x130206) => Self::SupplementaryText(Box::new(SupplementaryText::read(r)?)),
_ => {
r.unknown_type("SupplementaryInformationDisplay")?;
return Ok(None);
}
}))
}
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(),
}
}
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(),
}
}
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(),
}
}
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(),
}
}
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\"", ""),
}
}
}