Add GA402 anime-matrix packet unit test

This commit is contained in:
Luke D. Jones
2022-07-15 12:52:08 +12:00
parent 37d586c5de
commit 16c4ee609e
7 changed files with 526 additions and 37 deletions

View File

@@ -1,6 +1,6 @@
use std::{env, error::Error, path::Path, process::exit};
use rog_anime::{usb::get_anime_type, AnimeDiagonal};
use rog_anime::{usb::get_anime_type, AnimeDiagonal, AnimeType};
use rog_dbus::RogDbusClientBlocking;
fn main() -> Result<(), Box<dyn Error>> {
@@ -13,8 +13,12 @@ fn main() -> Result<(), Box<dyn Error>> {
exit(-1);
}
let matrix =
AnimeDiagonal::from_png(Path::new(&args[1]), None, args[2].parse::<f32>().unwrap())?;
let matrix = AnimeDiagonal::from_png(
Path::new(&args[1]),
None,
args[2].parse::<f32>().unwrap(),
AnimeType::GA401,
)?;
let anime_type = get_anime_type()?;

View File

@@ -1,6 +1,6 @@
use std::{thread::sleep, time::Duration};
use rog_anime::{usb::get_anime_type, AnimeDiagonal};
use rog_anime::{usb::get_anime_type, AnimeDiagonal, AnimeType};
use rog_dbus::RogDbusClientBlocking;
// In usable data:
@@ -12,7 +12,7 @@ fn main() {
let (client, _) = RogDbusClientBlocking::new().unwrap();
for step in (2..50).rev() {
let mut matrix = AnimeDiagonal::new(None);
let mut matrix = AnimeDiagonal::new(AnimeType::GA401, None);
for c in (0..60).into_iter().step_by(step) {
for i in matrix.get_mut().iter_mut() {
i[c] = 50;