From 253f12566920b73396ab67adf82974634f337858 Mon Sep 17 00:00:00 2001 From: Michael Sippel Date: Sat, 28 Sep 2024 23:11:05 +0200 Subject: [PATCH] termion dependency; clear screen in controller display --- Cargo.toml | 2 ++ src/controller.rs | 1 + src/main.rs | 8 +++----- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 8eb0917..931cc04 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,6 +10,8 @@ cgmath = "*" prisma = "0.1.1" angular-units = "*" jack = "0.11" +termion ="*" +net2 = "*" [dependencies.async-std] version = "1.9.0" diff --git a/src/controller.rs b/src/controller.rs index 2054fa4..6ab2c7e 100644 --- a/src/controller.rs +++ b/src/controller.rs @@ -35,6 +35,7 @@ impl Controller { let inputs = self.inputs.read().unwrap(); let lib = self.library.read().unwrap(); + eprintln!("{}", termion::clear::All); eprintln!("----------"); if inputs.active { diff --git a/src/main.rs b/src/main.rs index 11a3ac4..c60f6fc 100644 --- a/src/main.rs +++ b/src/main.rs @@ -59,7 +59,7 @@ async fn main() { vec![ Fixture::new_matrix(), // .with_driver( Box::new(MatrixTcpDriver::new("ip:port")) ), -/* + Fixture::new_stripe(false) .with_driver( Box::new(StripeDriver::new("192.168.0.114:4210", socket.clone())) ) .offset(Vector2::new(-0.5, 0.0)), @@ -67,7 +67,7 @@ async fn main() { Fixture::new_stripe(true) .with_driver( Box::new(StripeDriver::new("192.168.0.113:4210", socket.clone())) ) .offset(Vector2::new(-0.4, 0.0)), -*/ + Fixture::new_stripe(true) .with_driver( Box::new(StripeDriver::new("192.168.0.112:4210", socket.clone())) ) .offset(Vector2::new(0.4, 0.0)), @@ -133,17 +133,15 @@ async fn main() { if src_addr == "192.168.0.112:4210".parse().expect("parse socketaddr") { lighting_setup.sync_fixture(2); } - /* if src_addr == "192.168.0.113:4210".parse().expect("parse socketaddr") { lighting_setup.sync_fixture(3); } if src_addr == "192.168.0.114:4210".parse().expect("parse socketaddr") { lighting_setup.sync_fixture(4); } - */ } - for i in 1 .. 3 { + for i in 1 ..5 { lighting_setup.update_outputs(i); } }