wip
This commit is contained in:
parent
1072ff4660
commit
3588e3f4a2
5 changed files with 171 additions and 87 deletions
31
src/device/common.rs
Normal file
31
src/device/common.rs
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
|
||||
/*
|
||||
self.protocol_version,
|
||||
self.le_state,
|
||||
self.playback_state,
|
||||
self.source,
|
||||
self.le_flags,
|
||||
self.playback_flags,
|
||||
self.source_flags,
|
||||
self.fullness,
|
||||
self.point_rate,
|
||||
self.point_count
|
||||
*/
|
||||
|
||||
pub struct Status {
|
||||
pub active: bool,
|
||||
pub last_traced_at: String,
|
||||
pub properties: Vec<String>
|
||||
}
|
||||
|
||||
pub trait Device {
|
||||
/**
|
||||
fn intersect(&self, orig : &Vec3, dir : &Vec3) -> Option<Float>;
|
||||
fn get_surface(&self, v : &Vec3) -> Vec3;
|
||||
fn get_normal(&self, v : &Vec3) -> Vec3;
|
||||
fn get_material(&self) -> &dyn Material;
|
||||
**/
|
||||
|
||||
fn status( &self ) -> Status;
|
||||
|
||||
}
|
||||
36
src/device/helios.rs
Normal file
36
src/device/helios.rs
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
///
|
||||
/// Configure udev:
|
||||
/// https://github.com/Grix/helios_dac/blob/master/docs/udev_rules_for_linux.md
|
||||
///
|
||||
use helios_dac::NativeHeliosDacController;
|
||||
use helios_dac::{
|
||||
// Coordinate,
|
||||
Color,
|
||||
DeviceStatus,
|
||||
Frame,
|
||||
Point,
|
||||
};
|
||||
use crate::conf::HeliosConf;
|
||||
use crate::device::common::{Device, Status};
|
||||
|
||||
pub struct HeliosDevice {
|
||||
pub conf: HeliosConf,
|
||||
}
|
||||
|
||||
impl HeliosDevice {
|
||||
|
||||
pub fn new ( conf: HeliosConf) -> Self{
|
||||
Self{ conf }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
impl Device for HeliosDevice {
|
||||
fn status(&self) -> Status {
|
||||
return Status {
|
||||
active: true,
|
||||
last_traced_at: "now".to_string(),
|
||||
properties: vec!["foo".to_string()],
|
||||
};
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue