pub mod dataitems;
use std::any::Any;
use crate::asterix::category::CategoryIndex;
use crate::asterix::uap::common::dataitems::*;
use crate::asterix::uap::{DataItem, UAPDataItem, UAPEntry};
pub struct CAT048EntryList {
pub entries: Vec<UAPEntry>
}
impl CAT048EntryList {
fn _new() -> CAT048EntryList {
CAT048EntryList {
entries: vec![
UAPEntry::create( "1", "010", "Data Source Identifier", "2", DataSourceId.type_id() ).unwrap(),
UAPEntry::create( "2", "140", "Time-of-Day", "3", TimeOfDday.type_id()).unwrap(),
UAPEntry::create( "3", "020", "Target Report Descriptor", "1+", TargetReportDesc.type_id()).unwrap(),
UAPEntry::create( "4", "040", "Measured Position in Slant Polar Coordinates", "4", PositionPolarCoord.type_id()).unwrap(),
UAPEntry::create( "5", "070", "Mode-3/A Code in Octal Representation", "2", Mode3ACodeOctal.type_id()).unwrap(),
UAPEntry::create( "6", "090", "Flight Level in Binary Representation", "2", FlightLevelBin.type_id()).unwrap(),
UAPEntry::create( "7", "130", "Radar Plot Characteristics", "1+1+", RadarPlotCharac.type_id()).unwrap(),
UAPEntry::create( "8", "220", "Aircraft Address", "3", AircraftAddr.type_id()).unwrap(),
UAPEntry::create( "9", "240", "Aircraft Identification", "6", AircraftId.type_id()).unwrap(),
UAPEntry::create("10", "250", "Mode S MB Data", "1+8*n", ModeSMBData.type_id()).unwrap(),
UAPEntry::create("11", "161", "Track Number", "2", TrackNumber.type_id()).unwrap(),
UAPEntry::create("12", "042", "Calculated Position in Cartesian Coordinates", "4", PositionCartesianCoord.type_id()).unwrap(),
UAPEntry::create("13", "200", "Calculated Track Velocity in Polar Representation", "4", TrackVelocPolar.type_id()).unwrap(),
UAPEntry::create("14", "170", "Track Status", "1+", TrackStatus.type_id()).unwrap(),
UAPEntry::create("15", "210", "Track Quality", "4", TrackQuality.type_id()).unwrap(),
UAPEntry::create("16", "030", "Warning/Error Conditions/Target Classification", "1+", WarnErrorConditions.type_id()).unwrap(),
UAPEntry::create("17", "080", "Mode-3/A Code Confidence Indicator", "2", Mode3AConfid.type_id()).unwrap(),
UAPEntry::create("18", "100", "Mode-C Code and Confidence Indicator", "4", ModeCCodeAndConfid.type_id()).unwrap(),
UAPEntry::create("19", "110", "Height Measured by 3D Radar", "2", Height3DRadar.type_id()).unwrap(),
UAPEntry::create("20", "120", "Radial Doppler Speed", "1+", RadialDopplerSpeed.type_id()).unwrap(),
UAPEntry::create("21", "230", "Communications / ACAS Capability and Flight Status", "2", CommACASAndFlitghtStatus.type_id()).unwrap(),
UAPEntry::create("22", "260", "ACAS Resolution Advisory Report", "7", ACASResolReport.type_id()).unwrap(),
UAPEntry::create("23", "055", "Mode-1 Code in Octal Representation", "1", Mode1CodeOctal.type_id()).unwrap(),
UAPEntry::create("24", "050", "Mode-2 Code in Octal Representation", "2", Mode2CodeOctal.type_id()).unwrap(),
UAPEntry::create("25", "065", "Mode-1 Code Confidence Indicator", "1", Mode1CodeConfid.type_id()).unwrap(),
UAPEntry::create("26", "060", "Mode-2 Code Confidence Indicator", "2", Mode2CodeConfid.type_id()).unwrap(),
UAPEntry::create("27", "SPF", "Special Purpose Field", "1+1+", SPF.type_id() ).unwrap(),
UAPEntry::create("28", "REF", "Reserved Expansion Field", "1+1+", REF.type_id() ).unwrap()
]
}
}
}
pub struct CAT048Definition {
pub cat048_uap_data_items: Vec<UAPDataItem>
}
impl CAT048Definition {
fn _load() -> CAT048Definition {
let mut cat048_definition = CAT048Definition { cat048_uap_data_items: vec![]};
for entry in CAT048EntryList::_new().entries {
cat048_definition.cat048_uap_data_items.push(UAPDataItem {
frn: entry.frn,
data_item: DataItem {
category: CategoryIndex::_048,
data_item_index: entry.code,
content: entry.description,
length: entry.length,
type_id: entry.type_id
}
});
}
cat048_definition
}
}