desktop/src-tauri/src/picker/config/display_config.rs

34 lines
967 B
Rust

use serde::{Deserialize, Serialize};
#[derive(Clone, Copy, Serialize, Deserialize, Debug)]
pub struct LedStripConfig {
pub index: usize,
pub global_start_position: usize,
pub global_end_position: usize,
}
#[derive(Clone, Copy, Serialize, Deserialize, Debug)]
pub struct DisplayConfig {
pub index_of_display: usize,
pub display_width: usize,
pub display_height: usize,
pub top_led_strip: Option<LedStripConfig>,
pub bottom_led_strip: Option<LedStripConfig>,
pub left_led_strip: Option<LedStripConfig>,
pub right_led_strip: Option<LedStripConfig>,
}
impl DisplayConfig {
pub fn default(index_of_display: usize, display_width: usize, display_height: usize) -> Self {
Self {
index_of_display,
display_width,
display_height,
top_led_strip: None,
bottom_led_strip: None,
left_led_strip: None,
right_led_strip: None,
}
}
}