cif v2
This commit is contained in:
parent
d7c84d60e8
commit
aa172be1ef
21 changed files with 894 additions and 2515 deletions
113
Cargo.lock
generated
113
Cargo.lock
generated
|
@ -356,24 +356,6 @@ 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"
|
||||
|
@ -633,12 +615,6 @@ 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"
|
||||
|
@ -738,6 +714,12 @@ dependencies = [
|
|||
"simd-adler32",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "fixedbitset"
|
||||
version = "0.5.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1d674e81391d1e1ab681a28d99df07927c6d4aa5b027d7da16ba32d1d21ecd99"
|
||||
|
||||
[[package]]
|
||||
name = "flate2"
|
||||
version = "1.1.0"
|
||||
|
@ -1554,6 +1536,12 @@ dependencies = [
|
|||
"uuid",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "multimap"
|
||||
version = "0.10.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1d87ecb2933e8aeadb3e3a02b828fed80a7528047e68b4f424523a0981a3a084"
|
||||
|
||||
[[package]]
|
||||
name = "native-tls"
|
||||
version = "0.2.14"
|
||||
|
@ -1820,6 +1808,16 @@ version = "2.3.1"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e"
|
||||
|
||||
[[package]]
|
||||
name = "petgraph"
|
||||
version = "0.7.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3672b37090dbd86368a4145bc067582552b29c27377cad4e0a306c97f9bd7772"
|
||||
dependencies = [
|
||||
"fixedbitset",
|
||||
"indexmap",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pin-project-lite"
|
||||
version = "0.2.16"
|
||||
|
@ -1903,6 +1901,16 @@ dependencies = [
|
|||
"zerocopy",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "prettyplease"
|
||||
version = "0.2.32"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "664ec5419c51e34154eec046ebcba56312d5a2fc3b09a06da188e1ad21afadf6"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "proc-macro2"
|
||||
version = "1.0.94"
|
||||
|
@ -1931,6 +1939,58 @@ dependencies = [
|
|||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "prost"
|
||||
version = "0.13.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2796faa41db3ec313a31f7624d9286acf277b52de526150b7e69f3debf891ee5"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"prost-derive",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "prost-build"
|
||||
version = "0.13.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "be769465445e8c1474e9c5dac2018218498557af32d9ed057325ec9a41ae81bf"
|
||||
dependencies = [
|
||||
"heck",
|
||||
"itertools 0.12.1",
|
||||
"log",
|
||||
"multimap",
|
||||
"once_cell",
|
||||
"petgraph",
|
||||
"prettyplease",
|
||||
"prost",
|
||||
"prost-types",
|
||||
"regex",
|
||||
"syn",
|
||||
"tempfile",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "prost-derive"
|
||||
version = "0.13.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8a56d757972c98b346a9b766e3f02746cde6dd1cd1d1d563472929fdd74bec4d"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"itertools 0.12.1",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "prost-types"
|
||||
version = "0.13.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "52c2c1bf36ddb1a1c396b3601a3cec27c2462e45f07c386894ec3ccf5332bd16"
|
||||
dependencies = [
|
||||
"prost",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "qoi"
|
||||
version = "0.4.1"
|
||||
|
@ -3628,9 +3688,10 @@ dependencies = [
|
|||
name = "wxbox-interchange"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"capnp",
|
||||
"capnpc",
|
||||
"nexrad-decode",
|
||||
"prost",
|
||||
"prost-build",
|
||||
"prost-types",
|
||||
"wxbox-ar2",
|
||||
]
|
||||
|
||||
|
|
|
@ -8,10 +8,12 @@
|
|||
"@turf/turf": "^7.2.0",
|
||||
"@types/geojson": "^7946.0.16",
|
||||
"maplibre-gl": "^5.5.0",
|
||||
"ts-protoc-gen": "^0.15.0",
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/compat": "^1.2.5",
|
||||
"@eslint/js": "^9.18.0",
|
||||
"@protobuf-ts/plugin": "^2.10.0",
|
||||
"@sveltejs/adapter-auto": "^6.0.0",
|
||||
"@sveltejs/kit": "^2.16.0",
|
||||
"@sveltejs/vite-plugin-svelte": "^5.0.0",
|
||||
|
@ -170,6 +172,16 @@
|
|||
|
||||
"@polka/url": ["@polka/url@1.0.0-next.29", "", {}, "sha512-wwQAWhWSuHaag8c4q/KN/vCoeOJYshAIvMQwD4GpSb3OiZklFfvAgmj0VCBBImRpuF/aFgIRzllXlVX93Jevww=="],
|
||||
|
||||
"@protobuf-ts/plugin": ["@protobuf-ts/plugin@2.10.0", "", { "dependencies": { "@protobuf-ts/plugin-framework": "^2.10.0", "@protobuf-ts/protoc": "^2.10.0", "@protobuf-ts/runtime": "^2.10.0", "@protobuf-ts/runtime-rpc": "^2.10.0", "typescript": "^3.9" }, "bin": { "protoc-gen-ts": "bin/protoc-gen-ts", "protoc-gen-dump": "bin/protoc-gen-dump" } }, "sha512-iMX4C4TVfMNRLn2msK0cVg5jmizjtu5FYiy8EK5Lg6EgyR9TVHeK2rzmufWKYM2Pcg1jSwC0cFcXHQnCoeFxUg=="],
|
||||
|
||||
"@protobuf-ts/plugin-framework": ["@protobuf-ts/plugin-framework@2.10.0", "", { "dependencies": { "@protobuf-ts/runtime": "^2.10.0", "typescript": "^3.9" } }, "sha512-EuW9irbt+w7Ml1CaAxK6xyl7pSuWVbNy0rsChxJEthMrAVTN5EPdJ3whNWvsRBa+HwRImEl8KHNnRoq/vGOHbg=="],
|
||||
|
||||
"@protobuf-ts/protoc": ["@protobuf-ts/protoc@2.10.0", "", { "bin": { "protoc": "protoc.js" } }, "sha512-S4BtGBh22+uL5E6qLVxV0QNY6tiLVB8QL7RIkvo+KYknipZfSNwubdKy5CPkrwVXzJn4s3cx7bKx1w6BxkBIPg=="],
|
||||
|
||||
"@protobuf-ts/runtime": ["@protobuf-ts/runtime@2.10.0", "", {}, "sha512-ypYwGg9Pn3W/2lZ7/HW60hONGuSdzphvOY8Dq7LeNttymDe0y3LaTUUMRpuGqOT6FfrWEMnfQbyqU8AAreo8wA=="],
|
||||
|
||||
"@protobuf-ts/runtime-rpc": ["@protobuf-ts/runtime-rpc@2.10.0", "", { "dependencies": { "@protobuf-ts/runtime": "^2.10.0" } }, "sha512-8CS/XPv3+pMK4v8UKhtCdvbS4h9l7aqlteKdRt0/UbIKZ8n0qHj6hX8cBhz2ngvohxCOS0N08zPr9aCLBNhW3Q=="],
|
||||
|
||||
"@rollup/rollup-android-arm-eabi": ["@rollup/rollup-android-arm-eabi@4.40.2", "", { "os": "android", "cpu": "arm" }, "sha512-JkdNEq+DFxZfUwxvB58tHMHBHVgX23ew41g1OQinthJ+ryhdRk67O31S7sYw8u2lTjHUPFxwar07BBt1KHp/hg=="],
|
||||
|
||||
"@rollup/rollup-android-arm64": ["@rollup/rollup-android-arm64@4.40.2", "", { "os": "android", "cpu": "arm64" }, "sha512-13unNoZ8NzUmnndhPTkWPWbX3vtHodYmy+I9kuLxN+F+l+x3LdVF7UCu8TWVMt1POHLh6oDHhnOA04n8oJZhBw=="],
|
||||
|
@ -712,6 +724,8 @@
|
|||
|
||||
"globals": ["globals@16.1.0", "", {}, "sha512-aibexHNbb/jiUSObBgpHLj+sIuUmJnYcgXBlrfsiDZ9rt4aF2TFRbyLgZ2iFQuVZ1K5Mx3FVkbKRSgKrbK3K2g=="],
|
||||
|
||||
"google-protobuf": ["google-protobuf@3.21.4", "", {}, "sha512-MnG7N936zcKTco4Jd2PX2U96Kf9PxygAPKBug+74LHzmHXmceN16MmRcdgZv+DGef/S9YvQAfRsNCn4cjf9yyQ=="],
|
||||
|
||||
"gopd": ["gopd@1.2.0", "", {}, "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg=="],
|
||||
|
||||
"graceful-fs": ["graceful-fs@4.2.11", "", {}, "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ=="],
|
||||
|
@ -1044,6 +1058,8 @@
|
|||
|
||||
"ts-api-utils": ["ts-api-utils@2.1.0", "", { "peerDependencies": { "typescript": ">=4.8.4" } }, "sha512-CUgTZL1irw8u29bzrOD/nH85jqyc74D6SshFgujOIA7osm2Rz7dYH77agkx7H4FBNxDq7Cjf+IjaX/8zwFW+ZQ=="],
|
||||
|
||||
"ts-protoc-gen": ["ts-protoc-gen@0.15.0", "", { "dependencies": { "google-protobuf": "^3.15.5" }, "bin": { "protoc-gen-ts": "bin/protoc-gen-ts" } }, "sha512-TycnzEyrdVDlATJ3bWFTtra3SCiEP0W0vySXReAuEygXCUr1j2uaVyL0DhzjwuUdQoW5oXPwk6oZWeA0955V+g=="],
|
||||
|
||||
"tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="],
|
||||
|
||||
"type-check": ["type-check@0.4.0", "", { "dependencies": { "prelude-ls": "^1.2.1" } }, "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew=="],
|
||||
|
@ -1094,6 +1110,10 @@
|
|||
|
||||
"@humanfs/node/@humanwhocodes/retry": ["@humanwhocodes/retry@0.3.1", "", {}, "sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA=="],
|
||||
|
||||
"@protobuf-ts/plugin/typescript": ["typescript@3.9.10", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q=="],
|
||||
|
||||
"@protobuf-ts/plugin-framework/typescript": ["typescript@3.9.10", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q=="],
|
||||
|
||||
"@tailwindcss/oxide-wasm32-wasi/@emnapi/core": ["@emnapi/core@1.4.3", "", { "dependencies": { "@emnapi/wasi-threads": "1.0.2", "tslib": "^2.4.0" }, "bundled": true }, "sha512-4m62DuCE07lw01soJwPiBGC0nAww0Q+RY70VZ+n49yDIO13yyinhbWCeNnaob0lakDtWQzSdtNWzJeOJt2ma+g=="],
|
||||
|
||||
"@tailwindcss/oxide-wasm32-wasi/@emnapi/runtime": ["@emnapi/runtime@1.4.3", "", { "dependencies": { "tslib": "^2.4.0" }, "bundled": true }, "sha512-pBPWdu6MLKROBX05wSNKcNb++m5Er+KQ9QkB+WVM+pW2Kx9hoSrVTnu3BdkI5eBLZoKu/J6mW/B6i6bJB2ytXQ=="],
|
||||
|
|
|
@ -11,11 +11,13 @@
|
|||
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
||||
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
||||
"format": "prettier --write .",
|
||||
"lint": "prettier --check . && eslint ."
|
||||
"lint": "prettier --check . && eslint .",
|
||||
"protobuf:update": "protoc --ts_out src/lib/generated_interop --proto_path ../crates/interchange/src/ ../crates/interchange/src/*.proto"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/compat": "^1.2.5",
|
||||
"@eslint/js": "^9.18.0",
|
||||
"@protobuf-ts/plugin": "^2.10.0",
|
||||
"@sveltejs/adapter-auto": "^6.0.0",
|
||||
"@sveltejs/kit": "^2.16.0",
|
||||
"@sveltejs/vite-plugin-svelte": "^5.0.0",
|
||||
|
@ -47,6 +49,7 @@
|
|||
"@lucide/svelte": "^0.510.0",
|
||||
"@turf/turf": "^7.2.0",
|
||||
"@types/geojson": "^7946.0.16",
|
||||
"maplibre-gl": "^5.5.0"
|
||||
"maplibre-gl": "^5.5.0",
|
||||
"ts-protoc-gen": "^0.15.0"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
import CloudAlertIcon from "@lucide/svelte/icons/cloud-alert";
|
||||
import {borderLUT, fillLUT} from "$lib/alertLayer";
|
||||
import AlertPopup from "$lib/AlertPopup.svelte";
|
||||
import {CifContainer} from "$lib/generated_interop/cifContainer";
|
||||
|
||||
interface Props {
|
||||
categories: LayerList;
|
||||
|
@ -142,11 +143,19 @@
|
|||
map.getCanvas().style.cursor = '';
|
||||
popup.remove();
|
||||
});
|
||||
(async () => {
|
||||
let r = await fetch('http://localhost:3000/v2/nexrad/l2/KM/1/REF');
|
||||
const bytes = await r.bytes();
|
||||
const container = CifContainer.fromBinary(bytes);
|
||||
console.log('wxrad http://localhost:3000/v2/nexrad/l2/KRLX/1/REF: ', container);
|
||||
})();
|
||||
});
|
||||
map.on('error', (e) => {
|
||||
console.error(e);
|
||||
toast.error('Data loading failed!');
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
80
client/src/lib/generated_interop/cifContainer.ts
Normal file
80
client/src/lib/generated_interop/cifContainer.ts
Normal file
|
@ -0,0 +1,80 @@
|
|||
// @generated by protobuf-ts 2.10.0
|
||||
// @generated from protobuf file "cifContainer.proto" (package "cif", syntax proto3)
|
||||
// tslint:disable
|
||||
import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
|
||||
import type { IBinaryWriter } from "@protobuf-ts/runtime";
|
||||
import { WireType } from "@protobuf-ts/runtime";
|
||||
import type { BinaryReadOptions } from "@protobuf-ts/runtime";
|
||||
import type { IBinaryReader } from "@protobuf-ts/runtime";
|
||||
import { UnknownFieldHandler } from "@protobuf-ts/runtime";
|
||||
import type { PartialMessage } from "@protobuf-ts/runtime";
|
||||
import { reflectionMergePartial } from "@protobuf-ts/runtime";
|
||||
import { MessageType } from "@protobuf-ts/runtime";
|
||||
import { DigitalRadarData } from "./digitalRadarData";
|
||||
/**
|
||||
* @generated from protobuf message cif.CifContainer
|
||||
*/
|
||||
export interface CifContainer {
|
||||
/**
|
||||
* @generated from protobuf oneof: message_type
|
||||
*/
|
||||
messageType: {
|
||||
oneofKind: "digitalRadarData";
|
||||
/**
|
||||
* @generated from protobuf field: cif.digitalRadarData.DigitalRadarData digitalRadarData = 1;
|
||||
*/
|
||||
digitalRadarData: DigitalRadarData;
|
||||
} | {
|
||||
oneofKind: undefined;
|
||||
};
|
||||
}
|
||||
// @generated message type with reflection information, may provide speed optimized methods
|
||||
class CifContainer$Type extends MessageType<CifContainer> {
|
||||
constructor() {
|
||||
super("cif.CifContainer", [
|
||||
{ no: 1, name: "digitalRadarData", kind: "message", oneof: "messageType", T: () => DigitalRadarData }
|
||||
]);
|
||||
}
|
||||
create(value?: PartialMessage<CifContainer>): CifContainer {
|
||||
const message = globalThis.Object.create((this.messagePrototype!));
|
||||
message.messageType = { oneofKind: undefined };
|
||||
if (value !== undefined)
|
||||
reflectionMergePartial<CifContainer>(this, message, value);
|
||||
return message;
|
||||
}
|
||||
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CifContainer): CifContainer {
|
||||
let message = target ?? this.create(), end = reader.pos + length;
|
||||
while (reader.pos < end) {
|
||||
let [fieldNo, wireType] = reader.tag();
|
||||
switch (fieldNo) {
|
||||
case /* cif.digitalRadarData.DigitalRadarData digitalRadarData */ 1:
|
||||
message.messageType = {
|
||||
oneofKind: "digitalRadarData",
|
||||
digitalRadarData: DigitalRadarData.internalBinaryRead(reader, reader.uint32(), options, (message.messageType as any).digitalRadarData)
|
||||
};
|
||||
break;
|
||||
default:
|
||||
let u = options.readUnknownField;
|
||||
if (u === "throw")
|
||||
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
||||
let d = reader.skip(wireType);
|
||||
if (u !== false)
|
||||
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
internalBinaryWrite(message: CifContainer, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
||||
/* cif.digitalRadarData.DigitalRadarData digitalRadarData = 1; */
|
||||
if (message.messageType.oneofKind === "digitalRadarData")
|
||||
DigitalRadarData.internalBinaryWrite(message.messageType.digitalRadarData, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
|
||||
let u = options.writeUnknownFields;
|
||||
if (u !== false)
|
||||
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
||||
return writer;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @generated MessageType for protobuf message cif.CifContainer
|
||||
*/
|
||||
export const CifContainer = new CifContainer$Type();
|
498
client/src/lib/generated_interop/digitalRadarData.ts
Normal file
498
client/src/lib/generated_interop/digitalRadarData.ts
Normal file
|
@ -0,0 +1,498 @@
|
|||
// @generated by protobuf-ts 2.10.0
|
||||
// @generated from protobuf file "digitalRadarData.proto" (package "cif.digitalRadarData", syntax proto3)
|
||||
// tslint:disable
|
||||
import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
|
||||
import type { IBinaryWriter } from "@protobuf-ts/runtime";
|
||||
import { WireType } from "@protobuf-ts/runtime";
|
||||
import type { BinaryReadOptions } from "@protobuf-ts/runtime";
|
||||
import type { IBinaryReader } from "@protobuf-ts/runtime";
|
||||
import { UnknownFieldHandler } from "@protobuf-ts/runtime";
|
||||
import type { PartialMessage } from "@protobuf-ts/runtime";
|
||||
import { reflectionMergePartial } from "@protobuf-ts/runtime";
|
||||
import { MessageType } from "@protobuf-ts/runtime";
|
||||
/**
|
||||
* @generated from protobuf message cif.digitalRadarData.DigitalRadarData
|
||||
*/
|
||||
export interface DigitalRadarData {
|
||||
/**
|
||||
* @generated from protobuf field: int32 vcpNumber = 1;
|
||||
*/
|
||||
vcpNumber: number;
|
||||
/**
|
||||
* @generated from protobuf field: int32 elevationNumber = 2;
|
||||
*/
|
||||
elevationNumber: number;
|
||||
/**
|
||||
* @generated from protobuf field: repeated cif.digitalRadarData.Radial radials = 3;
|
||||
*/
|
||||
radials: Radial[];
|
||||
}
|
||||
/**
|
||||
* @generated from protobuf message cif.digitalRadarData.Radial
|
||||
*/
|
||||
export interface Radial {
|
||||
/**
|
||||
* @generated from protobuf field: fixed64 collectionTimestamp = 1;
|
||||
*/
|
||||
collectionTimestamp: bigint;
|
||||
/**
|
||||
* @generated from protobuf field: int32 azimuthNumber = 2;
|
||||
*/
|
||||
azimuthNumber: number;
|
||||
/**
|
||||
* @generated from protobuf field: float azimuthAngleDegrees = 3;
|
||||
*/
|
||||
azimuthAngleDegrees: number;
|
||||
/**
|
||||
* @generated from protobuf field: float azimuthSpacingDegrees = 4;
|
||||
*/
|
||||
azimuthSpacingDegrees: number;
|
||||
/**
|
||||
* @generated from protobuf field: cif.digitalRadarData.RadialStatus radialStatus = 5;
|
||||
*/
|
||||
radialStatus: RadialStatus;
|
||||
/**
|
||||
* @generated from protobuf field: int32 elevationNumber = 6;
|
||||
*/
|
||||
elevationNumber: number;
|
||||
/**
|
||||
* @generated from protobuf field: float elevationDegrees = 7;
|
||||
*/
|
||||
elevationDegrees: number;
|
||||
/**
|
||||
* @generated from protobuf field: cif.digitalRadarData.MomentaryProduct product = 8;
|
||||
*/
|
||||
product?: MomentaryProduct;
|
||||
}
|
||||
/**
|
||||
* @generated from protobuf message cif.digitalRadarData.MomentaryProduct
|
||||
*/
|
||||
export interface MomentaryProduct {
|
||||
/**
|
||||
* @generated from protobuf field: cif.digitalRadarData.MomentaryMeta productMetadata = 1;
|
||||
*/
|
||||
productMetadata?: MomentaryMeta;
|
||||
/**
|
||||
* @generated from protobuf field: cif.digitalRadarData.MomentaryData data = 2;
|
||||
*/
|
||||
data?: MomentaryData;
|
||||
}
|
||||
/**
|
||||
* @generated from protobuf message cif.digitalRadarData.MomentaryMeta
|
||||
*/
|
||||
export interface MomentaryMeta {
|
||||
/**
|
||||
* @generated from protobuf field: string productName = 1;
|
||||
*/
|
||||
productName: string;
|
||||
}
|
||||
/**
|
||||
* @generated from protobuf message cif.digitalRadarData.MomentaryData
|
||||
*/
|
||||
export interface MomentaryData {
|
||||
/**
|
||||
* @generated from protobuf field: float scale = 1;
|
||||
*/
|
||||
scale: number;
|
||||
/**
|
||||
* @generated from protobuf field: float offset = 2;
|
||||
*/
|
||||
offset: number;
|
||||
/**
|
||||
* @generated from protobuf field: int32 startRange = 3;
|
||||
*/
|
||||
startRange: number;
|
||||
/**
|
||||
* @generated from protobuf field: int32 sampleInterval = 4;
|
||||
*/
|
||||
sampleInterval: number;
|
||||
/**
|
||||
* @generated from protobuf field: repeated int32 data = 5;
|
||||
*/
|
||||
data: number[];
|
||||
}
|
||||
/**
|
||||
* @generated from protobuf enum cif.digitalRadarData.RadialStatus
|
||||
*/
|
||||
export enum RadialStatus {
|
||||
/**
|
||||
* @generated from protobuf enum value: RADIAL_STATUS_UNKNOWN = 0;
|
||||
*/
|
||||
UNKNOWN = 0,
|
||||
/**
|
||||
* @generated from protobuf enum value: RADIAL_STATUS_ELEVATION_START = 1;
|
||||
*/
|
||||
ELEVATION_START = 1,
|
||||
/**
|
||||
* @generated from protobuf enum value: RADIAL_STATUS_INTERMEDIATE_RADIAL_DATA = 2;
|
||||
*/
|
||||
INTERMEDIATE_RADIAL_DATA = 2,
|
||||
/**
|
||||
* @generated from protobuf enum value: RADIAL_STATUS_ELEVATION_END = 3;
|
||||
*/
|
||||
ELEVATION_END = 3,
|
||||
/**
|
||||
* @generated from protobuf enum value: RADIAL_STATUS_VOLUME_SCAN_START = 4;
|
||||
*/
|
||||
VOLUME_SCAN_START = 4,
|
||||
/**
|
||||
* @generated from protobuf enum value: RADIAL_STATUS_VOLUME_SCAN_END = 5;
|
||||
*/
|
||||
VOLUME_SCAN_END = 5,
|
||||
/**
|
||||
* @generated from protobuf enum value: RADIAL_STATUS_ELEVATION_START_VCP_FINAL = 6;
|
||||
*/
|
||||
ELEVATION_START_VCP_FINAL = 6
|
||||
}
|
||||
// @generated message type with reflection information, may provide speed optimized methods
|
||||
class DigitalRadarData$Type extends MessageType<DigitalRadarData> {
|
||||
constructor() {
|
||||
super("cif.digitalRadarData.DigitalRadarData", [
|
||||
{ no: 1, name: "vcpNumber", kind: "scalar", T: 5 /*ScalarType.INT32*/ },
|
||||
{ no: 2, name: "elevationNumber", kind: "scalar", T: 5 /*ScalarType.INT32*/ },
|
||||
{ no: 3, name: "radials", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => Radial }
|
||||
]);
|
||||
}
|
||||
create(value?: PartialMessage<DigitalRadarData>): DigitalRadarData {
|
||||
const message = globalThis.Object.create((this.messagePrototype!));
|
||||
message.vcpNumber = 0;
|
||||
message.elevationNumber = 0;
|
||||
message.radials = [];
|
||||
if (value !== undefined)
|
||||
reflectionMergePartial<DigitalRadarData>(this, message, value);
|
||||
return message;
|
||||
}
|
||||
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DigitalRadarData): DigitalRadarData {
|
||||
let message = target ?? this.create(), end = reader.pos + length;
|
||||
while (reader.pos < end) {
|
||||
let [fieldNo, wireType] = reader.tag();
|
||||
switch (fieldNo) {
|
||||
case /* int32 vcpNumber */ 1:
|
||||
message.vcpNumber = reader.int32();
|
||||
break;
|
||||
case /* int32 elevationNumber */ 2:
|
||||
message.elevationNumber = reader.int32();
|
||||
break;
|
||||
case /* repeated cif.digitalRadarData.Radial radials */ 3:
|
||||
message.radials.push(Radial.internalBinaryRead(reader, reader.uint32(), options));
|
||||
break;
|
||||
default:
|
||||
let u = options.readUnknownField;
|
||||
if (u === "throw")
|
||||
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
||||
let d = reader.skip(wireType);
|
||||
if (u !== false)
|
||||
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
internalBinaryWrite(message: DigitalRadarData, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
||||
/* int32 vcpNumber = 1; */
|
||||
if (message.vcpNumber !== 0)
|
||||
writer.tag(1, WireType.Varint).int32(message.vcpNumber);
|
||||
/* int32 elevationNumber = 2; */
|
||||
if (message.elevationNumber !== 0)
|
||||
writer.tag(2, WireType.Varint).int32(message.elevationNumber);
|
||||
/* repeated cif.digitalRadarData.Radial radials = 3; */
|
||||
for (let i = 0; i < message.radials.length; i++)
|
||||
Radial.internalBinaryWrite(message.radials[i], writer.tag(3, WireType.LengthDelimited).fork(), options).join();
|
||||
let u = options.writeUnknownFields;
|
||||
if (u !== false)
|
||||
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
||||
return writer;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @generated MessageType for protobuf message cif.digitalRadarData.DigitalRadarData
|
||||
*/
|
||||
export const DigitalRadarData = new DigitalRadarData$Type();
|
||||
// @generated message type with reflection information, may provide speed optimized methods
|
||||
class Radial$Type extends MessageType<Radial> {
|
||||
constructor() {
|
||||
super("cif.digitalRadarData.Radial", [
|
||||
{ no: 1, name: "collectionTimestamp", kind: "scalar", T: 6 /*ScalarType.FIXED64*/, L: 0 /*LongType.BIGINT*/ },
|
||||
{ no: 2, name: "azimuthNumber", kind: "scalar", T: 5 /*ScalarType.INT32*/ },
|
||||
{ no: 3, name: "azimuthAngleDegrees", kind: "scalar", T: 2 /*ScalarType.FLOAT*/ },
|
||||
{ no: 4, name: "azimuthSpacingDegrees", kind: "scalar", T: 2 /*ScalarType.FLOAT*/ },
|
||||
{ no: 5, name: "radialStatus", kind: "enum", T: () => ["cif.digitalRadarData.RadialStatus", RadialStatus, "RADIAL_STATUS_"] },
|
||||
{ no: 6, name: "elevationNumber", kind: "scalar", T: 5 /*ScalarType.INT32*/ },
|
||||
{ no: 7, name: "elevationDegrees", kind: "scalar", T: 2 /*ScalarType.FLOAT*/ },
|
||||
{ no: 8, name: "product", kind: "message", T: () => MomentaryProduct }
|
||||
]);
|
||||
}
|
||||
create(value?: PartialMessage<Radial>): Radial {
|
||||
const message = globalThis.Object.create((this.messagePrototype!));
|
||||
message.collectionTimestamp = 0n;
|
||||
message.azimuthNumber = 0;
|
||||
message.azimuthAngleDegrees = 0;
|
||||
message.azimuthSpacingDegrees = 0;
|
||||
message.radialStatus = 0;
|
||||
message.elevationNumber = 0;
|
||||
message.elevationDegrees = 0;
|
||||
if (value !== undefined)
|
||||
reflectionMergePartial<Radial>(this, message, value);
|
||||
return message;
|
||||
}
|
||||
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Radial): Radial {
|
||||
let message = target ?? this.create(), end = reader.pos + length;
|
||||
while (reader.pos < end) {
|
||||
let [fieldNo, wireType] = reader.tag();
|
||||
switch (fieldNo) {
|
||||
case /* fixed64 collectionTimestamp */ 1:
|
||||
message.collectionTimestamp = reader.fixed64().toBigInt();
|
||||
break;
|
||||
case /* int32 azimuthNumber */ 2:
|
||||
message.azimuthNumber = reader.int32();
|
||||
break;
|
||||
case /* float azimuthAngleDegrees */ 3:
|
||||
message.azimuthAngleDegrees = reader.float();
|
||||
break;
|
||||
case /* float azimuthSpacingDegrees */ 4:
|
||||
message.azimuthSpacingDegrees = reader.float();
|
||||
break;
|
||||
case /* cif.digitalRadarData.RadialStatus radialStatus */ 5:
|
||||
message.radialStatus = reader.int32();
|
||||
break;
|
||||
case /* int32 elevationNumber */ 6:
|
||||
message.elevationNumber = reader.int32();
|
||||
break;
|
||||
case /* float elevationDegrees */ 7:
|
||||
message.elevationDegrees = reader.float();
|
||||
break;
|
||||
case /* cif.digitalRadarData.MomentaryProduct product */ 8:
|
||||
message.product = MomentaryProduct.internalBinaryRead(reader, reader.uint32(), options, message.product);
|
||||
break;
|
||||
default:
|
||||
let u = options.readUnknownField;
|
||||
if (u === "throw")
|
||||
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
||||
let d = reader.skip(wireType);
|
||||
if (u !== false)
|
||||
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
internalBinaryWrite(message: Radial, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
||||
/* fixed64 collectionTimestamp = 1; */
|
||||
if (message.collectionTimestamp !== 0n)
|
||||
writer.tag(1, WireType.Bit64).fixed64(message.collectionTimestamp);
|
||||
/* int32 azimuthNumber = 2; */
|
||||
if (message.azimuthNumber !== 0)
|
||||
writer.tag(2, WireType.Varint).int32(message.azimuthNumber);
|
||||
/* float azimuthAngleDegrees = 3; */
|
||||
if (message.azimuthAngleDegrees !== 0)
|
||||
writer.tag(3, WireType.Bit32).float(message.azimuthAngleDegrees);
|
||||
/* float azimuthSpacingDegrees = 4; */
|
||||
if (message.azimuthSpacingDegrees !== 0)
|
||||
writer.tag(4, WireType.Bit32).float(message.azimuthSpacingDegrees);
|
||||
/* cif.digitalRadarData.RadialStatus radialStatus = 5; */
|
||||
if (message.radialStatus !== 0)
|
||||
writer.tag(5, WireType.Varint).int32(message.radialStatus);
|
||||
/* int32 elevationNumber = 6; */
|
||||
if (message.elevationNumber !== 0)
|
||||
writer.tag(6, WireType.Varint).int32(message.elevationNumber);
|
||||
/* float elevationDegrees = 7; */
|
||||
if (message.elevationDegrees !== 0)
|
||||
writer.tag(7, WireType.Bit32).float(message.elevationDegrees);
|
||||
/* cif.digitalRadarData.MomentaryProduct product = 8; */
|
||||
if (message.product)
|
||||
MomentaryProduct.internalBinaryWrite(message.product, writer.tag(8, WireType.LengthDelimited).fork(), options).join();
|
||||
let u = options.writeUnknownFields;
|
||||
if (u !== false)
|
||||
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
||||
return writer;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @generated MessageType for protobuf message cif.digitalRadarData.Radial
|
||||
*/
|
||||
export const Radial = new Radial$Type();
|
||||
// @generated message type with reflection information, may provide speed optimized methods
|
||||
class MomentaryProduct$Type extends MessageType<MomentaryProduct> {
|
||||
constructor() {
|
||||
super("cif.digitalRadarData.MomentaryProduct", [
|
||||
{ no: 1, name: "productMetadata", kind: "message", T: () => MomentaryMeta },
|
||||
{ no: 2, name: "data", kind: "message", T: () => MomentaryData }
|
||||
]);
|
||||
}
|
||||
create(value?: PartialMessage<MomentaryProduct>): MomentaryProduct {
|
||||
const message = globalThis.Object.create((this.messagePrototype!));
|
||||
if (value !== undefined)
|
||||
reflectionMergePartial<MomentaryProduct>(this, message, value);
|
||||
return message;
|
||||
}
|
||||
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: MomentaryProduct): MomentaryProduct {
|
||||
let message = target ?? this.create(), end = reader.pos + length;
|
||||
while (reader.pos < end) {
|
||||
let [fieldNo, wireType] = reader.tag();
|
||||
switch (fieldNo) {
|
||||
case /* cif.digitalRadarData.MomentaryMeta productMetadata */ 1:
|
||||
message.productMetadata = MomentaryMeta.internalBinaryRead(reader, reader.uint32(), options, message.productMetadata);
|
||||
break;
|
||||
case /* cif.digitalRadarData.MomentaryData data */ 2:
|
||||
message.data = MomentaryData.internalBinaryRead(reader, reader.uint32(), options, message.data);
|
||||
break;
|
||||
default:
|
||||
let u = options.readUnknownField;
|
||||
if (u === "throw")
|
||||
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
||||
let d = reader.skip(wireType);
|
||||
if (u !== false)
|
||||
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
internalBinaryWrite(message: MomentaryProduct, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
||||
/* cif.digitalRadarData.MomentaryMeta productMetadata = 1; */
|
||||
if (message.productMetadata)
|
||||
MomentaryMeta.internalBinaryWrite(message.productMetadata, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
|
||||
/* cif.digitalRadarData.MomentaryData data = 2; */
|
||||
if (message.data)
|
||||
MomentaryData.internalBinaryWrite(message.data, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
|
||||
let u = options.writeUnknownFields;
|
||||
if (u !== false)
|
||||
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
||||
return writer;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @generated MessageType for protobuf message cif.digitalRadarData.MomentaryProduct
|
||||
*/
|
||||
export const MomentaryProduct = new MomentaryProduct$Type();
|
||||
// @generated message type with reflection information, may provide speed optimized methods
|
||||
class MomentaryMeta$Type extends MessageType<MomentaryMeta> {
|
||||
constructor() {
|
||||
super("cif.digitalRadarData.MomentaryMeta", [
|
||||
{ no: 1, name: "productName", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
|
||||
]);
|
||||
}
|
||||
create(value?: PartialMessage<MomentaryMeta>): MomentaryMeta {
|
||||
const message = globalThis.Object.create((this.messagePrototype!));
|
||||
message.productName = "";
|
||||
if (value !== undefined)
|
||||
reflectionMergePartial<MomentaryMeta>(this, message, value);
|
||||
return message;
|
||||
}
|
||||
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: MomentaryMeta): MomentaryMeta {
|
||||
let message = target ?? this.create(), end = reader.pos + length;
|
||||
while (reader.pos < end) {
|
||||
let [fieldNo, wireType] = reader.tag();
|
||||
switch (fieldNo) {
|
||||
case /* string productName */ 1:
|
||||
message.productName = reader.string();
|
||||
break;
|
||||
default:
|
||||
let u = options.readUnknownField;
|
||||
if (u === "throw")
|
||||
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
||||
let d = reader.skip(wireType);
|
||||
if (u !== false)
|
||||
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
internalBinaryWrite(message: MomentaryMeta, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
||||
/* string productName = 1; */
|
||||
if (message.productName !== "")
|
||||
writer.tag(1, WireType.LengthDelimited).string(message.productName);
|
||||
let u = options.writeUnknownFields;
|
||||
if (u !== false)
|
||||
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
||||
return writer;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @generated MessageType for protobuf message cif.digitalRadarData.MomentaryMeta
|
||||
*/
|
||||
export const MomentaryMeta = new MomentaryMeta$Type();
|
||||
// @generated message type with reflection information, may provide speed optimized methods
|
||||
class MomentaryData$Type extends MessageType<MomentaryData> {
|
||||
constructor() {
|
||||
super("cif.digitalRadarData.MomentaryData", [
|
||||
{ no: 1, name: "scale", kind: "scalar", T: 2 /*ScalarType.FLOAT*/ },
|
||||
{ no: 2, name: "offset", kind: "scalar", T: 2 /*ScalarType.FLOAT*/ },
|
||||
{ no: 3, name: "startRange", kind: "scalar", T: 5 /*ScalarType.INT32*/ },
|
||||
{ no: 4, name: "sampleInterval", kind: "scalar", T: 5 /*ScalarType.INT32*/ },
|
||||
{ no: 5, name: "data", kind: "scalar", repeat: 1 /*RepeatType.PACKED*/, T: 5 /*ScalarType.INT32*/ }
|
||||
]);
|
||||
}
|
||||
create(value?: PartialMessage<MomentaryData>): MomentaryData {
|
||||
const message = globalThis.Object.create((this.messagePrototype!));
|
||||
message.scale = 0;
|
||||
message.offset = 0;
|
||||
message.startRange = 0;
|
||||
message.sampleInterval = 0;
|
||||
message.data = [];
|
||||
if (value !== undefined)
|
||||
reflectionMergePartial<MomentaryData>(this, message, value);
|
||||
return message;
|
||||
}
|
||||
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: MomentaryData): MomentaryData {
|
||||
let message = target ?? this.create(), end = reader.pos + length;
|
||||
while (reader.pos < end) {
|
||||
let [fieldNo, wireType] = reader.tag();
|
||||
switch (fieldNo) {
|
||||
case /* float scale */ 1:
|
||||
message.scale = reader.float();
|
||||
break;
|
||||
case /* float offset */ 2:
|
||||
message.offset = reader.float();
|
||||
break;
|
||||
case /* int32 startRange */ 3:
|
||||
message.startRange = reader.int32();
|
||||
break;
|
||||
case /* int32 sampleInterval */ 4:
|
||||
message.sampleInterval = reader.int32();
|
||||
break;
|
||||
case /* repeated int32 data */ 5:
|
||||
if (wireType === WireType.LengthDelimited)
|
||||
for (let e = reader.int32() + reader.pos; reader.pos < e;)
|
||||
message.data.push(reader.int32());
|
||||
else
|
||||
message.data.push(reader.int32());
|
||||
break;
|
||||
default:
|
||||
let u = options.readUnknownField;
|
||||
if (u === "throw")
|
||||
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
||||
let d = reader.skip(wireType);
|
||||
if (u !== false)
|
||||
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
internalBinaryWrite(message: MomentaryData, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
||||
/* float scale = 1; */
|
||||
if (message.scale !== 0)
|
||||
writer.tag(1, WireType.Bit32).float(message.scale);
|
||||
/* float offset = 2; */
|
||||
if (message.offset !== 0)
|
||||
writer.tag(2, WireType.Bit32).float(message.offset);
|
||||
/* int32 startRange = 3; */
|
||||
if (message.startRange !== 0)
|
||||
writer.tag(3, WireType.Varint).int32(message.startRange);
|
||||
/* int32 sampleInterval = 4; */
|
||||
if (message.sampleInterval !== 0)
|
||||
writer.tag(4, WireType.Varint).int32(message.sampleInterval);
|
||||
/* repeated int32 data = 5; */
|
||||
if (message.data.length) {
|
||||
writer.tag(5, WireType.LengthDelimited).fork();
|
||||
for (let i = 0; i < message.data.length; i++)
|
||||
writer.int32(message.data[i]);
|
||||
writer.join();
|
||||
}
|
||||
let u = options.writeUnknownFields;
|
||||
if (u !== false)
|
||||
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
||||
return writer;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @generated MessageType for protobuf message cif.digitalRadarData.MomentaryData
|
||||
*/
|
||||
export const MomentaryData = new MomentaryData$Type();
|
|
@ -4,7 +4,8 @@ version = "0.1.0"
|
|||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
capnp = "0.20"
|
||||
prost = "0.13"
|
||||
prost-types = "0.13"
|
||||
|
||||
wxbox-ar2 = { path = "../ar2", optional = true }
|
||||
nexrad-decode = { path = "../nexrad-decode", optional = true }
|
||||
|
@ -14,4 +15,4 @@ default = []
|
|||
ar2 = ["dep:wxbox-ar2", "dep:nexrad-decode"]
|
||||
|
||||
[build-dependencies]
|
||||
capnpc = "0.20"
|
||||
prost-build = "0.13"
|
|
@ -1,4 +1,4 @@
|
|||
# wxbox data interchange format
|
||||
x# 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.
|
|
@ -1,10 +1,11 @@
|
|||
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");
|
||||
prost_build::compile_protos(
|
||||
&[
|
||||
"src/cifContainer.proto",
|
||||
"src/digitalRadarData.proto"
|
||||
],
|
||||
&["src/"]
|
||||
).unwrap();
|
||||
println!("cargo:rerun-if-changed=src/cif.proto");
|
||||
println!("cargo:rerun-if-changed=src/digitalRadarData.proto");
|
||||
}
|
|
@ -1,50 +0,0 @@
|
|||
@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 @7 :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);
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
@0xf4ec6bdd2faa25e6;
|
||||
|
||||
struct Message {
|
||||
union {
|
||||
tilerStatusReport @0 :import "tilerStatusReport.capnp".TilerStatusReport;
|
||||
digitalRadarData @1 :import "digitalRadarData.capnp".DigitalRadarData;
|
||||
}
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
@0xa53697f84202e60f;
|
||||
|
||||
struct TilerStatusReport {
|
||||
cacheInfo @0 :CacheInfo;
|
||||
}
|
||||
|
||||
struct CacheInfo {
|
||||
grib2CacheEntries @0 :UInt64;
|
||||
nexradCacheEntries @1 :UInt64;
|
||||
}
|
|
@ -1,83 +1,93 @@
|
|||
use std::io::Cursor;
|
||||
use nexrad_decode::messages::digital_radar_data::RadialStatus;
|
||||
use wxbox_ar2::{MomentData, Radial, Scan};
|
||||
pub fn serialize_scan_to_cif_message(scan: &Scan, elevation_number: u8, requested_product: &str) -> 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();
|
||||
use crate::{cif, AsCif};
|
||||
use crate::cif::cif_container::MessageType;
|
||||
|
||||
digital_radar_data.set_vcp_number(scan.coverage_pattern_number);
|
||||
digital_radar_data.set_elevation_number(elevation_number);
|
||||
pub struct Ar2AsCifParams {
|
||||
pub requested_elevation: u8,
|
||||
pub requested_product: String
|
||||
}
|
||||
|
||||
// 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 {
|
||||
// parse out the radials
|
||||
let mut radials_we_can_use: Vec<(&Radial, &MomentData)> = vec![];
|
||||
for radial in &elevation.radials {
|
||||
match requested_product {
|
||||
"REF" if radial.reflectivity.is_some() => {
|
||||
radials_we_can_use.push((&radial, &radial.reflectivity.as_ref().unwrap()));
|
||||
},
|
||||
"VEL" if radial.velocity.is_some() => {
|
||||
radials_we_can_use.push((&radial, &radial.velocity.as_ref().unwrap()));
|
||||
},
|
||||
"SW" if radial.spectrum_width.is_some() => {
|
||||
radials_we_can_use.push((&radial, &radial.spectrum_width.as_ref().unwrap()));
|
||||
},
|
||||
"ZDR" if radial.differential_reflectivity.is_some() => {
|
||||
radials_we_can_use.push((&radial, &radial.differential_reflectivity.as_ref().unwrap()));
|
||||
},
|
||||
"PHI" if radial.differential_phase.is_some() => {
|
||||
radials_we_can_use.push((&radial, &radial.differential_phase.as_ref().unwrap()));
|
||||
},
|
||||
"RHO" if radial.correlation_coefficient.is_some() => {
|
||||
radials_we_can_use.push((&radial, &radial.correlation_coefficient.as_ref().unwrap()));
|
||||
},
|
||||
"CFP" if radial.specific_differential_phase.is_some() => {
|
||||
radials_we_can_use.push((&radial, &radial.specific_differential_phase.as_ref().unwrap()));
|
||||
},
|
||||
_ => {}
|
||||
|
||||
impl AsCif for Scan {
|
||||
type Params = Ar2AsCifParams;
|
||||
fn as_cif(&self, params: &Self::Params) -> cif::CifContainer {
|
||||
let mut digital_radar_data = cif::digital_radar_data::DigitalRadarData::default();
|
||||
digital_radar_data.elevation_number = params.requested_elevation as i32;
|
||||
digital_radar_data.vcp_number = self.coverage_pattern_number as i32;
|
||||
|
||||
// find the elevation
|
||||
let maybe_elevation = self.sweeps.iter().find(|u| u.elevation_number == params.requested_elevation);
|
||||
if let Some(elevation) = maybe_elevation {
|
||||
// parse out the radials
|
||||
let mut radials_we_can_use: Vec<(&Radial, &MomentData)> = vec![];
|
||||
for radial in &elevation.radials {
|
||||
match params.requested_product.as_str() {
|
||||
"REF" if radial.reflectivity.is_some() => {
|
||||
radials_we_can_use.push((&radial, &radial.reflectivity.as_ref().unwrap()));
|
||||
},
|
||||
"VEL" if radial.velocity.is_some() => {
|
||||
radials_we_can_use.push((&radial, &radial.velocity.as_ref().unwrap()));
|
||||
},
|
||||
"SW" if radial.spectrum_width.is_some() => {
|
||||
radials_we_can_use.push((&radial, &radial.spectrum_width.as_ref().unwrap()));
|
||||
},
|
||||
"ZDR" if radial.differential_reflectivity.is_some() => {
|
||||
radials_we_can_use.push((&radial, &radial.differential_reflectivity.as_ref().unwrap()));
|
||||
},
|
||||
"PHI" if radial.differential_phase.is_some() => {
|
||||
radials_we_can_use.push((&radial, &radial.differential_phase.as_ref().unwrap()));
|
||||
},
|
||||
"RHO" if radial.correlation_coefficient.is_some() => {
|
||||
radials_we_can_use.push((&radial, &radial.correlation_coefficient.as_ref().unwrap()));
|
||||
},
|
||||
"CFP" if radial.specific_differential_phase.is_some() => {
|
||||
radials_we_can_use.push((&radial, &radial.specific_differential_phase.as_ref().unwrap()));
|
||||
},
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
digital_radar_data.radials = radials_we_can_use.iter()
|
||||
.map(|u| {
|
||||
let mut radial = cif::digital_radar_data::Radial::default();
|
||||
radial.elevation_number = u.0.elevation_number as i32;
|
||||
radial.azimuth_angle_degrees = u.0.azimuth_angle_degrees;
|
||||
radial.azimuth_number = u.0.azimuth_number as i32;
|
||||
radial.azimuth_spacing_degrees = u.0.azimuth_spacing_degrees;
|
||||
radial.collection_timestamp = u.0.collection_timestamp as u64;
|
||||
radial.elevation_degrees = u.0.elevation_number_degrees;
|
||||
radial.radial_status = match u.0.radial_status {
|
||||
RadialStatus::ElevationStart => cif::digital_radar_data::RadialStatus::ElevationStart,
|
||||
RadialStatus::IntermediateRadialData => cif::digital_radar_data::RadialStatus::IntermediateRadialData,
|
||||
RadialStatus::ElevationEnd => cif::digital_radar_data::RadialStatus::ElevationEnd,
|
||||
RadialStatus::VolumeScanStart => cif::digital_radar_data::RadialStatus::VolumeScanStart,
|
||||
RadialStatus::VolumeScanEnd => cif::digital_radar_data::RadialStatus::VolumeScanEnd,
|
||||
RadialStatus::ElevationStartVCPFinal => cif::digital_radar_data::RadialStatus::ElevationStartVcpFinal,
|
||||
}.into();
|
||||
|
||||
let mut moment_meta = cif::digital_radar_data::MomentaryMeta::default();
|
||||
moment_meta.product_name = params.requested_product.clone();
|
||||
|
||||
let mut moment_data = cif::digital_radar_data::MomentaryData::default();
|
||||
moment_data.offset = u.1.offset;
|
||||
moment_data.sample_interval = u.1.sample_interval as i32;
|
||||
moment_data.scale = u.1.scale;
|
||||
moment_data.start_range = u.1.start_range as i32;
|
||||
moment_data.data = u.1.values.iter().map(|u| *u as i32).collect();
|
||||
|
||||
let mut moment_product = cif::digital_radar_data::MomentaryProduct::default();
|
||||
moment_product.product_metadata = Some(moment_meta);
|
||||
|
||||
radial.product = Some(moment_product);
|
||||
|
||||
radial
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
|
||||
let mut radials = digital_radar_data.reborrow().init_radials(radials_we_can_use.len() as u32);
|
||||
|
||||
for (number, (radial, data)) in radials_we_can_use.iter().enumerate() {
|
||||
let mut this_radial_msg = radials.reborrow().get(number as u32);
|
||||
this_radial_msg.set_collection_timestamp(radial.collection_timestamp);
|
||||
this_radial_msg.set_azimuth_number(radial.azimuth_number);
|
||||
this_radial_msg.set_azimuth_angle_degrees(radial.azimuth_angle_degrees);
|
||||
this_radial_msg.set_azimuth_spacing_degrees(radial.azimuth_spacing_degrees);
|
||||
this_radial_msg.set_elevation_number(radial.elevation_number);
|
||||
this_radial_msg.set_elevation_degrees(radial.elevation_number_degrees);
|
||||
|
||||
this_radial_msg.set_radial_status(match radial.radial_status {
|
||||
RadialStatus::ElevationStart => crate::digitalRadarData_capnp::RadialStatus::ElevationStart,
|
||||
RadialStatus::IntermediateRadialData => crate::digitalRadarData_capnp::RadialStatus::IntermediateRadialData,
|
||||
RadialStatus::ElevationEnd => crate::digitalRadarData_capnp::RadialStatus::ElevationEnd,
|
||||
RadialStatus::VolumeScanStart => crate::digitalRadarData_capnp::RadialStatus::VolumeScanStart,
|
||||
RadialStatus::VolumeScanEnd => crate::digitalRadarData_capnp::RadialStatus::VolumeScanEnd,
|
||||
RadialStatus::ElevationStartVCPFinal => crate::digitalRadarData_capnp::RadialStatus::ElevationStartVCPFinal,
|
||||
});
|
||||
|
||||
let mut msg_requested_product = this_radial_msg.reborrow().init_requested_product();
|
||||
|
||||
let mut product_metadata = msg_requested_product.reborrow().init_product_metadata();
|
||||
product_metadata.set_product_name(requested_product);
|
||||
|
||||
let mut momentary_product_data = msg_requested_product.reborrow().init_data();
|
||||
momentary_product_data.set_scale(data.scale);
|
||||
momentary_product_data.set_offset(data.offset);
|
||||
momentary_product_data.set_start_range(data.start_range);
|
||||
momentary_product_data.set_sample_interval(data.sample_interval);
|
||||
momentary_product_data.set_values(&*data.values).unwrap();
|
||||
}
|
||||
} else {
|
||||
digital_radar_data.reborrow().init_radials(0); // no elevation is signalled by an empty radials field
|
||||
let mut container = cif::CifContainer::default();
|
||||
container.message_type = Some(MessageType::DigitalRadarData(digital_radar_data));
|
||||
container
|
||||
}
|
||||
|
||||
let mut output = Cursor::new(Vec::new());
|
||||
capnp::serialize_packed::write_message(&mut output, &message).unwrap();
|
||||
output.into_inner()
|
||||
}
|
11
crates/interchange/src/cifContainer.proto
Normal file
11
crates/interchange/src/cifContainer.proto
Normal file
|
@ -0,0 +1,11 @@
|
|||
syntax = "proto3";
|
||||
|
||||
package cif;
|
||||
|
||||
import "digitalRadarData.proto";
|
||||
|
||||
message CifContainer {
|
||||
oneof message_type {
|
||||
cif.digitalRadarData.DigitalRadarData digitalRadarData = 1;
|
||||
}
|
||||
}
|
54
crates/interchange/src/digitalRadarData.proto
Normal file
54
crates/interchange/src/digitalRadarData.proto
Normal file
|
@ -0,0 +1,54 @@
|
|||
syntax = "proto3";
|
||||
|
||||
package cif.digitalRadarData;
|
||||
|
||||
message DigitalRadarData {
|
||||
int32 vcpNumber = 1;
|
||||
int32 elevationNumber = 2;
|
||||
|
||||
repeated Radial radials = 3;
|
||||
}
|
||||
|
||||
message Radial {
|
||||
fixed64 collectionTimestamp = 1;
|
||||
|
||||
int32 azimuthNumber = 2;
|
||||
float azimuthAngleDegrees = 3;
|
||||
float azimuthSpacingDegrees = 4;
|
||||
|
||||
RadialStatus radialStatus = 5;
|
||||
|
||||
int32 elevationNumber = 6;
|
||||
float elevationDegrees = 7;
|
||||
|
||||
MomentaryProduct product = 8;
|
||||
}
|
||||
|
||||
enum RadialStatus {
|
||||
RADIAL_STATUS_UNKNOWN = 0;
|
||||
RADIAL_STATUS_ELEVATION_START = 1;
|
||||
RADIAL_STATUS_INTERMEDIATE_RADIAL_DATA = 2;
|
||||
RADIAL_STATUS_ELEVATION_END = 3;
|
||||
RADIAL_STATUS_VOLUME_SCAN_START = 4;
|
||||
RADIAL_STATUS_VOLUME_SCAN_END = 5;
|
||||
RADIAL_STATUS_ELEVATION_START_VCP_FINAL = 6;
|
||||
}
|
||||
|
||||
message MomentaryProduct {
|
||||
MomentaryMeta productMetadata = 1;
|
||||
MomentaryData data = 2;
|
||||
}
|
||||
|
||||
message MomentaryMeta {
|
||||
string productName = 1;
|
||||
}
|
||||
|
||||
message MomentaryData {
|
||||
float scale = 1;
|
||||
float offset = 2;
|
||||
|
||||
int32 startRange = 3;
|
||||
int32 sampleInterval = 4;
|
||||
|
||||
repeated int32 data = 5;
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -1,9 +1,25 @@
|
|||
use prost::Message;
|
||||
use crate::cif::CifContainer;
|
||||
|
||||
#[allow(non_snake_case)]
|
||||
pub mod schema_capnp;
|
||||
#[allow(non_snake_case)]
|
||||
pub mod digitalRadarData_capnp;
|
||||
#[allow(non_snake_case)]
|
||||
pub mod tilerStatusReport_capnp;
|
||||
pub mod cif {
|
||||
include!(concat!(env!("OUT_DIR"), "/cif.rs"));
|
||||
pub mod digital_radar_data {
|
||||
include!(concat!(env!("OUT_DIR"), "/cif.digital_radar_data.rs"));
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "ar2")]
|
||||
pub mod ar2;
|
||||
pub mod ar2;
|
||||
|
||||
pub trait AsCif {
|
||||
type Params;
|
||||
|
||||
fn as_cif(&self, params: &Self::Params) -> cif::CifContainer;
|
||||
}
|
||||
|
||||
pub fn serialize_cif_message(cif: &CifContainer) -> Vec<u8> {
|
||||
let mut buf = Vec::with_capacity(cif.encoded_len());
|
||||
cif.encode(&mut buf).unwrap();
|
||||
buf
|
||||
}
|
|
@ -1,287 +0,0 @@
|
|||
// @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>>>;
|
||||
}
|
|
@ -1,447 +0,0 @@
|
|||
// @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;
|
||||
}
|
||||
}
|
|
@ -16,7 +16,6 @@ missing = -99.0
|
|||
no_coverage = -999.0
|
||||
|
||||
[data.nexrad.base_reflectivity_halfdegree]
|
||||
from = "DS.p94r0"
|
||||
palette = """
|
||||
Color4: 10 164 164 255 0 100 100 192 255
|
||||
Color4: 20 64 128 255 255 32 64 128 255
|
||||
|
|
|
@ -3,7 +3,6 @@ use crate::error::AppError;
|
|||
use crate::nexrad_list_response::ListBucketResult;
|
||||
use crate::tiles::{DataId, TileId};
|
||||
use anyhow::{anyhow, bail};
|
||||
use axum::Json;
|
||||
use axum::extract::{Path, State};
|
||||
use axum::http::header;
|
||||
use axum::response::IntoResponse;
|
||||
|
@ -24,7 +23,8 @@ use std::sync::Arc;
|
|||
use tracing::{debug, info_span};
|
||||
use wxbox_ar2::sites::wsr88d::{SITES, Wsr88dSite};
|
||||
use wxbox_ar2::{MomentValue, Radial, Scan, Sweep, parse};
|
||||
use wxbox_interchange::ar2::serialize_scan_to_cif_message;
|
||||
use wxbox_interchange::ar2::{Ar2AsCifParams};
|
||||
use wxbox_interchange::{serialize_cif_message, AsCif};
|
||||
use wxbox_pal::ColorPalette;
|
||||
|
||||
pub type NexradDataCache = Cache<DataId, Arc<wxbox_ar2::Scan>>;
|
||||
|
@ -34,7 +34,6 @@ pub type NexradDataConfig = HashMap<String, NexradDataSource>;
|
|||
|
||||
#[derive(Serialize, Deserialize, Clone)]
|
||||
pub struct NexradDataSource {
|
||||
pub from: String,
|
||||
pub palette: String,
|
||||
}
|
||||
impl Debug for NexradDataSource {
|
||||
|
@ -127,11 +126,18 @@ pub async fn nexrad_data_handler(
|
|||
state.nexrad_data_cache.get(&data_id).await.unwrap()
|
||||
};
|
||||
|
||||
let cif_message = data.as_cif(&Ar2AsCifParams {
|
||||
requested_elevation: sweep,
|
||||
requested_product: product.clone(),
|
||||
});
|
||||
|
||||
|
||||
Ok((
|
||||
[(header::CONTENT_TYPE, "application/wxbox-common-interchange-format")],
|
||||
serialize_scan_to_cif_message(&data, sweep, &product),
|
||||
[
|
||||
(header::CONTENT_TYPE, "application/wxbox-common-interchange-format".to_string()),
|
||||
(header::CONTENT_DISPOSITION, format!("attachment; filename=\"{}_{}_{}.wxrad\"", site, sweep, product))
|
||||
],
|
||||
serialize_cif_message(&cif_message),
|
||||
))
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue