Compare commits

...

6 Commits

Author SHA1 Message Date
alban 481472d592 Merge branch 'feature/dac-trait' 2023-06-08 21:30:26 +02:00
Marc Planard d9b96f6090 fix draw loop 2023-06-08 21:06:33 +02:00
alban 560b3be71b fix: rename settings.toml 2023-06-08 20:22:36 +02:00
alban 6e97b1c441 fix: rename settings template 2023-06-08 20:21:51 +02:00
alban 50e9b43b71 Merge branch 'dev/marc' into feature/dac-trait 2023-06-08 20:20:42 +02:00
alban 4b135ce283 fix: rework device 2023-06-08 20:18:28 +02:00
5 changed files with 8 additions and 6 deletions

2
.gitignore vendored
View File

@ -1,6 +1,6 @@
# Configuration file
Settings.*
settings.*
# Generated by Cargo
# will have compiled files and executables

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

@ -109,6 +109,6 @@ fn get_next_frame(
line = transformer.apply(&line);
}
info!("Line: {:?}", line);
//info!("Line: {:?}", line);
Ok(line)
}