Merge branch 'feature/dac-trait'
This commit is contained in:
commit
481472d592
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
# Configuration file
|
# Configuration file
|
||||||
Settings.*
|
settings.*
|
||||||
|
|
||||||
# Generated by Cargo
|
# Generated by Cargo
|
||||||
# will have compiled files and executables
|
# will have compiled files and executables
|
||||||
|
@ -29,7 +29,7 @@ pub struct Status {
|
|||||||
pub trait Device {
|
pub trait Device {
|
||||||
fn status( &self ) -> Status;
|
fn status( &self ) -> Status;
|
||||||
fn draw(
|
fn draw(
|
||||||
&self,
|
&mut self,
|
||||||
frame: Vec<Point>,
|
frame: Vec<Point>,
|
||||||
speed: u32,
|
speed: u32,
|
||||||
) -> LJResult<()> ;
|
) -> LJResult<()> ;
|
@ -42,14 +42,16 @@ impl Device for HeliosDevice {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn draw(&self,
|
fn draw(&mut self,
|
||||||
line: Vec<Point>,
|
line: Vec<Point>,
|
||||||
speed: u32,
|
speed: u32,
|
||||||
) -> LJResult<()> {
|
) -> 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 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(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -109,6 +109,6 @@ fn get_next_frame(
|
|||||||
line = transformer.apply(&line);
|
line = transformer.apply(&line);
|
||||||
}
|
}
|
||||||
|
|
||||||
info!("Line: {:?}", line);
|
//info!("Line: {:?}", line);
|
||||||
Ok(line)
|
Ok(line)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user