diff --git a/etws_loader/target/.rustc_info.json b/etws_loader/target/.rustc_info.json index 0d726c4..14533f6 100644 --- a/etws_loader/target/.rustc_info.json +++ b/etws_loader/target/.rustc_info.json @@ -1 +1 @@ -{"rustc_fingerprint":8475780184195034948,"outputs":{"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":""},"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":""}},"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 2c44dc7..9458257 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,7 @@ -{"message":"unused imports: `Write`, `self`","code":{"code":"unused_imports","explanation":null},"level":"warning","spans":[{"file_name":"src/parser.rs","byte_start":323,"byte_end":327,"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":335,"byte_end":340,"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":323,"byte_end":329,"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":333,"byte_end":340,"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: `RNone`","code":{"code":"unused_imports","explanation":null},"level":"warning","spans":[{"file_name":"src/lib.rs","byte_start":180,"byte_end":185,"line_start":9,"line_end":9,"column_start":9,"column_end":14,"is_primary":true,"text":[{"text":" RNone, ROk,","highlight_start":9,"highlight_end":14}],"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":180,"byte_end":187,"line_start":9,"line_end":9,"column_start":9,"column_end":16,"is_primary":true,"text":[{"text":" RNone, ROk,","highlight_start":9,"highlight_end":16}],"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: `RNone`\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--> \u001b[0m\u001b[0msrc/lib.rs:9: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;12m9\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m RNone, ROk,\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":6651,"byte_end":6656,"line_start":198,"line_end":198,"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":6651,"byte_end":6656,"line_start":198,"line_end":198,"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:198: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;12m198\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":9035,"byte_end":9040,"line_start":279,"line_end":279,"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":9035,"byte_end":9040,"line_start":279,"line_end":279,"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:279: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;12m279\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":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":"variants `I64` and `U64` are never constructed","code":{"code":"dead_code","explanation":null},"level":"warning","spans":[{"file_name":"src/parser.rs","byte_start":563,"byte_end":573,"line_start":28,"line_end":28,"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":580,"byte_end":583,"line_start":29,"line_end":29,"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":616,"byte_end":619,"line_start":33,"line_end":33,"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:29: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;12m28\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;12m29\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;12m33\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":323,"byte_end":327,"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":335,"byte_end":340,"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":323,"byte_end":329,"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":333,"byte_end":340,"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 import: `RNone`","code":{"code":"unused_imports","explanation":null},"level":"warning","spans":[{"file_name":"src/lib.rs","byte_start":180,"byte_end":185,"line_start":9,"line_end":9,"column_start":9,"column_end":14,"is_primary":true,"text":[{"text":" RNone, ROk,","highlight_start":9,"highlight_end":14}],"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":180,"byte_end":187,"line_start":9,"line_end":9,"column_start":9,"column_end":16,"is_primary":true,"text":[{"text":" RNone, ROk,","highlight_start":9,"highlight_end":16}],"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: `RNone`\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--> \u001b[0m\u001b[0msrc/lib.rs:9: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;12m9\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m RNone, ROk,\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_type":"diagnostic","message":"unused variable: `hlen2`","code":{"code":"unused_variables","explanation":null},"level":"warning","spans":[{"file_name":"src/parser.rs","byte_start":6651,"byte_end":6656,"line_start":198,"line_end":198,"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":6651,"byte_end":6656,"line_start":198,"line_end":198,"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:198: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;12m198\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":9035,"byte_end":9040,"line_start":279,"line_end":279,"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":9035,"byte_end":9040,"line_start":279,"line_end":279,"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:279: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;12m279\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":563,"byte_end":573,"line_start":28,"line_end":28,"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":580,"byte_end":583,"line_start":29,"line_end":29,"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":616,"byte_end":619,"line_start":33,"line_end":33,"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:29: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;12m28\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;12m29\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;12m33\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":"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"} 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 87027ea..99a5167 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 8b0f810..8aac226 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 87027ea..99a5167 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 8b0f810..8aac226 100644 Binary files a/etws_loader/target/release/libetws_loader.rlib and b/etws_loader/target/release/libetws_loader.rlib differ diff --git a/src/components/app.rs b/src/components/app.rs index 38799e2..ae4491a 100644 --- a/src/components/app.rs +++ b/src/components/app.rs @@ -225,13 +225,6 @@ impl Component for AppModel { let buffer: Buffer = Rc::new(RefCell::new(HashMap::new())); let mut dispatcher = Dispatcher::new(5, 5, chrono::Duration::minutes(1), buffer.clone()); - let mut path_format = HashMap::new(); - - path_format.insert( - format!("DBZ"), - format!("/Volumes/data2/RadarArray/HangZhou/radarData/OutputProducts/RadarProducts/BasicProductsX/%Y%m%d/%Y%m%d%H%M%S/ZJHZAA_%Y%m%d%H%M%S_ET.dat.gz"), - ); - dispatcher.set_path_format(path_format); let model = AppModel { buffer: buffer, @@ -489,7 +482,7 @@ impl AppModel { sender.send(tex.unwrap()).unwrap(); new_sender .command_sender() - .emit(AppCommand::TestBuffer((format!("DBZ"), r))); + .emit(AppCommand::TestBuffer((r.layer.name.clone(), r))); } }) as BoxFuture<'static, ()> }; diff --git a/src/components/setting/dispatcher_list.rs b/src/components/setting/dispatcher_list.rs new file mode 100644 index 0000000..a5c4aab --- /dev/null +++ b/src/components/setting/dispatcher_list.rs @@ -0,0 +1,65 @@ +use abi_stable::traits::IntoReprC; +use adw::prelude::*; +use gtk::prelude::*; +use relm4::{factory::FactoryView, gtk, prelude::*, FactorySender}; + +#[derive(Debug)] +pub enum Msg {} + +#[derive(Debug)] +pub enum OutputMsg { + Update((String, String)), +} + +pub struct PathItem { + title: String, + path: String, +} + +impl PathItem { + pub fn new(title: String, path: String) -> Self { + Self { title, path } + } +} + +#[relm4::factory(pub)] +impl FactoryComponent for PathItem { + type ParentWidget = adw::PreferencesGroup; + type ParentInput = super::SettingMsg; + type Input = (); + type Output = OutputMsg; + type Init = PathItem; + type CommandOutput = (); + + view! { + #[root] + adw::EntryRow{ + set_title: &self.title, + set_text: &self.path, + set_max_width_chars:100, + connect_changed[sender] => move |s|{ + let key = s.title().clone().into(); + sender.output(OutputMsg::Update((key,s.text().to_string()))); + }, + add_suffix=>k::Switch{ + set_height_request: 10, + set_margin_vertical:15, + set_hexpand: false, + set_vexpand: false + } + } + + } + fn init_model(init: Self::Init, index: &DynamicIndex, sender: FactorySender) -> Self { + init + } + fn update(&mut self, message: Self::Input, sender: FactorySender) {} + fn forward_to_parent(_output: Self::Output) -> Option { + match _output { + OutputMsg::Update((k, v)) => Some(super::SettingMsg::PathFormats(( + "etws_loader".to_string(), + (k, v), + ))), + } + } +} diff --git a/src/components/setting/messages.rs b/src/components/setting/messages.rs index 1d0a51a..355ef12 100644 --- a/src/components/setting/messages.rs +++ b/src/components/setting/messages.rs @@ -1,5 +1,4 @@ - #[derive(Debug)] pub enum SettingMsg { - -} \ No newline at end of file + PathFormats((String, (String, String))), +} diff --git a/src/components/setting/mod.rs b/src/components/setting/mod.rs index ff94d2f..4a14321 100644 --- a/src/components/setting/mod.rs +++ b/src/components/setting/mod.rs @@ -1,4 +1,5 @@ +pub mod dispatcher_list; pub mod messages; pub mod setting; +pub use messages::*; pub use setting::*; -pub use messages::*; \ No newline at end of file diff --git a/src/components/setting/setting.rs b/src/components/setting/setting.rs index 84192d9..2792d05 100644 --- a/src/components/setting/setting.rs +++ b/src/components/setting/setting.rs @@ -1,19 +1,25 @@ +use super::dispatcher_list::PathItem; use crate::{ + config::PATH_FORMATS, data::{self, CoordType, Radar2d}, widgets::render::{predefined::color_mapper::BoundaryNorm, Layer}, - PLUGIN_MANAGER, + CONFIG, PLUGIN_MANAGER, }; use adw::prelude::*; use gtk::{prelude::*, traits::OrientableExt}; -use relm4::*; +use relm4::factory::{DynamicIndex, FactoryComponent, FactorySender, FactoryVecDeque}; use relm4::{gtk, ComponentParts, ComponentSender, RelmWidgetExt, SimpleComponent}; +use relm4::{typed_list_view::TypedListView, *}; use relm4_components::open_dialog::{ OpenDialog, OpenDialogMsg, OpenDialogResponse, OpenDialogSettings, }; +use std::{borrow::BorrowMut, collections::HashMap, path}; use super::SettingMsg; -pub struct SettingModel {} +pub struct SettingModel { + path_list: FactoryVecDeque, +} #[relm4::component(pub)] impl SimpleComponent for SettingModel { @@ -48,7 +54,15 @@ impl SimpleComponent for SettingModel { set_margin_start:10, set_margin_end:10, }} - } + }, + path_page = adw::PreferencesPage{ + set_title:"Paths", + #[local_ref] + add=my_view -> adw::PreferencesGroup{ + set_title:"Add", + } + }, + stack.add_titled(&path_page, None, "Paths"), } @@ -57,26 +71,38 @@ impl SimpleComponent for SettingModel { root: &Self::Root, sender: ComponentSender, ) -> ComponentParts { - let model = SettingModel {}; + let mut path_list = + FactoryVecDeque::new(adw::PreferencesGroup::new(), sender.input_sender()); + { + let config = CONFIG.lock().unwrap(); + let etws_config = config.plugins.get("etws_loader").unwrap(); + let paths = etws_config.path_formats.as_ref().unwrap_or(&PATH_FORMATS); + let mut list_guard = path_list.guard(); + for p in paths { + list_guard.push_back(PathItem::new(p.0.clone(), p.1.clone())); + } + } + let model = SettingModel { path_list }; + + let my_view = model.path_list.widget(); let general_page = gtk::Box::new(gtk::Orientation::Vertical, 10); - - let plugin_page = gtk::Box::new(gtk::Orientation::Vertical, 10); - let preferences = adw::PreferencesPage::new(); - let group = adw::PreferencesGroup::new(); - group.set_title("Plugins"); - let entry_row = adw::EntryRow::new(); - entry_row.set_title("Plugin Path"); - group.add(&entry_row); - preferences.add(&group); - preferences.set_parent(&plugin_page); - let widgets = view_output!(); - let stack = widgets.stack.clone(); - - stack.add_titled(&plugin_page, None, "Plugins"); ComponentParts { model, widgets } } - fn update(&mut self, msg: Self::Input, _sender: ComponentSender) {} + fn update(&mut self, msg: Self::Input, _sender: ComponentSender) { + match msg { + SettingMsg::PathFormats((plugin, (k, v))) => { + let mut config = CONFIG.lock().unwrap(); + let mut pluging_cfg = config.plugins.get_mut(&plugin).unwrap(); + if pluging_cfg.path_formats.is_none() { + pluging_cfg.path_formats = Some(HashMap::new()); + } + pluging_cfg.path_formats.as_mut().unwrap().insert(k, v); + let mut list_guard = self.path_list.guard(); + // list_guard.push_back(PathItem::new(k, v)); + } + } + } } diff --git a/src/config.rs b/src/config.rs index 6f5cb4f..7310c15 100644 --- a/src/config.rs +++ b/src/config.rs @@ -4,6 +4,29 @@ use serde::{Deserialize, Serialize}; use std::{collections::HashMap, env, io::Write, path::PathBuf}; use toml; +lazy_static! { + pub static ref PATH_FORMATS: HashMap = { + let mut map = HashMap::new(); + map.insert("R".to_string(), String::new()); + map.insert("V".to_string(), String::new()); + map.insert("SW".to_string(), String::new()); + map.insert("CC".to_string(), String::new()); + map.insert("ZDR".to_string(), String::new()); + map.insert("PHIDP".to_string(), String::new()); + map.insert("KDP".to_string(), String::new()); + map.insert("HCA".to_string(), String::new()); + map.insert("DBZ".to_string(), String::new()); + map.insert("QPE".to_string(), String::new()); + map.insert("QPF".to_string(), String::new()); + map.insert("VIL".to_string(), String::new()); + map.insert("OHP".to_string(), String::new()); + map.insert("THP".to_string(), String::new()); + map.insert("ET".to_string(), String::new()); + map.insert("EB".to_string(), String::new()); + map + }; +} + #[derive(Debug, Serialize, Deserialize, Default)] pub struct Config { pub plugins: HashMap, @@ -12,6 +35,7 @@ pub struct Config { #[derive(Debug, Serialize, Deserialize)] pub struct PluginConfig { pub version: String, + pub path_formats: Option>, } impl Config { diff --git a/src/main.rs b/src/main.rs index 6263f3f..cdd5e6b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -11,7 +11,7 @@ use gtk::{ prelude::SettingsExt, }; use plugin_system::{init_plugin, PluginManager}; -use std::{sync::Mutex, ptr}; +use std::{ptr, sync::Mutex}; use tokio::runtime::Runtime; mod chart; mod components; @@ -22,7 +22,7 @@ mod errors; mod pipeline; mod plugin_system; use components::app::AppModel; -use once_cell::{unsync::Lazy as UnsafeLazy, sync::Lazy as SafeLazy}; +use once_cell::{sync::Lazy as SafeLazy, unsync::Lazy as UnsafeLazy}; use tracing::info; use tracing_subscriber; mod widgets; @@ -34,7 +34,7 @@ static RUNTIME: SafeLazy = static CONFIG: SafeLazy> = SafeLazy::new(|| Mutex::new(Config::from_env().unwrap())); static PLUGIN_MANAGER: SafeLazy = SafeLazy::new(|| PluginManager::new().unwrap()); -static SETTING: UnsafeLazy = UnsafeLazy::new(|| Settings::new(APP_ID)); +// static SETTING: UnsafeLazy = UnsafeLazy::new(|| Settings::new(APP_ID)); fn main() { // Load GL pointers from epoxy (GL context management library used by GTK). diff --git a/src/pipeline/utils.rs b/src/pipeline/utils.rs index dfdf995..35bd728 100644 --- a/src/pipeline/utils.rs +++ b/src/pipeline/utils.rs @@ -4,6 +4,7 @@ use crate::components::app::Buffer; use crate::coords::proj::Mercator; use crate::coords::Mapper; use crate::widgets::{Render, Target, TargetType, CMS}; +use crate::CONFIG; use crate::{data::Radar2d, errors::RenderError, widgets::Layer, PLUGIN_MANAGER}; use chrono::{prelude::*, Duration}; use euclid::approxord::max; @@ -202,7 +203,6 @@ impl Pipeline { pub struct Dispatcher { datetime: DateTime, - path_format: HashMap, fore_len: usize, back_len: usize, step: Duration, @@ -216,9 +216,13 @@ impl Dispatcher { step: Duration, registered_buffer: Buffer, ) -> Self { + // let config = CONFIG.lock().unwrap(); + // let config = CONFIG.lock().unwrap(); + // let etws_loader = CONFIG.lock().unwrap().plugins.get("etws_loader").unwrap(); + // let format = etws_loader.path_formats.as_ref(); Self { datetime: Utc::now(), - path_format: HashMap::new(), + // path_format: format, fore_len, back_len, step, @@ -226,9 +230,9 @@ impl Dispatcher { } } - pub fn set_path_format(&mut self, formats: HashMap) { - self.path_format = formats; - } + // pub fn set_path_format(&mut self, formats: HashMap) { + // self.path_format = formats; + // } pub fn set_current_time(&mut self, datetime: DateTime) { self.datetime = datetime; @@ -254,7 +258,17 @@ impl Dispatcher { ) -> Option { let datetime_format: regex::Regex = Regex::new(r"(?:%[YHMSmd](?:[-/:_]?%[YHMSmd])*)").unwrap(); - let c = self.path_format.get(name).map(|s| { + let config = CONFIG.lock().unwrap(); + let path_format = config + .plugins + .get("etws_loader") + .unwrap() + .path_formats + .as_ref(); + if path_format.is_none() { + return None; + } + let c = path_format.unwrap().get(name).map(|s| { let path = s.clone(); let need_formated = datetime_format.captures_iter(&path).collect::>(); let mut result_path = path.clone(); @@ -290,7 +304,17 @@ impl Dispatcher { ) -> Option)>> { let datetime_format: regex::Regex = Regex::new(r"(?:%[YHMSmd](?:[-/:_]?%[YHMSmd])*)").unwrap(); - self.path_format.get(name).map(|s| { + let config = CONFIG.lock().unwrap(); + let path_format = config + .plugins + .get("etws_loader") + .unwrap() + .path_formats + .as_ref(); + if path_format.is_none() { + return None; + } + path_format.unwrap().get(name).map(|s| { let path = s.clone(); let need_formated = datetime_format.captures_iter(&path).collect::>(); let mut fore = self.fore_len; @@ -364,7 +388,7 @@ impl Dispatcher { } macro_rules! match_in_macro { - ($block:ident,$name:literal, $(($branch:path, $t:ty, $color:expr)),+) => { + ($block:ident,$(($branch:path,$name:literal, $t:ty, $color:expr)),+) => { { let datetime = Utc.timestamp_opt($block.datetime, 0).unwrap(); match $block.data_type { @@ -388,63 +412,73 @@ pub fn data_to_layer(block: Block) -> Option<(DateTime, Layer)> { match block.shape { DataShape::Matrix => match_in_macro!( block, - "DBZ", ( PluginResultType::DBZ, + "DBZ", Radar2d, create_dbz_boundarynorm() ), - (PluginResultType::R, Radar2d, create_dbz_boundarynorm()), - (PluginResultType::V, Radar2d, create_vel_boundarynorm()), + (PluginResultType::R,"R", Radar2d, create_dbz_boundarynorm()), + (PluginResultType::V,"V", Radar2d, create_vel_boundarynorm()), ( PluginResultType::ZDR, + "ZDR", Radar2d, create_zdr_boundarynorm() ), ( PluginResultType::PHIDP, + "PHIDP", Radar2d, create_phidp_boundarynorm() ), ( PluginResultType::KDP, + "KDP", Radar2d, create_kdp_boundarynorm() ), - (PluginResultType::CC, Radar2d, create_cc_boundarynorm()), + (PluginResultType::CC,"CC", Radar2d, create_cc_boundarynorm()), ( PluginResultType::HCA, + "HCA", Radar2d, create_cpc_boundarynorm() ), ( PluginResultType::QPE, + "QPE", Radar2d, create_vil_boundarynorm() ), ( PluginResultType::QPF, + "QPF", Radar2d, create_vil_boundarynorm() ), ( PluginResultType::VIL, + "VIL", Radar2d, create_vil_boundarynorm() ), ( PluginResultType::OHP, + "OHP", Radar2d, create_vil_boundarynorm() ), ( PluginResultType::THP, + "THP", Radar2d, create_vil_boundarynorm() ), - (PluginResultType::ET, Radar2d, create_et_boundarynorm()), + (PluginResultType::ET,"ET", Radar2d, create_et_boundarynorm()), ( PluginResultType::EB, + "EB", Radar2d, create_hgt_boundarynorm() ) diff --git a/src/plugin_system/mod.rs b/src/plugin_system/mod.rs index b5a8844..2744efb 100644 --- a/src/plugin_system/mod.rs +++ b/src/plugin_system/mod.rs @@ -70,11 +70,10 @@ pub struct PluginManager { 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() { + for (plugin_name, config) in CONFIG.lock().unwrap().plugins.iter() { if let Ok((id, p)) = init_plugin(plugin_name.to_owned()) { println!("Loaded plugin: {}", plugin_name); this.registered_plugins.insert(id, p);