diff --git a/.gitignore b/.gitignore index 3a8cabc..824751b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ /target .idea + +*/target/* \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 5b56700..0e9a1ac 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -487,6 +487,7 @@ dependencies = [ "chrono", "core_extensions", "crossbeam", + "dirs", "epoxy", "etws_loader", "euclid", @@ -529,6 +530,7 @@ dependencies = [ "svg", "thiserror", "tokio", + "toml 0.8.8", "topojson", "tracker", ] @@ -876,6 +878,15 @@ dependencies = [ "subtle", ] +[[package]] +name = "dirs" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" +dependencies = [ + "dirs-sys", +] + [[package]] name = "dirs-next" version = "2.0.0" @@ -886,6 +897,18 @@ dependencies = [ "dirs-sys-next", ] +[[package]] +name = "dirs-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys 0.48.0", +] + [[package]] name = "dirs-sys-next" version = "0.1.2" @@ -2581,6 +2604,12 @@ version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + [[package]] name = "orbclient" version = "0.3.47" @@ -2875,7 +2904,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" dependencies = [ "once_cell", - "toml_edit", + "toml_edit 0.19.11", ] [[package]] @@ -3342,9 +3371,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.3" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96426c9936fd7a0124915f9185ea1d20aa9445cc9821142f0a73bc9207a2e186" +checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" dependencies = [ "serde", ] @@ -3582,7 +3611,7 @@ dependencies = [ "cfg-expr", "heck", "pkg-config", - "toml", + "toml 0.7.5", "version-compare", ] @@ -3732,14 +3761,26 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit", + "toml_edit 0.19.11", +] + +[[package]] +name = "toml" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1a195ec8c9da26928f773888e0742ca3ca1040c6cd859c919c9f59c1954ab35" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit 0.21.0", ] [[package]] name = "toml_datetime" -version = "0.6.3" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" dependencies = [ "serde", ] @@ -3754,7 +3795,20 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "winnow", + "winnow 0.4.7", +] + +[[package]] +name = "toml_edit" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d34d383cd00a163b4a5b85053df514d45bc330f6de7737edfe0a93311d1eaa03" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "winnow 0.5.35", ] [[package]] @@ -4398,6 +4452,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "winnow" +version = "0.5.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1931d78a9c73861da0134f453bb1f790ce49b2e30eba8410b4b79bac72b46a2d" +dependencies = [ + "memchr", +] + [[package]] name = "wio" version = "0.2.2" diff --git a/Cargo.toml b/Cargo.toml index a94108b..01ef65e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -39,7 +39,9 @@ geo = "0.26.0" topojson = "0.5.1" geojson = "0.24.1" plotters = "0.3.5" -core_extensions={ version = "1.5.2", default_features = false, features = ["std"] } +core_extensions = { version = "1.5.2", default_features = false, features = [ + "std", +] } plotters-backend = "0.3.5" tokio = { version = "1.35.1", features = [ "time", @@ -72,7 +74,8 @@ abi_stable = "0.11.3" serde = "1.0.196" serde_json = "1.0.112" flate2 = "1.0.28" -# plotters-cairo = "0.5.0" +toml = "0.8.8" +dirs = "5.0.1" [build-dependencies] diff --git a/config.toml b/config.toml new file mode 100644 index 0000000..5c4fe15 --- /dev/null +++ b/config.toml @@ -0,0 +1,2 @@ +[plugins] +etws_loader = { version = "0.1.0" } diff --git a/etws_loader/src/lib.rs b/etws_loader/src/lib.rs index 9e916cb..ac6477e 100644 --- a/etws_loader/src/lib.rs +++ b/etws_loader/src/lib.rs @@ -83,9 +83,31 @@ impl Plugin for ETWSLoader { CoordType::Other }; + let shape = match b.info.dimension_size.len() { + 1 => radarg_plugin_interface::DataShape::Vector, + 2 => radarg_plugin_interface::DataShape::Matrix, + _ => radarg_plugin_interface::DataShape::Scalar, + }; + + let data_type = match b.info.value_name.as_str() { + "ET" => PluginResultType::ET, + "DBZ" => PluginResultType::DBZ, + "CR" => PluginResultType::DBZ, + "R" => PluginResultType::R, + "V" => PluginResultType::V, + "ZDR" => PluginResultType::ZDR, + "PHIDP" => PluginResultType::PHIDP, + "KDP" => PluginResultType::KDP, + "CC" => PluginResultType::CC, + "HCA" => PluginResultType::HCA, + "QPE" => PluginResultType::QPE, + "QPF" => PluginResultType::QPF, + _ => PluginResultType::Unknown, + }; + radarg_plugin_interface::Block { data: data, - shape: radarg_plugin_interface::DataShape::Vector, + shape, size: RVec::from(b.info.dimension_size) .into_iter() .map(|p| p as usize) @@ -101,7 +123,7 @@ impl Plugin for ETWSLoader { .collect::>(), ), fill_value: b.info.fill_value, - data_type: PluginResultType::DBZ, + data_type, } }) .collect::>(); diff --git a/etws_loader/target/.rustc_info.json b/etws_loader/target/.rustc_info.json index 93dab57..14533f6 100644 --- a/etws_loader/target/.rustc_info.json +++ b/etws_loader/target/.rustc_info.json @@ -1 +1 @@ -{"rustc_fingerprint":8475780184195034948,"outputs":{"15729799797837862367":{"success":true,"status":"","code":0,"stdout":"___\nlib___.rlib\nlib___.dylib\nlib___.dylib\nlib___.a\nlib___.dylib\n/Users/ruomu/.rustup/toolchains/nightly-x86_64-apple-darwin\noff\npacked\nunpacked\n___\ndebug_assertions\noverflow_checks\npanic=\"unwind\"\nproc_macro\nrelocation_model=\"pic\"\ntarget_abi=\"\"\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"\"\ntarget_family=\"unix\"\ntarget_feature=\"cmpxchg16b\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_feature=\"sse3\"\ntarget_feature=\"ssse3\"\ntarget_has_atomic\ntarget_has_atomic=\"128\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_has_atomic_equal_alignment=\"16\"\ntarget_has_atomic_equal_alignment=\"32\"\ntarget_has_atomic_equal_alignment=\"64\"\ntarget_has_atomic_equal_alignment=\"8\"\ntarget_has_atomic_equal_alignment=\"ptr\"\ntarget_has_atomic_load_store\ntarget_has_atomic_load_store=\"128\"\ntarget_has_atomic_load_store=\"16\"\ntarget_has_atomic_load_store=\"32\"\ntarget_has_atomic_load_store=\"64\"\ntarget_has_atomic_load_store=\"8\"\ntarget_has_atomic_load_store=\"ptr\"\ntarget_os=\"macos\"\ntarget_pointer_width=\"64\"\ntarget_thread_local\ntarget_vendor=\"apple\"\nunix\n","stderr":""},"4614504638168534921":{"success":true,"status":"","code":0,"stdout":"rustc 1.74.0-nightly (8142a319e 2023-09-13)\nbinary: rustc\ncommit-hash: 8142a319ed5c1d1f96e5a1881a6546e463b77c8f\ncommit-date: 2023-09-13\nhost: x86_64-apple-darwin\nrelease: 1.74.0-nightly\nLLVM version: 17.0.0\n","stderr":""}},"successes":{}} \ No newline at end of file +{"rustc_fingerprint":6534886339914138005,"outputs":{"4614504638168534921":{"success":true,"status":"","code":0,"stdout":"rustc 1.77.0-nightly (d78329b92 2024-01-13)\nbinary: rustc\ncommit-hash: d78329b92e8d141d19505e7c1527181c4ab87ed4\ncommit-date: 2024-01-13\nhost: aarch64-apple-darwin\nrelease: 1.77.0-nightly\nLLVM version: 17.0.6\n","stderr":""},"15729799797837862367":{"success":true,"status":"","code":0,"stdout":"___\nlib___.rlib\nlib___.dylib\nlib___.dylib\nlib___.a\nlib___.dylib\n/Users/tsuki/.rustup/toolchains/nightly-aarch64-apple-darwin\noff\npacked\nunpacked\n___\ndebug_assertions\noverflow_checks\npanic=\"unwind\"\nproc_macro\nrelocation_model=\"pic\"\ntarget_abi=\"\"\ntarget_arch=\"aarch64\"\ntarget_endian=\"little\"\ntarget_env=\"\"\ntarget_family=\"unix\"\ntarget_feature=\"aes\"\ntarget_feature=\"crc\"\ntarget_feature=\"dit\"\ntarget_feature=\"dotprod\"\ntarget_feature=\"dpb\"\ntarget_feature=\"dpb2\"\ntarget_feature=\"fcma\"\ntarget_feature=\"fhm\"\ntarget_feature=\"flagm\"\ntarget_feature=\"fp16\"\ntarget_feature=\"frintts\"\ntarget_feature=\"jsconv\"\ntarget_feature=\"lor\"\ntarget_feature=\"lse\"\ntarget_feature=\"neon\"\ntarget_feature=\"paca\"\ntarget_feature=\"pacg\"\ntarget_feature=\"pan\"\ntarget_feature=\"pmuv3\"\ntarget_feature=\"ras\"\ntarget_feature=\"rcpc\"\ntarget_feature=\"rcpc2\"\ntarget_feature=\"rdm\"\ntarget_feature=\"sb\"\ntarget_feature=\"sha2\"\ntarget_feature=\"sha3\"\ntarget_feature=\"ssbs\"\ntarget_feature=\"v8.1a\"\ntarget_feature=\"v8.2a\"\ntarget_feature=\"v8.3a\"\ntarget_feature=\"v8.4a\"\ntarget_feature=\"vh\"\ntarget_has_atomic\ntarget_has_atomic=\"128\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_has_atomic_equal_alignment=\"128\"\ntarget_has_atomic_equal_alignment=\"16\"\ntarget_has_atomic_equal_alignment=\"32\"\ntarget_has_atomic_equal_alignment=\"64\"\ntarget_has_atomic_equal_alignment=\"8\"\ntarget_has_atomic_equal_alignment=\"ptr\"\ntarget_has_atomic_load_store\ntarget_has_atomic_load_store=\"128\"\ntarget_has_atomic_load_store=\"16\"\ntarget_has_atomic_load_store=\"32\"\ntarget_has_atomic_load_store=\"64\"\ntarget_has_atomic_load_store=\"8\"\ntarget_has_atomic_load_store=\"ptr\"\ntarget_os=\"macos\"\ntarget_pointer_width=\"64\"\ntarget_thread_local\ntarget_vendor=\"apple\"\nunix\n","stderr":""}},"successes":{}} \ No newline at end of file diff --git a/etws_loader/target/release/.fingerprint/etws_loader-826e392dbec97b5d/lib-etws_loader b/etws_loader/target/release/.fingerprint/etws_loader-826e392dbec97b5d/lib-etws_loader index b9b1390..928d854 100644 --- a/etws_loader/target/release/.fingerprint/etws_loader-826e392dbec97b5d/lib-etws_loader +++ b/etws_loader/target/release/.fingerprint/etws_loader-826e392dbec97b5d/lib-etws_loader @@ -1 +1 @@ -747a3e56d0023d1f \ No newline at end of file +16f3840281ed1c0f \ No newline at end of file diff --git a/etws_loader/target/release/.fingerprint/etws_loader-826e392dbec97b5d/lib-etws_loader.json b/etws_loader/target/release/.fingerprint/etws_loader-826e392dbec97b5d/lib-etws_loader.json index 2a14595..2d45bde 100644 --- a/etws_loader/target/release/.fingerprint/etws_loader-826e392dbec97b5d/lib-etws_loader.json +++ b/etws_loader/target/release/.fingerprint/etws_loader-826e392dbec97b5d/lib-etws_loader.json @@ -1 +1 @@ -{"rustc":2034204546556879275,"features":"[]","target":8454914719411586997,"profile":3567329628440936607,"path":17523903030608720598,"deps":[[3470807962260834726,"serde",false,4787662401497216020],[6147374319788932929,"serde_json",false,13625016085015906423],[6644485573429891122,"thiserror",false,1778660508903088478],[6954241390595330609,"nom",false,2941494162337318825],[8926101378076943148,"byteorder",false,13786993926510157100],[8944703748776155531,"chrono",false,9456401766367467294],[10043922549268360936,"radarg_plugin_interface",false,11802334733291555594],[11138931377059941435,"num_traits",false,2532219253751132008],[12701726091060201577,"abi_stable",false,2027217686562626457],[12732307821348191974,"anyhow",false,10525944046939466143],[12935855096716563853,"flate2",false,6751665531550146114],[16098302879908240583,"nom_derive",false,13622616610426096756]],"local":[{"CheckDepInfo":{"dep_info":"release/.fingerprint/etws_loader-826e392dbec97b5d/dep-lib-etws_loader"}}],"rustflags":[],"metadata":41698518999418921,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file +{"rustc":17942353898403517573,"features":"[]","declared_features":"","target":8454914719411586997,"profile":14094339167972473758,"path":17523903030608720598,"deps":[[3470807962260834726,"serde",false,3464438898850424389],[6147374319788932929,"serde_json",false,4018346002534341099],[6644485573429891122,"thiserror",false,15376366722783231122],[6954241390595330609,"nom",false,17004332135801955629],[8926101378076943148,"byteorder",false,6029042559770906212],[8944703748776155531,"chrono",false,14085117952510397354],[10043922549268360936,"radarg_plugin_interface",false,2929903515477199145],[11138931377059941435,"num_traits",false,16208028648554347177],[12701726091060201577,"abi_stable",false,46919867052192855],[12732307821348191974,"anyhow",false,13132421988549874417],[12935855096716563853,"flate2",false,9880693184163145737],[16098302879908240583,"nom_derive",false,9783335926581460414]],"local":[{"CheckDepInfo":{"dep_info":"release/.fingerprint/etws_loader-826e392dbec97b5d/dep-lib-etws_loader"}}],"rustflags":[],"metadata":41698518999418921,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/etws_loader/target/release/.fingerprint/etws_loader-826e392dbec97b5d/output-lib-etws_loader b/etws_loader/target/release/.fingerprint/etws_loader-826e392dbec97b5d/output-lib-etws_loader index af9e5f4..41cf946 100644 --- a/etws_loader/target/release/.fingerprint/etws_loader-826e392dbec97b5d/output-lib-etws_loader +++ b/etws_loader/target/release/.fingerprint/etws_loader-826e392dbec97b5d/output-lib-etws_loader @@ -1,7 +1,6 @@ -{"message":"unused imports: `Write`, `self`","code":{"code":"unused_imports","explanation":null},"level":"warning","spans":[{"file_name":"src/parser.rs","byte_start":308,"byte_end":312,"line_start":13,"line_end":13,"column_start":15,"column_end":19,"is_primary":true,"text":[{"text":"use std::io::{self, Read, Write};","highlight_start":15,"highlight_end":19}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"src/parser.rs","byte_start":320,"byte_end":325,"line_start":13,"line_end":13,"column_start":27,"column_end":32,"is_primary":true,"text":[{"text":"use std::io::{self, Read, Write};","highlight_start":27,"highlight_end":32}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"`#[warn(unused_imports)]` on by default","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"remove the unused imports","code":null,"level":"help","spans":[{"file_name":"src/parser.rs","byte_start":308,"byte_end":314,"line_start":13,"line_end":13,"column_start":15,"column_end":21,"is_primary":true,"text":[{"text":"use std::io::{self, Read, Write};","highlight_start":15,"highlight_end":21}],"label":null,"suggested_replacement":"","suggestion_applicability":"MachineApplicable","expansion":null},{"file_name":"src/parser.rs","byte_start":318,"byte_end":325,"line_start":13,"line_end":13,"column_start":25,"column_end":32,"is_primary":true,"text":[{"text":"use std::io::{self, Read, Write};","highlight_start":25,"highlight_end":32}],"label":null,"suggested_replacement":"","suggestion_applicability":"MachineApplicable","expansion":null}],"children":[],"rendered":null}],"rendered":"\u001b[0m\u001b[1m\u001b[33mwarning\u001b[0m\u001b[0m\u001b[1m: unused imports: `Write`, `self`\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--> \u001b[0m\u001b[0msrc/parser.rs:13:15\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;12m13\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0muse std::io::{self, Read, Write};\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[33m^^^^\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[33m^^^^^\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m= \u001b[0m\u001b[0m\u001b[1mnote\u001b[0m\u001b[0m: `#[warn(unused_imports)]` on by default\u001b[0m\n\n"} -{"message":"unused import: `external_types::crossbeam_channel::RSender`","code":{"code":"unused_imports","explanation":null},"level":"warning","spans":[{"file_name":"src/lib.rs","byte_start":69,"byte_end":111,"line_start":5,"line_end":5,"column_start":5,"column_end":47,"is_primary":true,"text":[{"text":" external_types::crossbeam_channel::RSender,","highlight_start":5,"highlight_end":47}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"remove the unused import","code":null,"level":"help","spans":[{"file_name":"src/lib.rs","byte_start":63,"byte_end":111,"line_start":4,"line_end":5,"column_start":23,"column_end":47,"is_primary":true,"text":[{"text":" export_root_module,","highlight_start":23,"highlight_end":24},{"text":" external_types::crossbeam_channel::RSender,","highlight_start":1,"highlight_end":47}],"label":null,"suggested_replacement":"","suggestion_applicability":"MachineApplicable","expansion":null}],"children":[],"rendered":null}],"rendered":"\u001b[0m\u001b[1m\u001b[33mwarning\u001b[0m\u001b[0m\u001b[1m: unused import: `external_types::crossbeam_channel::RSender`\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--> \u001b[0m\u001b[0msrc/lib.rs:5:5\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;12m5\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m external_types::crossbeam_channel::RSender,\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[33m^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\u001b[0m\n\n"} -{"message":"unused variable: `hlen2`","code":{"code":"unused_variables","explanation":null},"level":"warning","spans":[{"file_name":"src/parser.rs","byte_start":4460,"byte_end":4465,"line_start":153,"line_end":153,"column_start":21,"column_end":26,"is_primary":true,"text":[{"text":" let (input, hlen2) = Self::_parse_u32(input, order)?;","highlight_start":21,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"`#[warn(unused_variables)]` on by default","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"if this is intentional, prefix it with an underscore","code":null,"level":"help","spans":[{"file_name":"src/parser.rs","byte_start":4460,"byte_end":4465,"line_start":153,"line_end":153,"column_start":21,"column_end":26,"is_primary":true,"text":[{"text":" let (input, hlen2) = Self::_parse_u32(input, order)?;","highlight_start":21,"highlight_end":26}],"label":null,"suggested_replacement":"_hlen2","suggestion_applicability":"MachineApplicable","expansion":null}],"children":[],"rendered":null}],"rendered":"\u001b[0m\u001b[1m\u001b[33mwarning\u001b[0m\u001b[0m\u001b[1m: unused variable: `hlen2`\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--> \u001b[0m\u001b[0msrc/parser.rs:153:21\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;12m153\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m let (input, hlen2) = Self::_parse_u32(input, order)?;\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[33m^^^^^\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[33mhelp: if this is intentional, prefix it with an underscore: `_hlen2`\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m= \u001b[0m\u001b[0m\u001b[1mnote\u001b[0m\u001b[0m: `#[warn(unused_variables)]` on by default\u001b[0m\n\n"} -{"message":"unused variable: `order`","code":{"code":"unused_variables","explanation":null},"level":"warning","spans":[{"file_name":"src/parser.rs","byte_start":6453,"byte_end":6458,"line_start":221,"line_end":221,"column_start":9,"column_end":14,"is_primary":true,"text":[{"text":" order: Order,","highlight_start":9,"highlight_end":14}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"if this is intentional, prefix it with an underscore","code":null,"level":"help","spans":[{"file_name":"src/parser.rs","byte_start":6453,"byte_end":6458,"line_start":221,"line_end":221,"column_start":9,"column_end":14,"is_primary":true,"text":[{"text":" order: Order,","highlight_start":9,"highlight_end":14}],"label":null,"suggested_replacement":"_order","suggestion_applicability":"MachineApplicable","expansion":null}],"children":[],"rendered":null}],"rendered":"\u001b[0m\u001b[1m\u001b[33mwarning\u001b[0m\u001b[0m\u001b[1m: unused variable: `order`\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--> \u001b[0m\u001b[0msrc/parser.rs:221:9\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;12m221\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m order: Order,\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[33m^^^^^\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[33mhelp: if this is intentional, prefix it with an underscore: `_order`\u001b[0m\n\n"} -{"message":"unused variable: `dimension_len`","code":{"code":"unused_variables","explanation":null},"level":"warning","spans":[{"file_name":"src/lib.rs","byte_start":1056,"byte_end":1069,"line_start":42,"line_end":42,"column_start":26,"column_end":39,"is_primary":true,"text":[{"text":" let (dimension_len, data) = match b.data {","highlight_start":26,"highlight_end":39}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"if this is intentional, prefix it with an underscore","code":null,"level":"help","spans":[{"file_name":"src/lib.rs","byte_start":1056,"byte_end":1069,"line_start":42,"line_end":42,"column_start":26,"column_end":39,"is_primary":true,"text":[{"text":" let (dimension_len, data) = match b.data {","highlight_start":26,"highlight_end":39}],"label":null,"suggested_replacement":"_dimension_len","suggestion_applicability":"MachineApplicable","expansion":null}],"children":[],"rendered":null}],"rendered":"\u001b[0m\u001b[1m\u001b[33mwarning\u001b[0m\u001b[0m\u001b[1m: unused variable: `dimension_len`\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--> \u001b[0m\u001b[0msrc/lib.rs:42:26\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;12m42\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m let (dimension_len, data) = match b.data {\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[33m^^^^^^^^^^^^^\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[33mhelp: if this is intentional, prefix it with an underscore: `_dimension_len`\u001b[0m\n\n"} -{"message":"variants `I64` and `U64` are never constructed","code":{"code":"dead_code","explanation":null},"level":"warning","spans":[{"file_name":"src/parser.rs","byte_start":529,"byte_end":539,"line_start":27,"line_end":27,"column_start":6,"column_end":16,"is_primary":false,"text":[{"text":"enum ValueTypes {","highlight_start":6,"highlight_end":16}],"label":"variants in this enum","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"src/parser.rs","byte_start":546,"byte_end":549,"line_start":28,"line_end":28,"column_start":5,"column_end":8,"is_primary":true,"text":[{"text":" I64,","highlight_start":5,"highlight_end":8}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"src/parser.rs","byte_start":582,"byte_end":585,"line_start":32,"line_end":32,"column_start":5,"column_end":8,"is_primary":true,"text":[{"text":" U64,","highlight_start":5,"highlight_end":8}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"`#[warn(dead_code)]` on by default","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"\u001b[0m\u001b[1m\u001b[33mwarning\u001b[0m\u001b[0m\u001b[1m: variants `I64` and `U64` are never constructed\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--> \u001b[0m\u001b[0msrc/parser.rs:28:5\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;12m27\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0menum ValueTypes {\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m----------\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12mvariants in this enum\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;12m28\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m I64,\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[33m^^^\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;12m...\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;12m32\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m U64,\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[33m^^^\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m= \u001b[0m\u001b[0m\u001b[1mnote\u001b[0m\u001b[0m: `#[warn(dead_code)]` on by default\u001b[0m\n\n"} -{"message":"6 warnings emitted","code":null,"level":"warning","spans":[],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[33mwarning\u001b[0m\u001b[0m\u001b[1m: 6 warnings emitted\u001b[0m\n\n"} +{"$message_type":"diagnostic","message":"unused imports: `Write`, `self`","code":{"code":"unused_imports","explanation":null},"level":"warning","spans":[{"file_name":"src/parser.rs","byte_start":308,"byte_end":312,"line_start":13,"line_end":13,"column_start":15,"column_end":19,"is_primary":true,"text":[{"text":"use std::io::{self, Read, Write};","highlight_start":15,"highlight_end":19}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"src/parser.rs","byte_start":320,"byte_end":325,"line_start":13,"line_end":13,"column_start":27,"column_end":32,"is_primary":true,"text":[{"text":"use std::io::{self, Read, Write};","highlight_start":27,"highlight_end":32}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"`#[warn(unused_imports)]` on by default","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"remove the unused imports","code":null,"level":"help","spans":[{"file_name":"src/parser.rs","byte_start":308,"byte_end":314,"line_start":13,"line_end":13,"column_start":15,"column_end":21,"is_primary":true,"text":[{"text":"use std::io::{self, Read, Write};","highlight_start":15,"highlight_end":21}],"label":null,"suggested_replacement":"","suggestion_applicability":"MachineApplicable","expansion":null},{"file_name":"src/parser.rs","byte_start":318,"byte_end":325,"line_start":13,"line_end":13,"column_start":25,"column_end":32,"is_primary":true,"text":[{"text":"use std::io::{self, Read, Write};","highlight_start":25,"highlight_end":32}],"label":null,"suggested_replacement":"","suggestion_applicability":"MachineApplicable","expansion":null}],"children":[],"rendered":null}],"rendered":"\u001b[0m\u001b[1m\u001b[33mwarning\u001b[0m\u001b[0m\u001b[1m: unused imports: `Write`, `self`\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--> \u001b[0m\u001b[0msrc/parser.rs:13:15\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;12m13\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0muse std::io::{self, Read, Write};\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[33m^^^^\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[33m^^^^^\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m= \u001b[0m\u001b[0m\u001b[1mnote\u001b[0m\u001b[0m: `#[warn(unused_imports)]` on by default\u001b[0m\n\n"} +{"$message_type":"diagnostic","message":"unused variable: `hlen2`","code":{"code":"unused_variables","explanation":null},"level":"warning","spans":[{"file_name":"src/parser.rs","byte_start":4460,"byte_end":4465,"line_start":153,"line_end":153,"column_start":21,"column_end":26,"is_primary":true,"text":[{"text":" let (input, hlen2) = Self::_parse_u32(input, order)?;","highlight_start":21,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"`#[warn(unused_variables)]` on by default","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"if this is intentional, prefix it with an underscore","code":null,"level":"help","spans":[{"file_name":"src/parser.rs","byte_start":4460,"byte_end":4465,"line_start":153,"line_end":153,"column_start":21,"column_end":26,"is_primary":true,"text":[{"text":" let (input, hlen2) = Self::_parse_u32(input, order)?;","highlight_start":21,"highlight_end":26}],"label":null,"suggested_replacement":"_hlen2","suggestion_applicability":"MachineApplicable","expansion":null}],"children":[],"rendered":null}],"rendered":"\u001b[0m\u001b[1m\u001b[33mwarning\u001b[0m\u001b[0m\u001b[1m: unused variable: `hlen2`\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--> \u001b[0m\u001b[0msrc/parser.rs:153:21\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;12m153\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m let (input, hlen2) = Self::_parse_u32(input, order)?;\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[33m^^^^^\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[33mhelp: if this is intentional, prefix it with an underscore: `_hlen2`\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m= \u001b[0m\u001b[0m\u001b[1mnote\u001b[0m\u001b[0m: `#[warn(unused_variables)]` on by default\u001b[0m\n\n"} +{"$message_type":"diagnostic","message":"unused variable: `order`","code":{"code":"unused_variables","explanation":null},"level":"warning","spans":[{"file_name":"src/parser.rs","byte_start":6453,"byte_end":6458,"line_start":221,"line_end":221,"column_start":9,"column_end":14,"is_primary":true,"text":[{"text":" order: Order,","highlight_start":9,"highlight_end":14}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"if this is intentional, prefix it with an underscore","code":null,"level":"help","spans":[{"file_name":"src/parser.rs","byte_start":6453,"byte_end":6458,"line_start":221,"line_end":221,"column_start":9,"column_end":14,"is_primary":true,"text":[{"text":" order: Order,","highlight_start":9,"highlight_end":14}],"label":null,"suggested_replacement":"_order","suggestion_applicability":"MachineApplicable","expansion":null}],"children":[],"rendered":null}],"rendered":"\u001b[0m\u001b[1m\u001b[33mwarning\u001b[0m\u001b[0m\u001b[1m: unused variable: `order`\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--> \u001b[0m\u001b[0msrc/parser.rs:221:9\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;12m221\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m order: Order,\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[33m^^^^^\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[33mhelp: if this is intentional, prefix it with an underscore: `_order`\u001b[0m\n\n"} +{"$message_type":"diagnostic","message":"unused variable: `dimension_len`","code":{"code":"unused_variables","explanation":null},"level":"warning","spans":[{"file_name":"src/lib.rs","byte_start":1019,"byte_end":1032,"line_start":41,"line_end":41,"column_start":26,"column_end":39,"is_primary":true,"text":[{"text":" let (dimension_len, data) = match b.data {","highlight_start":26,"highlight_end":39}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"if this is intentional, prefix it with an underscore","code":null,"level":"help","spans":[{"file_name":"src/lib.rs","byte_start":1019,"byte_end":1032,"line_start":41,"line_end":41,"column_start":26,"column_end":39,"is_primary":true,"text":[{"text":" let (dimension_len, data) = match b.data {","highlight_start":26,"highlight_end":39}],"label":null,"suggested_replacement":"_dimension_len","suggestion_applicability":"MachineApplicable","expansion":null}],"children":[],"rendered":null}],"rendered":"\u001b[0m\u001b[1m\u001b[33mwarning\u001b[0m\u001b[0m\u001b[1m: unused variable: `dimension_len`\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--> \u001b[0m\u001b[0msrc/lib.rs:41:26\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;12m41\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m let (dimension_len, data) = match b.data {\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[33m^^^^^^^^^^^^^\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[33mhelp: if this is intentional, prefix it with an underscore: `_dimension_len`\u001b[0m\n\n"} +{"$message_type":"diagnostic","message":"variants `I64` and `U64` are never constructed","code":{"code":"dead_code","explanation":null},"level":"warning","spans":[{"file_name":"src/parser.rs","byte_start":529,"byte_end":539,"line_start":27,"line_end":27,"column_start":6,"column_end":16,"is_primary":false,"text":[{"text":"enum ValueTypes {","highlight_start":6,"highlight_end":16}],"label":"variants in this enum","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"src/parser.rs","byte_start":546,"byte_end":549,"line_start":28,"line_end":28,"column_start":5,"column_end":8,"is_primary":true,"text":[{"text":" I64,","highlight_start":5,"highlight_end":8}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"src/parser.rs","byte_start":582,"byte_end":585,"line_start":32,"line_end":32,"column_start":5,"column_end":8,"is_primary":true,"text":[{"text":" U64,","highlight_start":5,"highlight_end":8}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"`#[warn(dead_code)]` on by default","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"\u001b[0m\u001b[1m\u001b[33mwarning\u001b[0m\u001b[0m\u001b[1m: variants `I64` and `U64` are never constructed\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--> \u001b[0m\u001b[0msrc/parser.rs:28:5\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;12m27\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0menum ValueTypes {\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m----------\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12mvariants in this enum\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;12m28\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m I64,\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[33m^^^\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;12m...\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;12m32\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m U64,\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[33m^^^\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m= \u001b[0m\u001b[0m\u001b[1mnote\u001b[0m\u001b[0m: `#[warn(dead_code)]` on by default\u001b[0m\n\n"} +{"$message_type":"diagnostic","message":"5 warnings emitted","code":null,"level":"warning","spans":[],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[33mwarning\u001b[0m\u001b[0m\u001b[1m: 5 warnings emitted\u001b[0m\n\n"} diff --git a/etws_loader/target/release/deps/etws_loader.d b/etws_loader/target/release/deps/etws_loader.d index aa4f077..2025c0d 100644 --- a/etws_loader/target/release/deps/etws_loader.d +++ b/etws_loader/target/release/deps/etws_loader.d @@ -1,8 +1,8 @@ -/Users/ruomu/projects/cinrad_g/etws_loader/target/release/deps/libetws_loader.dylib: src/lib.rs src/error.rs src/parser.rs +/Users/tsuki/projects/radar-g/etws_loader/target/release/deps/libetws_loader.dylib: src/lib.rs src/error.rs src/parser.rs -/Users/ruomu/projects/cinrad_g/etws_loader/target/release/deps/libetws_loader.rlib: src/lib.rs src/error.rs src/parser.rs +/Users/tsuki/projects/radar-g/etws_loader/target/release/deps/libetws_loader.rlib: src/lib.rs src/error.rs src/parser.rs -/Users/ruomu/projects/cinrad_g/etws_loader/target/release/deps/etws_loader.d: src/lib.rs src/error.rs src/parser.rs +/Users/tsuki/projects/radar-g/etws_loader/target/release/deps/etws_loader.d: src/lib.rs src/error.rs src/parser.rs src/lib.rs: src/error.rs: diff --git a/etws_loader/target/release/deps/libetws_loader.dylib b/etws_loader/target/release/deps/libetws_loader.dylib index 8f9d44c..d598dbd 100755 Binary files a/etws_loader/target/release/deps/libetws_loader.dylib and b/etws_loader/target/release/deps/libetws_loader.dylib differ diff --git a/etws_loader/target/release/deps/libetws_loader.rlib b/etws_loader/target/release/deps/libetws_loader.rlib index e5e5ee3..1fa321f 100644 Binary files a/etws_loader/target/release/deps/libetws_loader.rlib and b/etws_loader/target/release/deps/libetws_loader.rlib differ diff --git a/etws_loader/target/release/libetws_loader.d b/etws_loader/target/release/libetws_loader.d index 40adfb4..77c9b50 100644 --- a/etws_loader/target/release/libetws_loader.d +++ b/etws_loader/target/release/libetws_loader.d @@ -1 +1 @@ -/Users/ruomu/projects/cinrad_g/etws_loader/target/release/libetws_loader.dylib: /Users/ruomu/projects/cinrad_g/etws_loader/src/error.rs /Users/ruomu/projects/cinrad_g/etws_loader/src/lib.rs /Users/ruomu/projects/cinrad_g/etws_loader/src/parser.rs /Users/ruomu/projects/cinrad_g/radarg_plugin_interface/src/error.rs /Users/ruomu/projects/cinrad_g/radarg_plugin_interface/src/lib.rs +/Users/tsuki/projects/radar-g/etws_loader/target/release/libetws_loader.dylib: /Users/tsuki/projects/radar-g/etws_loader/src/error.rs /Users/tsuki/projects/radar-g/etws_loader/src/lib.rs /Users/tsuki/projects/radar-g/etws_loader/src/parser.rs /Users/tsuki/projects/radar-g/radarg_plugin_interface/src/error.rs /Users/tsuki/projects/radar-g/radarg_plugin_interface/src/lib.rs diff --git a/etws_loader/target/release/libetws_loader.dylib b/etws_loader/target/release/libetws_loader.dylib index 8f9d44c..d598dbd 100755 Binary files a/etws_loader/target/release/libetws_loader.dylib and b/etws_loader/target/release/libetws_loader.dylib differ diff --git a/etws_loader/target/release/libetws_loader.rlib b/etws_loader/target/release/libetws_loader.rlib index e5e5ee3..1fa321f 100644 Binary files a/etws_loader/target/release/libetws_loader.rlib and b/etws_loader/target/release/libetws_loader.rlib differ diff --git a/radarg_plugin_interface/src/lib.rs b/radarg_plugin_interface/src/lib.rs index f7207e7..8a01359 100644 --- a/radarg_plugin_interface/src/lib.rs +++ b/radarg_plugin_interface/src/lib.rs @@ -11,7 +11,8 @@ pub use self::error::Error; /// The identifier for a plugin. #[repr(C)] -#[derive(Debug, Clone, PartialEq, Eq, StableAbi)] +#[derive(Debug, Clone, PartialEq, Eq, StableAbi, Hash)] +#[sabi(impl_InterfaceType(Sync, Send, Debug, Debug, Hash))] pub struct PluginId { pub named: RCowStr<'static>, /// The number of the instance of this Plugin. @@ -24,7 +25,7 @@ pub struct PluginId { pub enum CoordType { Polar, Cartesian, - Other + Other, } pub type PluginType = Plugin_TO<'static, RBox<()>>; @@ -57,11 +58,25 @@ pub enum DataShape { #[derive(StableAbi, Clone, Debug)] #[sabi(impl_InterfaceType(Sync, Send, Debug))] pub enum PluginResultType { + // Single + R, + V, + SW, + CC, + ZDR, + PHIDP, + KDP, + HCA, DBZ, - WIND, - RAIN, QPE, QPF, + VIL, + OHP, + THP, + ET, + EB, + // Unknown + Unknown, } #[repr(C)] @@ -89,6 +104,7 @@ pub struct Block { #[repr(C)] #[derive(Debug, StableAbi)] +#[sabi(impl_InterfaceType(Sync, Send, Debug))] pub struct PluginInfo { pub name: RStr<'static>, pub version: RStr<'static>, @@ -98,7 +114,8 @@ pub struct PluginInfo { } #[sabi_trait] -pub trait Plugin { +#[sabi(impl_InterfaceType(Sync, Send, Debug))] +pub trait Plugin: Send + Sync { fn load(&self, path: RStr<'_>) -> RResult; fn plugin_id(&self) -> &PluginId; fn plugin_info(&self) -> PluginInfo; @@ -110,6 +127,7 @@ pub trait Plugin { /// call ::load_from_directory(some_directory_path) #[repr(C)] #[derive(StableAbi)] +#[sabi(impl_InterfaceType(Sync, Send, Debug))] #[sabi(kind(Prefix(prefix_ref = PluginMod_Ref)))] #[sabi(missing_field(panic))] pub struct PluginMod { diff --git a/src/components/app.rs b/src/components/app.rs index e4eef04..28b0ca5 100644 --- a/src/components/app.rs +++ b/src/components/app.rs @@ -1,17 +1,24 @@ use crate::{ - data::{CoordType, Radar2d}, + data::{self, CoordType, Radar2d}, plugin_system::init_plugin, render::{predefined::color_mapper::BoundaryNorm, Layer}, + PLUGIN_MANAGER, }; -use super::{control_panel::ControlPanelModel, messages::MonitorInputMsg, monitor::MonitorModel}; +use super::{ + control_panel::{ControlPanelInputMsg, ControlPanelModel}, + messages::MonitorInputMsg, + monitor::MonitorModel, + TimelineMsg, +}; use abi_stable::std_types::RStr; +use chrono::{DateTime, Duration, Utc}; use gtk::{ prelude::{ApplicationExt, BoxExt, GtkWindowExt, WidgetExt}, traits::OrientableExt, }; use ndarray::{Array1, Array2, Array3}; -use radarg_plugin_interface::VecResult; +use radarg_plugin_interface::{Block, DataShape, PluginId, VecResult}; use relm4::actions::{AccelsPlus, RelmAction, RelmActionGroup}; use relm4::*; use relm4::{gtk, ComponentParts, ComponentSender, RelmWidgetExt, SimpleComponent}; @@ -28,7 +35,7 @@ pub enum AppMsg { Close, OpenDialog, OpenDialogMulti, - OpenFile(Layer), + OpenFile((DateTime, Layer)), } pub struct AppModel { @@ -117,41 +124,10 @@ impl SimpleComponent for AppModel { .launch(OpenDialogSettings::default()) .forward(sender.input_sender(), |response| match response { OpenDialogResponse::Accept(path) => { - let plugin = init_plugin().unwrap(); + let plugin = PLUGIN_MANAGER.get_plugin_by_name("etws_loader").unwrap(); let mut result = plugin.load(RStr::from_str(path.to_str().unwrap())).unwrap(); let mut block = result.blocks.pop().unwrap(); - - let dim1: Vec<_> = block.dimension_values.remove(2).into(); - let dim2: Vec<_> = block.dimension_values.remove(1).into(); - let data = block.data; - let fill_value = block.fill_value; - let data_shape: Vec = block.size.into(); - - if let VecResult::I8(data) = data { - let array = Array3::from_shape_vec( - [data_shape[0], data_shape[1], data_shape[2]], - data.into(), - ) - .unwrap(); - - let layer = array.index_axis(ndarray::Axis(0), 10).to_owned(); - let data_2d = Radar2d { - dim1: Array1::from_vec(dim1), - dim2: Array1::from_vec(dim2), - data: layer, - fill_value: fill_value as i8, - coord_type: CoordType::LatLon, - }; - let layer_name = "test"; - - AppMsg::OpenFile(Layer::grid_render_layer( - data_2d, - layer_name.to_string(), - BoundaryNorm::default(), - )) - } else { - AppMsg::Close - } + data_to_grid_layer(block) } OpenDialogResponse::Cancel => AppMsg::Close, }); @@ -182,8 +158,16 @@ impl SimpleComponent for AppModel { fn update(&mut self, msg: Self::Input, _sender: ComponentSender) { match msg { - AppMsg::OpenFile(layer) => { + AppMsg::OpenFile((time, layer)) => { self.render.sender().emit(MonitorInputMsg::AddLayer(layer)); + self.control + .sender() + .emit(ControlPanelInputMsg::Selection(Some(time))); + self.control + .sender() + .emit(ControlPanelInputMsg::TimeLine(TimelineMsg::SetStart( + time - Duration::minutes(30), + ))); } AppMsg::CloseRequest => {} AppMsg::Close => {} @@ -194,3 +178,92 @@ impl SimpleComponent for AppModel { } } } + +macro_rules! match_in_macro { + ($block:ident,$name:literal, $(($branch:path, $t:ty, $color:expr)),+) => { + { + match $block.data_type { + $( + $branch => { + let data: $t = $block.into(); + let layer = Layer::grid_render_layer(data, format!($name), $color); + AppMsg::OpenFile((Utc::now() ,layer)) + }, + )+ + _ => AppMsg::Close, + } + } + + }; +} + +fn data_to_grid_layer(block: Block) -> AppMsg { + use crate::utils::*; + use radarg_plugin_interface::PluginResultType; + match block.shape { + DataShape::Matrix => match_in_macro!( + block, + "DBZ", + ( + PluginResultType::DBZ, + Radar2d, + create_dbz_boundarynorm() + ), + (PluginResultType::R, Radar2d, create_dbz_boundarynorm()), + (PluginResultType::V, Radar2d, create_vel_boundarynorm()), + ( + PluginResultType::ZDR, + Radar2d, + create_zdr_boundarynorm() + ), + ( + PluginResultType::PHIDP, + Radar2d, + create_phidp_boundarynorm() + ), + ( + PluginResultType::KDP, + Radar2d, + create_kdp_boundarynorm() + ), + (PluginResultType::CC, Radar2d, create_cc_boundarynorm()), + ( + PluginResultType::HCA, + Radar2d, + create_cpc_boundarynorm() + ), + ( + PluginResultType::QPE, + Radar2d, + create_vil_boundarynorm() + ), + ( + PluginResultType::QPF, + Radar2d, + create_vil_boundarynorm() + ), + ( + PluginResultType::VIL, + Radar2d, + create_vil_boundarynorm() + ), + ( + PluginResultType::OHP, + Radar2d, + create_vil_boundarynorm() + ), + ( + PluginResultType::THP, + Radar2d, + create_vil_boundarynorm() + ), + (PluginResultType::ET, Radar2d, create_et_boundarynorm()), + ( + PluginResultType::EB, + Radar2d, + create_hgt_boundarynorm() + ) + ), + _ => AppMsg::Close, + } +} diff --git a/src/components/control_panel/control_panel.rs b/src/components/control_panel/control_panel.rs index c663c92..50cd62d 100644 --- a/src/components/control_panel/control_panel.rs +++ b/src/components/control_panel/control_panel.rs @@ -1,3 +1,4 @@ +use super::messages::*; use crate::data::{CoordType, Radar2d, RadarData2d}; use crate::plugin_system::init_plugin; use crate::render::predefined::color_mapper::BoundaryNorm; @@ -22,85 +23,14 @@ pub struct ControlPanelModel { timeline_start: DateTime, selection: Option>, #[tracker::no_eq] - open_button: Controller, - #[tracker::no_eq] list_img_wrapper: TypedListView, } -#[derive(Debug, PartialEq, PartialOrd, Ord, Eq)] -struct ImgItem { - time: String, - img: Option, - visiable: bool, -} - -impl ImgItem { - fn new(time: String, img: Option, visiable: bool) -> Self { - Self { - time, - img, - visiable, - } - } -} - -struct Widgets { - img: gtk::Image, -} - -impl RelmListItem for ImgItem { - type Root = gtk::Frame; - type Widgets = Widgets; - - fn setup(_item: >k::ListItem) -> (gtk::Frame, Widgets) { - relm4::view! { - my_box = gtk::Frame { - set_height_request: 70, - set_width_request: 100, - gtk::Box{ - set_margin_all:2, - #[name = "img"] - gtk::Image{} - } - } - } - - let widgets = Widgets { img }; - - (my_box, widgets) - } - - fn bind(&mut self, widgets: &mut Self::Widgets, _root: &mut Self::Root) { - let Widgets { img } = widgets; - } -} - -#[derive(Debug)] -pub enum HeaderOutput { - NewLayer(Layer), -} - -#[derive(Debug)] -pub enum TimelineMsg { - Rewind(Duration), - FastForward(Duration), - SetStart(DateTime), -} - -#[derive(Debug)] -pub enum AppMsg { - Open(PathBuf), - TimeLine(TimelineMsg), - Selection(Option>), - SelectionRewind, - SelectionFastForward, -} - #[relm4::component(pub)] impl SimpleComponent for ControlPanelModel { type Init = i8; - type Output = HeaderOutput; - type Input = AppMsg; + type Output = ControlPanelOutputMsg; + type Input = ControlPanelInputMsg; view! { #[root] @@ -142,7 +72,7 @@ impl SimpleComponent for ControlPanelModel { gtk::Button{ set_icon_name: "rewind-filled", connect_clicked[sender] => move |_| { - sender.input(AppMsg::SelectionRewind); + sender.input(ControlPanelInputMsg::SelectionRewind); }, }, gtk::Button{ @@ -151,7 +81,7 @@ impl SimpleComponent for ControlPanelModel { gtk::Button{ set_icon_name: "fast-forward-filled", connect_clicked[sender] => move |_| { - sender.input(AppMsg::SelectionFastForward); + sender.input(ControlPanelInputMsg::SelectionFastForward); }, } } @@ -186,7 +116,7 @@ impl SimpleComponent for ControlPanelModel { connect_day_selected[sender,pop] => move |cal| { let date = cal.date().ymd(); let date = Utc.with_ymd_and_hms(date.0, date.1 as u32, date.2 as u32, 0,0,0).unwrap(); - sender.input(AppMsg::TimeLine( + sender.input(ControlPanelInputMsg::TimeLine( TimelineMsg::SetStart(date) )); pop.popdown(); @@ -204,7 +134,7 @@ impl SimpleComponent for ControlPanelModel { set_icon_name: "rewind-filled", // add_controller: fastforward_long_press_detector, connect_clicked[sender] => move |_| { - sender.input(AppMsg::TimeLine( + sender.input(ControlPanelInputMsg::TimeLine( TimelineMsg::Rewind(-Duration::minutes(12)) )); }, @@ -219,7 +149,7 @@ impl SimpleComponent for ControlPanelModel { connect_start_time_notify[sender] => move |time| { let time = time.start_time(); sender.input( - AppMsg::Selection( + ControlPanelInputMsg::Selection( if time > i64::MIN { Some(Utc.timestamp_opt(time, 0).unwrap()) } else{ @@ -231,7 +161,7 @@ impl SimpleComponent for ControlPanelModel { gtk::Button{ set_icon_name: "fast-forward-filled", connect_clicked[sender] => move |_| { - sender.input(AppMsg::TimeLine( + sender.input(ControlPanelInputMsg::TimeLine( TimelineMsg::FastForward(Duration::minutes(12)) )); }, @@ -269,15 +199,6 @@ impl SimpleComponent for ControlPanelModel { root: &Self::Root, sender: relm4::ComponentSender, ) -> relm4::ComponentParts { - let open_button = OpenButton::builder() - .launch(OpenButtonSettings { - dialog_settings: OpenDialogSettings::default(), - text: "Open file", - recently_opened_files: Some(".recent_files"), - max_recent_files: 10, - }) - .forward(sender.input_sender(), AppMsg::Open); - let select_model = gtk::StringList::new(&["Option 1", "Option 2", "Option 3", "Editable..."]); let step_selector = gtk::DropDown::from_strings(&["Option 1", "Option 2", "Option 3"]); @@ -290,7 +211,6 @@ impl SimpleComponent for ControlPanelModel { let model = ControlPanelModel { selection: None, timeline_start, - open_button, list_img_wrapper, tracker: 0, }; @@ -303,10 +223,7 @@ impl SimpleComponent for ControlPanelModel { fn update(&mut self, msg: Self::Input, _sender: ComponentSender) { self.reset(); match msg { - AppMsg::Open(p) => { - - } - AppMsg::TimeLine(line_msg) => match line_msg { + ControlPanelInputMsg::TimeLine(line_msg) => match line_msg { TimelineMsg::Rewind(c) | TimelineMsg::FastForward(c) => { let current = self.get_timeline_start().clone(); self.set_timeline_start(current + c); @@ -315,16 +232,16 @@ impl SimpleComponent for ControlPanelModel { self.set_timeline_start(time); } }, - AppMsg::Selection(selection) => { + ControlPanelInputMsg::Selection(selection) => { self.set_selection(selection); } - AppMsg::SelectionRewind => { + ControlPanelInputMsg::SelectionRewind => { let current = self.get_selection().clone(); if let Some(current) = current { self.set_selection(Some(current - Duration::minutes(12))); } } - AppMsg::SelectionFastForward => { + ControlPanelInputMsg::SelectionFastForward => { let current = self.get_selection().clone(); if let Some(current) = current { self.set_selection(Some(current + Duration::minutes(12))); @@ -333,3 +250,48 @@ impl SimpleComponent for ControlPanelModel { } } } + +#[derive(Debug, PartialEq, PartialOrd, Ord, Eq)] +struct ImgItem { + time: String, + img: Option, + visiable: bool, +} + +impl ImgItem { + fn new(time: String, img: Option, visiable: bool) -> Self { + Self { + time, + img, + visiable, + } + } +} +struct Widgets { + img: gtk::Image, +} + +impl RelmListItem for ImgItem { + type Root = gtk::Frame; + type Widgets = Widgets; + + fn setup(_item: >k::ListItem) -> (gtk::Frame, Widgets) { + relm4::view! { + my_box = gtk::Frame { + set_height_request: 70, + set_width_request: 100, + gtk::Box{ + set_margin_all:2, + #[name = "img"] + gtk::Image{} + } + } + } + let widgets = Widgets { img }; + (my_box, widgets) + } + + fn bind(&mut self, widgets: &mut Self::Widgets, _root: &mut Self::Root) { + let Widgets { img } = widgets; + } +} diff --git a/src/components/control_panel/messages.rs b/src/components/control_panel/messages.rs index e69de29..080025d 100644 --- a/src/components/control_panel/messages.rs +++ b/src/components/control_panel/messages.rs @@ -0,0 +1,19 @@ +use chrono::{DateTime, Duration, Utc}; + +#[derive(Debug)] +pub enum TimelineMsg { + Rewind(Duration), + FastForward(Duration), + SetStart(DateTime), +} + +#[derive(Debug)] +pub enum ControlPanelInputMsg { + TimeLine(TimelineMsg), + Selection(Option>), + SelectionRewind, + SelectionFastForward, +} + +#[derive(Debug)] +pub enum ControlPanelOutputMsg {} diff --git a/src/components/control_panel/mod.rs b/src/components/control_panel/mod.rs index acea845..ec7622c 100644 --- a/src/components/control_panel/mod.rs +++ b/src/components/control_panel/mod.rs @@ -1,3 +1,4 @@ mod control_panel; mod messages; pub use control_panel::*; +pub use messages::*; diff --git a/src/components/render_panel/mod.rs b/src/components/render_panel/mod.rs deleted file mode 100644 index 702b137..0000000 --- a/src/components/render_panel/mod.rs +++ /dev/null @@ -1,3 +0,0 @@ -mod messages; -mod render_panel; -pub use render_panel::RenderPanelModel; diff --git a/src/components/render_panel/render_panel.rs b/src/components/render_panel/render_panel.rs deleted file mode 100644 index 82f8637..0000000 --- a/src/components/render_panel/render_panel.rs +++ /dev/null @@ -1,45 +0,0 @@ -use super::messages::RenderInputMsg; -use super::monitor::MonitorModel; -use gtk::prelude::*; -use relm4::component::AsyncComponentController; -use relm4::{ - component::{AsyncComponent, AsyncController}, - RelmWidgetExt, *, -}; - -pub struct RenderPanelModel { - monitor: Controller, - // monitor: AsyncController, -} - -#[relm4::component(pub)] -impl SimpleComponent for RenderPanelModel { - type Init = (); - type Output = (); - type Input = (); - - view! { - gtk::Box{ - set_orientation: gtk::Orientation::Horizontal, - set_hexpand:true, - set_vexpand:true, - model.monitor.widget(), - } - } - - fn init( - init: Self::Init, - root: &Self::Root, - sender: relm4::ComponentSender, - ) -> relm4::ComponentParts { - let monitor: Controller = MonitorModel::builder() - .launch(()) - .forward(sender.input_sender(), |_| {}); - - let model = RenderPanelModel { monitor }; - let widgets = view_output!(); - ComponentParts { model, widgets } - } - - fn update(&mut self, msg: Self::Input, _sender: ComponentSender) {} -} diff --git a/src/config.rs b/src/config.rs new file mode 100644 index 0000000..6f5cb4f --- /dev/null +++ b/src/config.rs @@ -0,0 +1,45 @@ +use crate::errors::ConfigError; +use dirs; +use serde::{Deserialize, Serialize}; +use std::{collections::HashMap, env, io::Write, path::PathBuf}; +use toml; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Config { + pub plugins: HashMap, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct PluginConfig { + pub version: String, +} + +impl Config { + pub fn from_file(path: impl AsRef) -> Result { + let file = std::fs::read_to_string(path)?; + let config = toml::from_str(&file)?; + Ok(config) + } + + pub fn from_env() -> Result { + if let Some(dir_path) = env::var("RADARG_CONFIG") + .ok() + .map(|x| PathBuf::from(x)) + .or(dirs::config_dir()) + { + let path = dir_path.join("radarg.toml"); + println!("{:?}", path); + if path.exists() { + return Ok(Self::from_file(path)?); + } else { + let default_config = Config::default(); + let mut file = std::fs::File::create(path)?; + let ser_config = toml::to_string_pretty(&default_config).unwrap(); + file.write_all(ser_config.as_bytes()); + return Ok(default_config); + } + } + + Err(ConfigError::DefaultConfigError) + } +} diff --git a/src/errors.rs b/src/errors.rs index 36d7615..e15b887 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -17,3 +17,33 @@ pub enum PipelineError { source: ProjError, }, } + +#[derive(Debug, Error)] +pub enum ConfigError { + #[error("")] + IOError(#[from] std::io::Error), + #[error("")] + TomlError(#[from] toml::de::Error), + #[error("")] + VarError(#[from] std::env::VarError), + #[error("Can't find and create default Config")] + DefaultConfigError, +} + +#[derive(Debug, Error)] +pub enum PluginError { + #[error("")] + LibraryError(#[from] abi_stable::library::LibraryError), + #[error("")] + IOError(#[from] std::io::Error), + #[error("")] + ProjError(#[from] ProjError), + #[error("")] + TomlError(#[from] toml::de::Error), + #[error("")] + VarError(#[from] std::env::VarError), + #[error("")] + DefaultConfigError, + #[error("")] + PluginError, +} diff --git a/src/main.rs b/src/main.rs index 7b6c644..25d71e8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,12 +1,14 @@ #![allow(unused)] #![allow(dead_code)] mod utils; +use config::Config; use gtk::gio; -use plugin_system::init_plugin; +use plugin_system::{init_plugin, PluginManager}; use std::ptr; use tokio::runtime::Runtime; mod chart; mod components; +mod config; mod coords; mod data; mod dealers; @@ -19,13 +21,16 @@ mod timeline; mod window; use components::app::AppModel; use once_cell::sync::Lazy; +use std::sync::Mutex; const APP_ID: &str = "org.tsuki.radar_g"; static RUNTIME: Lazy = Lazy::new(|| Runtime::new().expect("Setting up tokio runtime needs to succeed.")); -// static OFFSCREEN: Lazy = Lazy::new(|| OffscreenRenderer::new().expect("Can't create offscreen renderer.")); +static CONFIG: Lazy> = Lazy::new(|| Mutex::new(Config::from_env().unwrap())); + +static PLUGIN_MANAGER: Lazy = Lazy::new(|| PluginManager::new().unwrap()); fn main() { // Load GL pointers from epoxy (GL context management library used by GTK). @@ -52,7 +57,7 @@ fn main() { let relm = relm4::RelmApp::new(APP_ID); initialize_custom_css(); - // init_plugin(); + let pluginmanager = PluginManager::new(); relm.run::(()); } diff --git a/src/plugin_system/mod.rs b/src/plugin_system/mod.rs index 2bb4221..b5a8844 100644 --- a/src/plugin_system/mod.rs +++ b/src/plugin_system/mod.rs @@ -1,4 +1,5 @@ mod utils; +use crate::{config::Config, errors::PluginError}; use abi_stable::{ external_types::crossbeam_channel::{self, RReceiver, RSender}, library::{lib_header_from_path, LibraryError, LibrarySuffix, RawLibrary}, @@ -6,19 +7,19 @@ use abi_stable::{ std_types::{RBox, RErr, ROk, RResult, RSome, RStr, RString, RVec}, }; use core_extensions::*; -use radarg_plugin_interface::{PluginId, PluginMod_Ref, Plugin_TO}; +use radarg_plugin_interface::{Plugin, PluginId, PluginMod_Ref, Plugin_TO}; use std::{ collections::{HashMap, VecDeque}, io, mem, path::{Path, PathBuf}, - sync::Arc, + sync::{Arc, Mutex}, }; fn compute_plugin_path(base_name: &str) -> io::Result { - let debug_dir = "/Users/ruomu/projects/cinrad_g/etws_loader/target/debug" + let debug_dir = "./etws_loader/target/debug" .as_ref_::() .into_::(); - let release_dir = "/Users/ruomu/projects/cinrad_g/etws_loader/target/release" + let release_dir = "./etws_loader/target/release" .as_ref_::() .into_::(); @@ -42,25 +43,54 @@ fn compute_plugin_path(base_name: &str) -> io::Result { .piped(Ok) } -pub fn init_plugin() -> Option>> { - let library_path: PathBuf = match compute_plugin_path("etws_loader") { - Ok(x) => x, - Err(e) => { - return None; - } - }; +pub fn init_plugin( + base_name: impl AsRef, +) -> Result<(PluginId, Plugin_TO<'static, RBox<()>>), PluginError> { + let library_path: PathBuf = compute_plugin_path(base_name.as_ref())?; let res = (|| { let header = lib_header_from_path(&library_path)?; header.init_root_module::() - })(); + })()?; - let plugin_constructor = res.unwrap().new(); + let plugin_constructor = res.new(); let new_id = PluginId { - named: "ETWS".into(), + named: base_name.as_ref().to_owned().into(), instance: 0, }; - let plugin = plugin_constructor(new_id).unwrap(); + let plugin = plugin_constructor(new_id.clone()).unwrap(); - Some(plugin) + Ok((new_id, plugin)) +} + +pub struct PluginManager { + registered_plugins: HashMap>>, +} + +impl PluginManager { + pub fn new() -> Result { + use crate::CONFIG; + let lock = CONFIG.lock().unwrap(); + let mut this = Self { + registered_plugins: HashMap::new(), + }; + for (plugin_name, config) in lock.plugins.iter() { + if let Ok((id, p)) = init_plugin(plugin_name.to_owned()) { + println!("Loaded plugin: {}", plugin_name); + this.registered_plugins.insert(id, p); + } + } + Ok(this) + } + + pub fn get_plugin(&self, id: &PluginId) -> Option<&Plugin_TO<'static, RBox<()>>> { + self.registered_plugins.get(id) + } + + pub fn get_plugin_by_name(&self, name: &str) -> Option<&Plugin_TO<'static, RBox<()>>> { + self.registered_plugins + .iter() + .find(|(id, _)| id.named == name) + .map(|(_, p)| p) + } } diff --git a/src/plugin_system/utils.rs b/src/plugin_system/utils.rs index 22baf6b..534b1b2 100644 --- a/src/plugin_system/utils.rs +++ b/src/plugin_system/utils.rs @@ -1,4 +1,63 @@ -use crate::data::Radar2d; -use ndarray::{Array1, Array2, Array3}; -use num_traits::Num; -use radarg_plugin_interface::{Block, DataShape, PluginResult, VecResult}; \ No newline at end of file +use crate::data::{CoordType, Radar2d}; +use ndarray::{Array1, Array2, Array3, ShapeBuilder}; +use num_traits::{AsPrimitive, FromPrimitive, Num}; +use radarg_plugin_interface::{Block, DataShape, PluginResult, VecResult}; + +macro_rules! match_in_macro { +// ($(($branch:path, $t:ty)),+, $block:ident) + ($block:tt, $(($branch:path, $t:path)),+) => { + { + let data = $block.data; + let dim1: Vec<_> = $block.dimension_values.remove(1).into(); + let dim2: Vec<_> = $block.dimension_values.remove(0).into(); + let fill_value = $block.fill_value; + let data_shape: Vec = $block.size.into(); + let coord_type = match $block.coord_type{ + radarg_plugin_interface::CoordType::Cartesian => CoordType::LatLon, + radarg_plugin_interface::CoordType::Polar => CoordType::Polar, + _ => panic!("Unsupported coord type") + }; + match data { + $( + $branch(x) => { + let shape = [data_shape[0], data_shape[1]]; + Radar2d { + fill_value: T::from_f64(fill_value).unwrap(), + data: Array2::from_shape_vec(shape, x.into_iter().map(|x| $t(x).unwrap()).collect::>()).unwrap(), + dim1: Array1::from_vec(dim1), + dim2: Array1::from_vec(dim2), + coord_type: coord_type, + }}, + )+ + _ => panic!("Unsupported data type"), + } + } + + }; +} + +impl From for Radar2d +where + T: Num + Copy + PartialOrd + PartialEq, + T: FromPrimitive, +{ + fn from(block: Block) -> Self { + let mut block = block; + if let DataShape::Matrix = block.shape { + let result = match_in_macro!( + block, + (VecResult::I8, T::from_i8), + (VecResult::I32, T::from_i32), + (VecResult::I64, T::from_i64), + (VecResult::U8, T::from_u8), + (VecResult::U32, T::from_u32), + (VecResult::U64, T::from_u64), + (VecResult::F32, T::from_f32), + (VecResult::F64, T::from_f64) + ); + result + } else { + panic!("Expected matrix data shape"); + } + } +} diff --git a/src/utils.rs b/src/utils.rs index cb1a3d8..0c811e2 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -1,4 +1,5 @@ use chrono::{DateTime, Utc}; +use femtovg::Color; use gtk::glib::{HasParamSpec, ParamSpecInt64, ParamSpecInt64Builder, ToValue}; use std::{borrow::BorrowMut, num::NonZeroU32}; @@ -10,6 +11,8 @@ use surfman::{ GLVersion, NativeConnection, NativeContext, SurfaceAccess, SurfaceType, }; +use crate::render::predefined::color_mapper::BoundaryNorm; + pub fn meshgrid(x: ArrayView1, y: ArrayView1) -> (Array2, Array2) where T: Clone, @@ -61,3 +64,260 @@ pub fn creator() { renderer.set_screen_target(Some(fbo)); device.destroy_context(&mut context).unwrap(); } + +pub fn create_dbz_boundarynorm() -> BoundaryNorm { + BoundaryNorm::new( + vec![ + -5, 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, + ], + vec![ + Color::rgb(23, 174, 165), + Color::rgb(198, 195, 253), + Color::rgb(124, 114, 236), + Color::rgb(1, 160, 246), + Color::rgb(0, 236, 236), + Color::rgb(0, 216, 0), + Color::rgb(1, 144, 0), + Color::rgb(255, 255, 0), + Color::rgb(231, 192, 0), + Color::rgb(255, 144, 0), + Color::rgb(255, 0, 0), + Color::rgb(214, 0, 0), + Color::rgb(192, 0, 0), + Color::rgb(255, 0, 240), + Color::rgb(150, 0, 180), + Color::rgb(139, 0, 255), + ], + true, + ) +} + +pub fn create_vel_boundarynorm() -> BoundaryNorm { + BoundaryNorm::new( + vec![ + -35.0, -27.0, -20.0, -15.0, -10.0, -5.0, -1.0, 0.0, 1.0, 5.0, 10.0, 15.0, 20.0, 27.0, + 35.0, + ], + vec![ + Color::rgb(0, 224, 255), + Color::rgb(0, 128, 255), + Color::rgb(50, 0, 150), + Color::rgb(0, 251, 144), + Color::rgb(0, 187, 144), + Color::rgb(0, 143, 0), + Color::rgb(205, 192, 159), + Color::rgb(255, 255, 255), + Color::rgb(248, 135, 0), + Color::rgb(255, 207, 0), + Color::rgb(255, 255, 0), + Color::rgb(174, 0, 0), + Color::rgb(208, 112, 0), + Color::rgb(255, 0, 0), + ], + true, + ) +} + +pub fn create_phidp_boundarynorm() -> BoundaryNorm { + BoundaryNorm::new( + vec![ + 0.0, 22.0, 46.0, 68.0, 90.0, 112.0, 136.0, 158.0, 180.0, 202.0, 224.0, 248.0, 270.0, + 292.0, 314.0, 359.0, + ], + vec![ + Color::rgb(0, 60, 255), + Color::rgb(0, 239, 239), + Color::rgb(0, 186, 191), + Color::rgb(0, 131, 125), + Color::rgb(0, 137, 56), + Color::rgb(0, 183, 41), + Color::rgb(0, 218, 13), + Color::rgb(0, 255, 0), + Color::rgb(255, 255, 59), + Color::rgb(255, 240, 0), + Color::rgb(255, 198, 0), + Color::rgb(255, 165, 0), + Color::rgb(255, 114, 0), + Color::rgb(255, 31, 0), + Color::rgb(193, 0, 0), + ], + true, + ) +} + +pub fn create_zdr_boundarynorm() -> BoundaryNorm { + BoundaryNorm::new( + vec![ + -5.0, -4.5, -4.0, -3.5, -3.0, -2.5, -2.0, -1.5, -1.0, -0.5, 0.0, 0.5, 1.0, + ], + vec![ + Color::rgb(70, 70, 70), + Color::rgb(80, 80, 80), + Color::rgb(90, 90, 90), + Color::rgb(100, 100, 100), + Color::rgb(110, 110, 110), + Color::rgb(120, 120, 120), + Color::rgb(130, 130, 130), + Color::rgb(140, 140, 140), + Color::rgb(150, 150, 150), + Color::rgb(175, 175, 175), + Color::rgb(200, 200, 200), + Color::rgb(220, 240, 220), + Color::rgb(0, 192, 39), + ], + true, + ) +} + +pub fn create_cc_boundarynorm() -> BoundaryNorm { + BoundaryNorm::new( + vec![ + 0.0, 0.1, 0.3, 0.5, 0.6, 0.7, 0.8, 0.85, 0.9, 0.92, 0.94, 0.95, 0.96, 0.97, 0.98, 0.99, + ], + vec![ + Color::rgb(0, 60, 255), + Color::rgb(0, 239, 239), + Color::rgb(0, 186, 191), + Color::rgb(0, 131, 125), + Color::rgb(0, 137, 56), + Color::rgb(0, 183, 41), + Color::rgb(0, 218, 13), + Color::rgb(0, 255, 0), + Color::rgb(255, 255, 59), + Color::rgb(255, 240, 0), + Color::rgb(255, 198, 0), + Color::rgb(255, 165, 0), + Color::rgb(255, 114, 0), + Color::rgb(255, 31, 0), + Color::rgb(193, 0, 0), + ], + true, + ) +} + +pub fn create_vil_boundarynorm() -> BoundaryNorm { + BoundaryNorm::new( + vec![ + 1.0, 5.0, 10.0, 15.0, 20.0, 25.0, 30.0, 35., 40., 45., 50., 55., 60., 65., 70., + ], + vec![ + Color::rgb(156, 156, 156), + Color::rgb(118, 118, 118), + Color::rgb(250, 170, 170), + Color::rgb(238, 140, 140), + Color::rgb(201, 112, 112), + Color::rgb(0, 251, 144), + Color::rgb(0, 187, 0), + Color::rgb(255, 255, 112), + Color::rgb(208, 208, 96), + Color::rgb(255, 96, 96), + Color::rgb(218, 0, 0), + Color::rgb(174, 0, 0), + Color::rgb(0, 0, 255), + Color::rgb(255, 255, 255), + ], + true, + ) +} + +pub fn create_hgt_boundarynorm() -> BoundaryNorm { + BoundaryNorm::new( + vec![ + 0.0, 2.0, 3.0, 5.0, 6.0, 8.0, 9.0, 11., 12., 14., 15., 17., 18., 20., 21., + ], + vec![ + Color::rgb(0, 0, 0), + Color::rgb(118, 118, 118), + Color::rgb(0, 224, 255), + Color::rgb(0, 176, 255), + Color::rgb(0, 144, 204), + Color::rgb(50, 0, 150), + Color::rgb(0, 251, 144), + Color::rgb(0, 187, 0), + Color::rgb(0, 239, 0), + Color::rgb(254, 191, 0), + Color::rgb(255, 255, 0), + Color::rgb(174, 0, 0), + Color::rgb(255, 0, 0), + Color::rgb(255, 255, 255), + ], + true, + ) +} + +pub fn create_et_boundarynorm() -> BoundaryNorm { + BoundaryNorm::new( + vec![ + 0.1, 0.2, 0.5, 1.0, 1.5, 2.0, 3.0, 5.0, 6.0, 8.0, 9.0, 11.0, 12.0, 14.0, 15.0, 17.0, + 18.0, 20.0, 21.0, + ], + vec![ + Color::rgb(204, 253, 255), + Color::rgb(153, 248, 255), + Color::rgb(101, 239, 255), + Color::rgb(50, 227, 255), + Color::rgb(134, 255, 134), + Color::rgb(80, 255, 80), + Color::rgb(0, 241, 1), + Color::rgb(0, 187, 0), + Color::rgb(255, 255, 84), + Color::rgb(255, 240, 0), + Color::rgb(255, 191, 0), + Color::rgb(255, 168, 0), + Color::rgb(255, 89, 89), + Color::rgb(255, 64, 64), + Color::rgb(255, 13, 13), + Color::rgb(237, 0, 0), + Color::rgb(205, 0, 0), + Color::rgb(139, 0, 0), + ], + true, + ) +} + +pub fn create_cpc_boundarynorm() -> BoundaryNorm { + BoundaryNorm::new( + vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], + vec![ + Color::rgb(201, 196, 191), + Color::rgb(112, 188, 73), + Color::rgb(245, 163, 110), + Color::rgb(208, 119, 52), + Color::rgb(234, 37, 47), + Color::rgb(199, 53, 47), + Color::rgb(145, 71, 152), + Color::rgb(178, 177, 65), + Color::rgb(103, 199, 208), + Color::rgb(55, 90, 165), + Color::rgb(187, 165, 204), + ], + true, + ) +} + +pub fn create_kdp_boundarynorm() -> BoundaryNorm { + BoundaryNorm::new( + vec![ + -0.8, -0.4, -0.2, -0.1, 0.1, 0.15, 0.22, 0.33, 0.5, 0.75, 1.1, 1.7, 2.4, 3.1, 7.0, 20.0, + ], + vec![ + Color::rgb(0, 255, 255), + Color::rgb(0, 239, 239), + Color::rgb(0, 168, 172), + Color::rgb(180, 180, 180), + Color::rgb(180, 180, 180), + Color::rgb(0, 192, 39), + Color::rgb(0, 232, 10), + Color::rgb(36, 255, 36), + Color::rgb(255, 255, 30), + Color::rgb(255, 230, 0), + Color::rgb(255, 188, 0), + Color::rgb(255, 152, 0), + Color::rgb(255, 94, 0), + Color::rgb(242, 15, 0), + Color::rgb(187, 0, 58), + Color::rgb(253, 6, 253), + ], + true, + ) +} diff --git a/test.py b/test.py new file mode 100644 index 0000000..420e26d --- /dev/null +++ b/test.py @@ -0,0 +1,76 @@ +import re + +def hex_to_rgb(hex_color): + hex_color = hex_color.lstrip('#') + return tuple(int(hex_color[i:i+2], 16) for i in (0, 2, 4)) + +COLOR = { + 'dbz': { + 'colors': ['#17AEA5','#C6C3FD',"#7C72EC","#01a0f6", "#00ecec", "#00d800", "#019000", "#ffff00", "#e7c000", "#ff9000", "#ff0000", "#d60000","#c00000", "#ff00f0", "#9600b4", "#8b00ff"], + 'numbar': [-5,0,5,10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75], + }, + + 'vel': { + 'colors': ["#00e0ff", "#0080ff", "#320096", "#00fb90", "#00bb90", "#008f00", "#cdc09f", "#ffffff", "#f88700", + "#ffcf00", "#ffff00", "#ae0000", "#d07000", "#ff0000"], + 'numbar': [-35, -27, -20, -15, -10, -5, -1, 0, 1, 5, 10, 15, 20, 27, 35], + }, + 'W': { + 'colors': ["#e0e0e0", "#7ce0e0", "#00e0e0", "#00b0b0", "#00fefe", "#00c400", "#008000", "#fefe00", "#fed200", + "#fe7c00", "#feb0b0", "#fe5858", "#fe0000", "#fefefe"], + 'numbar': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 16], + }, + 'PhiDP': { + 'colors': ["#003cff", "#00efef", "#00babf", "#00837d", "#008938", "#00b729", "#00da0d", "#00ff00", "#ffff3b", + "#fff000", "#ffc600", "#ffa500", "#ff7200", "#ff1f00", "#c10000"], + 'numbar': [0, 22, 46, 68, 90, 112, 136, 158, 180, 202, 224, 248, 270, 292, 314, 359], + }, + 'KDP': { + 'colors': ["#00ffff", "#00efef", "#00a8ac", "#b4b4b4", "#b4b4b4", "#00c027", "#00e80a", "#24ff24", "#ffff1e", + "#ffe600", "#ffbc00", "#ff9800", "#ff5e00", "#f20f00", "#bb003a",'#FD06FD'], + 'numbar': [-0.8, -0.4, -0.2, -0.1, 0.1, 0.15, 0.22, 0.33, 0.5, 0.75, 1.1, 1.7, 2.4, 3.1, 7, 20], + }, + 'ZDR': { + 'colors': ["#464646", '#505050','#5A5A5A','#646464',"#6e6e6e",'#787878', '#828282','#8C8C8C',"#969696", '#AFAFAF', "#c8c8c8","#dcf0dc", "#00c027", "#00e80a", "#24ff24", + "#ffff1e","#FEF133", '#FEE52D',"#ffbc00", "#ff9800", "#ff5e00", "#f20f00", "#bb003a",'#DB009B','#FD06FD'], + 'numbar': [-5,-4.5,-4,-3.5, -3,-2.5,-2,-1.5, -1, -0.5, 0, 0.5, 1, 1.5, 2, 2.5,3, 3.5, 4, 4.5, 5, 5.5, 6,6.5, 7,8], + }, + 'LDR': { + 'colors': ["#c80300", "#c80300", "#fd250f", "#fe6f02", "#fdaa0a", "#fbcb00", "#f3ee04", "#fbfa38", "#00f400", + "#02d303", "#12c434", "#058e3e", "#058174", "#0ac2c7", "#02f0f0"], + 'numbar': [-30, -28, -26, -24, -22, -20, -18, -16, -14, -12, -10, -9, -8, -7, -6, -5], + }, + 'CC': { + 'colors': ["#003cff", "#00efef", "#00babf", "#00837d", "#008938", "#00b729", "#00da0d", "#00ff00", "#ffff3b", + "#fff000", "#ffc600", "#ffa500", "#ff7200", "#ff1f00", "#c10000"], + 'numbar': [0, 0.1, 0.3, 0.5, 0.6, 0.7, 0.8, 0.85, 0.9, 0.92, 0.94, 0.95, 0.96, 0.97, 0.98, 0.99], + }, + 'VIL': { + 'colors': ["#9c9c9c", "#767676", "#faaaaa", "#ee8c8c", "#c97070", "#00fb90", "#00bb00", "#ffff70", "#d0d060", + "#ff6060", "#da0000", "#ae0000", "#0000ff", "#ffffff"], + 'numbar': [1, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70], + }, + 'HGT': { + 'colors': ["#000000", "#767676", "#00e0ff", "#00b0ff", "#0090cc", "#320096", "#00fb90", "#00bb00", "#00ef00", + "#febf00", "#ffff00", "#ae0000", "#ff0000", "#ffffff"], + 'numbar': [0, 2, 3, 5, 6, 8, 9, 11, 12, 14, 15, 17, 18, 20, 21], + }, + 'CPC': { + 'colors': ["#C9C4BF", "#70BC49", "#F5A36E", "#D07734", "#EA252F", "#C7352F", "#914798", + "#B2B141", "#67C7D0", "#375AA5", "#BBA5CC"], + 'numbar': [0,1,2,3,4,5,6,7,8,9,10,11], + }, +} + +for key, value in COLOR.items(): + print(f"{key}: Self {{") + print(" boundaries: vec![", end="") + print(*value['numbar'], sep=", ", end="") + print("],") + print(" extrand: true,") + print(" colors: vec![") + for color in value['colors']: + rgb = hex_to_rgb(color) + print(f" Color::rgb{rgb},") + print(" ],") + print("},") \ No newline at end of file diff --git a/test.txt b/test.txt new file mode 100644 index 0000000..c9c604e --- /dev/null +++ b/test.txt @@ -0,0 +1,57 @@ +COLOR = { + 'dbz': { + 'colors': ['#17AEA5','#C6C3FD',"#7C72EC","#01a0f6", "#00ecec", "#00d800", "#019000", "#ffff00", "#e7c000", "#ff9000", "#ff0000", "#d60000","#c00000", "#ff00f0", "#9600b4", "#8b00ff"], + 'numbar': [-5,0,5,10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75], + }, + + 'vel': { + 'colors': ["#00e0ff", "#0080ff", "#320096", "#00fb90", "#00bb90", "#008f00", "#cdc09f", "#ffffff", "#f88700", + "#ffcf00", "#ffff00", "#ae0000", "#d07000", "#ff0000"], + 'numbar': [-35, -27, -20, -15, -10, -5, -1, 0, 1, 5, 10, 15, 20, 27, 35], + }, + 'W': { + 'colors': ["#e0e0e0", "#7ce0e0", "#00e0e0", "#00b0b0", "#00fefe", "#00c400", "#008000", "#fefe00", "#fed200", + "#fe7c00", "#feb0b0", "#fe5858", "#fe0000", "#fefefe"], + 'numbar': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 16], + }, + 'PhiDP': { + 'colors': ["#003cff", "#00efef", "#00babf", "#00837d", "#008938", "#00b729", "#00da0d", "#00ff00", "#ffff3b", + "#fff000", "#ffc600", "#ffa500", "#ff7200", "#ff1f00", "#c10000"], + 'numbar': [0, 22, 46, 68, 90, 112, 136, 158, 180, 202, 224, 248, 270, 292, 314, 359], + }, + 'KDP': { + 'colors': ["#00ffff", "#00efef", "#00a8ac", "#b4b4b4", "#b4b4b4", "#00c027", "#00e80a", "#24ff24", "#ffff1e", + "#ffe600", "#ffbc00", "#ff9800", "#ff5e00", "#f20f00", "#bb003a",'#FD06FD'], + 'numbar': [-0.8, -0.4, -0.2, -0.1, 0.1, 0.15, 0.22, 0.33, 0.5, 0.75, 1.1, 1.7, 2.4, 3.1, 7, 20], + }, + 'ZDR': { + 'colors': ["#464646", '#505050','#5A5A5A','#646464',"#6e6e6e",'#787878', '#828282','#8C8C8C',"#969696", '#AFAFAF', "#c8c8c8","#dcf0dc", "#00c027", "#00e80a", "#24ff24", + "#ffff1e","#FEF133", '#FEE52D',"#ffbc00", "#ff9800", "#ff5e00", "#f20f00", "#bb003a",'#DB009B','#FD06FD'], + 'numbar': [-5,-4.5,-4,-3.5, -3,-2.5,-2,-1.5, -1, -0.5, 0, 0.5, 1, 1.5, 2, 2.5,3, 3.5, 4, 4.5, 5, 5.5, 6,6.5, 7,8], + }, + 'LDR': { + 'colors': ["#c80300", "#c80300", "#fd250f", "#fe6f02", "#fdaa0a", "#fbcb00", "#f3ee04", "#fbfa38", "#00f400", + "#02d303", "#12c434", "#058e3e", "#058174", "#0ac2c7", "#02f0f0"], + 'numbar': [-30, -28, -26, -24, -22, -20, -18, -16, -14, -12, -10, -9, -8, -7, -6, -5], + }, + 'CC': { + 'colors': ["#003cff", "#00efef", "#00babf", "#00837d", "#008938", "#00b729", "#00da0d", "#00ff00", "#ffff3b", + "#fff000", "#ffc600", "#ffa500", "#ff7200", "#ff1f00", "#c10000"], + 'numbar': [0, 0.1, 0.3, 0.5, 0.6, 0.7, 0.8, 0.85, 0.9, 0.92, 0.94, 0.95, 0.96, 0.97, 0.98, 0.99], + }, + 'VIL': { + 'colors': ["#9c9c9c", "#767676", "#faaaaa", "#ee8c8c", "#c97070", "#00fb90", "#00bb00", "#ffff70", "#d0d060", + "#ff6060", "#da0000", "#ae0000", "#0000ff", "#ffffff"], + 'numbar': [1, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70], + }, + 'HGT': { + 'colors': ["#000000", "#767676", "#00e0ff", "#00b0ff", "#0090cc", "#320096", "#00fb90", "#00bb00", "#00ef00", + "#febf00", "#ffff00", "#ae0000", "#ff0000", "#ffffff"], + 'numbar': [0, 2, 3, 5, 6, 8, 9, 11, 12, 14, 15, 17, 18, 20, 21], + }, + 'CPC': { + 'colors': ["#C9C4BF", "#70BC49", "#F5A36E", "#D07734", "#EA252F", "#C7352F", "#914798", + "#B2B141", "#67C7D0", "#375AA5", "#BBA5CC"], + 'numbar': [0,1,2,3,4,5,6,7,8,9,10,11], + }, +} \ No newline at end of file diff --git a/test2.txt b/test2.txt new file mode 100644 index 0000000..8645216 --- /dev/null +++ b/test2.txt @@ -0,0 +1 @@ +dbz: Self { \ No newline at end of file