feat: cif (name pending)
Some checks are pending
Verify Latest Dependencies / Verify Latest Dependencies (push) Waiting to run
build and test / wxbox - latest (push) Waiting to run

This commit is contained in:
core 2025-05-19 21:07:33 -04:00
parent 5c597977ee
commit 182252e209
Signed by: core
GPG key ID: FDBF740DADDCEECF
15 changed files with 2747 additions and 103 deletions

6
.idea/wxbox.iml generated
View file

@ -22,6 +22,12 @@
<sourceFolder url="file://$MODULE_DIR$/crates/ar2/benches" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/crates/grib2/benches" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/crates/tiler/benches" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/crates/interchange/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/crates/nexrad-data/examples" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/crates/nexrad-data/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/crates/nexrad-decode/examples" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/crates/nexrad-decode/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/crates/nexrad-model/src" isTestSource="false" />
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
<excludeFolder url="file://$MODULE_DIR$/temp" />
<excludeFolder url="file://$MODULE_DIR$/tmp" />

63
Cargo.lock generated
View file

@ -324,12 +324,6 @@ version = "1.22.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b6b1fc10dbac614ebc03540c9dbd60e83887fda27794998c6528f1782047d540"
[[package]]
name = "byteorder"
version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
[[package]]
name = "byteorder-lite"
version = "0.1.0"
@ -362,6 +356,24 @@ dependencies = [
"pkg-config",
]
[[package]]
name = "capnp"
version = "0.20.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "053b81915c2ce1629b8fb964f578b18cb39b23ef9d5b24120d0dfc959569a1d9"
dependencies = [
"embedded-io",
]
[[package]]
name = "capnpc"
version = "0.20.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1aa3d5f01e69ed11656d2c7c47bf34327ea9bfb5c85c7de787fcd7b6c5e45b61"
dependencies = [
"capnp",
]
[[package]]
name = "cast"
version = "0.3.0"
@ -621,6 +633,12 @@ version = "1.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719"
[[package]]
name = "embedded-io"
version = "0.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d"
[[package]]
name = "encoding_rs"
version = "0.8.35"
@ -2261,28 +2279,6 @@ dependencies = [
"windows-sys 0.52.0",
]
[[package]]
name = "rmp"
version = "0.8.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "228ed7c16fa39782c3b3468e974aec2795e9089153cd08ee2e9aefb3613334c4"
dependencies = [
"byteorder",
"num-traits",
"paste",
]
[[package]]
name = "rmp-serde"
version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "52e599a477cf9840e92f2cde9a7189e67b42c57532749bf90aea6ec10facd4db"
dependencies = [
"byteorder",
"rmp",
"serde",
]
[[package]]
name = "rustc-demangle"
version = "0.1.24"
@ -3628,6 +3624,15 @@ dependencies = [
"wxbox-nommer",
]
[[package]]
name = "wxbox-interchange"
version = "0.1.0"
dependencies = [
"capnp",
"capnpc",
"wxbox-ar2",
]
[[package]]
name = "wxbox-nommer"
version = "0.1.0"
@ -3657,7 +3662,6 @@ dependencies = [
"quick-xml",
"rayon",
"reqwest",
"rmp-serde",
"serde",
"strum",
"strum_macros",
@ -3669,6 +3673,7 @@ dependencies = [
"wxbox-ar2",
"wxbox-common",
"wxbox-grib2",
"wxbox-interchange",
"wxbox-pal",
]

View file

@ -0,0 +1,15 @@
[package]
name = "wxbox-interchange"
version = "0.1.0"
edition = "2024"
[dependencies]
capnp = "0.20"
wxbox-ar2 = { path = "../ar2", optional = true }
[features]
default = []
ar2 = ["dep:wxbox-ar2"]
[build-dependencies]
capnpc = "0.20"

View file

@ -0,0 +1,10 @@
fn main() {
capnpc::CompilerCommand::new()
.output_path("src/")
.src_prefix("schemas")
.file("schemas/schema.capnp")
.file("schemas/digitalRadarData.capnp")
.file("schemas/tilerStatusReport.capnp")
.run()
.expect("capnp compiles");
}

View file

@ -0,0 +1,9 @@
# wxbox data interchange format
The wxbox data interchange format is a fast and compact protocol for interchanging weather data.
Primarily intended for compact representations of radar radials, it will also eventually be extended to other types of
weather information.
## Supported Data Contents
| Data Type | File extension | `Content-Type` | Inner data union type |
|----------------------------------------------------------|----------------|------------------------------------------|-----------------------|
| Digital Radial Radar Data - Momentary - single elevation | wxrad | `application/x.wxbox-digital-radar-data` | `DigitalRadarData` |

View file

@ -0,0 +1,53 @@
@0xf91dcf1c056cf08a;
struct DigitalRadarData {
vcpNumber @0 :UInt16;
elevationNumber @1 :UInt8;
radials @2 :List(Radial);
}
struct Radial {
collectionTimestamp @0 :Int64;
azimuthNumber @1 :UInt16;
azimuthAngleDegrees @2 :Float32;
azimuthSpacingDegrees @3 :Float32;
radialStatus @4 :RadialStatus;
elevationNumber @5 :UInt8;
elevationDegrees @6 :Float32;
requestedProduct :union {
unavailable @7 :Void;
available @8 :MomentaryProduct;
}
}
enum RadialStatus {
elevationStart @0;
intermediateRadialData @1;
elevationEnd @2;
volumeScanStart @3;
volumeScanEnd @4;
elevationStartVCPFinal @5; # start of new elevation, last elevation in VCP
}
struct MomentaryProduct {
productMetadata @0 :MomentaryProductMeta;
data @1 :MomentaryProductData;
}
struct MomentaryProductMeta {
productName @0 :Text;
}
struct MomentaryProductData {
scale @0 :Float32;
offset @1 :Float32;
startRange @2 :UInt16;
sampleInterval @3 :UInt16;
values @4 :List(UInt8);
}

View file

@ -0,0 +1,8 @@
@0xf4ec6bdd2faa25e6;
struct Message {
union {
tilerStatusReport @0 :import "tilerStatusReport.capnp".TilerStatusReport;
digitalRadarData @1 :import "digitalRadarData.capnp".DigitalRadarData;
}
}

View file

@ -0,0 +1,10 @@
@0xa53697f84202e60f;
struct TilerStatusReport {
cacheInfo @0 :CacheInfo;
}
struct CacheInfo {
grib2CacheEntries @0 :UInt64;
nexradCacheEntries @1 :UInt64;
}

View file

@ -0,0 +1,19 @@
use wxbox_ar2::Scan;
pub fn serialize_scan_to_cif_message(scan: &Scan, elevation_number: u8) -> Vec<u8> {
let mut message = capnp::message::Builder::new_default();
let cif_message = message.init_root::<crate::schema_capnp::message::Builder>();
let mut digital_radar_data = cif_message.init_digital_radar_data();
digital_radar_data.set_vcp_number(scan.coverage_pattern_number);
digital_radar_data.set_elevation_number(elevation_number);
// find the elevation the user requested
let maybe_elevation = scan.sweeps.iter().find(|u| u.elevation_number == elevation_number);
if let Some(elevation) = maybe_elevation {
} else {
digital_radar_data.reborrow().init_radials(0); // no elevation is signalled by an empty radials field
}
todo!()
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,9 @@
#[allow(non_snake_case)]
pub mod schema_capnp;
#[allow(non_snake_case)]
pub mod digitalRadarData_capnp;
#[allow(non_snake_case)]
pub mod tilerStatusReport_capnp;
#[cfg(feature = ar2)]
pub mod ar2;

View file

@ -0,0 +1,287 @@
// @generated by the capnpc-rust plugin to the Cap'n Proto schema compiler.
// DO NOT EDIT.
// source: schema.capnp
pub mod message {
pub use self::Which::{TilerStatusReport,DigitalRadarData};
#[derive(Copy, Clone)]
pub struct Owned(());
impl ::capnp::introspect::Introspect for Owned { fn introspect() -> ::capnp::introspect::Type { ::capnp::introspect::TypeVariant::Struct(::capnp::introspect::RawBrandedStructSchema { generic: &_private::RAW_SCHEMA, field_types: _private::get_field_types, annotation_types: _private::get_annotation_types }).into() } }
impl ::capnp::traits::Owned for Owned { type Reader<'a> = Reader<'a>; type Builder<'a> = Builder<'a>; }
impl ::capnp::traits::OwnedStruct for Owned { type Reader<'a> = Reader<'a>; type Builder<'a> = Builder<'a>; }
impl ::capnp::traits::Pipelined for Owned { type Pipeline = Pipeline; }
pub struct Reader<'a> { reader: ::capnp::private::layout::StructReader<'a> }
impl <> ::core::marker::Copy for Reader<'_,> {}
impl <> ::core::clone::Clone for Reader<'_,> {
fn clone(&self) -> Self { *self }
}
impl <> ::capnp::traits::HasTypeId for Reader<'_,> {
const TYPE_ID: u64 = _private::TYPE_ID;
}
impl <'a,> ::core::convert::From<::capnp::private::layout::StructReader<'a>> for Reader<'a,> {
fn from(reader: ::capnp::private::layout::StructReader<'a>) -> Self {
Self { reader, }
}
}
impl <'a,> ::core::convert::From<Reader<'a,>> for ::capnp::dynamic_value::Reader<'a> {
fn from(reader: Reader<'a,>) -> Self {
Self::Struct(::capnp::dynamic_struct::Reader::new(reader.reader, ::capnp::schema::StructSchema::new(::capnp::introspect::RawBrandedStructSchema { generic: &_private::RAW_SCHEMA, field_types: _private::get_field_types::<>, annotation_types: _private::get_annotation_types::<>})))
}
}
impl <> ::core::fmt::Debug for Reader<'_,> {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::result::Result<(), ::core::fmt::Error> {
core::fmt::Debug::fmt(&::core::convert::Into::<::capnp::dynamic_value::Reader<'_>>::into(*self), f)
}
}
impl <'a,> ::capnp::traits::FromPointerReader<'a> for Reader<'a,> {
fn get_from_pointer(reader: &::capnp::private::layout::PointerReader<'a>, default: ::core::option::Option<&'a [::capnp::Word]>) -> ::capnp::Result<Self> {
::core::result::Result::Ok(reader.get_struct(default)?.into())
}
}
impl <'a,> ::capnp::traits::IntoInternalStructReader<'a> for Reader<'a,> {
fn into_internal_struct_reader(self) -> ::capnp::private::layout::StructReader<'a> {
self.reader
}
}
impl <'a,> ::capnp::traits::Imbue<'a> for Reader<'a,> {
fn imbue(&mut self, cap_table: &'a ::capnp::private::layout::CapTable) {
self.reader.imbue(::capnp::private::layout::CapTableReader::Plain(cap_table))
}
}
impl <'a,> Reader<'a,> {
pub fn reborrow(&self) -> Reader<'_,> {
Self { .. *self }
}
pub fn total_size(&self) -> ::capnp::Result<::capnp::MessageSize> {
self.reader.total_size()
}
#[inline]
pub fn has_tiler_status_report(&self) -> bool {
if self.reader.get_data_field::<u16>(0) != 0 { return false; }
!self.reader.get_pointer_field(0).is_null()
}
#[inline]
pub fn has_digital_radar_data(&self) -> bool {
if self.reader.get_data_field::<u16>(0) != 1 { return false; }
!self.reader.get_pointer_field(0).is_null()
}
#[inline]
pub fn which(self) -> ::core::result::Result<WhichReader<'a,>, ::capnp::NotInSchema> {
match self.reader.get_data_field::<u16>(0) {
0 => {
::core::result::Result::Ok(TilerStatusReport(
::capnp::traits::FromPointerReader::get_from_pointer(&self.reader.get_pointer_field(0), ::core::option::Option::None)
))
}
1 => {
::core::result::Result::Ok(DigitalRadarData(
::capnp::traits::FromPointerReader::get_from_pointer(&self.reader.get_pointer_field(0), ::core::option::Option::None)
))
}
x => ::core::result::Result::Err(::capnp::NotInSchema(x))
}
}
}
pub struct Builder<'a> { builder: ::capnp::private::layout::StructBuilder<'a> }
impl <> ::capnp::traits::HasStructSize for Builder<'_,> {
const STRUCT_SIZE: ::capnp::private::layout::StructSize = ::capnp::private::layout::StructSize { data: 1, pointers: 1 };
}
impl <> ::capnp::traits::HasTypeId for Builder<'_,> {
const TYPE_ID: u64 = _private::TYPE_ID;
}
impl <'a,> ::core::convert::From<::capnp::private::layout::StructBuilder<'a>> for Builder<'a,> {
fn from(builder: ::capnp::private::layout::StructBuilder<'a>) -> Self {
Self { builder, }
}
}
impl <'a,> ::core::convert::From<Builder<'a,>> for ::capnp::dynamic_value::Builder<'a> {
fn from(builder: Builder<'a,>) -> Self {
Self::Struct(::capnp::dynamic_struct::Builder::new(builder.builder, ::capnp::schema::StructSchema::new(::capnp::introspect::RawBrandedStructSchema { generic: &_private::RAW_SCHEMA, field_types: _private::get_field_types::<>, annotation_types: _private::get_annotation_types::<>})))
}
}
impl <'a,> ::capnp::traits::ImbueMut<'a> for Builder<'a,> {
fn imbue_mut(&mut self, cap_table: &'a mut ::capnp::private::layout::CapTable) {
self.builder.imbue(::capnp::private::layout::CapTableBuilder::Plain(cap_table))
}
}
impl <'a,> ::capnp::traits::FromPointerBuilder<'a> for Builder<'a,> {
fn init_pointer(builder: ::capnp::private::layout::PointerBuilder<'a>, _size: u32) -> Self {
builder.init_struct(<Self as ::capnp::traits::HasStructSize>::STRUCT_SIZE).into()
}
fn get_from_pointer(builder: ::capnp::private::layout::PointerBuilder<'a>, default: ::core::option::Option<&'a [::capnp::Word]>) -> ::capnp::Result<Self> {
::core::result::Result::Ok(builder.get_struct(<Self as ::capnp::traits::HasStructSize>::STRUCT_SIZE, default)?.into())
}
}
impl <> ::capnp::traits::SetterInput<Owned<>> for Reader<'_,> {
fn set_pointer_builder(mut pointer: ::capnp::private::layout::PointerBuilder<'_>, value: Self, canonicalize: bool) -> ::capnp::Result<()> { pointer.set_struct(&value.reader, canonicalize) }
}
impl <'a,> Builder<'a,> {
pub fn into_reader(self) -> Reader<'a,> {
self.builder.into_reader().into()
}
pub fn reborrow(&mut self) -> Builder<'_,> {
Builder { builder: self.builder.reborrow() }
}
pub fn reborrow_as_reader(&self) -> Reader<'_,> {
self.builder.as_reader().into()
}
pub fn total_size(&self) -> ::capnp::Result<::capnp::MessageSize> {
self.builder.as_reader().total_size()
}
#[inline]
pub fn set_tiler_status_report(&mut self, value: crate::tilerStatusReport_capnp::tiler_status_report::Reader<'_>) -> ::capnp::Result<()> {
self.builder.set_data_field::<u16>(0, 0);
::capnp::traits::SetterInput::set_pointer_builder(self.builder.reborrow().get_pointer_field(0), value, false)
}
#[inline]
pub fn init_tiler_status_report(self, ) -> crate::tilerStatusReport_capnp::tiler_status_report::Builder<'a> {
self.builder.set_data_field::<u16>(0, 0);
::capnp::traits::FromPointerBuilder::init_pointer(self.builder.get_pointer_field(0), 0)
}
#[inline]
pub fn has_tiler_status_report(&self) -> bool {
if self.builder.get_data_field::<u16>(0) != 0 { return false; }
!self.builder.is_pointer_field_null(0)
}
#[inline]
pub fn set_digital_radar_data(&mut self, value: crate::digitalRadarData_capnp::digital_radar_data::Reader<'_>) -> ::capnp::Result<()> {
self.builder.set_data_field::<u16>(0, 1);
::capnp::traits::SetterInput::set_pointer_builder(self.builder.reborrow().get_pointer_field(0), value, false)
}
#[inline]
pub fn init_digital_radar_data(self, ) -> crate::digitalRadarData_capnp::digital_radar_data::Builder<'a> {
self.builder.set_data_field::<u16>(0, 1);
::capnp::traits::FromPointerBuilder::init_pointer(self.builder.get_pointer_field(0), 0)
}
#[inline]
pub fn has_digital_radar_data(&self) -> bool {
if self.builder.get_data_field::<u16>(0) != 1 { return false; }
!self.builder.is_pointer_field_null(0)
}
#[inline]
pub fn which(self) -> ::core::result::Result<WhichBuilder<'a,>, ::capnp::NotInSchema> {
match self.builder.get_data_field::<u16>(0) {
0 => {
::core::result::Result::Ok(TilerStatusReport(
::capnp::traits::FromPointerBuilder::get_from_pointer(self.builder.get_pointer_field(0), ::core::option::Option::None)
))
}
1 => {
::core::result::Result::Ok(DigitalRadarData(
::capnp::traits::FromPointerBuilder::get_from_pointer(self.builder.get_pointer_field(0), ::core::option::Option::None)
))
}
x => ::core::result::Result::Err(::capnp::NotInSchema(x))
}
}
}
pub struct Pipeline { _typeless: ::capnp::any_pointer::Pipeline }
impl ::capnp::capability::FromTypelessPipeline for Pipeline {
fn new(typeless: ::capnp::any_pointer::Pipeline) -> Self {
Self { _typeless: typeless, }
}
}
impl Pipeline {
}
mod _private {
pub static ENCODED_NODE: [::capnp::Word; 52] = [
::capnp::word(0, 0, 0, 0, 6, 0, 6, 0),
::capnp::word(207, 232, 53, 60, 199, 56, 142, 192),
::capnp::word(13, 0, 0, 0, 1, 0, 1, 0),
::capnp::word(230, 37, 170, 47, 221, 107, 236, 244),
::capnp::word(1, 0, 7, 0, 0, 0, 2, 0),
::capnp::word(0, 0, 0, 0, 0, 0, 0, 0),
::capnp::word(22, 0, 0, 0, 219, 0, 0, 0),
::capnp::word(21, 0, 0, 0, 170, 0, 0, 0),
::capnp::word(29, 0, 0, 0, 7, 0, 0, 0),
::capnp::word(0, 0, 0, 0, 0, 0, 0, 0),
::capnp::word(25, 0, 0, 0, 119, 0, 0, 0),
::capnp::word(0, 0, 0, 0, 0, 0, 0, 0),
::capnp::word(0, 0, 0, 0, 0, 0, 0, 0),
::capnp::word(115, 99, 104, 101, 109, 97, 46, 99),
::capnp::word(97, 112, 110, 112, 58, 77, 101, 115),
::capnp::word(115, 97, 103, 101, 0, 0, 0, 0),
::capnp::word(0, 0, 0, 0, 1, 0, 1, 0),
::capnp::word(8, 0, 0, 0, 3, 0, 4, 0),
::capnp::word(0, 0, 255, 255, 0, 0, 0, 0),
::capnp::word(0, 0, 1, 0, 0, 0, 0, 0),
::capnp::word(0, 0, 0, 0, 0, 0, 0, 0),
::capnp::word(41, 0, 0, 0, 146, 0, 0, 0),
::capnp::word(0, 0, 0, 0, 0, 0, 0, 0),
::capnp::word(44, 0, 0, 0, 3, 0, 1, 0),
::capnp::word(56, 0, 0, 0, 2, 0, 1, 0),
::capnp::word(1, 0, 254, 255, 0, 0, 0, 0),
::capnp::word(0, 0, 1, 0, 1, 0, 0, 0),
::capnp::word(0, 0, 0, 0, 0, 0, 0, 0),
::capnp::word(53, 0, 0, 0, 138, 0, 0, 0),
::capnp::word(0, 0, 0, 0, 0, 0, 0, 0),
::capnp::word(56, 0, 0, 0, 3, 0, 1, 0),
::capnp::word(68, 0, 0, 0, 2, 0, 1, 0),
::capnp::word(116, 105, 108, 101, 114, 83, 116, 97),
::capnp::word(116, 117, 115, 82, 101, 112, 111, 114),
::capnp::word(116, 0, 0, 0, 0, 0, 0, 0),
::capnp::word(16, 0, 0, 0, 0, 0, 0, 0),
::capnp::word(107, 210, 50, 88, 206, 228, 195, 255),
::capnp::word(0, 0, 0, 0, 0, 0, 0, 0),
::capnp::word(0, 0, 0, 0, 0, 0, 0, 0),
::capnp::word(16, 0, 0, 0, 0, 0, 0, 0),
::capnp::word(0, 0, 0, 0, 0, 0, 0, 0),
::capnp::word(0, 0, 0, 0, 0, 0, 0, 0),
::capnp::word(100, 105, 103, 105, 116, 97, 108, 82),
::capnp::word(97, 100, 97, 114, 68, 97, 116, 97),
::capnp::word(0, 0, 0, 0, 0, 0, 0, 0),
::capnp::word(16, 0, 0, 0, 0, 0, 0, 0),
::capnp::word(124, 221, 74, 204, 88, 181, 51, 199),
::capnp::word(0, 0, 0, 0, 0, 0, 0, 0),
::capnp::word(0, 0, 0, 0, 0, 0, 0, 0),
::capnp::word(16, 0, 0, 0, 0, 0, 0, 0),
::capnp::word(0, 0, 0, 0, 0, 0, 0, 0),
::capnp::word(0, 0, 0, 0, 0, 0, 0, 0),
];
pub fn get_field_types(index: u16) -> ::capnp::introspect::Type {
match index {
0 => <crate::tilerStatusReport_capnp::tiler_status_report::Owned as ::capnp::introspect::Introspect>::introspect(),
1 => <crate::digitalRadarData_capnp::digital_radar_data::Owned as ::capnp::introspect::Introspect>::introspect(),
_ => panic!("invalid field index {}", index),
}
}
pub fn get_annotation_types(child_index: Option<u16>, index: u32) -> ::capnp::introspect::Type {
panic!("invalid annotation indices ({:?}, {}) ", child_index, index)
}
pub static RAW_SCHEMA: ::capnp::introspect::RawStructSchema = ::capnp::introspect::RawStructSchema {
encoded_node: &ENCODED_NODE,
nonunion_members: NONUNION_MEMBERS,
members_by_discriminant: MEMBERS_BY_DISCRIMINANT,
members_by_name: MEMBERS_BY_NAME,
};
pub static NONUNION_MEMBERS : &[u16] = &[];
pub static MEMBERS_BY_DISCRIMINANT : &[u16] = &[0,1];
pub static MEMBERS_BY_NAME : &[u16] = &[1,0];
pub const TYPE_ID: u64 = 0xc08e_38c7_3c35_e8cf;
}
pub enum Which<A0,A1> {
TilerStatusReport(A0),
DigitalRadarData(A1),
}
pub type WhichReader<'a,> = Which<::capnp::Result<crate::tilerStatusReport_capnp::tiler_status_report::Reader<'a>>,::capnp::Result<crate::digitalRadarData_capnp::digital_radar_data::Reader<'a>>>;
pub type WhichBuilder<'a,> = Which<::capnp::Result<crate::tilerStatusReport_capnp::tiler_status_report::Builder<'a>>,::capnp::Result<crate::digitalRadarData_capnp::digital_radar_data::Builder<'a>>>;
}

