Merge branch 'dev/marc'

This commit is contained in:
Marc Planard 2023-06-08 22:38:48 +02:00
commit f61c36e897
6 changed files with 39 additions and 17 deletions

View file

@ -29,7 +29,7 @@ pub struct Status {
pub trait Device {
fn status( &self ) -> Status;
fn draw(
&self,
&mut self,
frame: Vec<Point>,
speed: u32,
) -> LJResult<()> ;

View file

@ -42,14 +42,16 @@ impl Device for HeliosDevice {
}
}
fn draw(&self,
fn draw(&mut self,
line: Vec<Point>,
speed: u32,
) -> LJResult<()> {
while let Ok(DeviceStatus::NotReady) = self.dac.status() {}
while let Ok(DeviceStatus::NotReady) = self.dac.status() {
}
let points: Vec<helios_dac::Point> = line.into_iter().map(|p| p.into()).collect();
let _frame = Frame::new(speed, points);
let frame = Frame::new(speed, points);
self.dac.write_frame(frame.clone())?;
Ok(())
}

View file

@ -72,9 +72,8 @@ fn run_all() -> LJResult<()> {
let frame = get_next_frame(&config, &transformers,
&mut rs, order == Order::Black)?;
// For now, draw all the time
tracer.draw(frame, 1000)?;
tracer.draw(frame, 10_000)?;
}
info!("Exiting, stoping device.");
@ -109,6 +108,6 @@ fn get_next_frame(
line = transformer.apply(&line);
}
info!("Line: {:?}", line);
//info!("Line: {:?}", line);
Ok(line)
}