summaryrefslogtreecommitdiff
path: root/src/qhyccd/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/qhyccd/mod.rs')
-rw-r--r--src/qhyccd/mod.rs16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/qhyccd/mod.rs b/src/qhyccd/mod.rs
index 12630d6..becb698 100644
--- a/src/qhyccd/mod.rs
+++ b/src/qhyccd/mod.rs
@@ -20,6 +20,7 @@ use crossbeam_channel::select;
use png::HasParameters;
use crate::Dimensions;
+use crate::Properties;
// unsafe impl Send for Camera { }
#[derive(Debug)]
@@ -222,7 +223,18 @@ pub fn connect(camera_idx: i32) -> Result<(Receiver<QHYResponse>, Sender<QHYMess
let (data, width, height, bpp, channels) = camera.read_frame(data).expect("can read frames from camera");
counter = camera.settings.exposure;
camera.begin_exposure().expect("can begin exposures");
- response_sender.send(QHYResponse::Data(data, Dimensions::new(width, height, bpp, channels))).unwrap();
+ response_sender.send(QHYResponse::Data(
+ data,
+ Dimensions::new(width, height, bpp, channels),
+ Properties {
+ device: "qhy376c",
+ exposure_ms: camera.settings.exposure as u32,
+ gain: camera.settings.gain as u16,
+ offset: camera.settings.offset as u16,
+ gamma: camera.settings.gamma as u16,
+ temp: (camera.settings.cur_temp * 10.0) as u16,
+ },
+ )).unwrap();
} else {
// no frame ready in the buffer! we can't actually read the image...
counter = camera.settings.exposure;
@@ -242,7 +254,7 @@ pub fn connect(camera_idx: i32) -> Result<(Receiver<QHYResponse>, Sender<QHYMess
pub enum QHYResponse {
InitializationError,
- Data(Vec<u8>, Dimensions),
+ Data(Vec<u8>, Dimensions, Properties),
DroppedFrame,
Shutdown,
UpdatedSettings(Settings),