View file

@ -0,0 +1,447 @@
// @generated by the capnpc-rust plugin to the Cap'n Proto schema compiler.
// DO NOT EDIT.
// source: tilerStatusReport.capnp
pub mod tiler_status_report {
#[derive(Copy, Clone)]
pub struct Owned(());
impl ::capnp::introspect::Introspect for Owned { fn introspect() -> ::capnp::introspect::Type { ::capnp::introspect::TypeVariant::Struct(::capnp::introspect::RawBrandedStructSchema { generic: &_private::RAW_SCHEMA, field_types: _private::get_field_types, annotation_types: _private::get_annotation_types }).into() } }
impl ::capnp::traits::Owned for Owned { type Reader<'a> = Reader<'a>; type Builder<'a> = Builder<'a>; }
impl ::capnp::traits::OwnedStruct for Owned { type Reader<'a> = Reader<'a>; type Builder<'a> = Builder<'a>; }
impl ::capnp::traits::Pipelined for Owned { type Pipeline = Pipeline; }
pub struct Reader<'a> { reader: ::capnp::private::layout::StructReader<'a> }
impl <> ::core::marker::Copy for Reader<'_,> {}
impl <> ::core::clone::Clone for Reader<'_,> {
fn clone(&self) -> Self { *self }
}
impl <> ::capnp::traits::HasTypeId for Reader<'_,> {
const TYPE_ID: u64 = _private::TYPE_ID;
}
impl <'a,> ::core::convert::From<::capnp::private::layout::StructReader<'a>> for Reader<'a,> {
fn from(reader: ::capnp::private::layout::StructReader<'a>) -> Self {
Self { reader, }
}
}
impl <'a,> ::core::convert::From<Reader<'a,>> for ::capnp::dynamic_value::Reader<'a> {
fn from(reader: Reader<'a,>) -> Self {
Self::Struct(::capnp::dynamic_struct::Reader::new(reader.reader, ::capnp::schema::StructSchema::new(::capnp::introspect::RawBrandedStructSchema { generic: &_private::RAW_SCHEMA, field_types: _private::get_field_types::<>, annotation_types: _private::get_annotation_types::<>})))
}
}
impl <> ::core::fmt::Debug for Reader<'_,> {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::result::Result<(), ::core::fmt::Error> {
core::fmt::Debug::fmt(&::core::convert::Into::<::capnp::dynamic_value::Reader<'_>>::into(*self), f)
}
}
impl <'a,> ::capnp::traits::FromPointerReader<'a> for Reader<'a,> {
fn get_from_pointer(reader: &::capnp::private::layout::PointerReader<'a>, default: ::core::option::Option<&'a [::capnp::Word]>) -> ::capnp::Result<Self> {
::core::result::Result::Ok(reader.get_struct(default)?.into())
}
}
impl <'a,> ::capnp::traits::IntoInternalStructReader<'a> for Reader<'a,> {
fn into_internal_struct_reader(self) -> ::capnp::private::layout::StructReader<'a> {
self.reader
}
}
impl <'a,> ::capnp::traits::Imbue<'a> for Reader<'a,> {
fn imbue(&mut self, cap_table: &'a ::capnp::private::layout::CapTable) {
self.reader.imbue(::capnp::private::layout::CapTableReader::Plain(cap_table))
}
}
impl <'a,> Reader<'a,> {
pub fn reborrow(&self) -> Reader<'_,> {
Self { .. *self }
}
pub fn total_size(&self) -> ::capnp::Result<::capnp::MessageSize> {
self.reader.total_size()
}
#[inline]
pub fn get_cache_info(self) -> ::capnp::Result<crate::tilerStatusReport_capnp::cache_info::Reader<'a>> {
::capnp::traits::FromPointerReader::get_from_pointer(&self.reader.get_pointer_field(0), ::core::option::Option::None)
}
#[inline]
pub fn has_cache_info(&self) -> bool {
!self.reader.get_pointer_field(0).is_null()
}
}
pub struct Builder<'a> { builder: ::capnp::private::layout::StructBuilder<'a> }
impl <> ::capnp::traits::HasStructSize for Builder<'_,> {
const STRUCT_SIZE: ::capnp::private::layout::StructSize = ::capnp::private::layout::StructSize { data: 0, pointers: 1 };
}
impl <> ::capnp::traits::HasTypeId for Builder<'_,> {
const TYPE_ID: u64 = _private::TYPE_ID;
}
impl <'a,> ::core::convert::From<::capnp::private::layout::StructBuilder<'a>> for Builder<'a,> {
fn from(builder: ::capnp::private::layout::StructBuilder<'a>) -> Self {
Self { builder, }
}
}
impl <'a,> ::core::convert::From<Builder<'a,>> for ::capnp::dynamic_value::Builder<'a> {
fn from(builder: Builder<'a,>) -> Self {
Self::Struct(::capnp::dynamic_struct::Builder::new(builder.builder, ::capnp::schema::StructSchema::new(::capnp::introspect::RawBrandedStructSchema { generic: &_private::RAW_SCHEMA, field_types: _private::get_field_types::<>, annotation_types: _private::get_annotation_types::<>})))
}
}
impl <'a,> ::capnp::traits::ImbueMut<'a> for Builder<'a,> {
fn imbue_mut(&mut self, cap_table: &'a mut ::capnp::private::layout::CapTable) {
self.builder.imbue(::capnp::private::layout::CapTableBuilder::Plain(cap_table))
}
}
impl <'a,> ::capnp::traits::FromPointerBuilder<'a> for Builder<'a,> {
fn init_pointer(builder: ::capnp::private::layout::PointerBuilder<'a>, _size: u32) -> Self {
builder.init_struct(<Self as ::capnp::traits::HasStructSize>::STRUCT_SIZE).into()
}
fn get_from_pointer(builder: ::capnp::private::layout::PointerBuilder<'a>, default: ::core::option::Option<&'a [::capnp::Word]>) -> ::capnp::Result<Self> {
::core::result::Result::Ok(builder.get_struct(<Self as ::capnp::traits::HasStructSize>::STRUCT_SIZE, default)?.into())
}
}
impl <> ::capnp::traits::SetterInput<Owned<>> for Reader<'_,> {
fn set_pointer_builder(mut pointer: ::capnp::private::layout::PointerBuilder<'_>, value: Self, canonicalize: bool) -> ::capnp::Result<()> { pointer.set_struct(&value.reader, canonicalize) }
}
impl <'a,> Builder<'a,> {
pub fn into_reader(self) -> Reader<'a,> {
self.builder.into_reader().into()
}
pub fn reborrow(&mut self) -> Builder<'_,> {
Builder { builder: self.builder.reborrow() }
}
pub fn reborrow_as_reader(&self) -> Reader<'_,> {
self.builder.as_reader().into()
}
pub fn total_size(&self) -> ::capnp::Result<::capnp::MessageSize> {
self.builder.as_reader().total_size()
}
#[inline]
pub fn get_cache_info(self) -> ::capnp::Result<crate::tilerStatusReport_capnp::cache_info::Builder<'a>> {
::capnp::traits::FromPointerBuilder::get_from_pointer(self.builder.get_pointer_field(0), ::core::option::Option::None)
}
#[inline]
pub fn set_cache_info(&mut self, value: crate::tilerStatusReport_capnp::cache_info::Reader<'_>) -> ::capnp::Result<()> {
::capnp::traits::SetterInput::set_pointer_builder(self.builder.reborrow().get_pointer_field(0), value, false)
}
#[inline]
pub fn init_cache_info(self, ) -> crate::tilerStatusReport_capnp::cache_info::Builder<'a> {
::capnp::traits::FromPointerBuilder::init_pointer(self.builder.get_pointer_field(0), 0)
}
#[inline]
pub fn has_cache_info(&self) -> bool {
!self.builder.is_pointer_field_null(0)
}
}
pub struct Pipeline { _typeless: ::capnp::any_pointer::Pipeline }
impl ::capnp::capability::FromTypelessPipeline for Pipeline {
fn new(typeless: ::capnp::any_pointer::Pipeline) -> Self {
Self { _typeless: typeless, }
}
}
impl Pipeline {
pub fn get_cache_info(&self) -> crate::tilerStatusReport_capnp::cache_info::Pipeline {
::capnp::capability::FromTypelessPipeline::new(self._typeless.get_pointer_field(0))
}
}
mod _private {
pub static ENCODED_NODE: [::capnp::Word; 37] = [
::capnp::word(0, 0, 0, 0, 6, 0, 6, 0),
::capnp::word(107, 210, 50, 88, 206, 228, 195, 255),
::capnp::word(24, 0, 0, 0, 1, 0, 0, 0),
::capnp::word(15, 230, 2, 66, 248, 151, 54, 165),
::capnp::word(1, 0, 7, 0, 0, 0, 0, 0),
::capnp::word(0, 0, 0, 0, 0, 0, 0, 0),
::capnp::word(22, 0, 0, 0, 79, 0, 0, 0),
::capnp::word(21, 0, 0, 0, 82, 1, 0, 0),
::capnp::word(41, 0, 0, 0, 7, 0, 0, 0),
::capnp::word(0, 0, 0, 0, 0, 0, 0, 0),
::capnp::word(37, 0, 0, 0, 63, 0, 0, 0),
::capnp::word(0, 0, 0, 0, 0, 0, 0, 0),
::capnp::word(0, 0, 0, 0, 0, 0, 0, 0),
::capnp::word(116, 105, 108, 101, 114, 83, 116, 97),
::capnp::word(116, 117, 115, 82, 101, 112, 111, 114),
::capnp::word(116, 46, 99, 97, 112, 110, 112, 58),
::capnp::word(84, 105, 108, 101, 114, 83, 116, 97),
::capnp::word(116, 117, 115, 82, 101, 112, 111, 114),
::capnp::word(116, 0, 0, 0, 0, 0, 0, 0),
::capnp::word(0, 0, 0, 0, 1, 0, 1, 0),
::capnp::word(4, 0, 0, 0, 3, 0, 4, 0),
::capnp::word(0, 0, 0, 0, 0, 0, 0, 0),
::capnp::word(0, 0, 1, 0, 0, 0, 0, 0),
::capnp::word(0, 0, 0, 0, 0, 0, 0, 0),
::capnp::word(13, 0, 0, 0, 82, 0, 0, 0),
::capnp::word(0, 0, 0, 0, 0, 0, 0, 0),
::capnp::word(12, 0, 0, 0, 3, 0, 1, 0),
::capnp::word(24, 0, 0, 0, 2, 0, 1, 0),
::capnp::word(99, 97, 99, 104, 101, 73, 110, 102),
::capnp::word(111, 0, 0, 0, 0, 0, 0, 0),
::capnp::word(16, 0, 0, 0, 0, 0, 0, 0),
::capnp::word(134, 113, 226, 152, 133, 252, 175, 149),
::capnp::word(0, 0, 0, 0, 0, 0, 0, 0),
::capnp::word(0, 0, 0, 0, 0, 0, 0, 0),
::capnp::word(16, 0, 0, 0, 0, 0, 0, 0),
::capnp::word(0, 0, 0, 0, 0, 0, 0, 0),
::capnp::word(0, 0, 0, 0, 0, 0, 0, 0),
];
pub fn get_field_types(index: u16) -> ::capnp::introspect::Type {
match index {
0 => <crate::tilerStatusReport_capnp::cache_info::Owned as ::capnp::introspect::Introspect>::introspect(),
_ => panic!("invalid field index {}", index),
}
}
pub fn get_annotation_types(child_index: Option<u16>, index: u32) -> ::capnp::introspect::Type {
panic!("invalid annotation indices ({:?}, {}) ", child_index, index)
}
pub static RAW_SCHEMA: ::capnp::introspect::RawStructSchema = ::capnp::introspect::RawStructSchema {
encoded_node: &ENCODED_NODE,
nonunion_members: NONUNION_MEMBERS,
members_by_discriminant: MEMBERS_BY_DISCRIMINANT,
members_by_name: MEMBERS_BY_NAME,
};
pub static NONUNION_MEMBERS : &[u16] = &[0];
pub static MEMBERS_BY_DISCRIMINANT : &[u16] = &[];
pub static MEMBERS_BY_NAME : &[u16] = &[0];
pub const TYPE_ID: u64 = 0xffc3_e4ce_5832_d26b;
}
}
pub mod cache_info {
#[derive(Copy, Clone)]
pub struct Owned(());
impl ::capnp::introspect::Introspect for Owned { fn introspect() -> ::capnp::introspect::Type { ::capnp::introspect::TypeVariant::Struct(::capnp::introspect::RawBrandedStructSchema { generic: &_private::RAW_SCHEMA, field_types: _private::get_field_types, annotation_types: _private::get_annotation_types }).into() } }
impl ::capnp::traits::Owned for Owned { type Reader<'a> = Reader<'a>; type Builder<'a> = Builder<'a>; }
impl ::capnp::traits::OwnedStruct for Owned { type Reader<'a> = Reader<'a>; type Builder<'a> = Builder<'a>; }
impl ::capnp::traits::Pipelined for Owned { type Pipeline = Pipeline; }
pub struct Reader<'a> { reader: ::capnp::private::layout::StructReader<'a> }
impl <> ::core::marker::Copy for Reader<'_,> {}
impl <> ::core::clone::Clone for Reader<'_,> {
fn clone(&self) -> Self { *self }
}
impl <> ::capnp::traits::HasTypeId for Reader<'_,> {
const TYPE_ID: u64 = _private::TYPE_ID;
}
impl <'a,> ::core::convert::From<::capnp::private::layout::StructReader<'a>> for Reader<'a,> {
fn from(reader: ::capnp::private::layout::StructReader<'a>) -> Self {
Self { reader, }
}
}
impl <'a,> ::core::convert::From<Reader<'a,>> for ::capnp::dynamic_value::Reader<'a> {
fn from(reader: Reader<'a,>) -> Self {
Self::Struct(::capnp::dynamic_struct::Reader::new(reader.reader, ::capnp::schema::StructSchema::new(::capnp::introspect::RawBrandedStructSchema { generic: &_private::RAW_SCHEMA, field_types: _private::get_field_types::<>, annotation_types: _private::get_annotation_types::<>})))
}
}
impl <> ::core::fmt::Debug for Reader<'_,> {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::result::Result<(), ::core::fmt::Error> {
core::fmt::Debug::fmt(&::core::convert::Into::<::capnp::dynamic_value::Reader<'_>>::into(*self), f)
}
}
impl <'a,> ::capnp::traits::FromPointerReader<'a> for Reader<'a,> {
fn get_from_pointer(reader: &::capnp::private::layout::PointerReader<'a>, default: ::core::option::Option<&'a [::capnp::Word]>) -> ::capnp::Result<Self> {
::core::result::Result::Ok(reader.get_struct(default)?.into())
}
}
impl <'a,> ::capnp::traits::IntoInternalStructReader<'a> for Reader<'a,> {
fn into_internal_struct_reader(self) -> ::capnp::private::layout::StructReader<'a> {
self.reader
}
}
impl <'a,> ::capnp::traits::Imbue<'a> for Reader<'a,> {
fn imbue(&mut self, cap_table: &'a ::capnp::private::layout::CapTable) {
self.reader.imbue(::capnp::private::layout::CapTableReader::Plain(cap_table))
}
}
impl <> Reader<'_,> {
pub fn reborrow(&self) -> Reader<'_,> {
Self { .. *self }
}
pub fn total_size(&self) -> ::capnp::Result<::capnp::MessageSize> {
self.reader.total_size()
}
#[inline]
pub fn get_grib2_cache_entries(self) -> u64 {
self.reader.get_data_field::<u64>(0)
}
#[inline]
pub fn get_nexrad_cache_entries(self) -> u64 {
self.reader.get_data_field::<u64>(1)
}
}
pub struct Builder<'a> { builder: ::capnp::private::layout::StructBuilder<'a> }
impl <> ::capnp::traits::HasStructSize for Builder<'_,> {
const STRUCT_SIZE: ::capnp::private::layout::StructSize = ::capnp::private::layout::StructSize { data: 2, pointers: 0 };
}
impl <> ::capnp::traits::HasTypeId for Builder<'_,> {
const TYPE_ID: u64 = _private::TYPE_ID;
}
impl <'a,> ::core::convert::From<::capnp::private::layout::StructBuilder<'a>> for Builder<'a,> {
fn from(builder: ::capnp::private::layout::StructBuilder<'a>) -> Self {
Self { builder, }
}
}
impl <'a,> ::core::convert::From<Builder<'a,>> for ::capnp::dynamic_value::Builder<'a> {
fn from(builder: Builder<'a,>) -> Self {
Self::Struct(::capnp::dynamic_struct::Builder::new(builder.builder, ::capnp::schema::StructSchema::new(::capnp::introspect::RawBrandedStructSchema { generic: &_private::RAW_SCHEMA, field_types: _private::get_field_types::<>, annotation_types: _private::get_annotation_types::<>})))
}
}
impl <'a,> ::capnp::traits::ImbueMut<'a> for Builder<'a,> {
fn imbue_mut(&mut self, cap_table: &'a mut ::capnp::private::layout::CapTable) {
self.builder.imbue(::capnp::private::layout::CapTableBuilder::Plain(cap_table))
}
}
impl <'a,> ::capnp::traits::FromPointerBuilder<'a> for Builder<'a,> {
fn init_pointer(builder: ::capnp::private::layout::PointerBuilder<'a>, _size: u32) -> Self {
builder.init_struct(<Self as ::capnp::traits::HasStructSize>::STRUCT_SIZE).into()
}
fn get_from_pointer(builder: ::capnp::private::layout::PointerBuilder<'a>, default: ::core::option::Option<&'a [::capnp::Word]>) -> ::capnp::Result<Self> {
::core::result::Result::Ok(builder.get_struct(<Self as ::capnp::traits::HasStructSize>::STRUCT_SIZE, default)?.into())
}
}
impl <> ::capnp::traits::SetterInput<Owned<>> for Reader<'_,> {
fn set_pointer_builder(mut pointer: ::capnp::private::layout::PointerBuilder<'_>, value: Self, canonicalize: bool) -> ::capnp::Result<()> { pointer.set_struct(&value.reader, canonicalize) }
}
impl <'a,> Builder<'a,> {
pub fn into_reader(self) -> Reader<'a,> {
self.builder.into_reader().into()
}
pub fn reborrow(&mut self) -> Builder<'_,> {
Builder { builder: self.builder.reborrow() }
}
pub fn reborrow_as_reader(&self) -> Reader<'_,> {
self.builder.as_reader().into()
}
pub fn total_size(&self) -> ::capnp::Result<::capnp::MessageSize> {
self.builder.as_reader().total_size()
}
#[inline]
pub fn get_grib2_cache_entries(self) -> u64 {
self.builder.get_data_field::<u64>(0)
}
#[inline]
pub fn set_grib2_cache_entries(&mut self, value: u64) {
self.builder.set_data_field::<u64>(0, value);
}
#[inline]
pub fn get_nexrad_cache_entries(self) -> u64 {
self.builder.get_data_field::<u64>(1)
}
#[inline]
pub fn set_nexrad_cache_entries(&mut self, value: u64) {
self.builder.set_data_field::<u64>(1, value);
}
}
pub struct Pipeline { _typeless: ::capnp::any_pointer::Pipeline }
impl ::capnp::capability::FromTypelessPipeline for Pipeline {
fn new(typeless: ::capnp::any_pointer::Pipeline) -> Self {
Self { _typeless: typeless, }
}
}
impl Pipeline {
}
mod _private {
pub static ENCODED_NODE: [::capnp::Word; 54] = [
::capnp::word(0, 0, 0, 0, 6, 0, 6, 0),
::capnp::word(134, 113, 226, 152, 133, 252, 175, 149),
::capnp::word(24, 0, 0, 0, 1, 0, 2, 0),
::capnp::word(15, 230, 2, 66, 248, 151, 54, 165),
::capnp::word(0, 0, 7, 0, 0, 0, 0, 0),
::capnp::word(0, 0, 0, 0, 0, 0, 0, 0),
::capnp::word(81, 0, 0, 0, 170, 0, 0, 0),
::capnp::word(21, 0, 0, 0, 18, 1, 0, 0),
::capnp::word(37, 0, 0, 0, 7, 0, 0, 0),
::capnp::word(0, 0, 0, 0, 0, 0, 0, 0),
::capnp::word(33, 0, 0, 0, 119, 0, 0, 0),
::capnp::word(0, 0, 0, 0, 0, 0, 0, 0),
::capnp::word(0, 0, 0, 0, 0, 0, 0, 0),
::capnp::word(116, 105, 108, 101, 114, 83, 116, 97),
::capnp::word(116, 117, 115, 82, 101, 112, 111, 114),
::capnp::word(116, 46, 99, 97, 112, 110, 112, 58),
::capnp::word(67, 97, 99, 104, 101, 73, 110, 102),
::capnp::word(111, 0, 0, 0, 0, 0, 0, 0),
::capnp::word(0, 0, 0, 0, 1, 0, 1, 0),
::capnp::word(8, 0, 0, 0, 3, 0, 4, 0),
::capnp::word(0, 0, 0, 0, 0, 0, 0, 0),
::capnp::word(0, 0, 1, 0, 0, 0, 0, 0),
::capnp::word(0, 0, 0, 0, 0, 0, 0, 0),
::capnp::word(41, 0, 0, 0, 146, 0, 0, 0),
::capnp::word(0, 0, 0, 0, 0, 0, 0, 0),
::capnp::word(44, 0, 0, 0, 3, 0, 1, 0),
::capnp::word(56, 0, 0, 0, 2, 0, 1, 0),
::capnp::word(1, 0, 0, 0, 1, 0, 0, 0),
::capnp::word(0, 0, 1, 0, 1, 0, 0, 0),
::capnp::word(0, 0, 0, 0, 0, 0, 0, 0),
::capnp::word(53, 0, 0, 0, 154, 0, 0, 0),
::capnp::word(0, 0, 0, 0, 0, 0, 0, 0),
::capnp::word(56, 0, 0, 0, 3, 0, 1, 0),
::capnp::word(68, 0, 0, 0, 2, 0, 1, 0),
::capnp::word(103, 114, 105, 98, 50, 67, 97, 99),
::capnp::word(104, 101, 69, 110, 116, 114, 105, 101),
::capnp::word(115, 0, 0, 0, 0, 0, 0, 0),
::capnp::word(9, 0, 0, 0, 0, 0, 0, 0),
::capnp::word(0, 0, 0, 0, 0, 0, 0, 0),
::capnp::word(0, 0, 0, 0, 0, 0, 0, 0),
::capnp::word(0, 0, 0, 0, 0, 0, 0, 0),
::capnp::word(9, 0, 0, 0, 0, 0, 0, 0),
::capnp::word(0, 0, 0, 0, 0, 0, 0, 0),
::capnp::word(0, 0, 0, 0, 0, 0, 0, 0),
::capnp::word(110, 101, 120, 114, 97, 100, 67, 97),
::capnp::word(99, 104, 101, 69, 110, 116, 114, 105),
::capnp::word(101, 115, 0, 0, 0, 0, 0, 0),
::capnp::word(9, 0, 0, 0, 0, 0, 0, 0),
::capnp::word(0, 0, 0, 0, 0, 0, 0, 0),
::capnp::word(0, 0, 0, 0, 0, 0, 0, 0),
::capnp::word(0, 0, 0, 0, 0, 0, 0, 0),
::capnp::word(9, 0, 0, 0, 0, 0, 0, 0),
::capnp::word(0, 0, 0, 0, 0, 0, 0, 0),
::capnp::word(0, 0, 0, 0, 0, 0, 0, 0),
];
pub fn get_field_types(index: u16) -> ::capnp::introspect::Type {
match index {
0 => <u64 as ::capnp::introspect::Introspect>::introspect(),
1 => <u64 as ::capnp::introspect::Introspect>::introspect(),
_ => panic!("invalid field index {}", index),
}
}
pub fn get_annotation_types(child_index: Option<u16>, index: u32) -> ::capnp::introspect::Type {
panic!("invalid annotation indices ({:?}, {}) ", child_index, index)
}
pub static RAW_SCHEMA: ::capnp::introspect::RawStructSchema = ::capnp::introspect::RawStructSchema {
encoded_node: &ENCODED_NODE,
nonunion_members: NONUNION_MEMBERS,
members_by_discriminant: MEMBERS_BY_DISCRIMINANT,
members_by_name: MEMBERS_BY_NAME,
};
pub static NONUNION_MEMBERS : &[u16] = &[0,1];
pub static MEMBERS_BY_DISCRIMINANT : &[u16] = &[];
pub static MEMBERS_BY_NAME : &[u16] = &[0,1];
pub const TYPE_ID: u64 = 0x95af_fc85_98e2_7186;
}
}

