From d0b66575d980764c638c63e28b334b32473d8da5 Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Tue, 14 Jan 2025 16:08:43 -0500 Subject: [PATCH 01/69] reduce tof enable time budget --- controller/src/main.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/controller/src/main.rs b/controller/src/main.rs index a010e8f..4a87d37 100644 --- a/controller/src/main.rs +++ b/controller/src/main.rs @@ -5,7 +5,6 @@ #![no_main] #![allow(async_fn_in_trait)] -mod vl53l0; use core::array; use core::borrow::BorrowMut; @@ -38,7 +37,6 @@ use rand::RngCore; use reqwless::response; use static_cell::StaticCell; use defmt_rtt as _; -use vl53l0::RegAddr::*; bind_interrupts!(struct Irqs { PIO0_IRQ_0 => InterruptHandler; @@ -109,7 +107,7 @@ async fn main(spawner: Spawner) { tof.set_address(0x32).unwrap(); info!("4"); tof2on.set_high(); - Timer::after_millis(13).await; + Timer::after_micros(1200).await; // DS11555 3.2 info!("5"); let mut tof2 = vl53l0x::VL53L0x::new(RefCellDevice::new(&bus1)).unwrap(); info!("6"); From fed2a4348194adeee27557846778f174149cdd90 Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Thu, 16 Jan 2025 11:08:08 -0500 Subject: [PATCH 02/69] frequency detection from mic --- interface/Cargo.lock | 934 ++++++++++++++++++++++++++++++++++++++++++ interface/Cargo.toml | 9 + interface/src/main.rs | 45 ++ 3 files changed, 988 insertions(+) create mode 100644 interface/Cargo.lock create mode 100644 interface/Cargo.toml create mode 100644 interface/src/main.rs diff --git a/interface/Cargo.lock b/interface/Cargo.lock new file mode 100644 index 0000000..34ad00d --- /dev/null +++ b/interface/Cargo.lock @@ -0,0 +1,934 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "alsa" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed7572b7ba83a31e20d1b48970ee402d2e3e0537dcfe0a3ff4d6eb7508617d43" +dependencies = [ + "alsa-sys", + "bitflags 2.8.0", + "cfg-if", + "libc", +] + +[[package]] +name = "alsa-sys" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db8fee663d06c4e303404ef5f40488a53e062f89ba8bfed81f42325aafad1527" +dependencies = [ + "libc", + "pkg-config", +] + +[[package]] +name = "anyhow" +version = "1.0.95" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34ac096ce696dc2fcabef30516bb13c0a68a11d30131d3df6f04711467681b04" + +[[package]] +name = "autocfg" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" + +[[package]] +name = "bindgen" +version = "0.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f49d8fed880d473ea71efb9bf597651e77201bdd4893efe54c9e5d65ae04ce6f" +dependencies = [ + "bitflags 2.8.0", + "cexpr", + "clang-sys", + "itertools", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" + +[[package]] +name = "bumpalo" +version = "3.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" + +[[package]] +name = "bytes" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" + +[[package]] +name = "cc" +version = "1.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8293772165d9345bdaaa39b45b2109591e63fe5e6fbc23c6ff930a048aa310b" +dependencies = [ + "jobserver", + "libc", + "shlex", +] + +[[package]] +name = "cesu8" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" + +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "clang-sys" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +dependencies = [ + "glob", + "libc", + "libloading", +] + +[[package]] +name = "combine" +version = "4.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" +dependencies = [ + "bytes", + "memchr", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "coreaudio-rs" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "321077172d79c662f64f5071a03120748d5bb652f5231570141be24cfcd2bace" +dependencies = [ + "bitflags 1.3.2", + "core-foundation-sys", + "coreaudio-sys", +] + +[[package]] +name = "coreaudio-sys" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ce857aa0b77d77287acc1ac3e37a05a8c95a2af3647d23b15f263bdaeb7562b" +dependencies = [ + "bindgen", +] + +[[package]] +name = "cpal" +version = "0.15.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "873dab07c8f743075e57f524c583985fbaf745602acbe916a01539364369a779" +dependencies = [ + "alsa", + "core-foundation-sys", + "coreaudio-rs", + "dasp_sample", + "jni", + "js-sys", + "libc", + "mach2", + "ndk", + "ndk-context", + "oboe", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "windows", +] + +[[package]] +name = "dasp_sample" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c87e182de0887fd5361989c677c4e8f5000cd9491d6d563161a8f3a5519fc7f" + +[[package]] +name = "either" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "glob" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" + +[[package]] +name = "hashbrown" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" + +[[package]] +name = "indexmap" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" +dependencies = [ + "equivalent", + "hashbrown", +] + +[[package]] +name = "interface" +version = "0.1.0" +dependencies = [ + "anyhow", + "cpal", + "pitch-detection", +] + +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + +[[package]] +name = "jni" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" +dependencies = [ + "cesu8", + "cfg-if", + "combine", + "jni-sys", + "log", + "thiserror", + "walkdir", + "windows-sys 0.45.0", +] + +[[package]] +name = "jni-sys" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" + +[[package]] +name = "jobserver" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" +dependencies = [ + "libc", +] + +[[package]] +name = "js-sys" +version = "0.3.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" +dependencies = [ + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "libc" +version = "0.2.169" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" + +[[package]] +name = "libloading" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" +dependencies = [ + "cfg-if", + "windows-targets 0.52.6", +] + +[[package]] +name = "log" +version = "0.4.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f" + +[[package]] +name = "mach2" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b955cdeb2a02b9117f121ce63aa52d08ade45de53e48fe6a38b39c10f6f709" +dependencies = [ + "libc", +] + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "ndk" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2076a31b7010b17a38c01907c45b945e8f11495ee4dd588309718901b1f7a5b7" +dependencies = [ + "bitflags 2.8.0", + "jni-sys", + "log", + "ndk-sys", + "num_enum", + "thiserror", +] + +[[package]] +name = "ndk-context" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b" + +[[package]] +name = "ndk-sys" +version = "0.5.0+25.2.9519653" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c196769dd60fd4f363e11d948139556a344e79d451aeb2fa2fd040738ef7691" +dependencies = [ + "jni-sys", +] + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "num-complex" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_enum" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e613fc340b2220f734a8595782c551f1250e969d87d3be1ae0579e8d4065179" +dependencies = [ + "num_enum_derive", +] + +[[package]] +name = "num_enum_derive" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "oboe" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8b61bebd49e5d43f5f8cc7ee2891c16e0f41ec7954d36bcb6c14c5e0de867fb" +dependencies = [ + "jni", + "ndk", + "ndk-context", + "num-derive", + "num-traits", + "oboe-sys", +] + +[[package]] +name = "oboe-sys" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c8bb09a4a2b1d668170cfe0a7d5bc103f8999fb316c98099b6a9939c9f2e79d" +dependencies = [ + "cc", +] + +[[package]] +name = "once_cell" +version = "1.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" + +[[package]] +name = "pitch-detection" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e086e70dfcfd46cd6097c501a66fb07cd73ee8c27844b0941d9b2b3e43dfbf92" +dependencies = [ + "rustfft", +] + +[[package]] +name = "pkg-config" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" + +[[package]] +name = "primal-check" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc0d895b311e3af9902528fbb8f928688abbd95872819320517cc24ca6b2bd08" +dependencies = [ + "num-integer", +] + +[[package]] +name = "proc-macro-crate" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" +dependencies = [ + "toml_edit", +] + +[[package]] +name = "proc-macro2" +version = "1.0.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "regex" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustfft" +version = "6.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43806561bc506d0c5d160643ad742e3161049ac01027b5e6d7524091fd401d86" +dependencies = [ + "num-complex", + "num-integer", + "num-traits", + "primal-check", + "strength_reduce", + "transpose", + "version_check", +] + +[[package]] +name = "rustversion" +version = "1.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "strength_reduce" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe895eb47f22e2ddd4dabc02bce419d2e643c8e3b585c78158b349195bc24d82" + +[[package]] +name = "syn" +version = "2.0.96" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "toml_datetime" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" + +[[package]] +name = "toml_edit" +version = "0.22.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" +dependencies = [ + "indexmap", + "toml_datetime", + "winnow", +] + +[[package]] +name = "transpose" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ad61aed86bc3faea4300c7aee358b4c6d0c8d6ccc36524c96e4c92ccf26e77e" +dependencies = [ + "num-integer", + "strength_reduce", +] + +[[package]] +name = "unicode-ident" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" +dependencies = [ + "bumpalo", + "log", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61" +dependencies = [ + "cfg-if", + "js-sys", + "once_cell", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "web-sys" +version = "0.3.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "winapi-util" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" +dependencies = [ + "windows-sys 0.59.0", +] + +[[package]] +name = "windows" +version = "0.54.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9252e5725dbed82865af151df558e754e4a3c2c30818359eb17465f1346a1b49" +dependencies = [ + "windows-core", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-core" +version = "0.54.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12661b9c89351d684a50a8a643ce5f608e20243b9fb84687800163429f161d65" +dependencies = [ + "windows-result", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-result" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e383302e8ec8515204254685643de10811af0ed97ea37210dc26fb0032647f8" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "winnow" +version = "0.6.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8d71a593cc5c42ad7876e2c1fda56f314f3754c084128833e64f1345ff8a03a" +dependencies = [ + "memchr", +] diff --git a/interface/Cargo.toml b/interface/Cargo.toml new file mode 100644 index 0000000..8bbc54e --- /dev/null +++ b/interface/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "interface" +version = "0.1.0" +edition = "2021" + +[dependencies] +anyhow = "1.0.95" +cpal = "0.15.3" +pitch-detection = "0.3" diff --git a/interface/src/main.rs b/interface/src/main.rs new file mode 100644 index 0000000..3db6939 --- /dev/null +++ b/interface/src/main.rs @@ -0,0 +1,45 @@ +#![feature(iter_collect_into)] +use std::{sync::mpsc, thread::sleep, time::Duration}; + +use anyhow::{Context, Ok, Result}; +use cpal::traits::{DeviceTrait, HostTrait, StreamTrait}; +use pitch_detection::detector::{mcleod::McLeodDetector, PitchDetector}; + +fn main() -> Result<()> { + dbg!(cpal::available_hosts()); + let host = cpal::default_host(); + let device = host.devices().unwrap().find(|d|d.name().unwrap() == "pulse").context("no pulse")?; + + let config = device.default_input_config()?; + + dbg!(config.sample_format()); + let rate = config.sample_rate(); + + let (sender, notes) = mpsc::channel(); + + const POWER_THRESHOLD: f32 = 5.0; + const CLARITY_THRESHOLD: f32 = 0.7; + + let stream = device.build_input_stream(&config.into(), + move | data: &[f32], _: &_| { + let mut detctor = McLeodDetector::new(2204, 2204/2); + sender.send(detctor.get_pitch(&data[..2204], rate.0 as usize, POWER_THRESHOLD, CLARITY_THRESHOLD)).unwrap(); + + }, + move |err| {eprintln!("{err}")} , + Some(Duration::from_secs(1)))?; + + stream.play()?; + + for note in notes { + if let Some(note) = note { + dbg!(note.frequency); + dbg!(note.clarity); + } + } + + + drop(stream); + + Ok(()) +} From 945b4710e7cb538a54ca73f8aca27ee0640fab20 Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Thu, 16 Jan 2025 11:16:45 -0500 Subject: [PATCH 03/69] volume calculation --- interface/src/main.rs | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/interface/src/main.rs b/interface/src/main.rs index 3db6939..312152d 100644 --- a/interface/src/main.rs +++ b/interface/src/main.rs @@ -3,9 +3,10 @@ use std::{sync::mpsc, thread::sleep, time::Duration}; use anyhow::{Context, Ok, Result}; use cpal::traits::{DeviceTrait, HostTrait, StreamTrait}; -use pitch_detection::detector::{mcleod::McLeodDetector, PitchDetector}; +use pitch_detection::{detector::{mcleod::McLeodDetector, PitchDetector}, utils}; fn main() -> Result<()> { + // assumes pulseaudio system with f32 samples and 2204 sample packets dbg!(cpal::available_hosts()); let host = cpal::default_host(); let device = host.devices().unwrap().find(|d|d.name().unwrap() == "pulse").context("no pulse")?; @@ -19,11 +20,17 @@ fn main() -> Result<()> { const POWER_THRESHOLD: f32 = 5.0; const CLARITY_THRESHOLD: f32 = 0.7; + const PACKET_LEN: usize = 2204; let stream = device.build_input_stream(&config.into(), move | data: &[f32], _: &_| { - let mut detctor = McLeodDetector::new(2204, 2204/2); - sender.send(detctor.get_pitch(&data[..2204], rate.0 as usize, POWER_THRESHOLD, CLARITY_THRESHOLD)).unwrap(); + assert!(data.len() >= PACKET_LEN); + let data = &data[..PACKET_LEN]; + + // reinitialized every packet as it is not thread safe + let mut detctor = McLeodDetector::new(PACKET_LEN, PACKET_LEN/2); + let vol = utils::buffer::square_sum(data); + sender.send((detctor.get_pitch(data, rate.0 as usize, POWER_THRESHOLD, CLARITY_THRESHOLD),vol)).unwrap(); }, move |err| {eprintln!("{err}")} , @@ -31,14 +38,14 @@ fn main() -> Result<()> { stream.play()?; - for note in notes { + for (note,vol) in notes { if let Some(note) = note { dbg!(note.frequency); dbg!(note.clarity); + dbg!(vol); } } - drop(stream); Ok(()) From 4c616de4a0688354de10d4247211274f9d4817ef Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Thu, 16 Jan 2025 11:45:33 -0500 Subject: [PATCH 04/69] note -> action correspondence --- interface/Cargo.lock | 168 ++++++++++++++++++++++++++++++++++++++++-- interface/Cargo.toml | 1 + interface/src/main.rs | 25 ++++++- 3 files changed, 187 insertions(+), 7 deletions(-) diff --git a/interface/Cargo.lock b/interface/Cargo.lock index 34ad00d..93d4493 100644 --- a/interface/Cargo.lock +++ b/interface/Cargo.lock @@ -33,12 +33,32 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "ansi_term" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" +dependencies = [ + "winapi", +] + [[package]] name = "anyhow" version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34ac096ce696dc2fcabef30516bb13c0a68a11d30131d3df6f04711467681b04" +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi", + "libc", + "winapi", +] + [[package]] name = "autocfg" version = "1.4.0" @@ -60,7 +80,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn", + "syn 2.0.96", ] [[package]] @@ -130,6 +150,21 @@ dependencies = [ "libloading", ] +[[package]] +name = "clap" +version = "2.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" +dependencies = [ + "ansi_term", + "atty", + "bitflags 1.3.2", + "strsim", + "textwrap", + "unicode-width", + "vec_map", +] + [[package]] name = "combine" version = "4.6.7" @@ -219,6 +254,24 @@ version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" +[[package]] +name = "heck" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + [[package]] name = "indexmap" version = "2.7.0" @@ -236,6 +289,7 @@ dependencies = [ "anyhow", "cpal", "pitch-detection", + "rust-music-theory", ] [[package]] @@ -288,6 +342,12 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + [[package]] name = "libc" version = "0.2.169" @@ -387,7 +447,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.96", ] [[package]] @@ -426,7 +486,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn", + "syn 2.0.96", ] [[package]] @@ -538,6 +598,18 @@ version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" +[[package]] +name = "rust-music-theory" +version = "0.2.0" +source = "git+https://github.com/the-drunk-coder/rust-music-theory?rev=a062d65#a062d65c35d02e38a48a9de29a0fe21f6b8b043d" +dependencies = [ + "clap", + "lazy_static", + "regex", + "strum", + "strum_macros", +] + [[package]] name = "rustc-hash" version = "1.1.0" @@ -586,6 +658,41 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fe895eb47f22e2ddd4dabc02bce419d2e643c8e3b585c78158b349195bc24d82" +[[package]] +name = "strsim" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" + +[[package]] +name = "strum" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "530efb820d53b712f4e347916c5e7ed20deb76a4f0457943b3182fb889b06d2c" + +[[package]] +name = "strum_macros" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e6e163a520367c465f59e0a61a23cfae3b10b6546d78b6f672a382be79f7110" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "syn" version = "2.0.96" @@ -597,6 +704,15 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "textwrap" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" +dependencies = [ + "unicode-width", +] + [[package]] name = "thiserror" version = "1.0.69" @@ -614,7 +730,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.96", ] [[package]] @@ -650,6 +766,24 @@ version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" +[[package]] +name = "unicode-segmentation" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" + +[[package]] +name = "unicode-width" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" + +[[package]] +name = "vec_map" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" + [[package]] name = "version_check" version = "0.9.5" @@ -688,7 +822,7 @@ dependencies = [ "log", "proc-macro2", "quote", - "syn", + "syn 2.0.96", "wasm-bindgen-shared", ] @@ -723,7 +857,7 @@ checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.96", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -747,6 +881,22 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + [[package]] name = "winapi-util" version = "0.1.9" @@ -756,6 +906,12 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + [[package]] name = "windows" version = "0.54.0" diff --git a/interface/Cargo.toml b/interface/Cargo.toml index 8bbc54e..53b389b 100644 --- a/interface/Cargo.toml +++ b/interface/Cargo.toml @@ -7,3 +7,4 @@ edition = "2021" anyhow = "1.0.95" cpal = "0.15.3" pitch-detection = "0.3" +rust-music-theory = {git = "https://github.com/the-drunk-coder/rust-music-theory", rev = "a062d65"} diff --git a/interface/src/main.rs b/interface/src/main.rs index 312152d..1de1628 100644 --- a/interface/src/main.rs +++ b/interface/src/main.rs @@ -4,6 +4,7 @@ use std::{sync::mpsc, thread::sleep, time::Duration}; use anyhow::{Context, Ok, Result}; use cpal::traits::{DeviceTrait, HostTrait, StreamTrait}; use pitch_detection::{detector::{mcleod::McLeodDetector, PitchDetector}, utils}; +use rust_music_theory::note::{Note, NoteLetter, Pitch, Tuning}; fn main() -> Result<()> { // assumes pulseaudio system with f32 samples and 2204 sample packets @@ -40,9 +41,31 @@ fn main() -> Result<()> { for (note,vol) in notes { if let Some(note) = note { - dbg!(note.frequency); + //dbg!(note.frequency); dbg!(note.clarity); dbg!(vol); + let note = Note::from_freq(note.frequency, Tuning::EqualTemperament); + match note.pitch { + Pitch { letter: NoteLetter::A, accidental: 0} => { + println!("forward"); + } + Pitch { letter: NoteLetter::A, accidental: 1} => { + println!("backward"); + } + Pitch { letter: NoteLetter::C, accidental: 0} => { + println!("right"); + } + Pitch { letter: NoteLetter::C, accidental: 1} => { + println!("left"); + } + Pitch { letter: NoteLetter::G, accidental: 0} => { + println!("fire"); + } + pitch => { + dbg!(pitch); + } + + } } } From 7a918e2b65cd559a7cdec726d94194e201bd3993 Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Sat, 18 Jan 2025 13:10:07 -0500 Subject: [PATCH 05/69] transitioning sensor reads to second core --- controller/Cargo.lock | 1 + controller/Cargo.toml | 2 + controller/src/main.rs | 21 ++++++- controller/src/sensor_manager.rs | 102 +++++++++++++++++++++++++++++++ interface/.gitignore | 1 + 5 files changed, 124 insertions(+), 3 deletions(-) create mode 100644 controller/src/sensor_manager.rs create mode 100644 interface/.gitignore diff --git a/controller/Cargo.lock b/controller/Cargo.lock index 13bdae2..87ba8f8 100644 --- a/controller/Cargo.lock +++ b/controller/Cargo.lock @@ -306,6 +306,7 @@ dependencies = [ "hex", "log", "mpu6050", + "nalgebra", "panic-probe", "pio", "pio-proc", diff --git a/controller/Cargo.toml b/controller/Cargo.toml index 5eba3f7..bffed1a 100644 --- a/controller/Cargo.toml +++ b/controller/Cargo.toml @@ -9,6 +9,7 @@ license = "MIT OR Apache-2.0" embassy-executor = { version = "0.6.0", git="https://github.com/embassy-rs/embassy", features = ["task-arena-size-98304", "arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] } embassy-time = { version = "0.3.2", git="https://github.com/embassy-rs/embassy", features = ["defmt", "defmt-timestamp-uptime"] } embassy-rp = { version = "0.2.0", git="https://github.com/embassy-rs/embassy", features = ["defmt", "unstable-pac", "time-driver", "critical-section-impl", "rp2040"] } +embassy-sync = { version = "0.6.2", git="https://github.com/embassy-rs/embassy" } embassy-usb = { version = "0.3.0", git="https://github.com/embassy-rs/embassy", features = ["defmt"] } embassy-net = { version = "0.4.0", git="https://github.com/embassy-rs/embassy", features = ["defmt", "tcp", "udp", "raw", "dhcpv4", "medium-ethernet", "dns"] } embassy-net-wiznet = { version = "0.1.0", git="https://github.com/embassy-rs/embassy", features = ["defmt"] } @@ -61,6 +62,7 @@ bt-hci = { version = "0.1.0", default-features = false, features = ["defmt"] } hex = { version = "0.4.3", default-features=false } mpu6050 = { git = "https://git.ank.dev/ank/mpu6050" } vl53l0x = "1.0.1" +nalgebra = { version = "0.31.2", default-features=false } [profile.release] diff --git a/controller/src/main.rs b/controller/src/main.rs index 4a87d37..d40e121 100644 --- a/controller/src/main.rs +++ b/controller/src/main.rs @@ -5,6 +5,7 @@ #![no_main] #![allow(async_fn_in_trait)] +mod sensor_manager; use core::array; use core::borrow::BorrowMut; @@ -16,6 +17,7 @@ use core::str::from_utf8; use bt_hci::cmd::info; use cyw43_pio::PioSpi; use embassy_rp::i2c::{Async, I2c}; +use embassy_rp::multicore::spawn_core1; use embassy_rp::pwm::{self, Pwm}; use embedded_hal_bus::i2c::RefCellDevice; use fixed::FixedU16; @@ -35,6 +37,7 @@ use embedded_io_async::Write; use mpu6050::Mpu6050; use rand::RngCore; use reqwless::response; +use sensor_manager::{sensor_manager, SensorData}; use static_cell::StaticCell; use defmt_rtt as _; @@ -45,6 +48,9 @@ bind_interrupts!(struct Irqs { USBCTRL_IRQ => embassy_rp::usb::InterruptHandler; }); +static mut CORE1_STACK: Stack<4096> = Stack::new(); +static CHANNEL: Channel = Channel::new(); + #[embassy_executor::task] async fn logger_task(driver: Driver<'static, USB>) { embassy_usb_logger::run!(1024, log::LevelFilter::Debug, driver); @@ -96,17 +102,26 @@ async fn main(spawner: Spawner) { let config = embassy_rp::i2c::Config::default(); let bus1 = embassy_rp::i2c::I2c::new_async(p.I2C1, scl, sda, Irqs, config); let bus1 = RefCell::new(bus1); + let mut tof2enable = Output::new(p.PIN_16, Level::Low); + + + spawn_core1( + p.CORE1, + unsafe { &mut *core::ptr::addr_of_mut!(CORE1_STACK) }, + move || { + sensor_manager(bus, tof2enable) + } + ); info!("made RefCell"); - let mut tof2on = Output::new(p.PIN_16, Level::Low); info!("2"); Timer::after_millis(1).await; let mut tof = vl53l0x::VL53L0x::new(RefCellDevice::new(&bus1)).unwrap(); info!("3"); tof.set_address(0x32).unwrap(); info!("4"); - tof2on.set_high(); + tof2enable.set_high(); Timer::after_micros(1200).await; // DS11555 3.2 info!("5"); let mut tof2 = vl53l0x::VL53L0x::new(RefCellDevice::new(&bus1)).unwrap(); @@ -179,7 +194,7 @@ async fn main(spawner: Spawner) { defmt::unwrap!(spawner.spawn(net_task(runner))); //control.start_ap_open("cyw43", 5).await; - control.start_ap_wpa2("cyw43", "password", 5).await; + control.start_ap_wpa2("lovesense_setup2", "password123", 5).await; // And now we can use it! diff --git a/controller/src/sensor_manager.rs b/controller/src/sensor_manager.rs new file mode 100644 index 0000000..aa475ab --- /dev/null +++ b/controller/src/sensor_manager.rs @@ -0,0 +1,102 @@ +use core::sync::atomic::{AtomicU8, Ordering}; +use core::task::Poll; +use core::{cell::RefCell, mem::transmute}; + +use embassy_executor::Executor; +use embassy_rp::peripherals::{I2C0, I2C1}; +use embassy_time::{Delay, Duration, Instant, Timer}; +use embassy_rp::gpio::Output; +use embassy_rp::i2c::{Async, I2c}; +use embedded_hal_bus::i2c::RefCellDevice; +use log::info; +use mpu6050::Mpu6050; +use nalgebra::Vector3; + +pub struct SensorHardware { + bus_tof: I2c<'static, I2C1, Async>, + bus_gyro: I2c<'static, I2C0, Async>, + tof2enable: Output<'static>, +} + +pub fn sensor_manager(mut hardware: SensorHardware) -> ! { + let executor = Executor::new(); + let executor: &'static mut Executor = unsafe{transmute(&executor)}; + executor.run(move |spawner| { + spawner.spawn(init_sensors(hardware)).unwrap(); + }); +} + +static POLL_STATE: AtomicU8 = AtomicU8::new(PollState::None as u8); +#[repr(u8)] +enum PollState { + None, + Tof1, + Tof2, + Gyro, +} + +struct SensorData { + /// distance, mm + tof1: Option, + /// distance, mm + tof2: Option, + /// acceleration, rad/s + gyro: Option>, + /// acceleration, g + accel: Option>, + updated: Instant, +} + +#[embassy_executor::task] +async fn init_sensors(mut hardware: SensorHardware) { + let bus = RefCell::new(hardware.bus_tof); + + Timer::after_millis(1).await; + let mut tof = vl53l0x::VL53L0x::new(RefCellDevice::new(&bus)).unwrap(); + tof.set_address(0x32).unwrap(); + hardware.tof2enable.set_high(); + Timer::after_micros(1200).await; // DS11555 3.2 + let mut tof2 = vl53l0x::VL53L0x::new(RefCellDevice::new(&bus)).unwrap(); + + let mut gyro = Mpu6050::new_with_addr(hardware.bus_gyro,0x68); + gyro.init(&mut Delay).unwrap(); + gyro.set_gyro_range(mpu6050::device::GyroRange::D2000).unwrap(); + gyro.set_accel_range(mpu6050::device::AccelRange::G16).unwrap(); + + + let mut data = SensorData { + tof1: None, + tof2: None, + gyro: None, + accel: None, + updated: Instant::now(), + }; + + loop { + POLL_STATE.store(PollState::Tof1 as u8, Ordering::SeqCst); + if let Ok(dist) = tof.read_range_single_millimeters_blocking() { + info!("dist1: {dist}mm"); + data.tof1 = Some(dist); + } + Timer::after_millis(3).await; + POLL_STATE.store(PollState::Tof2 as u8, Ordering::SeqCst); + if let Ok(dist) = tof2.read_range_single_millimeters_blocking() { + info!("dist2: {dist}mm"); + data.tof2 = Some(dist); + } + Timer::after_millis(3).await; + POLL_STATE.store(PollState::Gyro as u8, Ordering::SeqCst); + if let Ok(gyro) = gyro.get_gyro() { + info!("rotation: {gyro}"); + data.gyro = Some(gyro); + } + if let Ok(accel) = gyro.get_acc() { + data.accel = Some(accel); + } + POLL_STATE.store(PollState::None as u8, Ordering::SeqCst); + + + + + } +} diff --git a/interface/.gitignore b/interface/.gitignore new file mode 100644 index 0000000..eb5a316 --- /dev/null +++ b/interface/.gitignore @@ -0,0 +1 @@ +target From 088e0225ca9d8296ee16d7564c6086cdcb94bb7e Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Sat, 18 Jan 2025 13:27:48 -0500 Subject: [PATCH 06/69] feasible second core sensor impl --- controller/Cargo.lock | 601 +++++++++++++++++++++---------- controller/Cargo.toml | 19 +- controller/src/main.rs | 98 ++--- controller/src/sensor_manager.rs | 19 +- 4 files changed, 463 insertions(+), 274 deletions(-) diff --git a/controller/Cargo.lock b/controller/Cargo.lock index 87ba8f8..e64dc10 100644 --- a/controller/Cargo.lock +++ b/controller/Cargo.lock @@ -110,9 +110,9 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "az" @@ -147,7 +147,16 @@ version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" dependencies = [ - "bit-vec", + "bit-vec 0.6.3", +] + +[[package]] +name = "bit-set" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0481a0e032742109b1133a095184ee93d88f3dc9e0d28a5d033dc77a073f44f" +dependencies = [ + "bit-vec 0.7.0", ] [[package]] @@ -156,6 +165,12 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" +[[package]] +name = "bit-vec" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2c54ff287cfc0a34f38a6b832ea1bd8e448a330b3e40a50859e6488bee07f22" + [[package]] name = "bitfield" version = "0.13.2" @@ -176,9 +191,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.6.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" [[package]] name = "block-buffer" @@ -191,12 +206,12 @@ dependencies = [ [[package]] name = "bt-hci" -version = "0.1.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57a6508c63d7d137e8188833d9ed3ca97e40d676cf5217874c8c1c24851b012d" +checksum = "d69c6b9d78fe4db539449fc8782dd2554fd4baee27f6e6dbf2e4757fcbc36139" dependencies = [ "defmt", - "embassy-sync 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "embassy-sync 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "embedded-io", "embedded-io-async", "futures-intrusive", @@ -227,9 +242,9 @@ checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" [[package]] name = "bytemuck" -version = "1.18.0" +version = "1.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94bbb0ad554ad961ddc5da507a12a29b14e4ae5bda06b19f575a3e6079d2e2ae" +checksum = "ef657dfab802224e671f5818e9a4935f9b1957ed18e58292690cc39e7a4092a3" [[package]] name = "byteorder" @@ -274,7 +289,6 @@ name = "controller" version = "0.1.0" dependencies = [ "assign-resources", - "bt-hci", "byte-slice-cast 1.2.2", "cortex-m", "cortex-m-rt", @@ -290,6 +304,7 @@ dependencies = [ "embassy-net", "embassy-net-wiznet", "embassy-rp", + "embassy-sync 0.6.2 (git+https://github.com/embassy-rs/embassy)", "embassy-time", "embassy-usb", "embassy-usb-logger", @@ -308,14 +323,14 @@ dependencies = [ "mpu6050", "nalgebra", "panic-probe", - "pio", - "pio-proc", + "pio 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "pio-proc 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "portable-atomic", "rand", "reqwless", "serde", "serde-json-core", - "smart-leds", + "smart-leds 0.3.0", "st7789", "static_cell", "usbd-hid", @@ -336,29 +351,29 @@ dependencies = [ [[package]] name = "cortex-m-rt" -version = "0.7.3" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee84e813d593101b1723e13ec38b6ab6abbdbaaa4546553f5395ed274079ddb1" +checksum = "801d4dec46b34c299ccf6b036717ae0fce602faa4f4fe816d9013b9a7c9f5ba6" dependencies = [ "cortex-m-rt-macros", ] [[package]] name = "cortex-m-rt-macros" -version = "0.7.0" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0f6f3e36f203cfedbc78b357fb28730aa2c6dc1ab060ee5c2405e843988d3c7" +checksum = "e37549a379a9e0e6e576fd208ee60394ccb8be963889eebba3ffe0980364f472" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.96", ] [[package]] name = "cpufeatures" -version = "0.2.14" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" +checksum = "16b80225097f2e5ae4e7179dd2266824648f3e2f49d9134d584b76389d31c4c3" dependencies = [ "libc", ] @@ -374,9 +389,9 @@ dependencies = [ [[package]] name = "critical-section" -version = "1.1.3" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f64009896348fc5af4222e9cf7d7d82a95a256c634ebcf61c53e4ea461422242" +checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" [[package]] name = "crunchy" @@ -417,8 +432,8 @@ dependencies = [ [[package]] name = "cyw43" -version = "0.2.0" -source = "git+https://github.com/embassy-rs/embassy#0ede8479dc4c6a58cfab0a5d4df41c0592405971" +version = "0.3.0" +source = "git+https://github.com/embassy-rs/embassy#c39076724f052fed6781b056bb79c9fa576b87a3" dependencies = [ "bt-hci", "cortex-m", @@ -426,26 +441,26 @@ dependencies = [ "defmt", "embassy-futures", "embassy-net-driver-channel", - "embassy-sync 0.6.0 (git+https://github.com/embassy-rs/embassy)", + "embassy-sync 0.6.2 (git+https://github.com/embassy-rs/embassy)", "embassy-time", "embedded-hal 1.0.0", "embedded-io-async", "futures", "heapless 0.8.0", - "num_enum", + "num_enum 0.5.11", ] [[package]] name = "cyw43-pio" -version = "0.2.0" -source = "git+https://github.com/embassy-rs/embassy#0ede8479dc4c6a58cfab0a5d4df41c0592405971" +version = "0.3.0" +source = "git+https://github.com/embassy-rs/embassy#c39076724f052fed6781b056bb79c9fa576b87a3" dependencies = [ "cyw43", "defmt", "embassy-rp", "fixed", - "pio", - "pio-proc", + "pio 0.2.1 (git+https://github.com/rp-rs/pio-rs?rev=fa586448b0b223217eec8c92c19fe6823dd04cc4)", + "pio-proc 0.2.2 (git+https://github.com/rp-rs/pio-rs?rev=fa586448b0b223217eec8c92c19fe6823dd04cc4)", ] [[package]] @@ -469,7 +484,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.77", + "syn 2.0.96", ] [[package]] @@ -480,7 +495,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 2.0.77", + "syn 2.0.96", ] [[package]] @@ -491,9 +506,9 @@ checksum = "f578e8e2c440e7297e008bb5486a3a8a194775224bbc23729b0dbdfaeebf162e" [[package]] name = "defmt" -version = "0.3.8" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a99dd22262668b887121d4672af5a64b238f026099f1a2a1b322066c9ecfe9e0" +checksum = "86f6162c53f659f65d00619fe31f14556a6e9f8752ccc4a41bd177ffcf3d6130" dependencies = [ "bitflags 1.3.2", "defmt-macros", @@ -501,24 +516,24 @@ dependencies = [ [[package]] name = "defmt-macros" -version = "0.3.9" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3a9f309eff1f79b3ebdf252954d90ae440599c26c2c553fe87a2d17195f2dcb" +checksum = "9d135dd939bad62d7490b0002602d35b358dce5fd9233a709d3c1ef467d4bde6" dependencies = [ "defmt-parser", - "proc-macro-error", + "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.96", ] [[package]] name = "defmt-parser" -version = "0.3.4" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff4a5fefe330e8d7f31b16a318f9ce81000d8e35e69b93eae154d16d2278f70f" +checksum = "3983b127f13995e68c1e29071e5d115cd96f215ccb5e6812e3728cd6f92653b3" dependencies = [ - "thiserror", + "thiserror 2.0.11", ] [[package]] @@ -632,11 +647,11 @@ dependencies = [ [[package]] name = "embassy-embedded-hal" -version = "0.2.0" -source = "git+https://github.com/embassy-rs/embassy#0ede8479dc4c6a58cfab0a5d4df41c0592405971" +version = "0.3.0" +source = "git+https://github.com/embassy-rs/embassy#c39076724f052fed6781b056bb79c9fa576b87a3" dependencies = [ "embassy-futures", - "embassy-sync 0.6.0 (git+https://github.com/embassy-rs/embassy)", + "embassy-sync 0.6.2 (git+https://github.com/embassy-rs/embassy)", "embassy-time", "embedded-hal 0.2.7", "embedded-hal 1.0.0", @@ -648,38 +663,36 @@ dependencies = [ [[package]] name = "embassy-executor" -version = "0.6.0" -source = "git+https://github.com/embassy-rs/embassy#0ede8479dc4c6a58cfab0a5d4df41c0592405971" +version = "0.7.0" +source = "git+https://github.com/embassy-rs/embassy#c39076724f052fed6781b056bb79c9fa576b87a3" dependencies = [ "cortex-m", "critical-section", "defmt", "document-features", "embassy-executor-macros", - "embassy-time-driver", - "embassy-time-queue-driver", ] [[package]] name = "embassy-executor-macros" -version = "0.5.0" -source = "git+https://github.com/embassy-rs/embassy#0ede8479dc4c6a58cfab0a5d4df41c0592405971" +version = "0.6.2" +source = "git+https://github.com/embassy-rs/embassy#c39076724f052fed6781b056bb79c9fa576b87a3" dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.96", ] [[package]] name = "embassy-futures" version = "0.1.1" -source = "git+https://github.com/embassy-rs/embassy#0ede8479dc4c6a58cfab0a5d4df41c0592405971" +source = "git+https://github.com/embassy-rs/embassy#c39076724f052fed6781b056bb79c9fa576b87a3" [[package]] name = "embassy-hal-internal" version = "0.2.0" -source = "git+https://github.com/embassy-rs/embassy#0ede8479dc4c6a58cfab0a5d4df41c0592405971" +source = "git+https://github.com/embassy-rs/embassy#c39076724f052fed6781b056bb79c9fa576b87a3" dependencies = [ "cortex-m", "critical-section", @@ -689,16 +702,16 @@ dependencies = [ [[package]] name = "embassy-net" -version = "0.4.0" -source = "git+https://github.com/embassy-rs/embassy#0ede8479dc4c6a58cfab0a5d4df41c0592405971" +version = "0.6.0" +source = "git+https://github.com/embassy-rs/embassy#c39076724f052fed6781b056bb79c9fa576b87a3" dependencies = [ "defmt", "document-features", "embassy-net-driver", - "embassy-sync 0.6.0 (git+https://github.com/embassy-rs/embassy)", + "embassy-sync 0.6.2 (git+https://github.com/embassy-rs/embassy)", "embassy-time", "embedded-io-async", - "embedded-nal-async", + "embedded-nal-async 0.8.0", "heapless 0.8.0", "managed", "smoltcp", @@ -707,7 +720,7 @@ dependencies = [ [[package]] name = "embassy-net-driver" version = "0.2.0" -source = "git+https://github.com/embassy-rs/embassy#0ede8479dc4c6a58cfab0a5d4df41c0592405971" +source = "git+https://github.com/embassy-rs/embassy#c39076724f052fed6781b056bb79c9fa576b87a3" dependencies = [ "defmt", ] @@ -715,17 +728,17 @@ dependencies = [ [[package]] name = "embassy-net-driver-channel" version = "0.3.0" -source = "git+https://github.com/embassy-rs/embassy#0ede8479dc4c6a58cfab0a5d4df41c0592405971" +source = "git+https://github.com/embassy-rs/embassy#c39076724f052fed6781b056bb79c9fa576b87a3" dependencies = [ "embassy-futures", "embassy-net-driver", - "embassy-sync 0.6.0 (git+https://github.com/embassy-rs/embassy)", + "embassy-sync 0.6.2 (git+https://github.com/embassy-rs/embassy)", ] [[package]] name = "embassy-net-wiznet" -version = "0.1.0" -source = "git+https://github.com/embassy-rs/embassy#0ede8479dc4c6a58cfab0a5d4df41c0592405971" +version = "0.2.0" +source = "git+https://github.com/embassy-rs/embassy#c39076724f052fed6781b056bb79c9fa576b87a3" dependencies = [ "defmt", "embassy-futures", @@ -737,8 +750,8 @@ dependencies = [ [[package]] name = "embassy-rp" -version = "0.2.0" -source = "git+https://github.com/embassy-rs/embassy#0ede8479dc4c6a58cfab0a5d4df41c0592405971" +version = "0.3.0" +source = "git+https://github.com/embassy-rs/embassy#c39076724f052fed6781b056bb79c9fa576b87a3" dependencies = [ "atomic-polyfill", "cfg-if", @@ -750,9 +763,10 @@ dependencies = [ "embassy-embedded-hal", "embassy-futures", "embassy-hal-internal", - "embassy-sync 0.6.0 (git+https://github.com/embassy-rs/embassy)", + "embassy-sync 0.6.2 (git+https://github.com/embassy-rs/embassy)", "embassy-time", "embassy-time-driver", + "embassy-time-queue-utils", "embassy-usb-driver", "embedded-hal 0.2.7", "embedded-hal 1.0.0", @@ -764,79 +778,84 @@ dependencies = [ "embedded-storage-async", "fixed", "nb 1.1.0", - "pio", - "pio-proc", + "pio 0.2.1 (git+https://github.com/rp-rs/pio-rs?rev=fa586448b0b223217eec8c92c19fe6823dd04cc4)", + "pio-proc 0.2.2 (git+https://github.com/rp-rs/pio-rs?rev=fa586448b0b223217eec8c92c19fe6823dd04cc4)", "rand_core", "rp-pac", "rp2040-boot2", "sha2-const-stable", + "smart-leds 0.4.0", ] [[package]] name = "embassy-sync" -version = "0.6.0" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3e0c49ff02ebe324faf3a8653ba91582e2d0a7fdef5bc88f449d5aa1bfcc05c" +checksum = "8d2c8cdff05a7a51ba0087489ea44b0b1d97a296ca6b1d6d1a33ea7423d34049" dependencies = [ "cfg-if", "critical-section", "embedded-io-async", + "futures-sink", "futures-util", "heapless 0.8.0", ] [[package]] name = "embassy-sync" -version = "0.6.0" -source = "git+https://github.com/embassy-rs/embassy#0ede8479dc4c6a58cfab0a5d4df41c0592405971" +version = "0.6.2" +source = "git+https://github.com/embassy-rs/embassy#c39076724f052fed6781b056bb79c9fa576b87a3" dependencies = [ "cfg-if", "critical-section", "embedded-io-async", + "futures-sink", "futures-util", "heapless 0.8.0", ] [[package]] name = "embassy-time" -version = "0.3.2" -source = "git+https://github.com/embassy-rs/embassy#0ede8479dc4c6a58cfab0a5d4df41c0592405971" +version = "0.4.0" +source = "git+https://github.com/embassy-rs/embassy#c39076724f052fed6781b056bb79c9fa576b87a3" dependencies = [ "cfg-if", "critical-section", "defmt", "document-features", "embassy-time-driver", - "embassy-time-queue-driver", "embedded-hal 0.2.7", "embedded-hal 1.0.0", "embedded-hal-async", "futures-util", - "heapless 0.8.0", ] [[package]] name = "embassy-time-driver" -version = "0.1.0" -source = "git+https://github.com/embassy-rs/embassy#0ede8479dc4c6a58cfab0a5d4df41c0592405971" +version = "0.2.0" +source = "git+https://github.com/embassy-rs/embassy#c39076724f052fed6781b056bb79c9fa576b87a3" dependencies = [ "document-features", ] [[package]] -name = "embassy-time-queue-driver" +name = "embassy-time-queue-utils" version = "0.1.0" -source = "git+https://github.com/embassy-rs/embassy#0ede8479dc4c6a58cfab0a5d4df41c0592405971" +source = "git+https://github.com/embassy-rs/embassy#c39076724f052fed6781b056bb79c9fa576b87a3" +dependencies = [ + "embassy-executor", + "heapless 0.8.0", +] [[package]] name = "embassy-usb" -version = "0.3.0" -source = "git+https://github.com/embassy-rs/embassy#0ede8479dc4c6a58cfab0a5d4df41c0592405971" +version = "0.4.0" +source = "git+https://github.com/embassy-rs/embassy#c39076724f052fed6781b056bb79c9fa576b87a3" dependencies = [ "defmt", "embassy-futures", "embassy-net-driver-channel", - "embassy-sync 0.6.0 (git+https://github.com/embassy-rs/embassy)", + "embassy-sync 0.6.2 (git+https://github.com/embassy-rs/embassy)", "embassy-usb-driver", "heapless 0.8.0", "ssmarshal", @@ -846,18 +865,18 @@ dependencies = [ [[package]] name = "embassy-usb-driver" version = "0.1.0" -source = "git+https://github.com/embassy-rs/embassy#0ede8479dc4c6a58cfab0a5d4df41c0592405971" +source = "git+https://github.com/embassy-rs/embassy#c39076724f052fed6781b056bb79c9fa576b87a3" dependencies = [ "defmt", ] [[package]] name = "embassy-usb-logger" -version = "0.2.0" -source = "git+https://github.com/embassy-rs/embassy#0ede8479dc4c6a58cfab0a5d4df41c0592405971" +version = "0.4.0" +source = "git+https://github.com/embassy-rs/embassy#c39076724f052fed6781b056bb79c9fa576b87a3" dependencies = [ "embassy-futures", - "embassy-sync 0.6.0 (git+https://github.com/embassy-rs/embassy)", + "embassy-sync 0.6.2 (git+https://github.com/embassy-rs/embassy)", "embassy-usb", "log", ] @@ -960,6 +979,15 @@ dependencies = [ "no-std-net", ] +[[package]] +name = "embedded-nal" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c56a28be191a992f28f178ec338a0bf02f63d7803244add736d026a471e6ed77" +dependencies = [ + "nb 1.1.0", +] + [[package]] name = "embedded-nal-async" version = "0.7.1" @@ -967,10 +995,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72229137a4fc12d239b0b7f50f04b30790678da6d782a0f3f1909bf57ec4b759" dependencies = [ "embedded-io-async", - "embedded-nal", + "embedded-nal 0.8.0", "no-std-net", ] +[[package]] +name = "embedded-nal-async" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76959917cd2b86f40a98c28dd5624eddd1fa69d746241c8257eac428d83cb211" +dependencies = [ + "embedded-io-async", + "embedded-nal 0.9.0", +] + [[package]] name = "embedded-sdmmc" version = "0.7.0" @@ -1122,9 +1160,9 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "futures" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" dependencies = [ "futures-channel", "futures-core", @@ -1136,9 +1174,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" dependencies = [ "futures-core", "futures-sink", @@ -1146,9 +1184,9 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "futures-intrusive" @@ -1162,38 +1200,38 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-macro" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.96", ] [[package]] name = "futures-sink" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" [[package]] name = "futures-task" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" [[package]] name = "futures-util" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ "futures-core", "futures-macro", @@ -1312,9 +1350,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.5" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" [[package]] name = "heapless" @@ -1384,9 +1422,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.9.4" +version = "1.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" +checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" [[package]] name = "ident_case" @@ -1396,12 +1434,12 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "indexmap" -version = "2.5.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" +checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" dependencies = [ "equivalent", - "hashbrown 0.14.5", + "hashbrown 0.15.2", ] [[package]] @@ -1433,6 +1471,24 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + +[[package]] +name = "keccak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" +dependencies = [ + "cpufeatures", +] + [[package]] name = "lalrpop" version = "0.19.12" @@ -1440,12 +1496,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0a1cbf952127589f2851ab2046af368fd20645491bb4b376f04b7f94d7a9837b" dependencies = [ "ascii-canvas", - "bit-set", + "bit-set 0.5.3", "diff", "ena", "is-terminal", - "itertools", - "lalrpop-util", + "itertools 0.10.5", + "lalrpop-util 0.19.12", "petgraph", "regex", "regex-syntax 0.6.29", @@ -1455,6 +1511,28 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "lalrpop" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e56f323e2d610628d1f5bdd39168a774674ac7989ed67011963bb3f71edd797" +dependencies = [ + "ascii-canvas", + "bit-set 0.6.0", + "ena", + "itertools 0.13.0", + "lalrpop-util 0.21.0", + "petgraph", + "pico-args", + "regex", + "regex-syntax 0.8.5", + "sha3", + "string_cache", + "term", + "unicode-xid", + "walkdir", +] + [[package]] name = "lalrpop-util" version = "0.19.12" @@ -1465,10 +1543,19 @@ dependencies = [ ] [[package]] -name = "libc" -version = "0.2.158" +name = "lalrpop-util" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" +checksum = "108dc8f5dabad92c65a03523055577d847f5dcc00f3e7d3a68bc4d48e01d8fe1" +dependencies = [ + "regex-automata", +] + +[[package]] +name = "libc" +version = "0.2.169" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" [[package]] name = "libm" @@ -1482,7 +1569,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "libc", ] @@ -1504,9 +1591,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.22" +version = "0.4.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f" [[package]] name = "managed" @@ -1629,7 +1716,16 @@ version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f646caf906c20226733ed5b1374287eb97e3c2a5c227ce668c1f2ce20ae57c9" dependencies = [ - "num_enum_derive", + "num_enum_derive 0.5.11", +] + +[[package]] +name = "num_enum" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e613fc340b2220f734a8595782c551f1250e969d87d3be1ae0579e8d4065179" +dependencies = [ + "num_enum_derive 0.7.3", ] [[package]] @@ -1644,10 +1740,21 @@ dependencies = [ ] [[package]] -name = "once_cell" -version = "1.19.0" +name = "num_enum_derive" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", +] + +[[package]] +name = "once_cell" +version = "1.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "opaque-debug" @@ -1724,10 +1831,16 @@ dependencies = [ ] [[package]] -name = "pin-project-lite" -version = "0.2.14" +name = "pico-args" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" +checksum = "5be167a7af36ee22fe3115051bc51f6e6c7054c9348e28deb4f49bd6f705a315" + +[[package]] +name = "pin-project-lite" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" [[package]] name = "pin-utils" @@ -1742,7 +1855,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76e09694b50f89f302ed531c1f2a7569f0be5867aee4ab4f8f729bbeec0078e3" dependencies = [ "arrayvec", - "num_enum", + "num_enum 0.5.11", + "paste", +] + +[[package]] +name = "pio" +version = "0.2.1" +source = "git+https://github.com/rp-rs/pio-rs?rev=fa586448b0b223217eec8c92c19fe6823dd04cc4#fa586448b0b223217eec8c92c19fe6823dd04cc4" +dependencies = [ + "arrayvec", + "num_enum 0.7.3", "paste", ] @@ -1752,12 +1875,22 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77532c2b8279aef98dfc7207ef15298a5a3d6b6cc76ccc8b65913d69f3a8dd6b" dependencies = [ - "lalrpop", - "lalrpop-util", - "pio", + "lalrpop 0.19.12", + "lalrpop-util 0.19.12", + "pio 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "regex-syntax 0.6.29", ] +[[package]] +name = "pio-parser" +version = "0.2.2" +source = "git+https://github.com/rp-rs/pio-rs?rev=fa586448b0b223217eec8c92c19fe6823dd04cc4#fa586448b0b223217eec8c92c19fe6823dd04cc4" +dependencies = [ + "lalrpop 0.21.0", + "lalrpop-util 0.21.0", + "pio 0.2.1 (git+https://github.com/rp-rs/pio-rs?rev=fa586448b0b223217eec8c92c19fe6823dd04cc4)", +] + [[package]] name = "pio-proc" version = "0.2.2" @@ -1765,9 +1898,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6b04dc870fb3a4fd8b3e4ca8c61b53bc8ac4eb78b66805d2b3c2e5c4829e0d7a" dependencies = [ "codespan-reporting", - "lalrpop-util", - "pio", - "pio-parser", + "lalrpop-util 0.19.12", + "pio 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "pio-parser 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro-error", "proc-macro2", "quote", @@ -1775,6 +1908,21 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "pio-proc" +version = "0.2.2" +source = "git+https://github.com/rp-rs/pio-rs?rev=fa586448b0b223217eec8c92c19fe6823dd04cc4#fa586448b0b223217eec8c92c19fe6823dd04cc4" +dependencies = [ + "codespan-reporting", + "lalrpop-util 0.21.0", + "pio 0.2.1 (git+https://github.com/rp-rs/pio-rs?rev=fa586448b0b223217eec8c92c19fe6823dd04cc4)", + "pio-parser 0.2.2 (git+https://github.com/rp-rs/pio-rs?rev=fa586448b0b223217eec8c92c19fe6823dd04cc4)", + "proc-macro-error2", + "proc-macro2", + "quote", + "syn 2.0.96", +] + [[package]] name = "polyval" version = "0.6.2" @@ -1789,9 +1937,9 @@ dependencies = [ [[package]] name = "portable-atomic" -version = "1.8.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d30538d42559de6b034bc76fd6dd4c38961b1ee5c6c56e3808c50128fdbc22ce" +checksum = "280dc24453071f1b63954171985a0b0d30058d287960968b9b2aca264c8d4ee6" dependencies = [ "critical-section", ] @@ -1845,19 +1993,41 @@ dependencies = [ ] [[package]] -name = "proc-macro2" -version = "1.0.86" +name = "proc-macro-error-attr2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "proc-macro-error2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" +dependencies = [ + "proc-macro-error-attr2", + "proc-macro2", + "quote", + "syn 2.0.96", +] + +[[package]] +name = "proc-macro2" +version = "1.0.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.37" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" dependencies = [ "proc-macro2", ] @@ -1889,11 +2059,11 @@ checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" [[package]] name = "redox_syscall" -version = "0.5.4" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0884ad60e090bf1345b93da0a5de8923c93884cd03f40dfcfddd3b4bee661853" +checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", ] [[package]] @@ -1904,30 +2074,30 @@ checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ "getrandom", "libredox", - "thiserror", + "thiserror 1.0.69", ] [[package]] name = "regex" -version = "1.10.6" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", "regex-automata", - "regex-syntax 0.8.4", + "regex-syntax 0.8.5", ] [[package]] name = "regex-automata" -version = "0.4.7" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.4", + "regex-syntax 0.8.5", ] [[package]] @@ -1938,9 +2108,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "reqwless" @@ -1953,7 +2123,7 @@ dependencies = [ "defmt", "embedded-io", "embedded-io-async", - "embedded-nal-async", + "embedded-nal-async 0.7.1", "embedded-tls", "heapless 0.8.0", "hex", @@ -1974,8 +2144,9 @@ dependencies = [ [[package]] name = "rp-pac" -version = "6.0.0" -source = "git+https://github.com/embassy-rs/rp-pac.git?rev=a7f42d25517f7124ad3b4ed492dec8b0f50a0e6c#a7f42d25517f7124ad3b4ed492dec8b0f50a0e6c" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8af65855c40b2c35079514c5489abffc0429347fef25d8467ff98ad84b4322d3" dependencies = [ "cortex-m", "cortex-m-rt", @@ -2005,14 +2176,14 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ - "semver 1.0.23", + "semver 1.0.24", ] [[package]] name = "rustversion" -version = "1.0.17" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" +checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" [[package]] name = "ryu" @@ -2020,6 +2191,15 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + [[package]] name = "scopeguard" version = "1.2.0" @@ -2050,9 +2230,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.23" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" +checksum = "3cb6eb87a131f756572d7fb904f6e7b68633f09cca868c5df1c4b8d1a694bbba" [[package]] name = "semver-parser" @@ -2062,9 +2242,9 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.210" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" +checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" dependencies = [ "serde_derive", ] @@ -2082,13 +2262,13 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.210" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" +checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.96", ] [[package]] @@ -2108,6 +2288,16 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f179d4e11094a893b82fff208f74d448a7512f99f5a0acbd5c679b705f83ed9" +[[package]] +name = "sha3" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +dependencies = [ + "digest", + "keccak", +] + [[package]] name = "simba" version = "0.7.3" @@ -2138,7 +2328,16 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38dd45fa275f70b4110eac5f5182611ad384f88bb22b68b9a9c3cafd7015290b" dependencies = [ - "smart-leds-trait", + "smart-leds-trait 0.2.1", +] + +[[package]] +name = "smart-leds" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66df34e571fa9993fa6f99131a374d58ca3d694b75f9baac93458fe0d6057bf0" +dependencies = [ + "smart-leds-trait 0.3.0", ] [[package]] @@ -2150,10 +2349,20 @@ dependencies = [ "rgb", ] +[[package]] +name = "smart-leds-trait" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bc64ee02bbbf469603016df746c0ed224f263280b6ebb49b7ebadbff375c572" +dependencies = [ + "rgb", +] + [[package]] name = "smoltcp" -version = "0.11.0" -source = "git+https://github.com/smoltcp-rs/smoltcp?rev=dd43c8f189178b0ab3bda798ed8578b5b0a6f094#dd43c8f189178b0ab3bda798ed8578b5b0a6f094" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dad095989c1533c1c266d9b1e8d70a1329dd3723c3edac6d03bbd67e7bf6f4bb" dependencies = [ "bitflags 1.3.2", "byteorder", @@ -2248,9 +2457,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.77" +version = "2.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" +checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80" dependencies = [ "proc-macro2", "quote", @@ -2279,22 +2488,42 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.64" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ - "thiserror-impl", + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d452f284b73e6d76dd36758a0c8684b1d5be31f92b89d07fd5822175732206fc" +dependencies = [ + "thiserror-impl 2.0.11", ] [[package]] name = "thiserror-impl" -version = "1.0.64" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.96", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26afc1baea8a989337eeb52b6e72a039780ce45c3edfcc9c5b9d112feeb173c2" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", ] [[package]] @@ -2314,9 +2543,9 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "unicode-ident" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" +checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" [[package]] name = "unicode-width" @@ -2424,6 +2653,16 @@ dependencies = [ "vcell", ] +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -2561,7 +2800,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.96", ] [[package]] diff --git a/controller/Cargo.toml b/controller/Cargo.toml index bffed1a..d9a5555 100644 --- a/controller/Cargo.toml +++ b/controller/Cargo.toml @@ -6,17 +6,17 @@ license = "MIT OR Apache-2.0" [dependencies] -embassy-executor = { version = "0.6.0", git="https://github.com/embassy-rs/embassy", features = ["task-arena-size-98304", "arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] } -embassy-time = { version = "0.3.2", git="https://github.com/embassy-rs/embassy", features = ["defmt", "defmt-timestamp-uptime"] } -embassy-rp = { version = "0.2.0", git="https://github.com/embassy-rs/embassy", features = ["defmt", "unstable-pac", "time-driver", "critical-section-impl", "rp2040"] } +embassy-executor = { version = "0.7.0", git="https://github.com/embassy-rs/embassy", features = ["task-arena-size-98304", "arch-cortex-m", "executor-thread", "executor-interrupt", "defmt"] } +embassy-time = { version = "0.4.0", git="https://github.com/embassy-rs/embassy", features = ["defmt", "defmt-timestamp-uptime"] } +embassy-rp = { version = "0.3.0", git="https://github.com/embassy-rs/embassy", features = ["defmt", "unstable-pac", "time-driver", "critical-section-impl", "rp2040"] } embassy-sync = { version = "0.6.2", git="https://github.com/embassy-rs/embassy" } -embassy-usb = { version = "0.3.0", git="https://github.com/embassy-rs/embassy", features = ["defmt"] } -embassy-net = { version = "0.4.0", git="https://github.com/embassy-rs/embassy", features = ["defmt", "tcp", "udp", "raw", "dhcpv4", "medium-ethernet", "dns"] } -embassy-net-wiznet = { version = "0.1.0", git="https://github.com/embassy-rs/embassy", features = ["defmt"] } +embassy-usb = { version = "0.4.0", git="https://github.com/embassy-rs/embassy", features = ["defmt"] } +embassy-net = { version = "0.6.0", git="https://github.com/embassy-rs/embassy", features = ["defmt", "tcp", "udp", "raw", "dhcpv4", "medium-ethernet", "dns"] } +embassy-net-wiznet = { version = "0.2.0", git="https://github.com/embassy-rs/embassy", features = ["defmt"] } embassy-futures = { version = "0.1.0", git="https://github.com/embassy-rs/embassy"} -embassy-usb-logger = { version = "0.2.0", git="https://github.com/embassy-rs/embassy" } -cyw43 = { version = "0.2.0", git="https://github.com/embassy-rs/embassy", features = ["defmt", "firmware-logs", "bluetooth"] } -cyw43-pio = { version = "0.2.0", git="https://github.com/embassy-rs/embassy", features = ["defmt"] } +embassy-usb-logger = { version = "0.4.0", git="https://github.com/embassy-rs/embassy" } +cyw43 = { version = "0.3.0", git="https://github.com/embassy-rs/embassy", features = ["defmt", "firmware-logs", "bluetooth"] } +cyw43-pio = { version = "0.3.0", git="https://github.com/embassy-rs/embassy", features = ["defmt"] } defmt = "0.3" defmt-rtt = "0.4" @@ -58,7 +58,6 @@ pio = "0.2.1" rand = { version = "0.8.5", default-features = false } embedded-sdmmc = "0.7.0" -bt-hci = { version = "0.1.0", default-features = false, features = ["defmt"] } hex = { version = "0.4.3", default-features=false } mpu6050 = { git = "https://git.ank.dev/ank/mpu6050" } vl53l0x = "1.0.1" diff --git a/controller/src/main.rs b/controller/src/main.rs index d40e121..61e2f86 100644 --- a/controller/src/main.rs +++ b/controller/src/main.rs @@ -11,14 +11,16 @@ use core::array; use core::borrow::BorrowMut; use core::cell::RefCell; use core::fmt::Formatter; +use core::mem::transmute; use core::panic::PanicInfo; use core::str::from_utf8; -use bt_hci::cmd::info; -use cyw43_pio::PioSpi; +use cyw43_pio::{PioSpi, DEFAULT_CLOCK_DIVIDER}; use embassy_rp::i2c::{Async, I2c}; -use embassy_rp::multicore::spawn_core1; +use embassy_rp::multicore::{spawn_core1, Stack}; use embassy_rp::pwm::{self, Pwm}; +use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex; +use embassy_sync::channel::Channel; use embedded_hal_bus::i2c::RefCellDevice; use fixed::FixedU16; use log::*; @@ -37,7 +39,7 @@ use embedded_io_async::Write; use mpu6050::Mpu6050; use rand::RngCore; use reqwless::response; -use sensor_manager::{sensor_manager, SensorData}; +use sensor_manager::{sensor_manager, SensorData, SensorHardware}; use static_cell::StaticCell; use defmt_rtt as _; @@ -49,7 +51,7 @@ bind_interrupts!(struct Irqs { }); static mut CORE1_STACK: Stack<4096> = Stack::new(); -static CHANNEL: Channel = Channel::new(); +pub static CHANNEL: Channel = Channel::new(); #[embassy_executor::task] async fn logger_task(driver: Driver<'static, USB>) { @@ -101,57 +103,22 @@ async fn main(spawner: Spawner) { let scl = p.PIN_27; let config = embassy_rp::i2c::Config::default(); let bus1 = embassy_rp::i2c::I2c::new_async(p.I2C1, scl, sda, Irqs, config); - let bus1 = RefCell::new(bus1); - let mut tof2enable = Output::new(p.PIN_16, Level::Low); + let tof2enable = Output::new(p.PIN_16, Level::Low); + let hardware = SensorHardware { + bus_tof: unsafe {transmute(bus)}, + bus_gyro: unsafe {transmute(bus1)}, + tof2enable, + }; spawn_core1( p.CORE1, unsafe { &mut *core::ptr::addr_of_mut!(CORE1_STACK) }, move || { - sensor_manager(bus, tof2enable) + sensor_manager(hardware) } ); - info!("made RefCell"); - - info!("2"); - Timer::after_millis(1).await; - let mut tof = vl53l0x::VL53L0x::new(RefCellDevice::new(&bus1)).unwrap(); - info!("3"); - tof.set_address(0x32).unwrap(); - info!("4"); - tof2enable.set_high(); - Timer::after_micros(1200).await; // DS11555 3.2 - info!("5"); - let mut tof2 = vl53l0x::VL53L0x::new(RefCellDevice::new(&bus1)).unwrap(); - info!("6"); - - - let mut gyro = Mpu6050::new_with_addr(bus,0x68); - - Timer::after_millis(1300).await; - gyro.init(&mut Delay).unwrap(); - - gyro.set_gyro_range(mpu6050::device::GyroRange::D2000).unwrap(); - gyro.set_accel_range(mpu6050::device::AccelRange::G16).unwrap(); - info!("pinidtd"); - Timer::after_millis(1300).await; - - loop { - //info!("pos: {}", gyro.get_gyro().unwrap().x); - //info!("jerk: {}", gyro.get_acc().unwrap().x); - //info!("temp: {}", gyro.get_temp().unwrap() * (9./5.) + 32.); - if let Ok(dist) = tof.read_range_single_millimeters_blocking() { - info!("dist1: {dist}mm"); - } - Timer::after_millis(3).await; - if let Ok(dist) = tof2.read_range_single_millimeters_blocking() { - info!("dist2: {dist}mm"); - } - Timer::after_millis(23).await; - } - let fw = include_bytes!("../../cyw43-firmware/43439A0.bin"); let clm = include_bytes!("../../cyw43-firmware/43439A0_clm.bin"); @@ -165,7 +132,16 @@ async fn main(spawner: Spawner) { let pwr = Output::new(p.PIN_23, Level::Low); let cs = Output::new(p.PIN_25, Level::High); let mut pio = Pio::new(p.PIO0, Irqs); - let spi = PioSpi::new(&mut pio.common, pio.sm0, pio.irq0, cs, p.PIN_24, p.PIN_29, p.DMA_CH0); + let spi = PioSpi::new( + &mut pio.common, + pio.sm0, + DEFAULT_CLOCK_DIVIDER, + pio.irq0, + cs, + p.PIN_24, + p.PIN_29, + p.DMA_CH0, + ); static STATE: StaticCell = StaticCell::new(); let state = STATE.init(cyw43::State::new()); @@ -531,32 +507,6 @@ async fn main(spawner: Spawner) { let mut segs = buf[..n].trim_ascii().split(|c| *c == ' ' as u8); match char::from_u32(segs.next().unwrap()[0] as u32).unwrap() { - 'W' => { - let addr: [u8;1] = hex::FromHex::from_hex(segs.next().unwrap()).unwrap(); - let reg: [u8;1] = hex::FromHex::from_hex(segs.next().unwrap()).unwrap(); - let data: [u8;1] = hex::FromHex::from_hex(segs.next().unwrap()).unwrap(); - info!("writing {:?}", reg); - Timer::after_millis(30).await; - - bus.write_async(addr[0] as u16, [reg[0], data[0]]).await.unwrap(); - - buf[0] = b"O"[0]; - buf[1] = b"K"[0]; - n=2; - }, - 'R' => { - let addr: [u8;1] = hex::FromHex::from_hex(segs.next().unwrap()).unwrap(); - let reg: [u8;1] = hex::FromHex::from_hex(segs.next().unwrap()).unwrap(); - info!("writing {:?}, addr {addr:?}", reg); - - let mut response: [u8;2] = [0;2]; - - let _ = bus.write_read_async(addr[0] as u16, reg, &mut response).await; - info!("recd {:?}", response); - info!("recd {:#02x}", response[0]); - let _ = hex::encode_to_slice(response, &mut buf); - n = 4; - }, 'D' => { let left: [u8;2] = hex::FromHex::from_hex(segs.next().unwrap()).unwrap(); let right: [u8;2] = hex::FromHex::from_hex(segs.next().unwrap()).unwrap(); diff --git a/controller/src/sensor_manager.rs b/controller/src/sensor_manager.rs index aa475ab..0b82a19 100644 --- a/controller/src/sensor_manager.rs +++ b/controller/src/sensor_manager.rs @@ -12,15 +12,17 @@ use log::info; use mpu6050::Mpu6050; use nalgebra::Vector3; +use crate::CHANNEL; + pub struct SensorHardware { - bus_tof: I2c<'static, I2C1, Async>, - bus_gyro: I2c<'static, I2C0, Async>, - tof2enable: Output<'static>, + pub bus_tof: I2c<'static, I2C1, Async>, + pub bus_gyro: I2c<'static, I2C0, Async>, + pub tof2enable: Output<'static>, } pub fn sensor_manager(mut hardware: SensorHardware) -> ! { - let executor = Executor::new(); - let executor: &'static mut Executor = unsafe{transmute(&executor)}; + let mut executor = Executor::new(); + let executor: &'static mut Executor = unsafe{transmute(&mut executor)}; executor.run(move |spawner| { spawner.spawn(init_sensors(hardware)).unwrap(); }); @@ -35,7 +37,8 @@ enum PollState { Gyro, } -struct SensorData { +#[derive(Clone, Debug)] +pub struct SensorData { /// distance, mm tof1: Option, /// distance, mm @@ -95,8 +98,6 @@ async fn init_sensors(mut hardware: SensorHardware) { } POLL_STATE.store(PollState::None as u8, Ordering::SeqCst); - - - + CHANNEL.send(data.clone()).await; } } From 9f740d84358d39104ae37c891d0a5039caec4a56 Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Sat, 18 Jan 2025 13:31:10 -0500 Subject: [PATCH 07/69] sensor data timestamp --- controller/src/sensor_manager.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/controller/src/sensor_manager.rs b/controller/src/sensor_manager.rs index 0b82a19..2909ede 100644 --- a/controller/src/sensor_manager.rs +++ b/controller/src/sensor_manager.rs @@ -76,25 +76,33 @@ async fn init_sensors(mut hardware: SensorHardware) { }; loop { + let mut updated = false; POLL_STATE.store(PollState::Tof1 as u8, Ordering::SeqCst); if let Ok(dist) = tof.read_range_single_millimeters_blocking() { info!("dist1: {dist}mm"); data.tof1 = Some(dist); + updated = true; } Timer::after_millis(3).await; POLL_STATE.store(PollState::Tof2 as u8, Ordering::SeqCst); if let Ok(dist) = tof2.read_range_single_millimeters_blocking() { info!("dist2: {dist}mm"); data.tof2 = Some(dist); + updated = true; } Timer::after_millis(3).await; POLL_STATE.store(PollState::Gyro as u8, Ordering::SeqCst); if let Ok(gyro) = gyro.get_gyro() { info!("rotation: {gyro}"); data.gyro = Some(gyro); + updated = true; } if let Ok(accel) = gyro.get_acc() { data.accel = Some(accel); + updated = true; + } + if updated { + data.updated = Instant::now(); } POLL_STATE.store(PollState::None as u8, Ordering::SeqCst); From 3b829b1b59c0c7a7347050567765f95d8b2ff91f Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Sat, 18 Jan 2025 13:31:25 -0500 Subject: [PATCH 08/69] remove partial tof driver --- controller/src/main.rs | 286 ----------------------------------------- 1 file changed, 286 deletions(-) diff --git a/controller/src/main.rs b/controller/src/main.rs index 61e2f86..e066dfb 100644 --- a/controller/src/main.rs +++ b/controller/src/main.rs @@ -178,292 +178,6 @@ async fn main(spawner: Spawner) { let mut tx_buffer = [0; 4096]; let mut buf = [0; 4096]; - //embassy_time::Timer::after_millis(7000).await; - - //async fn write_to_device<'a, T,const N: usize>(bus: &mut embassy_rp::i2c::I2c<'a, T,Async>, addr: u16, data: [[u8;2];N]) - //where T: embassy_rp::i2c::Instance { - // for transaction in data { - // let _ = bus.write_async(addr, transaction).await; - // } - //} - - //async fn write_flag<'a, T>(bus: &mut embassy_rp::i2c::I2c<'a, T,Async>, addr: u16, reg: u8, bit: u8, value: bool) - //where T: embassy_rp::i2c::Instance { - // let mut initial: [u8;1] = [0]; - // let _ = bus.write_read_async(addr, [reg], &mut initial).await; - // let mask = 1 << bit; - // if value { - // initial[0] |= mask; - // } else { - // initial[0] &= !mask; - // } - // let _ = bus.write_async(addr, [reg, initial[0]]).await; - //} - - //let id = 0x29; - //Timer::after_millis(50).await; // sensor boot - //write_to_device(&mut bus, id, [ - // [0x88, 0x00], - // [0x80, 0x01], - // [0xFF, 0x01], - // [0x00, 0x00], - //]).await; - //let mut stop: [u8;1] = [0]; - //let _ = bus.write_read_async(id, [0x91], &mut stop); - //write_to_device(&mut bus, id, [ - // [0x00, 0x01], - // [0xFF, 0x00], - // [0x80, 0x00], - //]).await; - // - //// disable SIGNAL_RATE_MSRC (bit 1) and SIGNAL_RATE_PRE_RANGE (bit 4) limit checks - //write_flag(&mut bus, id, 0x60, 1, true).await; - //write_flag(&mut bus, id, 0x60, 4, true).await; - - //let mega_counts_per_second = 0.25; - //let mega_counts_per_second: u16 = (mega_counts_per_second * (1<<7) as f64) as u16; - //let _ = bus.write_async(id, [FINAL_RANGE_CONFIG_MIN_COUNT_RATE_RTN_LIMIT as u8, - // (mega_counts_per_second >> 8) as u8, - // (mega_counts_per_second & 255) as u8 - //]).await; - - //// get spad info - //let _ = bus.write_async(id, [SYSTEM_SEQUENCE_CONFIG as u8, 0xFF]).await; - - //write_to_device(&mut bus, id , [ - // [0x80, 0x01], - // [0xff, 0x01], - // [0x00, 0x00], - // [0xff, 0x06], - //]).await; - //write_flag(&mut bus, id, 0x83, 3, true).await; - //write_to_device(&mut bus, id , [ - // [0xff, 0x07], - // [0x81, 0x01], - // [0x80, 0x01], - // [0x94, 0x6b], - // [0x83, 0x00], - //]).await; - //debug!("starting spad wait"); - //loop { - // let mut wait: [u8;1] = [0]; - // let _ = bus.write_read_async(id, [0x83], &mut wait).await; - // if wait[0] != 0 { - // break; - // } - // Timer::after_micros(5).await; - //} - //debug!("ended spad wait"); - - //let _ = bus.write_async(id, [0x83, 0x01]).await; - - //let mut value: [u8;1] = [0]; - //let _ = bus.write_read_async(id, [0x92], &mut value).await; - //write_to_device(&mut bus, id, [ - // [0x81, 0x00], - // [0xff, 0x06], - //]).await; - //write_flag(&mut bus, id, 0x83, 3, false).await; - //write_to_device(&mut bus, id, [ - // [0xff, 0x01], - // [0x00, 0x01], - // [0xff, 0x00], - // [0x80, 0x00], - //]).await; - //let count = value[0] & 0x7f; - //let is_aperture = value[0] & 0b10000000; - //let is_aperture = is_aperture != 0; - //// TODO: vl53l0x.py post line 200 - - //let mut spad_map: [u8;6]=[0;6]; - //let _ = bus.write_read_async(id, [GLOBAL_CONFIG_SPAD_ENABLES_REF_0 as u8], &mut spad_map); - - //write_to_device(&mut bus, id, [ - // [0xff, 0x01], - // [DYNAMIC_SPAD_REF_EN_START_OFFSET as u8, 0x00], - // [DYNAMIC_SPAD_NUM_REQUESTED_REF_SPAD as u8, 0x2c], - // [0xff, 0x00], - // [DYNAMIC_SPAD_REF_EN_START_OFFSET as u8, 0xb4], - //]).await; - - //let mut spads_enabled = 0; - //for i in 0..48 { - // if i < 12 && is_aperture || spads_enabled >= count { - // spad_map[i/8] &= !(1<< (i>>2)); - // } else if (spad_map[i/8] & (1<< (i>>2))) != 0 { - // spads_enabled += 1; - // } - //} - - //let mut spad_write: [u8;7] = [0;7]; - //spad_write[0] = GLOBAL_CONFIG_SPAD_ENABLES_REF_0 as u8; - //spad_write[1..].clone_from_slice(&spad_map); - //let _ = bus.write_async(id, spad_write).await; - - // - //write_to_device(&mut bus, id, [ - // [0xFF, 0x01], - // [0x00, 0x00], - // [0xFF, 0x00], - // [0x09, 0x00], - // [0x10, 0x00], - // [0x11, 0x00], - // [0x24, 0x01], - // [0x25, 0xFF], - // [0x75, 0x00], - // [0xFF, 0x01], - // [0x4E, 0x2C], - // [0x48, 0x00], - // [0x30, 0x20], - // [0xFF, 0x00], - // [0x30, 0x09], - // [0x54, 0x00], - // [0x31, 0x04], - // [0x32, 0x03], - // [0x40, 0x83], - // [0x46, 0x25], - // [0x60, 0x00], - // [0x27, 0x00], - // [0x50, 0x06], - // [0x51, 0x00], - // [0x52, 0x96], - // [0x56, 0x08], - // [0x57, 0x30], - // [0x61, 0x00], - // [0x62, 0x00], - // [0x64, 0x00], - // [0x65, 0x00], - // [0x66, 0xA0], - // [0xFF, 0x01], - // [0x22, 0x32], - // [0x47, 0x14], - // [0x49, 0xFF], - // [0x4A, 0x00], - // [0xFF, 0x00], - // [0x7A, 0x0A], - // [0x7B, 0x00], - // [0x78, 0x21], - // [0xFF, 0x01], - // [0x23, 0x34], - // [0x42, 0x00], - // [0x44, 0xFF], - // [0x45, 0x26], - // [0x46, 0x05], - // [0x40, 0x40], - // [0x0E, 0x06], - // [0x20, 0x1A], - // [0x43, 0x40], - // [0xFF, 0x00], - // [0x34, 0x03], - // [0x35, 0x44], - // [0xFF, 0x01], - // [0x31, 0x04], - // [0x4B, 0x09], - // [0x4C, 0x05], - // [0x4D, 0x04], - // [0xFF, 0x00], - // [0x44, 0x00], - // [0x45, 0x20], - // [0x47, 0x08], - // [0x48, 0x28], - // [0x67, 0x00], - // [0x70, 0x04], - // [0x71, 0x01], - // [0x72, 0xFE], - // [0x76, 0x00], - // [0x77, 0x00], - // [0xFF, 0x01], - // [0x0D, 0x01], - // [0xFF, 0x00], - // [0x80, 0x01], - // [0x01, 0xF8], - // [0xFF, 0x01], - // [0x8E, 0x01], - // [0x00, 0x01], - // [0xFF, 0x00], - // [0x80, 0x00], - - // [SYSTEM_INTERRUPT_CONFIG_GPIO as u8, 0x04], - //]).await; - ////write_flag(&mut bus, id, GPIO_HV_MUX_ACTIVE_HIGH as u8, 4, false).await; - ////let _ = bus.write_async(id, [SYSTEM_SEQUENCE_CONFIG as u8, 0x01]).await; - ////calibrate(&mut bus, id, 0x40).await; - ////let _ = bus.write_async(id, [SYSTEM_SEQUENCE_CONFIG as u8, 0x02]).await; - ////calibrate(&mut bus, id, 0x00).await; - ////let _ = bus.write_async(id, [SYSTEM_SEQUENCE_CONFIG as u8, 0xe8]).await; - - //async fn calibrate<'a, T>(bus: &mut embassy_rp::i2c::I2c<'a, T,Async>, addr: u16, data: u8) - //where T: embassy_rp::i2c::Instance { - // let _ = bus.write_async(addr, [SYSRANGE_START as u8 ,data | 0x01]).await; - // debug!("started calib wait"); - // loop { - // let mut wait: [u8;1] = [0]; - // let _ = bus.write_read_async(addr, [0x13], &mut wait).await; - // if wait[0] & 0x07 != 0 { - // break; - // } - // Timer::after_micros(5).await; - // } - // debug!("ended calib wait"); - // write_to_device(bus, addr, [ - // [SYSTEM_INTERRUPT_CLEAR as u8, 0x01], - // [SYSRANGE_START as u8, 0x00], - // ]).await; - //} - - - ////TODO VL53L0X.cpp L 236-280 - - - //// start continuous mode - //write_to_device(&mut bus, id, [ - // [0x80, 0x01], - // [0xFF, 0x01], - // [0x00, 0x00], - // [0x91, stop[0]], - // [0x00, 0x01], - // [0xFF, 0x00], - // [0x80, 0x00], - // //[0x04, 0x00], // measurement delay - // [0x00, 0x02], // back to back shots - //]).await; - - ////let _ = bus.write_async(0x88u16, [0x00]).await; - ////let _ = bus.write_async(0x80u16, [0x01]).await; - ////let _ = bus.write_async(0xFFu16, [0x01]).await; - ////let _ = bus.write_async(0x00u16, [0x00]).await; - ////let _ = bus.write_async(0x00u16, [0x01]).await; - ////let _ = bus.write_async(0xFFu16, [0x00]).await; - ////let _ = bus.write_async(0x80u16, [0x00]).await; - // - ////loop { - //// debug!("starting wait part 1"); - //// loop { - //// let mut wait: [u8;1] = [0]; - //// let _ = bus.write_read_async(id, [SYSRANGE_START as u8], &mut wait).await; - //// debug!("{wait:?}"); - //// if wait[0] & 0x01 != 0 { - //// break; - //// } - //// Timer::after_micros(5).await; - //// } - //// debug!("starting wait part 2"); - //// loop { - //// let mut wait: [u8;1] = [0]; - //// let _ = bus.write_read_async(id, [RESULT_INTERRUPT_STATUS as u8], &mut wait).await; - //// if wait[0] & 0x07 != 0 { - //// break; - //// } - //// Timer::after_micros(5).await; - //// } - //// debug!("ending wait part 2"); - //// let mut output: [u8; 2] = [0;2]; - //// let _ = bus.write_read_async(id, [0x14], &mut output).await; - //// let _ = bus.write_async(id, [0x0B, 0x01]).await; - //// info!("out: {:?}",output); - //// Timer::after_millis(20).await; - ////} - loop { let mut socket = TcpSocket::new(stack, &mut rx_buffer, &mut tx_buffer); socket.set_timeout(Some(Duration::from_secs(3))); From 736584f5d6fee85ab64f240056dca365205018a2 Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Sat, 18 Jan 2025 13:45:49 -0500 Subject: [PATCH 09/69] copy pwm config from door winch --- controller/src/main.rs | 20 ++++----- controller/src/vl53l0.rs | 91 ---------------------------------------- 2 files changed, 9 insertions(+), 102 deletions(-) delete mode 100644 controller/src/vl53l0.rs diff --git a/controller/src/main.rs b/controller/src/main.rs index e066dfb..135bb42 100644 --- a/controller/src/main.rs +++ b/controller/src/main.rs @@ -87,11 +87,11 @@ async fn main(spawner: Spawner) { let mut flipper = Output::new(p.PIN_22, Level::Low); let mut c: pwm::Config = Default::default(); - c.divider = 255.into(); - c.top = 8715; - c.compare_b = 7210; - c.compare_a = 2240; - let mut pwm = Pwm::new_output_ab(p.PWM_SLICE1, p.PIN_18, p.PIN_19, c.clone()); + c.divider = 40.into(); + c.top = 62500; // 20ms + c.compare_b = 4687; // 1.5ms + c.compare_a = 4687; // 1.5ms + let mut drive_pwm = Pwm::new_output_ab(p.PWM_SLICE1, p.PIN_18, p.PIN_19, c.clone()); flipper.set_high(); let sda = p.PIN_20; @@ -169,10 +169,8 @@ async fn main(spawner: Spawner) { defmt::unwrap!(spawner.spawn(net_task(runner))); - //control.start_ap_open("cyw43", 5).await; - control.start_ap_wpa2("lovesense_setup2", "password123", 5).await; - - // And now we can use it! + // password is not terribly private information + control.start_ap_wpa2("cruisecontrol", "dxSk2avMFvsY", 5).await; let mut rx_buffer = [0; 4096]; let mut tx_buffer = [0; 4096]; @@ -187,7 +185,7 @@ async fn main(spawner: Spawner) { c.top = 8715; c.compare_b = 0; c.compare_a = 0; - pwm.set_config(&c); + drive_pwm.set_config(&c); flipper.set_low(); @@ -231,7 +229,7 @@ async fn main(spawner: Spawner) { let right = u16::from_be_bytes(right); c.compare_b = right; info!("left {:?}, right {left:?}", right); - pwm.set_config(&c); + drive_pwm.set_config(&c); }, 'F' => { flipper.set_high(); diff --git a/controller/src/vl53l0.rs b/controller/src/vl53l0.rs deleted file mode 100644 index 2df35a8..0000000 --- a/controller/src/vl53l0.rs +++ /dev/null @@ -1,91 +0,0 @@ -use core::ops::Deref; - -#[repr(u8)] -pub enum RegAddr - { - SYSRANGE_START = 0x00, - - SYSTEM_THRESH_HIGH = 0x0C, - SYSTEM_THRESH_LOW = 0x0E, - - SYSTEM_SEQUENCE_CONFIG = 0x01, - SYSTEM_RANGE_CONFIG = 0x09, - SYSTEM_INTERMEASUREMENT_PERIOD = 0x04, - - SYSTEM_INTERRUPT_CONFIG_GPIO = 0x0A, - - GPIO_HV_MUX_ACTIVE_HIGH = 0x84, - - SYSTEM_INTERRUPT_CLEAR = 0x0B, - - RESULT_INTERRUPT_STATUS = 0x13, - RESULT_RANGE_STATUS = 0x14, - - RESULT_CORE_AMBIENT_WINDOW_EVENTS_RTN = 0xBC, - //RESULT_CORE_RANGING_TOTAL_EVENTS_RTN = 0xC0, - RESULT_CORE_AMBIENT_WINDOW_EVENTS_REF = 0xD0, - RESULT_CORE_RANGING_TOTAL_EVENTS_REF = 0xD4, - RESULT_PEAK_SIGNAL_RATE_REF = 0xB6, - - ALGO_PART_TO_PART_RANGE_OFFSET_MM = 0x28, - - I2C_SLAVE_DEVICE_ADDRESS = 0x8A, - - MSRC_CONFIG_CONTROL = 0x60, - - PRE_RANGE_CONFIG_MIN_SNR = 0x27, - PRE_RANGE_CONFIG_VALID_PHASE_LOW = 0x56, - PRE_RANGE_CONFIG_VALID_PHASE_HIGH = 0x57, - PRE_RANGE_MIN_COUNT_RATE_RTN_LIMIT = 0x64, - - FINAL_RANGE_CONFIG_MIN_SNR = 0x67, - FINAL_RANGE_CONFIG_VALID_PHASE_LOW = 0x47, - FINAL_RANGE_CONFIG_VALID_PHASE_HIGH = 0x48, - FINAL_RANGE_CONFIG_MIN_COUNT_RATE_RTN_LIMIT = 0x44, - - PRE_RANGE_CONFIG_SIGMA_THRESH_HI = 0x61, - PRE_RANGE_CONFIG_SIGMA_THRESH_LO = 0x62, - - PRE_RANGE_CONFIG_VCSEL_PERIOD = 0x50, - PRE_RANGE_CONFIG_TIMEOUT_MACROP_HI = 0x51, - PRE_RANGE_CONFIG_TIMEOUT_MACROP_LO = 0x52, - - SYSTEM_HISTOGRAM_BIN = 0x81, - HISTOGRAM_CONFIG_INITIAL_PHASE_SELECT = 0x33, - HISTOGRAM_CONFIG_READOUT_CTRL = 0x55, - - FINAL_RANGE_CONFIG_VCSEL_PERIOD = 0x70, - FINAL_RANGE_CONFIG_TIMEOUT_MACROP_HI = 0x71, - FINAL_RANGE_CONFIG_TIMEOUT_MACROP_LO = 0x72, - CROSSTALK_COMPENSATION_PEAK_RATE_MCPS = 0x20, - - MSRC_CONFIG_TIMEOUT_MACROP = 0x46, - - SOFT_RESET_GO2_SOFT_RESET_N = 0xBF, - IDENTIFICATION_MODEL_ID = 0xC0, - IDENTIFICATION_REVISION_ID = 0xC2, - - OSC_CALIBRATE_VAL = 0xF8, - - GLOBAL_CONFIG_VCSEL_WIDTH = 0x32, - GLOBAL_CONFIG_SPAD_ENABLES_REF_0 = 0xB0, - GLOBAL_CONFIG_SPAD_ENABLES_REF_1 = 0xB1, - GLOBAL_CONFIG_SPAD_ENABLES_REF_2 = 0xB2, - GLOBAL_CONFIG_SPAD_ENABLES_REF_3 = 0xB3, - GLOBAL_CONFIG_SPAD_ENABLES_REF_4 = 0xB4, - GLOBAL_CONFIG_SPAD_ENABLES_REF_5 = 0xB5, - - //GLOBAL_CONFIG_REF_EN_START_SELECT = 0xB6, - DYNAMIC_SPAD_NUM_REQUESTED_REF_SPAD = 0x4E, - DYNAMIC_SPAD_REF_EN_START_OFFSET = 0x4F, - POWER_MANAGEMENT_GO1_POWER_FORCE = 0x80, - - VHV_CONFIG_PAD_SCL_SDA__EXTSUP_HV = 0x89, - - ALGO_PHASECAL_LIM = 0x30, - //ALGO_PHASECAL_CONFIG_TIMEOUT = 0x30, -} - -struct Vl53l0x { - -} From 4945b4d7778686d3d87e52524e17647249afb610 Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Sat, 18 Jan 2025 14:26:13 -0500 Subject: [PATCH 10/69] rx netcode --- controller/Cargo.lock | 31 ++++++++++ controller/Cargo.toml | 4 +- controller/src/main.rs | 97 ++++++++++++++------------------ controller/src/sensor_manager.rs | 20 ++----- 4 files changed, 79 insertions(+), 73 deletions(-) diff --git a/controller/Cargo.lock b/controller/Cargo.lock index e64dc10..dcece99 100644 --- a/controller/Cargo.lock +++ b/controller/Cargo.lock @@ -268,6 +268,12 @@ dependencies = [ "inout", ] +[[package]] +name = "cobs" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67ba02a97a2bd10f4b59b25c7973101c79642302776489e030cd13cdab09ed15" + [[package]] name = "codespan-reporting" version = "0.11.1" @@ -278,6 +284,15 @@ dependencies = [ "unicode-width", ] +[[package]] +name = "common" +version = "0.1.0" +dependencies = [ + "nalgebra", + "postcard", + "serde", +] + [[package]] name = "const-oid" version = "0.9.6" @@ -290,6 +305,7 @@ version = "0.1.0" dependencies = [ "assign-resources", "byte-slice-cast 1.2.2", + "common", "cortex-m", "cortex-m-rt", "critical-section", @@ -326,6 +342,7 @@ dependencies = [ "pio 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "pio-proc 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "portable-atomic", + "postcard", "rand", "reqwless", "serde", @@ -1375,6 +1392,7 @@ dependencies = [ "atomic-polyfill", "hash32 0.2.1", "rustc_version 0.4.1", + "serde", "spin", "stable_deref_trait", ] @@ -1633,6 +1651,7 @@ dependencies = [ "num-complex", "num-rational", "num-traits", + "serde", "simba", "typenum", ] @@ -1680,6 +1699,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" dependencies = [ "num-traits", + "serde", ] [[package]] @@ -1944,6 +1964,17 @@ dependencies = [ "critical-section", ] +[[package]] +name = "postcard" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "170a2601f67cc9dba8edd8c4870b15f71a6a2dc196daec8c83f72b59dff628a8" +dependencies = [ + "cobs", + "heapless 0.7.17", + "serde", +] + [[package]] name = "ppv-lite86" version = "0.2.20" diff --git a/controller/Cargo.toml b/controller/Cargo.toml index d9a5555..1692ae5 100644 --- a/controller/Cargo.toml +++ b/controller/Cargo.toml @@ -26,6 +26,7 @@ fixed-macro = "1.2" # for web request example reqwless = { version = "0.12.0", features = ["defmt",]} serde = { version = "1.0.203", default-features = false, features = ["derive"] } +postcard = "1.0.0" serde-json-core = "0.5.1" # for assign resources example @@ -61,7 +62,8 @@ embedded-sdmmc = "0.7.0" hex = { version = "0.4.3", default-features=false } mpu6050 = { git = "https://git.ank.dev/ank/mpu6050" } vl53l0x = "1.0.1" -nalgebra = { version = "0.31.2", default-features=false } +nalgebra = { version = "0.31.2", default-features=false, features = ["serde-serialize-no-std"] } +common = { path = "../common" } [profile.release] diff --git a/controller/src/main.rs b/controller/src/main.rs index 135bb42..b02531a 100644 --- a/controller/src/main.rs +++ b/controller/src/main.rs @@ -34,12 +34,14 @@ use embassy_rp::gpio::{Level, Output}; use embassy_rp::peripherals::{DMA_CH0, PIO0, USB}; use embassy_rp::pio::{InterruptHandler, Pio}; use embassy_rp::usb::Driver; -use embassy_time::{Delay, Duration, Timer}; -use embedded_io_async::Write; +use embassy_time::{Delay, Duration, Instant, Timer}; +use embedded_io_async::{Read, Write}; use mpu6050::Mpu6050; +use nalgebra::clamp; use rand::RngCore; use reqwless::response; -use sensor_manager::{sensor_manager, SensorData, SensorHardware}; +use sensor_manager::{sensor_manager, SensorHardware}; +use common::{ControlPacket, SensorData, TelemetryPacket}; use static_cell::StaticCell; use defmt_rtt as _; @@ -51,7 +53,7 @@ bind_interrupts!(struct Irqs { }); static mut CORE1_STACK: Stack<4096> = Stack::new(); -pub static CHANNEL: Channel = Channel::new(); +pub static CHANNEL: Channel = Channel::new(); #[embassy_executor::task] async fn logger_task(driver: Driver<'static, USB>) { @@ -175,16 +177,17 @@ async fn main(spawner: Spawner) { let mut rx_buffer = [0; 4096]; let mut tx_buffer = [0; 4096]; let mut buf = [0; 4096]; + let mut telem_buf = [0; 4096]; loop { let mut socket = TcpSocket::new(stack, &mut rx_buffer, &mut tx_buffer); socket.set_timeout(Some(Duration::from_secs(3))); let mut c: pwm::Config = Default::default(); - c.divider = 255.into(); - c.top = 8715; - c.compare_b = 0; - c.compare_a = 0; + c.divider = 40.into(); + c.top = 62500; // 20ms + c.compare_b = 4687; // 1.5ms + c.compare_a = 4687; // 1.5ms drive_pwm.set_config(&c); flipper.set_low(); @@ -200,59 +203,41 @@ async fn main(spawner: Spawner) { control.gpio_set(0, true).await; loop { - let mut n = match socket.read(&mut buf).await { - Ok(0) => { - warn!("read EOF"); - break; - } - Ok(n) => n, - Err(e) => { - warn!("read error: {:?}", e); - break; - } - }; + let mut len: [u8; 4] = [0;4]; + if let Err(e) = socket.read_exact(&mut len).await { + warn!("read err: {e:?}"); + } + let len = u32::from_be_bytes(len) as usize; + let data = &mut buf[0..len]; + if let Err(e) = socket.read_exact(data).await { + warn!("read err: {e:?}"); + break; + } - - info!("rxd {}", from_utf8(&buf[..n]).unwrap()); - Timer::after_millis(30).await; - - let mut segs = buf[..n].trim_ascii().split(|c| *c == ' ' as u8); - - match char::from_u32(segs.next().unwrap()[0] as u32).unwrap() { - 'D' => { - let left: [u8;2] = hex::FromHex::from_hex(segs.next().unwrap()).unwrap(); - let right: [u8;2] = hex::FromHex::from_hex(segs.next().unwrap()).unwrap(); - info!("left {:?}, right {left:?}", right); - - let left = u16::from_be_bytes(left); - c.compare_a = left; - let right = u16::from_be_bytes(right); - c.compare_b = right; - info!("left {:?}, right {left:?}", right); - drive_pwm.set_config(&c); - }, - 'F' => { - flipper.set_high(); - }, - 'L' => { - flipper.set_low(); - }, - _ => {} - + if let Ok(data) = postcard::from_bytes::(&data) { + info!("got {data:?}"); + match data { + ControlPacket::Twist(forward, right) => { + info!("left to {}", clamp(forward+right, -1., 1.)); + info!("right to {}", clamp(forward-right, -1., 1.)); + }, + d => {error!("unimplemented: {d:?}")} // TODO + } } - //let mut response: [u8;2] = [0;2]; + if let Ok((data, _ts)) = CHANNEL.try_receive() { + let telem = TelemetryPacket { + sensors: data, + voltage: 0.0, // TODO + }; - //let _ = bus.read_async(0xC0u16, &mut response).await; - //let _ = hex::encode_to_slice(response, &mut buf); - - match socket.write_all(&buf[..n]).await { - Ok(()) => {} - Err(e) => { - warn!("write error: {:?}", e); - break; + if let Ok(telem) = postcard::to_slice(&telem, &mut telem_buf) { + if let Err(e) = socket.write_all(&telem).await { + warn!("write error: {:?}", e); + break; + } } - }; + } } } } diff --git a/controller/src/sensor_manager.rs b/controller/src/sensor_manager.rs index 2909ede..4da621b 100644 --- a/controller/src/sensor_manager.rs +++ b/controller/src/sensor_manager.rs @@ -2,6 +2,7 @@ use core::sync::atomic::{AtomicU8, Ordering}; use core::task::Poll; use core::{cell::RefCell, mem::transmute}; +use common::SensorData; use embassy_executor::Executor; use embassy_rp::peripherals::{I2C0, I2C1}; use embassy_time::{Delay, Duration, Instant, Timer}; @@ -37,19 +38,6 @@ enum PollState { Gyro, } -#[derive(Clone, Debug)] -pub struct SensorData { - /// distance, mm - tof1: Option, - /// distance, mm - tof2: Option, - /// acceleration, rad/s - gyro: Option>, - /// acceleration, g - accel: Option>, - updated: Instant, -} - #[embassy_executor::task] async fn init_sensors(mut hardware: SensorHardware) { let bus = RefCell::new(hardware.bus_tof); @@ -72,8 +60,8 @@ async fn init_sensors(mut hardware: SensorHardware) { tof2: None, gyro: None, accel: None, - updated: Instant::now(), }; + let mut updated_ts = Instant::now(); loop { let mut updated = false; @@ -102,10 +90,10 @@ async fn init_sensors(mut hardware: SensorHardware) { updated = true; } if updated { - data.updated = Instant::now(); + updated_ts = Instant::now(); } POLL_STATE.store(PollState::None as u8, Ordering::SeqCst); - CHANNEL.send(data.clone()).await; + CHANNEL.send((data.clone(), updated_ts.clone())).await; } } From 63bb5b8feaf9f62dc241e054190f144f4ed18a24 Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Sat, 18 Jan 2025 14:28:39 -0500 Subject: [PATCH 11/69] tuning for recorder --- interface/src/main.rs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/interface/src/main.rs b/interface/src/main.rs index 1de1628..35d0a9e 100644 --- a/interface/src/main.rs +++ b/interface/src/main.rs @@ -20,7 +20,7 @@ fn main() -> Result<()> { let (sender, notes) = mpsc::channel(); const POWER_THRESHOLD: f32 = 5.0; - const CLARITY_THRESHOLD: f32 = 0.7; + const CLARITY_THRESHOLD: f32 = 0.85; const PACKET_LEN: usize = 2204; let stream = device.build_input_stream(&config.into(), @@ -42,8 +42,8 @@ fn main() -> Result<()> { for (note,vol) in notes { if let Some(note) = note { //dbg!(note.frequency); - dbg!(note.clarity); - dbg!(vol); + //dbg!(note.clarity); + //dbg!(vol); let note = Note::from_freq(note.frequency, Tuning::EqualTemperament); match note.pitch { Pitch { letter: NoteLetter::A, accidental: 0} => { @@ -61,8 +61,15 @@ fn main() -> Result<()> { Pitch { letter: NoteLetter::G, accidental: 0} => { println!("fire"); } + Pitch { letter: NoteLetter::E, accidental: 0} => { + println!("fire"); + } pitch => { - dbg!(pitch); + if vol > 3000. { + println!("fire"); + } else { + //dbg!(pitch); + } } } From bd7b3fb287443be264fdeba05cc24e3d9faff91c Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Sat, 18 Jan 2025 14:56:19 -0500 Subject: [PATCH 12/69] interface telem --- interface/Cargo.lock | 377 ++++++++++++++++++++++++++++++++++++++++++ interface/Cargo.toml | 4 + interface/src/main.rs | 52 +++++- 3 files changed, 424 insertions(+), 9 deletions(-) diff --git a/interface/Cargo.lock b/interface/Cargo.lock index 93d4493..4580add 100644 --- a/interface/Cargo.lock +++ b/interface/Cargo.lock @@ -2,6 +2,21 @@ # It is not intended for manual editing. version = 4 +[[package]] +name = "addr2line" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" + [[package]] name = "aho-corasick" version = "1.1.3" @@ -48,6 +63,24 @@ version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34ac096ce696dc2fcabef30516bb13c0a68a11d30131d3df6f04711467681b04" +[[package]] +name = "approx" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cab112f0a86d568ea0e627cc1d6be74a1e9cd55214684db5561995f6dad897c6" +dependencies = [ + "num-traits", +] + +[[package]] +name = "atomic-polyfill" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cf2bce30dfe09ef0bfaef228b9d414faaf7e563035494d7fe092dba54b300f4" +dependencies = [ + "critical-section", +] + [[package]] name = "atty" version = "0.2.14" @@ -65,6 +98,21 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" +[[package]] +name = "backtrace" +version = "0.3.74" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" +dependencies = [ + "addr2line", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", + "windows-targets 0.52.6", +] + [[package]] name = "bindgen" version = "0.70.1" @@ -101,6 +149,12 @@ version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + [[package]] name = "bytes" version = "1.9.0" @@ -165,6 +219,12 @@ dependencies = [ "vec_map", ] +[[package]] +name = "cobs" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67ba02a97a2bd10f4b59b25c7973101c79642302776489e030cd13cdab09ed15" + [[package]] name = "combine" version = "4.6.7" @@ -175,6 +235,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "common" +version = "0.1.0" +dependencies = [ + "nalgebra", + "postcard", + "serde", +] + [[package]] name = "core-foundation-sys" version = "0.8.7" @@ -224,6 +293,12 @@ dependencies = [ "windows", ] +[[package]] +name = "critical-section" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" + [[package]] name = "dasp_sample" version = "0.11.0" @@ -242,18 +317,47 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +[[package]] +name = "gimli" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" + [[package]] name = "glob" version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" +[[package]] +name = "hash32" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0c35f58762feb77d74ebe43bdbc3210f09be9fe6742234d573bacc26ed92b67" +dependencies = [ + "byteorder", +] + [[package]] name = "hashbrown" version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" +[[package]] +name = "heapless" +version = "0.7.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdc6457c0eb62c71aac4bc17216026d8410337c4126773b9c5daba343f17964f" +dependencies = [ + "atomic-polyfill", + "hash32", + "rustc_version", + "serde", + "spin", + "stable_deref_trait", +] + [[package]] name = "heck" version = "0.3.3" @@ -287,9 +391,13 @@ name = "interface" version = "0.1.0" dependencies = [ "anyhow", + "common", "cpal", "pitch-detection", + "postcard", "rust-music-theory", + "serde", + "tokio", ] [[package]] @@ -364,6 +472,16 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "lock_api" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] + [[package]] name = "log" version = "0.4.25" @@ -391,6 +509,41 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" +[[package]] +name = "miniz_oxide" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8402cab7aefae129c6977bb0ff1b8fd9a04eb5b51efc50a70bea51cda0c7924" +dependencies = [ + "adler2", +] + +[[package]] +name = "mio" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" +dependencies = [ + "libc", + "wasi", + "windows-sys 0.52.0", +] + +[[package]] +name = "nalgebra" +version = "0.31.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20bd243ab3dbb395b39ee730402d2e5405e448c75133ec49cc977762c4cba3d1" +dependencies = [ + "approx", + "num-complex", + "num-rational", + "num-traits", + "serde", + "simba", + "typenum", +] + [[package]] name = "ndk" version = "0.8.0" @@ -437,6 +590,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" dependencies = [ "num-traits", + "serde", ] [[package]] @@ -459,6 +613,16 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-rational" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" +dependencies = [ + "num-integer", + "num-traits", +] + [[package]] name = "num-traits" version = "0.2.19" @@ -489,6 +653,15 @@ dependencies = [ "syn 2.0.96", ] +[[package]] +name = "object" +version = "0.36.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" +dependencies = [ + "memchr", +] + [[package]] name = "oboe" version = "0.6.1" @@ -518,6 +691,41 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" +[[package]] +name = "parking_lot" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets 0.52.6", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "pin-project-lite" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" + [[package]] name = "pitch-detection" version = "0.3.0" @@ -533,6 +741,17 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" +[[package]] +name = "postcard" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "170a2601f67cc9dba8edd8c4870b15f71a6a2dc196daec8c83f72b59dff628a8" +dependencies = [ + "cobs", + "heapless", + "serde", +] + [[package]] name = "primal-check" version = "0.3.4" @@ -569,6 +788,15 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "redox_syscall" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" +dependencies = [ + "bitflags 2.8.0", +] + [[package]] name = "regex" version = "1.11.1" @@ -610,12 +838,27 @@ dependencies = [ "strum_macros", ] +[[package]] +name = "rustc-demangle" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" + [[package]] name = "rustc-hash" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + [[package]] name = "rustfft" version = "6.2.0" @@ -646,12 +889,96 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "semver" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3cb6eb87a131f756572d7fb904f6e7b68633f09cca868c5df1c4b8d1a694bbba" + +[[package]] +name = "serde" +version = "1.0.217" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.217" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", +] + [[package]] name = "shlex" version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" +[[package]] +name = "signal-hook-registry" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" +dependencies = [ + "libc", +] + +[[package]] +name = "simba" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f3fd720c48c53cace224ae62bef1bbff363a70c68c4802a78b5cc6159618176" +dependencies = [ + "approx", + "num-complex", + "num-traits", + "paste", +] + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "socket2" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +dependencies = [ + "lock_api", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + [[package]] name = "strength_reduce" version = "0.2.4" @@ -733,6 +1060,35 @@ dependencies = [ "syn 2.0.96", ] +[[package]] +name = "tokio" +version = "1.43.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d61fa4ffa3de412bfea335c6ecff681de2b609ba3c77ef3e00e521813a9ed9e" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys 0.52.0", +] + +[[package]] +name = "tokio-macros" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", +] + [[package]] name = "toml_datetime" version = "0.6.8" @@ -760,6 +1116,12 @@ dependencies = [ "strength_reduce", ] +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + [[package]] name = "unicode-ident" version = "1.0.14" @@ -800,6 +1162,12 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + [[package]] name = "wasm-bindgen" version = "0.2.100" @@ -950,6 +1318,15 @@ dependencies = [ "windows-targets 0.42.2", ] +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", +] + [[package]] name = "windows-sys" version = "0.59.0" diff --git a/interface/Cargo.toml b/interface/Cargo.toml index 53b389b..ad5f72e 100644 --- a/interface/Cargo.toml +++ b/interface/Cargo.toml @@ -7,4 +7,8 @@ edition = "2021" anyhow = "1.0.95" cpal = "0.15.3" pitch-detection = "0.3" +postcard = "1.1.1" rust-music-theory = {git = "https://github.com/the-drunk-coder/rust-music-theory", rev = "a062d65"} +serde = "1.0.217" +tokio = { version = "1.43.0", features = ["full"] } +common = {path = "../common"} diff --git a/interface/src/main.rs b/interface/src/main.rs index 35d0a9e..0886e66 100644 --- a/interface/src/main.rs +++ b/interface/src/main.rs @@ -1,10 +1,12 @@ #![feature(iter_collect_into)] -use std::{sync::mpsc, thread::sleep, time::Duration}; +use std::{thread::sleep, time::Duration}; use anyhow::{Context, Ok, Result}; +use common::TelemetryPacket; use cpal::traits::{DeviceTrait, HostTrait, StreamTrait}; use pitch_detection::{detector::{mcleod::McLeodDetector, PitchDetector}, utils}; use rust_music_theory::note::{Note, NoteLetter, Pitch, Tuning}; +use tokio::{io::{AsyncReadExt, WriteHalf}, net::{tcp::{OwnedReadHalf, OwnedWriteHalf}, TcpStream}, sync::mpsc}; fn main() -> Result<()> { // assumes pulseaudio system with f32 samples and 2204 sample packets @@ -17,7 +19,7 @@ fn main() -> Result<()> { dbg!(config.sample_format()); let rate = config.sample_rate(); - let (sender, notes) = mpsc::channel(); + let (sender, notes) = mpsc::channel(2); const POWER_THRESHOLD: f32 = 5.0; const CLARITY_THRESHOLD: f32 = 0.85; @@ -31,7 +33,7 @@ fn main() -> Result<()> { // reinitialized every packet as it is not thread safe let mut detctor = McLeodDetector::new(PACKET_LEN, PACKET_LEN/2); let vol = utils::buffer::square_sum(data); - sender.send((detctor.get_pitch(data, rate.0 as usize, POWER_THRESHOLD, CLARITY_THRESHOLD),vol)).unwrap(); + sender.blocking_send((detctor.get_pitch(data, rate.0 as usize, POWER_THRESHOLD, CLARITY_THRESHOLD),vol)).unwrap(); }, move |err| {eprintln!("{err}")} , @@ -39,7 +41,43 @@ fn main() -> Result<()> { stream.play()?; - for (note,vol) in notes { + let executor = tokio::runtime::Runtime::new()?; + + + let control = executor.block_on(async { + let cruisecontrol = TcpStream::connect("169.254.1.1:1234").await?; + cruisecontrol.set_nodelay(true)?; + let (telem, control) = cruisecontrol.into_split(); + + tokio::spawn(telemetry_handler(telem)); + + Ok(control) + })?; + + + executor.block_on(controller(notes, control)).unwrap(); + + drop(stream); + + Ok(()) +} + +async fn telemetry_handler(mut telem: OwnedReadHalf) -> Result<()> { + let mut buf = vec![0; 2048]; + loop { + let len = telem.read_u32().await.context("bad length")? as usize; + let data = &mut buf[0..len]; + telem.read_exact(data).await?; + let telem: TelemetryPacket = postcard::from_bytes(&data)?; + + println!("telem: {telem:?}"); + + } +} + +async fn controller(mut notes: mpsc::Receiver<(Option>, f32)>, control: OwnedWriteHalf) -> Result<()> { + loop { + let (note,vol) = notes.recv().await.context("channel closed")?; if let Some(note) = note { //dbg!(note.frequency); //dbg!(note.clarity); @@ -71,12 +109,8 @@ fn main() -> Result<()> { //dbg!(pitch); } } - + } } } - - drop(stream); - - Ok(()) } From f7ab1c119a04a0265237d9ddabdd3343c5d9e3c9 Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Sat, 18 Jan 2025 15:04:34 -0500 Subject: [PATCH 13/69] front panel write data --- interface/Cargo.lock | 1 + interface/Cargo.toml | 1 + interface/src/main.rs | 25 ++++++++++++++++++++----- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/interface/Cargo.lock b/interface/Cargo.lock index 4580add..e803c90 100644 --- a/interface/Cargo.lock +++ b/interface/Cargo.lock @@ -393,6 +393,7 @@ dependencies = [ "anyhow", "common", "cpal", + "heapless", "pitch-detection", "postcard", "rust-music-theory", diff --git a/interface/Cargo.toml b/interface/Cargo.toml index ad5f72e..ea88d89 100644 --- a/interface/Cargo.toml +++ b/interface/Cargo.toml @@ -12,3 +12,4 @@ rust-music-theory = {git = "https://github.com/the-drunk-coder/rust-music-theory serde = "1.0.217" tokio = { version = "1.43.0", features = ["full"] } common = {path = "../common"} +heapless = "0.7.0" diff --git a/interface/src/main.rs b/interface/src/main.rs index 0886e66..05ec97f 100644 --- a/interface/src/main.rs +++ b/interface/src/main.rs @@ -2,11 +2,11 @@ use std::{thread::sleep, time::Duration}; use anyhow::{Context, Ok, Result}; -use common::TelemetryPacket; +use common::{ControlPacket, TelemetryPacket}; use cpal::traits::{DeviceTrait, HostTrait, StreamTrait}; use pitch_detection::{detector::{mcleod::McLeodDetector, PitchDetector}, utils}; use rust_music_theory::note::{Note, NoteLetter, Pitch, Tuning}; -use tokio::{io::{AsyncReadExt, WriteHalf}, net::{tcp::{OwnedReadHalf, OwnedWriteHalf}, TcpStream}, sync::mpsc}; +use tokio::{io::{AsyncReadExt, AsyncWriteExt, BufWriter, WriteHalf}, net::{tcp::{OwnedReadHalf, OwnedWriteHalf}, TcpStream}, sync::mpsc}; fn main() -> Result<()> { // assumes pulseaudio system with f32 samples and 2204 sample packets @@ -75,8 +75,11 @@ async fn telemetry_handler(mut telem: OwnedReadHalf) -> Result<()> { } } -async fn controller(mut notes: mpsc::Receiver<(Option>, f32)>, control: OwnedWriteHalf) -> Result<()> { +async fn controller(mut notes: mpsc::Receiver<(Option>, f32)>, controller: OwnedWriteHalf) -> Result<()> { + let mut controller = BufWriter::new(controller); loop { + let mut control = ControlPacket::Stop; + let (note,vol) = notes.recv().await.context("channel closed")?; if let Some(note) = note { //dbg!(note.frequency); @@ -86,31 +89,43 @@ async fn controller(mut notes: mpsc::Receiver<(Option { println!("forward"); + control = ControlPacket::Twist(1.0, 0.0); } Pitch { letter: NoteLetter::A, accidental: 1} => { println!("backward"); + control = ControlPacket::Twist(-1.0, 0.0); } Pitch { letter: NoteLetter::C, accidental: 0} => { println!("right"); + control = ControlPacket::Twist(0.0, 1.0); } Pitch { letter: NoteLetter::C, accidental: 1} => { println!("left"); + control = ControlPacket::Twist(0.0, -1.0); } Pitch { letter: NoteLetter::G, accidental: 0} => { println!("fire"); + control = ControlPacket::Fire; } Pitch { letter: NoteLetter::E, accidental: 0} => { println!("fire"); + control = ControlPacket::Fire; } - pitch => { + _pitch => { if vol > 3000. { println!("fire"); + control = ControlPacket::FireOverride(1.0); } else { //dbg!(pitch); } } - } + + + let control: heapless::Vec = postcard::to_vec(&control)?; + controller.write_u32(control.len() as u32).await?; + controller.write_all(&control).await?; + controller.flush().await?; } } } From 2af0807abd832632d04c35ec672918f753e96659 Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Sat, 18 Jan 2025 22:36:57 -0500 Subject: [PATCH 14/69] cam manager, hopefully somewhat realtime --- controller/src/main.rs | 126 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 114 insertions(+), 12 deletions(-) diff --git a/controller/src/main.rs b/controller/src/main.rs index b02531a..f0d5df1 100644 --- a/controller/src/main.rs +++ b/controller/src/main.rs @@ -19,7 +19,8 @@ use cyw43_pio::{PioSpi, DEFAULT_CLOCK_DIVIDER}; use embassy_rp::i2c::{Async, I2c}; use embassy_rp::multicore::{spawn_core1, Stack}; use embassy_rp::pwm::{self, Pwm}; -use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex; +use embassy_sync::blocking_mutex::raw::{CriticalSectionRawMutex, ThreadModeRawMutex}; +use embassy_sync::blocking_mutex::{Mutex, ThreadModeMutex}; use embassy_sync::channel::Channel; use embedded_hal_bus::i2c::RefCellDevice; use fixed::FixedU16; @@ -30,7 +31,7 @@ use embassy_net::tcp::TcpSocket; use embassy_net::{Config, StackResources}; use embassy_rp::bind_interrupts; use embassy_rp::clocks::RoscRng; -use embassy_rp::gpio::{Level, Output}; +use embassy_rp::gpio::{Input, Level, Output, Pull}; use embassy_rp::peripherals::{DMA_CH0, PIO0, USB}; use embassy_rp::pio::{InterruptHandler, Pio}; use embassy_rp::usb::Driver; @@ -86,16 +87,21 @@ async fn main(spawner: Spawner) { let driver = Driver::new(p.USB, Irqs); spawner.spawn(logger_task(driver)).unwrap(); - let mut flipper = Output::new(p.PIN_22, Level::Low); + let mut limit_switch = Input::new(p.PIN_22, Pull::Up); + + let mut d: pwm::Config = Default::default(); + d.divider = 40.into(); + d.top = 62500; // 20ms + d.compare_b = 4687; // 1.5ms + d.compare_a = 4687; // 1.5ms + let mut drive_pwm = Pwm::new_output_ab(p.PWM_SLICE1, p.PIN_18, p.PIN_19, d.clone()); + + let mut f: pwm::Config = Default::default(); + f.divider = 40.into(); + f.top = 62500; // 20ms + f.compare_b = 4687; // 1.5ms + let flip_pwm = Pwm::new_output_b(p.PWM_SLICE0, p.PIN_17, f.clone()); - let mut c: pwm::Config = Default::default(); - c.divider = 40.into(); - c.top = 62500; // 20ms - c.compare_b = 4687; // 1.5ms - c.compare_a = 4687; // 1.5ms - let mut drive_pwm = Pwm::new_output_ab(p.PWM_SLICE1, p.PIN_18, p.PIN_19, c.clone()); - flipper.set_high(); - let sda = p.PIN_20; let scl = p.PIN_21; let config = embassy_rp::i2c::Config::default(); @@ -179,6 +185,12 @@ async fn main(spawner: Spawner) { let mut buf = [0; 4096]; let mut telem_buf = [0; 4096]; + let cam_state: RefCell = RefCell::new(CamState::Idle); + + let cam_state_forever = unsafe { transmute(&cam_state) }; // SAFETY: if main exits we shall + // shortly die. + spawner.spawn(cam_manager(flip_pwm, limit_switch, cam_state_forever)).unwrap(); + loop { let mut socket = TcpSocket::new(stack, &mut rx_buffer, &mut tx_buffer); socket.set_timeout(Some(Duration::from_secs(3))); @@ -190,7 +202,7 @@ async fn main(spawner: Spawner) { c.compare_a = 4687; // 1.5ms drive_pwm.set_config(&c); - flipper.set_low(); + cam_state.replace(CamState::Idle); control.gpio_set(0, false).await; info!("Listening on TCP:1234..."); @@ -220,7 +232,31 @@ async fn main(spawner: Spawner) { ControlPacket::Twist(forward, right) => { info!("left to {}", clamp(forward+right, -1., 1.)); info!("right to {}", clamp(forward-right, -1., 1.)); + + c.compare_a = calc_speed(right + forward); + c.compare_b = calc_speed(right - forward); + drive_pwm.set_config(&c); }, + ControlPacket::Fire => { + cam_state.replace(CamState::Fire); + }, + ControlPacket::Stop => { + c.compare_a = calc_speed(0.); + c.compare_b = calc_speed(0.); + drive_pwm.set_config(&c); + + cam_state.replace(CamState::Idle); + }, + ControlPacket::FireOverride(speed) => { + cam_state.replace(CamState::Override(speed)); + }, + ControlPacket::Arm(enable) => { + if enable { + cam_state.replace(CamState::Charging(None)); + } else { + cam_state.replace(CamState::Idle); + } + } d => {error!("unimplemented: {d:?}")} // TODO } } @@ -241,3 +277,69 @@ async fn main(spawner: Spawner) { } } } + +/// -1 to 1 +fn calc_speed(speed: f32) -> u16 { + const COUNTS_PER_MS: f32 = 3125.; + let speed = speed.clamp(-1., 1.); + + let ms = (speed/2.0)+1.5; + + (COUNTS_PER_MS * ms) as u16 +} + +enum CamState { + Override(f32), + Charging(Option), + Charged, + Fire, + Idle, +} + +#[embassy_executor::task] +async fn cam_manager(mut cam: Pwm<'static>, limit: Input<'static>, cam_state: &'static RefCell) { + loop { + let mut cam_state = cam_state.borrow_mut(); + handle_cam(&mut cam, &mut (*cam_state), &limit); + drop(cam_state); + + Timer::after_micros(500).await; + } +} + +fn handle_cam(cam: &mut Pwm, state: &mut CamState, limit: &Input) { + let speed = match state { + CamState::Override(speed) => { + *speed + }, + CamState::Charging(mut charged) => { + if limit.is_low() { + let became_low = charged.get_or_insert_with(Instant::now); + if became_low.elapsed().as_micros() > 1800 { + *state = CamState::Charged; + 0.0 + } else { + 1.0 + } + } else { + charged = None; + 1.0 + } + }, + CamState::Fire => { + if limit.is_high() { + *state = CamState::Charging(None); + } + 1.0 + }, + CamState::Charged | CamState::Idle => 0.0, + }; + + + + let mut f: pwm::Config = Default::default(); + f.divider = 40.into(); + f.top = 62500; // 20ms + f.compare_b = calc_speed(speed); // 1.5ms + cam.set_config(&f); +} From 978a3fe2137688a42d5e7d52e5c0690c8dfd32af Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Sat, 18 Jan 2025 22:45:23 -0500 Subject: [PATCH 15/69] stop robot on music end --- interface/src/main.rs | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/interface/src/main.rs b/interface/src/main.rs index 05ec97f..cc73fc2 100644 --- a/interface/src/main.rs +++ b/interface/src/main.rs @@ -1,12 +1,12 @@ #![feature(iter_collect_into)] -use std::{thread::sleep, time::Duration}; +use std::{result, thread::sleep, time::Duration}; use anyhow::{Context, Ok, Result}; use common::{ControlPacket, TelemetryPacket}; use cpal::traits::{DeviceTrait, HostTrait, StreamTrait}; use pitch_detection::{detector::{mcleod::McLeodDetector, PitchDetector}, utils}; use rust_music_theory::note::{Note, NoteLetter, Pitch, Tuning}; -use tokio::{io::{AsyncReadExt, AsyncWriteExt, BufWriter, WriteHalf}, net::{tcp::{OwnedReadHalf, OwnedWriteHalf}, TcpStream}, sync::mpsc}; +use tokio::{io::{AsyncReadExt, AsyncWriteExt, BufWriter, WriteHalf}, net::{tcp::{OwnedReadHalf, OwnedWriteHalf}, TcpStream}, sync::mpsc, time::timeout}; fn main() -> Result<()> { // assumes pulseaudio system with f32 samples and 2204 sample packets @@ -77,10 +77,17 @@ async fn telemetry_handler(mut telem: OwnedReadHalf) -> Result<()> { async fn controller(mut notes: mpsc::Receiver<(Option>, f32)>, controller: OwnedWriteHalf) -> Result<()> { let mut controller = BufWriter::new(controller); + send_packet(&mut controller, ControlPacket::Arm(true)).await?; + println!("armed flipper"); loop { let mut control = ControlPacket::Stop; - let (note,vol) = notes.recv().await.context("channel closed")?; + let result::Result::Ok(note) = timeout(Duration::from_millis(95), notes.recv()).await else { + send_packet(&mut controller, ControlPacket::Stop).await?; + continue; + }; + + let (note,vol) = note.context("channel closed")?; if let Some(note) = note { //dbg!(note.frequency); //dbg!(note.clarity); @@ -122,10 +129,15 @@ async fn controller(mut notes: mpsc::Receiver<(Option = postcard::to_vec(&control)?; - controller.write_u32(control.len() as u32).await?; - controller.write_all(&control).await?; - controller.flush().await?; + send_packet(&mut controller, control).await?; } } } + +async fn send_packet(controller: &mut BufWriter, control: ControlPacket) -> Result<(), anyhow::Error> { + let control: heapless::Vec = postcard::to_vec(&control)?; + controller.write_u32(control.len() as u32).await?; + controller.write_all(&control).await?; + controller.flush().await?; + Ok(()) +} From 3ea2af5c6091229ba7145b7bb8f1d1bd25b51995 Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Sat, 18 Jan 2025 23:48:32 -0500 Subject: [PATCH 16/69] stop when no note is played --- interface/src/main.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/interface/src/main.rs b/interface/src/main.rs index cc73fc2..9fc51d2 100644 --- a/interface/src/main.rs +++ b/interface/src/main.rs @@ -83,6 +83,7 @@ async fn controller(mut notes: mpsc::Receiver<(Option Date: Sat, 18 Jan 2025 23:48:47 -0500 Subject: [PATCH 17/69] switch to laptop ap handles robot restarts better --- controller/src/main.rs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/controller/src/main.rs b/controller/src/main.rs index f0d5df1..77df1fd 100644 --- a/controller/src/main.rs +++ b/controller/src/main.rs @@ -15,6 +15,7 @@ use core::mem::transmute; use core::panic::PanicInfo; use core::str::from_utf8; +use cyw43::JoinOptions; use cyw43_pio::{PioSpi, DEFAULT_CLOCK_DIVIDER}; use embassy_rp::i2c::{Async, I2c}; use embassy_rp::multicore::{spawn_core1, Stack}; @@ -178,7 +179,19 @@ async fn main(spawner: Spawner) { defmt::unwrap!(spawner.spawn(net_task(runner))); // password is not terribly private information - control.start_ap_wpa2("cruisecontrol", "dxSk2avMFvsY", 5).await; + //control.start_ap_wpa2("cruisecontrol", "dxSk2avMFvsY", 5).await; + + loop { + match control + .join("cruisecontrol", JoinOptions::new("dxSk2avMFvsY".as_bytes())) + .await + { + Ok(_) => break, + Err(err) => { + info!("join failed with status={}", err.status); + } + } + } let mut rx_buffer = [0; 4096]; let mut tx_buffer = [0; 4096]; From f532dd6d70027c8e926e8c2bdf6cd49e2fe649f0 Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Sun, 19 Jan 2025 01:06:49 -0500 Subject: [PATCH 18/69] fix controller not returning to idle on network death --- controller/src/main.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/controller/src/main.rs b/controller/src/main.rs index 77df1fd..86f9c3f 100644 --- a/controller/src/main.rs +++ b/controller/src/main.rs @@ -231,6 +231,7 @@ async fn main(spawner: Spawner) { let mut len: [u8; 4] = [0;4]; if let Err(e) = socket.read_exact(&mut len).await { warn!("read err: {e:?}"); + break; } let len = u32::from_be_bytes(len) as usize; let data = &mut buf[0..len]; From 5a30e91800b201aade1aca847b4953d53a2c25f9 Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Sun, 19 Jan 2025 01:20:13 -0500 Subject: [PATCH 19/69] cam state in telemetry --- controller/src/main.rs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/controller/src/main.rs b/controller/src/main.rs index 86f9c3f..7ce17cc 100644 --- a/controller/src/main.rs +++ b/controller/src/main.rs @@ -30,7 +30,7 @@ use log::*; use embassy_executor::Spawner; use embassy_net::tcp::TcpSocket; use embassy_net::{Config, StackResources}; -use embassy_rp::bind_interrupts; +use embassy_rp::{bind_interrupts, watchdog}; use embassy_rp::clocks::RoscRng; use embassy_rp::gpio::{Input, Level, Output, Pull}; use embassy_rp::peripherals::{DMA_CH0, PIO0, USB}; @@ -278,7 +278,7 @@ async fn main(spawner: Spawner) { if let Ok((data, _ts)) = CHANNEL.try_receive() { let telem = TelemetryPacket { sensors: data, - voltage: 0.0, // TODO + cam_state: cam_state.borrow().to_telem(), }; if let Ok(telem) = postcard::to_slice(&telem, &mut telem_buf) { @@ -310,6 +310,17 @@ enum CamState { Idle, } +impl CamState { + fn to_telem(&self) -> common::CamState { + match self { + Self::Override(_) | Self::Fire => common::CamState::Firing, + Self::Charging(_) => common::CamState::Charging, + Self::Charged => common::CamState::Charged, + Self::Idle => common::CamState::Idle, + } + } +} + #[embassy_executor::task] async fn cam_manager(mut cam: Pwm<'static>, limit: Input<'static>, cam_state: &'static RefCell) { loop { From 5953f2c5843503881e26758ff5b5f0c2414905b8 Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Sun, 19 Jan 2025 01:20:46 -0500 Subject: [PATCH 20/69] shifted override fire --- interface/src/main.rs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/interface/src/main.rs b/interface/src/main.rs index 9fc51d2..61a704b 100644 --- a/interface/src/main.rs +++ b/interface/src/main.rs @@ -46,6 +46,7 @@ fn main() -> Result<()> { let control = executor.block_on(async { let cruisecontrol = TcpStream::connect("169.254.1.1:1234").await?; + println!("connected"); cruisecontrol.set_nodelay(true)?; let (telem, control) = cruisecontrol.into_split(); @@ -90,7 +91,7 @@ async fn controller(mut notes: mpsc::Receiver<(Option { - println!("fire"); - control = ControlPacket::Fire; + println!("e"); } - _pitch => { + Pitch { letter: NoteLetter::F, accidental: 1} => { + println!("fire"); + control = ControlPacket::FireOverride(1.0); + } + pitch => { if vol > 3000. { println!("fire"); control = ControlPacket::FireOverride(1.0); } else { - //dbg!(pitch); + dbg!(pitch); } } } From 9b1b289b924f6c7a8afc8c87f1538b239d3bba20 Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Sun, 19 Jan 2025 04:50:44 -0500 Subject: [PATCH 21/69] don't wait to stop charging, debouncing handled by user --- controller/src/main.rs | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/controller/src/main.rs b/controller/src/main.rs index 7ce17cc..830886c 100644 --- a/controller/src/main.rs +++ b/controller/src/main.rs @@ -88,7 +88,7 @@ async fn main(spawner: Spawner) { let driver = Driver::new(p.USB, Irqs); spawner.spawn(logger_task(driver)).unwrap(); - let mut limit_switch = Input::new(p.PIN_22, Pull::Up); + let limit_switch = Input::new(p.PIN_22, Pull::Up); let mut d: pwm::Config = Default::default(); d.divider = 40.into(); @@ -247,8 +247,8 @@ async fn main(spawner: Spawner) { info!("left to {}", clamp(forward+right, -1., 1.)); info!("right to {}", clamp(forward-right, -1., 1.)); - c.compare_a = calc_speed(right + forward); - c.compare_b = calc_speed(right - forward); + c.compare_a = calc_speed(forward - right); + c.compare_b = calc_speed(forward + right); drive_pwm.set_config(&c); }, ControlPacket::Fire => { @@ -266,7 +266,7 @@ async fn main(spawner: Spawner) { }, ControlPacket::Arm(enable) => { if enable { - cam_state.replace(CamState::Charging(None)); + cam_state.replace(CamState::Charging); } else { cam_state.replace(CamState::Idle); } @@ -302,9 +302,10 @@ fn calc_speed(speed: f32) -> u16 { (COUNTS_PER_MS * ms) as u16 } +#[derive(Debug)] enum CamState { Override(f32), - Charging(Option), + Charging, Charged, Fire, Idle, @@ -314,7 +315,7 @@ impl CamState { fn to_telem(&self) -> common::CamState { match self { Self::Override(_) | Self::Fire => common::CamState::Firing, - Self::Charging(_) => common::CamState::Charging, + Self::Charging => common::CamState::Charging, Self::Charged => common::CamState::Charged, Self::Idle => common::CamState::Idle, } @@ -337,23 +338,17 @@ fn handle_cam(cam: &mut Pwm, state: &mut CamState, limit: &Input) { CamState::Override(speed) => { *speed }, - CamState::Charging(mut charged) => { + CamState::Charging => { if limit.is_low() { - let became_low = charged.get_or_insert_with(Instant::now); - if became_low.elapsed().as_micros() > 1800 { - *state = CamState::Charged; - 0.0 - } else { - 1.0 - } + *state = CamState::Charged; + 0.0 } else { - charged = None; 1.0 } }, CamState::Fire => { if limit.is_high() { - *state = CamState::Charging(None); + *state = CamState::Charging; } 1.0 }, From bc3b71040309d79129348e392d84bb08325e7170 Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Sun, 19 Jan 2025 11:19:39 -0500 Subject: [PATCH 22/69] recorder control update --- interface/src/main.rs | 62 +++++++++++++++++++++++++++++++++---------- 1 file changed, 48 insertions(+), 14 deletions(-) diff --git a/interface/src/main.rs b/interface/src/main.rs index 61a704b..2cd69bc 100644 --- a/interface/src/main.rs +++ b/interface/src/main.rs @@ -1,12 +1,12 @@ #![feature(iter_collect_into)] -use std::{result, thread::sleep, time::Duration}; +use std::{result, sync::Arc, thread::sleep, time::Duration}; use anyhow::{Context, Ok, Result}; use common::{ControlPacket, TelemetryPacket}; use cpal::traits::{DeviceTrait, HostTrait, StreamTrait}; use pitch_detection::{detector::{mcleod::McLeodDetector, PitchDetector}, utils}; use rust_music_theory::note::{Note, NoteLetter, Pitch, Tuning}; -use tokio::{io::{AsyncReadExt, AsyncWriteExt, BufWriter, WriteHalf}, net::{tcp::{OwnedReadHalf, OwnedWriteHalf}, TcpStream}, sync::mpsc, time::timeout}; +use tokio::{io::{AsyncReadExt, AsyncWriteExt, BufWriter, WriteHalf}, net::{tcp::{OwnedReadHalf, OwnedWriteHalf}, TcpStream}, spawn, sync::{self, mpsc, RwLock}, time::timeout}; fn main() -> Result<()> { // assumes pulseaudio system with f32 samples and 2204 sample packets @@ -43,6 +43,7 @@ fn main() -> Result<()> { let executor = tokio::runtime::Runtime::new()?; + //let latest_telem = Arc::new(RwLock::new(None)); let control = executor.block_on(async { let cruisecontrol = TcpStream::connect("169.254.1.1:1234").await?; @@ -78,8 +79,14 @@ async fn telemetry_handler(mut telem: OwnedReadHalf) -> Result<()> { async fn controller(mut notes: mpsc::Receiver<(Option>, f32)>, controller: OwnedWriteHalf) -> Result<()> { let mut controller = BufWriter::new(controller); - send_packet(&mut controller, ControlPacket::Arm(true)).await?; - println!("armed flipper"); + //send_packet(&mut controller, ControlPacket::Arm(true)).await?; + //println!("armed flipper"); + + //let (auto_tx, mut auto_rx) = mpsc::channel(1); + //let mut auto = None; + + //auto = Some(spawn(seek)) + loop { let mut control = ControlPacket::Stop; @@ -92,6 +99,14 @@ async fn controller(mut notes: mpsc::Receiver<(Option 600. { + println!("too high"); + continue; + } //dbg!(note.clarity); //dbg!(vol); let note = Note::from_freq(note.frequency, Tuning::EqualTemperament); @@ -112,31 +127,38 @@ async fn controller(mut notes: mpsc::Receiver<(Option { + Pitch { letter: NoteLetter::G, accidental: 0|1} => { println!("fire"); control = ControlPacket::Fire; } - Pitch { letter: NoteLetter::E, accidental: 0} => { - println!("e"); - } Pitch { letter: NoteLetter::F, accidental: 1} => { - println!("fire"); - control = ControlPacket::FireOverride(1.0); + println!("stop flat"); + control = ControlPacket::Stop; + } + Pitch { letter: NoteLetter::F, accidental: 0} => { + println!("stop"); + control = ControlPacket::Stop; + } + Pitch { letter: NoteLetter::E, accidental: 0} => { + println!("stop"); + control = ControlPacket::Stop; + //if let result::Result::Ok(command) = auto_rx.try_recv() { + // control = command; + //} } pitch => { if vol > 3000. { - println!("fire"); - control = ControlPacket::FireOverride(1.0); + println!("rly loud"); + //control = ControlPacket::FireOverride(1.0); } else { dbg!(pitch); } } } - send_packet(&mut controller, control).await?; } else { - send_packet(&mut controller, ControlPacket::Stop).await?; + send_packet(&mut controller, ControlPacket::Twist(0.0, 0.0)).await?; } } } @@ -148,3 +170,15 @@ async fn send_packet(controller: &mut BufWriter, control: Contro controller.flush().await?; Ok(()) } + +//async fn seek(data: TelemetryPacket) -> Result<()>{ +// +// let left_tof = data.sensors.tof1.context("missing tof1")?; +// let right_tof = data.sensors.tof2.context("missing tof2")?; +// +// /// Distance (mm) where both tofs point at the same thing +// const CONVERGANCE_DISTANCE: u16 = 80; +// const DETECT_DISTANCE: u16 = 380; +// +// +//} From 70d4e551b41b95b61413f62110fb20d53d4d43d9 Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Sun, 19 Jan 2025 12:20:06 -0500 Subject: [PATCH 23/69] sax control --- interface/src/main.rs | 170 ++++++++++++++++++++++++++++-------------- 1 file changed, 115 insertions(+), 55 deletions(-) diff --git a/interface/src/main.rs b/interface/src/main.rs index 2cd69bc..1addf0e 100644 --- a/interface/src/main.rs +++ b/interface/src/main.rs @@ -1,5 +1,5 @@ #![feature(iter_collect_into)] -use std::{result, sync::Arc, thread::sleep, time::Duration}; +use std::{ops::ControlFlow, result, sync::Arc, thread::sleep, time::Duration}; use anyhow::{Context, Ok, Result}; use common::{ControlPacket, TelemetryPacket}; @@ -99,60 +99,9 @@ async fn controller(mut notes: mpsc::Receiver<(Option 600. { - println!("too high"); - continue; - } - //dbg!(note.clarity); - //dbg!(vol); - let note = Note::from_freq(note.frequency, Tuning::EqualTemperament); - match note.pitch { - Pitch { letter: NoteLetter::A, accidental: 0} => { - println!("forward"); - control = ControlPacket::Twist(1.0, 0.0); - } - Pitch { letter: NoteLetter::A, accidental: 1} => { - println!("backward"); - control = ControlPacket::Twist(-1.0, 0.0); - } - Pitch { letter: NoteLetter::C, accidental: 0} => { - println!("right"); - control = ControlPacket::Twist(0.0, 1.0); - } - Pitch { letter: NoteLetter::C, accidental: 1} => { - println!("left"); - control = ControlPacket::Twist(0.0, -1.0); - } - Pitch { letter: NoteLetter::G, accidental: 0|1} => { - println!("fire"); - control = ControlPacket::Fire; - } - Pitch { letter: NoteLetter::F, accidental: 1} => { - println!("stop flat"); - control = ControlPacket::Stop; - } - Pitch { letter: NoteLetter::F, accidental: 0} => { - println!("stop"); - control = ControlPacket::Stop; - } - Pitch { letter: NoteLetter::E, accidental: 0} => { - println!("stop"); - control = ControlPacket::Stop; - //if let result::Result::Ok(command) = auto_rx.try_recv() { - // control = command; - //} - } - pitch => { - if vol > 3000. { - println!("rly loud"); - //control = ControlPacket::FireOverride(1.0); - } else { - dbg!(pitch); - } + if let ControlFlow::Break(_) = sax_control(&mut control, vol, ¬e) { + if let ControlFlow::Break(_) = recorder_control(&mut control, vol, note) { + continue; } } @@ -163,6 +112,117 @@ async fn controller(mut notes: mpsc::Receiver<(Option) -> ControlFlow<()> { + if note.frequency < 150. { + println!("too low"); + return ControlFlow::Break(()); + } + if note.frequency > 270. { + println!("too high"); + return ControlFlow::Break(()); + } + let note = Note::from_freq(note.frequency, Tuning::EqualTemperament); + //dbg!(note.clarity); + //dbg!(vol); + match note.pitch { + Pitch { letter: NoteLetter::C, accidental: 1} => { + println!("forward"); + *control = ControlPacket::Twist(1.0, 0.0); + } + //Pitch { letter: NoteLetter::A, accidental: 1} => { + // println!("backward"); + // *control = ControlPacket::Twist(-1.0, 0.0); + //} + Pitch { letter: NoteLetter::B, accidental: 0} => { + println!("right"); + *control = ControlPacket::Twist(0.0, 1.0); + } + Pitch { letter: NoteLetter::A, accidental: 0} => { + println!("left"); + *control = ControlPacket::Twist(0.0, -1.0); + } + Pitch { letter: NoteLetter::G, accidental: 1} => { + println!("fire"); + *control = ControlPacket::Fire; + } + Pitch { letter: NoteLetter::F, accidental: 1} => { + println!("stop flat"); + *control = ControlPacket::Stop; + } + pitch => { + if vol > 3000. { + println!("rly loud"); + //control = ControlPacket::FireOverride(1.0); + dbg!(pitch); + } else { + dbg!(pitch); + } + } + } + ControlFlow::Continue(()) +} + + +fn recorder_control(control: &mut ControlPacket, vol: f32, note: pitch_detection::Pitch) -> ControlFlow<()> { + if note.frequency < 300. { + println!("too low"); + return ControlFlow::Break(()); + } + if note.frequency > 600. { + println!("too high"); + return ControlFlow::Break(()); + } + let note = Note::from_freq(note.frequency, Tuning::EqualTemperament); + //dbg!(note.clarity); + //dbg!(vol); + match note.pitch { + Pitch { letter: NoteLetter::A, accidental: 0} => { + println!("forward"); + *control = ControlPacket::Twist(1.0, 0.0); + } + Pitch { letter: NoteLetter::A, accidental: 1} => { + println!("backward"); + *control = ControlPacket::Twist(-1.0, 0.0); + } + Pitch { letter: NoteLetter::C, accidental: 0} => { + println!("right"); + *control = ControlPacket::Twist(0.0, 1.0); + } + Pitch { letter: NoteLetter::C, accidental: 1} => { + println!("left"); + *control = ControlPacket::Twist(0.0, -1.0); + } + Pitch { letter: NoteLetter::G, accidental: 0|1} => { + println!("fire"); + *control = ControlPacket::Fire; + } + Pitch { letter: NoteLetter::F, accidental: 1} => { + println!("stop flat"); + *control = ControlPacket::Stop; + } + Pitch { letter: NoteLetter::F, accidental: 0} => { + println!("stop"); + *control = ControlPacket::Stop; + } + Pitch { letter: NoteLetter::E, accidental: 0} => { + println!("stop"); + *control = ControlPacket::Stop; + //if let result::Result::Ok(command) = auto_rx.try_recv() { + // control = command; + //} + } + pitch => { + if vol > 3000. { + println!("rly loud"); + //control = ControlPacket::FireOverride(1.0); + } else { + dbg!(pitch); + } + } + } + ControlFlow::Continue(()) +} + async fn send_packet(controller: &mut BufWriter, control: ControlPacket) -> Result<(), anyhow::Error> { let control: heapless::Vec = postcard::to_vec(&control)?; controller.write_u32(control.len() as u32).await?; From 57522c26ccf6f70c7c7aaf5fb0433d156bfa49df Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Sun, 19 Jan 2025 17:17:29 -0500 Subject: [PATCH 24/69] added weapon enable flag --- controller/src/main.rs | 2 +- interface/src/main.rs | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/controller/src/main.rs b/controller/src/main.rs index 830886c..b01839d 100644 --- a/controller/src/main.rs +++ b/controller/src/main.rs @@ -360,6 +360,6 @@ fn handle_cam(cam: &mut Pwm, state: &mut CamState, limit: &Input) { let mut f: pwm::Config = Default::default(); f.divider = 40.into(); f.top = 62500; // 20ms - f.compare_b = calc_speed(speed); // 1.5ms + f.compare_b = calc_speed(-speed); // 1.5ms cam.set_config(&f); } diff --git a/interface/src/main.rs b/interface/src/main.rs index 1addf0e..4b324d6 100644 --- a/interface/src/main.rs +++ b/interface/src/main.rs @@ -112,6 +112,9 @@ async fn controller(mut notes: mpsc::Receiver<(Option) -> ControlFlow<()> { if note.frequency < 150. { println!("too low"); @@ -142,8 +145,10 @@ fn sax_control(control: &mut ControlPacket, vol: f32, note: &pitch_detection::Pi *control = ControlPacket::Twist(0.0, -1.0); } Pitch { letter: NoteLetter::G, accidental: 1} => { - println!("fire"); - *control = ControlPacket::Fire; + if ARMED { + println!("fire"); + *control = ControlPacket::Fire; + } } Pitch { letter: NoteLetter::F, accidental: 1} => { println!("stop flat"); @@ -193,8 +198,10 @@ fn recorder_control(control: &mut ControlPacket, vol: f32, note: pitch_detection *control = ControlPacket::Twist(0.0, -1.0); } Pitch { letter: NoteLetter::G, accidental: 0|1} => { - println!("fire"); - *control = ControlPacket::Fire; + if ARMED { + println!("fire"); + *control = ControlPacket::Fire; + } } Pitch { letter: NoteLetter::F, accidental: 1} => { println!("stop flat"); From 782fd891a15cf1d2f8822663c0a9e19c243e0320 Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Wed, 5 Mar 2025 12:36:24 -0500 Subject: [PATCH 25/69] triple tof init --- common/Cargo.lock | 266 +++++++++++++++++++++++++++++++ common/Cargo.toml | 9 ++ common/src/lib.rs | 52 ++++++ controller/src/main.rs | 13 +- controller/src/sensor_manager.rs | 82 ++++++---- 5 files changed, 385 insertions(+), 37 deletions(-) create mode 100644 common/Cargo.lock create mode 100644 common/Cargo.toml create mode 100644 common/src/lib.rs diff --git a/common/Cargo.lock b/common/Cargo.lock new file mode 100644 index 0000000..a8538e1 --- /dev/null +++ b/common/Cargo.lock @@ -0,0 +1,266 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "approx" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cab112f0a86d568ea0e627cc1d6be74a1e9cd55214684db5561995f6dad897c6" +dependencies = [ + "num-traits", +] + +[[package]] +name = "atomic-polyfill" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cf2bce30dfe09ef0bfaef228b9d414faaf7e563035494d7fe092dba54b300f4" +dependencies = [ + "critical-section", +] + +[[package]] +name = "autocfg" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "cobs" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67ba02a97a2bd10f4b59b25c7973101c79642302776489e030cd13cdab09ed15" + +[[package]] +name = "common" +version = "0.1.0" +dependencies = [ + "nalgebra", + "postcard", + "serde", +] + +[[package]] +name = "critical-section" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" + +[[package]] +name = "hash32" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0c35f58762feb77d74ebe43bdbc3210f09be9fe6742234d573bacc26ed92b67" +dependencies = [ + "byteorder", +] + +[[package]] +name = "heapless" +version = "0.7.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdc6457c0eb62c71aac4bc17216026d8410337c4126773b9c5daba343f17964f" +dependencies = [ + "atomic-polyfill", + "hash32", + "rustc_version", + "serde", + "spin", + "stable_deref_trait", +] + +[[package]] +name = "lock_api" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "nalgebra" +version = "0.31.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20bd243ab3dbb395b39ee730402d2e5405e448c75133ec49cc977762c4cba3d1" +dependencies = [ + "approx", + "num-complex", + "num-rational", + "num-traits", + "serde", + "simba", + "typenum", +] + +[[package]] +name = "num-complex" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" +dependencies = [ + "num-traits", + "serde", +] + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "postcard" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "170a2601f67cc9dba8edd8c4870b15f71a6a2dc196daec8c83f72b59dff628a8" +dependencies = [ + "cobs", + "heapless", + "serde", +] + +[[package]] +name = "proc-macro2" +version = "1.0.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "semver" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3cb6eb87a131f756572d7fb904f6e7b68633f09cca868c5df1c4b8d1a694bbba" + +[[package]] +name = "serde" +version = "1.0.217" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.217" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "simba" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f3fd720c48c53cace224ae62bef1bbff363a70c68c4802a78b5cc6159618176" +dependencies = [ + "approx", + "num-complex", + "num-traits", + "paste", +] + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +dependencies = [ + "lock_api", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "syn" +version = "2.0.96" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "unicode-ident" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" diff --git a/common/Cargo.toml b/common/Cargo.toml new file mode 100644 index 0000000..9a5ff0a --- /dev/null +++ b/common/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "common" +version = "0.1.0" +edition = "2021" + +[dependencies] +serde = { version = "1.0.*", default-features = false } +postcard = "1.0.0" +nalgebra = { version = "0.31.2", default-features=false, features = ["serde-serialize-no-std"]} diff --git a/common/src/lib.rs b/common/src/lib.rs new file mode 100644 index 0000000..26bbe61 --- /dev/null +++ b/common/src/lib.rs @@ -0,0 +1,52 @@ +#![no_std] + +use nalgebra::Vector3; +use serde::{Deserialize, Serialize}; + +/// -1..1 +pub type Speed = f32; + +#[derive(Serialize, Deserialize, Debug)] +pub enum ControlPacket { + /// Forward, Clockwise + Twist(Speed, Speed), + /// Launch the flipper once + Fire, + /// Run the flipper motor manually + FireOverride(Speed), + /// Enable/Disable flipper staging + Arm(bool), + RunAuto, + /// Stop all motors + Stop, + /// Permanently stop all motors + EStop, +} + +#[derive(Clone, Debug, Serialize, Deserialize)] +pub struct SensorData { + /// left distance, mm + pub tof_l: Option, + /// right distance, mm + pub tof_r: Option, + /// left side distance, mm + pub tof_s: Option, + /// acceleration, rad/s + pub gyro: Option>, + /// acceleration, g + pub accel: Option>, +} + +#[derive(Serialize, Deserialize, Debug)] +pub struct TelemetryPacket { + pub sensors: SensorData, + pub cam_state: CamState, +} + +#[derive(Serialize, Deserialize, Debug)] +pub enum CamState { + Firing, + Charged, + Charging, + Idle, +} diff --git a/controller/src/main.rs b/controller/src/main.rs index b01839d..1b6d800 100644 --- a/controller/src/main.rs +++ b/controller/src/main.rs @@ -88,7 +88,8 @@ async fn main(spawner: Spawner) { let driver = Driver::new(p.USB, Irqs); spawner.spawn(logger_task(driver)).unwrap(); - let limit_switch = Input::new(p.PIN_22, Pull::Up); + let limit_switch = Input::new(p.PIN_16, Pull::Up); + let auto_status = Output::new(p.PIN_2, Level::High); let mut d: pwm::Config = Default::default(); d.divider = 40.into(); @@ -112,12 +113,14 @@ async fn main(spawner: Spawner) { let scl = p.PIN_27; let config = embassy_rp::i2c::Config::default(); let bus1 = embassy_rp::i2c::I2c::new_async(p.I2C1, scl, sda, Irqs, config); - let tof2enable = Output::new(p.PIN_16, Level::Low); + let tof_r_enable = Output::new(p.PIN_28, Level::Low); + let tof_l_enable = Output::new(p.PIN_22, Level::Low); let hardware = SensorHardware { - bus_tof: unsafe {transmute(bus)}, - bus_gyro: unsafe {transmute(bus1)}, - tof2enable, + bus_tof: unsafe {transmute(bus1)}, + bus_gyro: unsafe {transmute(bus)}, + tof_l_enable, + tof_r_enable, }; spawn_core1( diff --git a/controller/src/sensor_manager.rs b/controller/src/sensor_manager.rs index 4da621b..329ccd6 100644 --- a/controller/src/sensor_manager.rs +++ b/controller/src/sensor_manager.rs @@ -18,10 +18,11 @@ use crate::CHANNEL; pub struct SensorHardware { pub bus_tof: I2c<'static, I2C1, Async>, pub bus_gyro: I2c<'static, I2C0, Async>, - pub tof2enable: Output<'static>, + pub tof_l_enable: Output<'static>, + pub tof_r_enable: Output<'static>, } -pub fn sensor_manager(mut hardware: SensorHardware) -> ! { +pub fn sensor_manager(hardware: SensorHardware) -> ! { let mut executor = Executor::new(); let executor: &'static mut Executor = unsafe{transmute(&mut executor)}; executor.run(move |spawner| { @@ -33,8 +34,9 @@ static POLL_STATE: AtomicU8 = AtomicU8::new(PollState::None as u8); #[repr(u8)] enum PollState { None, - Tof1, - Tof2, + TofL, + TofR, + TofS, Gyro, } @@ -43,21 +45,29 @@ async fn init_sensors(mut hardware: SensorHardware) { let bus = RefCell::new(hardware.bus_tof); Timer::after_millis(1).await; - let mut tof = vl53l0x::VL53L0x::new(RefCellDevice::new(&bus)).unwrap(); - tof.set_address(0x32).unwrap(); - hardware.tof2enable.set_high(); - Timer::after_micros(1200).await; // DS11555 3.2 - let mut tof2 = vl53l0x::VL53L0x::new(RefCellDevice::new(&bus)).unwrap(); + let mut tof_s = vl53l0x::VL53L0x::new(RefCellDevice::new(&bus)).unwrap(); + tof_s.set_address(0x32).unwrap(); - let mut gyro = Mpu6050::new_with_addr(hardware.bus_gyro,0x68); - gyro.init(&mut Delay).unwrap(); - gyro.set_gyro_range(mpu6050::device::GyroRange::D2000).unwrap(); - gyro.set_accel_range(mpu6050::device::AccelRange::G16).unwrap(); + hardware.tof_l_enable.set_high(); + Timer::after_micros(1200).await; // DS11555 3.2 + let mut tof_l = vl53l0x::VL53L0x::new(RefCellDevice::new(&bus)).unwrap(); + tof_l.set_address(0x33).unwrap(); + + hardware.tof_r_enable.set_high(); + Timer::after_micros(1200).await; // DS11555 3.2 + let mut tof_r = vl53l0x::VL53L0x::new(RefCellDevice::new(&bus)).unwrap(); + tof_r.set_address(0x34).unwrap(); + + //let mut gyro = Mpu6050::new_with_addr(hardware.bus_gyro,0x68); + //gyro.init(&mut Delay).unwrap(); + //gyro.set_gyro_range(mpu6050::device::GyroRange::D2000).unwrap(); + //gyro.set_accel_range(mpu6050::device::AccelRange::G16).unwrap(); let mut data = SensorData { - tof1: None, - tof2: None, + tof_l: None, + tof_r: None, + tof_s: None, gyro: None, accel: None, }; @@ -65,35 +75,43 @@ async fn init_sensors(mut hardware: SensorHardware) { loop { let mut updated = false; - POLL_STATE.store(PollState::Tof1 as u8, Ordering::SeqCst); - if let Ok(dist) = tof.read_range_single_millimeters_blocking() { - info!("dist1: {dist}mm"); - data.tof1 = Some(dist); + POLL_STATE.store(PollState::TofS as u8, Ordering::SeqCst); + if let Ok(dist) = tof_s.read_range_single_millimeters_blocking() { + data.tof_s = Some(dist); updated = true; } Timer::after_millis(3).await; - POLL_STATE.store(PollState::Tof2 as u8, Ordering::SeqCst); - if let Ok(dist) = tof2.read_range_single_millimeters_blocking() { - info!("dist2: {dist}mm"); - data.tof2 = Some(dist); + + POLL_STATE.store(PollState::TofL as u8, Ordering::SeqCst); + if let Ok(dist) = tof_l.read_range_single_millimeters_blocking() { + data.tof_l = Some(dist); updated = true; } Timer::after_millis(3).await; - POLL_STATE.store(PollState::Gyro as u8, Ordering::SeqCst); - if let Ok(gyro) = gyro.get_gyro() { - info!("rotation: {gyro}"); - data.gyro = Some(gyro); - updated = true; - } - if let Ok(accel) = gyro.get_acc() { - data.accel = Some(accel); + + POLL_STATE.store(PollState::TofR as u8, Ordering::SeqCst); + if let Ok(dist) = tof_r.read_range_single_millimeters_blocking() { + data.tof_r = Some(dist); updated = true; } + Timer::after_millis(3).await; + + //POLL_STATE.store(PollState::Gyro as u8, Ordering::SeqCst); + //if let Ok(gyro) = gyro.get_gyro() { + // info!("rotation: {gyro}"); + // data.gyro = Some(gyro); + // updated = true; + //} + //if let Ok(accel) = gyro.get_acc() { + // data.accel = Some(accel); + // updated = true; + //} if updated { updated_ts = Instant::now(); } POLL_STATE.store(PollState::None as u8, Ordering::SeqCst); - CHANNEL.send((data.clone(), updated_ts.clone())).await; + info!("sensors: {data:?}"); + //CHANNEL.send((data.clone(), updated_ts.clone())).await; } } From 6192627e25df7d5dff054fca2c6b3093fd619e8d Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Wed, 5 Mar 2025 12:44:55 -0500 Subject: [PATCH 26/69] now using a mosfet, no "center" --- controller/src/main.rs | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/controller/src/main.rs b/controller/src/main.rs index 1b6d800..c230b17 100644 --- a/controller/src/main.rs +++ b/controller/src/main.rs @@ -99,9 +99,9 @@ async fn main(spawner: Spawner) { let mut drive_pwm = Pwm::new_output_ab(p.PWM_SLICE1, p.PIN_18, p.PIN_19, d.clone()); let mut f: pwm::Config = Default::default(); - f.divider = 40.into(); - f.top = 62500; // 20ms - f.compare_b = 4687; // 1.5ms + f.divider = 1.into(); // no reason to slow down, this is going right into a mosfet + f.top = u16::MAX; + f.compare_b = 0; let flip_pwm = Pwm::new_output_b(p.PWM_SLICE0, p.PIN_17, f.clone()); let sda = p.PIN_20; @@ -295,14 +295,13 @@ async fn main(spawner: Spawner) { } } -/// -1 to 1 +/// 0 to 1 fn calc_speed(speed: f32) -> u16 { - const COUNTS_PER_MS: f32 = 3125.; - let speed = speed.clamp(-1., 1.); + let speed = speed.clamp(0., 1.); - let ms = (speed/2.0)+1.5; + let speed = speed * u16::MAX as f32; - (COUNTS_PER_MS * ms) as u16 + speed as u16 } #[derive(Debug)] @@ -361,8 +360,8 @@ fn handle_cam(cam: &mut Pwm, state: &mut CamState, limit: &Input) { let mut f: pwm::Config = Default::default(); - f.divider = 40.into(); - f.top = 62500; // 20ms - f.compare_b = calc_speed(-speed); // 1.5ms + f.divider = 1.into(); + f.top = u16::MAX; + f.compare_b = calc_speed(speed); cam.set_config(&f); } From 31c847f39abe803df6c27d164a011b8c4915956c Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Wed, 5 Mar 2025 12:55:57 -0500 Subject: [PATCH 27/69] gracefully handle senosr death --- controller/src/sensor_manager.rs | 59 ++++++++++++++------------------ 1 file changed, 25 insertions(+), 34 deletions(-) diff --git a/controller/src/sensor_manager.rs b/controller/src/sensor_manager.rs index 329ccd6..7622946 100644 --- a/controller/src/sensor_manager.rs +++ b/controller/src/sensor_manager.rs @@ -34,9 +34,7 @@ static POLL_STATE: AtomicU8 = AtomicU8::new(PollState::None as u8); #[repr(u8)] enum PollState { None, - TofL, - TofR, - TofS, + Tof, Gyro, } @@ -45,18 +43,24 @@ async fn init_sensors(mut hardware: SensorHardware) { let bus = RefCell::new(hardware.bus_tof); Timer::after_millis(1).await; - let mut tof_s = vl53l0x::VL53L0x::new(RefCellDevice::new(&bus)).unwrap(); - tof_s.set_address(0x32).unwrap(); + let mut tof_s = vl53l0x::VL53L0x::new(RefCellDevice::new(&bus)).ok(); + if let Some(ref mut tof_s) = tof_s { + tof_s.set_address(0x32).unwrap(); + } hardware.tof_l_enable.set_high(); Timer::after_micros(1200).await; // DS11555 3.2 - let mut tof_l = vl53l0x::VL53L0x::new(RefCellDevice::new(&bus)).unwrap(); - tof_l.set_address(0x33).unwrap(); + let mut tof_l = vl53l0x::VL53L0x::new(RefCellDevice::new(&bus)).ok(); + if let Some(ref mut tof_l) = tof_l { + tof_l.set_address(0x33).unwrap(); + } hardware.tof_r_enable.set_high(); Timer::after_micros(1200).await; // DS11555 3.2 - let mut tof_r = vl53l0x::VL53L0x::new(RefCellDevice::new(&bus)).unwrap(); - tof_r.set_address(0x34).unwrap(); + let mut tof_r = vl53l0x::VL53L0x::new(RefCellDevice::new(&bus)).ok(); + if let Some(ref mut tof_r) = tof_r { + tof_r.set_address(0x34).unwrap(); + } //let mut gyro = Mpu6050::new_with_addr(hardware.bus_gyro,0x68); //gyro.init(&mut Delay).unwrap(); @@ -71,30 +75,20 @@ async fn init_sensors(mut hardware: SensorHardware) { gyro: None, accel: None, }; - let mut updated_ts = Instant::now(); loop { - let mut updated = false; - POLL_STATE.store(PollState::TofS as u8, Ordering::SeqCst); - if let Ok(dist) = tof_s.read_range_single_millimeters_blocking() { - data.tof_s = Some(dist); - updated = true; + POLL_STATE.store(PollState::Tof as u8, Ordering::SeqCst); + for (tof, store) in + [(&mut tof_s, &mut data.tof_s), (&mut tof_l, &mut data.tof_l), (&mut tof_r, &mut data.tof_r)] { + if let Some(ref mut tof) = tof { + if let Ok(dist) = tof.read_range_single_millimeters_blocking() { + *store = Some(dist); + } else { + *store = None; + } + Timer::after_millis(3).await; + } } - Timer::after_millis(3).await; - - POLL_STATE.store(PollState::TofL as u8, Ordering::SeqCst); - if let Ok(dist) = tof_l.read_range_single_millimeters_blocking() { - data.tof_l = Some(dist); - updated = true; - } - Timer::after_millis(3).await; - - POLL_STATE.store(PollState::TofR as u8, Ordering::SeqCst); - if let Ok(dist) = tof_r.read_range_single_millimeters_blocking() { - data.tof_r = Some(dist); - updated = true; - } - Timer::after_millis(3).await; //POLL_STATE.store(PollState::Gyro as u8, Ordering::SeqCst); //if let Ok(gyro) = gyro.get_gyro() { @@ -106,12 +100,9 @@ async fn init_sensors(mut hardware: SensorHardware) { // data.accel = Some(accel); // updated = true; //} - if updated { - updated_ts = Instant::now(); - } POLL_STATE.store(PollState::None as u8, Ordering::SeqCst); info!("sensors: {data:?}"); - //CHANNEL.send((data.clone(), updated_ts.clone())).await; + CHANNEL.send((data.clone(), Instant::now())).await; } } From b82c6dbed8d05f28b696517ceea42ddd9383f095 Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Wed, 5 Mar 2025 13:02:04 -0500 Subject: [PATCH 28/69] set auto light over the network --- common/src/lib.rs | 2 ++ controller/src/main.rs | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/common/src/lib.rs b/common/src/lib.rs index 26bbe61..f09af96 100644 --- a/common/src/lib.rs +++ b/common/src/lib.rs @@ -16,6 +16,8 @@ pub enum ControlPacket { FireOverride(Speed), /// Enable/Disable flipper staging Arm(bool), + /// Enable/Disable auto light + SetAuto(bool), RunAuto, /// Stop all motors Stop, diff --git a/controller/src/main.rs b/controller/src/main.rs index c230b17..6a0e549 100644 --- a/controller/src/main.rs +++ b/controller/src/main.rs @@ -89,7 +89,7 @@ async fn main(spawner: Spawner) { spawner.spawn(logger_task(driver)).unwrap(); let limit_switch = Input::new(p.PIN_16, Pull::Up); - let auto_status = Output::new(p.PIN_2, Level::High); + let mut auto_status = Output::new(p.PIN_2, Level::Low); let mut d: pwm::Config = Default::default(); d.divider = 40.into(); @@ -267,6 +267,9 @@ async fn main(spawner: Spawner) { ControlPacket::FireOverride(speed) => { cam_state.replace(CamState::Override(speed)); }, + ControlPacket::SetAuto(state) => { + auto_status.set_level(Level::from(state)); + }, ControlPacket::Arm(enable) => { if enable { cam_state.replace(CamState::Charging); From 02f6efaaa572bffa270ee344ee84c0f469dd2f26 Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Wed, 5 Mar 2025 13:55:42 -0500 Subject: [PATCH 29/69] change ip to an allowable linksys DHCP subnet --- controller/src/main.rs | 2 +- interface/src/main.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/controller/src/main.rs b/controller/src/main.rs index 6a0e549..4c20358 100644 --- a/controller/src/main.rs +++ b/controller/src/main.rs @@ -167,7 +167,7 @@ async fn main(spawner: Spawner) { // Use a link-local address for communication without DHCP server let config = Config::ipv4_static(embassy_net::StaticConfigV4 { - address: embassy_net::Ipv4Cidr::new(embassy_net::Ipv4Address::new(169, 254, 1, 1), 16), + address: embassy_net::Ipv4Cidr::new(embassy_net::Ipv4Address::new(192, 168, 1, 2), 16), dns_servers: heapless::Vec::new(), gateway: None, }); diff --git a/interface/src/main.rs b/interface/src/main.rs index 4b324d6..fa62783 100644 --- a/interface/src/main.rs +++ b/interface/src/main.rs @@ -46,7 +46,7 @@ fn main() -> Result<()> { //let latest_telem = Arc::new(RwLock::new(None)); let control = executor.block_on(async { - let cruisecontrol = TcpStream::connect("169.254.1.1:1234").await?; + let cruisecontrol = TcpStream::connect("192.168.1.2:1234").await?; println!("connected"); cruisecontrol.set_nodelay(true)?; let (telem, control) = cruisecontrol.into_split(); From 99f0ed69e4b936be40863fa3cb5882ec183fefa1 Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Wed, 5 Mar 2025 14:20:17 -0500 Subject: [PATCH 30/69] fixes restored esc pwm calculator send length before data --- controller/src/main.rs | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/controller/src/main.rs b/controller/src/main.rs index 4c20358..3176aaa 100644 --- a/controller/src/main.rs +++ b/controller/src/main.rs @@ -288,10 +288,18 @@ async fn main(spawner: Spawner) { }; if let Ok(telem) = postcard::to_slice(&telem, &mut telem_buf) { + if let Err(e) = socket.write_all(&u32::to_be_bytes(telem.len() as u32)).await { + warn!("write error: {:?}", e); + break; + } if let Err(e) = socket.write_all(&telem).await { warn!("write error: {:?}", e); break; } + //if let Err(e) = socket.flush().await { + // warn!("write error: {:?}", e); + // break; + //} } } } @@ -299,7 +307,7 @@ async fn main(spawner: Spawner) { } /// 0 to 1 -fn calc_speed(speed: f32) -> u16 { +fn calc_speed_mosfet(speed: f32) -> u16 { let speed = speed.clamp(0., 1.); let speed = speed * u16::MAX as f32; @@ -307,6 +315,16 @@ fn calc_speed(speed: f32) -> u16 { speed as u16 } +/// -1 to 1 +fn calc_speed(speed: f32) -> u16 { + const COUNTS_PER_MS: f32 = 3125.; + let speed = speed.clamp(-1., 1.); + + let ms = (speed/2.0)+1.5; + + (COUNTS_PER_MS * ms) as u16 +} + #[derive(Debug)] enum CamState { Override(f32), @@ -365,6 +383,6 @@ fn handle_cam(cam: &mut Pwm, state: &mut CamState, limit: &Input) { let mut f: pwm::Config = Default::default(); f.divider = 1.into(); f.top = u16::MAX; - f.compare_b = calc_speed(speed); + f.compare_b = calc_speed_mosfet(speed); cam.set_config(&f); } From b063a41783ecf59cfe6840ce93a73abc970fc2ff Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Wed, 5 Mar 2025 15:01:58 -0500 Subject: [PATCH 31/69] motors are swapped on new chassis --- controller/src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/controller/src/main.rs b/controller/src/main.rs index 3176aaa..07d3502 100644 --- a/controller/src/main.rs +++ b/controller/src/main.rs @@ -250,8 +250,8 @@ async fn main(spawner: Spawner) { info!("left to {}", clamp(forward+right, -1., 1.)); info!("right to {}", clamp(forward-right, -1., 1.)); - c.compare_a = calc_speed(forward - right); - c.compare_b = calc_speed(forward + right); + c.compare_a = calc_speed(-forward - right); + c.compare_b = calc_speed(-forward + right); drive_pwm.set_config(&c); }, ControlPacket::Fire => { From 971c57fa13c8122e107291202b97bd608e895ae9 Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Wed, 5 Mar 2025 21:10:17 -0500 Subject: [PATCH 32/69] graceful decay on gyro failure also switched gyro iic pins because the other ones were shorted under the pico :| --- controller/src/main.rs | 4 ++-- controller/src/sensor_manager.rs | 39 ++++++++++++++++++++------------ 2 files changed, 26 insertions(+), 17 deletions(-) diff --git a/controller/src/main.rs b/controller/src/main.rs index 07d3502..539c4e9 100644 --- a/controller/src/main.rs +++ b/controller/src/main.rs @@ -104,8 +104,8 @@ async fn main(spawner: Spawner) { f.compare_b = 0; let flip_pwm = Pwm::new_output_b(p.PWM_SLICE0, p.PIN_17, f.clone()); - let sda = p.PIN_20; - let scl = p.PIN_21; + let sda = p.PIN_8; + let scl = p.PIN_9; let config = embassy_rp::i2c::Config::default(); let bus = embassy_rp::i2c::I2c::new_async(p.I2C0, scl, sda, Irqs, config); diff --git a/controller/src/sensor_manager.rs b/controller/src/sensor_manager.rs index 7622946..b5001d4 100644 --- a/controller/src/sensor_manager.rs +++ b/controller/src/sensor_manager.rs @@ -9,7 +9,7 @@ use embassy_time::{Delay, Duration, Instant, Timer}; use embassy_rp::gpio::Output; use embassy_rp::i2c::{Async, I2c}; use embedded_hal_bus::i2c::RefCellDevice; -use log::info; +use log::{error, info}; use mpu6050::Mpu6050; use nalgebra::Vector3; @@ -62,10 +62,19 @@ async fn init_sensors(mut hardware: SensorHardware) { tof_r.set_address(0x34).unwrap(); } - //let mut gyro = Mpu6050::new_with_addr(hardware.bus_gyro,0x68); - //gyro.init(&mut Delay).unwrap(); - //gyro.set_gyro_range(mpu6050::device::GyroRange::D2000).unwrap(); - //gyro.set_accel_range(mpu6050::device::AccelRange::G16).unwrap(); + info!("initting gyro"); + let mut gyro = Mpu6050::new_with_addr(hardware.bus_gyro,0x68); + let mut gyro_alive = true; + match gyro.init(&mut Delay) { + Ok(()) => { + gyro.set_gyro_range(mpu6050::device::GyroRange::D2000).unwrap_or_else(|_| gyro_alive = false); + gyro.set_accel_range(mpu6050::device::AccelRange::G16).unwrap_or_else(|_| gyro_alive = false); + info!("init gyro"); + } + e => { + error!("gyro init err: {e:?}"); + } + } let mut data = SensorData { @@ -90,16 +99,16 @@ async fn init_sensors(mut hardware: SensorHardware) { } } - //POLL_STATE.store(PollState::Gyro as u8, Ordering::SeqCst); - //if let Ok(gyro) = gyro.get_gyro() { - // info!("rotation: {gyro}"); - // data.gyro = Some(gyro); - // updated = true; - //} - //if let Ok(accel) = gyro.get_acc() { - // data.accel = Some(accel); - // updated = true; - //} + if gyro_alive { + POLL_STATE.store(PollState::Gyro as u8, Ordering::SeqCst); + if let Ok(gyro) = gyro.get_gyro() { + info!("rotation: {gyro}"); + data.gyro = Some(gyro); + } + if let Ok(accel) = gyro.get_acc() { + data.accel = Some(accel); + } + } POLL_STATE.store(PollState::None as u8, Ordering::SeqCst); info!("sensors: {data:?}"); From 79b22b3cb7eccf9bf41d1ce63868cc8d00f755a3 Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Thu, 6 Mar 2025 11:49:33 -0500 Subject: [PATCH 33/69] added basic control gui tried fltk, didn't like it, using egui --- interface/Cargo.lock | 3092 ++++++++++++++++++++++++++++++++++++++++- interface/Cargo.toml | 4 + interface/src/gui.rs | 59 + interface/src/main.rs | 46 +- 4 files changed, 3178 insertions(+), 23 deletions(-) create mode 100644 interface/src/gui.rs diff --git a/interface/Cargo.lock b/interface/Cargo.lock index e803c90..9c0c188 100644 --- a/interface/Cargo.lock +++ b/interface/Cargo.lock @@ -2,6 +2,114 @@ # It is not intended for manual editing. version = 4 +[[package]] +name = "ab_glyph" +version = "0.2.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec3672c180e71eeaaac3a541fbbc5f5ad4def8b747c595ad30d674e43049f7b0" +dependencies = [ + "ab_glyph_rasterizer", + "owned_ttf_parser", +] + +[[package]] +name = "ab_glyph_rasterizer" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c71b1793ee61086797f5c80b6efa2b8ffa6d5dd703f118545808a7f2e27f7046" + +[[package]] +name = "accesskit" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3d3b8f9bae46a948369bc4a03e815d4ed6d616bd00de4051133a5019dc31c5a" + +[[package]] +name = "accesskit_atspi_common" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c5dd55e6e94949498698daf4d48fb5659e824d7abec0d394089656ceaf99d4f" +dependencies = [ + "accesskit", + "accesskit_consumer", + "atspi-common", + "serde", + "thiserror", + "zvariant", +] + +[[package]] +name = "accesskit_consumer" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f47983a1084940ba9a39c077a8c63e55c619388be5476ac04c804cfbd1e63459" +dependencies = [ + "accesskit", + "hashbrown", + "immutable-chunkmap", +] + +[[package]] +name = "accesskit_macos" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7329821f3bd1101e03a7d2e03bd339e3ac0dc64c70b4c9f9ae1949e3ba8dece1" +dependencies = [ + "accesskit", + "accesskit_consumer", + "hashbrown", + "objc2", + "objc2-app-kit", + "objc2-foundation", +] + +[[package]] +name = "accesskit_unix" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcee751cc20d88678c33edaf9c07e8b693cd02819fe89053776f5313492273f5" +dependencies = [ + "accesskit", + "accesskit_atspi_common", + "async-channel", + "async-executor", + "async-task", + "atspi", + "futures-lite", + "futures-util", + "serde", + "zbus", +] + +[[package]] +name = "accesskit_windows" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24fcd5d23d70670992b823e735e859374d694a3d12bfd8dd32bd3bd8bedb5d81" +dependencies = [ + "accesskit", + "accesskit_consumer", + "hashbrown", + "paste", + "static_assertions", + "windows 0.58.0", + "windows-core 0.58.0", +] + +[[package]] +name = "accesskit_winit" +version = "0.23.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6a48dad5530b6deb9fc7a52cc6c3bf72cdd9eb8157ac9d32d69f2427a5e879" +dependencies = [ + "accesskit", + "accesskit_macos", + "accesskit_unix", + "accesskit_windows", + "raw-window-handle", + "winit", +] + [[package]] name = "addr2line" version = "0.24.2" @@ -17,6 +125,19 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" +[[package]] +name = "ahash" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +dependencies = [ + "cfg-if", + "getrandom 0.2.15", + "once_cell", + "version_check", + "zerocopy", +] + [[package]] name = "aho-corasick" version = "1.1.3" @@ -48,6 +169,42 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "android-activity" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef6978589202a00cd7e118380c448a08b6ed394c3a8df3a430d0898e3a42d046" +dependencies = [ + "android-properties", + "bitflags 2.8.0", + "cc", + "cesu8", + "jni", + "jni-sys", + "libc", + "log", + "ndk 0.9.0", + "ndk-context", + "ndk-sys 0.6.0+11769913", + "num_enum", + "thiserror", +] + +[[package]] +name = "android-properties" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc7eb209b1518d6bb87b283c20095f5228ecda460da70b44f0802523dea6da04" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + [[package]] name = "ansi_term" version = "0.12.1" @@ -72,6 +229,191 @@ dependencies = [ "num-traits", ] +[[package]] +name = "arboard" +version = "3.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df099ccb16cd014ff054ac1bf392c67feeef57164b05c42f037cd40f5d4357f4" +dependencies = [ + "clipboard-win", + "log", + "objc2", + "objc2-app-kit", + "objc2-foundation", + "parking_lot", + "x11rb", +] + +[[package]] +name = "arrayref" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" + +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + +[[package]] +name = "as-raw-xcb-connection" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "175571dd1d178ced59193a6fc02dde1b972eb0bc56c892cde9beeceac5bf0f6b" + +[[package]] +name = "ash" +version = "0.38.0+1.3.281" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bb44936d800fea8f016d7f2311c6a4f97aebd5dc86f09906139ec848cf3a46f" +dependencies = [ + "libloading", +] + +[[package]] +name = "async-broadcast" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "435a87a52755b8f27fcf321ac4f04b2802e337c8c4872923137471ec39c37532" +dependencies = [ + "event-listener", + "event-listener-strategy", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-channel" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89b47800b0be77592da0afd425cc03468052844aff33b84e33cc696f64e77b6a" +dependencies = [ + "concurrent-queue", + "event-listener-strategy", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-executor" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30ca9a001c1e8ba5149f91a74362376cc6bc5b919d92d988668657bd570bdcec" +dependencies = [ + "async-task", + "concurrent-queue", + "fastrand", + "futures-lite", + "slab", +] + +[[package]] +name = "async-fs" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebcd09b382f40fcd159c2d695175b2ae620ffa5f3bd6f664131efff4e8b9e04a" +dependencies = [ + "async-lock", + "blocking", + "futures-lite", +] + +[[package]] +name = "async-io" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a2b323ccce0a1d90b449fd71f2a06ca7faa7c54c2751f06c9bd851fc061059" +dependencies = [ + "async-lock", + "cfg-if", + "concurrent-queue", + "futures-io", + "futures-lite", + "parking", + "polling", + "rustix", + "slab", + "tracing", + "windows-sys 0.59.0", +] + +[[package]] +name = "async-lock" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" +dependencies = [ + "event-listener", + "event-listener-strategy", + "pin-project-lite", +] + +[[package]] +name = "async-process" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63255f1dc2381611000436537bbedfe83183faa303a5a0edaf191edef06526bb" +dependencies = [ + "async-channel", + "async-io", + "async-lock", + "async-signal", + "async-task", + "blocking", + "cfg-if", + "event-listener", + "futures-lite", + "rustix", + "tracing", +] + +[[package]] +name = "async-recursion" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", +] + +[[package]] +name = "async-signal" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "637e00349800c0bdf8bfc21ebbc0b6524abea702b0da4168ac00d070d0c0b9f3" +dependencies = [ + "async-io", + "async-lock", + "atomic-waker", + "cfg-if", + "futures-core", + "futures-io", + "rustix", + "signal-hook-registry", + "slab", + "windows-sys 0.59.0", +] + +[[package]] +name = "async-task" +version = "4.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" + +[[package]] +name = "async-trait" +version = "0.1.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d556ec1359574147ec0c4fc5eb525f3f23263a592b1a9c07e0a75b427de55c97" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", +] + [[package]] name = "atomic-polyfill" version = "1.0.3" @@ -81,13 +423,70 @@ dependencies = [ "critical-section", ] +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + +[[package]] +name = "atspi" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be534b16650e35237bb1ed189ba2aab86ce65e88cc84c66f4935ba38575cecbf" +dependencies = [ + "atspi-common", + "atspi-connection", + "atspi-proxies", +] + +[[package]] +name = "atspi-common" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1909ed2dc01d0a17505d89311d192518507e8a056a48148e3598fef5e7bb6ba7" +dependencies = [ + "enumflags2", + "serde", + "static_assertions", + "zbus", + "zbus-lockstep", + "zbus-lockstep-macros", + "zbus_names", + "zvariant", +] + +[[package]] +name = "atspi-connection" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "430c5960624a4baaa511c9c0fcc2218e3b58f5dbcc47e6190cafee344b873333" +dependencies = [ + "atspi-common", + "atspi-proxies", + "futures-lite", + "zbus", +] + +[[package]] +name = "atspi-proxies" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5e6c5de3e524cf967569722446bcd458d5032348554d9a17d7d72b041ab7496" +dependencies = [ + "atspi-common", + "serde", + "zbus", + "zvariant", +] + [[package]] name = "atty" version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ - "hermit-abi", + "hermit-abi 0.1.19", "libc", "winapi", ] @@ -131,6 +530,21 @@ dependencies = [ "syn 2.0.96", ] +[[package]] +name = "bit-set" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" + [[package]] name = "bitflags" version = "1.3.2" @@ -143,24 +557,113 @@ version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" +[[package]] +name = "block" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "block2" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c132eebf10f5cad5289222520a4a058514204aed6d791f1cf4fe8088b82d15f" +dependencies = [ + "objc2", +] + +[[package]] +name = "blocking" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "703f41c54fc768e63e091340b424302bb1c29ef4aa0c7f10fe849dfb114d29ea" +dependencies = [ + "async-channel", + "async-task", + "futures-io", + "futures-lite", + "piper", +] + [[package]] name = "bumpalo" version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" +[[package]] +name = "bytemuck" +version = "1.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6b1fc10dbac614ebc03540c9dbd60e83887fda27794998c6528f1782047d540" +dependencies = [ + "bytemuck_derive", +] + +[[package]] +name = "bytemuck_derive" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fa76293b4f7bb636ab88fd78228235b5248b4d05cc589aed610f954af5d7c7a" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", +] + [[package]] name = "byteorder" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" +[[package]] +name = "byteorder-lite" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" + [[package]] name = "bytes" version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" +[[package]] +name = "calloop" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b99da2f8558ca23c71f4fd15dc57c906239752dd27ff3c00a1d56b685b7cbfec" +dependencies = [ + "bitflags 2.8.0", + "log", + "polling", + "rustix", + "slab", + "thiserror", +] + +[[package]] +name = "calloop-wayland-source" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95a66a987056935f7efce4ab5668920b5d0dac4a7c99991a67395f13702ddd20" +dependencies = [ + "calloop", + "rustix", + "wayland-backend", + "wayland-client", +] + [[package]] name = "cc" version = "1.2.9" @@ -193,6 +696,27 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "cfg_aliases" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" + +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + +[[package]] +name = "cgl" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ced0551234e87afee12411d535648dd89d2e7f34c78b753395567aff3d447ff" +dependencies = [ + "libc", +] + [[package]] name = "clang-sys" version = "1.8.1" @@ -219,12 +743,31 @@ dependencies = [ "vec_map", ] +[[package]] +name = "clipboard-win" +version = "5.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15efe7a882b08f34e38556b14f2fb3daa98769d06c7f0c1b076dfd0d983bc892" +dependencies = [ + "error-code", +] + [[package]] name = "cobs" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "67ba02a97a2bd10f4b59b25c7973101c79642302776489e030cd13cdab09ed15" +[[package]] +name = "codespan-reporting" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" +dependencies = [ + "termcolor", + "unicode-width", +] + [[package]] name = "combine" version = "4.6.7" @@ -244,12 +787,65 @@ dependencies = [ "serde", ] +[[package]] +name = "concurrent-queue" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b55271e5c8c478ad3f38ad24ef34923091e0548492a266d19b3c0b4d82574c63" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "core-foundation-sys" version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" +[[package]] +name = "core-graphics" +version = "0.23.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c07782be35f9e1140080c6b96f0d44b739e2278479f64e02fdab4e32dfd8b081" +dependencies = [ + "bitflags 1.3.2", + "core-foundation 0.9.4", + "core-graphics-types", + "foreign-types", + "libc", +] + +[[package]] +name = "core-graphics-types" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45390e6114f68f718cc7a830514a96f903cccd70d02a8f6d9f643ac4ba45afaf" +dependencies = [ + "bitflags 1.3.2", + "core-foundation 0.9.4", + "libc", +] + [[package]] name = "coreaudio-rs" version = "0.11.3" @@ -284,13 +880,31 @@ dependencies = [ "js-sys", "libc", "mach2", - "ndk", + "ndk 0.8.0", "ndk-context", "oboe", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "windows", + "windows 0.54.0", +] + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +dependencies = [ + "cfg-if", ] [[package]] @@ -299,36 +913,690 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" +[[package]] +name = "crossbeam-utils" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "cursor-icon" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96a6ac251f4a2aca6b3f91340350eab87ae57c3f127ffeb585e92bd336717991" + [[package]] name = "dasp_sample" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c87e182de0887fd5361989c677c4e8f5000cd9491d6d563161a8f3a5519fc7f" +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", +] + +[[package]] +name = "dispatch" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" + +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", +] + +[[package]] +name = "dlib" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "330c60081dcc4c72131f8eb70510f1ac07223e5d4163db481a04a0befcffa412" +dependencies = [ + "libloading", +] + +[[package]] +name = "document-features" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95249b50c6c185bee49034bcb378a49dc2b5dff0be90ff6616d31d64febab05d" +dependencies = [ + "litrs", +] + +[[package]] +name = "downcast-rs" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" + +[[package]] +name = "dpi" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f25c0e292a7ca6d6498557ff1df68f32c99850012b6ea401cf8daf771f22ff53" + +[[package]] +name = "ecolor" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d72e9c39f6e11a2e922d04a34ec5e7ef522ea3f5a1acfca7a19d16ad5fe50f5" +dependencies = [ + "bytemuck", + "emath", +] + +[[package]] +name = "eframe" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2f2d9e7ea2d11ec9e98a8683b6eb99f9d7d0448394ef6e0d6d91bd4eb817220" +dependencies = [ + "ahash", + "bytemuck", + "document-features", + "egui", + "egui-wgpu", + "egui-winit", + "egui_glow", + "glow 0.16.0", + "glutin", + "glutin-winit", + "image", + "js-sys", + "log", + "objc2", + "objc2-app-kit", + "objc2-foundation", + "parking_lot", + "percent-encoding", + "profiling", + "raw-window-handle", + "static_assertions", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "web-time", + "winapi", + "windows-sys 0.59.0", + "winit", +] + +[[package]] +name = "egui" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "252d52224d35be1535d7fd1d6139ce071fb42c9097773e79f7665604f5596b5e" +dependencies = [ + "accesskit", + "ahash", + "emath", + "epaint", + "log", + "nohash-hasher", + "profiling", +] + +[[package]] +name = "egui-toast" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2531762f801556e7b8c445feee7b5a790aca1d5bf4d4e09a66c73b807058816" +dependencies = [ + "egui", +] + +[[package]] +name = "egui-wgpu" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26c1e821d2d8921ef6ce98b258c7e24d9d6aab2ca1f9cdf374eca997e7f67f59" +dependencies = [ + "ahash", + "bytemuck", + "document-features", + "egui", + "epaint", + "log", + "profiling", + "thiserror", + "type-map", + "web-time", + "wgpu", + "winit", +] + +[[package]] +name = "egui-winit" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e84c2919cd9f3a38a91e8f84ac6a245c19251fd95226ed9fae61d5ea564fce3" +dependencies = [ + "accesskit_winit", + "ahash", + "arboard", + "egui", + "log", + "profiling", + "raw-window-handle", + "smithay-clipboard", + "web-time", + "webbrowser", + "winit", +] + +[[package]] +name = "egui_extras" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d7a8198c088b1007108cb2d403bc99a5e370999b200db4f14559610d7330126" +dependencies = [ + "ahash", + "egui", + "enum-map", + "image", + "log", + "mime_guess2", + "profiling", +] + +[[package]] +name = "egui_glow" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3eaf6264cc7608e3e69a7d57a6175f438275f1b3889c1a551b418277721c95e6" +dependencies = [ + "ahash", + "bytemuck", + "egui", + "glow 0.16.0", + "log", + "memoffset", + "profiling", + "wasm-bindgen", + "web-sys", + "winit", +] + [[package]] name = "either" version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +[[package]] +name = "emath" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4fe73c1207b864ee40aa0b0c038d6092af1030744678c60188a05c28553515d" +dependencies = [ + "bytemuck", +] + +[[package]] +name = "endi" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3d8a32ae18130a3c84dd492d4215c3d913c3b07c6b63c2eb3eb7ff1101ab7bf" + +[[package]] +name = "enum-map" +version = "2.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6866f3bfdf8207509a033af1a75a7b08abda06bbaaeae6669323fd5a097df2e9" +dependencies = [ + "enum-map-derive", + "serde", +] + +[[package]] +name = "enum-map-derive" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f282cfdfe92516eb26c2af8589c274c7c17681f5ecc03c18255fe741c6aa64eb" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", +] + +[[package]] +name = "enumflags2" +version = "0.7.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba2f4b465f5318854c6f8dd686ede6c0a9dc67d4b1ac241cf0eb51521a309147" +dependencies = [ + "enumflags2_derive", + "serde", +] + +[[package]] +name = "enumflags2_derive" +version = "0.7.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc4caf64a58d7a6d65ab00639b046ff54399a39f5f2554728895ace4b297cd79" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", +] + +[[package]] +name = "epaint" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5666f8d25236293c966fbb3635eac18b04ad1914e3bab55bc7d44b9980cafcac" +dependencies = [ + "ab_glyph", + "ahash", + "bytemuck", + "ecolor", + "emath", + "epaint_default_fonts", + "log", + "nohash-hasher", + "parking_lot", + "profiling", +] + +[[package]] +name = "epaint_default_fonts" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66f6ddac3e6ac6fd4c3d48bb8b1943472f8da0f43a4303bcd8a18aa594401c80" + [[package]] name = "equivalent" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +[[package]] +name = "errno" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" +dependencies = [ + "libc", + "windows-sys 0.59.0", +] + +[[package]] +name = "error-code" +version = "3.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5d9305ccc6942a704f4335694ecd3de2ea531b114ac2d51f5f843750787a92f" + +[[package]] +name = "event-listener" +version = "5.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3492acde4c3fc54c845eaab3eed8bd00c7a7d881f78bfc801e43a93dec1331ae" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c3e4e0dd3673c1139bf041f3008816d9cf2946bbfac2945c09e523b8d7b05b2" +dependencies = [ + "event-listener", + "pin-project-lite", +] + +[[package]] +name = "fastrand" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" + +[[package]] +name = "fdeflate" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e6853b52649d4ac5c0bd02320cddc5ba956bdb407c4b75a2c6b75bf51500f8c" +dependencies = [ + "simd-adler32", +] + +[[package]] +name = "flate2" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "foldhash" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0d2fde1f7b3d48b8395d5f2de76c18a528bd6a9cdde438df747bfcba3e05d6f" + +[[package]] +name = "foreign-types" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" +dependencies = [ + "foreign-types-macros", + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-macros" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", +] + +[[package]] +name = "foreign-types-shared" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futures-core" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" + +[[package]] +name = "futures-io" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" + +[[package]] +name = "futures-lite" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5edaec856126859abb19ed65f39e90fea3a9574b9707f13539acf4abf7eb532" +dependencies = [ + "fastrand", + "futures-core", + "futures-io", + "parking", + "pin-project-lite", +] + +[[package]] +name = "futures-macro" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", +] + +[[package]] +name = "futures-sink" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" + +[[package]] +name = "futures-task" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" + +[[package]] +name = "futures-util" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" +dependencies = [ + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "gethostname" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0176e0459c2e4a1fe232f984bca6890e681076abb9934f6cea7c326f3fc47818" +dependencies = [ + "libc", + "windows-targets 0.48.5", +] + +[[package]] +name = "getrandom" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a49c392881ce6d5c3b8cb70f98717b7c07aabbdff06687b9030dbfbe2725f8" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.13.3+wasi-0.2.2", + "windows-targets 0.52.6", +] + [[package]] name = "gimli" version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" +[[package]] +name = "gl_generator" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a95dfc23a2b4a9a2f5ab41d194f8bfda3cabec42af4e39f08c339eb2a0c124d" +dependencies = [ + "khronos_api", + "log", + "xml-rs", +] + [[package]] name = "glob" version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" +[[package]] +name = "glow" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d51fa363f025f5c111e03f13eda21162faeacb6911fe8caa0c0349f9cf0c4483" +dependencies = [ + "js-sys", + "slotmap", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "glow" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5e5ea60d70410161c8bf5da3fdfeaa1c72ed2c15f8bbb9d19fe3a4fad085f08" +dependencies = [ + "js-sys", + "slotmap", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "glutin" +version = "0.32.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03642b8b0cce622392deb0ee3e88511f75df2daac806102597905c3ea1974848" +dependencies = [ + "bitflags 2.8.0", + "cfg_aliases 0.2.1", + "cgl", + "core-foundation 0.9.4", + "dispatch", + "glutin_egl_sys", + "glutin_glx_sys", + "glutin_wgl_sys", + "libloading", + "objc2", + "objc2-app-kit", + "objc2-foundation", + "once_cell", + "raw-window-handle", + "wayland-sys", + "windows-sys 0.52.0", + "x11-dl", +] + +[[package]] +name = "glutin-winit" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85edca7075f8fc728f28cb8fbb111a96c3b89e930574369e3e9c27eb75d3788f" +dependencies = [ + "cfg_aliases 0.2.1", + "glutin", + "raw-window-handle", + "winit", +] + +[[package]] +name = "glutin_egl_sys" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c4680ba6195f424febdc3ba46e7a42a0e58743f2edb115297b86d7f8ecc02d2" +dependencies = [ + "gl_generator", + "windows-sys 0.52.0", +] + +[[package]] +name = "glutin_glx_sys" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a7bb2938045a88b612499fbcba375a77198e01306f52272e692f8c1f3751185" +dependencies = [ + "gl_generator", + "x11-dl", +] + +[[package]] +name = "glutin_wgl_sys" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c4ee00b289aba7a9e5306d57c2d05499b2e5dc427f84ac708bd2c090212cf3e" +dependencies = [ + "gl_generator", +] + +[[package]] +name = "gpu-alloc" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbcd2dba93594b227a1f57ee09b8b9da8892c34d55aa332e034a228d0fe6a171" +dependencies = [ + "bitflags 2.8.0", + "gpu-alloc-types", +] + +[[package]] +name = "gpu-alloc-types" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98ff03b468aa837d70984d55f5d3f846f6ec31fe34bbb97c4f85219caeee1ca4" +dependencies = [ + "bitflags 2.8.0", +] + +[[package]] +name = "gpu-descriptor" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcf29e94d6d243368b7a56caa16bc213e4f9f8ed38c4d9557069527b5d5281ca" +dependencies = [ + "bitflags 2.8.0", + "gpu-descriptor-types", + "hashbrown", +] + +[[package]] +name = "gpu-descriptor-types" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdf242682df893b86f33a73828fb09ca4b2d3bb6cc95249707fc684d27484b91" +dependencies = [ + "bitflags 2.8.0", +] + [[package]] name = "hash32" version = "0.2.1" @@ -343,6 +1611,9 @@ name = "hashbrown" version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" +dependencies = [ + "foldhash", +] [[package]] name = "heapless" @@ -376,6 +1647,193 @@ dependencies = [ "libc", ] +[[package]] +name = "hermit-abi" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hexf-parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfa686283ad6dd069f105e5ab091b04c62850d3e4cf5d67debad1933f55023df" + +[[package]] +name = "home" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589533453244b0995c858700322199b2becb13b627df2851f64a2775d024abcf" +dependencies = [ + "windows-sys 0.59.0", +] + +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", +] + +[[package]] +name = "idna" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "image" +version = "0.25.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd6f44aed642f18953a158afeb30206f4d50da59fbc66ecb53c66488de73563b" +dependencies = [ + "bytemuck", + "byteorder-lite", + "num-traits", + "png", +] + +[[package]] +name = "immutable-chunkmap" +version = "2.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12f97096f508d54f8f8ab8957862eee2ccd628847b6217af1a335e1c44dee578" +dependencies = [ + "arrayvec", +] + [[package]] name = "indexmap" version = "2.7.0" @@ -393,6 +1851,9 @@ dependencies = [ "anyhow", "common", "cpal", + "eframe", + "egui-toast", + "egui_extras", "heapless", "pitch-detection", "postcard", @@ -451,6 +1912,23 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "khronos-egl" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6aae1df220ece3c0ada96b8153459b67eebe9ae9212258bb0134ae60416fdf76" +dependencies = [ + "libc", + "libloading", + "pkg-config", +] + +[[package]] +name = "khronos_api" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc" + [[package]] name = "lazy_static" version = "1.5.0" @@ -473,6 +1951,35 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "libredox" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags 2.8.0", + "libc", + "redox_syscall 0.5.8", +] + +[[package]] +name = "linux-raw-sys" +version = "0.4.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" + +[[package]] +name = "litemap" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23fb14cb19457329c82206317a5663005a4d404783dc74f4252769b0d5f42856" + +[[package]] +name = "litrs" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" + [[package]] name = "lock_api" version = "0.4.12" @@ -498,12 +2005,70 @@ dependencies = [ "libc", ] +[[package]] +name = "malloc_buf" +version = "0.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" +dependencies = [ + "libc", +] + [[package]] name = "memchr" version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +[[package]] +name = "memmap2" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd3f7eed9d3848f8b98834af67102b720745c4ec028fcd0aa0239277e7de374f" +dependencies = [ + "libc", +] + +[[package]] +name = "memoffset" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" +dependencies = [ + "autocfg", +] + +[[package]] +name = "metal" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ecfd3296f8c56b7c1f6fbac3c71cefa9d78ce009850c45000015f206dc7fa21" +dependencies = [ + "bitflags 2.8.0", + "block", + "core-graphics-types", + "foreign-types", + "log", + "objc", + "paste", +] + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "mime_guess2" +version = "2.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25a3333bb1609500601edc766a39b4c1772874a4ce26022f4d866854dc020c41" +dependencies = [ + "mime", + "unicase", +] + [[package]] name = "minimal-lexical" version = "0.2.1" @@ -517,6 +2082,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8402cab7aefae129c6977bb0ff1b8fd9a04eb5b51efc50a70bea51cda0c7924" dependencies = [ "adler2", + "simd-adler32", ] [[package]] @@ -526,10 +2092,31 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" dependencies = [ "libc", - "wasi", + "wasi 0.11.0+wasi-snapshot-preview1", "windows-sys 0.52.0", ] +[[package]] +name = "naga" +version = "23.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "364f94bc34f61332abebe8cad6f6cd82a5b65cff22c828d05d0968911462ca4f" +dependencies = [ + "arrayvec", + "bit-set", + "bitflags 2.8.0", + "cfg_aliases 0.1.1", + "codespan-reporting", + "hexf-parse", + "indexmap", + "log", + "rustc-hash", + "spirv", + "termcolor", + "thiserror", + "unicode-xid", +] + [[package]] name = "nalgebra" version = "0.31.4" @@ -554,11 +2141,26 @@ dependencies = [ "bitflags 2.8.0", "jni-sys", "log", - "ndk-sys", + "ndk-sys 0.5.0+25.2.9519653", "num_enum", "thiserror", ] +[[package]] +name = "ndk" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3f42e7bbe13d351b6bead8286a43aac9534b82bd3cc43e47037f012ebfd62d4" +dependencies = [ + "bitflags 2.8.0", + "jni-sys", + "log", + "ndk-sys 0.6.0+11769913", + "num_enum", + "raw-window-handle", + "thiserror", +] + [[package]] name = "ndk-context" version = "0.1.1" @@ -574,6 +2176,34 @@ dependencies = [ "jni-sys", ] +[[package]] +name = "ndk-sys" +version = "0.6.0+11769913" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee6cda3051665f1fb8d9e08fc35c96d5a244fb1be711a03b71118828afc9a873" +dependencies = [ + "jni-sys", +] + +[[package]] +name = "nix" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" +dependencies = [ + "bitflags 2.8.0", + "cfg-if", + "cfg_aliases 0.2.1", + "libc", + "memoffset", +] + +[[package]] +name = "nohash-hasher" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" + [[package]] name = "nom" version = "7.1.3" @@ -654,6 +2284,218 @@ dependencies = [ "syn 2.0.96", ] +[[package]] +name = "objc" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" +dependencies = [ + "malloc_buf", +] + +[[package]] +name = "objc-sys" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdb91bdd390c7ce1a8607f35f3ca7151b65afc0ff5ff3b34fa350f7d7c7e4310" + +[[package]] +name = "objc2" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46a785d4eeff09c14c487497c162e92766fbb3e4059a71840cecc03d9a50b804" +dependencies = [ + "objc-sys", + "objc2-encode", +] + +[[package]] +name = "objc2-app-kit" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4e89ad9e3d7d297152b17d39ed92cd50ca8063a89a9fa569046d41568891eff" +dependencies = [ + "bitflags 2.8.0", + "block2", + "libc", + "objc2", + "objc2-core-data", + "objc2-core-image", + "objc2-foundation", + "objc2-quartz-core", +] + +[[package]] +name = "objc2-cloud-kit" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74dd3b56391c7a0596a295029734d3c1c5e7e510a4cb30245f8221ccea96b009" +dependencies = [ + "bitflags 2.8.0", + "block2", + "objc2", + "objc2-core-location", + "objc2-foundation", +] + +[[package]] +name = "objc2-contacts" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5ff520e9c33812fd374d8deecef01d4a840e7b41862d849513de77e44aa4889" +dependencies = [ + "block2", + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-core-data" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "617fbf49e071c178c0b24c080767db52958f716d9eabdf0890523aeae54773ef" +dependencies = [ + "bitflags 2.8.0", + "block2", + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-core-image" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55260963a527c99f1819c4f8e3b47fe04f9650694ef348ffd2227e8196d34c80" +dependencies = [ + "block2", + "objc2", + "objc2-foundation", + "objc2-metal", +] + +[[package]] +name = "objc2-core-location" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "000cfee34e683244f284252ee206a27953279d370e309649dc3ee317b37e5781" +dependencies = [ + "block2", + "objc2", + "objc2-contacts", + "objc2-foundation", +] + +[[package]] +name = "objc2-encode" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef25abbcd74fb2609453eb695bd2f860d389e457f67dc17cafc8b8cbc89d0c33" + +[[package]] +name = "objc2-foundation" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ee638a5da3799329310ad4cfa62fbf045d5f56e3ef5ba4149e7452dcf89d5a8" +dependencies = [ + "bitflags 2.8.0", + "block2", + "dispatch", + "libc", + "objc2", +] + +[[package]] +name = "objc2-link-presentation" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1a1ae721c5e35be65f01a03b6d2ac13a54cb4fa70d8a5da293d7b0020261398" +dependencies = [ + "block2", + "objc2", + "objc2-app-kit", + "objc2-foundation", +] + +[[package]] +name = "objc2-metal" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd0cba1276f6023976a406a14ffa85e1fdd19df6b0f737b063b95f6c8c7aadd6" +dependencies = [ + "bitflags 2.8.0", + "block2", + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-quartz-core" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e42bee7bff906b14b167da2bac5efe6b6a07e6f7c0a21a7308d40c960242dc7a" +dependencies = [ + "bitflags 2.8.0", + "block2", + "objc2", + "objc2-foundation", + "objc2-metal", +] + +[[package]] +name = "objc2-symbols" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a684efe3dec1b305badae1a28f6555f6ddd3bb2c2267896782858d5a78404dc" +dependencies = [ + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-ui-kit" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8bb46798b20cd6b91cbd113524c490f1686f4c4e8f49502431415f3512e2b6f" +dependencies = [ + "bitflags 2.8.0", + "block2", + "objc2", + "objc2-cloud-kit", + "objc2-core-data", + "objc2-core-image", + "objc2-core-location", + "objc2-foundation", + "objc2-link-presentation", + "objc2-quartz-core", + "objc2-symbols", + "objc2-uniform-type-identifiers", + "objc2-user-notifications", +] + +[[package]] +name = "objc2-uniform-type-identifiers" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44fa5f9748dbfe1ca6c0b79ad20725a11eca7c2218bceb4b005cb1be26273bfe" +dependencies = [ + "block2", + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-user-notifications" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76cfcbf642358e8689af64cee815d139339f3ed8ad05103ed5eaf73db8d84cb3" +dependencies = [ + "bitflags 2.8.0", + "block2", + "objc2", + "objc2-core-location", + "objc2-foundation", +] + [[package]] name = "object" version = "0.36.7" @@ -670,7 +2512,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8b61bebd49e5d43f5f8cc7ee2891c16e0f41ec7954d36bcb6c14c5e0de867fb" dependencies = [ "jni", - "ndk", + "ndk 0.8.0", "ndk-context", "num-derive", "num-traits", @@ -692,6 +2534,40 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" +[[package]] +name = "orbclient" +version = "0.3.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba0b26cec2e24f08ed8bb31519a9333140a6599b867dac464bb150bdb796fd43" +dependencies = [ + "libredox", +] + +[[package]] +name = "ordered-stream" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aa2b01e1d916879f73a53d01d1d6cee68adbb31d6d9177a8cfce093cced1d50" +dependencies = [ + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "owned_ttf_parser" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22ec719bbf3b2a81c109a4e20b1f129b5566b7dce654bc3872f6a05abf82b2c4" +dependencies = [ + "ttf-parser", +] + +[[package]] +name = "parking" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" + [[package]] name = "parking_lot" version = "0.12.3" @@ -710,7 +2586,7 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall", + "redox_syscall 0.5.8", "smallvec", "windows-targets 0.52.6", ] @@ -721,12 +2597,55 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "pin-project" +version = "1.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677f1add503faace112b9f1373e43e9e054bfdd22ff1a63c1bc485eaec6a6a8a" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", +] + [[package]] name = "pin-project-lite" version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "piper" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96c8c490f422ef9a4efd2cb5b42b76c8613d7e7dfc1caf667b8a3350a5acc066" +dependencies = [ + "atomic-waker", + "fastrand", + "futures-io", +] + [[package]] name = "pitch-detection" version = "0.3.0" @@ -742,6 +2661,34 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" +[[package]] +name = "png" +version = "0.17.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82151a2fc869e011c153adc57cf2789ccb8d9906ce52c0b39a6b5697749d7526" +dependencies = [ + "bitflags 1.3.2", + "crc32fast", + "fdeflate", + "flate2", + "miniz_oxide", +] + +[[package]] +name = "polling" +version = "3.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a604568c3202727d1507653cb121dbd627a58684eb09a820fd746bee38b4442f" +dependencies = [ + "cfg-if", + "concurrent-queue", + "hermit-abi 0.4.0", + "pin-project-lite", + "rustix", + "tracing", + "windows-sys 0.59.0", +] + [[package]] name = "postcard" version = "1.1.1" @@ -753,6 +2700,15 @@ dependencies = [ "serde", ] +[[package]] +name = "ppv-lite86" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] + [[package]] name = "primal-check" version = "0.3.4" @@ -780,6 +2736,31 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "profiling" +version = "1.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afbdc74edc00b6f6a218ca6a5364d6226a259d4b8ea1af4a0ea063f27e179f4d" + +[[package]] +name = "quick-xml" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eff6510e86862b57b210fd8cbe8ed3f0d7d600b9c2863cd4549a2e033c66e956" +dependencies = [ + "memchr", + "serde", +] + +[[package]] +name = "quick-xml" +version = "0.37.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "165859e9e55f79d67b96c5d96f4e88b6f2695a1972849c15a6a3f5c59fc2c003" +dependencies = [ + "memchr", +] + [[package]] name = "quote" version = "1.0.38" @@ -789,6 +2770,51 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.15", +] + +[[package]] +name = "raw-window-handle" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20675572f6f24e9e76ef639bc5552774ed45f1c30e2951e1e99c59888861c539" + +[[package]] +name = "redox_syscall" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +dependencies = [ + "bitflags 1.3.2", +] + [[package]] name = "redox_syscall" version = "0.5.8" @@ -827,6 +2853,12 @@ version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" +[[package]] +name = "renderdoc-sys" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b30a45b0cd0bcca8037f3d0dc3421eaf95327a17cad11964fb8179b4fc4832" + [[package]] name = "rust-music-theory" version = "0.2.0" @@ -875,6 +2907,19 @@ dependencies = [ "version_check", ] +[[package]] +name = "rustix" +version = "0.38.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" +dependencies = [ + "bitflags 2.8.0", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.59.0", +] + [[package]] name = "rustversion" version = "1.0.19" @@ -890,12 +2935,31 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "scoped-tls" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" + [[package]] name = "scopeguard" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "sctk-adwaita" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6277f0217056f77f1d8f49f2950ac6c278c0d607c45f5ee99328d792ede24ec" +dependencies = [ + "ab_glyph", + "log", + "memmap2", + "smithay-client-toolkit", + "tiny-skia", +] + [[package]] name = "semver" version = "1.0.24" @@ -922,6 +2986,28 @@ dependencies = [ "syn 2.0.96", ] +[[package]] +name = "serde_repr" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "175ee3e80ae9982737ca543e96133087cbd9a485eecc3bc4de9c1a37b47ea59c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", +] + +[[package]] +name = "sha1" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + [[package]] name = "shlex" version = "1.3.0" @@ -949,12 +3035,81 @@ dependencies = [ "paste", ] +[[package]] +name = "simd-adler32" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" + +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + +[[package]] +name = "slotmap" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbff4acf519f630b3a3ddcfaea6c06b42174d9a44bc70c620e9ed1649d58b82a" +dependencies = [ + "version_check", +] + [[package]] name = "smallvec" version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +[[package]] +name = "smithay-client-toolkit" +version = "0.19.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3457dea1f0eb631b4034d61d4d8c32074caa6cd1ab2d59f2327bd8461e2c0016" +dependencies = [ + "bitflags 2.8.0", + "calloop", + "calloop-wayland-source", + "cursor-icon", + "libc", + "log", + "memmap2", + "rustix", + "thiserror", + "wayland-backend", + "wayland-client", + "wayland-csd-frame", + "wayland-cursor", + "wayland-protocols", + "wayland-protocols-wlr", + "wayland-scanner", + "xkeysym", +] + +[[package]] +name = "smithay-clipboard" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc8216eec463674a0e90f29e0ae41a4db573ec5b56b1c6c1c71615d249b6d846" +dependencies = [ + "libc", + "smithay-client-toolkit", + "wayland-backend", +] + +[[package]] +name = "smol_str" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd538fb6910ac1099850255cf94a94df6551fbdd602454387d0adb2d1ca6dead" +dependencies = [ + "serde", +] + [[package]] name = "socket2" version = "0.5.8" @@ -974,18 +3129,39 @@ dependencies = [ "lock_api", ] +[[package]] +name = "spirv" +version = "0.3.0+sdk-1.3.268.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eda41003dc44290527a59b13432d4a0379379fa074b70174882adfbdfd917844" +dependencies = [ + "bitflags 2.8.0", +] + [[package]] name = "stable_deref_trait" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + [[package]] name = "strength_reduce" version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fe895eb47f22e2ddd4dabc02bce419d2e643c8e3b585c78158b349195bc24d82" +[[package]] +name = "strict-num" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6637bab7722d379c8b41ba849228d680cc12d0a45ba1fa2b48f2a30577a06731" + [[package]] name = "strsim" version = "0.8.0" @@ -1032,6 +3208,40 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", +] + +[[package]] +name = "tempfile" +version = "3.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22e5a0acb1f3f55f65cc4a866c361b2fb2a0ff6366785ae6fbb5f85df07ba230" +dependencies = [ + "cfg-if", + "fastrand", + "getrandom 0.3.1", + "once_cell", + "rustix", + "windows-sys 0.59.0", +] + +[[package]] +name = "termcolor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +dependencies = [ + "winapi-util", +] + [[package]] name = "textwrap" version = "0.11.0" @@ -1061,6 +3271,41 @@ dependencies = [ "syn 2.0.96", ] +[[package]] +name = "tiny-skia" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83d13394d44dae3207b52a326c0c85a8bf87f1541f23b0d143811088497b09ab" +dependencies = [ + "arrayref", + "arrayvec", + "bytemuck", + "cfg-if", + "log", + "tiny-skia-path", +] + +[[package]] +name = "tiny-skia-path" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c9e7fc0c2e86a30b117d0462aa261b72b7a99b7ebd7deb3a14ceda95c5bdc93" +dependencies = [ + "arrayref", + "bytemuck", + "strict-num", +] + +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + [[package]] name = "tokio" version = "1.43.0" @@ -1107,6 +3352,37 @@ dependencies = [ "winnow", ] +[[package]] +name = "tracing" +version = "0.1.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", +] + +[[package]] +name = "tracing-core" +version = "0.1.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" +dependencies = [ + "once_cell", +] + [[package]] name = "transpose" version = "0.2.3" @@ -1117,12 +3393,44 @@ dependencies = [ "strength_reduce", ] +[[package]] +name = "ttf-parser" +version = "0.25.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2df906b07856748fa3f6e0ad0cbaa047052d4a7dd609e231c4f72cee8c36f31" + +[[package]] +name = "type-map" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "deb68604048ff8fa93347f02441e4487594adc20bb8a084f9e564d2b827a0a9f" +dependencies = [ + "rustc-hash", +] + [[package]] name = "typenum" version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +[[package]] +name = "uds_windows" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89daebc3e6fd160ac4aa9fc8b3bf71e1f74fbf92367ae71fb83a037e8bf164b9" +dependencies = [ + "memoffset", + "tempfile", + "winapi", +] + +[[package]] +name = "unicase" +version = "2.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75b844d17643ee918803943289730bec8aac480150456169e647ed0b576ba539" + [[package]] name = "unicode-ident" version = "1.0.14" @@ -1141,6 +3449,35 @@ version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + +[[package]] +name = "url" +version = "2.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + [[package]] name = "vec_map" version = "0.8.2" @@ -1169,6 +3506,15 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +[[package]] +name = "wasi" +version = "0.13.3+wasi-0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26816d2e1a4a36a2940b96c5296ce403917633dff8f3440e9b236ed6f6bacad2" +dependencies = [ + "wit-bindgen-rt", +] + [[package]] name = "wasm-bindgen" version = "0.2.100" @@ -1240,6 +3586,115 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "wayland-backend" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7208998eaa3870dad37ec8836979581506e0c5c64c20c9e79e9d2a10d6f47bf" +dependencies = [ + "cc", + "downcast-rs", + "rustix", + "scoped-tls", + "smallvec", + "wayland-sys", +] + +[[package]] +name = "wayland-client" +version = "0.31.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2120de3d33638aaef5b9f4472bff75f07c56379cf76ea320bd3a3d65ecaf73f" +dependencies = [ + "bitflags 2.8.0", + "rustix", + "wayland-backend", + "wayland-scanner", +] + +[[package]] +name = "wayland-csd-frame" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "625c5029dbd43d25e6aa9615e88b829a5cad13b2819c4ae129fdbb7c31ab4c7e" +dependencies = [ + "bitflags 2.8.0", + "cursor-icon", + "wayland-backend", +] + +[[package]] +name = "wayland-cursor" +version = "0.31.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a93029cbb6650748881a00e4922b076092a6a08c11e7fbdb923f064b23968c5d" +dependencies = [ + "rustix", + "wayland-client", + "xcursor", +] + +[[package]] +name = "wayland-protocols" +version = "0.32.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0781cf46869b37e36928f7b432273c0995aa8aed9552c556fb18754420541efc" +dependencies = [ + "bitflags 2.8.0", + "wayland-backend", + "wayland-client", + "wayland-scanner", +] + +[[package]] +name = "wayland-protocols-plasma" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ccaacc76703fefd6763022ac565b590fcade92202492381c95b2edfdf7d46b3" +dependencies = [ + "bitflags 2.8.0", + "wayland-backend", + "wayland-client", + "wayland-protocols", + "wayland-scanner", +] + +[[package]] +name = "wayland-protocols-wlr" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "248a02e6f595aad796561fa82d25601bd2c8c3b145b1c7453fc8f94c1a58f8b2" +dependencies = [ + "bitflags 2.8.0", + "wayland-backend", + "wayland-client", + "wayland-protocols", + "wayland-scanner", +] + +[[package]] +name = "wayland-scanner" +version = "0.31.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "896fdafd5d28145fce7958917d69f2fd44469b1d4e861cb5961bcbeebc6d1484" +dependencies = [ + "proc-macro2", + "quick-xml 0.37.2", + "quote", +] + +[[package]] +name = "wayland-sys" +version = "0.31.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbcebb399c77d5aa9fa5db874806ee7b4eba4e73650948e8f93963f128896615" +dependencies = [ + "dlib", + "log", + "once_cell", + "pkg-config", +] + [[package]] name = "web-sys" version = "0.3.77" @@ -1250,6 +3705,134 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "web-time" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webbrowser" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea9fe1ebb156110ff855242c1101df158b822487e4957b0556d9ffce9db0f535" +dependencies = [ + "block2", + "core-foundation 0.10.0", + "home", + "jni", + "log", + "ndk-context", + "objc2", + "objc2-foundation", + "url", + "web-sys", +] + +[[package]] +name = "wgpu" +version = "23.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80f70000db37c469ea9d67defdc13024ddf9a5f1b89cb2941b812ad7cde1735a" +dependencies = [ + "arrayvec", + "cfg_aliases 0.1.1", + "document-features", + "js-sys", + "log", + "parking_lot", + "profiling", + "raw-window-handle", + "smallvec", + "static_assertions", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "wgpu-core", + "wgpu-hal", + "wgpu-types", +] + +[[package]] +name = "wgpu-core" +version = "23.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d63c3c478de8e7e01786479919c8769f62a22eec16788d8c2ac77ce2c132778a" +dependencies = [ + "arrayvec", + "bit-vec", + "bitflags 2.8.0", + "cfg_aliases 0.1.1", + "document-features", + "indexmap", + "log", + "naga", + "once_cell", + "parking_lot", + "profiling", + "raw-window-handle", + "rustc-hash", + "smallvec", + "thiserror", + "wgpu-hal", + "wgpu-types", +] + +[[package]] +name = "wgpu-hal" +version = "23.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89364b8a0b211adc7b16aeaf1bd5ad4a919c1154b44c9ce27838213ba05fd821" +dependencies = [ + "android_system_properties", + "arrayvec", + "ash", + "bitflags 2.8.0", + "bytemuck", + "cfg_aliases 0.1.1", + "core-graphics-types", + "glow 0.14.2", + "glutin_wgl_sys", + "gpu-alloc", + "gpu-descriptor", + "js-sys", + "khronos-egl", + "libc", + "libloading", + "log", + "metal", + "naga", + "ndk-sys 0.5.0+25.2.9519653", + "objc", + "once_cell", + "parking_lot", + "profiling", + "raw-window-handle", + "renderdoc-sys", + "rustc-hash", + "smallvec", + "thiserror", + "wasm-bindgen", + "web-sys", + "wgpu-types", + "windows 0.58.0", +] + +[[package]] +name = "wgpu-types" +version = "23.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "610f6ff27778148c31093f3b03abc4840f9636d58d597ca2f5977433acfe0068" +dependencies = [ + "bitflags 2.8.0", + "js-sys", + "web-sys", +] + [[package]] name = "winapi" version = "0.3.9" @@ -1287,7 +3870,17 @@ version = "0.54.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9252e5725dbed82865af151df558e754e4a3c2c30818359eb17465f1346a1b49" dependencies = [ - "windows-core", + "windows-core 0.54.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd04d41d93c4992d421894c18c8b43496aa748dd4c081bac0dc93eb0489272b6" +dependencies = [ + "windows-core 0.58.0", "windows-targets 0.52.6", ] @@ -1297,10 +3890,45 @@ version = "0.54.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12661b9c89351d684a50a8a643ce5f608e20243b9fb84687800163429f161d65" dependencies = [ - "windows-result", + "windows-result 0.1.2", "windows-targets 0.52.6", ] +[[package]] +name = "windows-core" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ba6d44ec8c2591c134257ce647b7ea6b20335bf6379a27dac5f1641fcf59f99" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-result 0.2.0", + "windows-strings", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-implement" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", +] + +[[package]] +name = "windows-interface" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", +] + [[package]] name = "windows-result" version = "0.1.2" @@ -1310,6 +3938,25 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-result" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-strings" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" +dependencies = [ + "windows-result 0.2.0", + "windows-targets 0.52.6", +] + [[package]] name = "windows-sys" version = "0.45.0" @@ -1352,6 +3999,21 @@ dependencies = [ "windows_x86_64_msvc 0.42.2", ] +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + [[package]] name = "windows-targets" version = "0.52.6" @@ -1374,6 +4036,12 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + [[package]] name = "windows_aarch64_gnullvm" version = "0.52.6" @@ -1386,6 +4054,12 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + [[package]] name = "windows_aarch64_msvc" version = "0.52.6" @@ -1398,6 +4072,12 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + [[package]] name = "windows_i686_gnu" version = "0.52.6" @@ -1416,6 +4096,12 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + [[package]] name = "windows_i686_msvc" version = "0.52.6" @@ -1428,6 +4114,12 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + [[package]] name = "windows_x86_64_gnu" version = "0.52.6" @@ -1440,6 +4132,12 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + [[package]] name = "windows_x86_64_gnullvm" version = "0.52.6" @@ -1452,12 +4150,70 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + [[package]] name = "windows_x86_64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +[[package]] +name = "winit" +version = "0.30.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a809eacf18c8eca8b6635091543f02a5a06ddf3dad846398795460e6e0ae3cc0" +dependencies = [ + "ahash", + "android-activity", + "atomic-waker", + "bitflags 2.8.0", + "block2", + "bytemuck", + "calloop", + "cfg_aliases 0.2.1", + "concurrent-queue", + "core-foundation 0.9.4", + "core-graphics", + "cursor-icon", + "dpi", + "js-sys", + "libc", + "memmap2", + "ndk 0.9.0", + "objc2", + "objc2-app-kit", + "objc2-foundation", + "objc2-ui-kit", + "orbclient", + "percent-encoding", + "pin-project", + "raw-window-handle", + "redox_syscall 0.4.1", + "rustix", + "sctk-adwaita", + "smithay-client-toolkit", + "smol_str", + "tracing", + "unicode-segmentation", + "wasm-bindgen", + "wasm-bindgen-futures", + "wayland-backend", + "wayland-client", + "wayland-protocols", + "wayland-protocols-plasma", + "web-sys", + "web-time", + "windows-sys 0.52.0", + "x11-dl", + "x11rb", + "xkbcommon-dl", +] + [[package]] name = "winnow" version = "0.6.24" @@ -1466,3 +4222,321 @@ checksum = "c8d71a593cc5c42ad7876e2c1fda56f314f3754c084128833e64f1345ff8a03a" dependencies = [ "memchr", ] + +[[package]] +name = "wit-bindgen-rt" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c" +dependencies = [ + "bitflags 2.8.0", +] + +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + +[[package]] +name = "x11-dl" +version = "2.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38735924fedd5314a6e548792904ed8c6de6636285cb9fec04d5b1db85c1516f" +dependencies = [ + "libc", + "once_cell", + "pkg-config", +] + +[[package]] +name = "x11rb" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d91ffca73ee7f68ce055750bf9f6eca0780b8c85eff9bc046a3b0da41755e12" +dependencies = [ + "as-raw-xcb-connection", + "gethostname", + "libc", + "libloading", + "once_cell", + "rustix", + "x11rb-protocol", +] + +[[package]] +name = "x11rb-protocol" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec107c4503ea0b4a98ef47356329af139c0a4f7750e621cf2973cd3385ebcb3d" + +[[package]] +name = "xcursor" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ef33da6b1660b4ddbfb3aef0ade110c8b8a781a3b6382fa5f2b5b040fd55f61" + +[[package]] +name = "xdg-home" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec1cdab258fb55c0da61328dc52c8764709b249011b2cad0454c72f0bf10a1f6" +dependencies = [ + "libc", + "windows-sys 0.59.0", +] + +[[package]] +name = "xkbcommon-dl" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d039de8032a9a8856a6be89cea3e5d12fdd82306ab7c94d74e6deab2460651c5" +dependencies = [ + "bitflags 2.8.0", + "dlib", + "log", + "once_cell", + "xkeysym", +] + +[[package]] +name = "xkeysym" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9cc00251562a284751c9973bace760d86c0276c471b4be569fe6b068ee97a56" + +[[package]] +name = "xml-rs" +version = "0.8.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5b940ebc25896e71dd073bad2dbaa2abfe97b0a391415e22ad1326d9c54e3c4" + +[[package]] +name = "yoke" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", + "synstructure", +] + +[[package]] +name = "zbus" +version = "4.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb97012beadd29e654708a0fdb4c84bc046f537aecfde2c3ee0a9e4b4d48c725" +dependencies = [ + "async-broadcast", + "async-executor", + "async-fs", + "async-io", + "async-lock", + "async-process", + "async-recursion", + "async-task", + "async-trait", + "blocking", + "enumflags2", + "event-listener", + "futures-core", + "futures-sink", + "futures-util", + "hex", + "nix", + "ordered-stream", + "rand", + "serde", + "serde_repr", + "sha1", + "static_assertions", + "tracing", + "uds_windows", + "windows-sys 0.52.0", + "xdg-home", + "zbus_macros", + "zbus_names", + "zvariant", +] + +[[package]] +name = "zbus-lockstep" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ca2c5dceb099bddaade154055c926bb8ae507a18756ba1d8963fd7b51d8ed1d" +dependencies = [ + "zbus_xml", + "zvariant", +] + +[[package]] +name = "zbus-lockstep-macros" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "709ab20fc57cb22af85be7b360239563209258430bccf38d8b979c5a2ae3ecce" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", + "zbus-lockstep", + "zbus_xml", + "zvariant", +] + +[[package]] +name = "zbus_macros" +version = "4.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "267db9407081e90bbfa46d841d3cbc60f59c0351838c4bc65199ecd79ab1983e" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.96", + "zvariant_utils", +] + +[[package]] +name = "zbus_names" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b9b1fef7d021261cc16cba64c351d291b715febe0fa10dc3a443ac5a5022e6c" +dependencies = [ + "serde", + "static_assertions", + "zvariant", +] + +[[package]] +name = "zbus_xml" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab3f374552b954f6abb4bd6ce979e6c9b38fb9d0cd7cc68a7d796e70c9f3a233" +dependencies = [ + "quick-xml 0.30.0", + "serde", + "static_assertions", + "zbus_names", + "zvariant", +] + +[[package]] +name = "zerocopy" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +dependencies = [ + "byteorder", + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", +] + +[[package]] +name = "zerofrom" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", + "synstructure", +] + +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", +] + +[[package]] +name = "zvariant" +version = "4.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2084290ab9a1c471c38fc524945837734fbf124487e105daec2bb57fd48c81fe" +dependencies = [ + "endi", + "enumflags2", + "serde", + "static_assertions", + "zvariant_derive", +] + +[[package]] +name = "zvariant_derive" +version = "4.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73e2ba546bda683a90652bac4a279bc146adad1386f25379cf73200d2002c449" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.96", + "zvariant_utils", +] + +[[package]] +name = "zvariant_utils" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c51bcff7cc3dbb5055396bcf774748c3dab426b4b8659046963523cee4808340" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", +] diff --git a/interface/Cargo.toml b/interface/Cargo.toml index ea88d89..af8d6b2 100644 --- a/interface/Cargo.toml +++ b/interface/Cargo.toml @@ -13,3 +13,7 @@ serde = "1.0.217" tokio = { version = "1.43.0", features = ["full"] } common = {path = "../common"} heapless = "0.7.0" + +eframe = "0.30" +egui_extras = { version = "0.30", features = ["default", "image"] } +egui-toast = "0.16.0" diff --git a/interface/src/gui.rs b/interface/src/gui.rs new file mode 100644 index 0000000..4f74cc3 --- /dev/null +++ b/interface/src/gui.rs @@ -0,0 +1,59 @@ + +use common::{ControlPacket, TelemetryPacket}; +use eframe::egui::{self, Align2}; +use tokio::sync::{mpsc, watch::Receiver}; +use egui_toast::{Toast, Toasts}; + +pub fn gui(data: Receiver, toasts: mpsc::Receiver) -> eframe::Result { + let options = eframe::NativeOptions { + viewport: egui::ViewportBuilder::default().with_inner_size([320.0, 240.0]), + ..Default::default() + }; + eframe::run_native( + "Cruise Control Dashboard", + options, + Box::new(|cc| { + // This gives us image support: + egui_extras::install_image_loaders(&cc.egui_ctx); + + Ok(Box::new(GUI::with_receivers(data, toasts))) + }), + ) +} + +#[derive(Default)] +pub struct GUIData { + pub telemetry: Option, + pub last_command: Option, +} + +struct GUI { + data: Receiver, + toasts: mpsc::Receiver, +} + +impl GUI { + fn with_receivers(data: Receiver, toasts: mpsc::Receiver) -> Self { + Self { + data, + toasts, + } + } +} + +impl eframe::App for GUI { + fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) { + egui::CentralPanel::default().show(ctx, |ui| { + ui.heading("Cruise Control"); + }); + let mut toasts = Toasts::new() + .anchor(Align2::RIGHT_BOTTOM, (-10.0, -10.0)) // 10 units from the bottom right corner + .direction(egui::Direction::BottomUp); + + while let Ok(toast) = self.toasts.try_recv() { + toasts.add(toast); + } + + toasts.show(ctx); + } +} diff --git a/interface/src/main.rs b/interface/src/main.rs index fa62783..3cf1423 100644 --- a/interface/src/main.rs +++ b/interface/src/main.rs @@ -1,12 +1,17 @@ +#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] #![feature(iter_collect_into)] -use std::{ops::ControlFlow, result, sync::Arc, thread::sleep, time::Duration}; +use std::{ops::ControlFlow, result, sync::Arc, thread::{self, sleep}, time::Duration}; use anyhow::{Context, Ok, Result}; use common::{ControlPacket, TelemetryPacket}; use cpal::traits::{DeviceTrait, HostTrait, StreamTrait}; +use egui_toast::{Toast, ToastKind}; +use gui::{gui, GUIData}; use pitch_detection::{detector::{mcleod::McLeodDetector, PitchDetector}, utils}; use rust_music_theory::note::{Note, NoteLetter, Pitch, Tuning}; -use tokio::{io::{AsyncReadExt, AsyncWriteExt, BufWriter, WriteHalf}, net::{tcp::{OwnedReadHalf, OwnedWriteHalf}, TcpStream}, spawn, sync::{self, mpsc, RwLock}, time::timeout}; +use tokio::{io::{AsyncReadExt, AsyncWriteExt, BufWriter, WriteHalf}, net::{tcp::{OwnedReadHalf, OwnedWriteHalf}, TcpStream}, spawn, sync::{self, mpsc, watch, RwLock}, time::timeout}; + +mod gui; fn main() -> Result<()> { // assumes pulseaudio system with f32 samples and 2204 sample packets @@ -45,26 +50,36 @@ fn main() -> Result<()> { //let latest_telem = Arc::new(RwLock::new(None)); - let control = executor.block_on(async { - let cruisecontrol = TcpStream::connect("192.168.1.2:1234").await?; - println!("connected"); - cruisecontrol.set_nodelay(true)?; - let (telem, control) = cruisecontrol.into_split(); - - tokio::spawn(telemetry_handler(telem)); - - Ok(control) - })?; + let (toast_sender, toasts) = mpsc::channel(5); + let (data_sender, gui_data) =watch::channel(GUIData::default()); - executor.block_on(controller(notes, control)).unwrap(); + thread::spawn(move || { + let control = executor.block_on(async { + toast_sender.send(Toast::new().text("connecting to bot").kind(ToastKind::Info)).await.unwrap(); + let cruisecontrol = TcpStream::connect("192.168.1.2:1234").await?; + println!("connected"); + toast_sender.send(Toast::new().text("connected").kind(ToastKind::Success)).await.unwrap(); + cruisecontrol.set_nodelay(true)?; + let (telem, control) = cruisecontrol.into_split(); + + tokio::spawn(telemetry_handler(telem, data_sender.clone())); + + Ok(control) + }).unwrap(); + + executor.block_on(controller(notes, control)).unwrap() + }); + + println!("launching gui"); + gui(gui_data, toasts).unwrap(); drop(stream); Ok(()) } -async fn telemetry_handler(mut telem: OwnedReadHalf) -> Result<()> { +async fn telemetry_handler(mut telem: OwnedReadHalf, gui: watch::Sender) -> Result<()> { let mut buf = vec![0; 2048]; loop { let len = telem.read_u32().await.context("bad length")? as usize; @@ -74,6 +89,9 @@ async fn telemetry_handler(mut telem: OwnedReadHalf) -> Result<()> { println!("telem: {telem:?}"); + gui.send_modify(|gui| { + gui.telemetry = Some(telem); + }); } } From bb974c2015dc5fdef4ee64edb43ba92235a496b7 Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Thu, 6 Mar 2025 12:17:13 -0500 Subject: [PATCH 34/69] send tof status to gui --- common/src/lib.rs | 2 +- interface/src/gui.rs | 19 ++++++++++++++++++- interface/src/main.rs | 12 ++++++++---- 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/common/src/lib.rs b/common/src/lib.rs index f09af96..13791c5 100644 --- a/common/src/lib.rs +++ b/common/src/lib.rs @@ -6,7 +6,7 @@ use serde::{Deserialize, Serialize}; /// -1..1 pub type Speed = f32; -#[derive(Serialize, Deserialize, Debug)] +#[derive(Serialize, Deserialize, Debug, Clone)] pub enum ControlPacket { /// Forward, Clockwise Twist(Speed, Speed), diff --git a/interface/src/gui.rs b/interface/src/gui.rs index 4f74cc3..2d5596f 100644 --- a/interface/src/gui.rs +++ b/interface/src/gui.rs @@ -1,9 +1,13 @@ +use std::cell::OnceCell; + use common::{ControlPacket, TelemetryPacket}; -use eframe::egui::{self, Align2}; +use eframe::egui::{self, containers, Align2, Checkbox, Context, Label}; use tokio::sync::{mpsc, watch::Receiver}; use egui_toast::{Toast, Toasts}; +pub const GUI: OnceCell = OnceCell::new(); + pub fn gui(data: Receiver, toasts: mpsc::Receiver) -> eframe::Result { let options = eframe::NativeOptions { viewport: egui::ViewportBuilder::default().with_inner_size([320.0, 240.0]), @@ -43,8 +47,21 @@ impl GUI { impl eframe::App for GUI { fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) { + let _ = GUI.set(ctx.clone()); egui::CentralPanel::default().show(ctx, |ui| { ui.heading("Cruise Control"); + + if let Some(ref command) = self.data.borrow().last_command { + ui.label(format!("sending {command:?}")); + } + if let Some(ref telem) = self.data.borrow().telemetry { + ui.label(format!("Left tof: {}", if let Some(tof) = telem.sensors.tof_l {format!("✅ {tof}mm")} else {"❌".into()})); + ui.label(format!("Right tof: {}", if let Some(tof) = telem.sensors.tof_r {format!("✅ {tof}mm")} else {"❌".into()})); + ui.label(format!("Side tof: {}", if let Some(tof) = telem.sensors.tof_s {format!("✅ {tof}mm")} else {"❌".into()})); + ui.label(format!("Gyro: {}", if telem.sensors.gyro.is_some() {"✅"} else {"❌"})); + } else { + ui.label("disconnected"); + } }); let mut toasts = Toasts::new() .anchor(Align2::RIGHT_BOTTOM, (-10.0, -10.0)) // 10 units from the bottom right corner diff --git a/interface/src/main.rs b/interface/src/main.rs index 3cf1423..dca7b64 100644 --- a/interface/src/main.rs +++ b/interface/src/main.rs @@ -6,7 +6,7 @@ use anyhow::{Context, Ok, Result}; use common::{ControlPacket, TelemetryPacket}; use cpal::traits::{DeviceTrait, HostTrait, StreamTrait}; use egui_toast::{Toast, ToastKind}; -use gui::{gui, GUIData}; +use gui::{gui, GUIData, GUI}; use pitch_detection::{detector::{mcleod::McLeodDetector, PitchDetector}, utils}; use rust_music_theory::note::{Note, NoteLetter, Pitch, Tuning}; use tokio::{io::{AsyncReadExt, AsyncWriteExt, BufWriter, WriteHalf}, net::{tcp::{OwnedReadHalf, OwnedWriteHalf}, TcpStream}, spawn, sync::{self, mpsc, watch, RwLock}, time::timeout}; @@ -68,7 +68,7 @@ fn main() -> Result<()> { Ok(control) }).unwrap(); - executor.block_on(controller(notes, control)).unwrap() + executor.block_on(controller(notes, control, data_sender.clone())).unwrap() }); println!("launching gui"); @@ -92,10 +92,11 @@ async fn telemetry_handler(mut telem: OwnedReadHalf, gui: watch::Sender gui.send_modify(|gui| { gui.telemetry = Some(telem); }); + GUI.get().map(|c| c.request_repaint()); } } -async fn controller(mut notes: mpsc::Receiver<(Option>, f32)>, controller: OwnedWriteHalf) -> Result<()> { +async fn controller(mut notes: mpsc::Receiver<(Option>, f32)>, controller: OwnedWriteHalf, gui: watch::Sender) -> Result<()> { let mut controller = BufWriter::new(controller); //send_packet(&mut controller, ControlPacket::Arm(true)).await?; //println!("armed flipper"); @@ -123,10 +124,13 @@ async fn controller(mut notes: mpsc::Receiver<(Option Date: Thu, 6 Mar 2025 17:09:37 -0500 Subject: [PATCH 35/69] adapt to windows audio quirks (virtualbox ones at least) --- interface/src/gui.rs | 2 ++ interface/src/main.rs | 10 +++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/interface/src/gui.rs b/interface/src/gui.rs index 2d5596f..a9ace36 100644 --- a/interface/src/gui.rs +++ b/interface/src/gui.rs @@ -59,6 +59,8 @@ impl eframe::App for GUI { ui.label(format!("Right tof: {}", if let Some(tof) = telem.sensors.tof_r {format!("✅ {tof}mm")} else {"❌".into()})); ui.label(format!("Side tof: {}", if let Some(tof) = telem.sensors.tof_s {format!("✅ {tof}mm")} else {"❌".into()})); ui.label(format!("Gyro: {}", if telem.sensors.gyro.is_some() {"✅"} else {"❌"})); + + ui.label(format!("Cam: {:?}", telem.cam_state)); } else { ui.label("disconnected"); } diff --git a/interface/src/main.rs b/interface/src/main.rs index dca7b64..d3b3841 100644 --- a/interface/src/main.rs +++ b/interface/src/main.rs @@ -1,4 +1,3 @@ -#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] #![feature(iter_collect_into)] use std::{ops::ControlFlow, result, sync::Arc, thread::{self, sleep}, time::Duration}; @@ -17,8 +16,14 @@ fn main() -> Result<()> { // assumes pulseaudio system with f32 samples and 2204 sample packets dbg!(cpal::available_hosts()); let host = cpal::default_host(); + #[cfg(target_os = "windows")] + let Some(device) = host.devices().unwrap().filter(|device| device.supported_input_configs().unwrap().count() != 0).next() else { + panic!("no input devices") + }; + #[cfg(target_os = "linux")] let device = host.devices().unwrap().find(|d|d.name().unwrap() == "pulse").context("no pulse")?; + let config = device.default_input_config()?; dbg!(config.sample_format()); @@ -28,7 +33,10 @@ fn main() -> Result<()> { const POWER_THRESHOLD: f32 = 5.0; const CLARITY_THRESHOLD: f32 = 0.85; + #[cfg(target_os = "linux")] const PACKET_LEN: usize = 2204; + #[cfg(target_os = "windows")] + const PACKET_LEN: usize = 512; let stream = device.build_input_stream(&config.into(), move | data: &[f32], _: &_| { From cf0a6b94d7693fd42fa7c339b155a82bf6eea8cb Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Thu, 6 Mar 2025 20:24:14 -0500 Subject: [PATCH 36/69] buffer received samples until they hit the analysis threshold --- interface/src/main.rs | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/interface/src/main.rs b/interface/src/main.rs index d3b3841..dcb0351 100644 --- a/interface/src/main.rs +++ b/interface/src/main.rs @@ -31,15 +31,34 @@ fn main() -> Result<()> { let (sender, notes) = mpsc::channel(2); + #[cfg(target_os = "linux")] const POWER_THRESHOLD: f32 = 5.0; + #[cfg(target_os = "windows")] + const POWER_THRESHOLD: f32 = 1.0; const CLARITY_THRESHOLD: f32 = 0.85; #[cfg(target_os = "linux")] const PACKET_LEN: usize = 2204; #[cfg(target_os = "windows")] - const PACKET_LEN: usize = 512; + const PACKET_LEN: usize = 2000; + + let mut packet = Vec::new(); let stream = device.build_input_stream(&config.into(), move | data: &[f32], _: &_| { + let mut data = data; + + if packet.len() > PACKET_LEN { + packet.clear(); + } + + if data.len() <= PACKET_LEN { + packet.extend_from_slice(data); + if packet.len() > PACKET_LEN { + data = &packet; + } else { + return; + } + } assert!(data.len() >= PACKET_LEN); let data = &data[..PACKET_LEN]; From 0bef5cc6e71aa766ad1ce2486b6c4d5778747506 Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Thu, 6 Mar 2025 20:33:23 -0500 Subject: [PATCH 37/69] tuned windows sampling settings for stability --- interface/src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/interface/src/main.rs b/interface/src/main.rs index dcb0351..fd394ac 100644 --- a/interface/src/main.rs +++ b/interface/src/main.rs @@ -39,7 +39,7 @@ fn main() -> Result<()> { #[cfg(target_os = "linux")] const PACKET_LEN: usize = 2204; #[cfg(target_os = "windows")] - const PACKET_LEN: usize = 2000; + const PACKET_LEN: usize = 1800; let mut packet = Vec::new(); @@ -136,7 +136,7 @@ async fn controller(mut notes: mpsc::Receiver<(Option Date: Sat, 8 Mar 2025 02:04:06 -0500 Subject: [PATCH 38/69] handle close requests (slightly bodgey) --- interface/src/gui.rs | 20 ++++++++++++++------ interface/src/main.rs | 7 ++++--- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/interface/src/gui.rs b/interface/src/gui.rs index a9ace36..205622a 100644 --- a/interface/src/gui.rs +++ b/interface/src/gui.rs @@ -1,16 +1,18 @@ -use std::cell::OnceCell; +use std::{cell::OnceCell, time::Duration}; use common::{ControlPacket, TelemetryPacket}; use eframe::egui::{self, containers, Align2, Checkbox, Context, Label}; -use tokio::sync::{mpsc, watch::Receiver}; +use tokio::{runtime::Runtime, sync::{mpsc, watch::Receiver}}; use egui_toast::{Toast, Toasts}; pub const GUI: OnceCell = OnceCell::new(); -pub fn gui(data: Receiver, toasts: mpsc::Receiver) -> eframe::Result { +pub fn gui(data: Receiver, toasts: mpsc::Receiver, executor: Runtime) -> eframe::Result { let options = eframe::NativeOptions { - viewport: egui::ViewportBuilder::default().with_inner_size([320.0, 240.0]), + viewport: egui::ViewportBuilder::default() + .with_inner_size([700.0, 480.0]) + .with_app_id("cruisecontrol"), ..Default::default() }; eframe::run_native( @@ -20,7 +22,7 @@ pub fn gui(data: Receiver, toasts: mpsc::Receiver) -> eframe::Re // This gives us image support: egui_extras::install_image_loaders(&cc.egui_ctx); - Ok(Box::new(GUI::with_receivers(data, toasts))) + Ok(Box::new(GUI::with_receivers(data, toasts, executor))) }), ) } @@ -34,13 +36,15 @@ pub struct GUIData { struct GUI { data: Receiver, toasts: mpsc::Receiver, + executor: Option, } impl GUI { - fn with_receivers(data: Receiver, toasts: mpsc::Receiver) -> Self { + fn with_receivers(data: Receiver, toasts: mpsc::Receiver, executor: Runtime) -> Self { Self { data, toasts, + executor: Some(executor), } } } @@ -74,5 +78,9 @@ impl eframe::App for GUI { } toasts.show(ctx); + + if ctx.input(|i| i.viewport().close_requested()) { + self.executor.take().unwrap().shutdown_timeout(Duration::from_millis(100)); + } } } diff --git a/interface/src/main.rs b/interface/src/main.rs index fd394ac..7d8a0aa 100644 --- a/interface/src/main.rs +++ b/interface/src/main.rs @@ -81,8 +81,9 @@ fn main() -> Result<()> { let (data_sender, gui_data) =watch::channel(GUIData::default()); + let spawner = executor.handle().clone(); thread::spawn(move || { - let control = executor.block_on(async { + let control = spawner.block_on(async { toast_sender.send(Toast::new().text("connecting to bot").kind(ToastKind::Info)).await.unwrap(); let cruisecontrol = TcpStream::connect("192.168.1.2:1234").await?; println!("connected"); @@ -95,11 +96,11 @@ fn main() -> Result<()> { Ok(control) }).unwrap(); - executor.block_on(controller(notes, control, data_sender.clone())).unwrap() + spawner.block_on(controller(notes, control, data_sender.clone())).unwrap() }); println!("launching gui"); - gui(gui_data, toasts).unwrap(); + gui(gui_data, toasts, executor).unwrap(); drop(stream); From d448f05dd7946309d1d4123a3fc2b6f9544421ce Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Sat, 8 Mar 2025 08:32:03 -0500 Subject: [PATCH 39/69] interface retries and error logging --- interface/src/main.rs | 73 ++++++++++++++++++++++++++----------------- 1 file changed, 44 insertions(+), 29 deletions(-) diff --git a/interface/src/main.rs b/interface/src/main.rs index 7d8a0aa..354af73 100644 --- a/interface/src/main.rs +++ b/interface/src/main.rs @@ -1,5 +1,5 @@ #![feature(iter_collect_into)] -use std::{ops::ControlFlow, result, sync::Arc, thread::{self, sleep}, time::Duration}; +use std::{fmt::format, ops::ControlFlow, result, sync::Arc, thread::{self, sleep}, time::Duration}; use anyhow::{Context, Ok, Result}; use common::{ControlPacket, TelemetryPacket}; @@ -8,7 +8,7 @@ use egui_toast::{Toast, ToastKind}; use gui::{gui, GUIData, GUI}; use pitch_detection::{detector::{mcleod::McLeodDetector, PitchDetector}, utils}; use rust_music_theory::note::{Note, NoteLetter, Pitch, Tuning}; -use tokio::{io::{AsyncReadExt, AsyncWriteExt, BufWriter, WriteHalf}, net::{tcp::{OwnedReadHalf, OwnedWriteHalf}, TcpStream}, spawn, sync::{self, mpsc, watch, RwLock}, time::timeout}; +use tokio::{io::{AsyncReadExt, AsyncWriteExt, BufWriter, WriteHalf}, net::{tcp::{OwnedReadHalf, OwnedWriteHalf}, TcpStream}, spawn, sync::{self, broadcast, mpsc, watch, RwLock}, time::timeout}; mod gui; @@ -29,7 +29,7 @@ fn main() -> Result<()> { dbg!(config.sample_format()); let rate = config.sample_rate(); - let (sender, notes) = mpsc::channel(2); + let (sender, notes) = broadcast::channel(2); #[cfg(target_os = "linux")] const POWER_THRESHOLD: f32 = 5.0; @@ -65,7 +65,9 @@ fn main() -> Result<()> { // reinitialized every packet as it is not thread safe let mut detctor = McLeodDetector::new(PACKET_LEN, PACKET_LEN/2); let vol = utils::buffer::square_sum(data); - sender.blocking_send((detctor.get_pitch(data, rate.0 as usize, POWER_THRESHOLD, CLARITY_THRESHOLD),vol)).unwrap(); + if let Err(e) = sender.send((detctor.get_pitch(data, rate.0 as usize, POWER_THRESHOLD, CLARITY_THRESHOLD).map(|p|p.frequency),vol)) { + println!("channel: {e}"); + } }, move |err| {eprintln!("{err}")} , @@ -83,20 +85,16 @@ fn main() -> Result<()> { let spawner = executor.handle().clone(); thread::spawn(move || { - let control = spawner.block_on(async { - toast_sender.send(Toast::new().text("connecting to bot").kind(ToastKind::Info)).await.unwrap(); - let cruisecontrol = TcpStream::connect("192.168.1.2:1234").await?; - println!("connected"); - toast_sender.send(Toast::new().text("connected").kind(ToastKind::Success)).await.unwrap(); - cruisecontrol.set_nodelay(true)?; - let (telem, control) = cruisecontrol.into_split(); + spawner.block_on(async { + loop { + if let Err(e) = connect(toast_sender.clone(), notes.resubscribe(), data_sender.clone()).await { + if let Err(_) = toast_sender.send(Toast::new().text(format!("{e:?}")).kind(ToastKind::Error)).await { + break; + }; + } + } + }); - tokio::spawn(telemetry_handler(telem, data_sender.clone())); - - Ok(control) - }).unwrap(); - - spawner.block_on(controller(notes, control, data_sender.clone())).unwrap() }); println!("launching gui"); @@ -107,6 +105,23 @@ fn main() -> Result<()> { Ok(()) } +/// frequency, volume +type Detection = (Option, f32); + +async fn connect(toast_sender: mpsc::Sender, notes: broadcast::Receiver, data_sender: watch::Sender) -> Result<()>{ + toast_sender.send(Toast::new().text("connecting to bot").kind(ToastKind::Info)).await?; + let cruisecontrol = TcpStream::connect("192.168.1.2:1234").await?; + println!("connected"); + toast_sender.send(Toast::new().text("connected").kind(ToastKind::Success)).await?; + cruisecontrol.set_nodelay(true)?; + let (telem, control) = cruisecontrol.into_split(); + + tokio::spawn(telemetry_handler(telem, data_sender.clone())); + + controller(notes, control, data_sender.clone()).await?; + Ok(()) +} + async fn telemetry_handler(mut telem: OwnedReadHalf, gui: watch::Sender) -> Result<()> { let mut buf = vec![0; 2048]; loop { @@ -115,7 +130,7 @@ async fn telemetry_handler(mut telem: OwnedReadHalf, gui: watch::Sender telem.read_exact(data).await?; let telem: TelemetryPacket = postcard::from_bytes(&data)?; - println!("telem: {telem:?}"); + //println!("telem: {telem:?}"); gui.send_modify(|gui| { gui.telemetry = Some(telem); @@ -124,7 +139,7 @@ async fn telemetry_handler(mut telem: OwnedReadHalf, gui: watch::Sender } } -async fn controller(mut notes: mpsc::Receiver<(Option>, f32)>, controller: OwnedWriteHalf, gui: watch::Sender) -> Result<()> { +async fn controller(mut notes: broadcast::Receiver, controller: OwnedWriteHalf, gui: watch::Sender) -> Result<()> { let mut controller = BufWriter::new(controller); //send_packet(&mut controller, ControlPacket::Arm(true)).await?; //println!("armed flipper"); @@ -145,8 +160,8 @@ async fn controller(mut notes: mpsc::Receiver<(Option) -> ControlFlow<()> { - if note.frequency < 150. { +fn sax_control(control: &mut ControlPacket, vol: f32, frequency: f32) -> ControlFlow<()> { + if frequency < 150. { println!("too low"); return ControlFlow::Break(()); } - if note.frequency > 270. { + if frequency > 270. { println!("too high"); return ControlFlow::Break(()); } - let note = Note::from_freq(note.frequency, Tuning::EqualTemperament); + let note = Note::from_freq(frequency, Tuning::EqualTemperament); //dbg!(note.clarity); //dbg!(vol); match note.pitch { @@ -218,16 +233,16 @@ fn sax_control(control: &mut ControlPacket, vol: f32, note: &pitch_detection::Pi } -fn recorder_control(control: &mut ControlPacket, vol: f32, note: pitch_detection::Pitch) -> ControlFlow<()> { - if note.frequency < 300. { +fn recorder_control(control: &mut ControlPacket, vol: f32, frequency: f32) -> ControlFlow<()> { + if frequency < 300. { println!("too low"); return ControlFlow::Break(()); } - if note.frequency > 600. { + if frequency > 600. { println!("too high"); return ControlFlow::Break(()); } - let note = Note::from_freq(note.frequency, Tuning::EqualTemperament); + let note = Note::from_freq(frequency, Tuning::EqualTemperament); //dbg!(note.clarity); //dbg!(vol); match note.pitch { From b567bf752819f312eba314947d30045000bd5a27 Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Sat, 8 Mar 2025 10:33:53 -0500 Subject: [PATCH 40/69] added config sliders and vendored eframe's persistence path finder --- interface/Cargo.lock | 1 + interface/Cargo.toml | 1 + interface/src/gui.rs | 24 ++++++++++++++++++++++-- interface/src/main.rs | 1 + 4 files changed, 25 insertions(+), 2 deletions(-) diff --git a/interface/Cargo.lock b/interface/Cargo.lock index 9c0c188..a330c7c 100644 --- a/interface/Cargo.lock +++ b/interface/Cargo.lock @@ -1855,6 +1855,7 @@ dependencies = [ "egui-toast", "egui_extras", "heapless", + "home", "pitch-detection", "postcard", "rust-music-theory", diff --git a/interface/Cargo.toml b/interface/Cargo.toml index af8d6b2..fe8d173 100644 --- a/interface/Cargo.toml +++ b/interface/Cargo.toml @@ -17,3 +17,4 @@ heapless = "0.7.0" eframe = "0.30" egui_extras = { version = "0.30", features = ["default", "image"] } egui-toast = "0.16.0" +home = "0.5.11" diff --git a/interface/src/gui.rs b/interface/src/gui.rs index 205622a..641618d 100644 --- a/interface/src/gui.rs +++ b/interface/src/gui.rs @@ -1,11 +1,13 @@ -use std::{cell::OnceCell, time::Duration}; +use std::{cell::OnceCell, path::PathBuf, time::Duration}; use common::{ControlPacket, TelemetryPacket}; -use eframe::egui::{self, containers, Align2, Checkbox, Context, Label}; +use eframe::egui::{self, containers, Align2, Checkbox, Context, Id, Label}; use tokio::{runtime::Runtime, sync::{mpsc, watch::Receiver}}; use egui_toast::{Toast, Toasts}; +use crate::storage_dir::storage_dir; + pub const GUI: OnceCell = OnceCell::new(); pub fn gui(data: Receiver, toasts: mpsc::Receiver, executor: Runtime) -> eframe::Result { @@ -52,6 +54,24 @@ impl GUI { impl eframe::App for GUI { fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) { let _ = GUI.set(ctx.clone()); + let mut num = 0.0; + let mut num2 = 0.0; + let mut num3 = 0.0; + let mut auto_idx = 0; + egui::SidePanel::right(Id::new("config")).resizable(false).show(ctx, |ui| { + ui.heading("configuration"); + ui.add(egui::Slider::new(&mut num, 0.0..=10.0).text("volume threshold")); + ui.label("higher accepts less noise (better)"); + ui.add(egui::Slider::new(&mut num2, 0.0..=1.0).text("auto turn kP")); + ui.add(egui::Slider::new(&mut num3, 30.0..=100.0).text("auto fire distance (mm)")); + ui.horizontal(|ui| { + egui::ComboBox::new("auto selector", "select auto") + .show_index(ui, &mut auto_idx, 3, |n| ["a","b","c"][n]); + ui.button("refresh").clicked(); + }); + println!("data {:?}", storage_dir("cruisecontrol")); + }); + egui::CentralPanel::default().show(ctx, |ui| { ui.heading("Cruise Control"); diff --git a/interface/src/main.rs b/interface/src/main.rs index 354af73..ca1c616 100644 --- a/interface/src/main.rs +++ b/interface/src/main.rs @@ -11,6 +11,7 @@ use rust_music_theory::note::{Note, NoteLetter, Pitch, Tuning}; use tokio::{io::{AsyncReadExt, AsyncWriteExt, BufWriter, WriteHalf}, net::{tcp::{OwnedReadHalf, OwnedWriteHalf}, TcpStream}, spawn, sync::{self, broadcast, mpsc, watch, RwLock}, time::timeout}; mod gui; +mod storage_dir; fn main() -> Result<()> { // assumes pulseaudio system with f32 samples and 2204 sample packets From 2fb5a5709fcee672eadb39011b6c8a30dbc2ff96 Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Sat, 8 Mar 2025 10:58:27 -0500 Subject: [PATCH 41/69] gui conf persistence --- interface/Cargo.lock | 46 ++++++++++++++++++++++++++++++++++++++++ interface/Cargo.toml | 2 +- interface/src/gui.rs | 50 +++++++++++++++++++++++++++++++++----------- 3 files changed, 85 insertions(+), 13 deletions(-) diff --git a/interface/Cargo.lock b/interface/Cargo.lock index a330c7c..059abb6 100644 --- a/interface/Cargo.lock +++ b/interface/Cargo.lock @@ -23,6 +23,10 @@ name = "accesskit" version = "0.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3d3b8f9bae46a948369bc4a03e815d4ed6d616bd00de4051133a5019dc31c5a" +dependencies = [ + "enumn", + "serde", +] [[package]] name = "accesskit_atspi_common" @@ -134,6 +138,7 @@ dependencies = [ "cfg-if", "getrandom 0.2.15", "once_cell", + "serde", "version_check", "zerocopy", ] @@ -512,6 +517,12 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "base64" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + [[package]] name = "bindgen" version = "0.70.1" @@ -556,6 +567,9 @@ name = "bitflags" version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" +dependencies = [ + "serde", +] [[package]] name = "block" @@ -1006,6 +1020,7 @@ checksum = "7d72e9c39f6e11a2e922d04a34ec5e7ef522ea3f5a1acfca7a19d16ad5fe50f5" dependencies = [ "bytemuck", "emath", + "serde", ] [[package]] @@ -1024,6 +1039,7 @@ dependencies = [ "glow 0.16.0", "glutin", "glutin-winit", + "home", "image", "js-sys", "log", @@ -1034,6 +1050,8 @@ dependencies = [ "percent-encoding", "profiling", "raw-window-handle", + "ron", + "serde", "static_assertions", "wasm-bindgen", "wasm-bindgen-futures", @@ -1057,6 +1075,8 @@ dependencies = [ "log", "nohash-hasher", "profiling", + "ron", + "serde", ] [[package]] @@ -1101,6 +1121,7 @@ dependencies = [ "log", "profiling", "raw-window-handle", + "serde", "smithay-clipboard", "web-time", "webbrowser", @@ -1153,6 +1174,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4fe73c1207b864ee40aa0b0c038d6092af1030744678c60188a05c28553515d" dependencies = [ "bytemuck", + "serde", ] [[package]] @@ -1203,6 +1225,17 @@ dependencies = [ "syn 2.0.96", ] +[[package]] +name = "enumn" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f9ed6b3789237c8a0c1c505af1c7eb2c560df6186f01b098c3a1064ea532f38" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", +] + [[package]] name = "epaint" version = "0.30.0" @@ -1219,6 +1252,7 @@ dependencies = [ "nohash-hasher", "parking_lot", "profiling", + "serde", ] [[package]] @@ -2860,6 +2894,18 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19b30a45b0cd0bcca8037f3d0dc3421eaf95327a17cad11964fb8179b4fc4832" +[[package]] +name = "ron" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b91f7eff05f748767f183df4320a63d6936e9c6107d97c9e6bdd9784f4289c94" +dependencies = [ + "base64", + "bitflags 2.8.0", + "serde", + "serde_derive", +] + [[package]] name = "rust-music-theory" version = "0.2.0" diff --git a/interface/Cargo.toml b/interface/Cargo.toml index fe8d173..02b9d7c 100644 --- a/interface/Cargo.toml +++ b/interface/Cargo.toml @@ -14,7 +14,7 @@ tokio = { version = "1.43.0", features = ["full"] } common = {path = "../common"} heapless = "0.7.0" -eframe = "0.30" +eframe = { version = "0.30", features = ["persistence"] } egui_extras = { version = "0.30", features = ["default", "image"] } egui-toast = "0.16.0" home = "0.5.11" diff --git a/interface/src/gui.rs b/interface/src/gui.rs index 641618d..81d0f9d 100644 --- a/interface/src/gui.rs +++ b/interface/src/gui.rs @@ -2,7 +2,7 @@ use std::{cell::OnceCell, path::PathBuf, time::Duration}; use common::{ControlPacket, TelemetryPacket}; -use eframe::egui::{self, containers, Align2, Checkbox, Context, Id, Label}; +use eframe::{egui::{self, containers, Align2, Checkbox, Context, Id, Label}, Storage}; use tokio::{runtime::Runtime, sync::{mpsc, watch::Receiver}}; use egui_toast::{Toast, Toasts}; @@ -24,7 +24,7 @@ pub fn gui(data: Receiver, toasts: mpsc::Receiver, executor: Run // This gives us image support: egui_extras::install_image_loaders(&cc.egui_ctx); - Ok(Box::new(GUI::with_receivers(data, toasts, executor))) + Ok(Box::new(GUI::with_receivers(data, toasts, executor, cc.storage.unwrap()))) }), ) } @@ -35,18 +35,43 @@ pub struct GUIData { pub last_command: Option, } +#[cfg(target_os = "linux")] +const DEFAULT_VOLUME_THRESHOLD: f32 = 5.0; +#[cfg(target_os = "windows")] +const DEFAULT_VOLUME_THRESHOLD: f32 = 1.0; +const DEFAULT_TURN_GAIN: f32 = 0.3; +const DEFAULT_FIRE_DISTANCE: f32 = 55.0; + struct GUI { data: Receiver, toasts: mpsc::Receiver, executor: Option, + volume_threshold: f32, + auto_turn_gain: f32, + /// mm + auto_fire_distance: f32, + selected_auto: usize, } impl GUI { - fn with_receivers(data: Receiver, toasts: mpsc::Receiver, executor: Runtime) -> Self { + fn with_receivers(data: Receiver, toasts: mpsc::Receiver, executor: Runtime, storage: &dyn Storage) -> Self { + let volume_threshold: f32 = storage.get_string("volume_threshold").map(|s| s.parse().ok()).flatten().unwrap_or(DEFAULT_VOLUME_THRESHOLD); + + let auto_turn_gain: f32 = storage.get_string("auto_turn_gain").map(|s| s.parse().ok()).flatten().unwrap_or(DEFAULT_TURN_GAIN); + + let auto_fire_distance: f32 = storage.get_string("auto_fire_distance").map(|s| s.parse().ok()).flatten().unwrap_or(DEFAULT_FIRE_DISTANCE); + + let selected_auto: usize = storage.get_string("selected_auto").map(|s| s.parse().ok()).flatten().unwrap_or(0); + + Self { data, toasts, executor: Some(executor), + volume_threshold, + auto_turn_gain, + auto_fire_distance, + selected_auto, } } } @@ -54,22 +79,23 @@ impl GUI { impl eframe::App for GUI { fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) { let _ = GUI.set(ctx.clone()); - let mut num = 0.0; - let mut num2 = 0.0; - let mut num3 = 0.0; - let mut auto_idx = 0; egui::SidePanel::right(Id::new("config")).resizable(false).show(ctx, |ui| { ui.heading("configuration"); - ui.add(egui::Slider::new(&mut num, 0.0..=10.0).text("volume threshold")); + ui.add(egui::Slider::new(&mut self.volume_threshold, 0.0..=10.0).text("volume threshold")); ui.label("higher accepts less noise (better)"); - ui.add(egui::Slider::new(&mut num2, 0.0..=1.0).text("auto turn kP")); - ui.add(egui::Slider::new(&mut num3, 30.0..=100.0).text("auto fire distance (mm)")); + ui.add(egui::Slider::new(&mut self.auto_turn_gain, 0.0..=1.0).text("auto turn kP")); + ui.add(egui::Slider::new(&mut self.auto_fire_distance, 30.0..=100.0).text("auto fire distance (mm)")); ui.horizontal(|ui| { egui::ComboBox::new("auto selector", "select auto") - .show_index(ui, &mut auto_idx, 3, |n| ["a","b","c"][n]); + .show_index(ui, &mut self.selected_auto, 3, |n| ["a","b","c"][n]); ui.button("refresh").clicked(); }); - println!("data {:?}", storage_dir("cruisecontrol")); + + let storage = _frame.storage_mut().unwrap(); + storage.set_string("volume_threshold", format!("{}",self.volume_threshold)); + storage.set_string("auto_turn_gain", format!("{}",self.auto_turn_gain)); + storage.set_string("auto_fire_distance", format!("{}",self.auto_fire_distance)); + storage.set_string("selected_auto", format!("{}",self.selected_auto)); }); egui::CentralPanel::default().show(ctx, |ui| { From e352c5b0486f9b60d8420a2842fb305f993ef3e4 Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Sat, 8 Mar 2025 11:03:13 -0500 Subject: [PATCH 42/69] propagate volume threshold --- interface/Cargo.lock | 7 +++++++ interface/Cargo.toml | 1 + interface/src/gui.rs | 10 ++++++---- interface/src/main.rs | 13 ++++++------- 4 files changed, 20 insertions(+), 11 deletions(-) diff --git a/interface/Cargo.lock b/interface/Cargo.lock index 059abb6..0b8b141 100644 --- a/interface/Cargo.lock +++ b/interface/Cargo.lock @@ -434,6 +434,12 @@ version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" +[[package]] +name = "atomic_float" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "628d228f918ac3b82fe590352cc719d30664a0c13ca3a60266fe02c7132d480a" + [[package]] name = "atspi" version = "0.22.0" @@ -1883,6 +1889,7 @@ name = "interface" version = "0.1.0" dependencies = [ "anyhow", + "atomic_float", "common", "cpal", "eframe", diff --git a/interface/Cargo.toml b/interface/Cargo.toml index 02b9d7c..8ebdd93 100644 --- a/interface/Cargo.toml +++ b/interface/Cargo.toml @@ -18,3 +18,4 @@ eframe = { version = "0.30", features = ["persistence"] } egui_extras = { version = "0.30", features = ["default", "image"] } egui-toast = "0.16.0" home = "0.5.11" +atomic_float = "1.1.0" diff --git a/interface/src/gui.rs b/interface/src/gui.rs index 81d0f9d..0ec5318 100644 --- a/interface/src/gui.rs +++ b/interface/src/gui.rs @@ -1,12 +1,12 @@ -use std::{cell::OnceCell, path::PathBuf, time::Duration}; +use std::{cell::OnceCell, path::PathBuf, sync::atomic::Ordering, time::Duration}; use common::{ControlPacket, TelemetryPacket}; use eframe::{egui::{self, containers, Align2, Checkbox, Context, Id, Label}, Storage}; use tokio::{runtime::Runtime, sync::{mpsc, watch::Receiver}}; use egui_toast::{Toast, Toasts}; -use crate::storage_dir::storage_dir; +use crate::{storage_dir::storage_dir, POWER_THRESHOLD}; pub const GUI: OnceCell = OnceCell::new(); @@ -36,9 +36,9 @@ pub struct GUIData { } #[cfg(target_os = "linux")] -const DEFAULT_VOLUME_THRESHOLD: f32 = 5.0; +pub const DEFAULT_VOLUME_THRESHOLD: f32 = 5.0; #[cfg(target_os = "windows")] -const DEFAULT_VOLUME_THRESHOLD: f32 = 1.0; +pub const DEFAULT_VOLUME_THRESHOLD: f32 = 1.0; const DEFAULT_TURN_GAIN: f32 = 0.3; const DEFAULT_FIRE_DISTANCE: f32 = 55.0; @@ -96,6 +96,8 @@ impl eframe::App for GUI { storage.set_string("auto_turn_gain", format!("{}",self.auto_turn_gain)); storage.set_string("auto_fire_distance", format!("{}",self.auto_fire_distance)); storage.set_string("selected_auto", format!("{}",self.selected_auto)); + + POWER_THRESHOLD.store(self.volume_threshold, Ordering::Relaxed); }); egui::CentralPanel::default().show(ctx, |ui| { diff --git a/interface/src/main.rs b/interface/src/main.rs index ca1c616..a799877 100644 --- a/interface/src/main.rs +++ b/interface/src/main.rs @@ -1,11 +1,12 @@ #![feature(iter_collect_into)] -use std::{fmt::format, ops::ControlFlow, result, sync::Arc, thread::{self, sleep}, time::Duration}; +use std::{fmt::format, ops::ControlFlow, result, sync::{atomic::Ordering, Arc}, thread::{self, sleep}, time::Duration}; use anyhow::{Context, Ok, Result}; +use atomic_float::AtomicF32; use common::{ControlPacket, TelemetryPacket}; use cpal::traits::{DeviceTrait, HostTrait, StreamTrait}; use egui_toast::{Toast, ToastKind}; -use gui::{gui, GUIData, GUI}; +use gui::{gui, GUIData, DEFAULT_VOLUME_THRESHOLD, GUI}; use pitch_detection::{detector::{mcleod::McLeodDetector, PitchDetector}, utils}; use rust_music_theory::note::{Note, NoteLetter, Pitch, Tuning}; use tokio::{io::{AsyncReadExt, AsyncWriteExt, BufWriter, WriteHalf}, net::{tcp::{OwnedReadHalf, OwnedWriteHalf}, TcpStream}, spawn, sync::{self, broadcast, mpsc, watch, RwLock}, time::timeout}; @@ -13,6 +14,8 @@ use tokio::{io::{AsyncReadExt, AsyncWriteExt, BufWriter, WriteHalf}, net::{tcp:: mod gui; mod storage_dir; +pub const POWER_THRESHOLD: AtomicF32 = AtomicF32::new(DEFAULT_VOLUME_THRESHOLD); + fn main() -> Result<()> { // assumes pulseaudio system with f32 samples and 2204 sample packets dbg!(cpal::available_hosts()); @@ -32,10 +35,6 @@ fn main() -> Result<()> { let (sender, notes) = broadcast::channel(2); - #[cfg(target_os = "linux")] - const POWER_THRESHOLD: f32 = 5.0; - #[cfg(target_os = "windows")] - const POWER_THRESHOLD: f32 = 1.0; const CLARITY_THRESHOLD: f32 = 0.85; #[cfg(target_os = "linux")] const PACKET_LEN: usize = 2204; @@ -66,7 +65,7 @@ fn main() -> Result<()> { // reinitialized every packet as it is not thread safe let mut detctor = McLeodDetector::new(PACKET_LEN, PACKET_LEN/2); let vol = utils::buffer::square_sum(data); - if let Err(e) = sender.send((detctor.get_pitch(data, rate.0 as usize, POWER_THRESHOLD, CLARITY_THRESHOLD).map(|p|p.frequency),vol)) { + if let Err(e) = sender.send((detctor.get_pitch(data, rate.0 as usize, POWER_THRESHOLD.load(Ordering::Relaxed), CLARITY_THRESHOLD).map(|p|p.frequency),vol)) { println!("channel: {e}"); } From 95c5b50dd3460be0fd6d1955595e46909792b76e Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Sat, 8 Mar 2025 11:40:07 -0500 Subject: [PATCH 43/69] added combat logger A refactor might be beneficial here, now data is being sent to multiple streams which feels a tad off --- common/src/lib.rs | 4 +- interface/Cargo.lock | 73 ++++++++++++++++ interface/Cargo.toml | 5 +- interface/src/combatlog.rs | 42 ++++++++++ interface/src/main.rs | 27 ++++-- interface/src/storage_dir.rs | 157 +++++++++++++++++++++++++++++++++++ 6 files changed, 297 insertions(+), 11 deletions(-) create mode 100644 interface/src/combatlog.rs create mode 100644 interface/src/storage_dir.rs diff --git a/common/src/lib.rs b/common/src/lib.rs index 13791c5..16ce42f 100644 --- a/common/src/lib.rs +++ b/common/src/lib.rs @@ -39,13 +39,13 @@ pub struct SensorData { pub accel: Option>, } -#[derive(Serialize, Deserialize, Debug)] +#[derive(Serialize, Deserialize, Debug, Clone)] pub struct TelemetryPacket { pub sensors: SensorData, pub cam_state: CamState, } -#[derive(Serialize, Deserialize, Debug)] +#[derive(Serialize, Deserialize, Debug, Clone)] pub enum CamState { Firing, Charged, diff --git a/interface/Cargo.lock b/interface/Cargo.lock index 0b8b141..04315c5 100644 --- a/interface/Cargo.lock +++ b/interface/Cargo.lock @@ -201,6 +201,12 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc7eb209b1518d6bb87b283c20095f5228ecda460da70b44f0802523dea6da04" +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + [[package]] name = "android_system_properties" version = "0.1.5" @@ -737,6 +743,20 @@ dependencies = [ "libc", ] +[[package]] +name = "chrono" +version = "0.4.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a7964611d71df112cb1730f2ee67324fcf4d0fc6606acbbe9bfe06df124637c" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "js-sys", + "num-traits", + "wasm-bindgen", + "windows-link", +] + [[package]] name = "clang-sys" version = "1.8.1" @@ -1183,6 +1203,18 @@ dependencies = [ "serde", ] +[[package]] +name = "embedded-io" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef1a6892d9eef45c8fa6b9e0086428a2cca8491aca8f787c534a3d6d0bcb3ced" + +[[package]] +name = "embedded-io" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" + [[package]] name = "endi" version = "1.1.0" @@ -1714,6 +1746,29 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "iana-time-zone" +version = "0.1.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core 0.52.0", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + [[package]] name = "icu_collections" version = "1.5.0" @@ -1890,6 +1945,7 @@ version = "0.1.0" dependencies = [ "anyhow", "atomic_float", + "chrono", "common", "cpal", "eframe", @@ -2738,6 +2794,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "170a2601f67cc9dba8edd8c4870b15f71a6a2dc196daec8c83f72b59dff628a8" dependencies = [ "cobs", + "embedded-io 0.4.0", + "embedded-io 0.6.1", "heapless", "serde", ] @@ -3938,6 +3996,15 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets 0.52.6", +] + [[package]] name = "windows-core" version = "0.54.0" @@ -3983,6 +4050,12 @@ dependencies = [ "syn 2.0.96", ] +[[package]] +name = "windows-link" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dccfd733ce2b1753b03b6d3c65edf020262ea35e20ccdf3e288043e6dd620e3" + [[package]] name = "windows-result" version = "0.1.2" diff --git a/interface/Cargo.toml b/interface/Cargo.toml index 8ebdd93..b4c2952 100644 --- a/interface/Cargo.toml +++ b/interface/Cargo.toml @@ -7,9 +7,9 @@ edition = "2021" anyhow = "1.0.95" cpal = "0.15.3" pitch-detection = "0.3" -postcard = "1.1.1" +postcard = { version = "1.1.1", features = ["alloc", "use-std"] } rust-music-theory = {git = "https://github.com/the-drunk-coder/rust-music-theory", rev = "a062d65"} -serde = "1.0.217" +serde = { version = "1.0.217", features = ["derive"] } tokio = { version = "1.43.0", features = ["full"] } common = {path = "../common"} heapless = "0.7.0" @@ -19,3 +19,4 @@ egui_extras = { version = "0.30", features = ["default", "image"] } egui-toast = "0.16.0" home = "0.5.11" atomic_float = "1.1.0" +chrono = "0.4.40" diff --git a/interface/src/combatlog.rs b/interface/src/combatlog.rs new file mode 100644 index 0000000..21371c9 --- /dev/null +++ b/interface/src/combatlog.rs @@ -0,0 +1,42 @@ +use std::time::{Duration, SystemTime, UNIX_EPOCH}; + +use anyhow::Ok; +use common::{ControlPacket, TelemetryPacket}; +use serde::{Deserialize, Serialize}; +use tokio::{fs::File, io::AsyncWriteExt, sync::mpsc::Receiver, time::Instant}; + +use crate::storage_dir::storage; + + +#[derive(Serialize, Deserialize)] +pub enum CombatData { + Telemetry(TelemetryPacket), + Control(ControlPacket), +} + +type CombatLogRow = (CombatData, u128); + +pub async fn combat_logger(mut data: Receiver) -> anyhow::Result<()> { + let mut path = storage(); + let time = chrono::offset::Utc::now(); + let formatted = time.to_rfc3339_opts(chrono::SecondsFormat::Secs, false); + path.push(format!("{formatted}.combatlog")); + let mut file = File::options().create(true).append(true).open(path).await?; + + let mut save = Instant::now(); + + while let Some(packet) = data.recv().await { + let time = SystemTime::now().duration_since(UNIX_EPOCH)?.as_micros(); + let vec = postcard::to_stdvec(&(packet, time))?; + + file.write_u64(vec.len() as u64).await?; + file.write_all(&vec).await?; + + if save.elapsed() > Duration::from_secs(30) { + save = Instant::now(); + file.sync_all().await?; + } + } + + Ok(()) +} diff --git a/interface/src/main.rs b/interface/src/main.rs index a799877..ce49c5e 100644 --- a/interface/src/main.rs +++ b/interface/src/main.rs @@ -3,6 +3,7 @@ use std::{fmt::format, ops::ControlFlow, result, sync::{atomic::Ordering, Arc}, use anyhow::{Context, Ok, Result}; use atomic_float::AtomicF32; +use combatlog::{combat_logger, CombatData}; use common::{ControlPacket, TelemetryPacket}; use cpal::traits::{DeviceTrait, HostTrait, StreamTrait}; use egui_toast::{Toast, ToastKind}; @@ -13,10 +14,13 @@ use tokio::{io::{AsyncReadExt, AsyncWriteExt, BufWriter, WriteHalf}, net::{tcp:: mod gui; mod storage_dir; +mod combatlog; pub const POWER_THRESHOLD: AtomicF32 = AtomicF32::new(DEFAULT_VOLUME_THRESHOLD); fn main() -> Result<()> { + let (logging_sender, combatlog) = mpsc::channel(64); + // assumes pulseaudio system with f32 samples and 2204 sample packets dbg!(cpal::available_hosts()); let host = cpal::default_host(); @@ -27,7 +31,6 @@ fn main() -> Result<()> { #[cfg(target_os = "linux")] let device = host.devices().unwrap().find(|d|d.name().unwrap() == "pulse").context("no pulse")?; - let config = device.default_input_config()?; dbg!(config.sample_format()); @@ -86,8 +89,15 @@ fn main() -> Result<()> { let spawner = executor.handle().clone(); thread::spawn(move || { spawner.block_on(async { + let log_toasts = toast_sender.clone(); + tokio::spawn(async move { + if let Err(e) = combat_logger(combatlog).await { + let _ = log_toasts.clone().send(Toast::new().text(format!("logger crashed: {e:?}")).kind(ToastKind::Error)).await; + } + }); + loop { - if let Err(e) = connect(toast_sender.clone(), notes.resubscribe(), data_sender.clone()).await { + if let Err(e) = connect(toast_sender.clone(), notes.resubscribe(), data_sender.clone(), logging_sender.clone()).await { if let Err(_) = toast_sender.send(Toast::new().text(format!("{e:?}")).kind(ToastKind::Error)).await { break; }; @@ -108,7 +118,7 @@ fn main() -> Result<()> { /// frequency, volume type Detection = (Option, f32); -async fn connect(toast_sender: mpsc::Sender, notes: broadcast::Receiver, data_sender: watch::Sender) -> Result<()>{ +async fn connect(toast_sender: mpsc::Sender, notes: broadcast::Receiver, data_sender: watch::Sender, logging_sender: mpsc::Sender) -> Result<()>{ toast_sender.send(Toast::new().text("connecting to bot").kind(ToastKind::Info)).await?; let cruisecontrol = TcpStream::connect("192.168.1.2:1234").await?; println!("connected"); @@ -116,13 +126,13 @@ async fn connect(toast_sender: mpsc::Sender, notes: broadcast::Receiver) -> Result<()> { +async fn telemetry_handler(mut telem: OwnedReadHalf, gui: watch::Sender, logging_sender: mpsc::Sender) -> Result<()> { let mut buf = vec![0; 2048]; loop { let len = telem.read_u32().await.context("bad length")? as usize; @@ -132,6 +142,8 @@ async fn telemetry_handler(mut telem: OwnedReadHalf, gui: watch::Sender //println!("telem: {telem:?}"); + logging_sender.send(CombatData::Telemetry(telem.clone())).await?; + gui.send_modify(|gui| { gui.telemetry = Some(telem); }); @@ -139,7 +151,7 @@ async fn telemetry_handler(mut telem: OwnedReadHalf, gui: watch::Sender } } -async fn controller(mut notes: broadcast::Receiver, controller: OwnedWriteHalf, gui: watch::Sender) -> Result<()> { +async fn controller(mut notes: broadcast::Receiver, controller: OwnedWriteHalf, gui: watch::Sender, logging_sender: mpsc::Sender) -> Result<()> { let mut controller = BufWriter::new(controller); //send_packet(&mut controller, ControlPacket::Arm(true)).await?; //println!("armed flipper"); @@ -168,6 +180,7 @@ async fn controller(mut notes: broadcast::Receiver, controller: Owned } send_packet(&mut controller, control.clone()).await?; + logging_sender.send(CombatData::Control(control.clone())).await?; gui.send_modify(|gui| gui.last_command = Some(control)); } else { send_packet(&mut controller, ControlPacket::Twist(0.0, 0.0)).await?; diff --git a/interface/src/storage_dir.rs b/interface/src/storage_dir.rs new file mode 100644 index 0000000..d5e3649 --- /dev/null +++ b/interface/src/storage_dir.rs @@ -0,0 +1,157 @@ +// copied from eframe (private item) +// https://docs.rs/eframe/latest/src/eframe/native/file_storage.rs.html#17 + +use std::path::PathBuf; + +use eframe::egui; + +pub fn storage() -> PathBuf { + storage_dir("cruisecontrol").unwrap() +} + +pub fn storage_dir(app_id: &str) -> Option { + + use egui::os::OperatingSystem as OS; + + use std::env::var_os; + + match OS::from_target_os() { + + OS::Nix => var_os("XDG_DATA_HOME") + + .map(PathBuf::from) + + .filter(|p| p.is_absolute()) + + .or_else(|| home::home_dir().map(|p| p.join(".local").join("share"))) + + .map(|p| { + + p.join( + + app_id + + .to_lowercase() + + .replace(|c: char| c.is_ascii_whitespace(), ""), + + ) + + }), + + OS::Mac => home::home_dir().map(|p| { + + p.join("Library") + + .join("Application Support") + + .join(app_id.replace(|c: char| c.is_ascii_whitespace(), "-")) + + }), + + OS::Windows => roaming_appdata().map(|p| p.join(app_id).join("data")), + + OS::Unknown | OS::Android | OS::IOS => None, + + } + +} + +// Adapted from + +// https://github.com/rust-lang/cargo/blob/6e11c77384989726bb4f412a0e23b59c27222c34/crates/home/src/windows.rs#L19-L37 + +#[cfg(all(windows, not(target_vendor = "uwp")))] + +#[allow(unsafe_code)] + +fn roaming_appdata() -> Option { + + use std::ffi::OsString; + + use std::os::windows::ffi::OsStringExt; + + use std::ptr; + + use std::slice; + + + use windows_sys::Win32::Foundation::S_OK; + + use windows_sys::Win32::System::Com::CoTaskMemFree; + + use windows_sys::Win32::UI::Shell::{ + + FOLDERID_RoamingAppData, SHGetKnownFolderPath, KF_FLAG_DONT_VERIFY, + + }; + + + extern "C" { + + fn wcslen(buf: *const u16) -> usize; + + } + + let mut path_raw = ptr::null_mut(); + + + // SAFETY: SHGetKnownFolderPath allocates for us, we don't pass any pointers to it. + + // See https://learn.microsoft.com/en-us/windows/win32/api/shlobj_core/nf-shlobj_core-shgetknownfolderpath + + let result = unsafe { + + SHGetKnownFolderPath( + + &FOLDERID_RoamingAppData, + + KF_FLAG_DONT_VERIFY as u32, + + std::ptr::null_mut(), + + &mut path_raw, + + ) + + }; + + + let path = if result == S_OK { + + // SAFETY: SHGetKnownFolderPath indicated success and is supposed to allocate a nullterminated string for us. + + let path_slice = unsafe { slice::from_raw_parts(path_raw, wcslen(path_raw)) }; + + Some(PathBuf::from(OsString::from_wide(path_slice))) + + } else { + + None + + }; + + + // SAFETY: + + // This memory got allocated by SHGetKnownFolderPath, we didn't touch anything in the process. + + // A null ptr is a no-op for `CoTaskMemFree`, so in case this failed we're still good. + + // https://learn.microsoft.com/en-us/windows/win32/api/combaseapi/nf-combaseapi-cotaskmemfree + + unsafe { CoTaskMemFree(path_raw.cast()) }; + + + path + +} + + +#[cfg(any(not(windows), target_vendor = "uwp"))] + +fn roaming_appdata() -> Option { + + None + +} From 354f600f922265abf0b9b6a77a0ba80a70467a34 Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Sat, 8 Mar 2025 12:05:50 -0500 Subject: [PATCH 44/69] added icon (not testable on sway) --- interface/Cargo.lock | 478 +++++++++++++++++++++++++++++++++++- interface/Cargo.toml | 1 + interface/assets/lizard.png | Bin 0 -> 26886 bytes interface/src/gui.rs | 16 +- 4 files changed, 491 insertions(+), 4 deletions(-) create mode 100644 interface/assets/lizard.png diff --git a/interface/Cargo.lock b/interface/Cargo.lock index 04315c5..8fc4206 100644 --- a/interface/Cargo.lock +++ b/interface/Cargo.lock @@ -152,6 +152,12 @@ dependencies = [ "memchr", ] +[[package]] +name = "aligned-vec" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4aa90d7ce82d4be67b64039a3d588d38dbcc6736577de4a847025ce5b0c468d1" + [[package]] name = "alsa" version = "0.9.1" @@ -240,6 +246,12 @@ dependencies = [ "num-traits", ] +[[package]] +name = "arbitrary" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dde20b3d026af13f561bdd0f15edf01fc734f0dafcedbaf42bba506a9517f223" + [[package]] name = "arboard" version = "3.4.1" @@ -255,6 +267,17 @@ dependencies = [ "x11rb", ] +[[package]] +name = "arg_enum_proc_macro" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ae92a5119aa49cdbcf6b9f893fe4e1d98b04ccbf82ee0584ad948a44a734dea" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", +] + [[package]] name = "arrayref" version = "0.3.9" @@ -514,6 +537,29 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" +[[package]] +name = "av1-grain" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6678909d8c5d46a42abcf571271e15fdbc0a225e3646cf23762cd415046c78bf" +dependencies = [ + "anyhow", + "arrayvec", + "log", + "nom", + "num-rational", + "v_frame", +] + +[[package]] +name = "avif-serialize" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98922d6a4cfbcb08820c69d8eeccc05bb1f29bfa06b4f5b1dbfe9a868bd7608e" +dependencies = [ + "arrayvec", +] + [[package]] name = "backtrace" version = "0.3.74" @@ -544,7 +590,7 @@ dependencies = [ "bitflags 2.8.0", "cexpr", "clang-sys", - "itertools", + "itertools 0.13.0", "proc-macro2", "quote", "regex", @@ -568,6 +614,12 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" +[[package]] +name = "bit_field" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc827186963e592360843fb5ba4b973e145841266c1357f7180c43526f2e5b61" + [[package]] name = "bitflags" version = "1.3.2" @@ -583,6 +635,12 @@ dependencies = [ "serde", ] +[[package]] +name = "bitstream-io" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6099cdc01846bc367c4e7dd630dc5966dccf36b652fae7a74e17b640411a91b2" + [[package]] name = "block" version = "0.1.6" @@ -620,6 +678,12 @@ dependencies = [ "piper", ] +[[package]] +name = "built" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56ed6191a7e78c36abdb16ab65341eefd73d64d303fffccdbb00d51e4205967b" + [[package]] name = "bumpalo" version = "3.16.0" @@ -716,6 +780,16 @@ dependencies = [ "nom", ] +[[package]] +name = "cfg-expr" +version = "0.15.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d067ad48b8650848b989a59a86c6c36a995d02d2bf778d45c3c5d57bc2718f02" +dependencies = [ + "smallvec", + "target-lexicon", +] + [[package]] name = "cfg-if" version = "1.0.0" @@ -808,6 +882,12 @@ dependencies = [ "unicode-width", ] +[[package]] +name = "color_quant" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" + [[package]] name = "combine" version = "4.6.7" @@ -953,12 +1033,37 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" +[[package]] +name = "crossbeam-deque" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + [[package]] name = "crossbeam-utils" version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" +[[package]] +name = "crunchy" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43da5946c66ffcc7745f48db692ffbb10a83bfe0afd96235c5c2a4fb23994929" + [[package]] name = "crypto-common" version = "0.1.6" @@ -1342,6 +1447,21 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "exr" +version = "1.73.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f83197f59927b46c04a183a619b7c29df34e63e63c7869320862268c0ef687e0" +dependencies = [ + "bit_field", + "half", + "lebe", + "miniz_oxide", + "rayon-core", + "smallvec", + "zune-inflate", +] + [[package]] name = "fastrand" version = "2.3.0" @@ -1517,6 +1637,16 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "gif" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fb2d69b19215e18bb912fa30f7ce15846e301408695e44e0ef719f1da9e19f2" +dependencies = [ + "color_quant", + "weezl", +] + [[package]] name = "gimli" version = "0.31.1" @@ -1669,6 +1799,16 @@ dependencies = [ "bitflags 2.8.0", ] +[[package]] +name = "half" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" +dependencies = [ + "cfg-if", + "crunchy", +] + [[package]] name = "hash32" version = "0.2.1" @@ -1710,6 +1850,12 @@ dependencies = [ "unicode-segmentation", ] +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + [[package]] name = "hermit-abi" version = "0.1.19" @@ -1916,10 +2062,37 @@ checksum = "cd6f44aed642f18953a158afeb30206f4d50da59fbc66ecb53c66488de73563b" dependencies = [ "bytemuck", "byteorder-lite", + "color_quant", + "exr", + "gif", + "image-webp", "num-traits", "png", + "qoi", + "ravif", + "rayon", + "rgb", + "tiff", + "zune-core", + "zune-jpeg", ] +[[package]] +name = "image-webp" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b77d01e822461baa8409e156015a1d91735549f0f2c17691bd2d996bef238f7f" +dependencies = [ + "byteorder-lite", + "quick-error", +] + +[[package]] +name = "imgref" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0263a3d970d5c054ed9312c0057b4f3bde9c0b33836d3637361d4a9e6e7a408" + [[package]] name = "immutable-chunkmap" version = "2.0.6" @@ -1953,6 +2126,7 @@ dependencies = [ "egui_extras", "heapless", "home", + "image", "pitch-detection", "postcard", "rust-music-theory", @@ -1960,6 +2134,26 @@ dependencies = [ "tokio", ] +[[package]] +name = "interpolate_name" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34819042dc3d3971c46c2190835914dfbe0c3c13f61449b2997f4e9722dfa60" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", +] + +[[package]] +name = "itertools" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +dependencies = [ + "either", +] + [[package]] name = "itertools" version = "0.13.0" @@ -2000,6 +2194,12 @@ dependencies = [ "libc", ] +[[package]] +name = "jpeg-decoder" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5d4a7da358eff58addd2877a45865158f0d78c911d43a5784ceb7bbf52833b0" + [[package]] name = "js-sys" version = "0.3.77" @@ -2033,12 +2233,28 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +[[package]] +name = "lebe" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03087c2bad5e1034e8cace5926dec053fb3790248370865f5117a7d0213354c8" + [[package]] name = "libc" version = "0.2.169" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" +[[package]] +name = "libfuzzer-sys" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf78f52d400cf2d84a3a973a78a592b4adc535739e0a5597a0da6f0c357adc75" +dependencies = [ + "arbitrary", + "cc", +] + [[package]] name = "libloading" version = "0.8.6" @@ -2094,6 +2310,15 @@ version = "0.4.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f" +[[package]] +name = "loop9" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fae87c125b03c1d2c0150c90365d7d6bcc53fb73a9acaef207d2d065860f062" +dependencies = [ + "imgref", +] + [[package]] name = "mach2" version = "0.4.2" @@ -2112,6 +2337,16 @@ dependencies = [ "libc", ] +[[package]] +name = "maybe-rayon" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ea1f30cedd69f0a2954655f7188c6a834246d2bcf1e315e2ac40c4b24dc9519" +dependencies = [ + "cfg-if", + "rayon", +] + [[package]] name = "memchr" version = "2.7.4" @@ -2283,6 +2518,12 @@ dependencies = [ "jni-sys", ] +[[package]] +name = "new_debug_unreachable" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" + [[package]] name = "nix" version = "0.29.0" @@ -2312,6 +2553,22 @@ dependencies = [ "minimal-lexical", ] +[[package]] +name = "noop_proc_macro" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0676bb32a98c1a483ce53e500a81ad9c3d5b3f7c920c28c24e9cb0980d0b5bc8" + +[[package]] +name = "num-bigint" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +dependencies = [ + "num-integer", + "num-traits", +] + [[package]] name = "num-complex" version = "0.4.6" @@ -2348,6 +2605,7 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" dependencies = [ + "num-bigint", "num-integer", "num-traits", ] @@ -2841,6 +3099,34 @@ name = "profiling" version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "afbdc74edc00b6f6a218ca6a5364d6226a259d4b8ea1af4a0ea063f27e179f4d" +dependencies = [ + "profiling-procmacros", +] + +[[package]] +name = "profiling-procmacros" +version = "1.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a65f2e60fbf1063868558d69c6beacf412dc755f9fc020f514b7955fc914fe30" +dependencies = [ + "quote", + "syn 2.0.96", +] + +[[package]] +name = "qoi" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f6d64c71eb498fe9eae14ce4ec935c555749aef511cca85b5568910d6e48001" +dependencies = [ + "bytemuck", +] + +[[package]] +name = "quick-error" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3" [[package]] name = "quick-xml" @@ -2900,12 +3186,82 @@ dependencies = [ "getrandom 0.2.15", ] +[[package]] +name = "rav1e" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd87ce80a7665b1cce111f8a16c1f3929f6547ce91ade6addf4ec86a8dda5ce9" +dependencies = [ + "arbitrary", + "arg_enum_proc_macro", + "arrayvec", + "av1-grain", + "bitstream-io", + "built", + "cfg-if", + "interpolate_name", + "itertools 0.12.1", + "libc", + "libfuzzer-sys", + "log", + "maybe-rayon", + "new_debug_unreachable", + "noop_proc_macro", + "num-derive", + "num-traits", + "once_cell", + "paste", + "profiling", + "rand", + "rand_chacha", + "simd_helpers", + "system-deps", + "thiserror", + "v_frame", + "wasm-bindgen", +] + +[[package]] +name = "ravif" +version = "0.11.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2413fd96bd0ea5cdeeb37eaf446a22e6ed7b981d792828721e74ded1980a45c6" +dependencies = [ + "avif-serialize", + "imgref", + "loop9", + "quick-error", + "rav1e", + "rayon", + "rgb", +] + [[package]] name = "raw-window-handle" version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "20675572f6f24e9e76ef639bc5552774ed45f1c30e2951e1e99c59888861c539" +[[package]] +name = "rayon" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + [[package]] name = "redox_syscall" version = "0.4.1" @@ -2959,6 +3315,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19b30a45b0cd0bcca8037f3d0dc3421eaf95327a17cad11964fb8179b4fc4832" +[[package]] +name = "rgb" +version = "0.8.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57397d16646700483b67d2dd6511d79318f9d057fdbd21a4066aeac8b41d310a" + [[package]] name = "ron" version = "0.8.1" @@ -3109,6 +3471,15 @@ dependencies = [ "syn 2.0.96", ] +[[package]] +name = "serde_spanned" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" +dependencies = [ + "serde", +] + [[package]] name = "sha1" version = "0.10.6" @@ -3153,6 +3524,15 @@ version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" +[[package]] +name = "simd_helpers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95890f873bec569a0362c235787f3aca6e1e887302ba4840839bcc6459c42da6" +dependencies = [ + "quote", +] + [[package]] name = "slab" version = "0.4.9" @@ -3292,7 +3672,7 @@ version = "0.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e6e163a520367c465f59e0a61a23cfae3b10b6546d78b6f672a382be79f7110" dependencies = [ - "heck", + "heck 0.3.3", "proc-macro2", "quote", "syn 1.0.109", @@ -3331,6 +3711,25 @@ dependencies = [ "syn 2.0.96", ] +[[package]] +name = "system-deps" +version = "6.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3e535eb8dded36d55ec13eddacd30dec501792ff23a0b1682c38601b8cf2349" +dependencies = [ + "cfg-expr", + "heck 0.5.0", + "pkg-config", + "toml", + "version-compare", +] + +[[package]] +name = "target-lexicon" +version = "0.12.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" + [[package]] name = "tempfile" version = "3.17.1" @@ -3383,6 +3782,17 @@ dependencies = [ "syn 2.0.96", ] +[[package]] +name = "tiff" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba1310fcea54c6a9a4fd1aad794ecc02c31682f6bfbecdf460bf19533eed1e3e" +dependencies = [ + "flate2", + "jpeg-decoder", + "weezl", +] + [[package]] name = "tiny-skia" version = "0.11.4" @@ -3447,11 +3857,26 @@ dependencies = [ "syn 2.0.96", ] +[[package]] +name = "toml" +version = "0.8.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + [[package]] name = "toml_datetime" version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" +dependencies = [ + "serde", +] [[package]] name = "toml_edit" @@ -3460,6 +3885,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" dependencies = [ "indexmap", + "serde", + "serde_spanned", "toml_datetime", "winnow", ] @@ -3590,12 +4017,29 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" +[[package]] +name = "v_frame" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6f32aaa24bacd11e488aa9ba66369c7cd514885742c9fe08cfe85884db3e92b" +dependencies = [ + "aligned-vec", + "num-traits", + "wasm-bindgen", +] + [[package]] name = "vec_map" version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" +[[package]] +name = "version-compare" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "852e951cb7832cb45cb1169900d19760cfa39b82bc0ea9c0e5a14ae88411c98b" + [[package]] name = "version_check" version = "0.9.5" @@ -3845,6 +4289,12 @@ dependencies = [ "web-sys", ] +[[package]] +name = "weezl" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53a85b86a771b1c87058196170769dd264f66c0782acf1ae6cc51bfd64b39082" + [[package]] name = "wgpu" version = "23.0.1" @@ -4631,6 +5081,30 @@ dependencies = [ "syn 2.0.96", ] +[[package]] +name = "zune-core" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f423a2c17029964870cfaabb1f13dfab7d092a62a29a89264f4d36990ca414a" + +[[package]] +name = "zune-inflate" +version = "0.2.54" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73ab332fe2f6680068f3582b16a24f90ad7096d5d39b974d1c0aff0125116f02" +dependencies = [ + "simd-adler32", +] + +[[package]] +name = "zune-jpeg" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99a5bab8d7dedf81405c4bb1f2b83ea057643d9cb28778cea9eecddeedd2e028" +dependencies = [ + "zune-core", +] + [[package]] name = "zvariant" version = "4.2.0" diff --git a/interface/Cargo.toml b/interface/Cargo.toml index b4c2952..8732af4 100644 --- a/interface/Cargo.toml +++ b/interface/Cargo.toml @@ -20,3 +20,4 @@ egui-toast = "0.16.0" home = "0.5.11" atomic_float = "1.1.0" chrono = "0.4.40" +image = "0.25.5" diff --git a/interface/assets/lizard.png b/interface/assets/lizard.png new file mode 100644 index 0000000000000000000000000000000000000000..f76add009e506326456ae95214c8b39021b33b60 GIT binary patch literal 26886 zcmX6^by!s0*S+*eqolNiAl=;(Qc8Dscem6_cc&nO4BedyNQ($Vhmx0Q?yN zAT$C1Zo#KQ{{Vm&Cjji50)TKf0Fb!mcc_ViFQA(%$-f1j{{0nqm#2ZxV0gY$k;T|U zf#9fi! zlzyouB`dXebaa$hy>z8obez<9)iKaeP&Y+=?;S+B zmHJ_2tHcH*8sD6%8tPDB(43SItJe_BAom~LmN%VqO!NoOFfQDfPp_${O!2WhYFJ?0 zH(6xHy-B98SkBV$B*YPUF>>KtOi^u1jzQW3i?1*vJ}5k|)Pddp5yL|UhI}_Ct2qMi zcYgSoq+05&qrJ;KI{LM_JFT%K^{QYn*gb&rrIeF6ubgKdqV6IdMzf6qp28=&ZfQfGk-yM1KnltzOts^ zeb-B`{xTE2sAR$f?gd>ktC&bFw6qGmha*`?0wf;hM^zjW(8F2B%FN9}s09%Hg;$JF zdV)Yiw7ZfyL>3o9`|r)WU#_A>9KEH#7k<5yAmbTuWj;91)*?n6MCMCC0g^ zw|;`bB9d3dj))oTRuWZ^IhGgy?RyFe?Ki}g*y%|qhW}+MQ4apuLR(5F-l0IAatef` zEPYc@aqr`Hh=KABzluS_)BYl~REo1|rRAB0vh&J+y3ZWqi192jk%IHKSm%t8ln_-4MKU14oG*yUvH!|s+V@wR1 zLZ6+Y-TU|)=~b%}>8Syxzo%w2MA@zNY6I$3nSpt>mKcw6oS-WPl^Nf}G|QWfPXDPJ z=Z0BFoT!hjmZo4V$YOQWq zhkWV^GrAN$Lxn?LBG&6CL#U=*?V1mQpcT9ZWW4lnu0^AC@q$PTDb%ia;+@QoJUzgn?)V`Oe7Ul0ranRMCBeZLqUC*Y#!0_-BYt_Xq`SB3pE;J-mGN&=SfAi^oD#Vfy6qRFsR;m=I8XS=tAl?*V*UcrXL6g&H10W z%r4WCuoc|PX*}Zy1v0{gHfPov|X9WqTk{v#bkq#M7DmvzBlM2b&l9s6qX zRA-%GU$uzXo?3kt`>J0MW2+?nRRpTBZnstU7-Da_2TNK(ErS>*_g96s2l)90RxD{Q z-0jTk=19DFHyT3w50$G%1sx6@QTVqO3nk#{=O)OBm47QqS1+EP`~n^evHRbq?=t-o zvn=;|oP8$9MZTIfVtnlXy~L+CusDDrt&m#wnwlzdGC67NOQHpaby8%00U1i2R zf0~8AX7BvI4@-xg3{^(q`4X>Pz3V7PbLH&Gb=M&8D=@1_qf0ZqHOQ8PMABF2M~)`_?VtuAv`TZ;-(_UT!=QH7X$yxJqL=#`A+^TV z_^7g4*dI9`Do^0As@J2IlsgH#M!UjRx5rQm^DYKYkJYlvD)dntscyJ!d!+t zg-CyF|LqcPYP-}_25tP{ED%54fK!R{@l#ubJ9uYXuy(|%ziIi^dK~P`WxzR9*-}N# z=k#$lwT$p6MEs3IW~#a(XFn;&TATjtuSvEglu)R{VO}e1`*_4qHpMqZ;aspe2QJ}s>rQ{*8*6m*29JVdCfg+LZy$mW%-?@ApHxrmTnOpXMLMST|T3+Ir+T~ zXFk1>0ySE$^xxh$C`c-BJq{GPJp!SuAiek*GScMvuM0c*h$LM zt5oz#s#PEnC`t9RNPfAS#gfjBXcD=k7O~_dJzx5x4#fW$)e8X&BqfkoC>%VTES_6q z*0&JrXBHn6yjE)gy|P_nXgL2H*?5;kwb{n>U zn3g8rge~VX{NZQ}UUMYe2DjuUP{x-$1egTvrK~l^nhq>5{D79ka-YMti`X?&^xj<4!%<2ZDvF!S^7j(Ly0g5E)4Y4< zYHGN<**R&xi8K*Rkq}C*AxR`!NeBus1OYe)0D$Qt3DFinnM82kxicBu@VWjH4Dy;EovYppd(<#c*( z9#6yj=Fi`h^P1eB73_-+OI*#Tfw8uHGe#0(((%K7GUXGIj92BXJ-mvDoVUSuC6=x{ z(WuScZUe@^AJ^<(2AkLyu-EQ=*J)k-CX=n`vYTiuv)6gbizd6yec0v}#}B%ejCjm? z$b#CzphzEN)c{&qHQi4+B`~0m-sA1NbRslbLI@gjnR>2@mKK8^X2eI6_hg$Fca2(S z1_Szi5T%A+HF_+vYF2tX6Fc`7Z2cgTxjgt$tum7dgSk@(_-x!)#=uJo7WkVWwC_?o zn)dqKC|FE&oBaw_>>G30gv)ZFl)`S7U^>^>or>{(t5vPr4&nlpeSXK)VmC)kEA+XeS`}zvz_-OI4uGR;YUA zO7YUL(0=?itL@M6%WH)O0#ALhMs-u)Z))n6_Fh^+;kgal^`IlSjQ|-sKuV{U+R<{zbRz13msw?G#{JSujIxv{W)c~gazoEU z!MDxzzP--@Pv69KkaPOig)ge%Ltgtnj?*oA4@0V*Ce6i@!k%cM5ud-^m$E8F@l`C<`CN7K8NDWbYT2rNVe?+-F!8{@ zsjsQ;XB&pd<*|_W&gW^qk@ z74ZvZ*0`SmlPkd&F6*e-G>o?3Q`v=(@pym`c&q@|X0m~_mCr$=vc}vTgp_DN4D-7i z5=qm&R`A3$V3d@+(FiUW@z9$UR>0b!`UTT3^$Q;op5+=~;jg~LcyLpzUpV9SR1AaW zs#gvUP~1Aai`nJiFle%mnK}CM0cv>FQn1A5pw%jO=zePDIzK$in=okAsAQrtBPiW+ zymT=b;o`L5B9XY>V$Fs{wX#qV5a`IPmlA{|F{$?65elM?xAoeyFYzwBvYHphP0n`v zEus&#^D-YyaLwpP+>^YGP>p|hCLkO2m?eyuj&eQw*@2HdMUIBT(>FYoFYJ17axJ7$ zQZQXjF5m*M(mF?1dHD-A9IZr{?eP(RRPiQ4)k|7|hA{9V&c_Q}@7?ufGG~W5WT31` zzH<`5e?IsveJk)erl~^@E#8FySwhvk>EgW*X!KNt?1SWC%QcR?_1ed~CaE#JhsTB}Git2tH-iXo8m4xhnUFg)oEh7d!uE{2 zgab|TdBptxfAI)G4po-mn}gF2#sMFivt-GtqS>_|EPzwYP*~a`^+Xv&UR)!>=Cg zZgAs}XlR+$Qa|6@N}0(JQ}sTnm9O+88}kGg#o>=G!0U?TL0sosXwx69l?Q+6u@Y6t z^|NMUoUw5*KJ+KO&e=dl90{v|W#i&Yc*RF#3&@K0G%8Qfn zyuv7Wxo7zEUS#$aZhUeHlhKm5Wu9}9{6usei9v+c8=X%f$I(ckn{7BEt&WS$d>GB# z*cBs@xJDpQYp_N{g%2lXCkXl2d$g?MQPFPB zZ(5Lqg|N<5Xg7k$dOYsI=Ft6JW<7i%5f+04K2lytg zxtUINIFWn&uzqnP`7X1gW$*jBC<}bC&Z3cvWIB8~+%)w-)$i#>z`x}fX20*%v88Nx zoMaVeeJ?JM#ZuSQW~3LF%oJCk-}0Iik&6yE*J5mYS+VucgI%`oa1dCeEoF$I6Ge0* zLcIc>My=W7VqcxGmM#y4gB~4&;dM4ZqU*bwEgR~9vofjo8j7_D{uxhjkHA)E?SB93 z0dbd2{8CEue5y5$@Xn;jqCXkY6vWu?%4J3RMvSlUDQh)0s|Tk4XC0A05WPlnDUMOKG@SdC(( zg*K$+_QOS>#uLIoMYA86mjvI3H%H)`^o7_&*ECnoK?D+~F468Iwm6l?mcyMZj*!3t zjc9S=eHkD5n~Ib2`{*{ytFTs`8Cznj*H|etfn?>ENXzK&CQvX*0WaU(fUUNxxZe_!G)y7;&1=&)GJw_stcci*K6Ov@&)rZ$~TzR{5bNvc}!lVDEaQsK|&j)9u^_K^vaSKG62)~ zhk}aMig;o+J*7BL(H_K>eC)J)xyTzhogOK&h6^@@G2-i(;+kP|w)(YP4{)($e0J0; zfbQVbPrm2eE|0OI`Oxl32kw>Vs`KK-D#hui>E!c|r}4PO>r?Hn{Uv|5m9h@!OV}cm zWNYb-u_8YDkxKrknDn5?v;OL~JXo1U!uli&*99-qWZzv7u@d88E*8TRrwn2j?TLMB+({1)B$6?yL(13FVl10wyL^YO#fDKK8NNYAGzkeu!HsPRky~^#qNZPcg z1+Fq2EF%pp+ZP+hyH}=-OL5JtTY9~6hc7c=$oDKoetU~rKxh|dlcVc(U9b#I6^i(I zQahtX4e5|Qo~|bu&~muqcRL^?gTzRZt(d^{F0F^usMY_F+`|;8U^B192|50I!((kh zRVil@4PM-ld9K>&bv##PhFO=2g6eo0fXs3XQWeg}M?Q@hf2QJsB|LwB8L=I8Qz7o0 z`G=^QjOpZN$`Cql?86vIbbqX$!&eatJy^%mUV?{_@11rSQQlnz-alk{8%*BWHzY3o*X*dG(JZ~q=tVvd0`G-C zf8o9s5Ke#@^J!7bLDbuY`ts&qWqX>I*;&TX`{A`>$@@4g)~4%vghUG_jV70A?_U@u z4Pt+yC`f7PNinViD_+b~$C6Y$5cZ=*r9T9NBrikkqdApNx0`@rjRT6B}r-c9CA zGWRNiUiJ-%2~_Vv4v=I9Tc`}{fQO!B(ork(cm@u1v3ZWs4NK-_=HAKg-KjVpc>Z2T zBmAvL3vSTjWfUl_z<&1z8#%ug-{DX(l0hb=xZmGRF1o7rFSXy1z^j`_$f_Ou=u)Z3 z76d+MZG-Lmf#2>~TVNQVK`_1$%_C6iX;=|_C5j4C$<<3Ob`O_q{7RENSSK#K($zy7 zlaW^B+9b+$ujKz5+YGikX-rz3i6$B~yh5JSp;P=hbKKaIi(HWJ(OE}K``OmM(Y1F1 zjN#AemX|)MEV8K{T2a!Rmp4IpYhEFHZR%CGck=ubj6Q!A*;E{tV(3um4)Ctw$Mc%N z{}Kh%yV%pB_9`Hky^Y<1&exl5~&M+ zZWH;>7W|`1A-|))4kleT+&O1;uY|~l^-fImPE7rc3D{b}8cHGT#w*U~6+a3#xE{+~ zL%*f?E1h(E`}-Ch6DjpOg3CbmQ!h^im6Y}!acAq{IQrTR^5eylz^=nCa^;1#m(%j_ znr6j^ce9$QH6n4(fUdKJCy;D*{AMRk`Cg8se7(0}9jtc+2CX)E0l3FHe0-yOmPv~d zmW*ZDrRGl3fk;nA1^&EMTJN9fgaibxQnW7I2aI<(^XvIPmS56@kdt!_8TTHC@2(w8 z*EHrDFA@)=Nr;nQUEEUUo!8=Xoy)MLyRiM>`KFux4FoyxTD54SzuV+<^VR%}&lH$1 zFx*!M`(9~$rJ}?JM28E6Lw0I2+U*{^hM) z?KtIw!JbQlP37rI(arvvz!FJ(hdx^`^lw>F&JDcv( z!0fk()}GPYo?J)6qJf87umwopZDX$%0f7F0J+iziWi4SL0CxW%Gc>tFsR28ucv9|t z4TSDqSH64Jd;cI`_(#`{)&EC5`O@;FC*E1PN0{kz2%3Xt4gbYhJ%pC6yIAV8?M~U$ zYLDlkqWHzEC1tCigWmT>^94*$l`s#`b~1j=;y&n3G!K*G?+y>ly3ty4Lz%1cJ$p8v{=K5*@FJ3i`$WZ zCLaT0Fs~5j4}bA9>D!$ewQ=(b)L~ynK~YBqy>w>BltaP0lTdattoJ`)ujA3Pmlo)A z%jZ~sx+s!h-O0z+YkN%l+JQl_!8y!?@A9JIr2O$qaWJL-3hXzMN%kPqx* zOxs4RkFoyNwq|<~9q0WPUYjGF74&eaLRAZ=fw)cAJ0^`GN_dyLWFgG30p4BR()k04 z5U!WlyjP=DcA76Vyzuy|Qi+77R=}I28jj$t%-%KXtSPn5i3Gv`fFtB`5(Io~P*K-~ zb5wA1!p*<9t)TP0(Xk?S+urelLFGhB^Swm^CNd%%(tkRpWHvAGRv8_qbW)o>oAOh7 z6b?Mo#a(oC{)Lk8h0&cN8vhIf1#w3EFX7w-vAyJ_yqZ?{F1aqEVxqDU)lu`cdR#v~ z8TQ8U0GW2{thsXO>Ja4LiPIKrIUC?$eX+W-$l-m|2*MykMZ*6tmG_}lD9W*Ay&;p2 zpIzuMc!z44ERo7_sgno%J((?DiRs8(pr@`GiJv-`huw+s1Y=}hYZG<>Z>T%%8T1!}4yIK#@Ek*+hqbv@4!isB-V&|a zxSpuUlPjWu7^GJ+Mzy}EwZGY%X$cbXf+0GrTNiS?p2gC(!Y8a=>&9^sGq@=f4LcIE z1ej0WZe}?)FVy)7f(XMzaBnxEmpups5@DvHl<()o{(N(zko!(@QoG#5o@KNL4>SFJ z)*<1$F%i(Q>{j|#XR#6ks13aAm3fU>Q_F~Gvnr1w@fD410UQGR72w2XZkrkom4$vfinO?c=p`EosK#HY=xU z)e0I2!LyE)=*yyB_mRGH;6sI@eJm|0W_v^0Bm*giOn*-|mFxTgYoy3_R?b4OuZAR~ zpf@nZX`$Mie=A<^baB?6w{lG|-|+j`A`0X5Y`4>H?b;(Du+B(5c59!QFZ?)tWkSs7 z!~fABt-0!|&OUM!832;nTNfhy<+$>4OpL-&-3LFL$8w?8 zDb1)BA$?chSFS)E80@Je?s>H=72_A8;l~ysU~%BzQl8q%XqrH;Qf9}W}akE{OD-bk>VTUFMh3q|N{up)oZZb=}S5vv$6tt2RH3;Ig$ab6)7ZMpp$qi=+ z^kKr|9>hzJ#*O3F&D+K45uic_w#rgmsDNDfv{^GV%$zHSZX~kH-f;_(b)dNCu^XgJ ze`7s4-W$YM^u#fe!FnS7>F>V^MdN@3ihLU%_1*UtGf;-{$P?uL>Dk_u6V5p0r0Tk{ zw2cmL|AQZQmLn)H?0;z!q5;MP-1EWcPqmIWS&LEI5CbDJ;}a)z_~c_}k2Xm5A3SFg95^Ix}MkkAZChQaEmxj>rM zB0$?kFNBR*YTXyJ*gki{o{vlgC`NP)?=tB9z_3Alew}kEFlEx_zE?{W=QNl9#`DAI zP9hH;5-`r_p@8k>uoScIYO$HPJV(VDQ#1c3TWC$SC6`S=X-RsqC%0lVwoT;jc!B5= zX^RVAPKryjT)!H`e|6NR!;dSuP$X#x{_Mq1x6^}+{tqYa16qk=mfFbu5jc9b#=TrT zO(28co|#VLD)j3ST5+Z*l>{HVd@GcX9)4P*T2U6Wba^Bi^l0e(lAJ)g>eg|TWG#!s zh=0Y|Aj;KbqPex__6H52yNSx2+gLp@t%^q8FDC$?*g)=IzYOYpHTDt{pFHE`<#Vf% z&GY2(-`a#sL)RnG7yvMJ&g=}oAH;Ic*?J4H%Pst)h(njHvUAIa;H^p9r()G><<2@n z8WJ4be7r7e6=|~l`rK%*NWV?;G-K+?XK&vsoVK|Zoi@GoJmQ=}_IBMJP^{>~0-X^3 z{65r+0cXoOnw^oM>ba`18#{~%YhwoC0^0ds=l4*eV?wZ_EmT$W){<^HitgO7;~ zLb@x$Ec{bt0euAQgNObdYwI>t0Uxb!oG%r@_k4I|+j~4w!4f113r)~eJ zt}7(wx$d+BRkJ)T7VRFEz&s}_x*Yd^9jNd9DhS&G?~X_S$r+XnE7Kr8M5_xGpHpBH z5BOW@s=ma|ng^X%WMMjpx@fy9)f1bsj;QZyA5Jj70KUg|x$SC~_V=L+s$)hZGj*nQ z3vw|qZzgiheg4s8TndV{rdYK_BoBoG>MtQoW$a1h0Fxwwku7)DVf^v6zzAAqOSO8> z&+*z208oLSPJBey+=ZN8ch!d6^pt$53QU>3Q*5{&8GE{0O@>Gq_L*N;j8n_nl;J`52-J+3w^ayfq)*C_gCZt1h^K2*pb1v z4pd5Y+h>9~vsbs>KyihAPMdG#ATkhUYPxc%BGkCO(Nt}BtFu|)9qpawywv2oH`Dq) zU(AXxkM5{S0{{B9;QigDKL8k$3bJ0oo^B!xqMMc9wkR70jzvw(7Y51Wfnu}5WWg+w zuwzBHz_WK`Wu%+~Qe5+2ydUlY{(@!-NePZywyYV)SEgnW-?l6P)6$!H6o0VD2&uBu zL?HL~2|V3(nH~C*q2kai>+obuR6b*Qdhcn3Vhe>zl|59gp3<(Y?IDj?u( zl|2e|4`u}Uh50(~ZgsBuao?)NuGKzr-C1hD7L?WvN@hNLJfjuBntK&buSa$EA!JU! zlxegIt=F=3Vh38Bjz8e&v@Z%lO~#siEB&uq^_U;STbniLjCrfGFZ+WxanqZ6@oHqg z_EqG66vGUiMlw|UPa|W;fI+evB~XZXqL-7MUS1WhvSKM05%I(dJoel>1jlAMZ~L$i!)LtoZOQ{S$=IXh=JQjEMoL8B(@N zXUlf6M;KlH(q{1W(cN0W(M5cR6OyOmGg?}%zXQWAXfm{kuEJ$iA3lNHriJ)D<^VIV zw&Gf~Q~6}|5{Zza5ma$onk5B#H>Y;+P81OHlf!g(?vz@sveftJp zQ81RkaZ5rV7tkes{~+@^alT4hOT%x#FL1R*#bAO|=%2?XDYo8R zkxo@o1)LA4L|P~cvouB>!5LNG7ch@`_6FO&WRuaohIA!MEfUXny^II-x9#%C^U?#= zIo=(-Tb7JU&fQMWhMt3CXD5+X=VeiRY~qS883N(-Wq`Koi(;wpMOcgv#=ZRe0(@WE z-@lMS)njZZ%gi8VLciJE-GcXx)e+=|)UZ5@-}N??}sd_21vwK+b)vyg`^o!9|w5NJ;Rmv!bKs-vlhd zh-9dP=y1Ja>#InEi00fHz40CJ`ym6;wunN?@~I-OGQD`7=001SeRbA_f>(;a6VguS z18YICK7~II1WUDxU6a=JpAA^Txh5ArdoW^=yyJCT>D=6EpF!_Wz5vkjs{Y3Nw4*S{x}cRow3{N5H! zFyY5E7kxhaOtlapX-CYjKjhJgD>N6X`}8AHs+d46!U6^VYsLMOsFRnG09pLgXn>z6 z?YoXiWp1N7rsy=gkj9uH&$BH%!pAOg4%oKYeBvA z&BjeU?T*4S7%ppmJF^=uf!E)@COsW5!0*E(TXf?H)HNBn7_@3ftn00sI}7kbewdU6 zmf6t_Nk=uW{-b()ZU*v9g1+zn)^nP0c>h0Fo`6Qfd#oKX4~na;uPB}>EUzwG<{L97 zT4R!8Dvhccml~aypr(IrpOtphkfX{NwuxLR{%$6>;j+!OZr0U^doFbJr($!Azsfoe zf#^v=W{CK^ABX`~tozBCTI}FIT%d-Kz|S4wX>^5w;>f}-43c2VF>wT$RtwI}@9*pl zK|jHeRJel41QvB~PI9^_KB}^UwBqk#@dt6gn-JF*40oPAgcg8r-L4pD%w>PI({hqT z)A~Bp^#gXZ{c@MGp=c?5XJtunpdSb3q8&GD_nyc=)t!MZex@htqH=lZum-((e{^Ht zC2Kfn6Euj#5@Zr>*XtCCdOc!e2?bppk>IWR6)hn~XgIu9%JG$74aO2T3eD`lMU@O2 zjTPO0*r-~{wCpcso_s&*nwtRP z>Nu~p>2R6V;4oQoPU#uB_)48pRho3aVWBuVSx*IvQVY z29#>hmXq)DT2`p!t=c%f&wJ*6`h|i4MFLjFMk&re!YZx*<=Kt5I?j9k+$~+0F3Cf@ zeoPtx*(HmNn(8ddS7v=3nPiIT!ol`%Qej3J#-AVH%&(LV~#?qAS zuiS$4DscQhxW*8xemCzB8H3_0TFWz%HTV}pHk6GV<^J(%Df}ogVck>@?hpn%wJyCe zb@Pdryw-W-K2F`4>3wT;q~+=E6gvOJ`kVvr8)R|qIn?->T>gV;(1`117`w#hvk@3K zl0P`)rlny~YCbfcEf_qRggm9xu>8p{?_E(+rWNxh5#A7J^z7Qet-hXbBUcfLTQG}Y z47_y$wT1L?ZPTh+>+_?-Qs@)@;eYCyTH0GNMG58tmP0kJP*VZ3B9Y@tjc#oP?2Q3B zXD(|eUA<0iOUGT%L!R-MFj?1}6%-Eg#CthX{~I8^lL^aA$Xi=Gr^-~k2KfrmDU??I z(^0Wv!Sd1eZ&paH9%$oKdwzVhycs7Tjvf06yF>|W!t5V89dJH|4P4CPI<_312#6od zmsFR)0;8HNg7|tupFmTm7GdP3U@QE5TIm?f2C7;I4Gq6P=z z(Z707ch_4@;geVg6X6>9CdOtF#MuL&*YKr<|# z!4dY<_M(^TaYf#|g0%x3nn_lTky#}f6f#$=y>i#FGUz`>Ty?z*=3*h+Ml)|!!a=j+ z?!emty%x=o<90ZP*bk0{0#(-dCRfJiEMtNL?OjK!E60xqvsW}&d*)hL zSF@~lBJ9GK`s(Jr0o1qakphipt5qnppY3y3>;ryp41?@r-JIoMM)Seh;9FUErCQ$M zf}d$p)pr45gK@ql{i?Y-CZpJ490-zCBYArHEiOnNrX!dA9X7E!)%&hihQ)t>sW{L) zY)m#v_zf^!9yalDSYlqGVR!J1^M!06bwPAT>HgFjbkBX8l9M9lMy|ql1DWokcuKOv zctvl9tNouIqbJ8mp(_b~zT0|^mLMySHN8x%Gsn%d&|=3D;LA7wV?&@7_D;(+@JDmI zom!^}@eL-s;vmud(@!cDFT{P8mBOCKKk2vof+n~2ipM$L3F~?)5s$NlB;%yO?*}f7 zEsnp&5m&}0eYvpM~V>}%Ys>RvkP{zKxRbcv)E6&68rr0ph|YpSefa6rQoDu8MMtqg1oD+Z@UoN&W-7yMr>6i7p& z2{5BRJ_JaZa~bezp@f3cTlyV8xt2x&|6RjHWufmb8pI~G9GhCBN4Y(j^tM((Ko)W{ zP_m)gNyld$O~Vw`^JMxKlpGofD@zE0RkE9rX^q$TLqwzLc@o~}EJfd6E6R>LO}v?v zR;SHgG9S^;e9i)Dc{9BOF^FYjpN4q21r^yTTk zzn7`EWUI`!Gi)`h$Zk`3Av9H9L?{X5svd42&q@9`#=1o-yh6KATDfvf|2p#fUgA+$ z1J0X%DD`76ydovBNX+V>YD9DxOkQ9QNZm_OY6rS)Du!azKc3EhM!h61pD^PxNHt_e zp+30!-DgJTv&7Bma|wnENZ$?gVUccvw2QN5dGL`;W6sB%rLZdr{W58W`o0OL|NmYq zZ9;%){FG5g-PH-wjLI^KVi?_L^Bhe-j@mV_hw(B>N=iV4tbP6GyB;bqm~&pTotSZR z?WkF*ZkZYmIlucEi7u5)^v_7S)-8}vlwLoi6Yu7(t2b@ugDTUnosgGwV~SeW3X7hi6678_{%7m zX#70pm7HB*$js97i1SF35uNG}egoxe=J7l#OUQtMPq3)=$?!wI87QhM_wx*Y(;nywS6()hhBW?Pj}~9$DfRBA{MBl%*l-}II2UA$3SV7*PWGhd~q%~w(AWYOlO|Fx*%j0r~O`hVVUL4PwY zNM?xy@6aQNUig}UV98#m((iQNYHnJxG1K45M$G*zTO#vmrBMd1_oO&WtnN-^0g#@Z zY;I%ySSIEHxerS{XU$geDK}+RYmn=yD3zND5(5Wsgbtq?<_^zAXMJb@NSCY7#(ojY zWBuyePjq;R#GjJs`C%Hps?E9MnMs9Qr?XRQXn>a1*kD%9{oo&}!%od=T{56S{d(BG zBg;wmVXv(goIT;Yi94<)uFQ2=h+r)&h1!)_D2c7!r6AALvshQ5VL~>H3j&Y@TM1@an2s1_u6W_!omERplnH{jPAGsag_8NVw<`=G@)dUUYb!XtA1Pj(Owfr18*dA&4{zK%4l+Ixx6nBwgu_;fK= z)a`Nk^G0t?xyqnh8~xk~6MLKzBUEww4XFLSPcK9MLd>BG9);*{AMSRlm4-9ShrCuU zCj$M6c%D8YOMg*s#{~N3a6lE&LM2jyEkESwXJl2=!WK4UGnv%huvH42UC0iovs_UG zC(mfZNLH`U9_U^t5h!~aO({wzTK(!N;yMKlemjYe^%ik0_EGzzXh4DboZvgiLcn$3 z!_;4sPNy`!wJJ${!n1;0wmS4v&|8B93|)f;CeQ@?JvP{JNuwnr15Iwnvci!FS7sDn!H`6F$M`}DXm!mo# z6#0yHAxP4b#-bA5b6Z7Ek4EWlmD*tJy=wWom9~nOVz@w_w-Xq+d~;;g*2GPU1-t(N zAanFJBCmI=Hf>jRSkCHkl|lv#*@@LsBO3)ur-t*b8y+=pn+B0GaNbNgTZBcSS|ICl zzl+$_?@+T^vC}RnB7$&ICKdTlt{h|o((Ze4_N{#;_~tGNH0%A-ZsyNKRXlhI$>+F{ zzJhWc=+8`J2%B>>n%Ypd7T~cfRp+WIr>M8oQXsUs=Yl(O@A(Ilp)-=r)%YPmd5ycX z&G*n<(M|zdtNMdbv$05A1uJIg`gB&&7n8=L?>^#aK>P<|ts6_MTquDwgf+du05Z5m`IvVPQsS(E#IOuJMSc(-MC@ypb1fX+qKrpN*_(4={b)E{L1qZeeKThdV zrd@A5n_$ojTR0jZC=C*$Q3VEmi82tC`-4u957IMKs8`QEwo%58_=pvpjiR^fU-&VB zoi5@-s6-|^1!&j?rz@+il^iwWp$=#gn_csDnK-z|%P_H}CdXf_ap_iNoOwPjPZl>N zA;I~>zbvuZvbEq|m=$k);54;^=A3Wkc&iwxDIx9&X${dE|JVsNZbICjH&4 zQ9}`HwFfGDYRWdCkp3+bC$IhunF<`2LL|T4lMz{EX2QC0#MYdO4N$(f(+|FjfY8cn z9UaW$0Fa@ES5NhUYHIn7cghWW2s55wo39-@IS4T+)Lz`376hS|#dBB|08vRJ>g5~H|kNkh?qw3h>11gVJ za!3?T3WNr{j-zj^xQ6ns9I3BP;lycrW3I|7s0T(Ocn4gN0Z_i5#(a~9|BL{141fd6 zpnJI|*LMQc5QOqUpw{%|192>xL(Y&g2z5#hR4-5T>)o7)wXm4V+|;;0=|QhG==_$_ zfOV%UXUdm{CPGui%)g`R{wj>BJ6FIqRd%$YD|`v@&byPU2NCSObrTfHXY>{FLRwR+ zpml4?t&tJ*v469!=N39ES$}RAZQiFZsW8)2Q>{VW2HI8=i-hb5v2#+BB0FBKw9o8J zX%h;0U=>u-S)D7CfI}9jKu3*;V{;8Qxa-SKp$Msv*O0BN^gX*WeW9 zv5o4o&sK3C7S|+G^@%iUPRWRN+l&C?|WufBt$P|c*^8Pz*PqTK>XKDGcK zOE>Q}aJHW}F4RwJdj4Ak1)Vo?!n)ZP$e~UFKE_Il_|D?&v~0XaJY*_mo4?B^iZ(C&grv`! zsh*h;63T$n0?G&~LdrUQ`9%B>&Xb8GP?$Xs1HH(AtFSt}Eix!{K~k-?ITn`AVbr2M zyMGYV9`xj_GDCyq{hwY>+n@P39ge52Kdt}$XY?2rBhc`wmQ@ZL6WvZmU*hRuDMCmi zsX*MUQQsne8U`iC%32pDw3~Y#FH7}TprPu3}Hl57(&Jq;{)neB<1*6YM zrHlA5e)70T9`2PlI9h@cDbB#?u7ICd@NjlTZDFk{3L0CdO<8}_epFWbtXHWq>Jix5 zQUCySO`GdIX}j;qar9mus4(-LNQ2boYAMDzG*CH;%atN4J@x*NSP)_c|3AC0yAF{gc~}c=&fzI8A?ov4hZ3|O#iH?)v(Gm_5`}0K2s`3pMjBqE>ioOd zSLsE5r@>!BV95Hoytrm1TZHIV@tTmB{qqQxP)=6R4b^|wH}h+8bg%aP z3ql#(N=kgf+6(QW|6L`nv*lfNwh%bd^67;M)R zQHKLjjX$k(kL)`L}Pj>o`#*xVK1XgTHF@ti$obB&{HZU!0yA8kH zzAJfSK$A`XnLg-dDB4Kh=X=_of{-Nr+jTtDoqIkPP(xBJkZ@>SG|yMFPpNwKT`X2x znTyTS2%OPpeFnAH2d4&&sqW*)HrYL=VAq-3EbEy*d9^*I5Tu6@KggfPe_72Sqw11OaKJRZ0mdC6(@y1}TviIE08u zqjbkPbT`r}AT3g&fYbqLxQp*^<~MWio%@$F$mYb}d%f#@*7JNepEIs}!sB`FG6z+A z!4^uU3OGNxvwr4~%4t>mY*A^9B0ia4yc>SUmLpsKfr!ucc($$fxlxu4IWx68`1iKoi8o^yl$W-*~q|xEtk@LJqSWlRHa%%nM{a!U!U2vvr zMD$d6?zyX<2Qu>Vh`OEN4L&b-I`_ERUA{aZQ$|ZUS7X?eu2pQZgloI3xWw5-xd5ZI zCTOG5Bk4T%JJgd$yRZ#ue)ijPSLKo_5g(t}2t9*BZ&p3=?Cy&@edrmBjjttr8KX)P zQmVg-O%D*L^05s%Z0j3H>XGRA=)r&B8(BvlCJe8CWV4R zg3AMQ(ki{|f?eD1Z_PM_Z|69r5)f;1zr7LMw@lLJ_LERytHzMwu#Naah|KeipkbM{4EI4ed%nQsJ#$A*%bI_sewbcxD<*&%ZR+r~ZHZ4|lQEgWQrGGEh3Y-}F z_Ac*A-mB^GEb7zIKB@R6o5&yZH zD=Aglf=w!EJY6IPIk)f2&*h$ZNoR4Cj$@v^Sx3poZ(f$@U z!~AnpY0=l8Q1|zmj~co^UW`hSAg8&}p5V2)Pa5=vTT3a1hD_i)?&|_;m1N(q1=;OC zys6qEVtWix>*E>ruNJ*U&s`AdUap%kDYMm0F#HfWZ0rL;fJ2+@J^iCuaZr~FGJt3h zF%u+~4HEex;V0IL%bEM-!`tDQXbEL}@v)Q_9xS9ZwV@?HOyxnt&(mzir;DdS)Xb{b+c% zA>75fu4MQrrV*~1nTtQp*6*h0)ab)2L@khME{T-9*wtI>1e-}+QbLOhYtab>sG)G< z%vh91B?zwUWfS9{qcm)S6^EOt9r%(VPqjqNz|6&o?leo3a`y4DONoCd(CDgf$q-Cx zP;33yxBXCZ>mT;kP->WyybEov4Rv;$#_dg?R2!j*XRuPUaXK4cZskm3?-~o(@I>eX|Wmx)`s>rbL(+|Xlvw6#)9(yQ4EgwdnyBIYQ@CUp#GE?7 z^(mI@FnbbknRbB6N%zXyK(4_W6vNum-JH0Bq;S%CLQ&tjwbl07dJmoE_sQRN2gnOM zGydpJ7U4)g(pq%R?(LA36QECTe0jxG1AR>?VtzpH(SQ_Xqtu3Jsg&EldCyFvm>ZrT zV`x$BQP z^gHtnWZ%AVyS(|NwFQbQURv&s`%q}M9E{-*FrySsgaOa-;+etDp)W2^Ucq5+jAgo? zPhQ{Zpw>Ts=8grdaLJU>$_G=#{h>}Gu4^|p@sABvXh;8U9W@;|6|qOaY5#m*B|-zG z1~Ti!_sXmw;9_hw#1zvHJ)^J2wZ*wVELh)Jcl4zR_J?rlIPqvsyFz`vB@<#&66Cyl z>H-!_l^&ls7fqNAI!(s&@k8#@{{99Jo6o}KebW?mym$T7rbzret$d;>5w8_lUNWwZ zxk0(>)q_iFLIc(wMdLNUYNHJ-Ih_!cM_;uY>!wL#r4vK+m^C>T?w!^_pj`Bs|DQSe zJBWSD0knANj_2WtHlQ;YC~owTwn^hrF$89C0O$oIVN-9om~L|_lB%OQ#A@6i+Eh@` z)!8w4e6oB``#2ENCSMsTrCuG-vDL)&1h+so@73W-JuE5x4+2Gqt;^f~f^hibXe2Yb z`E&=AwM<%-Orw628xKTYs};bi#dRGL#}jQ$d2*z36&Q)oTQW5OX89CNQUjDEyZ1S( zhf{!D>Cxz#|3o_nM(3fcFKxy%1Ksq8$j#5_ZWBB1jBJ&%`88XOUPFBLr#&}GR)T;j zANW?IK>cKTiC9`HTAnis-g)2o0Bf}VXlCKw0UO%o%d;W-@!C#nj4hSM_a(Qz73Xe{ zD+AW>`o38;#(@5&yl=e%`6KM1@0Daag!9e0H^@=9ctZ$JHKYkp3=y;HmeV*!l*NM= zW)#l81Ih?0ZL2-y z-ZCr8t;yo5r^O#=ad52a4Dz4LRe7#VTbB+g5po#+b*s6d(?>c_yuUJ*hY0i1`O@QJSkJ2e9pff!1(+8Yga?*M(}BA zzF*#-00my7nkjP)6lBBGHM)o%5(HIQJon7u-mCplrlAKR0%QqhHy2j@O+%ZKc24fu z#=rGRa126NCuucm*yt7)v4ghIH*NXpF`&&osL>1|QNxUO7{g==K5=EN_s zS-sPUC02I$^zxIA0U3D;k;1&khOd)fv_UKv&E+mIS(11jc|IOS5ttGXwL=3PzmQ?V z_DWds=YgwS>~Jr|t@xgJaa}=6$PH%2Am2Uq!0&Rc z7m=1#ND*`Rchw~qU=!f~$hq=hkfE2q(I9l76~a?Bjt3bT?3ACb4gPpD->vtbSYT~; zXw&H;wxEC-??GILzk`I!>9$<%z}u}hLgvM7uk*=Lcf9>5jh0bT3FfwroaQo*0qwms(D>e3p zPj9^c1PPy^IP{v++4O?U#XV2uT(8L&KQ@tOBnUsQGw=TXFz+jW?-CM_f9t(z$k)Zh z*FhR(l%kI=FVl|f9YqmbAZAPv@u;M2+Ea?y^Ch4fAW$! zy;y`3Uy-*&vyxy+Sy{!^bDFmMeZr)xI%qqjgEX6?B?hZwe8c_n?~2%Qhx~RCZNwZ=tbmxsJGWM=+ukSc+rbuE?dV5iPx7wLMFsp6Rv;2YnEDCS5n_dpWJzP zydX16d1#{iR1lHy*g_FU?O({o@46TKi8h+WgTkt*;t(C$_HOgqlH)Vt#>9byK5*!j zF<@dYIt9^cKkPzH&F=)1pElkb+#nXG`SW=|@uz~@(r>IAA<=Z{-eU-x?SQF$#>NGW z#2H9or8LF+{C5{j@{l6%@!S+puD^edc~O=(b!S*5j5!C@cF>c4NOkFy{FrI8w^qO^b4q7!T7LCDo*u3{7xgi>wj=?qFcaLbFH&B z;+JZIz;4IH6X8Ok-nkJB`L{MgCe(%2j|KU#LT*i79}+5@r9_a)8Sfe*kV}p$g5I4M z0FM+8!6$Nx6NkH^U6hI`lgS?+Vd5owIkMk1Q|i~-M8>cup}LyKxV-1yRigrM`1>bt z5v?L%8eUw#_=EZ%I>#1;2C@8}`>#a+Yb3VG#9%0IGE!dbjA2&*>B7hNH}Rf(<8_3Y zE;*k6vL|7+d=iRH(York0a8AeOS@2Kf{_x@!a$PJ>=U+JbM4y?61fkRT$Y9Gy;(f+ zZdO0!<7D4`t=aqRPa*Z{$_kJ@0LGMhA7hw{I!GKy|EYP2C`;rPeYXFQ zi0p|(Nk<$@+JaJ>!Ce{HePg9gaL#I?n>{~vOP-haF8FkNzD{r0!{q~+uqrr2aVr}V zC+M$6P|wG*(k+i`w;Awa0+IfG3sKSByFW0c_YOWU6cqx+0NXINnkeQs2!c4w-^!W- zDQy9bQL;L5`%YGzb5Mj?=b(N=%$iC$xqqUK9JyRvCFLix>eb8-KVGdhg_`MtjTHtW z^xke(Xz@;)a*JRWGIr_TePNk?2bQfHN@v$tIV$$h zPwjR+;c4RAk<-+~f3SJz8{K#~65K~&Pi{*dae*Vdh{z6GQY>5uR3?kJrIe;YF=HD7 zo6_Ko@Us3{2D1qq1ab8iZL`(xH)!d+VMC4SA)}$owDn>n+dOPs`wJlmY2jl%tvH=K zP09!S<`Ze{x1v|P!pgMe*`3d;BnPXfV|urg*Oq-eM)PU*ET`(aSlQj)xqht^q3jVm zekP1)geDIcCk-LN4b4B(1t&*C&A_5DCB$m}JSg_|@VRT>)*ERn5@ktB0_s(w!y~eZ zP)M*unPsw*Gqdz*bfT9s>D0MCc+YKj;?h6VTvMxnG6PolmC>cBa)!tt$MSz=dj=CV zF18f{w-@ZB>po}LzCqqh29h8VX zBi}&Zlre1S79Nm)@~_T@gE7cPOJN{fzrp9vb|ok44MM8SJm}#%R>zu(%ZG8osjrIeaBqf6VRim}nGszu}xU(pxIP zV^F(TF>%@bAwds@tUCF`Sm;^pnp4!xARBFk;`<`bD>W>AT1pBCCT6lr->*p@w;E+T z-&l@LC8eNikJY*EmnH?hmj+c;$TB6=L*Nq73Lg!hgh*h=V*oygK-51I)K5R|LqUm6 zm++Xhsp=5P97*=>B115-^jw>&&@BS@u1%e3c+Ao<6xv|8t%!yaMat%APm*V zO=y}djPs#oDp1RzT}33rWq;Om3KI9PT3oimo0}Ie)RoLmluupcY3NKc7%y(a9z(#g zIYq?gs7aq3lgK*6AE{TCaN%gmj-ON-{W6y?a>?d>!BawtK-j58AvNY{%}~-7-10h_ zn$nviq^7H*d33R|?^#!|X%%Y=-gh2Lj2N`iDGZDpZtsbHD#wpH-%+ zx7yXvjbGCeXZ#%UOd5xI@n3eAZKS-ZmQUbkf9pE(uR1DDxhc)g8vGRGB%4k$*AZ_(wcjxT(^{{S&Pd_XnYiB zXVzU2X=xLy^veHC|TaWsSmj6I%S}7j0~(A?P9#_Tv_~*-MK>;zOLfD@D}2plDLa$zQ>E_>m~PIoH-M&Vat%y@t39x zhV(niaPcxeuNffaht&V93Z3`jqEo~~$}ahIG7b)&%mc(nNJi^&Yo)HdR%63Q1JWtd zUG{w#=YTt)@u-=enpg8dm9YC_l06L$WA9v+7k$2~dJCZf`dX|k<|`gpJMMD~R2<^tz)i;A&W9vP zYjiA;9p~g^SNrZv3lstXh)4o861k4?JGq_uCFf1hZo4| zc>kK$^$=cGo~dH5vF#9?qaH1}ca*F^Y5L3LmDFkSgx{&&Z872QIMyKc0@$ha#os=e z|Cnn?ErJSTE1z&xD2apGF`&2EH`-x)C3)sW<+7&L{JrkiPHH3vfjGIq9|hDIXYd^G zUrFSJkyjBVECyJDW7f`}x({&5&v%Oig<5%n4r?eYOEM){Usyx#KIxJbPZ9OjxUS4T zIz#UfC$RFK=|cMInHj*Z2$Oa6$8wLwTt+G`f${}g70^W<4`Tz-$bV`RBu^2%LkbXtzk;9mv`r7hw|=UoQ1bkEF4# zo^Xl5nBPDF!g%5H1&`^YQ>;T)@y(xv)sCaFpxBLrxp34Dgt29V&*G+xL9)6;AsWM` zK1Iaq;44oxHAhCSJqsO` z=YRKGny{xp1EVPPeK-Os_Ue~e&c}MQI2gh(P1`CM@$*Z|kb`c-o1sVJ)QKz~{uAO-R5j z&2D;V9AvH=#U5z*Sox7t{r;NZgXzJ~55M#8*4$?oS!v|iSQ*!kV*$9!{MsK&sh66$ zBQ0CHd;Fr(EV}OaC!?HN=gH&?3@=Blc*|}B`)N?Wj`!e0q6@{Khv#!U$+&m$isDZm z4rS-yJ`KYauT6E` zw~++xi4n{6o=%P?&at9>qR%X%-_4W|nfEnI?F6^_9(Idl>ez}5Z9&MZP4&sGGyVne zkjn1nsg*F}z8RrUh_paCbyaDNxn+KZ5F>Y$C*bA)%;sMBe%Uk7$VjY)wKXW2sTo?6 z*o4^Q-s?k>XZvdLnB4>46GJ-p^=AJGZaH1c)e`4qEYNF#Kisr7~6SR}GL$v+vsL{s;-bre@ASN% zuJ4vqrb(2`r}y5?2as8(h=BTEWzFd;!7REflU2iosuE+LJZTVbcIel|ogF)})B%FK zC^86xW_`+91d`*3pNIg(Pi?En0e_E4)M?NV3ssWp>&6#1$=+tp^bqG}z*i$s%X1IyRc0kDxNR>x%r*=x4m~^v+2XyUxaYZ=F4Q+~sw8J3 z^C!T~5Qumni=WeUXAQ0*hPQL#7HWVIc*g6oa@^@h5a9oGH1k-2Y7vhN@rg{8Xo{ce zF;#Sog^2)!DVsL8lEH4%NL}e&vGJ`@-!g~2caR!_@5aO6s%Vm2TWWlGr3h|Rn4w>c zW>9cu#nL(mQsWsQh)}J;zNh$?pEl{wG#tXHz@WJr=!V2>r)GSKx=|~E>h0ZwNo3|8 zX2-~fg!xH&<#xe1dwX;{_wNB1@L2R0HvpWM!GY)py|I;L#VA+>5lr&Gfh>VQ;9ajC z5&(AVtRF8f0=!;RlFpXAWc@Xrv`j&yT0%lBVFd+~T;CyH0>I}c@A^Tw*Q2c#bLm3e z_ZQ1y+FdeHXFS!E3fmb{#!UD&FTeiy`*|cTqFfu*mwfdm3z8(BL-TO&5(Z@8ST16T zd(OQHZ{Nv36i=ZF&CnS(1eyy3kRJm+i8!FeUE^b%2FeMV`Hi*lMgW(gZ{Esc@oJz~ zC*y0S?dH>?Sic%VN^YJHV8Zj1xuBcxGs^*$MVeHaA z{V}c=5XK&%?!N4>U^xobZ)@hW!y$&DSNnAXCIcDQLy%~_BCu*YOyudpRYfzFpT1uD z3Y=xB7x&=&y}*{(!{VX!w3Cq%MIggeqMcCO2=|gpQ!)vn>2>o_%h8a&1P`Hf)s>JL z|D>F-SawdBX=?Ur+s)K;>Zf{F*iMEAXUsK!-_z5W4@phdwtHTW{h3DmfkzQ-hD6B+ z`tLeT7qo^-7;#^(!wn)o=FK&4&rzm10GDOx>4sc9YwsaXu1yk`Quz6qqt+~Nvzb_r zx-vuky~I-J**NjHQzK}VijUk&CeX& z5(Fb>ucXY;x@g0Y9se@w?%RuRSQIk2j8U8)3dakaF!f@)R>N6x&t2Cdwc9B+Hza+G zCPFlAt6qq>ohmbu2~wd5KJhyII+l5%+vi*r%cV+ndU7J^72M`q<(tOv1|bsF_kAd& z?Tg^!I2PTvkL68)P7bS$hr?Jt_|mdXG)@vL?j__{UyPzND7PM%w5I{G{>pX@FPnTT zU`L2rM%=cTSFYR+;<`Rc-eE zUGk%!PvqtCXPKd^JNu2eJd68xWe|i5kEmoGkuah9Iy$Q%r=^)`0XUf#YMi@e6Vb2R zZU4d5_hPErb}6S4G{0uY-Pn>XZr4IhhAE^ z+a{BC5o-`jHjCfkiZ{6TXbVkhU3a%L4q5cJKKfLDl!1 z`&7O{`X1wJmu*LF$BIT%>FUSw4f+@f^BqXej1Vyiv5?99B{U@rn1xLcp)y#ABpd`O zCnhBv`~>2K@}8Eop{e|2C+HBHBlSGoI;Yjc>;2eGTHGK$-1`MNAsrB0QK@fyRa^%c z=Zz7xJ_IIVd5zov+Tj|67qnj()UUSuV9~xNJ#HuHL>n5e!OliQ!PH%}^q*-t)%Myg zp0nuPZ-AvZZ8DCg7xm;S7UuV!51p08L7qC$+!iQ26J-nf;?^Kf$lURp7|@f!Eb60A z>qoT!QVlpe@cY%;4{L3eJGB(?WWT+Y!yX2*?(@1=qi|bAr%2Ef;`2$fWr9f6K$KqY znX%=R9Y3T4?JqfkplPdr?Ev#vo$ufSUf37y+&XrJq>RmgPhLv}VAJ>wq3PAG0j16^ z_W){YoAm(Zm>cjOj|D0Ec#Y1 zHw6vszhh&RveGQLjllBYw;R6;7;Q*X@ z^pdKK3I;%>O$@n(i8_1Ej~92Et3!_SJIL} z8@xQhMh*KUamTeU6A=_Fy8P5o=$Llz4qLkyVmQ|_&8jA#zm;c&| z0cn`D>+Rf_L9@frDZt-L_3G`1VT=)I@|lrPzEv%5w-+-2kQ7GB-(QInEH2TzX8a;7M$xa;vnc`d?@k@YrY|NlZA8p*Fhh%9DXM$ z*!%Pw%}*fmppqt@I`8BZ)OTpk^T;f^5}v{_Osh4O5G}8D`6z#AiYu8Y3Q-)pgg+Z4=ofhfGlRJ9y9Sh#S2Tee+ItBEHkG& z(wlz2$kZ7ru@dPvYe+=4^2K$-LMkotn?c7%28y0(w?tBE9wNx_(z+=hN-5;V1($zI z(m=(qrUbs;v^V8TJo8o?F+n3~rJfSKZn5EK4&ulPX~#>8j*OZkq`21Eek-bEyrK)x zBC3T=34yq3`nd?M`)r#&Y9!_O^2Q94yPw?$D7?ua!f2}dHa`VS5TWn2t;P|vB3an3 zZjtPrx;$;Kb#pP6y0aPjap9$!wJ2m;e90$m7%yEF5$F o{1|)qbum{@M{|U=y|JY^kK+r=+V{v%_-}-QoQiCTv{Ar+0aafimH+?% literal 0 HcmV?d00001 diff --git a/interface/src/gui.rs b/interface/src/gui.rs index 0ec5318..f458bf4 100644 --- a/interface/src/gui.rs +++ b/interface/src/gui.rs @@ -2,7 +2,8 @@ use std::{cell::OnceCell, path::PathBuf, sync::atomic::Ordering, time::Duration}; use common::{ControlPacket, TelemetryPacket}; -use eframe::{egui::{self, containers, Align2, Checkbox, Context, Id, Label}, Storage}; +use eframe::{egui::{self, containers, Align2, Checkbox, Context, IconData, Id, ImageSource, Label}, Storage}; +use image::ImageFormat; use tokio::{runtime::Runtime, sync::{mpsc, watch::Receiver}}; use egui_toast::{Toast, Toasts}; @@ -11,10 +12,21 @@ use crate::{storage_dir::storage_dir, POWER_THRESHOLD}; pub const GUI: OnceCell = OnceCell::new(); pub fn gui(data: Receiver, toasts: mpsc::Receiver, executor: Runtime) -> eframe::Result { + let icon = egui::include_image!("../assets/lizard.png"); + + let icon = image::load_from_memory_with_format(include_bytes!("../assets/lizard.png"), ImageFormat::Png).unwrap(); + + let icon = IconData { + width: icon.width(), + height: icon.height(), + rgba: icon.into_rgba8().into_raw(), + }; + let options = eframe::NativeOptions { viewport: egui::ViewportBuilder::default() .with_inner_size([700.0, 480.0]) - .with_app_id("cruisecontrol"), + .with_app_id("cruisecontrol") + .with_icon(icon), ..Default::default() }; eframe::run_native( From a000276c221628abc4972610e76dea9b5cbd9bf4 Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Sat, 8 Mar 2025 15:13:39 -0500 Subject: [PATCH 45/69] added auto stub --- interface/src/auto.rs | 110 ++++++++++++++++++++++++++++++++++++++++++ interface/src/main.rs | 1 + 2 files changed, 111 insertions(+) create mode 100644 interface/src/auto.rs diff --git a/interface/src/auto.rs b/interface/src/auto.rs new file mode 100644 index 0000000..64cf59f --- /dev/null +++ b/interface/src/auto.rs @@ -0,0 +1,110 @@ +use std::{collections::VecDeque, ops::{Div, Sub}}; + +use common::{CamState, ControlPacket, SensorData}; +use anyhow::Result; + +struct AutoConfig { + turn_gain: f32, + auto_fire_distance: f32, +} +const AUTO_GAP: i16 = 140; /// mm tofs must drop to count as a hit +const AUTO_SELF_OCCLUSION: u16 = 130; /// minimum + +struct AutoInterface { +} + +impl AutoInterface { + /// change active command, fails if not in control + fn run_command(&self, command: ControlPacket) -> Result<()> {unimplemented!()} + fn sensor_data(&self) -> SensorData {unimplemented!()} + fn cam_state(&self) -> CamState {unimplemented!()} + async fn sensor_update(&self) -> SensorData {unimplemented!()} + /// disable auto + fn disable(&self) {unimplemented!()} + /// request auto enable, fails if the driver does not grant it + fn enable(&self) -> Result<()> {unimplemented!()} + fn enabled(&self) -> bool {unimplemented!()} + fn auto_conf(&self) -> AutoConfig {unimplemented!()} + fn send_message(&self, message: String) {unimplemented!()} +} + +struct Configurable { + name: &'static str, + default: f32, + min: f32, + max: f32, +} + +trait Auto { + /// entrypoint + async fn run(interface: &AutoInterface); + /// register + fn default_configs() -> [Configurable]; + +} + +async fn auto (interface: &AutoInterface) { + let mut tof_l = Stats::new(); + let mut tof_r = Stats::new(); + loop { + let data = interface.sensor_update().await; + let cam = interface.cam_state(); + let CamState::Charged = cam else { + continue; + }; + + let Some(latest_tof_l) = data.tof_l else { + continue; + }; + tof_l.update(latest_tof_l as i16); + let Some(latest_tof_r) = data.tof_r else { + continue; + }; + tof_r.update(latest_tof_r as i16); + + let detection = |latest: u16, delta: i16| { + delta < AUTO_GAP && latest > AUTO_SELF_OCCLUSION + }; + + if detection(latest_tof_l, tof_l.delta()) || detection(latest_tof_l, tof_l.delta()) { + if let Ok(()) = interface.enable() { + println!("found, now seek") + } + } + } +} + + +struct Stats { + table: VecDeque +} + +impl Stats { + pub fn new() -> Self { + Self { table: VecDeque::new() } + + } + + const MAX_ELEMENTS: usize = 3; + + pub fn update(&mut self, elem: T) { + self.table.push_front(elem); + if self.table.len() > Self::MAX_ELEMENTS { + self.table.pop_back(); + } + } +} + +impl + Copy + From> Stats { + pub fn delta(&self) -> T { + *self.table.get(0).unwrap_or(&T::from(0)) - *self.table.get(1).unwrap_or(&T::from(0)) + } + + pub fn max(&self) -> T { + *self.table.iter().max().unwrap_or(&T::from(0)) + } + + pub fn min(&self) -> T { + *self.table.iter().max().unwrap_or(&T::from(0)) + } +} diff --git a/interface/src/main.rs b/interface/src/main.rs index ce49c5e..1aa3d10 100644 --- a/interface/src/main.rs +++ b/interface/src/main.rs @@ -15,6 +15,7 @@ use tokio::{io::{AsyncReadExt, AsyncWriteExt, BufWriter, WriteHalf}, net::{tcp:: mod gui; mod storage_dir; mod combatlog; +mod auto; pub const POWER_THRESHOLD: AtomicF32 = AtomicF32::new(DEFAULT_VOLUME_THRESHOLD); From 9d107d6c26688ed623835c6cc565c76a01613b85 Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Sat, 8 Mar 2025 15:22:14 -0500 Subject: [PATCH 46/69] made interface a library --- interface/src/auto.rs | 3 ++- interface/src/lib.rs | 12 ++++++++++++ interface/src/main.rs | 11 ++--------- 3 files changed, 16 insertions(+), 10 deletions(-) create mode 100644 interface/src/lib.rs diff --git a/interface/src/auto.rs b/interface/src/auto.rs index 64cf59f..1f868db 100644 --- a/interface/src/auto.rs +++ b/interface/src/auto.rs @@ -35,12 +35,13 @@ struct Configurable { max: f32, } +/// A fake trait in the sense that these methods are exposed as symbols, not trait methods trait Auto { /// entrypoint async fn run(interface: &AutoInterface); /// register fn default_configs() -> [Configurable]; - + fn name() -> &'static str; } async fn auto (interface: &AutoInterface) { diff --git a/interface/src/lib.rs b/interface/src/lib.rs new file mode 100644 index 0000000..7cc9afe --- /dev/null +++ b/interface/src/lib.rs @@ -0,0 +1,12 @@ +#![feature(iter_collect_into)] + +use atomic_float::AtomicF32; +use gui::DEFAULT_VOLUME_THRESHOLD; + +pub mod gui; +pub mod storage_dir; +pub mod combatlog; +pub mod auto; + +pub const POWER_THRESHOLD: AtomicF32 = AtomicF32::new(DEFAULT_VOLUME_THRESHOLD); + diff --git a/interface/src/main.rs b/interface/src/main.rs index 1aa3d10..238af37 100644 --- a/interface/src/main.rs +++ b/interface/src/main.rs @@ -1,23 +1,16 @@ -#![feature(iter_collect_into)] use std::{fmt::format, ops::ControlFlow, result, sync::{atomic::Ordering, Arc}, thread::{self, sleep}, time::Duration}; use anyhow::{Context, Ok, Result}; use atomic_float::AtomicF32; -use combatlog::{combat_logger, CombatData}; +use interface::{combatlog::{combat_logger, CombatData}, POWER_THRESHOLD}; use common::{ControlPacket, TelemetryPacket}; use cpal::traits::{DeviceTrait, HostTrait, StreamTrait}; use egui_toast::{Toast, ToastKind}; -use gui::{gui, GUIData, DEFAULT_VOLUME_THRESHOLD, GUI}; +use interface::gui::{gui, GUIData, DEFAULT_VOLUME_THRESHOLD, GUI}; use pitch_detection::{detector::{mcleod::McLeodDetector, PitchDetector}, utils}; use rust_music_theory::note::{Note, NoteLetter, Pitch, Tuning}; use tokio::{io::{AsyncReadExt, AsyncWriteExt, BufWriter, WriteHalf}, net::{tcp::{OwnedReadHalf, OwnedWriteHalf}, TcpStream}, spawn, sync::{self, broadcast, mpsc, watch, RwLock}, time::timeout}; -mod gui; -mod storage_dir; -mod combatlog; -mod auto; - -pub const POWER_THRESHOLD: AtomicF32 = AtomicF32::new(DEFAULT_VOLUME_THRESHOLD); fn main() -> Result<()> { let (logging_sender, combatlog) = mpsc::channel(64); From 05c7904513522a09dd4d8e9d9a9a311adb6eaa10 Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Sat, 8 Mar 2025 17:21:55 -0500 Subject: [PATCH 47/69] factored auto into separate crate --- .gitignore | 1 + auto/Cargo.lock | 5178 +++++++++++++++++++++++++++++++++++++++++ auto/Cargo.toml | 8 + auto/src/lib.rs | 73 + interface/src/auto.rs | 100 +- 5 files changed, 5276 insertions(+), 84 deletions(-) create mode 100644 .gitignore create mode 100644 auto/Cargo.lock create mode 100644 auto/Cargo.toml create mode 100644 auto/src/lib.rs diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b60de5b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +**/target diff --git a/auto/Cargo.lock b/auto/Cargo.lock new file mode 100644 index 0000000..a6729dc --- /dev/null +++ b/auto/Cargo.lock @@ -0,0 +1,5178 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "ab_glyph" +version = "0.2.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec3672c180e71eeaaac3a541fbbc5f5ad4def8b747c595ad30d674e43049f7b0" +dependencies = [ + "ab_glyph_rasterizer", + "owned_ttf_parser", +] + +[[package]] +name = "ab_glyph_rasterizer" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c71b1793ee61086797f5c80b6efa2b8ffa6d5dd703f118545808a7f2e27f7046" + +[[package]] +name = "accesskit" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3d3b8f9bae46a948369bc4a03e815d4ed6d616bd00de4051133a5019dc31c5a" +dependencies = [ + "enumn", + "serde", +] + +[[package]] +name = "accesskit_atspi_common" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c5dd55e6e94949498698daf4d48fb5659e824d7abec0d394089656ceaf99d4f" +dependencies = [ + "accesskit", + "accesskit_consumer", + "atspi-common", + "serde", + "thiserror", + "zvariant", +] + +[[package]] +name = "accesskit_consumer" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f47983a1084940ba9a39c077a8c63e55c619388be5476ac04c804cfbd1e63459" +dependencies = [ + "accesskit", + "hashbrown", + "immutable-chunkmap", +] + +[[package]] +name = "accesskit_macos" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7329821f3bd1101e03a7d2e03bd339e3ac0dc64c70b4c9f9ae1949e3ba8dece1" +dependencies = [ + "accesskit", + "accesskit_consumer", + "hashbrown", + "objc2", + "objc2-app-kit", + "objc2-foundation", +] + +[[package]] +name = "accesskit_unix" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcee751cc20d88678c33edaf9c07e8b693cd02819fe89053776f5313492273f5" +dependencies = [ + "accesskit", + "accesskit_atspi_common", + "async-channel", + "async-executor", + "async-task", + "atspi", + "futures-lite", + "futures-util", + "serde", + "zbus", +] + +[[package]] +name = "accesskit_windows" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24fcd5d23d70670992b823e735e859374d694a3d12bfd8dd32bd3bd8bedb5d81" +dependencies = [ + "accesskit", + "accesskit_consumer", + "hashbrown", + "paste", + "static_assertions", + "windows 0.58.0", + "windows-core 0.58.0", +] + +[[package]] +name = "accesskit_winit" +version = "0.23.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6a48dad5530b6deb9fc7a52cc6c3bf72cdd9eb8157ac9d32d69f2427a5e879" +dependencies = [ + "accesskit", + "accesskit_macos", + "accesskit_unix", + "accesskit_windows", + "raw-window-handle", + "winit", +] + +[[package]] +name = "addr2line" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" + +[[package]] +name = "ahash" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +dependencies = [ + "cfg-if", + "getrandom 0.2.15", + "once_cell", + "serde", + "version_check", + "zerocopy", +] + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "aligned-vec" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4aa90d7ce82d4be67b64039a3d588d38dbcc6736577de4a847025ce5b0c468d1" + +[[package]] +name = "alsa" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed7572b7ba83a31e20d1b48970ee402d2e3e0537dcfe0a3ff4d6eb7508617d43" +dependencies = [ + "alsa-sys", + "bitflags 2.9.0", + "cfg-if", + "libc", +] + +[[package]] +name = "alsa-sys" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db8fee663d06c4e303404ef5f40488a53e062f89ba8bfed81f42325aafad1527" +dependencies = [ + "libc", + "pkg-config", +] + +[[package]] +name = "android-activity" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef6978589202a00cd7e118380c448a08b6ed394c3a8df3a430d0898e3a42d046" +dependencies = [ + "android-properties", + "bitflags 2.9.0", + "cc", + "cesu8", + "jni", + "jni-sys", + "libc", + "log", + "ndk 0.9.0", + "ndk-context", + "ndk-sys 0.6.0+11769913", + "num_enum", + "thiserror", +] + +[[package]] +name = "android-properties" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc7eb209b1518d6bb87b283c20095f5228ecda460da70b44f0802523dea6da04" + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "ansi_term" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" +dependencies = [ + "winapi", +] + +[[package]] +name = "anyhow" +version = "1.0.97" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcfed56ad506cb2c684a14971b8861fdc3baaaae314b9e5f9bb532cbe3ba7a4f" + +[[package]] +name = "approx" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cab112f0a86d568ea0e627cc1d6be74a1e9cd55214684db5561995f6dad897c6" +dependencies = [ + "num-traits", +] + +[[package]] +name = "arbitrary" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dde20b3d026af13f561bdd0f15edf01fc734f0dafcedbaf42bba506a9517f223" + +[[package]] +name = "arboard" +version = "3.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df099ccb16cd014ff054ac1bf392c67feeef57164b05c42f037cd40f5d4357f4" +dependencies = [ + "clipboard-win", + "log", + "objc2", + "objc2-app-kit", + "objc2-foundation", + "parking_lot", + "x11rb", +] + +[[package]] +name = "arg_enum_proc_macro" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ae92a5119aa49cdbcf6b9f893fe4e1d98b04ccbf82ee0584ad948a44a734dea" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.99", +] + +[[package]] +name = "arrayref" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" + +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + +[[package]] +name = "as-raw-xcb-connection" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "175571dd1d178ced59193a6fc02dde1b972eb0bc56c892cde9beeceac5bf0f6b" + +[[package]] +name = "ash" +version = "0.38.0+1.3.281" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bb44936d800fea8f016d7f2311c6a4f97aebd5dc86f09906139ec848cf3a46f" +dependencies = [ + "libloading", +] + +[[package]] +name = "async-broadcast" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "435a87a52755b8f27fcf321ac4f04b2802e337c8c4872923137471ec39c37532" +dependencies = [ + "event-listener", + "event-listener-strategy", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-channel" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89b47800b0be77592da0afd425cc03468052844aff33b84e33cc696f64e77b6a" +dependencies = [ + "concurrent-queue", + "event-listener-strategy", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-executor" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30ca9a001c1e8ba5149f91a74362376cc6bc5b919d92d988668657bd570bdcec" +dependencies = [ + "async-task", + "concurrent-queue", + "fastrand", + "futures-lite", + "slab", +] + +[[package]] +name = "async-fs" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebcd09b382f40fcd159c2d695175b2ae620ffa5f3bd6f664131efff4e8b9e04a" +dependencies = [ + "async-lock", + "blocking", + "futures-lite", +] + +[[package]] +name = "async-io" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a2b323ccce0a1d90b449fd71f2a06ca7faa7c54c2751f06c9bd851fc061059" +dependencies = [ + "async-lock", + "cfg-if", + "concurrent-queue", + "futures-io", + "futures-lite", + "parking", + "polling", + "rustix 0.38.44", + "slab", + "tracing", + "windows-sys 0.59.0", +] + +[[package]] +name = "async-lock" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" +dependencies = [ + "event-listener", + "event-listener-strategy", + "pin-project-lite", +] + +[[package]] +name = "async-process" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63255f1dc2381611000436537bbedfe83183faa303a5a0edaf191edef06526bb" +dependencies = [ + "async-channel", + "async-io", + "async-lock", + "async-signal", + "async-task", + "blocking", + "cfg-if", + "event-listener", + "futures-lite", + "rustix 0.38.44", + "tracing", +] + +[[package]] +name = "async-recursion" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.99", +] + +[[package]] +name = "async-signal" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "637e00349800c0bdf8bfc21ebbc0b6524abea702b0da4168ac00d070d0c0b9f3" +dependencies = [ + "async-io", + "async-lock", + "atomic-waker", + "cfg-if", + "futures-core", + "futures-io", + "rustix 0.38.44", + "signal-hook-registry", + "slab", + "windows-sys 0.59.0", +] + +[[package]] +name = "async-task" +version = "4.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" + +[[package]] +name = "async-trait" +version = "0.1.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d556ec1359574147ec0c4fc5eb525f3f23263a592b1a9c07e0a75b427de55c97" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.99", +] + +[[package]] +name = "atomic-polyfill" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cf2bce30dfe09ef0bfaef228b9d414faaf7e563035494d7fe092dba54b300f4" +dependencies = [ + "critical-section", +] + +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + +[[package]] +name = "atomic_float" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "628d228f918ac3b82fe590352cc719d30664a0c13ca3a60266fe02c7132d480a" + +[[package]] +name = "atspi" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be534b16650e35237bb1ed189ba2aab86ce65e88cc84c66f4935ba38575cecbf" +dependencies = [ + "atspi-common", + "atspi-connection", + "atspi-proxies", +] + +[[package]] +name = "atspi-common" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1909ed2dc01d0a17505d89311d192518507e8a056a48148e3598fef5e7bb6ba7" +dependencies = [ + "enumflags2", + "serde", + "static_assertions", + "zbus", + "zbus-lockstep", + "zbus-lockstep-macros", + "zbus_names", + "zvariant", +] + +[[package]] +name = "atspi-connection" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "430c5960624a4baaa511c9c0fcc2218e3b58f5dbcc47e6190cafee344b873333" +dependencies = [ + "atspi-common", + "atspi-proxies", + "futures-lite", + "zbus", +] + +[[package]] +name = "atspi-proxies" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5e6c5de3e524cf967569722446bcd458d5032348554d9a17d7d72b041ab7496" +dependencies = [ + "atspi-common", + "serde", + "zbus", + "zvariant", +] + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi 0.1.19", + "libc", + "winapi", +] + +[[package]] +name = "auto" +version = "0.1.0" +dependencies = [ + "common", + "interface", +] + +[[package]] +name = "autocfg" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" + +[[package]] +name = "av1-grain" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6678909d8c5d46a42abcf571271e15fdbc0a225e3646cf23762cd415046c78bf" +dependencies = [ + "anyhow", + "arrayvec", + "log", + "nom", + "num-rational", + "v_frame", +] + +[[package]] +name = "avif-serialize" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98922d6a4cfbcb08820c69d8eeccc05bb1f29bfa06b4f5b1dbfe9a868bd7608e" +dependencies = [ + "arrayvec", +] + +[[package]] +name = "backtrace" +version = "0.3.74" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" +dependencies = [ + "addr2line", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", + "windows-targets 0.52.6", +] + +[[package]] +name = "base64" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + +[[package]] +name = "bindgen" +version = "0.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f49d8fed880d473ea71efb9bf597651e77201bdd4893efe54c9e5d65ae04ce6f" +dependencies = [ + "bitflags 2.9.0", + "cexpr", + "clang-sys", + "itertools 0.13.0", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn 2.0.99", +] + +[[package]] +name = "bit-set" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" + +[[package]] +name = "bit_field" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc827186963e592360843fb5ba4b973e145841266c1357f7180c43526f2e5b61" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" +dependencies = [ + "serde", +] + +[[package]] +name = "bitstream-io" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6099cdc01846bc367c4e7dd630dc5966dccf36b652fae7a74e17b640411a91b2" + +[[package]] +name = "block" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "block2" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c132eebf10f5cad5289222520a4a058514204aed6d791f1cf4fe8088b82d15f" +dependencies = [ + "objc2", +] + +[[package]] +name = "blocking" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "703f41c54fc768e63e091340b424302bb1c29ef4aa0c7f10fe849dfb114d29ea" +dependencies = [ + "async-channel", + "async-task", + "futures-io", + "futures-lite", + "piper", +] + +[[package]] +name = "built" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56ed6191a7e78c36abdb16ab65341eefd73d64d303fffccdbb00d51e4205967b" + +[[package]] +name = "bumpalo" +version = "3.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" + +[[package]] +name = "bytemuck" +version = "1.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6b1fc10dbac614ebc03540c9dbd60e83887fda27794998c6528f1782047d540" +dependencies = [ + "bytemuck_derive", +] + +[[package]] +name = "bytemuck_derive" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fa76293b4f7bb636ab88fd78228235b5248b4d05cc589aed610f954af5d7c7a" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.99", +] + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "byteorder-lite" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" + +[[package]] +name = "bytes" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" + +[[package]] +name = "calloop" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b99da2f8558ca23c71f4fd15dc57c906239752dd27ff3c00a1d56b685b7cbfec" +dependencies = [ + "bitflags 2.9.0", + "log", + "polling", + "rustix 0.38.44", + "slab", + "thiserror", +] + +[[package]] +name = "calloop-wayland-source" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95a66a987056935f7efce4ab5668920b5d0dac4a7c99991a67395f13702ddd20" +dependencies = [ + "calloop", + "rustix 0.38.44", + "wayland-backend", + "wayland-client", +] + +[[package]] +name = "cc" +version = "1.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be714c154be609ec7f5dad223a33bf1482fff90472de28f7362806e6d4832b8c" +dependencies = [ + "jobserver", + "libc", + "shlex", +] + +[[package]] +name = "cesu8" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" + +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] + +[[package]] +name = "cfg-expr" +version = "0.15.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d067ad48b8650848b989a59a86c6c36a995d02d2bf778d45c3c5d57bc2718f02" +dependencies = [ + "smallvec", + "target-lexicon", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "cfg_aliases" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" + +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + +[[package]] +name = "cgl" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ced0551234e87afee12411d535648dd89d2e7f34c78b753395567aff3d447ff" +dependencies = [ + "libc", +] + +[[package]] +name = "chrono" +version = "0.4.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a7964611d71df112cb1730f2ee67324fcf4d0fc6606acbbe9bfe06df124637c" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "js-sys", + "num-traits", + "wasm-bindgen", + "windows-link", +] + +[[package]] +name = "clang-sys" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +dependencies = [ + "glob", + "libc", + "libloading", +] + +[[package]] +name = "clap" +version = "2.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" +dependencies = [ + "ansi_term", + "atty", + "bitflags 1.3.2", + "strsim", + "textwrap", + "unicode-width", + "vec_map", +] + +[[package]] +name = "clipboard-win" +version = "5.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15efe7a882b08f34e38556b14f2fb3daa98769d06c7f0c1b076dfd0d983bc892" +dependencies = [ + "error-code", +] + +[[package]] +name = "cobs" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67ba02a97a2bd10f4b59b25c7973101c79642302776489e030cd13cdab09ed15" + +[[package]] +name = "codespan-reporting" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" +dependencies = [ + "termcolor", + "unicode-width", +] + +[[package]] +name = "color_quant" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" + +[[package]] +name = "combine" +version = "4.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" +dependencies = [ + "bytes", + "memchr", +] + +[[package]] +name = "common" +version = "0.1.0" +dependencies = [ + "nalgebra", + "postcard", + "serde", +] + +[[package]] +name = "concurrent-queue" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b55271e5c8c478ad3f38ad24ef34923091e0548492a266d19b3c0b4d82574c63" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "core-graphics" +version = "0.23.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c07782be35f9e1140080c6b96f0d44b739e2278479f64e02fdab4e32dfd8b081" +dependencies = [ + "bitflags 1.3.2", + "core-foundation 0.9.4", + "core-graphics-types", + "foreign-types", + "libc", +] + +[[package]] +name = "core-graphics-types" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45390e6114f68f718cc7a830514a96f903cccd70d02a8f6d9f643ac4ba45afaf" +dependencies = [ + "bitflags 1.3.2", + "core-foundation 0.9.4", + "libc", +] + +[[package]] +name = "coreaudio-rs" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "321077172d79c662f64f5071a03120748d5bb652f5231570141be24cfcd2bace" +dependencies = [ + "bitflags 1.3.2", + "core-foundation-sys", + "coreaudio-sys", +] + +[[package]] +name = "coreaudio-sys" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ce857aa0b77d77287acc1ac3e37a05a8c95a2af3647d23b15f263bdaeb7562b" +dependencies = [ + "bindgen", +] + +[[package]] +name = "cpal" +version = "0.15.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "873dab07c8f743075e57f524c583985fbaf745602acbe916a01539364369a779" +dependencies = [ + "alsa", + "core-foundation-sys", + "coreaudio-rs", + "dasp_sample", + "jni", + "js-sys", + "libc", + "mach2", + "ndk 0.8.0", + "ndk-context", + "oboe", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "windows 0.54.0", +] + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "critical-section" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" + +[[package]] +name = "crossbeam-deque" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" + +[[package]] +name = "crunchy" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43da5946c66ffcc7745f48db692ffbb10a83bfe0afd96235c5c2a4fb23994929" + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "cursor-icon" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96a6ac251f4a2aca6b3f91340350eab87ae57c3f127ffeb585e92bd336717991" + +[[package]] +name = "dasp_sample" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c87e182de0887fd5361989c677c4e8f5000cd9491d6d563161a8f3a5519fc7f" + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", +] + +[[package]] +name = "dispatch" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" + +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.99", +] + +[[package]] +name = "dlib" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "330c60081dcc4c72131f8eb70510f1ac07223e5d4163db481a04a0befcffa412" +dependencies = [ + "libloading", +] + +[[package]] +name = "document-features" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95249b50c6c185bee49034bcb378a49dc2b5dff0be90ff6616d31d64febab05d" +dependencies = [ + "litrs", +] + +[[package]] +name = "downcast-rs" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" + +[[package]] +name = "dpi" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f25c0e292a7ca6d6498557ff1df68f32c99850012b6ea401cf8daf771f22ff53" + +[[package]] +name = "ecolor" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d72e9c39f6e11a2e922d04a34ec5e7ef522ea3f5a1acfca7a19d16ad5fe50f5" +dependencies = [ + "bytemuck", + "emath 0.30.0", + "serde", +] + +[[package]] +name = "eframe" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2f2d9e7ea2d11ec9e98a8683b6eb99f9d7d0448394ef6e0d6d91bd4eb817220" +dependencies = [ + "ahash", + "bytemuck", + "document-features", + "egui", + "egui-wgpu", + "egui-winit", + "egui_glow", + "glow 0.16.0", + "glutin", + "glutin-winit", + "home", + "image", + "js-sys", + "log", + "objc2", + "objc2-app-kit", + "objc2-foundation", + "parking_lot", + "percent-encoding", + "profiling", + "raw-window-handle", + "ron", + "serde", + "static_assertions", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "web-time", + "winapi", + "windows-sys 0.59.0", + "winit", +] + +[[package]] +name = "egui" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "252d52224d35be1535d7fd1d6139ce071fb42c9097773e79f7665604f5596b5e" +dependencies = [ + "accesskit", + "ahash", + "emath 0.30.0", + "epaint", + "log", + "nohash-hasher", + "profiling", + "ron", + "serde", +] + +[[package]] +name = "egui-toast" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2531762f801556e7b8c445feee7b5a790aca1d5bf4d4e09a66c73b807058816" +dependencies = [ + "egui", +] + +[[package]] +name = "egui-wgpu" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26c1e821d2d8921ef6ce98b258c7e24d9d6aab2ca1f9cdf374eca997e7f67f59" +dependencies = [ + "ahash", + "bytemuck", + "document-features", + "egui", + "epaint", + "log", + "profiling", + "thiserror", + "type-map", + "web-time", + "wgpu", + "winit", +] + +[[package]] +name = "egui-winit" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e84c2919cd9f3a38a91e8f84ac6a245c19251fd95226ed9fae61d5ea564fce3" +dependencies = [ + "accesskit_winit", + "ahash", + "arboard", + "egui", + "log", + "profiling", + "raw-window-handle", + "serde", + "smithay-clipboard", + "web-time", + "webbrowser", + "winit", +] + +[[package]] +name = "egui_extras" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d7a8198c088b1007108cb2d403bc99a5e370999b200db4f14559610d7330126" +dependencies = [ + "ahash", + "egui", + "enum-map", + "image", + "log", + "mime_guess2", + "profiling", +] + +[[package]] +name = "egui_glow" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3eaf6264cc7608e3e69a7d57a6175f438275f1b3889c1a551b418277721c95e6" +dependencies = [ + "ahash", + "bytemuck", + "egui", + "glow 0.16.0", + "log", + "memoffset", + "profiling", + "wasm-bindgen", + "web-sys", + "winit", +] + +[[package]] +name = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" + +[[package]] +name = "emath" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4fe73c1207b864ee40aa0b0c038d6092af1030744678c60188a05c28553515d" +dependencies = [ + "bytemuck", + "serde", +] + +[[package]] +name = "emath" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e4cadcff7a5353ba72b7fea76bf2122b5ebdbc68e8155aa56dfdea90083fe1b" + +[[package]] +name = "embedded-io" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef1a6892d9eef45c8fa6b9e0086428a2cca8491aca8f787c534a3d6d0bcb3ced" + +[[package]] +name = "embedded-io" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" + +[[package]] +name = "endi" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3d8a32ae18130a3c84dd492d4215c3d913c3b07c6b63c2eb3eb7ff1101ab7bf" + +[[package]] +name = "enum-map" +version = "2.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6866f3bfdf8207509a033af1a75a7b08abda06bbaaeae6669323fd5a097df2e9" +dependencies = [ + "enum-map-derive", + "serde", +] + +[[package]] +name = "enum-map-derive" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f282cfdfe92516eb26c2af8589c274c7c17681f5ecc03c18255fe741c6aa64eb" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.99", +] + +[[package]] +name = "enumflags2" +version = "0.7.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba2f4b465f5318854c6f8dd686ede6c0a9dc67d4b1ac241cf0eb51521a309147" +dependencies = [ + "enumflags2_derive", + "serde", +] + +[[package]] +name = "enumflags2_derive" +version = "0.7.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc4caf64a58d7a6d65ab00639b046ff54399a39f5f2554728895ace4b297cd79" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.99", +] + +[[package]] +name = "enumn" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f9ed6b3789237c8a0c1c505af1c7eb2c560df6186f01b098c3a1064ea532f38" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.99", +] + +[[package]] +name = "epaint" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5666f8d25236293c966fbb3635eac18b04ad1914e3bab55bc7d44b9980cafcac" +dependencies = [ + "ab_glyph", + "ahash", + "bytemuck", + "ecolor", + "emath 0.30.0", + "epaint_default_fonts", + "log", + "nohash-hasher", + "parking_lot", + "profiling", + "serde", +] + +[[package]] +name = "epaint_default_fonts" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66f6ddac3e6ac6fd4c3d48bb8b1943472f8da0f43a4303bcd8a18aa594401c80" + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "errno" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" +dependencies = [ + "libc", + "windows-sys 0.59.0", +] + +[[package]] +name = "error-code" +version = "3.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5d9305ccc6942a704f4335694ecd3de2ea531b114ac2d51f5f843750787a92f" + +[[package]] +name = "event-listener" +version = "5.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3492acde4c3fc54c845eaab3eed8bd00c7a7d881f78bfc801e43a93dec1331ae" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c3e4e0dd3673c1139bf041f3008816d9cf2946bbfac2945c09e523b8d7b05b2" +dependencies = [ + "event-listener", + "pin-project-lite", +] + +[[package]] +name = "exr" +version = "1.73.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f83197f59927b46c04a183a619b7c29df34e63e63c7869320862268c0ef687e0" +dependencies = [ + "bit_field", + "half", + "lebe", + "miniz_oxide", + "rayon-core", + "smallvec", + "zune-inflate", +] + +[[package]] +name = "fastrand" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" + +[[package]] +name = "fdeflate" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e6853b52649d4ac5c0bd02320cddc5ba956bdb407c4b75a2c6b75bf51500f8c" +dependencies = [ + "simd-adler32", +] + +[[package]] +name = "flate2" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11faaf5a5236997af9848be0bef4db95824b1d534ebc64d0f0c6cf3e67bd38dc" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "foldhash" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0d2fde1f7b3d48b8395d5f2de76c18a528bd6a9cdde438df747bfcba3e05d6f" + +[[package]] +name = "foreign-types" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" +dependencies = [ + "foreign-types-macros", + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-macros" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.99", +] + +[[package]] +name = "foreign-types-shared" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futures-core" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" + +[[package]] +name = "futures-io" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" + +[[package]] +name = "futures-lite" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5edaec856126859abb19ed65f39e90fea3a9574b9707f13539acf4abf7eb532" +dependencies = [ + "fastrand", + "futures-core", + "futures-io", + "parking", + "pin-project-lite", +] + +[[package]] +name = "futures-macro" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.99", +] + +[[package]] +name = "futures-sink" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" + +[[package]] +name = "futures-task" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" + +[[package]] +name = "futures-util" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" +dependencies = [ + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "gethostname" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0176e0459c2e4a1fe232f984bca6890e681076abb9934f6cea7c326f3fc47818" +dependencies = [ + "libc", + "windows-targets 0.48.5", +] + +[[package]] +name = "getrandom" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a49c392881ce6d5c3b8cb70f98717b7c07aabbdff06687b9030dbfbe2725f8" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.13.3+wasi-0.2.2", + "windows-targets 0.52.6", +] + +[[package]] +name = "gif" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fb2d69b19215e18bb912fa30f7ce15846e301408695e44e0ef719f1da9e19f2" +dependencies = [ + "color_quant", + "weezl", +] + +[[package]] +name = "gimli" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" + +[[package]] +name = "gl_generator" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a95dfc23a2b4a9a2f5ab41d194f8bfda3cabec42af4e39f08c339eb2a0c124d" +dependencies = [ + "khronos_api", + "log", + "xml-rs", +] + +[[package]] +name = "glob" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" + +[[package]] +name = "glow" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d51fa363f025f5c111e03f13eda21162faeacb6911fe8caa0c0349f9cf0c4483" +dependencies = [ + "js-sys", + "slotmap", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "glow" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5e5ea60d70410161c8bf5da3fdfeaa1c72ed2c15f8bbb9d19fe3a4fad085f08" +dependencies = [ + "js-sys", + "slotmap", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "glutin" +version = "0.32.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03642b8b0cce622392deb0ee3e88511f75df2daac806102597905c3ea1974848" +dependencies = [ + "bitflags 2.9.0", + "cfg_aliases 0.2.1", + "cgl", + "core-foundation 0.9.4", + "dispatch", + "glutin_egl_sys", + "glutin_glx_sys", + "glutin_wgl_sys", + "libloading", + "objc2", + "objc2-app-kit", + "objc2-foundation", + "once_cell", + "raw-window-handle", + "wayland-sys", + "windows-sys 0.52.0", + "x11-dl", +] + +[[package]] +name = "glutin-winit" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85edca7075f8fc728f28cb8fbb111a96c3b89e930574369e3e9c27eb75d3788f" +dependencies = [ + "cfg_aliases 0.2.1", + "glutin", + "raw-window-handle", + "winit", +] + +[[package]] +name = "glutin_egl_sys" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c4680ba6195f424febdc3ba46e7a42a0e58743f2edb115297b86d7f8ecc02d2" +dependencies = [ + "gl_generator", + "windows-sys 0.52.0", +] + +[[package]] +name = "glutin_glx_sys" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a7bb2938045a88b612499fbcba375a77198e01306f52272e692f8c1f3751185" +dependencies = [ + "gl_generator", + "x11-dl", +] + +[[package]] +name = "glutin_wgl_sys" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c4ee00b289aba7a9e5306d57c2d05499b2e5dc427f84ac708bd2c090212cf3e" +dependencies = [ + "gl_generator", +] + +[[package]] +name = "gpu-alloc" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbcd2dba93594b227a1f57ee09b8b9da8892c34d55aa332e034a228d0fe6a171" +dependencies = [ + "bitflags 2.9.0", + "gpu-alloc-types", +] + +[[package]] +name = "gpu-alloc-types" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98ff03b468aa837d70984d55f5d3f846f6ec31fe34bbb97c4f85219caeee1ca4" +dependencies = [ + "bitflags 2.9.0", +] + +[[package]] +name = "gpu-descriptor" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcf29e94d6d243368b7a56caa16bc213e4f9f8ed38c4d9557069527b5d5281ca" +dependencies = [ + "bitflags 2.9.0", + "gpu-descriptor-types", + "hashbrown", +] + +[[package]] +name = "gpu-descriptor-types" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdf242682df893b86f33a73828fb09ca4b2d3bb6cc95249707fc684d27484b91" +dependencies = [ + "bitflags 2.9.0", +] + +[[package]] +name = "half" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" +dependencies = [ + "cfg-if", + "crunchy", +] + +[[package]] +name = "hash32" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0c35f58762feb77d74ebe43bdbc3210f09be9fe6742234d573bacc26ed92b67" +dependencies = [ + "byteorder", +] + +[[package]] +name = "hashbrown" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" +dependencies = [ + "foldhash", +] + +[[package]] +name = "heapless" +version = "0.7.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdc6457c0eb62c71aac4bc17216026d8410337c4126773b9c5daba343f17964f" +dependencies = [ + "atomic-polyfill", + "hash32", + "rustc_version", + "serde", + "spin", + "stable_deref_trait", +] + +[[package]] +name = "heck" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "hermit-abi" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hexf-parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfa686283ad6dd069f105e5ab091b04c62850d3e4cf5d67debad1933f55023df" + +[[package]] +name = "home" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589533453244b0995c858700322199b2becb13b627df2851f64a2775d024abcf" +dependencies = [ + "windows-sys 0.59.0", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core 0.52.0", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.99", +] + +[[package]] +name = "idna" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "image" +version = "0.25.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd6f44aed642f18953a158afeb30206f4d50da59fbc66ecb53c66488de73563b" +dependencies = [ + "bytemuck", + "byteorder-lite", + "color_quant", + "exr", + "gif", + "image-webp", + "num-traits", + "png", + "qoi", + "ravif", + "rayon", + "rgb", + "tiff", + "zune-core", + "zune-jpeg", +] + +[[package]] +name = "image-webp" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b77d01e822461baa8409e156015a1d91735549f0f2c17691bd2d996bef238f7f" +dependencies = [ + "byteorder-lite", + "quick-error", +] + +[[package]] +name = "imgref" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0263a3d970d5c054ed9312c0057b4f3bde9c0b33836d3637361d4a9e6e7a408" + +[[package]] +name = "immutable-chunkmap" +version = "2.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12f97096f508d54f8f8ab8957862eee2ccd628847b6217af1a335e1c44dee578" +dependencies = [ + "arrayvec", +] + +[[package]] +name = "indexmap" +version = "2.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c9c992b02b5b4c94ea26e32fe5bccb7aa7d9f390ab5c1221ff895bc7ea8b652" +dependencies = [ + "equivalent", + "hashbrown", +] + +[[package]] +name = "interface" +version = "0.1.0" +dependencies = [ + "anyhow", + "atomic_float", + "chrono", + "common", + "cpal", + "eframe", + "egui-toast", + "egui_extras", + "emath 0.31.1", + "heapless", + "home", + "image", + "libloading", + "pitch-detection", + "postcard", + "rust-music-theory", + "serde", + "tokio", +] + +[[package]] +name = "interpolate_name" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34819042dc3d3971c46c2190835914dfbe0c3c13f61449b2997f4e9722dfa60" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.99", +] + +[[package]] +name = "itertools" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + +[[package]] +name = "jni" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" +dependencies = [ + "cesu8", + "cfg-if", + "combine", + "jni-sys", + "log", + "thiserror", + "walkdir", + "windows-sys 0.45.0", +] + +[[package]] +name = "jni-sys" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" + +[[package]] +name = "jobserver" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" +dependencies = [ + "libc", +] + +[[package]] +name = "jpeg-decoder" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5d4a7da358eff58addd2877a45865158f0d78c911d43a5784ceb7bbf52833b0" + +[[package]] +name = "js-sys" +version = "0.3.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" +dependencies = [ + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "khronos-egl" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6aae1df220ece3c0ada96b8153459b67eebe9ae9212258bb0134ae60416fdf76" +dependencies = [ + "libc", + "libloading", + "pkg-config", +] + +[[package]] +name = "khronos_api" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc" + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "lebe" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03087c2bad5e1034e8cace5926dec053fb3790248370865f5117a7d0213354c8" + +[[package]] +name = "libc" +version = "0.2.170" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "875b3680cb2f8f71bdcf9a30f38d48282f5d3c95cbf9b3fa57269bb5d5c06828" + +[[package]] +name = "libfuzzer-sys" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf78f52d400cf2d84a3a973a78a592b4adc535739e0a5597a0da6f0c357adc75" +dependencies = [ + "arbitrary", + "cc", +] + +[[package]] +name = "libloading" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" +dependencies = [ + "cfg-if", + "windows-targets 0.52.6", +] + +[[package]] +name = "libredox" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags 2.9.0", + "libc", + "redox_syscall 0.5.10", +] + +[[package]] +name = "linux-raw-sys" +version = "0.4.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" + +[[package]] +name = "linux-raw-sys" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6db9c683daf087dc577b7506e9695b3d556a9f3849903fa28186283afd6809e9" + +[[package]] +name = "litemap" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23fb14cb19457329c82206317a5663005a4d404783dc74f4252769b0d5f42856" + +[[package]] +name = "litrs" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" + +[[package]] +name = "lock_api" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e" + +[[package]] +name = "loop9" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fae87c125b03c1d2c0150c90365d7d6bcc53fb73a9acaef207d2d065860f062" +dependencies = [ + "imgref", +] + +[[package]] +name = "mach2" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b955cdeb2a02b9117f121ce63aa52d08ade45de53e48fe6a38b39c10f6f709" +dependencies = [ + "libc", +] + +[[package]] +name = "malloc_buf" +version = "0.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" +dependencies = [ + "libc", +] + +[[package]] +name = "maybe-rayon" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ea1f30cedd69f0a2954655f7188c6a834246d2bcf1e315e2ac40c4b24dc9519" +dependencies = [ + "cfg-if", + "rayon", +] + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "memmap2" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd3f7eed9d3848f8b98834af67102b720745c4ec028fcd0aa0239277e7de374f" +dependencies = [ + "libc", +] + +[[package]] +name = "memoffset" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" +dependencies = [ + "autocfg", +] + +[[package]] +name = "metal" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ecfd3296f8c56b7c1f6fbac3c71cefa9d78ce009850c45000015f206dc7fa21" +dependencies = [ + "bitflags 2.9.0", + "block", + "core-graphics-types", + "foreign-types", + "log", + "objc", + "paste", +] + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "mime_guess2" +version = "2.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25a3333bb1609500601edc766a39b4c1772874a4ce26022f4d866854dc020c41" +dependencies = [ + "mime", + "unicase", +] + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e3e04debbb59698c15bacbb6d93584a8c0ca9cc3213cb423d31f760d8843ce5" +dependencies = [ + "adler2", + "simd-adler32", +] + +[[package]] +name = "mio" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" +dependencies = [ + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.52.0", +] + +[[package]] +name = "naga" +version = "23.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "364f94bc34f61332abebe8cad6f6cd82a5b65cff22c828d05d0968911462ca4f" +dependencies = [ + "arrayvec", + "bit-set", + "bitflags 2.9.0", + "cfg_aliases 0.1.1", + "codespan-reporting", + "hexf-parse", + "indexmap", + "log", + "rustc-hash", + "spirv", + "termcolor", + "thiserror", + "unicode-xid", +] + +[[package]] +name = "nalgebra" +version = "0.31.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20bd243ab3dbb395b39ee730402d2e5405e448c75133ec49cc977762c4cba3d1" +dependencies = [ + "approx", + "num-complex", + "num-rational", + "num-traits", + "serde", + "simba", + "typenum", +] + +[[package]] +name = "ndk" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2076a31b7010b17a38c01907c45b945e8f11495ee4dd588309718901b1f7a5b7" +dependencies = [ + "bitflags 2.9.0", + "jni-sys", + "log", + "ndk-sys 0.5.0+25.2.9519653", + "num_enum", + "thiserror", +] + +[[package]] +name = "ndk" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3f42e7bbe13d351b6bead8286a43aac9534b82bd3cc43e47037f012ebfd62d4" +dependencies = [ + "bitflags 2.9.0", + "jni-sys", + "log", + "ndk-sys 0.6.0+11769913", + "num_enum", + "raw-window-handle", + "thiserror", +] + +[[package]] +name = "ndk-context" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b" + +[[package]] +name = "ndk-sys" +version = "0.5.0+25.2.9519653" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c196769dd60fd4f363e11d948139556a344e79d451aeb2fa2fd040738ef7691" +dependencies = [ + "jni-sys", +] + +[[package]] +name = "ndk-sys" +version = "0.6.0+11769913" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee6cda3051665f1fb8d9e08fc35c96d5a244fb1be711a03b71118828afc9a873" +dependencies = [ + "jni-sys", +] + +[[package]] +name = "new_debug_unreachable" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" + +[[package]] +name = "nix" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" +dependencies = [ + "bitflags 2.9.0", + "cfg-if", + "cfg_aliases 0.2.1", + "libc", + "memoffset", +] + +[[package]] +name = "nohash-hasher" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "noop_proc_macro" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0676bb32a98c1a483ce53e500a81ad9c3d5b3f7c920c28c24e9cb0980d0b5bc8" + +[[package]] +name = "num-bigint" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-complex" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" +dependencies = [ + "num-traits", + "serde", +] + +[[package]] +name = "num-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.99", +] + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" +dependencies = [ + "num-bigint", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_enum" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e613fc340b2220f734a8595782c551f1250e969d87d3be1ae0579e8d4065179" +dependencies = [ + "num_enum_derive", +] + +[[package]] +name = "num_enum_derive" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.99", +] + +[[package]] +name = "objc" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" +dependencies = [ + "malloc_buf", +] + +[[package]] +name = "objc-sys" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdb91bdd390c7ce1a8607f35f3ca7151b65afc0ff5ff3b34fa350f7d7c7e4310" + +[[package]] +name = "objc2" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46a785d4eeff09c14c487497c162e92766fbb3e4059a71840cecc03d9a50b804" +dependencies = [ + "objc-sys", + "objc2-encode", +] + +[[package]] +name = "objc2-app-kit" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4e89ad9e3d7d297152b17d39ed92cd50ca8063a89a9fa569046d41568891eff" +dependencies = [ + "bitflags 2.9.0", + "block2", + "libc", + "objc2", + "objc2-core-data", + "objc2-core-image", + "objc2-foundation", + "objc2-quartz-core", +] + +[[package]] +name = "objc2-cloud-kit" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74dd3b56391c7a0596a295029734d3c1c5e7e510a4cb30245f8221ccea96b009" +dependencies = [ + "bitflags 2.9.0", + "block2", + "objc2", + "objc2-core-location", + "objc2-foundation", +] + +[[package]] +name = "objc2-contacts" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5ff520e9c33812fd374d8deecef01d4a840e7b41862d849513de77e44aa4889" +dependencies = [ + "block2", + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-core-data" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "617fbf49e071c178c0b24c080767db52958f716d9eabdf0890523aeae54773ef" +dependencies = [ + "bitflags 2.9.0", + "block2", + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-core-image" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55260963a527c99f1819c4f8e3b47fe04f9650694ef348ffd2227e8196d34c80" +dependencies = [ + "block2", + "objc2", + "objc2-foundation", + "objc2-metal", +] + +[[package]] +name = "objc2-core-location" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "000cfee34e683244f284252ee206a27953279d370e309649dc3ee317b37e5781" +dependencies = [ + "block2", + "objc2", + "objc2-contacts", + "objc2-foundation", +] + +[[package]] +name = "objc2-encode" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef25abbcd74fb2609453eb695bd2f860d389e457f67dc17cafc8b8cbc89d0c33" + +[[package]] +name = "objc2-foundation" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ee638a5da3799329310ad4cfa62fbf045d5f56e3ef5ba4149e7452dcf89d5a8" +dependencies = [ + "bitflags 2.9.0", + "block2", + "dispatch", + "libc", + "objc2", +] + +[[package]] +name = "objc2-link-presentation" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1a1ae721c5e35be65f01a03b6d2ac13a54cb4fa70d8a5da293d7b0020261398" +dependencies = [ + "block2", + "objc2", + "objc2-app-kit", + "objc2-foundation", +] + +[[package]] +name = "objc2-metal" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd0cba1276f6023976a406a14ffa85e1fdd19df6b0f737b063b95f6c8c7aadd6" +dependencies = [ + "bitflags 2.9.0", + "block2", + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-quartz-core" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e42bee7bff906b14b167da2bac5efe6b6a07e6f7c0a21a7308d40c960242dc7a" +dependencies = [ + "bitflags 2.9.0", + "block2", + "objc2", + "objc2-foundation", + "objc2-metal", +] + +[[package]] +name = "objc2-symbols" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a684efe3dec1b305badae1a28f6555f6ddd3bb2c2267896782858d5a78404dc" +dependencies = [ + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-ui-kit" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8bb46798b20cd6b91cbd113524c490f1686f4c4e8f49502431415f3512e2b6f" +dependencies = [ + "bitflags 2.9.0", + "block2", + "objc2", + "objc2-cloud-kit", + "objc2-core-data", + "objc2-core-image", + "objc2-core-location", + "objc2-foundation", + "objc2-link-presentation", + "objc2-quartz-core", + "objc2-symbols", + "objc2-uniform-type-identifiers", + "objc2-user-notifications", +] + +[[package]] +name = "objc2-uniform-type-identifiers" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44fa5f9748dbfe1ca6c0b79ad20725a11eca7c2218bceb4b005cb1be26273bfe" +dependencies = [ + "block2", + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-user-notifications" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76cfcbf642358e8689af64cee815d139339f3ed8ad05103ed5eaf73db8d84cb3" +dependencies = [ + "bitflags 2.9.0", + "block2", + "objc2", + "objc2-core-location", + "objc2-foundation", +] + +[[package]] +name = "object" +version = "0.36.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" +dependencies = [ + "memchr", +] + +[[package]] +name = "oboe" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8b61bebd49e5d43f5f8cc7ee2891c16e0f41ec7954d36bcb6c14c5e0de867fb" +dependencies = [ + "jni", + "ndk 0.8.0", + "ndk-context", + "num-derive", + "num-traits", + "oboe-sys", +] + +[[package]] +name = "oboe-sys" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c8bb09a4a2b1d668170cfe0a7d5bc103f8999fb316c98099b6a9939c9f2e79d" +dependencies = [ + "cc", +] + +[[package]] +name = "once_cell" +version = "1.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "945462a4b81e43c4e3ba96bd7b49d834c6f61198356aa858733bc4acf3cbe62e" + +[[package]] +name = "orbclient" +version = "0.3.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba0b26cec2e24f08ed8bb31519a9333140a6599b867dac464bb150bdb796fd43" +dependencies = [ + "libredox", +] + +[[package]] +name = "ordered-stream" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aa2b01e1d916879f73a53d01d1d6cee68adbb31d6d9177a8cfce093cced1d50" +dependencies = [ + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "owned_ttf_parser" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22ec719bbf3b2a81c109a4e20b1f129b5566b7dce654bc3872f6a05abf82b2c4" +dependencies = [ + "ttf-parser", +] + +[[package]] +name = "parking" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" + +[[package]] +name = "parking_lot" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall 0.5.10", + "smallvec", + "windows-targets 0.52.6", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "pin-project" +version = "1.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677f1add503faace112b9f1373e43e9e054bfdd22ff1a63c1bc485eaec6a6a8a" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.99", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "piper" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96c8c490f422ef9a4efd2cb5b42b76c8613d7e7dfc1caf667b8a3350a5acc066" +dependencies = [ + "atomic-waker", + "fastrand", + "futures-io", +] + +[[package]] +name = "pitch-detection" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e086e70dfcfd46cd6097c501a66fb07cd73ee8c27844b0941d9b2b3e43dfbf92" +dependencies = [ + "rustfft", +] + +[[package]] +name = "pkg-config" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" + +[[package]] +name = "png" +version = "0.17.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82151a2fc869e011c153adc57cf2789ccb8d9906ce52c0b39a6b5697749d7526" +dependencies = [ + "bitflags 1.3.2", + "crc32fast", + "fdeflate", + "flate2", + "miniz_oxide", +] + +[[package]] +name = "polling" +version = "3.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a604568c3202727d1507653cb121dbd627a58684eb09a820fd746bee38b4442f" +dependencies = [ + "cfg-if", + "concurrent-queue", + "hermit-abi 0.4.0", + "pin-project-lite", + "rustix 0.38.44", + "tracing", + "windows-sys 0.59.0", +] + +[[package]] +name = "postcard" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "170a2601f67cc9dba8edd8c4870b15f71a6a2dc196daec8c83f72b59dff628a8" +dependencies = [ + "cobs", + "embedded-io 0.4.0", + "embedded-io 0.6.1", + "heapless", + "serde", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "primal-check" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc0d895b311e3af9902528fbb8f928688abbd95872819320517cc24ca6b2bd08" +dependencies = [ + "num-integer", +] + +[[package]] +name = "proc-macro-crate" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edce586971a4dfaa28950c6f18ed55e0406c1ab88bbce2c6f6293a7aaba73d35" +dependencies = [ + "toml_edit", +] + +[[package]] +name = "proc-macro2" +version = "1.0.94" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "profiling" +version = "1.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afbdc74edc00b6f6a218ca6a5364d6226a259d4b8ea1af4a0ea063f27e179f4d" +dependencies = [ + "profiling-procmacros", +] + +[[package]] +name = "profiling-procmacros" +version = "1.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a65f2e60fbf1063868558d69c6beacf412dc755f9fc020f514b7955fc914fe30" +dependencies = [ + "quote", + "syn 2.0.99", +] + +[[package]] +name = "qoi" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f6d64c71eb498fe9eae14ce4ec935c555749aef511cca85b5568910d6e48001" +dependencies = [ + "bytemuck", +] + +[[package]] +name = "quick-error" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3" + +[[package]] +name = "quick-xml" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eff6510e86862b57b210fd8cbe8ed3f0d7d600b9c2863cd4549a2e033c66e956" +dependencies = [ + "memchr", + "serde", +] + +[[package]] +name = "quick-xml" +version = "0.37.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "165859e9e55f79d67b96c5d96f4e88b6f2695a1972849c15a6a3f5c59fc2c003" +dependencies = [ + "memchr", +] + +[[package]] +name = "quote" +version = "1.0.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1f1914ce909e1658d9907913b4b91947430c7d9be598b15a1912935b8c04801" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.15", +] + +[[package]] +name = "rav1e" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd87ce80a7665b1cce111f8a16c1f3929f6547ce91ade6addf4ec86a8dda5ce9" +dependencies = [ + "arbitrary", + "arg_enum_proc_macro", + "arrayvec", + "av1-grain", + "bitstream-io", + "built", + "cfg-if", + "interpolate_name", + "itertools 0.12.1", + "libc", + "libfuzzer-sys", + "log", + "maybe-rayon", + "new_debug_unreachable", + "noop_proc_macro", + "num-derive", + "num-traits", + "once_cell", + "paste", + "profiling", + "rand", + "rand_chacha", + "simd_helpers", + "system-deps", + "thiserror", + "v_frame", + "wasm-bindgen", +] + +[[package]] +name = "ravif" +version = "0.11.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2413fd96bd0ea5cdeeb37eaf446a22e6ed7b981d792828721e74ded1980a45c6" +dependencies = [ + "avif-serialize", + "imgref", + "loop9", + "quick-error", + "rav1e", + "rayon", + "rgb", +] + +[[package]] +name = "raw-window-handle" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20675572f6f24e9e76ef639bc5552774ed45f1c30e2951e1e99c59888861c539" + +[[package]] +name = "rayon" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "redox_syscall" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "redox_syscall" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b8c0c260b63a8219631167be35e6a988e9554dbd323f8bd08439c8ed1302bd1" +dependencies = [ + "bitflags 2.9.0", +] + +[[package]] +name = "regex" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" + +[[package]] +name = "renderdoc-sys" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b30a45b0cd0bcca8037f3d0dc3421eaf95327a17cad11964fb8179b4fc4832" + +[[package]] +name = "rgb" +version = "0.8.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57397d16646700483b67d2dd6511d79318f9d057fdbd21a4066aeac8b41d310a" + +[[package]] +name = "ron" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b91f7eff05f748767f183df4320a63d6936e9c6107d97c9e6bdd9784f4289c94" +dependencies = [ + "base64", + "bitflags 2.9.0", + "serde", + "serde_derive", +] + +[[package]] +name = "rust-music-theory" +version = "0.2.0" +source = "git+https://github.com/the-drunk-coder/rust-music-theory?rev=a062d65#a062d65c35d02e38a48a9de29a0fe21f6b8b043d" +dependencies = [ + "clap", + "lazy_static", + "regex", + "strum", + "strum_macros", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + +[[package]] +name = "rustfft" +version = "6.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43806561bc506d0c5d160643ad742e3161049ac01027b5e6d7524091fd401d86" +dependencies = [ + "num-complex", + "num-integer", + "num-traits", + "primal-check", + "strength_reduce", + "transpose", + "version_check", +] + +[[package]] +name = "rustix" +version = "0.38.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" +dependencies = [ + "bitflags 2.9.0", + "errno", + "libc", + "linux-raw-sys 0.4.15", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustix" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dade4812df5c384711475be5fcd8c162555352945401aed22a35bffeab61f657" +dependencies = [ + "bitflags 2.9.0", + "errno", + "libc", + "linux-raw-sys 0.9.2", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustversion" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "scoped-tls" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "sctk-adwaita" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6277f0217056f77f1d8f49f2950ac6c278c0d607c45f5ee99328d792ede24ec" +dependencies = [ + "ab_glyph", + "log", + "memmap2", + "smithay-client-toolkit", + "tiny-skia", +] + +[[package]] +name = "semver" +version = "1.0.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" + +[[package]] +name = "serde" +version = "1.0.218" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8dfc9d19bdbf6d17e22319da49161d5d0108e4188e8b680aef6299eed22df60" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.218" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f09503e191f4e797cb8aac08e9a4a4695c5edf6a2e70e376d961ddd5c969f82b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.99", +] + +[[package]] +name = "serde_repr" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "175ee3e80ae9982737ca543e96133087cbd9a485eecc3bc4de9c1a37b47ea59c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.99", +] + +[[package]] +name = "serde_spanned" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" +dependencies = [ + "serde", +] + +[[package]] +name = "sha1" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signal-hook-registry" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" +dependencies = [ + "libc", +] + +[[package]] +name = "simba" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f3fd720c48c53cace224ae62bef1bbff363a70c68c4802a78b5cc6159618176" +dependencies = [ + "approx", + "num-complex", + "num-traits", + "paste", +] + +[[package]] +name = "simd-adler32" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" + +[[package]] +name = "simd_helpers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95890f873bec569a0362c235787f3aca6e1e887302ba4840839bcc6459c42da6" +dependencies = [ + "quote", +] + +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + +[[package]] +name = "slotmap" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbff4acf519f630b3a3ddcfaea6c06b42174d9a44bc70c620e9ed1649d58b82a" +dependencies = [ + "version_check", +] + +[[package]] +name = "smallvec" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fcf8323ef1faaee30a44a340193b1ac6814fd9b7b4e88e9d4519a3e4abe1cfd" + +[[package]] +name = "smithay-client-toolkit" +version = "0.19.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3457dea1f0eb631b4034d61d4d8c32074caa6cd1ab2d59f2327bd8461e2c0016" +dependencies = [ + "bitflags 2.9.0", + "calloop", + "calloop-wayland-source", + "cursor-icon", + "libc", + "log", + "memmap2", + "rustix 0.38.44", + "thiserror", + "wayland-backend", + "wayland-client", + "wayland-csd-frame", + "wayland-cursor", + "wayland-protocols", + "wayland-protocols-wlr", + "wayland-scanner", + "xkeysym", +] + +[[package]] +name = "smithay-clipboard" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc8216eec463674a0e90f29e0ae41a4db573ec5b56b1c6c1c71615d249b6d846" +dependencies = [ + "libc", + "smithay-client-toolkit", + "wayland-backend", +] + +[[package]] +name = "smol_str" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd538fb6910ac1099850255cf94a94df6551fbdd602454387d0adb2d1ca6dead" +dependencies = [ + "serde", +] + +[[package]] +name = "socket2" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +dependencies = [ + "lock_api", +] + +[[package]] +name = "spirv" +version = "0.3.0+sdk-1.3.268.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eda41003dc44290527a59b13432d4a0379379fa074b70174882adfbdfd917844" +dependencies = [ + "bitflags 2.9.0", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "strength_reduce" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe895eb47f22e2ddd4dabc02bce419d2e643c8e3b585c78158b349195bc24d82" + +[[package]] +name = "strict-num" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6637bab7722d379c8b41ba849228d680cc12d0a45ba1fa2b48f2a30577a06731" + +[[package]] +name = "strsim" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" + +[[package]] +name = "strum" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "530efb820d53b712f4e347916c5e7ed20deb76a4f0457943b3182fb889b06d2c" + +[[package]] +name = "strum_macros" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e6e163a520367c465f59e0a61a23cfae3b10b6546d78b6f672a382be79f7110" +dependencies = [ + "heck 0.3.3", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.99" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e02e925281e18ffd9d640e234264753c43edc62d64b2d4cf898f1bc5e75f3fc2" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.99", +] + +[[package]] +name = "system-deps" +version = "6.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3e535eb8dded36d55ec13eddacd30dec501792ff23a0b1682c38601b8cf2349" +dependencies = [ + "cfg-expr", + "heck 0.5.0", + "pkg-config", + "toml", + "version-compare", +] + +[[package]] +name = "target-lexicon" +version = "0.12.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" + +[[package]] +name = "tempfile" +version = "3.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c317e0a526ee6120d8dabad239c8dadca62b24b6f168914bbbc8e2fb1f0e567" +dependencies = [ + "cfg-if", + "fastrand", + "getrandom 0.3.1", + "once_cell", + "rustix 1.0.1", + "windows-sys 0.59.0", +] + +[[package]] +name = "termcolor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "textwrap" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" +dependencies = [ + "unicode-width", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.99", +] + +[[package]] +name = "tiff" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba1310fcea54c6a9a4fd1aad794ecc02c31682f6bfbecdf460bf19533eed1e3e" +dependencies = [ + "flate2", + "jpeg-decoder", + "weezl", +] + +[[package]] +name = "tiny-skia" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83d13394d44dae3207b52a326c0c85a8bf87f1541f23b0d143811088497b09ab" +dependencies = [ + "arrayref", + "arrayvec", + "bytemuck", + "cfg-if", + "log", + "tiny-skia-path", +] + +[[package]] +name = "tiny-skia-path" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c9e7fc0c2e86a30b117d0462aa261b72b7a99b7ebd7deb3a14ceda95c5bdc93" +dependencies = [ + "arrayref", + "bytemuck", + "strict-num", +] + +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tokio" +version = "1.44.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9975ea0f48b5aa3972bf2d888c238182458437cc2a19374b81b25cdf1023fb3a" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys 0.52.0", +] + +[[package]] +name = "tokio-macros" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.99", +] + +[[package]] +name = "toml" +version = "0.8.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd87a5cdd6ffab733b2f74bc4fd7ee5fff6634124999ac278c35fc78c6120148" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.22.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17b4795ff5edd201c7cd6dca065ae59972ce77d1b80fa0a84d94950ece7d1474" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", +] + +[[package]] +name = "tracing" +version = "0.1.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.99", +] + +[[package]] +name = "tracing-core" +version = "0.1.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" +dependencies = [ + "once_cell", +] + +[[package]] +name = "transpose" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ad61aed86bc3faea4300c7aee358b4c6d0c8d6ccc36524c96e4c92ccf26e77e" +dependencies = [ + "num-integer", + "strength_reduce", +] + +[[package]] +name = "ttf-parser" +version = "0.25.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2df906b07856748fa3f6e0ad0cbaa047052d4a7dd609e231c4f72cee8c36f31" + +[[package]] +name = "type-map" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "deb68604048ff8fa93347f02441e4487594adc20bb8a084f9e564d2b827a0a9f" +dependencies = [ + "rustc-hash", +] + +[[package]] +name = "typenum" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" + +[[package]] +name = "uds_windows" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89daebc3e6fd160ac4aa9fc8b3bf71e1f74fbf92367ae71fb83a037e8bf164b9" +dependencies = [ + "memoffset", + "tempfile", + "winapi", +] + +[[package]] +name = "unicase" +version = "2.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75b844d17643ee918803943289730bec8aac480150456169e647ed0b576ba539" + +[[package]] +name = "unicode-ident" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" + +[[package]] +name = "unicode-segmentation" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" + +[[package]] +name = "unicode-width" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" + +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + +[[package]] +name = "url" +version = "2.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "v_frame" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6f32aaa24bacd11e488aa9ba66369c7cd514885742c9fe08cfe85884db3e92b" +dependencies = [ + "aligned-vec", + "num-traits", + "wasm-bindgen", +] + +[[package]] +name = "vec_map" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" + +[[package]] +name = "version-compare" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "852e951cb7832cb45cb1169900d19760cfa39b82bc0ea9c0e5a14ae88411c98b" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasi" +version = "0.13.3+wasi-0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26816d2e1a4a36a2940b96c5296ce403917633dff8f3440e9b236ed6f6bacad2" +dependencies = [ + "wit-bindgen-rt", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" +dependencies = [ + "bumpalo", + "log", + "proc-macro2", + "quote", + "syn 2.0.99", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61" +dependencies = [ + "cfg-if", + "js-sys", + "once_cell", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.99", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "wayland-backend" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7208998eaa3870dad37ec8836979581506e0c5c64c20c9e79e9d2a10d6f47bf" +dependencies = [ + "cc", + "downcast-rs", + "rustix 0.38.44", + "scoped-tls", + "smallvec", + "wayland-sys", +] + +[[package]] +name = "wayland-client" +version = "0.31.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2120de3d33638aaef5b9f4472bff75f07c56379cf76ea320bd3a3d65ecaf73f" +dependencies = [ + "bitflags 2.9.0", + "rustix 0.38.44", + "wayland-backend", + "wayland-scanner", +] + +[[package]] +name = "wayland-csd-frame" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "625c5029dbd43d25e6aa9615e88b829a5cad13b2819c4ae129fdbb7c31ab4c7e" +dependencies = [ + "bitflags 2.9.0", + "cursor-icon", + "wayland-backend", +] + +[[package]] +name = "wayland-cursor" +version = "0.31.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a93029cbb6650748881a00e4922b076092a6a08c11e7fbdb923f064b23968c5d" +dependencies = [ + "rustix 0.38.44", + "wayland-client", + "xcursor", +] + +[[package]] +name = "wayland-protocols" +version = "0.32.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0781cf46869b37e36928f7b432273c0995aa8aed9552c556fb18754420541efc" +dependencies = [ + "bitflags 2.9.0", + "wayland-backend", + "wayland-client", + "wayland-scanner", +] + +[[package]] +name = "wayland-protocols-plasma" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ccaacc76703fefd6763022ac565b590fcade92202492381c95b2edfdf7d46b3" +dependencies = [ + "bitflags 2.9.0", + "wayland-backend", + "wayland-client", + "wayland-protocols", + "wayland-scanner", +] + +[[package]] +name = "wayland-protocols-wlr" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "248a02e6f595aad796561fa82d25601bd2c8c3b145b1c7453fc8f94c1a58f8b2" +dependencies = [ + "bitflags 2.9.0", + "wayland-backend", + "wayland-client", + "wayland-protocols", + "wayland-scanner", +] + +[[package]] +name = "wayland-scanner" +version = "0.31.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "896fdafd5d28145fce7958917d69f2fd44469b1d4e861cb5961bcbeebc6d1484" +dependencies = [ + "proc-macro2", + "quick-xml 0.37.2", + "quote", +] + +[[package]] +name = "wayland-sys" +version = "0.31.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbcebb399c77d5aa9fa5db874806ee7b4eba4e73650948e8f93963f128896615" +dependencies = [ + "dlib", + "log", + "once_cell", + "pkg-config", +] + +[[package]] +name = "web-sys" +version = "0.3.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "web-time" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webbrowser" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea9fe1ebb156110ff855242c1101df158b822487e4957b0556d9ffce9db0f535" +dependencies = [ + "block2", + "core-foundation 0.10.0", + "home", + "jni", + "log", + "ndk-context", + "objc2", + "objc2-foundation", + "url", + "web-sys", +] + +[[package]] +name = "weezl" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53a85b86a771b1c87058196170769dd264f66c0782acf1ae6cc51bfd64b39082" + +[[package]] +name = "wgpu" +version = "23.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80f70000db37c469ea9d67defdc13024ddf9a5f1b89cb2941b812ad7cde1735a" +dependencies = [ + "arrayvec", + "cfg_aliases 0.1.1", + "document-features", + "js-sys", + "log", + "parking_lot", + "profiling", + "raw-window-handle", + "smallvec", + "static_assertions", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "wgpu-core", + "wgpu-hal", + "wgpu-types", +] + +[[package]] +name = "wgpu-core" +version = "23.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d63c3c478de8e7e01786479919c8769f62a22eec16788d8c2ac77ce2c132778a" +dependencies = [ + "arrayvec", + "bit-vec", + "bitflags 2.9.0", + "cfg_aliases 0.1.1", + "document-features", + "indexmap", + "log", + "naga", + "once_cell", + "parking_lot", + "profiling", + "raw-window-handle", + "rustc-hash", + "smallvec", + "thiserror", + "wgpu-hal", + "wgpu-types", +] + +[[package]] +name = "wgpu-hal" +version = "23.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89364b8a0b211adc7b16aeaf1bd5ad4a919c1154b44c9ce27838213ba05fd821" +dependencies = [ + "android_system_properties", + "arrayvec", + "ash", + "bitflags 2.9.0", + "bytemuck", + "cfg_aliases 0.1.1", + "core-graphics-types", + "glow 0.14.2", + "glutin_wgl_sys", + "gpu-alloc", + "gpu-descriptor", + "js-sys", + "khronos-egl", + "libc", + "libloading", + "log", + "metal", + "naga", + "ndk-sys 0.5.0+25.2.9519653", + "objc", + "once_cell", + "parking_lot", + "profiling", + "raw-window-handle", + "renderdoc-sys", + "rustc-hash", + "smallvec", + "thiserror", + "wasm-bindgen", + "web-sys", + "wgpu-types", + "windows 0.58.0", +] + +[[package]] +name = "wgpu-types" +version = "23.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "610f6ff27778148c31093f3b03abc4840f9636d58d597ca2f5977433acfe0068" +dependencies = [ + "bitflags 2.9.0", + "js-sys", + "web-sys", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" +dependencies = [ + "windows-sys 0.59.0", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows" +version = "0.54.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9252e5725dbed82865af151df558e754e4a3c2c30818359eb17465f1346a1b49" +dependencies = [ + "windows-core 0.54.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd04d41d93c4992d421894c18c8b43496aa748dd4c081bac0dc93eb0489272b6" +dependencies = [ + "windows-core 0.58.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-core" +version = "0.54.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12661b9c89351d684a50a8a643ce5f608e20243b9fb84687800163429f161d65" +dependencies = [ + "windows-result 0.1.2", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-core" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ba6d44ec8c2591c134257ce647b7ea6b20335bf6379a27dac5f1641fcf59f99" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-result 0.2.0", + "windows-strings", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-implement" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.99", +] + +[[package]] +name = "windows-interface" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.99", +] + +[[package]] +name = "windows-link" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dccfd733ce2b1753b03b6d3c65edf020262ea35e20ccdf3e288043e6dd620e3" + +[[package]] +name = "windows-result" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e383302e8ec8515204254685643de10811af0ed97ea37210dc26fb0032647f8" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-result" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-strings" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" +dependencies = [ + "windows-result 0.2.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "winit" +version = "0.30.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a809eacf18c8eca8b6635091543f02a5a06ddf3dad846398795460e6e0ae3cc0" +dependencies = [ + "ahash", + "android-activity", + "atomic-waker", + "bitflags 2.9.0", + "block2", + "bytemuck", + "calloop", + "cfg_aliases 0.2.1", + "concurrent-queue", + "core-foundation 0.9.4", + "core-graphics", + "cursor-icon", + "dpi", + "js-sys", + "libc", + "memmap2", + "ndk 0.9.0", + "objc2", + "objc2-app-kit", + "objc2-foundation", + "objc2-ui-kit", + "orbclient", + "percent-encoding", + "pin-project", + "raw-window-handle", + "redox_syscall 0.4.1", + "rustix 0.38.44", + "sctk-adwaita", + "smithay-client-toolkit", + "smol_str", + "tracing", + "unicode-segmentation", + "wasm-bindgen", + "wasm-bindgen-futures", + "wayland-backend", + "wayland-client", + "wayland-protocols", + "wayland-protocols-plasma", + "web-sys", + "web-time", + "windows-sys 0.52.0", + "x11-dl", + "x11rb", + "xkbcommon-dl", +] + +[[package]] +name = "winnow" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e7f4ea97f6f78012141bcdb6a216b2609f0979ada50b20ca5b52dde2eac2bb1" +dependencies = [ + "memchr", +] + +[[package]] +name = "wit-bindgen-rt" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c" +dependencies = [ + "bitflags 2.9.0", +] + +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + +[[package]] +name = "x11-dl" +version = "2.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38735924fedd5314a6e548792904ed8c6de6636285cb9fec04d5b1db85c1516f" +dependencies = [ + "libc", + "once_cell", + "pkg-config", +] + +[[package]] +name = "x11rb" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d91ffca73ee7f68ce055750bf9f6eca0780b8c85eff9bc046a3b0da41755e12" +dependencies = [ + "as-raw-xcb-connection", + "gethostname", + "libc", + "libloading", + "once_cell", + "rustix 0.38.44", + "x11rb-protocol", +] + +[[package]] +name = "x11rb-protocol" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec107c4503ea0b4a98ef47356329af139c0a4f7750e621cf2973cd3385ebcb3d" + +[[package]] +name = "xcursor" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ef33da6b1660b4ddbfb3aef0ade110c8b8a781a3b6382fa5f2b5b040fd55f61" + +[[package]] +name = "xdg-home" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec1cdab258fb55c0da61328dc52c8764709b249011b2cad0454c72f0bf10a1f6" +dependencies = [ + "libc", + "windows-sys 0.59.0", +] + +[[package]] +name = "xkbcommon-dl" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d039de8032a9a8856a6be89cea3e5d12fdd82306ab7c94d74e6deab2460651c5" +dependencies = [ + "bitflags 2.9.0", + "dlib", + "log", + "once_cell", + "xkeysym", +] + +[[package]] +name = "xkeysym" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9cc00251562a284751c9973bace760d86c0276c471b4be569fe6b068ee97a56" + +[[package]] +name = "xml-rs" +version = "0.8.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5b940ebc25896e71dd073bad2dbaa2abfe97b0a391415e22ad1326d9c54e3c4" + +[[package]] +name = "yoke" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.99", + "synstructure", +] + +[[package]] +name = "zbus" +version = "4.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb97012beadd29e654708a0fdb4c84bc046f537aecfde2c3ee0a9e4b4d48c725" +dependencies = [ + "async-broadcast", + "async-executor", + "async-fs", + "async-io", + "async-lock", + "async-process", + "async-recursion", + "async-task", + "async-trait", + "blocking", + "enumflags2", + "event-listener", + "futures-core", + "futures-sink", + "futures-util", + "hex", + "nix", + "ordered-stream", + "rand", + "serde", + "serde_repr", + "sha1", + "static_assertions", + "tracing", + "uds_windows", + "windows-sys 0.52.0", + "xdg-home", + "zbus_macros", + "zbus_names", + "zvariant", +] + +[[package]] +name = "zbus-lockstep" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ca2c5dceb099bddaade154055c926bb8ae507a18756ba1d8963fd7b51d8ed1d" +dependencies = [ + "zbus_xml", + "zvariant", +] + +[[package]] +name = "zbus-lockstep-macros" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "709ab20fc57cb22af85be7b360239563209258430bccf38d8b979c5a2ae3ecce" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.99", + "zbus-lockstep", + "zbus_xml", + "zvariant", +] + +[[package]] +name = "zbus_macros" +version = "4.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "267db9407081e90bbfa46d841d3cbc60f59c0351838c4bc65199ecd79ab1983e" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.99", + "zvariant_utils", +] + +[[package]] +name = "zbus_names" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b9b1fef7d021261cc16cba64c351d291b715febe0fa10dc3a443ac5a5022e6c" +dependencies = [ + "serde", + "static_assertions", + "zvariant", +] + +[[package]] +name = "zbus_xml" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab3f374552b954f6abb4bd6ce979e6c9b38fb9d0cd7cc68a7d796e70c9f3a233" +dependencies = [ + "quick-xml 0.30.0", + "serde", + "static_assertions", + "zbus_names", + "zvariant", +] + +[[package]] +name = "zerocopy" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +dependencies = [ + "byteorder", + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.99", +] + +[[package]] +name = "zerofrom" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.99", + "synstructure", +] + +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.99", +] + +[[package]] +name = "zune-core" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f423a2c17029964870cfaabb1f13dfab7d092a62a29a89264f4d36990ca414a" + +[[package]] +name = "zune-inflate" +version = "0.2.54" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73ab332fe2f6680068f3582b16a24f90ad7096d5d39b974d1c0aff0125116f02" +dependencies = [ + "simd-adler32", +] + +[[package]] +name = "zune-jpeg" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99a5bab8d7dedf81405c4bb1f2b83ea057643d9cb28778cea9eecddeedd2e028" +dependencies = [ + "zune-core", +] + +[[package]] +name = "zvariant" +version = "4.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2084290ab9a1c471c38fc524945837734fbf124487e105daec2bb57fd48c81fe" +dependencies = [ + "endi", + "enumflags2", + "serde", + "static_assertions", + "zvariant_derive", +] + +[[package]] +name = "zvariant_derive" +version = "4.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73e2ba546bda683a90652bac4a279bc146adad1386f25379cf73200d2002c449" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.99", + "zvariant_utils", +] + +[[package]] +name = "zvariant_utils" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c51bcff7cc3dbb5055396bcf774748c3dab426b4b8659046963523cee4808340" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.99", +] diff --git a/auto/Cargo.toml b/auto/Cargo.toml new file mode 100644 index 0000000..fd092f8 --- /dev/null +++ b/auto/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "auto" +version = "0.1.0" +edition = "2024" + +[dependencies] +common = {path = "../common"} +interface = {path = "../interface"} diff --git a/auto/src/lib.rs b/auto/src/lib.rs new file mode 100644 index 0000000..e558b98 --- /dev/null +++ b/auto/src/lib.rs @@ -0,0 +1,73 @@ +use std::{collections::VecDeque, ops::Sub}; + +use common::CamState; +use interface::auto::AutoInterface; + +const AUTO_GAP: i16 = 140; /// mm tofs must drop to count as a hit +const AUTO_SELF_OCCLUSION: u16 = 130; /// minimum + +async fn auto (interface: &AutoInterface) { + let mut tof_l = Stats::new(); + let mut tof_r = Stats::new(); + loop { + let data = interface.sensor_update().await; + let cam = interface.cam_state(); + let CamState::Charged = cam else { + continue; + }; + + let Some(latest_tof_l) = data.tof_l else { + continue; + }; + tof_l.update(latest_tof_l as i16); + let Some(latest_tof_r) = data.tof_r else { + continue; + }; + tof_r.update(latest_tof_r as i16); + + let detection = |latest: u16, delta: i16| { + delta < AUTO_GAP && latest > AUTO_SELF_OCCLUSION + }; + + if detection(latest_tof_l, tof_l.delta()) || detection(latest_tof_l, tof_l.delta()) { + if let Ok(()) = interface.enable() { + println!("found, now seek") + } + } + } +} + + +struct Stats { + table: VecDeque +} + +impl Stats { + pub fn new() -> Self { + Self { table: VecDeque::new() } + + } + + const MAX_ELEMENTS: usize = 3; + + pub fn update(&mut self, elem: T) { + self.table.push_front(elem); + if self.table.len() > Self::MAX_ELEMENTS { + self.table.pop_back(); + } + } +} + +impl + Copy + From> Stats { + pub fn delta(&self) -> T { + *self.table.get(0).unwrap_or(&T::from(0)) - *self.table.get(1).unwrap_or(&T::from(0)) + } + + pub fn max(&self) -> T { + *self.table.iter().max().unwrap_or(&T::from(0)) + } + + pub fn min(&self) -> T { + *self.table.iter().max().unwrap_or(&T::from(0)) + } +} diff --git a/interface/src/auto.rs b/interface/src/auto.rs index 1f868db..49400e7 100644 --- a/interface/src/auto.rs +++ b/interface/src/auto.rs @@ -3,109 +3,41 @@ use std::{collections::VecDeque, ops::{Div, Sub}}; use common::{CamState, ControlPacket, SensorData}; use anyhow::Result; -struct AutoConfig { +pub struct AutoConfig { turn_gain: f32, auto_fire_distance: f32, } -const AUTO_GAP: i16 = 140; /// mm tofs must drop to count as a hit -const AUTO_SELF_OCCLUSION: u16 = 130; /// minimum -struct AutoInterface { +pub struct AutoInterface { } impl AutoInterface { /// change active command, fails if not in control - fn run_command(&self, command: ControlPacket) -> Result<()> {unimplemented!()} - fn sensor_data(&self) -> SensorData {unimplemented!()} - fn cam_state(&self) -> CamState {unimplemented!()} - async fn sensor_update(&self) -> SensorData {unimplemented!()} + pub fn run_command(&self, command: ControlPacket) -> Result<()> {unimplemented!()} + pub fn sensor_data(&self) -> SensorData {unimplemented!()} + pub fn cam_state(&self) -> CamState {unimplemented!()} + pub async fn sensor_update(&self) -> SensorData {unimplemented!()} /// disable auto - fn disable(&self) {unimplemented!()} + pub fn disable(&self) {unimplemented!()} /// request auto enable, fails if the driver does not grant it - fn enable(&self) -> Result<()> {unimplemented!()} - fn enabled(&self) -> bool {unimplemented!()} - fn auto_conf(&self) -> AutoConfig {unimplemented!()} + pub fn enable(&self) -> Result<()> {unimplemented!()} + pub fn enabled(&self) -> bool {unimplemented!()} + pub fn auto_conf(&self) -> AutoConfig {unimplemented!()} fn send_message(&self, message: String) {unimplemented!()} } -struct Configurable { - name: &'static str, - default: f32, - min: f32, - max: f32, +pub struct Configurable { + pub name: &'static str, + pub default: f32, + pub min: f32, + pub max: f32, } /// A fake trait in the sense that these methods are exposed as symbols, not trait methods -trait Auto { +pub trait Auto { /// entrypoint async fn run(interface: &AutoInterface); /// register fn default_configs() -> [Configurable]; fn name() -> &'static str; } - -async fn auto (interface: &AutoInterface) { - let mut tof_l = Stats::new(); - let mut tof_r = Stats::new(); - loop { - let data = interface.sensor_update().await; - let cam = interface.cam_state(); - let CamState::Charged = cam else { - continue; - }; - - let Some(latest_tof_l) = data.tof_l else { - continue; - }; - tof_l.update(latest_tof_l as i16); - let Some(latest_tof_r) = data.tof_r else { - continue; - }; - tof_r.update(latest_tof_r as i16); - - let detection = |latest: u16, delta: i16| { - delta < AUTO_GAP && latest > AUTO_SELF_OCCLUSION - }; - - if detection(latest_tof_l, tof_l.delta()) || detection(latest_tof_l, tof_l.delta()) { - if let Ok(()) = interface.enable() { - println!("found, now seek") - } - } - } -} - - -struct Stats { - table: VecDeque -} - -impl Stats { - pub fn new() -> Self { - Self { table: VecDeque::new() } - - } - - const MAX_ELEMENTS: usize = 3; - - pub fn update(&mut self, elem: T) { - self.table.push_front(elem); - if self.table.len() > Self::MAX_ELEMENTS { - self.table.pop_back(); - } - } -} - -impl + Copy + From> Stats { - pub fn delta(&self) -> T { - *self.table.get(0).unwrap_or(&T::from(0)) - *self.table.get(1).unwrap_or(&T::from(0)) - } - - pub fn max(&self) -> T { - *self.table.iter().max().unwrap_or(&T::from(0)) - } - - pub fn min(&self) -> T { - *self.table.iter().max().unwrap_or(&T::from(0)) - } -} From 21e269bc43650f8b2aec297f57f3f88595e9e032 Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Sat, 8 Mar 2025 19:09:30 -0500 Subject: [PATCH 48/69] builder pattern for configs --- auto/Cargo.toml | 3 +++ auto/src/lib.rs | 23 ++++++++++++++++++++--- interface/Cargo.lock | 22 +++++++++++++++------- interface/Cargo.toml | 2 ++ interface/src/auto.rs | 28 +++++++++++++++++++++++++++- 5 files changed, 67 insertions(+), 11 deletions(-) diff --git a/auto/Cargo.toml b/auto/Cargo.toml index fd092f8..6e133e4 100644 --- a/auto/Cargo.toml +++ b/auto/Cargo.toml @@ -1,3 +1,6 @@ +[lib] +crate-type = ["dylib"] + [package] name = "auto" version = "0.1.0" diff --git a/auto/src/lib.rs b/auto/src/lib.rs index e558b98..2c21e09 100644 --- a/auto/src/lib.rs +++ b/auto/src/lib.rs @@ -1,12 +1,29 @@ -use std::{collections::VecDeque, ops::Sub}; +use std::{collections::VecDeque, ops::Sub, pin::Pin}; use common::CamState; -use interface::auto::AutoInterface; +use interface::auto::{AutoInterface, Configurable}; + +#[unsafe(no_mangle)] +pub fn entry(interface: AutoInterface) -> Pin + Send>> { + Box::pin(auto(interface)) +} + +#[unsafe(no_mangle)] +pub static NAME: &'static str = "scanseek v1"; + const AUTO_GAP: i16 = 140; /// mm tofs must drop to count as a hit const AUTO_SELF_OCCLUSION: u16 = 130; /// minimum -async fn auto (interface: &AutoInterface) { +#[unsafe(no_mangle)] +pub static CONFIGS: &[Configurable] = &[ + Configurable::new("auto minimum gap").range(0. .. 300.).default(140.) + .description("distance (mm) distance measurements must instantaneously drop to indicate a detection. This should line up with the size of the smallest robot you compete against"), + Configurable::new("auto self occlusion").range(0. .. 200.).default(143.) + .description("distance (mm) below which measurements are considered noise in the scan phase"), +]; + +async fn auto (interface: AutoInterface) { let mut tof_l = Stats::new(); let mut tof_r = Stats::new(); loop { diff --git a/interface/Cargo.lock b/interface/Cargo.lock index 8fc4206..2c5d3f7 100644 --- a/interface/Cargo.lock +++ b/interface/Cargo.lock @@ -1060,9 +1060,9 @@ checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" [[package]] name = "crunchy" -version = "0.2.3" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43da5946c66ffcc7745f48db692ffbb10a83bfe0afd96235c5c2a4fb23994929" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] name = "crypto-common" @@ -1150,7 +1150,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d72e9c39f6e11a2e922d04a34ec5e7ef522ea3f5a1acfca7a19d16ad5fe50f5" dependencies = [ "bytemuck", - "emath", + "emath 0.30.0", "serde", ] @@ -1201,7 +1201,7 @@ checksum = "252d52224d35be1535d7fd1d6139ce071fb42c9097773e79f7665604f5596b5e" dependencies = [ "accesskit", "ahash", - "emath", + "emath 0.30.0", "epaint", "log", "nohash-hasher", @@ -1308,6 +1308,12 @@ dependencies = [ "serde", ] +[[package]] +name = "emath" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e4cadcff7a5353ba72b7fea76bf2122b5ebdbc68e8155aa56dfdea90083fe1b" + [[package]] name = "embedded-io" version = "0.4.0" @@ -1389,7 +1395,7 @@ dependencies = [ "ahash", "bytemuck", "ecolor", - "emath", + "emath 0.30.0", "epaint_default_fonts", "log", "nohash-hasher", @@ -1666,9 +1672,9 @@ dependencies = [ [[package]] name = "glob" -version = "0.3.2" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "glow" @@ -2124,9 +2130,11 @@ dependencies = [ "eframe", "egui-toast", "egui_extras", + "emath 0.31.1", "heapless", "home", "image", + "libloading", "pitch-detection", "postcard", "rust-music-theory", diff --git a/interface/Cargo.toml b/interface/Cargo.toml index 8732af4..e03a77c 100644 --- a/interface/Cargo.toml +++ b/interface/Cargo.toml @@ -21,3 +21,5 @@ home = "0.5.11" atomic_float = "1.1.0" chrono = "0.4.40" image = "0.25.5" +libloading = "0.8.6" +emath = "0.31.1" diff --git a/interface/src/auto.rs b/interface/src/auto.rs index 49400e7..420927c 100644 --- a/interface/src/auto.rs +++ b/interface/src/auto.rs @@ -1,4 +1,4 @@ -use std::{collections::VecDeque, ops::{Div, Sub}}; +use std::{collections::VecDeque, ops::{Div, Range, Sub}}; use common::{CamState, ControlPacket, SensorData}; use anyhow::Result; @@ -28,11 +28,37 @@ impl AutoInterface { pub struct Configurable { pub name: &'static str, + pub description: Option<&'static str>, pub default: f32, pub min: f32, pub max: f32, } +impl Configurable { + pub const fn new(name: &'static str) -> Self { + Self { name, description: None, default: 0.0, min: 0.0, max: 1.0 } + } + pub const fn range(self, range: Range) -> Self { + Self { min: range.start, max: range.end, ..self } + } + pub const fn description(self, description: &'static str) -> Self { + Self { description: Some(description), ..self } + } + pub const fn default(self, default: f32) -> Self { + Self { default, ..self } + } + + pub const fn name(&'static self) -> &'static str { + self.name + } +} + +impl Default for Configurable { + fn default() -> Self { + Self { name: Default::default(), description: Default::default(), default: Default::default(), min: 0.0, max: 1.0 } + } +} + /// A fake trait in the sense that these methods are exposed as symbols, not trait methods pub trait Auto { /// entrypoint From 5b3347bb00033b71b09a634e268812f8721dff7b Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Sat, 8 Mar 2025 19:18:25 -0500 Subject: [PATCH 49/69] use configurable as a key --- auto/src/lib.rs | 17 ++++++++++------- interface/src/auto.rs | 12 ++++++++++-- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/auto/src/lib.rs b/auto/src/lib.rs index 2c21e09..08a8d52 100644 --- a/auto/src/lib.rs +++ b/auto/src/lib.rs @@ -12,15 +12,15 @@ pub fn entry(interface: AutoInterface) -> Pin + Send #[unsafe(no_mangle)] pub static NAME: &'static str = "scanseek v1"; -const AUTO_GAP: i16 = 140; /// mm tofs must drop to count as a hit -const AUTO_SELF_OCCLUSION: u16 = 130; /// minimum +const AUTO_GAP: Configurable = Configurable::new("auto minimum gap").range(0. .. 300.).default(140.) + .description("distance (mm) distance measurements must instantaneously drop to indicate a detection. This should line up with the size of the smallest robot you compete against"); +const AUTO_SELF_OCCLUSION: Configurable = Configurable::new("auto self occlusion").range(0. .. 200.).default(143.) + .description("distance (mm) below which measurements are considered noise in the scan phase"); #[unsafe(no_mangle)] pub static CONFIGS: &[Configurable] = &[ - Configurable::new("auto minimum gap").range(0. .. 300.).default(140.) - .description("distance (mm) distance measurements must instantaneously drop to indicate a detection. This should line up with the size of the smallest robot you compete against"), - Configurable::new("auto self occlusion").range(0. .. 200.).default(143.) - .description("distance (mm) below which measurements are considered noise in the scan phase"), + AUTO_GAP, + AUTO_SELF_OCCLUSION, ]; async fn auto (interface: AutoInterface) { @@ -42,8 +42,11 @@ async fn auto (interface: AutoInterface) { }; tof_r.update(latest_tof_r as i16); + let auto_gap = interface.conf(&AUTO_GAP); + let auto_self_occlusion = interface.conf(&AUTO_SELF_OCCLUSION); + let detection = |latest: u16, delta: i16| { - delta < AUTO_GAP && latest > AUTO_SELF_OCCLUSION + delta < auto_gap as i16 && latest > auto_self_occlusion as u16 }; if detection(latest_tof_l, tof_l.delta()) || detection(latest_tof_l, tof_l.delta()) { diff --git a/interface/src/auto.rs b/interface/src/auto.rs index 420927c..5a382e5 100644 --- a/interface/src/auto.rs +++ b/interface/src/auto.rs @@ -1,4 +1,4 @@ -use std::{collections::VecDeque, ops::{Div, Range, Sub}}; +use std::{collections::VecDeque, ops::{Deref, Div, Index, Range, Sub}}; use common::{CamState, ControlPacket, SensorData}; use anyhow::Result; @@ -22,7 +22,7 @@ impl AutoInterface { /// request auto enable, fails if the driver does not grant it pub fn enable(&self) -> Result<()> {unimplemented!()} pub fn enabled(&self) -> bool {unimplemented!()} - pub fn auto_conf(&self) -> AutoConfig {unimplemented!()} + pub fn conf(&self, key: &'static Configurable) -> f32 {unimplemented!()} fn send_message(&self, message: String) {unimplemented!()} } @@ -53,6 +53,14 @@ impl Configurable { } } +impl Deref for Configurable { + type Target = str; + + fn deref(&self) -> &Self::Target { + self.name + } +} + impl Default for Configurable { fn default() -> Self { Self { name: Default::default(), description: Default::default(), default: Default::default(), min: 0.0, max: 1.0 } From 27e69bf3011484352da0d956a73a2487af3e6db9 Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Sat, 8 Mar 2025 19:28:05 -0500 Subject: [PATCH 50/69] impl data receive --- interface/src/auto.rs | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/interface/src/auto.rs b/interface/src/auto.rs index 5a382e5..9c84841 100644 --- a/interface/src/auto.rs +++ b/interface/src/auto.rs @@ -1,22 +1,34 @@ use std::{collections::VecDeque, ops::{Deref, Div, Index, Range, Sub}}; -use common::{CamState, ControlPacket, SensorData}; +use common::{CamState, ControlPacket, SensorData, TelemetryPacket}; use anyhow::Result; +use tokio::sync::{broadcast, mpsc, watch}; pub struct AutoConfig { turn_gain: f32, auto_fire_distance: f32, } +#[derive(Clone)] pub struct AutoInterface { + command_sender: Option>, + data_receiver: watch::Receiver, } impl AutoInterface { /// change active command, fails if not in control pub fn run_command(&self, command: ControlPacket) -> Result<()> {unimplemented!()} - pub fn sensor_data(&self) -> SensorData {unimplemented!()} - pub fn cam_state(&self) -> CamState {unimplemented!()} - pub async fn sensor_update(&self) -> SensorData {unimplemented!()} + pub fn sensor_data(&mut self) -> SensorData { + self.data_receiver.borrow_and_update().sensors.clone() + } + pub fn cam_state(&mut self) -> CamState { + self.data_receiver.borrow_and_update().cam_state.clone() + } + pub async fn sensor_update(&mut self) -> SensorData { + self.data_receiver.changed().await.unwrap(); + self.data_receiver.borrow().sensors.clone() + + } /// disable auto pub fn disable(&self) {unimplemented!()} /// request auto enable, fails if the driver does not grant it From ce223621d16cc61fad0a8dfaa1dc837f42741168 Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Sat, 8 Mar 2025 20:47:52 -0500 Subject: [PATCH 51/69] auto conf sync to gui --- interface/src/auto.rs | 31 ++++++++++++++++++++++--------- interface/src/gui.rs | 39 +++++++++++++++++++++++++++++++++++---- 2 files changed, 57 insertions(+), 13 deletions(-) diff --git a/interface/src/auto.rs b/interface/src/auto.rs index 9c84841..b43a217 100644 --- a/interface/src/auto.rs +++ b/interface/src/auto.rs @@ -1,8 +1,9 @@ -use std::{collections::VecDeque, ops::{Deref, Div, Index, Range, Sub}}; +use std::{collections::VecDeque, ops::{Deref, Div, Index, Range, Sub}, sync::Arc}; use common::{CamState, ControlPacket, SensorData, TelemetryPacket}; -use anyhow::Result; -use tokio::sync::{broadcast, mpsc, watch}; +use anyhow::{Context, Ok, Result}; +use eframe::Storage; +use tokio::sync::{self, broadcast, mpsc, watch}; pub struct AutoConfig { turn_gain: f32, @@ -10,14 +11,19 @@ pub struct AutoConfig { } #[derive(Clone)] -pub struct AutoInterface { +pub struct AutoInterface<'s> { command_sender: Option>, data_receiver: watch::Receiver, + config: &'s dyn Storage, + enabled: bool, } -impl AutoInterface { +impl<'s> AutoInterface<'s> { /// change active command, fails if not in control - pub fn run_command(&self, command: ControlPacket) -> Result<()> {unimplemented!()} + pub async fn run_command(&self, command: ControlPacket) -> Result<()> { + self.command_sender.as_ref().context("no sender")?.send(command).await?; + Ok(()) + } pub fn sensor_data(&mut self) -> SensorData { self.data_receiver.borrow_and_update().sensors.clone() } @@ -32,9 +38,16 @@ impl AutoInterface { /// disable auto pub fn disable(&self) {unimplemented!()} /// request auto enable, fails if the driver does not grant it - pub fn enable(&self) -> Result<()> {unimplemented!()} - pub fn enabled(&self) -> bool {unimplemented!()} - pub fn conf(&self, key: &'static Configurable) -> f32 {unimplemented!()} + pub fn enable(&mut self) -> Result<()> { + self.enabled = self.command_sender.is_some(); + Ok(()) + } + pub fn enabled(&self) -> bool { self.enabled} + pub fn conf(&self, key: &'static Configurable) -> f32 { + self.config.get_string(&key.name) + .map(|s| s.parse().ok()) + .flatten().unwrap_or(key.default) + } fn send_message(&self, message: String) {unimplemented!()} } diff --git a/interface/src/gui.rs b/interface/src/gui.rs index f458bf4..a06ce2a 100644 --- a/interface/src/gui.rs +++ b/interface/src/gui.rs @@ -1,13 +1,12 @@ - -use std::{cell::OnceCell, path::PathBuf, sync::atomic::Ordering, time::Duration}; +use std::{cell::OnceCell, collections::HashMap, path::PathBuf, sync::{atomic::Ordering, Arc}, time::Duration}; use common::{ControlPacket, TelemetryPacket}; -use eframe::{egui::{self, containers, Align2, Checkbox, Context, IconData, Id, ImageSource, Label}, Storage}; +use eframe::{egui::{self, containers, Align2, Checkbox, Context, IconData, Id, ImageSource, Label, Ui}, Storage}; use image::ImageFormat; use tokio::{runtime::Runtime, sync::{mpsc, watch::Receiver}}; use egui_toast::{Toast, Toasts}; -use crate::{storage_dir::storage_dir, POWER_THRESHOLD}; +use crate::{auto::Configurable, storage_dir::storage_dir, POWER_THRESHOLD}; pub const GUI: OnceCell = OnceCell::new(); @@ -88,6 +87,18 @@ impl GUI { } } +// dupe from auto crate for testing +const AUTO_GAP: Configurable = Configurable::new("auto minimum gap").range(0. .. 300.).default(140.) + .description("distance (mm) distance measurements must instantaneously drop to indicate a detection. This should line up with the size of the smallest robot you compete against"); +const AUTO_SELF_OCCLUSION: Configurable = Configurable::new("auto self occlusion").range(0. .. 200.).default(143.) + .description("distance (mm) below which measurements are considered noise in the scan phase"); + +#[unsafe(no_mangle)] +pub static CONFIGS: &[Configurable] = &[ + AUTO_GAP, + AUTO_SELF_OCCLUSION, +]; + impl eframe::App for GUI { fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) { let _ = GUI.set(ctx.clone()); @@ -110,6 +121,10 @@ impl eframe::App for GUI { storage.set_string("selected_auto", format!("{}",self.selected_auto)); POWER_THRESHOLD.store(self.volume_threshold, Ordering::Relaxed); + + for conf in CONFIGS { + configurator(ui, conf, storage); + } }); egui::CentralPanel::default().show(ctx, |ui| { @@ -144,3 +159,19 @@ impl eframe::App for GUI { } } } + +fn configurator(ui: &mut Ui, config: &Configurable, map: &mut dyn Storage) { + ui.add(egui::Slider::from_get_set(config.min as f64 ..= config.max as f64, |value| { + match value { + Some(value) => { + map.set_string(&config.name,format!("{value}")); + value + }, + None => map.get_string(&config.name).map(|s| s.parse().ok()).flatten().unwrap_or(config.default as f64), + } + + }).text(config.name)); + if let Some(description) = config.description { + ui.label(description); + } +} From 9e43e6a943d0855b792d9d4f8ad89c7340febfb4 Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Sun, 9 Mar 2025 20:08:54 -0400 Subject: [PATCH 52/69] load config from real file --- auto/src/lib.rs | 5 +++-- interface/src/auto.rs | 25 ++++++++++++++++++++++--- interface/src/gui.rs | 1 - interface/src/main.rs | 5 ++++- 4 files changed, 29 insertions(+), 7 deletions(-) diff --git a/auto/src/lib.rs b/auto/src/lib.rs index 08a8d52..13e47ef 100644 --- a/auto/src/lib.rs +++ b/auto/src/lib.rs @@ -5,13 +5,14 @@ use interface::auto::{AutoInterface, Configurable}; #[unsafe(no_mangle)] -pub fn entry(interface: AutoInterface) -> Pin + Send>> { +pub fn entry(interface: AutoInterface) -> Pin>> { Box::pin(auto(interface)) } #[unsafe(no_mangle)] pub static NAME: &'static str = "scanseek v1"; + const AUTO_GAP: Configurable = Configurable::new("auto minimum gap").range(0. .. 300.).default(140.) .description("distance (mm) distance measurements must instantaneously drop to indicate a detection. This should line up with the size of the smallest robot you compete against"); const AUTO_SELF_OCCLUSION: Configurable = Configurable::new("auto self occlusion").range(0. .. 200.).default(143.) @@ -23,7 +24,7 @@ pub static CONFIGS: &[Configurable] = &[ AUTO_SELF_OCCLUSION, ]; -async fn auto (interface: AutoInterface) { +async fn auto (mut interface: AutoInterface) { let mut tof_l = Stats::new(); let mut tof_r = Stats::new(); loop { diff --git a/interface/src/auto.rs b/interface/src/auto.rs index b43a217..dd81603 100644 --- a/interface/src/auto.rs +++ b/interface/src/auto.rs @@ -3,6 +3,7 @@ use std::{collections::VecDeque, ops::{Deref, Div, Index, Range, Sub}, sync::Arc use common::{CamState, ControlPacket, SensorData, TelemetryPacket}; use anyhow::{Context, Ok, Result}; use eframe::Storage; +use libloading::{Library, Symbol}; use tokio::sync::{self, broadcast, mpsc, watch}; pub struct AutoConfig { @@ -11,14 +12,14 @@ pub struct AutoConfig { } #[derive(Clone)] -pub struct AutoInterface<'s> { +pub struct AutoInterface { command_sender: Option>, data_receiver: watch::Receiver, - config: &'s dyn Storage, + config: &'static dyn Storage, enabled: bool, } -impl<'s> AutoInterface<'s> { +impl AutoInterface { /// change active command, fails if not in control pub async fn run_command(&self, command: ControlPacket) -> Result<()> { self.command_sender.as_ref().context("no sender")?.send(command).await?; @@ -100,3 +101,21 @@ pub trait Auto { fn default_configs() -> [Configurable]; fn name() -> &'static str; } + + +pub fn get_confs() -> Result<()> { + let lib = unsafe {Library::new("../auto/target/release/libauto.so")?}; + + let configurations: Symbol<&&[Configurable]> = unsafe {lib.get(b"CONFIGS").unwrap()}; + + for config in configurations.iter() { + println!("co {}", config.name); + println!("co {:?}", config.description); + } + + let name: Symbol<&&'static str> = unsafe {lib.get(b"NAME").unwrap()}; + println!("na {:?}", *name); + + Ok(()) +} + diff --git a/interface/src/gui.rs b/interface/src/gui.rs index a06ce2a..3b09761 100644 --- a/interface/src/gui.rs +++ b/interface/src/gui.rs @@ -93,7 +93,6 @@ const AUTO_GAP: Configurable = Configurable::new("auto minimum gap").range(0. .. const AUTO_SELF_OCCLUSION: Configurable = Configurable::new("auto self occlusion").range(0. .. 200.).default(143.) .description("distance (mm) below which measurements are considered noise in the scan phase"); -#[unsafe(no_mangle)] pub static CONFIGS: &[Configurable] = &[ AUTO_GAP, AUTO_SELF_OCCLUSION, diff --git a/interface/src/main.rs b/interface/src/main.rs index 238af37..e99953f 100644 --- a/interface/src/main.rs +++ b/interface/src/main.rs @@ -2,7 +2,7 @@ use std::{fmt::format, ops::ControlFlow, result, sync::{atomic::Ordering, Arc}, use anyhow::{Context, Ok, Result}; use atomic_float::AtomicF32; -use interface::{combatlog::{combat_logger, CombatData}, POWER_THRESHOLD}; +use interface::{auto::get_confs, combatlog::{combat_logger, CombatData}, POWER_THRESHOLD}; use common::{ControlPacket, TelemetryPacket}; use cpal::traits::{DeviceTrait, HostTrait, StreamTrait}; use egui_toast::{Toast, ToastKind}; @@ -13,6 +13,9 @@ use tokio::{io::{AsyncReadExt, AsyncWriteExt, BufWriter, WriteHalf}, net::{tcp:: fn main() -> Result<()> { + get_confs().unwrap(); + panic!("got too far"); + let (logging_sender, combatlog) = mpsc::channel(64); // assumes pulseaudio system with f32 samples and 2204 sample packets From 9c61d88fe4b56918a9048e479d0873b1ba5ad079 Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Tue, 11 Mar 2025 14:08:47 -0400 Subject: [PATCH 53/69] started to replace the egui persistence layer --- auto/Cargo.lock | 31 ++++++++++++++++++++++++++----- interface/Cargo.lock | 31 ++++++++++++++++++++++++++----- interface/Cargo.toml | 1 + interface/src/lib.rs | 1 + interface/src/loader.rs | 0 interface/src/storage.rs | 14 ++++++++++++++ 6 files changed, 68 insertions(+), 10 deletions(-) create mode 100644 interface/src/loader.rs create mode 100644 interface/src/storage.rs diff --git a/auto/Cargo.lock b/auto/Cargo.lock index a6729dc..d77333e 100644 --- a/auto/Cargo.lock +++ b/auto/Cargo.lock @@ -49,7 +49,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f47983a1084940ba9a39c077a8c63e55c619388be5476ac04c804cfbd1e63459" dependencies = [ "accesskit", - "hashbrown", + "hashbrown 0.15.2", "immutable-chunkmap", ] @@ -61,7 +61,7 @@ checksum = "7329821f3bd1101e03a7d2e03bd339e3ac0dc64c70b4c9f9ae1949e3ba8dece1" dependencies = [ "accesskit", "accesskit_consumer", - "hashbrown", + "hashbrown 0.15.2", "objc2", "objc2-app-kit", "objc2-foundation", @@ -93,7 +93,7 @@ checksum = "24fcd5d23d70670992b823e735e859374d694a3d12bfd8dd32bd3bd8bedb5d81" dependencies = [ "accesskit", "accesskit_consumer", - "hashbrown", + "hashbrown 0.15.2", "paste", "static_assertions", "windows 0.58.0", @@ -1088,6 +1088,20 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96a6ac251f4a2aca6b3f91340350eab87ae57c3f127ffeb585e92bd336717991" +[[package]] +name = "dashmap" +version = "6.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5041cc499144891f3790297212f32a74fb938e5136a14943f338ef9e0ae276cf" +dependencies = [ + "cfg-if", + "crossbeam-utils", + "hashbrown 0.14.5", + "lock_api", + "once_cell", + "parking_lot_core", +] + [[package]] name = "dasp_sample" version = "0.11.0" @@ -1801,7 +1815,7 @@ checksum = "dcf29e94d6d243368b7a56caa16bc213e4f9f8ed38c4d9557069527b5d5281ca" dependencies = [ "bitflags 2.9.0", "gpu-descriptor-types", - "hashbrown", + "hashbrown 0.15.2", ] [[package]] @@ -1832,6 +1846,12 @@ dependencies = [ "byteorder", ] +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" + [[package]] name = "hashbrown" version = "0.15.2" @@ -2123,7 +2143,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c9c992b02b5b4c94ea26e32fe5bccb7aa7d9f390ab5c1221ff895bc7ea8b652" dependencies = [ "equivalent", - "hashbrown", + "hashbrown 0.15.2", ] [[package]] @@ -2135,6 +2155,7 @@ dependencies = [ "chrono", "common", "cpal", + "dashmap", "eframe", "egui-toast", "egui_extras", diff --git a/interface/Cargo.lock b/interface/Cargo.lock index 2c5d3f7..85d0c52 100644 --- a/interface/Cargo.lock +++ b/interface/Cargo.lock @@ -49,7 +49,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f47983a1084940ba9a39c077a8c63e55c619388be5476ac04c804cfbd1e63459" dependencies = [ "accesskit", - "hashbrown", + "hashbrown 0.15.2", "immutable-chunkmap", ] @@ -61,7 +61,7 @@ checksum = "7329821f3bd1101e03a7d2e03bd339e3ac0dc64c70b4c9f9ae1949e3ba8dece1" dependencies = [ "accesskit", "accesskit_consumer", - "hashbrown", + "hashbrown 0.15.2", "objc2", "objc2-app-kit", "objc2-foundation", @@ -93,7 +93,7 @@ checksum = "24fcd5d23d70670992b823e735e859374d694a3d12bfd8dd32bd3bd8bedb5d81" dependencies = [ "accesskit", "accesskit_consumer", - "hashbrown", + "hashbrown 0.15.2", "paste", "static_assertions", "windows 0.58.0", @@ -1080,6 +1080,20 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96a6ac251f4a2aca6b3f91340350eab87ae57c3f127ffeb585e92bd336717991" +[[package]] +name = "dashmap" +version = "6.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5041cc499144891f3790297212f32a74fb938e5136a14943f338ef9e0ae276cf" +dependencies = [ + "cfg-if", + "crossbeam-utils", + "hashbrown 0.14.5", + "lock_api", + "once_cell", + "parking_lot_core", +] + [[package]] name = "dasp_sample" version = "0.11.0" @@ -1793,7 +1807,7 @@ checksum = "dcf29e94d6d243368b7a56caa16bc213e4f9f8ed38c4d9557069527b5d5281ca" dependencies = [ "bitflags 2.8.0", "gpu-descriptor-types", - "hashbrown", + "hashbrown 0.15.2", ] [[package]] @@ -1824,6 +1838,12 @@ dependencies = [ "byteorder", ] +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" + [[package]] name = "hashbrown" version = "0.15.2" @@ -2115,7 +2135,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" dependencies = [ "equivalent", - "hashbrown", + "hashbrown 0.15.2", ] [[package]] @@ -2127,6 +2147,7 @@ dependencies = [ "chrono", "common", "cpal", + "dashmap", "eframe", "egui-toast", "egui_extras", diff --git a/interface/Cargo.toml b/interface/Cargo.toml index e03a77c..ad272d1 100644 --- a/interface/Cargo.toml +++ b/interface/Cargo.toml @@ -23,3 +23,4 @@ chrono = "0.4.40" image = "0.25.5" libloading = "0.8.6" emath = "0.31.1" +dashmap = "6.1.0" diff --git a/interface/src/lib.rs b/interface/src/lib.rs index 7cc9afe..f6f0ebb 100644 --- a/interface/src/lib.rs +++ b/interface/src/lib.rs @@ -7,6 +7,7 @@ pub mod gui; pub mod storage_dir; pub mod combatlog; pub mod auto; +pub mod storage; pub const POWER_THRESHOLD: AtomicF32 = AtomicF32::new(DEFAULT_VOLUME_THRESHOLD); diff --git a/interface/src/loader.rs b/interface/src/loader.rs new file mode 100644 index 0000000..e69de29 diff --git a/interface/src/storage.rs b/interface/src/storage.rs new file mode 100644 index 0000000..7392d3b --- /dev/null +++ b/interface/src/storage.rs @@ -0,0 +1,14 @@ +use std::{cell::RefCell, collections::HashMap, path::PathBuf, sync::Arc}; + +use dashmap::DashMap; + +struct StorageManager { + map: DashMap, + storage: Arc, +} + +impl StorageManager { + fn new(path: PathBuf) -> Self { + Self { map, storage } + } +} From d90011d921a87aeafd6e65f5f2aed467492a6ccf Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Sat, 22 Mar 2025 14:28:57 -0400 Subject: [PATCH 54/69] storage manager --- auto/Cargo.lock | 1 + interface/Cargo.lock | 1 + interface/Cargo.toml | 2 +- interface/src/auto.rs | 8 ++++---- interface/src/storage.rs | 38 +++++++++++++++++++++++++++++++++----- 5 files changed, 40 insertions(+), 10 deletions(-) diff --git a/auto/Cargo.lock b/auto/Cargo.lock index d77333e..b34493f 100644 --- a/auto/Cargo.lock +++ b/auto/Cargo.lock @@ -1100,6 +1100,7 @@ dependencies = [ "lock_api", "once_cell", "parking_lot_core", + "serde", ] [[package]] diff --git a/interface/Cargo.lock b/interface/Cargo.lock index 85d0c52..64a03b0 100644 --- a/interface/Cargo.lock +++ b/interface/Cargo.lock @@ -1092,6 +1092,7 @@ dependencies = [ "lock_api", "once_cell", "parking_lot_core", + "serde", ] [[package]] diff --git a/interface/Cargo.toml b/interface/Cargo.toml index ad272d1..aed473a 100644 --- a/interface/Cargo.toml +++ b/interface/Cargo.toml @@ -23,4 +23,4 @@ chrono = "0.4.40" image = "0.25.5" libloading = "0.8.6" emath = "0.31.1" -dashmap = "6.1.0" +dashmap = { version = "6.1.0", features = ["serde"] } diff --git a/interface/src/auto.rs b/interface/src/auto.rs index dd81603..283884b 100644 --- a/interface/src/auto.rs +++ b/interface/src/auto.rs @@ -6,6 +6,8 @@ use eframe::Storage; use libloading::{Library, Symbol}; use tokio::sync::{self, broadcast, mpsc, watch}; +use crate::storage::StorageManager; + pub struct AutoConfig { turn_gain: f32, auto_fire_distance: f32, @@ -15,7 +17,7 @@ pub struct AutoConfig { pub struct AutoInterface { command_sender: Option>, data_receiver: watch::Receiver, - config: &'static dyn Storage, + config: StorageManager, enabled: bool, } @@ -45,9 +47,7 @@ impl AutoInterface { } pub fn enabled(&self) -> bool { self.enabled} pub fn conf(&self, key: &'static Configurable) -> f32 { - self.config.get_string(&key.name) - .map(|s| s.parse().ok()) - .flatten().unwrap_or(key.default) + self.config.load(key) } fn send_message(&self, message: String) {unimplemented!()} } diff --git a/interface/src/storage.rs b/interface/src/storage.rs index 7392d3b..75fdc5d 100644 --- a/interface/src/storage.rs +++ b/interface/src/storage.rs @@ -1,14 +1,42 @@ -use std::{cell::RefCell, collections::HashMap, path::PathBuf, sync::Arc}; +use std::{cell::RefCell, collections::HashMap, fs::File, io::{Read, Write}, path::PathBuf, sync::Arc}; use dashmap::DashMap; -struct StorageManager { - map: DashMap, +use crate::auto::Configurable; + +#[derive(Clone)] +pub struct StorageManager { + map: Arc>, storage: Arc, } impl StorageManager { - fn new(path: PathBuf) -> Self { - Self { map, storage } + pub fn new(path: PathBuf) -> Result { + let map = if let Ok(mut file) = File::open(path) { + let mut vec = Vec::new(); + file.read_to_end(&mut vec)?; + postcard::from_bytes(&vec)? + } else { + DashMap::new() + }; + + let map = Arc::new(map); + + Ok(Self { map, storage: Arc::new(path) }) + } + + pub fn save(&self) { + let map = postcard::to_stdvec_cobs(&self.map).unwrap(); + + let mut backing_file = File::open(self.storage.as_path()).unwrap(); + backing_file.write_all(&map).unwrap(); + } + + pub fn load(&self, setting: &'static Configurable) -> f32 { + self.map.get(setting.name).map(|v| *v).unwrap_or(setting.default) + } + + pub fn store(&self, setting: &'static Configurable, value: f32) { + self.map.insert(setting.name.to_owned(), value); } } From 474841212d6f67bcff798ed7ee29b16837112a67 Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Sat, 22 Mar 2025 14:34:51 -0400 Subject: [PATCH 55/69] anyhow --- interface/src/storage.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/interface/src/storage.rs b/interface/src/storage.rs index 75fdc5d..9f35dd4 100644 --- a/interface/src/storage.rs +++ b/interface/src/storage.rs @@ -1,4 +1,5 @@ use std::{cell::RefCell, collections::HashMap, fs::File, io::{Read, Write}, path::PathBuf, sync::Arc}; +use anyhow::Result; use dashmap::DashMap; @@ -12,7 +13,7 @@ pub struct StorageManager { impl StorageManager { pub fn new(path: PathBuf) -> Result { - let map = if let Ok(mut file) = File::open(path) { + let map = if let Ok(mut file) = File::open(path.clone()) { let mut vec = Vec::new(); file.read_to_end(&mut vec)?; postcard::from_bytes(&vec)? @@ -28,7 +29,8 @@ impl StorageManager { pub fn save(&self) { let map = postcard::to_stdvec_cobs(&self.map).unwrap(); - let mut backing_file = File::open(self.storage.as_path()).unwrap(); + let mut backing_file = File::options().write(true).truncate(true).create(true) + .open(self.storage.as_path()).unwrap(); backing_file.write_all(&map).unwrap(); } From 321ece84bc730ed434d35512c415cfc15ad6df97 Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Sat, 22 Mar 2025 15:05:30 -0400 Subject: [PATCH 56/69] auto load struct --- interface/src/auto.rs | 39 +++++++++++++++++++++++++++++++++------ interface/src/main.rs | 15 ++++++++++++--- 2 files changed, 45 insertions(+), 9 deletions(-) diff --git a/interface/src/auto.rs b/interface/src/auto.rs index 283884b..2a954f3 100644 --- a/interface/src/auto.rs +++ b/interface/src/auto.rs @@ -93,13 +93,40 @@ impl Default for Configurable { } } -/// A fake trait in the sense that these methods are exposed as symbols, not trait methods -pub trait Auto { +pub struct Auto { + library: Arc, + // these aren't actually static, they have the same lifetime as the library xP + configs: &'static [Configurable], + name: &'static str, +} + +impl Auto { + pub fn new(path: &str) -> Result { + let lib = unsafe {Library::new(path)?}; + let lib = Arc::new(lib); + + let configurations: Symbol<&&[Configurable]> = unsafe {lib.get(b"CONFIGS").unwrap()}; + + let name: Symbol<&&'static str> = unsafe {lib.get(b"NAME").unwrap()}; + + + Ok(Self { + configs: *configurations, + name: *name, + library: lib, + }) + + } /// entrypoint - async fn run(interface: &AutoInterface); - /// register - fn default_configs() -> [Configurable]; - fn name() -> &'static str; + async fn run(&self, interface: &AutoInterface) { + } + + pub fn configs(&self) -> &'static [Configurable] { + self.configs + } + pub fn name(&self) -> &'static str { + self.name + } } diff --git a/interface/src/main.rs b/interface/src/main.rs index e99953f..4443fd1 100644 --- a/interface/src/main.rs +++ b/interface/src/main.rs @@ -2,7 +2,7 @@ use std::{fmt::format, ops::ControlFlow, result, sync::{atomic::Ordering, Arc}, use anyhow::{Context, Ok, Result}; use atomic_float::AtomicF32; -use interface::{auto::get_confs, combatlog::{combat_logger, CombatData}, POWER_THRESHOLD}; +use interface::{auto::{get_confs, Auto}, combatlog::{combat_logger, CombatData}, POWER_THRESHOLD}; use common::{ControlPacket, TelemetryPacket}; use cpal::traits::{DeviceTrait, HostTrait, StreamTrait}; use egui_toast::{Toast, ToastKind}; @@ -13,8 +13,17 @@ use tokio::{io::{AsyncReadExt, AsyncWriteExt, BufWriter, WriteHalf}, net::{tcp:: fn main() -> Result<()> { - get_confs().unwrap(); - panic!("got too far"); + let auto = Auto::new("../auto/target/release/libauto.so")?; + + println!("name: {}", auto.name()); + + for config in auto.configs().iter() { + println!("co {}", config.name); + println!("co {:?}", config.description); + } + + + let (logging_sender, combatlog) = mpsc::channel(64); From b63986711d4d96fe815d675c8eaeeabb0b948e17 Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Sat, 22 Mar 2025 15:27:49 -0400 Subject: [PATCH 57/69] run (untested) --- interface/src/auto.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/interface/src/auto.rs b/interface/src/auto.rs index 2a954f3..7aa55f8 100644 --- a/interface/src/auto.rs +++ b/interface/src/auto.rs @@ -1,10 +1,10 @@ -use std::{collections::VecDeque, ops::{Deref, Div, Index, Range, Sub}, sync::Arc}; +use std::{collections::VecDeque, future::Future, ops::{Deref, Div, Index, Range, Sub}, pin::Pin, sync::Arc}; use common::{CamState, ControlPacket, SensorData, TelemetryPacket}; use anyhow::{Context, Ok, Result}; use eframe::Storage; use libloading::{Library, Symbol}; -use tokio::sync::{self, broadcast, mpsc, watch}; +use tokio::{sync::{self, broadcast, mpsc, watch}, task::JoinHandle}; use crate::storage::StorageManager; @@ -118,7 +118,12 @@ impl Auto { } /// entrypoint - async fn run(&self, interface: &AutoInterface) { + pub async fn run(&self, interface: &AutoInterface) -> Result> { + let func: Symbol Pin + Send>>> = unsafe {self.library.get(b"entry")?}; + + let fut = unsafe { func(interface.clone()) }; + + Ok(tokio::spawn(fut)) } pub fn configs(&self) -> &'static [Configurable] { From 9f4b2e57a2e8d2a1298f7e272819251069216573 Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Wed, 26 Mar 2025 22:29:09 -0400 Subject: [PATCH 58/69] slight auto interface api changes I'm not liking the ControlPacket architecture anymore, I'd like to switch to a state-based controller from message-based to accommodate reliably getting side changes to work --- interface/Cargo.lock | 85 ++++++++++++++++++++++++++++++++++++------- interface/Cargo.toml | 1 + interface/src/auto.rs | 52 ++++++++++++++++---------- interface/src/main.rs | 9 +++-- 4 files changed, 110 insertions(+), 37 deletions(-) diff --git a/interface/Cargo.lock b/interface/Cargo.lock index 64a03b0..d4ba41f 100644 --- a/interface/Cargo.lock +++ b/interface/Cargo.lock @@ -38,7 +38,7 @@ dependencies = [ "accesskit_consumer", "atspi-common", "serde", - "thiserror", + "thiserror 1.0.69", "zvariant", ] @@ -198,7 +198,7 @@ dependencies = [ "ndk-context", "ndk-sys 0.6.0+11769913", "num_enum", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -739,7 +739,7 @@ dependencies = [ "polling", "rustix", "slab", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -1111,6 +1111,27 @@ dependencies = [ "crypto-common", ] +[[package]] +name = "directories" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16f5094c54661b38d03bd7e50df373292118db60b585c08a411c6d840017fe7d" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e01a3366d27ee9890022452ee61b2b63a67e6f13f58900b651ff5665f0bb1fab" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys 0.59.0", +] + [[package]] name = "dispatch" version = "0.2.0" @@ -1247,7 +1268,7 @@ dependencies = [ "epaint", "log", "profiling", - "thiserror", + "thiserror 1.0.69", "type-map", "web-time", "wgpu", @@ -2149,6 +2170,7 @@ dependencies = [ "common", "cpal", "dashmap", + "directories", "eframe", "egui-toast", "egui_extras", @@ -2204,7 +2226,7 @@ dependencies = [ "combine", "jni-sys", "log", - "thiserror", + "thiserror 1.0.69", "walkdir", "windows-sys 0.45.0", ] @@ -2476,7 +2498,7 @@ dependencies = [ "rustc-hash", "spirv", "termcolor", - "thiserror", + "thiserror 1.0.69", "unicode-xid", ] @@ -2506,7 +2528,7 @@ dependencies = [ "log", "ndk-sys 0.5.0+25.2.9519653", "num_enum", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -2521,7 +2543,7 @@ dependencies = [ "ndk-sys 0.6.0+11769913", "num_enum", "raw-window-handle", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -2920,6 +2942,12 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" +[[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.48" @@ -3246,7 +3274,7 @@ dependencies = [ "rand_chacha", "simd_helpers", "system-deps", - "thiserror", + "thiserror 1.0.69", "v_frame", "wasm-bindgen", ] @@ -3310,6 +3338,17 @@ dependencies = [ "bitflags 2.8.0", ] +[[package]] +name = "redox_users" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd6f9d3d47bdd2ad6945c5015a226ec6155d0bcdfd8f7cd29f86b71f8de99d2b" +dependencies = [ + "getrandom 0.2.15", + "libredox", + "thiserror 2.0.12", +] + [[package]] name = "regex" version = "1.11.1" @@ -3601,7 +3640,7 @@ dependencies = [ "log", "memmap2", "rustix", - "thiserror", + "thiserror 1.0.69", "wayland-backend", "wayland-client", "wayland-csd-frame", @@ -3798,7 +3837,16 @@ version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ - "thiserror-impl", + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" +dependencies = [ + "thiserror-impl 2.0.12", ] [[package]] @@ -3812,6 +3860,17 @@ dependencies = [ "syn 2.0.96", ] +[[package]] +name = "thiserror-impl" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", +] + [[package]] name = "tiff" version = "0.9.1" @@ -4369,7 +4428,7 @@ dependencies = [ "raw-window-handle", "rustc-hash", "smallvec", - "thiserror", + "thiserror 1.0.69", "wgpu-hal", "wgpu-types", ] @@ -4407,7 +4466,7 @@ dependencies = [ "renderdoc-sys", "rustc-hash", "smallvec", - "thiserror", + "thiserror 1.0.69", "wasm-bindgen", "web-sys", "wgpu-types", diff --git a/interface/Cargo.toml b/interface/Cargo.toml index aed473a..938e360 100644 --- a/interface/Cargo.toml +++ b/interface/Cargo.toml @@ -24,3 +24,4 @@ image = "0.25.5" libloading = "0.8.6" emath = "0.31.1" dashmap = { version = "6.1.0", features = ["serde"] } +directories = "6.0.0" diff --git a/interface/src/auto.rs b/interface/src/auto.rs index 7aa55f8..2ffdc5d 100644 --- a/interface/src/auto.rs +++ b/interface/src/auto.rs @@ -1,30 +1,38 @@ -use std::{collections::VecDeque, future::Future, ops::{Deref, Div, Index, Range, Sub}, pin::Pin, sync::Arc}; +use std::{future::Future, ops::{Deref, Range}, pin::Pin, sync::{atomic::{AtomicBool, Ordering}, Arc}}; use common::{CamState, ControlPacket, SensorData, TelemetryPacket}; -use anyhow::{Context, Ok, Result}; -use eframe::Storage; +use anyhow::{anyhow, Ok, Result}; use libloading::{Library, Symbol}; -use tokio::{sync::{self, broadcast, mpsc, watch}, task::JoinHandle}; +use tokio::{sync::watch, task::JoinHandle}; use crate::storage::StorageManager; -pub struct AutoConfig { - turn_gain: f32, - auto_fire_distance: f32, -} - #[derive(Clone)] pub struct AutoInterface { - command_sender: Option>, + command_sender: watch::Sender, data_receiver: watch::Receiver, config: StorageManager, - enabled: bool, + enabled: Arc, + enable_permission: Arc, } impl AutoInterface { + pub(crate) fn new(data: watch::Receiver, config: StorageManager, enable_permission: Arc) -> (Self, watch::Receiver) { + let (commands, receiver) = watch::channel(ControlPacket::Fire); + + let interface = Self { + command_sender: commands, + data_receiver: data, + config, + enabled: Arc::new(AtomicBool::new(false)), + enable_permission, + }; + + (interface, receiver) + } /// change active command, fails if not in control - pub async fn run_command(&self, command: ControlPacket) -> Result<()> { - self.command_sender.as_ref().context("no sender")?.send(command).await?; + pub fn run_command(&self, command: ControlPacket) -> Result<()> { + self.command_sender.send(command)?; Ok(()) } pub fn sensor_data(&mut self) -> SensorData { @@ -39,17 +47,22 @@ impl AutoInterface { } /// disable auto - pub fn disable(&self) {unimplemented!()} + pub fn disable(&mut self) { + self.enabled.store(false, Ordering::Release); + } /// request auto enable, fails if the driver does not grant it pub fn enable(&mut self) -> Result<()> { - self.enabled = self.command_sender.is_some(); - Ok(()) + if self.enable_permission.load(Ordering::Acquire) { + self.enabled.store(true, Ordering::Release); + Ok(()) + } else { + Err(anyhow!("no enable"))? + } } - pub fn enabled(&self) -> bool { self.enabled} + pub fn enabled(&self) -> bool { self.enabled.load(Ordering::Acquire) } pub fn conf(&self, key: &'static Configurable) -> f32 { self.config.load(key) } - fn send_message(&self, message: String) {unimplemented!()} } pub struct Configurable { @@ -118,7 +131,7 @@ impl Auto { } /// entrypoint - pub async fn run(&self, interface: &AutoInterface) -> Result> { + pub async fn run(&self, interface: AutoInterface) -> Result> { let func: Symbol Pin + Send>>> = unsafe {self.library.get(b"entry")?}; let fut = unsafe { func(interface.clone()) }; @@ -150,4 +163,3 @@ pub fn get_confs() -> Result<()> { Ok(()) } - diff --git a/interface/src/main.rs b/interface/src/main.rs index 4443fd1..66e7c96 100644 --- a/interface/src/main.rs +++ b/interface/src/main.rs @@ -2,7 +2,8 @@ use std::{fmt::format, ops::ControlFlow, result, sync::{atomic::Ordering, Arc}, use anyhow::{Context, Ok, Result}; use atomic_float::AtomicF32; -use interface::{auto::{get_confs, Auto}, combatlog::{combat_logger, CombatData}, POWER_THRESHOLD}; +use directories::ProjectDirs; +use interface::{auto::{get_confs, Auto}, combatlog::{combat_logger, CombatData}, storage::StorageManager, POWER_THRESHOLD}; use common::{ControlPacket, TelemetryPacket}; use cpal::traits::{DeviceTrait, HostTrait, StreamTrait}; use egui_toast::{Toast, ToastKind}; @@ -13,8 +14,11 @@ use tokio::{io::{AsyncReadExt, AsyncWriteExt, BufWriter, WriteHalf}, net::{tcp:: fn main() -> Result<()> { + let directories = ProjectDirs::from("dev", "ank", "Cruise Control").context("no home")?; let auto = Auto::new("../auto/target/release/libauto.so")?; + let storage = StorageManager::new(directories.config_dir().with_file_name("conf.dat"))?; + println!("name: {}", auto.name()); for config in auto.configs().iter() { @@ -22,9 +26,6 @@ fn main() -> Result<()> { println!("co {:?}", config.description); } - - - let (logging_sender, combatlog) = mpsc::channel(64); // assumes pulseaudio system with f32 samples and 2204 sample packets From c0daf3f64c1a12e86298685756b34ffdff06a90b Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Thu, 27 Mar 2025 18:35:31 -0400 Subject: [PATCH 59/69] use storage manager in gui --- auto/Cargo.lock | 85 ++++++++++++++++++++++++++++++++++------ interface/src/gui.rs | 64 +++++++++--------------------- interface/src/main.rs | 5 ++- interface/src/storage.rs | 12 ++++++ 4 files changed, 106 insertions(+), 60 deletions(-) diff --git a/auto/Cargo.lock b/auto/Cargo.lock index b34493f..60128b4 100644 --- a/auto/Cargo.lock +++ b/auto/Cargo.lock @@ -38,7 +38,7 @@ dependencies = [ "accesskit_consumer", "atspi-common", "serde", - "thiserror", + "thiserror 1.0.69", "zvariant", ] @@ -198,7 +198,7 @@ dependencies = [ "ndk-context", "ndk-sys 0.6.0+11769913", "num_enum", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -747,7 +747,7 @@ dependencies = [ "polling", "rustix 0.38.44", "slab", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -1119,6 +1119,27 @@ dependencies = [ "crypto-common", ] +[[package]] +name = "directories" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16f5094c54661b38d03bd7e50df373292118db60b585c08a411c6d840017fe7d" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e01a3366d27ee9890022452ee61b2b63a67e6f13f58900b651ff5665f0bb1fab" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys 0.59.0", +] + [[package]] name = "dispatch" version = "0.2.0" @@ -1255,7 +1276,7 @@ dependencies = [ "epaint", "log", "profiling", - "thiserror", + "thiserror 1.0.69", "type-map", "web-time", "wgpu", @@ -2157,6 +2178,7 @@ dependencies = [ "common", "cpal", "dashmap", + "directories", "eframe", "egui-toast", "egui_extras", @@ -2212,7 +2234,7 @@ dependencies = [ "combine", "jni-sys", "log", - "thiserror", + "thiserror 1.0.69", "walkdir", "windows-sys 0.45.0", ] @@ -2490,7 +2512,7 @@ dependencies = [ "rustc-hash", "spirv", "termcolor", - "thiserror", + "thiserror 1.0.69", "unicode-xid", ] @@ -2520,7 +2542,7 @@ dependencies = [ "log", "ndk-sys 0.5.0+25.2.9519653", "num_enum", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -2535,7 +2557,7 @@ dependencies = [ "ndk-sys 0.6.0+11769913", "num_enum", "raw-window-handle", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -2934,6 +2956,12 @@ version = "1.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "945462a4b81e43c4e3ba96bd7b49d834c6f61198356aa858733bc4acf3cbe62e" +[[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.48" @@ -3260,7 +3288,7 @@ dependencies = [ "rand_chacha", "simd_helpers", "system-deps", - "thiserror", + "thiserror 1.0.69", "v_frame", "wasm-bindgen", ] @@ -3324,6 +3352,17 @@ dependencies = [ "bitflags 2.9.0", ] +[[package]] +name = "redox_users" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd6f9d3d47bdd2ad6945c5015a226ec6155d0bcdfd8f7cd29f86b71f8de99d2b" +dependencies = [ + "getrandom 0.2.15", + "libredox", + "thiserror 2.0.12", +] + [[package]] name = "regex" version = "1.11.1" @@ -3628,7 +3667,7 @@ dependencies = [ "log", "memmap2", "rustix 0.38.44", - "thiserror", + "thiserror 1.0.69", "wayland-backend", "wayland-client", "wayland-csd-frame", @@ -3825,7 +3864,16 @@ version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ - "thiserror-impl", + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" +dependencies = [ + "thiserror-impl 2.0.12", ] [[package]] @@ -3839,6 +3887,17 @@ dependencies = [ "syn 2.0.99", ] +[[package]] +name = "thiserror-impl" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.99", +] + [[package]] name = "tiff" version = "0.9.1" @@ -4396,7 +4455,7 @@ dependencies = [ "raw-window-handle", "rustc-hash", "smallvec", - "thiserror", + "thiserror 1.0.69", "wgpu-hal", "wgpu-types", ] @@ -4434,7 +4493,7 @@ dependencies = [ "renderdoc-sys", "rustc-hash", "smallvec", - "thiserror", + "thiserror 1.0.69", "wasm-bindgen", "web-sys", "wgpu-types", diff --git a/interface/src/gui.rs b/interface/src/gui.rs index 3b09761..38baf4f 100644 --- a/interface/src/gui.rs +++ b/interface/src/gui.rs @@ -3,14 +3,14 @@ use std::{cell::OnceCell, collections::HashMap, path::PathBuf, sync::{atomic::Or use common::{ControlPacket, TelemetryPacket}; use eframe::{egui::{self, containers, Align2, Checkbox, Context, IconData, Id, ImageSource, Label, Ui}, Storage}; use image::ImageFormat; -use tokio::{runtime::Runtime, sync::{mpsc, watch::Receiver}}; +use tokio::{runtime::Runtime, sync::{mpsc, watch::{self, Receiver}}}; use egui_toast::{Toast, Toasts}; -use crate::{auto::Configurable, storage_dir::storage_dir, POWER_THRESHOLD}; +use crate::{auto::Configurable, storage::StorageManager, storage_dir::storage_dir, POWER_THRESHOLD}; pub const GUI: OnceCell = OnceCell::new(); -pub fn gui(data: Receiver, toasts: mpsc::Receiver, executor: Runtime) -> eframe::Result { +pub fn gui(data: Receiver, toasts: mpsc::Receiver, executor: Runtime, autoconf: watch::Receiver<&'static [Configurable]>, storage: StorageManager) -> eframe::Result { let icon = egui::include_image!("../assets/lizard.png"); let icon = image::load_from_memory_with_format(include_bytes!("../assets/lizard.png"), ImageFormat::Png).unwrap(); @@ -35,7 +35,7 @@ pub fn gui(data: Receiver, toasts: mpsc::Receiver, executor: Run // This gives us image support: egui_extras::install_image_loaders(&cc.egui_ctx); - Ok(Box::new(GUI::with_receivers(data, toasts, executor, cc.storage.unwrap()))) + Ok(Box::new(GUI::with_receivers(data, toasts, executor, storage, autoconf))) }), ) } @@ -46,10 +46,13 @@ pub struct GUIData { pub last_command: Option, } + #[cfg(target_os = "linux")] pub const DEFAULT_VOLUME_THRESHOLD: f32 = 5.0; #[cfg(target_os = "windows")] pub const DEFAULT_VOLUME_THRESHOLD: f32 = 1.0; +const VOLUME_THRESHOLD: Configurable = Configurable::new("Volume").range(0.0..10.).default(DEFAULT_VOLUME_THRESHOLD) + .description("higher accepts less noise (better)"); const DEFAULT_TURN_GAIN: f32 = 0.3; const DEFAULT_FIRE_DISTANCE: f32 = 55.0; @@ -57,32 +60,20 @@ struct GUI { data: Receiver, toasts: mpsc::Receiver, executor: Option, - volume_threshold: f32, - auto_turn_gain: f32, - /// mm - auto_fire_distance: f32, selected_auto: usize, + autoconf: watch::Receiver<&'static [Configurable]>, + storage: StorageManager, } impl GUI { - fn with_receivers(data: Receiver, toasts: mpsc::Receiver, executor: Runtime, storage: &dyn Storage) -> Self { - let volume_threshold: f32 = storage.get_string("volume_threshold").map(|s| s.parse().ok()).flatten().unwrap_or(DEFAULT_VOLUME_THRESHOLD); - - let auto_turn_gain: f32 = storage.get_string("auto_turn_gain").map(|s| s.parse().ok()).flatten().unwrap_or(DEFAULT_TURN_GAIN); - - let auto_fire_distance: f32 = storage.get_string("auto_fire_distance").map(|s| s.parse().ok()).flatten().unwrap_or(DEFAULT_FIRE_DISTANCE); - - let selected_auto: usize = storage.get_string("selected_auto").map(|s| s.parse().ok()).flatten().unwrap_or(0); - - + fn with_receivers(data: Receiver, toasts: mpsc::Receiver, executor: Runtime, storage: StorageManager, autoconf: watch::Receiver<&'static [Configurable]>) -> Self { Self { data, toasts, executor: Some(executor), - volume_threshold, - auto_turn_gain, - auto_fire_distance, - selected_auto, + selected_auto: 0, + autoconf, + storage, } } } @@ -103,26 +94,18 @@ impl eframe::App for GUI { let _ = GUI.set(ctx.clone()); egui::SidePanel::right(Id::new("config")).resizable(false).show(ctx, |ui| { ui.heading("configuration"); - ui.add(egui::Slider::new(&mut self.volume_threshold, 0.0..=10.0).text("volume threshold")); - ui.label("higher accepts less noise (better)"); - ui.add(egui::Slider::new(&mut self.auto_turn_gain, 0.0..=1.0).text("auto turn kP")); - ui.add(egui::Slider::new(&mut self.auto_fire_distance, 30.0..=100.0).text("auto fire distance (mm)")); + + configurator(ui, &VOLUME_THRESHOLD, &self.storage); ui.horizontal(|ui| { egui::ComboBox::new("auto selector", "select auto") .show_index(ui, &mut self.selected_auto, 3, |n| ["a","b","c"][n]); ui.button("refresh").clicked(); }); - let storage = _frame.storage_mut().unwrap(); - storage.set_string("volume_threshold", format!("{}",self.volume_threshold)); - storage.set_string("auto_turn_gain", format!("{}",self.auto_turn_gain)); - storage.set_string("auto_fire_distance", format!("{}",self.auto_fire_distance)); - storage.set_string("selected_auto", format!("{}",self.selected_auto)); - - POWER_THRESHOLD.store(self.volume_threshold, Ordering::Relaxed); + POWER_THRESHOLD.store(self.storage.load(&VOLUME_THRESHOLD), Ordering::Relaxed); for conf in CONFIGS { - configurator(ui, conf, storage); + configurator(ui, conf, &self.storage); } }); @@ -159,17 +142,8 @@ impl eframe::App for GUI { } } -fn configurator(ui: &mut Ui, config: &Configurable, map: &mut dyn Storage) { - ui.add(egui::Slider::from_get_set(config.min as f64 ..= config.max as f64, |value| { - match value { - Some(value) => { - map.set_string(&config.name,format!("{value}")); - value - }, - None => map.get_string(&config.name).map(|s| s.parse().ok()).flatten().unwrap_or(config.default as f64), - } - - }).text(config.name)); +fn configurator(ui: &mut Ui, config: &'static Configurable, map: &StorageManager) { + ui.add(egui::Slider::from_get_set(config.min as f64 ..= config.max as f64, map.get_set(config)).text(config.name)); if let Some(description) = config.description { ui.label(description); } diff --git a/interface/src/main.rs b/interface/src/main.rs index 66e7c96..470ca9f 100644 --- a/interface/src/main.rs +++ b/interface/src/main.rs @@ -3,7 +3,7 @@ use std::{fmt::format, ops::ControlFlow, result, sync::{atomic::Ordering, Arc}, use anyhow::{Context, Ok, Result}; use atomic_float::AtomicF32; use directories::ProjectDirs; -use interface::{auto::{get_confs, Auto}, combatlog::{combat_logger, CombatData}, storage::StorageManager, POWER_THRESHOLD}; +use interface::{auto::{get_confs, Auto}, combatlog::{combat_logger, CombatData}, gui::CONFIGS, storage::StorageManager, POWER_THRESHOLD}; use common::{ControlPacket, TelemetryPacket}; use cpal::traits::{DeviceTrait, HostTrait, StreamTrait}; use egui_toast::{Toast, ToastKind}; @@ -115,7 +115,8 @@ fn main() -> Result<()> { }); println!("launching gui"); - gui(gui_data, toasts, executor).unwrap(); + let (_conf_sender, conf) = watch::channel(CONFIGS); + gui(gui_data, toasts, executor, conf, storage).unwrap(); drop(stream); diff --git a/interface/src/storage.rs b/interface/src/storage.rs index 9f35dd4..0ed09e4 100644 --- a/interface/src/storage.rs +++ b/interface/src/storage.rs @@ -41,4 +41,16 @@ impl StorageManager { pub fn store(&self, setting: &'static Configurable, value: f32) { self.map.insert(setting.name.to_owned(), value); } + + pub fn get_set(&self, setting: &'static Configurable) -> impl 'static + FnMut(Option) -> f64 { + let self_ = self.clone(); + let setting_ = setting; + move |new| { + if let Some(new) = new { + self_.store(setting_, new as f32); + } + self_.load(setting_) as f64 + } + } + } From a2b629beab46754836b27c26033ef342fa1aff0c Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Thu, 27 Mar 2025 18:54:39 -0400 Subject: [PATCH 60/69] loadstore --- interface/src/main.rs | 8 +++++--- interface/src/storage.rs | 3 ++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/interface/src/main.rs b/interface/src/main.rs index 470ca9f..dc438ea 100644 --- a/interface/src/main.rs +++ b/interface/src/main.rs @@ -1,4 +1,4 @@ -use std::{fmt::format, ops::ControlFlow, result, sync::{atomic::Ordering, Arc}, thread::{self, sleep}, time::Duration}; +use std::{fmt::format, ops::ControlFlow, path::Path, result, sync::{atomic::Ordering, Arc}, thread::{self, sleep}, time::Duration}; use anyhow::{Context, Ok, Result}; use atomic_float::AtomicF32; @@ -17,7 +17,7 @@ fn main() -> Result<()> { let directories = ProjectDirs::from("dev", "ank", "Cruise Control").context("no home")?; let auto = Auto::new("../auto/target/release/libauto.so")?; - let storage = StorageManager::new(directories.config_dir().with_file_name("conf.dat"))?; + let storage = StorageManager::new(dbg!(directories.config_dir().to_path_buf().join(Path::new("conf.dat"))))?; println!("name: {}", auto.name()); @@ -116,10 +116,12 @@ fn main() -> Result<()> { println!("launching gui"); let (_conf_sender, conf) = watch::channel(CONFIGS); - gui(gui_data, toasts, executor, conf, storage).unwrap(); + gui(gui_data, toasts, executor, conf, storage.clone()).unwrap(); drop(stream); + storage.save(); + Ok(()) } diff --git a/interface/src/storage.rs b/interface/src/storage.rs index 0ed09e4..0fc4a1e 100644 --- a/interface/src/storage.rs +++ b/interface/src/storage.rs @@ -16,7 +16,7 @@ impl StorageManager { let map = if let Ok(mut file) = File::open(path.clone()) { let mut vec = Vec::new(); file.read_to_end(&mut vec)?; - postcard::from_bytes(&vec)? + postcard::from_bytes_cobs(&mut vec)? } else { DashMap::new() }; @@ -29,6 +29,7 @@ impl StorageManager { pub fn save(&self) { let map = postcard::to_stdvec_cobs(&self.map).unwrap(); + // TODO: mkdir let mut backing_file = File::options().write(true).truncate(true).create(true) .open(self.storage.as_path()).unwrap(); backing_file.write_all(&map).unwrap(); From b956c543fc3ccf020f27a29f47dbc00330aec61c Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Thu, 27 Mar 2025 18:59:47 -0400 Subject: [PATCH 61/69] remove storage_dir --- interface/src/combatlog.rs | 8 +- interface/src/gui.rs | 2 +- interface/src/lib.rs | 1 - interface/src/main.rs | 4 +- interface/src/storage_dir.rs | 157 ----------------------------------- 5 files changed, 6 insertions(+), 166 deletions(-) delete mode 100644 interface/src/storage_dir.rs diff --git a/interface/src/combatlog.rs b/interface/src/combatlog.rs index 21371c9..3cd490d 100644 --- a/interface/src/combatlog.rs +++ b/interface/src/combatlog.rs @@ -1,12 +1,10 @@ -use std::time::{Duration, SystemTime, UNIX_EPOCH}; +use std::{path::Path, time::{Duration, SystemTime, UNIX_EPOCH}}; use anyhow::Ok; use common::{ControlPacket, TelemetryPacket}; use serde::{Deserialize, Serialize}; use tokio::{fs::File, io::AsyncWriteExt, sync::mpsc::Receiver, time::Instant}; -use crate::storage_dir::storage; - #[derive(Serialize, Deserialize)] pub enum CombatData { @@ -16,8 +14,8 @@ pub enum CombatData { type CombatLogRow = (CombatData, u128); -pub async fn combat_logger(mut data: Receiver) -> anyhow::Result<()> { - let mut path = storage(); +pub async fn combat_logger(mut data: Receiver, path: &Path) -> anyhow::Result<()> { + let mut path = path.to_path_buf(); let time = chrono::offset::Utc::now(); let formatted = time.to_rfc3339_opts(chrono::SecondsFormat::Secs, false); path.push(format!("{formatted}.combatlog")); diff --git a/interface/src/gui.rs b/interface/src/gui.rs index 38baf4f..5d19bb7 100644 --- a/interface/src/gui.rs +++ b/interface/src/gui.rs @@ -6,7 +6,7 @@ use image::ImageFormat; use tokio::{runtime::Runtime, sync::{mpsc, watch::{self, Receiver}}}; use egui_toast::{Toast, Toasts}; -use crate::{auto::Configurable, storage::StorageManager, storage_dir::storage_dir, POWER_THRESHOLD}; +use crate::{auto::Configurable, storage::StorageManager, POWER_THRESHOLD}; pub const GUI: OnceCell = OnceCell::new(); diff --git a/interface/src/lib.rs b/interface/src/lib.rs index f6f0ebb..8f92088 100644 --- a/interface/src/lib.rs +++ b/interface/src/lib.rs @@ -4,7 +4,6 @@ use atomic_float::AtomicF32; use gui::DEFAULT_VOLUME_THRESHOLD; pub mod gui; -pub mod storage_dir; pub mod combatlog; pub mod auto; pub mod storage; diff --git a/interface/src/main.rs b/interface/src/main.rs index dc438ea..1a94b94 100644 --- a/interface/src/main.rs +++ b/interface/src/main.rs @@ -17,7 +17,7 @@ fn main() -> Result<()> { let directories = ProjectDirs::from("dev", "ank", "Cruise Control").context("no home")?; let auto = Auto::new("../auto/target/release/libauto.so")?; - let storage = StorageManager::new(dbg!(directories.config_dir().to_path_buf().join(Path::new("conf.dat"))))?; + let storage = StorageManager::new(directories.config_dir().to_path_buf().join(Path::new("conf.dat")))?; println!("name: {}", auto.name()); @@ -98,7 +98,7 @@ fn main() -> Result<()> { spawner.block_on(async { let log_toasts = toast_sender.clone(); tokio::spawn(async move { - if let Err(e) = combat_logger(combatlog).await { + if let Err(e) = combat_logger(combatlog, directories.data_dir()).await { let _ = log_toasts.clone().send(Toast::new().text(format!("logger crashed: {e:?}")).kind(ToastKind::Error)).await; } }); diff --git a/interface/src/storage_dir.rs b/interface/src/storage_dir.rs deleted file mode 100644 index d5e3649..0000000 --- a/interface/src/storage_dir.rs +++ /dev/null @@ -1,157 +0,0 @@ -// copied from eframe (private item) -// https://docs.rs/eframe/latest/src/eframe/native/file_storage.rs.html#17 - -use std::path::PathBuf; - -use eframe::egui; - -pub fn storage() -> PathBuf { - storage_dir("cruisecontrol").unwrap() -} - -pub fn storage_dir(app_id: &str) -> Option { - - use egui::os::OperatingSystem as OS; - - use std::env::var_os; - - match OS::from_target_os() { - - OS::Nix => var_os("XDG_DATA_HOME") - - .map(PathBuf::from) - - .filter(|p| p.is_absolute()) - - .or_else(|| home::home_dir().map(|p| p.join(".local").join("share"))) - - .map(|p| { - - p.join( - - app_id - - .to_lowercase() - - .replace(|c: char| c.is_ascii_whitespace(), ""), - - ) - - }), - - OS::Mac => home::home_dir().map(|p| { - - p.join("Library") - - .join("Application Support") - - .join(app_id.replace(|c: char| c.is_ascii_whitespace(), "-")) - - }), - - OS::Windows => roaming_appdata().map(|p| p.join(app_id).join("data")), - - OS::Unknown | OS::Android | OS::IOS => None, - - } - -} - -// Adapted from - -// https://github.com/rust-lang/cargo/blob/6e11c77384989726bb4f412a0e23b59c27222c34/crates/home/src/windows.rs#L19-L37 - -#[cfg(all(windows, not(target_vendor = "uwp")))] - -#[allow(unsafe_code)] - -fn roaming_appdata() -> Option { - - use std::ffi::OsString; - - use std::os::windows::ffi::OsStringExt; - - use std::ptr; - - use std::slice; - - - use windows_sys::Win32::Foundation::S_OK; - - use windows_sys::Win32::System::Com::CoTaskMemFree; - - use windows_sys::Win32::UI::Shell::{ - - FOLDERID_RoamingAppData, SHGetKnownFolderPath, KF_FLAG_DONT_VERIFY, - - }; - - - extern "C" { - - fn wcslen(buf: *const u16) -> usize; - - } - - let mut path_raw = ptr::null_mut(); - - - // SAFETY: SHGetKnownFolderPath allocates for us, we don't pass any pointers to it. - - // See https://learn.microsoft.com/en-us/windows/win32/api/shlobj_core/nf-shlobj_core-shgetknownfolderpath - - let result = unsafe { - - SHGetKnownFolderPath( - - &FOLDERID_RoamingAppData, - - KF_FLAG_DONT_VERIFY as u32, - - std::ptr::null_mut(), - - &mut path_raw, - - ) - - }; - - - let path = if result == S_OK { - - // SAFETY: SHGetKnownFolderPath indicated success and is supposed to allocate a nullterminated string for us. - - let path_slice = unsafe { slice::from_raw_parts(path_raw, wcslen(path_raw)) }; - - Some(PathBuf::from(OsString::from_wide(path_slice))) - - } else { - - None - - }; - - - // SAFETY: - - // This memory got allocated by SHGetKnownFolderPath, we didn't touch anything in the process. - - // A null ptr is a no-op for `CoTaskMemFree`, so in case this failed we're still good. - - // https://learn.microsoft.com/en-us/windows/win32/api/combaseapi/nf-combaseapi-cotaskmemfree - - unsafe { CoTaskMemFree(path_raw.cast()) }; - - - path - -} - - -#[cfg(any(not(windows), target_vendor = "uwp"))] - -fn roaming_appdata() -> Option { - - None - -} From 311427b0a5476b9636218b5bbe78768396e81fe7 Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Thu, 27 Mar 2025 19:25:39 -0400 Subject: [PATCH 62/69] plumb auto interface into controller --- common/src/lib.rs | 8 +++++++- controller/src/main.rs | 2 +- interface/src/auto.rs | 7 ++++++- interface/src/main.rs | 27 +++++++++++++++++---------- 4 files changed, 31 insertions(+), 13 deletions(-) diff --git a/common/src/lib.rs b/common/src/lib.rs index 16ce42f..14d2d3b 100644 --- a/common/src/lib.rs +++ b/common/src/lib.rs @@ -25,7 +25,7 @@ pub enum ControlPacket { EStop, } -#[derive(Clone, Debug, Serialize, Deserialize)] +#[derive(Clone, Debug, Serialize, Deserialize, Default)] pub struct SensorData { /// left distance, mm pub tof_l: Option, @@ -45,6 +45,12 @@ pub struct TelemetryPacket { pub cam_state: CamState, } +impl Default for TelemetryPacket { + fn default() -> Self { + Self { sensors: Default::default(), cam_state: CamState::Idle } + } +} + #[derive(Serialize, Deserialize, Debug, Clone)] pub enum CamState { Firing, diff --git a/controller/src/main.rs b/controller/src/main.rs index 539c4e9..d3aae41 100644 --- a/controller/src/main.rs +++ b/controller/src/main.rs @@ -89,7 +89,7 @@ async fn main(spawner: Spawner) { spawner.spawn(logger_task(driver)).unwrap(); let limit_switch = Input::new(p.PIN_16, Pull::Up); - let mut auto_status = Output::new(p.PIN_2, Level::Low); + let mut auto_status = Output::new(p.PIN_2, Level::High); let mut d: pwm::Config = Default::default(); d.divider = 40.into(); diff --git a/interface/src/auto.rs b/interface/src/auto.rs index 2ffdc5d..0d6d9e5 100644 --- a/interface/src/auto.rs +++ b/interface/src/auto.rs @@ -17,7 +17,7 @@ pub struct AutoInterface { } impl AutoInterface { - pub(crate) fn new(data: watch::Receiver, config: StorageManager, enable_permission: Arc) -> (Self, watch::Receiver) { + pub fn new(data: watch::Receiver, config: StorageManager, enable_permission: Arc) -> (Self, watch::Receiver) { let (commands, receiver) = watch::channel(ControlPacket::Fire); let interface = Self { @@ -30,6 +30,11 @@ impl AutoInterface { (interface, receiver) } + + pub fn subscribe(&self) -> watch::Receiver { + self.command_sender.subscribe() + } + /// change active command, fails if not in control pub fn run_command(&self, command: ControlPacket) -> Result<()> { self.command_sender.send(command)?; diff --git a/interface/src/main.rs b/interface/src/main.rs index 1a94b94..bf78209 100644 --- a/interface/src/main.rs +++ b/interface/src/main.rs @@ -1,9 +1,9 @@ -use std::{fmt::format, ops::ControlFlow, path::Path, result, sync::{atomic::Ordering, Arc}, thread::{self, sleep}, time::Duration}; +use std::{fmt::format, ops::ControlFlow, path::Path, result, sync::{atomic::{AtomicBool, Ordering}, Arc}, thread::{self, sleep}, time::Duration}; use anyhow::{Context, Ok, Result}; use atomic_float::AtomicF32; use directories::ProjectDirs; -use interface::{auto::{get_confs, Auto}, combatlog::{combat_logger, CombatData}, gui::CONFIGS, storage::StorageManager, POWER_THRESHOLD}; +use interface::{auto::{get_confs, Auto, AutoInterface}, combatlog::{combat_logger, CombatData}, gui::CONFIGS, storage::StorageManager, POWER_THRESHOLD}; use common::{ControlPacket, TelemetryPacket}; use cpal::traits::{DeviceTrait, HostTrait, StreamTrait}; use egui_toast::{Toast, ToastKind}; @@ -19,6 +19,11 @@ fn main() -> Result<()> { let storage = StorageManager::new(directories.config_dir().to_path_buf().join(Path::new("conf.dat")))?; + let auto_allowed = Arc::new(AtomicBool::new(false)); + + let (auto_telem_sender, auto_telem) = watch::channel(TelemetryPacket::default()); + let (interface, auto_command) = AutoInterface::new(auto_telem.clone(), storage.clone(), auto_allowed.clone()); + println!("name: {}", auto.name()); for config in auto.configs().iter() { @@ -104,7 +109,7 @@ fn main() -> Result<()> { }); loop { - if let Err(e) = connect(toast_sender.clone(), notes.resubscribe(), data_sender.clone(), logging_sender.clone()).await { + if let Err(e) = connect(toast_sender.clone(), notes.resubscribe(), data_sender.clone(), logging_sender.clone(), auto_telem_sender.clone(), auto_allowed.clone(), interface.clone()).await { if let Err(_) = toast_sender.send(Toast::new().text(format!("{e:?}")).kind(ToastKind::Error)).await { break; }; @@ -128,7 +133,7 @@ fn main() -> Result<()> { /// frequency, volume type Detection = (Option, f32); -async fn connect(toast_sender: mpsc::Sender, notes: broadcast::Receiver, data_sender: watch::Sender, logging_sender: mpsc::Sender) -> Result<()>{ +async fn connect(toast_sender: mpsc::Sender, notes: broadcast::Receiver, data_sender: watch::Sender, logging_sender: mpsc::Sender, auto_sender: watch::Sender, auto_allowed: Arc, interface: AutoInterface) -> Result<()>{ toast_sender.send(Toast::new().text("connecting to bot").kind(ToastKind::Info)).await?; let cruisecontrol = TcpStream::connect("192.168.1.2:1234").await?; println!("connected"); @@ -136,13 +141,13 @@ async fn connect(toast_sender: mpsc::Sender, notes: broadcast::Receiver, logging_sender: mpsc::Sender) -> Result<()> { +async fn telemetry_handler(mut telem: OwnedReadHalf, gui: watch::Sender, logging_sender: mpsc::Sender, auto_sender: watch::Sender) -> Result<()> { let mut buf = vec![0; 2048]; loop { let len = telem.read_u32().await.context("bad length")? as usize; @@ -152,7 +157,8 @@ async fn telemetry_handler(mut telem: OwnedReadHalf, gui: watch::Sender //println!("telem: {telem:?}"); - logging_sender.send(CombatData::Telemetry(telem.clone())).await?; + auto_sender.send(telem.clone())?; + let _ = logging_sender.send(CombatData::Telemetry(telem.clone())).await; gui.send_modify(|gui| { gui.telemetry = Some(telem); @@ -161,7 +167,7 @@ async fn telemetry_handler(mut telem: OwnedReadHalf, gui: watch::Sender } } -async fn controller(mut notes: broadcast::Receiver, controller: OwnedWriteHalf, gui: watch::Sender, logging_sender: mpsc::Sender) -> Result<()> { +async fn controller(mut notes: broadcast::Receiver, controller: OwnedWriteHalf, gui: watch::Sender, logging_sender: mpsc::Sender, enable: Arc, interface: AutoInterface) -> Result<()> { let mut controller = BufWriter::new(controller); //send_packet(&mut controller, ControlPacket::Arm(true)).await?; //println!("armed flipper"); @@ -171,6 +177,7 @@ async fn controller(mut notes: broadcast::Receiver, controller: Owned //auto = Some(spawn(seek)) + loop { let mut control = ControlPacket::Stop; @@ -190,7 +197,7 @@ async fn controller(mut notes: broadcast::Receiver, controller: Owned } send_packet(&mut controller, control.clone()).await?; - logging_sender.send(CombatData::Control(control.clone())).await?; + let _ = logging_sender.send(CombatData::Control(control.clone())).await; gui.send_modify(|gui| gui.last_command = Some(control)); } else { send_packet(&mut controller, ControlPacket::Twist(0.0, 0.0)).await?; From 1e1a82830bf49e281608a64ba1e60bb88f7fb1ab Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Thu, 27 Mar 2025 19:39:42 -0400 Subject: [PATCH 63/69] show auto status on gui --- interface/src/auto.rs | 10 +++++++--- interface/src/gui.rs | 15 +++++++++++---- interface/src/main.rs | 31 +++++++++++++++++-------------- 3 files changed, 35 insertions(+), 21 deletions(-) diff --git a/interface/src/auto.rs b/interface/src/auto.rs index 0d6d9e5..3c075d7 100644 --- a/interface/src/auto.rs +++ b/interface/src/auto.rs @@ -17,18 +17,22 @@ pub struct AutoInterface { } impl AutoInterface { - pub fn new(data: watch::Receiver, config: StorageManager, enable_permission: Arc) -> (Self, watch::Receiver) { + /// new + /// + /// returns command channel from auto, enable status + pub fn new(data: watch::Receiver, config: StorageManager, enable_permission: Arc) -> (Self, watch::Receiver, Arc) { let (commands, receiver) = watch::channel(ControlPacket::Fire); + let enabled = Arc::new(AtomicBool::new(false)); let interface = Self { command_sender: commands, data_receiver: data, config, - enabled: Arc::new(AtomicBool::new(false)), + enabled: enabled.clone(), enable_permission, }; - (interface, receiver) + (interface, receiver, enabled) } pub fn subscribe(&self) -> watch::Receiver { diff --git a/interface/src/gui.rs b/interface/src/gui.rs index 5d19bb7..28a7e26 100644 --- a/interface/src/gui.rs +++ b/interface/src/gui.rs @@ -1,4 +1,4 @@ -use std::{cell::OnceCell, collections::HashMap, path::PathBuf, sync::{atomic::Ordering, Arc}, time::Duration}; +use std::{cell::OnceCell, collections::HashMap, path::PathBuf, sync::{atomic::{AtomicBool, Ordering}, Arc}, time::Duration}; use common::{ControlPacket, TelemetryPacket}; use eframe::{egui::{self, containers, Align2, Checkbox, Context, IconData, Id, ImageSource, Label, Ui}, Storage}; @@ -10,7 +10,7 @@ use crate::{auto::Configurable, storage::StorageManager, POWER_THRESHOLD}; pub const GUI: OnceCell = OnceCell::new(); -pub fn gui(data: Receiver, toasts: mpsc::Receiver, executor: Runtime, autoconf: watch::Receiver<&'static [Configurable]>, storage: StorageManager) -> eframe::Result { +pub fn gui(data: Receiver, toasts: mpsc::Receiver, executor: Runtime, autoconf: watch::Receiver<&'static [Configurable]>, storage: StorageManager, auto_allowed: Arc, auto_enabled: Arc) -> eframe::Result { let icon = egui::include_image!("../assets/lizard.png"); let icon = image::load_from_memory_with_format(include_bytes!("../assets/lizard.png"), ImageFormat::Png).unwrap(); @@ -35,7 +35,7 @@ pub fn gui(data: Receiver, toasts: mpsc::Receiver, executor: Run // This gives us image support: egui_extras::install_image_loaders(&cc.egui_ctx); - Ok(Box::new(GUI::with_receivers(data, toasts, executor, storage, autoconf))) + Ok(Box::new(GUI::with_receivers(data, toasts, executor, storage, autoconf, auto_allowed, auto_enabled))) }), ) } @@ -63,10 +63,12 @@ struct GUI { selected_auto: usize, autoconf: watch::Receiver<&'static [Configurable]>, storage: StorageManager, + auto_allowed: Arc, + auto_enabled: Arc, } impl GUI { - fn with_receivers(data: Receiver, toasts: mpsc::Receiver, executor: Runtime, storage: StorageManager, autoconf: watch::Receiver<&'static [Configurable]>) -> Self { + fn with_receivers(data: Receiver, toasts: mpsc::Receiver, executor: Runtime, storage: StorageManager, autoconf: watch::Receiver<&'static [Configurable]>, auto_allowed: Arc, auto_enabled: Arc) -> Self { Self { data, toasts, @@ -74,6 +76,8 @@ impl GUI { selected_auto: 0, autoconf, storage, + auto_allowed, + auto_enabled, } } } @@ -115,6 +119,9 @@ impl eframe::App for GUI { if let Some(ref command) = self.data.borrow().last_command { ui.label(format!("sending {command:?}")); } + ui.label(format!("auto authorized: {}", if self.auto_allowed.load(Ordering::Acquire) {"✅"} else {"❌"})); + ui.label(format!("auto running: {}", if self.auto_enabled.load(Ordering::Acquire) {"✅ zoom vroom"} else {"❌"})); + if let Some(ref telem) = self.data.borrow().telemetry { ui.label(format!("Left tof: {}", if let Some(tof) = telem.sensors.tof_l {format!("✅ {tof}mm")} else {"❌".into()})); ui.label(format!("Right tof: {}", if let Some(tof) = telem.sensors.tof_r {format!("✅ {tof}mm")} else {"❌".into()})); diff --git a/interface/src/main.rs b/interface/src/main.rs index bf78209..ee8fa5d 100644 --- a/interface/src/main.rs +++ b/interface/src/main.rs @@ -22,7 +22,7 @@ fn main() -> Result<()> { let auto_allowed = Arc::new(AtomicBool::new(false)); let (auto_telem_sender, auto_telem) = watch::channel(TelemetryPacket::default()); - let (interface, auto_command) = AutoInterface::new(auto_telem.clone(), storage.clone(), auto_allowed.clone()); + let (interface, auto_command, auto_enabled) = AutoInterface::new(auto_telem.clone(), storage.clone(), auto_allowed.clone()); println!("name: {}", auto.name()); @@ -99,6 +99,7 @@ fn main() -> Result<()> { let spawner = executor.handle().clone(); + let auto_allowed_ = auto_allowed.clone(); thread::spawn(move || { spawner.block_on(async { let log_toasts = toast_sender.clone(); @@ -109,7 +110,7 @@ fn main() -> Result<()> { }); loop { - if let Err(e) = connect(toast_sender.clone(), notes.resubscribe(), data_sender.clone(), logging_sender.clone(), auto_telem_sender.clone(), auto_allowed.clone(), interface.clone()).await { + if let Err(e) = connect(toast_sender.clone(), notes.resubscribe(), data_sender.clone(), logging_sender.clone(), auto_telem_sender.clone(), auto_allowed_.clone(), interface.clone()).await { if let Err(_) = toast_sender.send(Toast::new().text(format!("{e:?}")).kind(ToastKind::Error)).await { break; }; @@ -121,7 +122,7 @@ fn main() -> Result<()> { println!("launching gui"); let (_conf_sender, conf) = watch::channel(CONFIGS); - gui(gui_data, toasts, executor, conf, storage.clone()).unwrap(); + gui(gui_data, toasts, executor, conf, storage.clone(), auto_allowed, auto_enabled).unwrap(); drop(stream); @@ -177,6 +178,7 @@ async fn controller(mut notes: broadcast::Receiver, controller: Owned //auto = Some(spawn(seek)) + let mut auto_data = interface.subscribe(); loop { let mut control = ControlPacket::Stop; @@ -190,12 +192,16 @@ async fn controller(mut notes: broadcast::Receiver, controller: Owned let (note,vol) = note.context("channel closed")?; if let Some(note) = note { dbg!(note); - if let ControlFlow::Break(_) = sax_control(&mut control, vol, note) { - if let ControlFlow::Break(_) = recorder_control(&mut control, vol, note) { + if let ControlFlow::Break(_) = sax_control(&mut control, vol, note, enable.clone()) { + if let ControlFlow::Break(_) = recorder_control(&mut control, vol, note, enable.clone()) { continue; } } + if enable.load(Ordering::Acquire) && interface.enabled() { + control = auto_data.borrow_and_update().clone(); + } + send_packet(&mut controller, control.clone()).await?; let _ = logging_sender.send(CombatData::Control(control.clone())).await; gui.send_modify(|gui| gui.last_command = Some(control)); @@ -210,7 +216,7 @@ async fn controller(mut notes: broadcast::Receiver, controller: Owned /// Weapon enabled const ARMED: bool = true; -fn sax_control(control: &mut ControlPacket, vol: f32, frequency: f32) -> ControlFlow<()> { +fn sax_control(control: &mut ControlPacket, vol: f32, frequency: f32, enable: Arc) -> ControlFlow<()> { if frequency < 150. { println!("too low"); return ControlFlow::Break(()); @@ -263,7 +269,7 @@ fn sax_control(control: &mut ControlPacket, vol: f32, frequency: f32) -> Control } -fn recorder_control(control: &mut ControlPacket, vol: f32, frequency: f32) -> ControlFlow<()> { +fn recorder_control(control: &mut ControlPacket, vol: f32, frequency: f32, enable: Arc) -> ControlFlow<()> { if frequency < 300. { println!("too low"); return ControlFlow::Break(()); @@ -303,15 +309,12 @@ fn recorder_control(control: &mut ControlPacket, vol: f32, frequency: f32) -> Co *control = ControlPacket::Stop; } Pitch { letter: NoteLetter::F, accidental: 0} => { - println!("stop"); - *control = ControlPacket::Stop; + println!("auto en"); + enable.store(true, Ordering::Release); } Pitch { letter: NoteLetter::E, accidental: 0} => { - println!("stop"); - *control = ControlPacket::Stop; - //if let result::Result::Ok(command) = auto_rx.try_recv() { - // control = command; - //} + println!("auto disable"); + enable.store(false, Ordering::Release); } pitch => { if vol > 3000. { From 9a68f43e5dd24dc5cf3a60fcda5ba500372faf39 Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Thu, 27 Mar 2025 19:45:47 -0400 Subject: [PATCH 64/69] run auto (it crashes) --- interface/src/main.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/interface/src/main.rs b/interface/src/main.rs index ee8fa5d..8fdfe58 100644 --- a/interface/src/main.rs +++ b/interface/src/main.rs @@ -100,8 +100,10 @@ fn main() -> Result<()> { let spawner = executor.handle().clone(); let auto_allowed_ = auto_allowed.clone(); + let interface_ = interface.clone(); thread::spawn(move || { spawner.block_on(async { + let log_toasts = toast_sender.clone(); tokio::spawn(async move { if let Err(e) = combat_logger(combatlog, directories.data_dir()).await { @@ -110,7 +112,7 @@ fn main() -> Result<()> { }); loop { - if let Err(e) = connect(toast_sender.clone(), notes.resubscribe(), data_sender.clone(), logging_sender.clone(), auto_telem_sender.clone(), auto_allowed_.clone(), interface.clone()).await { + if let Err(e) = connect(toast_sender.clone(), notes.resubscribe(), data_sender.clone(), logging_sender.clone(), auto_telem_sender.clone(), auto_allowed_.clone(), interface_.clone()).await { if let Err(_) = toast_sender.send(Toast::new().text(format!("{e:?}")).kind(ToastKind::Error)).await { break; }; @@ -120,6 +122,15 @@ fn main() -> Result<()> { }); + let interface_ = interface.clone(); + let spawner = executor.handle().clone(); + thread::spawn(move || { + spawner.block_on(async { + let _stoppie = auto.run(interface_).await.unwrap(); + println!("auto ended"); + }); + }); + println!("launching gui"); let (_conf_sender, conf) = watch::channel(CONFIGS); gui(gui_data, toasts, executor, conf, storage.clone(), auto_allowed, auto_enabled).unwrap(); From 17f484acd56ef06899ffb3a774f6ae37c1baba53 Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Fri, 28 Mar 2025 00:08:13 -0400 Subject: [PATCH 65/69] re-embedded auto in interface crashes seem to occur when mutating state from across the dylib boundary not worth troubleshooting when I don't need hot-reloading anymore --- interface/src/auto.rs | 20 +++-- interface/src/auto_impl.rs | 146 +++++++++++++++++++++++++++++++++++++ interface/src/gui.rs | 13 +--- interface/src/lib.rs | 1 + interface/src/main.rs | 4 +- 5 files changed, 164 insertions(+), 20 deletions(-) create mode 100644 interface/src/auto_impl.rs diff --git a/interface/src/auto.rs b/interface/src/auto.rs index 3c075d7..746a407 100644 --- a/interface/src/auto.rs +++ b/interface/src/auto.rs @@ -1,4 +1,4 @@ -use std::{future::Future, ops::{Deref, Range}, pin::Pin, sync::{atomic::{AtomicBool, Ordering}, Arc}}; +use std::{future::Future, ops::{Deref, Range}, pin::Pin, sync::{atomic::{AtomicBool, Ordering}, Arc}, thread::sleep, time::Duration}; use common::{CamState, ControlPacket, SensorData, TelemetryPacket}; use anyhow::{anyhow, Ok, Result}; @@ -53,7 +53,15 @@ impl AutoInterface { pub async fn sensor_update(&mut self) -> SensorData { self.data_receiver.changed().await.unwrap(); self.data_receiver.borrow().sensors.clone() - + } + pub fn sensor_update_blocking(&mut self) -> SensorData { + loop { + if self.data_receiver.has_changed().unwrap() { + break; + } + sleep(Duration::from_millis(10)); // TODO: exponential or condvars + } + self.data_receiver.borrow_and_update().sensors.clone() } /// disable auto pub fn disable(&mut self) { @@ -140,12 +148,12 @@ impl Auto { } /// entrypoint - pub async fn run(&self, interface: AutoInterface) -> Result> { - let func: Symbol Pin + Send>>> = unsafe {self.library.get(b"entry")?}; + pub fn run(&self, interface: AutoInterface) -> Result<()> { + let func: Symbol ()> = unsafe {self.library.get(b"entry")?}; - let fut = unsafe { func(interface.clone()) }; + unsafe { func(interface.clone()) }; - Ok(tokio::spawn(fut)) + Ok(()) } pub fn configs(&self) -> &'static [Configurable] { diff --git a/interface/src/auto_impl.rs b/interface/src/auto_impl.rs new file mode 100644 index 0000000..5c5e161 --- /dev/null +++ b/interface/src/auto_impl.rs @@ -0,0 +1,146 @@ + +use std::{collections::VecDeque, future::Future, ops::Sub, pin::Pin}; + +use common::CamState; +use crate::auto::{AutoInterface, Configurable}; + + +#[unsafe(no_mangle)] +pub fn entry(interface: AutoInterface) -> Pin + Send>> { + Box::pin(auto(interface)) +} + +#[unsafe(no_mangle)] +pub static NAME: &'static str = "scanseek v1"; + +const AUTO_GAP: Configurable = Configurable::new("auto minimum gap").range(0. .. 300.).default(140.) + .description("distance (mm) distance measurements must instantaneously drop to indicate a detection. This should line up with the size of the smallest robot you compete against"); +const AUTO_SELF_OCCLUSION: Configurable = Configurable::new("auto self occlusion").range(0. .. 200.).default(143.) + .description("distance (mm) below which measurements are considered noise in the scan phase"); +const AUTO_CONVERGENCE_POINT: Configurable = Configurable::new("auto convergence").range(100. .. 300.).default(190.) + .description("distance (mm) where the tof beams intersect"); +const AUTO_SEEK_RANGE: Configurable = Configurable::new("auto seek range").range(200. .. 8000.).default(500.); + +#[unsafe(no_mangle)] +pub static CONFIGS: &[Configurable] = &[ + AUTO_GAP, + AUTO_SELF_OCCLUSION, + AUTO_CONVERGENCE_POINT, + AUTO_SEEK_RANGE, +]; + +pub async fn auto(mut interface: AutoInterface) { + let mut tof_l = Stats::new(); + let mut tof_r = Stats::new(); + loop { + let data = interface.sensor_update().await; + println!("auto got on data"); + let cam = interface.cam_state(); + let CamState::Charged = cam else { + continue; + }; + + let Some(latest_tof_l) = data.tof_l else { + continue; + }; + tof_l.update(latest_tof_l as i16); + let Some(latest_tof_r) = data.tof_r else { + continue; + }; + tof_r.update(latest_tof_r as i16); + + let auto_gap = interface.conf(&AUTO_GAP); + let auto_self_occlusion = interface.conf(&AUTO_SELF_OCCLUSION); + + let detection = |latest: u16, delta: i16| { + delta < auto_gap as i16 && latest > auto_self_occlusion as u16 + }; + + if detection(latest_tof_l, tof_l.delta()) || detection(latest_tof_l, tof_l.delta()) { + if let Ok(()) = interface.enable() { + println!("found, now seek"); + seek(interface.clone(), &mut tof_l, &mut tof_r).await; + } else { + println!("requested enable") + } + } + } +} + +async fn seek(mut interface: AutoInterface, tof_l: &mut Stats, tof_r: &mut Stats) { + let crossover = interface.conf(&AUTO_CONVERGENCE_POINT) as i16; + let range = interface.conf(&AUTO_SEEK_RANGE) as i16; + loop { + let data = interface.sensor_data(); + data.tof_l.map(|d| tof_l.update(d as i16)); + data.tof_r.map(|d| tof_r.update(d as i16)); + + let left_near = tof_l.latest() < crossover && tof_l.delta() < 70; + let right_near = tof_r.latest() < crossover && tof_r.delta() < 70; + + let left_far = tof_l.latest() > crossover && tof_l.latest() < range && tof_l.delta() < 70; + let right_far = tof_r.latest() > crossover && tof_r.latest() < range && tof_r.delta() < 70; + + let near = left_near || right_near; + + let far = !near && (left_far || right_far); + + let mut twist = 0.0; + if near { + if tof_l.max() > tof_r.max() { + twist = 1.0; // right + } else { + twist = -1.0; // left + } + } else if far { + if tof_l.max() > tof_r.max() { + twist = -1.0; // left + } else { + twist = 1.0; // right + } + } + + let _ = interface.run_command(common::ControlPacket::Twist(1.0, twist)); + interface.sensor_update_blocking(); + } +} + +struct Stats { + table: VecDeque +} + +impl Stats { + pub fn new() -> Self { + Self { table: VecDeque::new() } + + } + + const MAX_ELEMENTS: usize = 3; + + pub fn update(&mut self, elem: T) { + self.table.push_front(elem); + if self.table.len() > Self::MAX_ELEMENTS { + self.table.pop_back(); + } + } + + /// panics if no values have been written + pub fn latest(&self) -> T { + self.table.front().unwrap().to_owned() + } +} + +impl + Copy + From> Stats { + pub fn delta(&self) -> T { + *self.table.get(0).unwrap_or(&T::from(0)) - *self.table.get(1).unwrap_or(&T::from(0)) + } + + pub fn max(&self) -> T { + *self.table.iter().max().unwrap_or(&T::from(0)) + } + + pub fn min(&self) -> T { + *self.table.iter().max().unwrap_or(&T::from(0)) + } + +} diff --git a/interface/src/gui.rs b/interface/src/gui.rs index 28a7e26..09884bd 100644 --- a/interface/src/gui.rs +++ b/interface/src/gui.rs @@ -6,7 +6,7 @@ use image::ImageFormat; use tokio::{runtime::Runtime, sync::{mpsc, watch::{self, Receiver}}}; use egui_toast::{Toast, Toasts}; -use crate::{auto::Configurable, storage::StorageManager, POWER_THRESHOLD}; +use crate::{auto::Configurable, auto_impl::CONFIGS, storage::StorageManager, POWER_THRESHOLD}; pub const GUI: OnceCell = OnceCell::new(); @@ -82,17 +82,6 @@ impl GUI { } } -// dupe from auto crate for testing -const AUTO_GAP: Configurable = Configurable::new("auto minimum gap").range(0. .. 300.).default(140.) - .description("distance (mm) distance measurements must instantaneously drop to indicate a detection. This should line up with the size of the smallest robot you compete against"); -const AUTO_SELF_OCCLUSION: Configurable = Configurable::new("auto self occlusion").range(0. .. 200.).default(143.) - .description("distance (mm) below which measurements are considered noise in the scan phase"); - -pub static CONFIGS: &[Configurable] = &[ - AUTO_GAP, - AUTO_SELF_OCCLUSION, -]; - impl eframe::App for GUI { fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) { let _ = GUI.set(ctx.clone()); diff --git a/interface/src/lib.rs b/interface/src/lib.rs index 8f92088..237d105 100644 --- a/interface/src/lib.rs +++ b/interface/src/lib.rs @@ -6,6 +6,7 @@ use gui::DEFAULT_VOLUME_THRESHOLD; pub mod gui; pub mod combatlog; pub mod auto; +pub mod auto_impl; pub mod storage; pub const POWER_THRESHOLD: AtomicF32 = AtomicF32::new(DEFAULT_VOLUME_THRESHOLD); diff --git a/interface/src/main.rs b/interface/src/main.rs index 8fdfe58..91f6e17 100644 --- a/interface/src/main.rs +++ b/interface/src/main.rs @@ -3,7 +3,7 @@ use std::{fmt::format, ops::ControlFlow, path::Path, result, sync::{atomic::{Ato use anyhow::{Context, Ok, Result}; use atomic_float::AtomicF32; use directories::ProjectDirs; -use interface::{auto::{get_confs, Auto, AutoInterface}, combatlog::{combat_logger, CombatData}, gui::CONFIGS, storage::StorageManager, POWER_THRESHOLD}; +use interface::{auto::{get_confs, Auto, AutoInterface}, auto_impl, combatlog::{combat_logger, CombatData}, gui::CONFIGS, storage::StorageManager, POWER_THRESHOLD}; use common::{ControlPacket, TelemetryPacket}; use cpal::traits::{DeviceTrait, HostTrait, StreamTrait}; use egui_toast::{Toast, ToastKind}; @@ -126,7 +126,7 @@ fn main() -> Result<()> { let spawner = executor.handle().clone(); thread::spawn(move || { spawner.block_on(async { - let _stoppie = auto.run(interface_).await.unwrap(); + let _stoppie = auto_impl::auto(interface_).await; println!("auto ended"); }); }); From 7fe4e4477e10ddcbb82df9e303df0c7fe34efa58 Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Fri, 28 Mar 2025 18:35:40 -0400 Subject: [PATCH 66/69] fire in auto --- interface/src/auto_impl.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/interface/src/auto_impl.rs b/interface/src/auto_impl.rs index 5c5e161..45e9320 100644 --- a/interface/src/auto_impl.rs +++ b/interface/src/auto_impl.rs @@ -2,6 +2,7 @@ use std::{collections::VecDeque, future::Future, ops::Sub, pin::Pin}; use common::CamState; +use tokio::time::Instant; use crate::auto::{AutoInterface, Configurable}; @@ -70,6 +71,7 @@ pub async fn auto(mut interface: AutoInterface) { async fn seek(mut interface: AutoInterface, tof_l: &mut Stats, tof_r: &mut Stats) { let crossover = interface.conf(&AUTO_CONVERGENCE_POINT) as i16; let range = interface.conf(&AUTO_SEEK_RANGE) as i16; + let mut timeout = Instant::now(); loop { let data = interface.sensor_data(); data.tof_l.map(|d| tof_l.update(d as i16)); @@ -85,6 +87,14 @@ async fn seek(mut interface: AutoInterface, tof_l: &mut Stats, tof_r: &mut let far = !near && (left_far || right_far); + if !(near || far) { + if timeout.elapsed().as_millis() > 1200 { + return; + } + } else { + timeout = Instant::now(); + } + let mut twist = 0.0; if near { if tof_l.max() > tof_r.max() { @@ -100,11 +110,22 @@ async fn seek(mut interface: AutoInterface, tof_l: &mut Stats, tof_r: &mut } } + if should_fire(&tof_l, &tof_r) { + let _ = interface.run_command(common::ControlPacket::Fire); + println!("fired"); + return; + } + let _ = interface.run_command(common::ControlPacket::Twist(1.0, twist)); interface.sensor_update_blocking(); } } +fn should_fire(left: &Stats, right: &Stats) -> bool { + left.latest() < 70 && left.latest() > 20 && left.delta() < 60 && + right.latest() < 70 && right.latest() > 20 && right.delta() < 60 +} + struct Stats { table: VecDeque } From a3864c4ef0c6ab33f1633eb9e48f1436e3c3584f Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Sat, 29 Mar 2025 19:02:58 -0400 Subject: [PATCH 67/69] use past convergence logic when one sensor is pat the convergence point the hardware is in really bad shape, the tofs randomly are stuck at max and randomly stuck at min. The drive esc can't feed more than ~20% power, and then not consistently either. Without any signal in the noise it is impossible to move forward. A possible full system redesign is to use a global shutter camera from outside the box for all position data, perhaps supplemented with an onboard IMU. tofs (at this price point) are not useful. It may be worth trying new tofs that haven't had the chance for particulate to accumulate in the emmiter/collector, but I'm not bullish on it. --- interface/src/auto_impl.rs | 39 ++++++++++++++++++++++++--------- interface/src/main.rs | 45 ++++++++++++++++++++++++++------------ 2 files changed, 60 insertions(+), 24 deletions(-) diff --git a/interface/src/auto_impl.rs b/interface/src/auto_impl.rs index 45e9320..ea0eec9 100644 --- a/interface/src/auto_impl.rs +++ b/interface/src/auto_impl.rs @@ -35,7 +35,6 @@ pub async fn auto(mut interface: AutoInterface) { let mut tof_r = Stats::new(); loop { let data = interface.sensor_update().await; - println!("auto got on data"); let cam = interface.cam_state(); let CamState::Charged = cam else { continue; @@ -52,12 +51,16 @@ pub async fn auto(mut interface: AutoInterface) { let auto_gap = interface.conf(&AUTO_GAP); let auto_self_occlusion = interface.conf(&AUTO_SELF_OCCLUSION); + let auto_range = interface.conf(&AUTO_SEEK_RANGE); let detection = |latest: u16, delta: i16| { - delta < auto_gap as i16 && latest > auto_self_occlusion as u16 + -delta > auto_gap as i16 && + latest > auto_self_occlusion as u16 && + latest < auto_range as u16 }; - if detection(latest_tof_l, tof_l.delta()) || detection(latest_tof_l, tof_l.delta()) { + + if dbg!(detection(latest_tof_l, tof_l.delta())) || dbg!(detection(latest_tof_r, dbg!(tof_r.delta()))) { if let Ok(()) = interface.enable() { println!("found, now seek"); seek(interface.clone(), &mut tof_l, &mut tof_r).await; @@ -77,6 +80,10 @@ async fn seek(mut interface: AutoInterface, tof_l: &mut Stats, tof_r: &mut data.tof_l.map(|d| tof_l.update(d as i16)); data.tof_r.map(|d| tof_r.update(d as i16)); + if data.tof_l.is_none() || data.tof_r.is_none() { + return; + } + let left_near = tof_l.latest() < crossover && tof_l.delta() < 70; let right_near = tof_r.latest() < crossover && tof_r.delta() < 70; @@ -97,16 +104,28 @@ async fn seek(mut interface: AutoInterface, tof_l: &mut Stats, tof_r: &mut let mut twist = 0.0; if near { - if tof_l.max() > tof_r.max() { - twist = 1.0; // right + // if one is beyond the convergence point use far logic + if tof_l.max().max(tof_r.max()) > + interface.conf(&AUTO_CONVERGENCE_POINT) as i16 { + if right_near { + twist = -0.7; + } else if left_near { + twist = 0.7; + } } else { - twist = -1.0; // left + // go towards the further side + let mut diff = tof_l.max() - tof_r.max(); + diff = diff.max(-100).min(100); + + twist = (diff as f32) / 150.; + } } else if far { - if tof_l.max() > tof_r.max() { - twist = -1.0; // left - } else { - twist = 1.0; // right + if tof_r.max() - tof_l.max() > 100 { + twist = 0.7; // right high, go right + } + if tof_l.max() - tof_r.max() > 100 { + twist = -0.7; // left high, go left } } diff --git a/interface/src/main.rs b/interface/src/main.rs index 91f6e17..1e651b0 100644 --- a/interface/src/main.rs +++ b/interface/src/main.rs @@ -3,7 +3,7 @@ use std::{fmt::format, ops::ControlFlow, path::Path, result, sync::{atomic::{Ato use anyhow::{Context, Ok, Result}; use atomic_float::AtomicF32; use directories::ProjectDirs; -use interface::{auto::{get_confs, Auto, AutoInterface}, auto_impl, combatlog::{combat_logger, CombatData}, gui::CONFIGS, storage::StorageManager, POWER_THRESHOLD}; +use interface::{auto::{get_confs, Auto, AutoInterface}, auto_impl::{self, CONFIGS}, combatlog::{combat_logger, CombatData}, storage::StorageManager, POWER_THRESHOLD}; use common::{ControlPacket, TelemetryPacket}; use cpal::traits::{DeviceTrait, HostTrait, StreamTrait}; use egui_toast::{Toast, ToastKind}; @@ -22,7 +22,7 @@ fn main() -> Result<()> { let auto_allowed = Arc::new(AtomicBool::new(false)); let (auto_telem_sender, auto_telem) = watch::channel(TelemetryPacket::default()); - let (interface, auto_command, auto_enabled) = AutoInterface::new(auto_telem.clone(), storage.clone(), auto_allowed.clone()); + let (interface, _auto_command, auto_enabled) = AutoInterface::new(auto_telem.clone(), storage.clone(), auto_allowed.clone()); println!("name: {}", auto.name()); @@ -192,9 +192,13 @@ async fn controller(mut notes: broadcast::Receiver, controller: Owned let mut auto_data = interface.subscribe(); loop { - let mut control = ControlPacket::Stop; + let mut control = ControlPacket::Twist(0.0, 0.0); - let result::Result::Ok(note) = timeout(Duration::from_millis(250), notes.recv()).await else { + let auto_enabled = || {enable.load(Ordering::Acquire) && interface.enabled()}; + + let control_timeout = if auto_enabled() {Duration::from_millis(50)} else {Duration::from_millis(350)}; + + let result::Result::Ok(note) = timeout(control_timeout, notes.recv()).await else { println!("timeout"); send_packet(&mut controller, ControlPacket::Stop).await?; continue; @@ -203,23 +207,35 @@ async fn controller(mut notes: broadcast::Receiver, controller: Owned let (note,vol) = note.context("channel closed")?; if let Some(note) = note { dbg!(note); + control = ControlPacket::Stop; if let ControlFlow::Break(_) = sax_control(&mut control, vol, note, enable.clone()) { if let ControlFlow::Break(_) = recorder_control(&mut control, vol, note, enable.clone()) { continue; } } - if enable.load(Ordering::Acquire) && interface.enabled() { - control = auto_data.borrow_and_update().clone(); + if let ControlPacket::Twist(ref mut f,ref mut r) = control { + let scale = 0.8; + *f *= scale; + *r *= scale; + } + } + + if auto_enabled() { + control = auto_data.borrow_and_update().clone(); + + if let ControlPacket::Twist(ref mut f,ref mut r) = control { + let scale = 0.1; + *f *= scale; + *r *= scale; } - send_packet(&mut controller, control.clone()).await?; - let _ = logging_sender.send(CombatData::Control(control.clone())).await; - gui.send_modify(|gui| gui.last_command = Some(control)); - } else { - send_packet(&mut controller, ControlPacket::Twist(0.0, 0.0)).await?; - gui.send_modify(|gui| gui.last_command = Some(ControlPacket::Stop)); } + + send_packet(&mut controller, control.clone()).await?; + let _ = logging_sender.send(CombatData::Control(control.clone())).await; + gui.send_modify(|gui| gui.last_command = Some(control)); + GUI.get().map(|c| c.request_repaint()); } } @@ -281,7 +297,7 @@ fn sax_control(control: &mut ControlPacket, vol: f32, frequency: f32, enable: Ar fn recorder_control(control: &mut ControlPacket, vol: f32, frequency: f32, enable: Arc) -> ControlFlow<()> { - if frequency < 300. { + if frequency < 280. { println!("too low"); return ControlFlow::Break(()); } @@ -318,8 +334,9 @@ fn recorder_control(control: &mut ControlPacket, vol: f32, frequency: f32, enabl Pitch { letter: NoteLetter::F, accidental: 1} => { println!("stop flat"); *control = ControlPacket::Stop; + enable.store(false, Ordering::Release); } - Pitch { letter: NoteLetter::F, accidental: 0} => { + Pitch { letter: NoteLetter::D, accidental: _} => { println!("auto en"); enable.store(true, Ordering::Release); } From 7811eaf91c08168951e95cf4e560903cb67b0246 Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Sun, 30 Mar 2025 01:06:29 -0400 Subject: [PATCH 68/69] disconnect button --- interface/src/gui.rs | 8 +++++++- interface/src/lib.rs | 3 +++ interface/src/main.rs | 11 +++++++++-- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/interface/src/gui.rs b/interface/src/gui.rs index 09884bd..09f1a1e 100644 --- a/interface/src/gui.rs +++ b/interface/src/gui.rs @@ -6,7 +6,7 @@ use image::ImageFormat; use tokio::{runtime::Runtime, sync::{mpsc, watch::{self, Receiver}}}; use egui_toast::{Toast, Toasts}; -use crate::{auto::Configurable, auto_impl::CONFIGS, storage::StorageManager, POWER_THRESHOLD}; +use crate::{auto::Configurable, auto_impl::CONFIGS, storage::StorageManager, POWER_THRESHOLD, RECONNECT}; pub const GUI: OnceCell = OnceCell::new(); @@ -105,6 +105,12 @@ impl eframe::App for GUI { egui::CentralPanel::default().show(ctx, |ui| { ui.heading("Cruise Control"); + if !RECONNECT.load(Ordering::Acquire) { + if ui.button("disconnect").clicked() { + RECONNECT.store(true, Ordering::Release); + } + } + if let Some(ref command) = self.data.borrow().last_command { ui.label(format!("sending {command:?}")); } diff --git a/interface/src/lib.rs b/interface/src/lib.rs index 237d105..e6c0a5b 100644 --- a/interface/src/lib.rs +++ b/interface/src/lib.rs @@ -1,5 +1,7 @@ #![feature(iter_collect_into)] +use std::sync::atomic::AtomicBool; + use atomic_float::AtomicF32; use gui::DEFAULT_VOLUME_THRESHOLD; @@ -11,3 +13,4 @@ pub mod storage; pub const POWER_THRESHOLD: AtomicF32 = AtomicF32::new(DEFAULT_VOLUME_THRESHOLD); +pub static RECONNECT: AtomicBool = AtomicBool::new(false); diff --git a/interface/src/main.rs b/interface/src/main.rs index 1e651b0..9bf7060 100644 --- a/interface/src/main.rs +++ b/interface/src/main.rs @@ -1,9 +1,9 @@ use std::{fmt::format, ops::ControlFlow, path::Path, result, sync::{atomic::{AtomicBool, Ordering}, Arc}, thread::{self, sleep}, time::Duration}; -use anyhow::{Context, Ok, Result}; +use anyhow::{anyhow, Context, Ok, Result}; use atomic_float::AtomicF32; use directories::ProjectDirs; -use interface::{auto::{get_confs, Auto, AutoInterface}, auto_impl::{self, CONFIGS}, combatlog::{combat_logger, CombatData}, storage::StorageManager, POWER_THRESHOLD}; +use interface::{auto::{get_confs, Auto, AutoInterface}, auto_impl::{self, CONFIGS}, combatlog::{combat_logger, CombatData}, storage::StorageManager, POWER_THRESHOLD, RECONNECT}; use common::{ControlPacket, TelemetryPacket}; use cpal::traits::{DeviceTrait, HostTrait, StreamTrait}; use egui_toast::{Toast, ToastKind}; @@ -117,6 +117,7 @@ fn main() -> Result<()> { break; }; } + let _ = data_sender.send(GUIData { telemetry: None, last_command: None }); } }); @@ -237,6 +238,12 @@ async fn controller(mut notes: broadcast::Receiver, controller: Owned gui.send_modify(|gui| gui.last_command = Some(control)); GUI.get().map(|c| c.request_repaint()); + + if RECONNECT.load(Ordering::Acquire) { + RECONNECT.store(false, Ordering::Release); + return Ok(()); + } + } } From 3c20c4e13ce21ae2a866f7bdd9e19200813dfcff Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Sun, 30 Mar 2025 03:13:19 -0400 Subject: [PATCH 69/69] show ping on panel --- interface/Cargo.lock | 101 +++++++++++++++++++++++++++++++++++++++++- interface/Cargo.toml | 1 + interface/src/gui.rs | 24 +++++++--- interface/src/lib.rs | 5 ++- interface/src/main.rs | 44 ++++++++++++++++-- 5 files changed, 162 insertions(+), 13 deletions(-) diff --git a/interface/Cargo.lock b/interface/Cargo.lock index d4ba41f..f61a546 100644 --- a/interface/Cargo.lock +++ b/interface/Cargo.lock @@ -1571,12 +1571,48 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "futures" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" +dependencies = [ + "futures-core", + "futures-sink", +] + [[package]] name = "futures-core" version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" +[[package]] +name = "futures-executor" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + [[package]] name = "futures-io" version = "0.3.31" @@ -1625,6 +1661,7 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ + "futures-channel", "futures-core", "futures-io", "futures-macro", @@ -2179,6 +2216,7 @@ dependencies = [ "home", "image", "libloading", + "ping-rs", "pitch-detection", "postcard", "rust-music-theory", @@ -2470,6 +2508,18 @@ dependencies = [ "simd-adler32", ] +[[package]] +name = "mio" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +dependencies = [ + "libc", + "log", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.48.0", +] + [[package]] name = "mio" version = "1.0.3" @@ -3049,6 +3099,19 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "ping-rs" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d873f038f84371f9c7fa13f6afea4d5f1fbcd5070ba8eb7af2a6d41c768eff8b" +dependencies = [ + "futures", + "mio 0.8.11", + "paste", + "socket2 0.4.10", + "windows 0.43.0", +] + [[package]] name = "piper" version = "0.2.4" @@ -3671,6 +3734,16 @@ dependencies = [ "serde", ] +[[package]] +name = "socket2" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" +dependencies = [ + "libc", + "winapi", +] + [[package]] name = "socket2" version = "0.5.8" @@ -3926,11 +3999,11 @@ dependencies = [ "backtrace", "bytes", "libc", - "mio", + "mio 1.0.3", "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2", + "socket2 0.5.8", "tokio-macros", "windows-sys 0.52.0", ] @@ -4515,6 +4588,21 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows" +version = "0.43.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04662ed0e3e5630dfa9b26e4cb823b817f1a9addda855d973a9458c236556244" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + [[package]] name = "windows" version = "0.54.0" @@ -4632,6 +4720,15 @@ dependencies = [ "windows-targets 0.42.2", ] +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + [[package]] name = "windows-sys" version = "0.52.0" diff --git a/interface/Cargo.toml b/interface/Cargo.toml index 938e360..42161cc 100644 --- a/interface/Cargo.toml +++ b/interface/Cargo.toml @@ -25,3 +25,4 @@ libloading = "0.8.6" emath = "0.31.1" dashmap = { version = "6.1.0", features = ["serde"] } directories = "6.0.0" +ping-rs = "0.1.2" diff --git a/interface/src/gui.rs b/interface/src/gui.rs index 09f1a1e..44416e5 100644 --- a/interface/src/gui.rs +++ b/interface/src/gui.rs @@ -6,11 +6,11 @@ use image::ImageFormat; use tokio::{runtime::Runtime, sync::{mpsc, watch::{self, Receiver}}}; use egui_toast::{Toast, Toasts}; -use crate::{auto::Configurable, auto_impl::CONFIGS, storage::StorageManager, POWER_THRESHOLD, RECONNECT}; +use crate::{auto::Configurable, auto_impl::CONFIGS, storage::StorageManager, PingData, POWER_THRESHOLD, RECONNECT}; pub const GUI: OnceCell = OnceCell::new(); -pub fn gui(data: Receiver, toasts: mpsc::Receiver, executor: Runtime, autoconf: watch::Receiver<&'static [Configurable]>, storage: StorageManager, auto_allowed: Arc, auto_enabled: Arc) -> eframe::Result { +pub fn gui(data: Receiver, toasts: mpsc::Receiver, executor: Runtime, autoconf: watch::Receiver<&'static [Configurable]>, storage: StorageManager, auto_allowed: Arc, auto_enabled: Arc, ping: PingData) -> eframe::Result { let icon = egui::include_image!("../assets/lizard.png"); let icon = image::load_from_memory_with_format(include_bytes!("../assets/lizard.png"), ImageFormat::Png).unwrap(); @@ -35,7 +35,7 @@ pub fn gui(data: Receiver, toasts: mpsc::Receiver, executor: Run // This gives us image support: egui_extras::install_image_loaders(&cc.egui_ctx); - Ok(Box::new(GUI::with_receivers(data, toasts, executor, storage, autoconf, auto_allowed, auto_enabled))) + Ok(Box::new(GUI::with_receivers(data, toasts, executor, storage, autoconf, auto_allowed, auto_enabled, ping))) }), ) } @@ -65,10 +65,11 @@ struct GUI { storage: StorageManager, auto_allowed: Arc, auto_enabled: Arc, + ping: PingData, } impl GUI { - fn with_receivers(data: Receiver, toasts: mpsc::Receiver, executor: Runtime, storage: StorageManager, autoconf: watch::Receiver<&'static [Configurable]>, auto_allowed: Arc, auto_enabled: Arc) -> Self { + fn with_receivers(data: Receiver, toasts: mpsc::Receiver, executor: Runtime, storage: StorageManager, autoconf: watch::Receiver<&'static [Configurable]>, auto_allowed: Arc, auto_enabled: Arc, ping: PingData) -> Self { Self { data, toasts, @@ -78,6 +79,7 @@ impl GUI { storage, auto_allowed, auto_enabled, + ping, } } } @@ -111,11 +113,21 @@ impl eframe::App for GUI { } } + if let Ok(ping) = self.ping.try_read() { + ui.horizontal(|ui| { + ui.label(format!("router: {}", if let Some(rtt) = ping.0 {format!("✅ {rtt}ms")} else {"❌".into()})); + ui.label(format!("robot: {}", if let Some(rtt) = ping.1 {format!("✅ {rtt}ms")} else {"❌".into()})); + }); + } + + if let Some(ref command) = self.data.borrow().last_command { ui.label(format!("sending {command:?}")); } - ui.label(format!("auto authorized: {}", if self.auto_allowed.load(Ordering::Acquire) {"✅"} else {"❌"})); - ui.label(format!("auto running: {}", if self.auto_enabled.load(Ordering::Acquire) {"✅ zoom vroom"} else {"❌"})); + ui.horizontal(|ui| { + ui.label(format!("auto authorized: {}", if self.auto_allowed.load(Ordering::Acquire) {"✅"} else {"❌"})); + ui.label(format!("auto running: {}", if self.auto_enabled.load(Ordering::Acquire) {"✅ zoom vroom"} else {"❌"})); + }); if let Some(ref telem) = self.data.borrow().telemetry { ui.label(format!("Left tof: {}", if let Some(tof) = telem.sensors.tof_l {format!("✅ {tof}mm")} else {"❌".into()})); diff --git a/interface/src/lib.rs b/interface/src/lib.rs index e6c0a5b..176b520 100644 --- a/interface/src/lib.rs +++ b/interface/src/lib.rs @@ -1,9 +1,10 @@ #![feature(iter_collect_into)] -use std::sync::atomic::AtomicBool; +use std::sync::{atomic::AtomicBool, Arc}; use atomic_float::AtomicF32; use gui::DEFAULT_VOLUME_THRESHOLD; +use tokio::sync::RwLock; pub mod gui; pub mod combatlog; @@ -14,3 +15,5 @@ pub mod storage; pub const POWER_THRESHOLD: AtomicF32 = AtomicF32::new(DEFAULT_VOLUME_THRESHOLD); pub static RECONNECT: AtomicBool = AtomicBool::new(false); + +pub type PingData = Arc, Option)>>; diff --git a/interface/src/main.rs b/interface/src/main.rs index 9bf7060..047e7b7 100644 --- a/interface/src/main.rs +++ b/interface/src/main.rs @@ -1,16 +1,16 @@ -use std::{fmt::format, ops::ControlFlow, path::Path, result, sync::{atomic::{AtomicBool, Ordering}, Arc}, thread::{self, sleep}, time::Duration}; +use std::{fmt::format, net::{IpAddr, Ipv4Addr}, ops::ControlFlow, path::Path, result, sync::{atomic::{AtomicBool, Ordering}, Arc}, thread::{self, sleep}, time::Duration}; use anyhow::{anyhow, Context, Ok, Result}; use atomic_float::AtomicF32; use directories::ProjectDirs; -use interface::{auto::{get_confs, Auto, AutoInterface}, auto_impl::{self, CONFIGS}, combatlog::{combat_logger, CombatData}, storage::StorageManager, POWER_THRESHOLD, RECONNECT}; +use interface::{auto::{get_confs, Auto, AutoInterface}, auto_impl::{self, CONFIGS}, combatlog::{combat_logger, CombatData}, storage::StorageManager, PingData, POWER_THRESHOLD, RECONNECT}; use common::{ControlPacket, TelemetryPacket}; use cpal::traits::{DeviceTrait, HostTrait, StreamTrait}; use egui_toast::{Toast, ToastKind}; use interface::gui::{gui, GUIData, DEFAULT_VOLUME_THRESHOLD, GUI}; use pitch_detection::{detector::{mcleod::McLeodDetector, PitchDetector}, utils}; use rust_music_theory::note::{Note, NoteLetter, Pitch, Tuning}; -use tokio::{io::{AsyncReadExt, AsyncWriteExt, BufWriter, WriteHalf}, net::{tcp::{OwnedReadHalf, OwnedWriteHalf}, TcpStream}, spawn, sync::{self, broadcast, mpsc, watch, RwLock}, time::timeout}; +use tokio::{io::{AsyncReadExt, AsyncWriteExt, BufWriter, WriteHalf}, join, net::{tcp::{OwnedReadHalf, OwnedWriteHalf}, TcpStream}, spawn, sync::{self, broadcast, mpsc, watch, RwLock}, time::{sleep_until, timeout, Instant}}; fn main() -> Result<()> { @@ -24,6 +24,8 @@ fn main() -> Result<()> { let (auto_telem_sender, auto_telem) = watch::channel(TelemetryPacket::default()); let (interface, _auto_command, auto_enabled) = AutoInterface::new(auto_telem.clone(), storage.clone(), auto_allowed.clone()); + let ping: PingData = Arc::new(RwLock::new((None, None))); + println!("name: {}", auto.name()); for config in auto.configs().iter() { @@ -101,8 +103,42 @@ fn main() -> Result<()> { let spawner = executor.handle().clone(); let auto_allowed_ = auto_allowed.clone(); let interface_ = interface.clone(); + let ping_ = ping.clone(); thread::spawn(move || { spawner.block_on(async { + tokio::spawn(async move { + let robot: IpAddr = "192.168.1.2".parse().unwrap(); + let router: IpAddr = "192.168.1.1".parse().unwrap(); + + loop { + let start = Instant::now(); + let (robot, router) = join!( + ping_rs::send_ping_async(&robot, + Duration::from_millis(250), + Arc::new(&[0,1,2,3]), + None, + ), + ping_rs::send_ping_async(&router, + Duration::from_millis(250), + Arc::new(&[0,1,2,3]), + None, + ), + ); + + let robot = robot.ok().map(|r| r.rtt); + let router = router.ok().map(|r| r.rtt); + + let mut ping = ping_.write().await; + + ping.0 = router; + ping.1 = robot; + + drop(ping); + + sleep_until(start + Duration::from_millis(500)).await; + + } + }); let log_toasts = toast_sender.clone(); tokio::spawn(async move { @@ -134,7 +170,7 @@ fn main() -> Result<()> { println!("launching gui"); let (_conf_sender, conf) = watch::channel(CONFIGS); - gui(gui_data, toasts, executor, conf, storage.clone(), auto_allowed, auto_enabled).unwrap(); + gui(gui_data, toasts, executor, conf, storage.clone(), auto_allowed, auto_enabled, ping.clone()).unwrap(); drop(stream);