View file

@ -46,4 +46,4 @@ wxbox-common = { path = "../common" }
chrono = "0.4"
quick-xml = { version = "0.37", features = ["serialize"] }
rmp-serde = { version = "1" }
wxbox-interchange = { path = "../interchange" }

View file

@ -126,79 +126,7 @@ pub async fn nexrad_data_handler(
state.nexrad_data_cache.get(&data_id).await.unwrap()
};
let filtered_scan = Scan {
coverage_pattern_number: data.coverage_pattern_number,
sweeps: data
.sweeps
.iter()
.filter_map(|u| {
if u.elevation_number != sweep {
None
} else {
Some(Sweep {
elevation_number: u.elevation_number,
radials: u
.radials
.iter()
.filter_map(|u| {
Some(Radial {
collection_timestamp: u.collection_timestamp,
azimuth_number: u.azimuth_number,
azimuth_angle_degrees: u.azimuth_angle_degrees,
azimuth_spacing_degrees: u.azimuth_spacing_degrees,
radial_status: u.radial_status,
elevation_number: u.elevation_number,
elevation_number_degrees: u.elevation_number_degrees,
reflectivity: if product == "REF" {
u.reflectivity.clone()
} else {
None
},
velocity: if product == "VEL" {
u.velocity.clone()
} else {
None
},
spectrum_width: if product == "SW" {
u.spectrum_width.clone()
} else {
None
},
differential_reflectivity: if product == "ZDR" {
u.differential_reflectivity.clone()
} else {
None
},
differential_phase: if product == "PHI" {
u.differential_phase.clone()
} else {
None
},
correlation_coefficient: if product == "RHO" {
u.correlation_coefficient.clone()
} else {
None
},
specific_differential_phase: if product == "CFP" {
u.specific_differential_phase.clone()
} else {
None
},
})
})
.collect(),
})
}
})
.collect(),
};
let data_bytes = rmp_serde::to_vec(data.as_ref())?;
Ok((
[(header::CONTENT_TYPE, "application/x-msgpack")],
data_bytes,
))
todo!()
}
async fn load_nexrad_data(