summaryrefslogtreecommitdiff
path: root/src/qhyccd/mod.rs
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2020-01-06 06:12:51 -0800
committeriximeow <me@iximeow.net>2020-01-06 06:12:51 -0800
commit500d14a308a2f58ea70b4a4e75c5603cd66d629f (patch)
tree9229cc872139f691835a929f8d69520f6d010b89 /src/qhyccd/mod.rs
parentee69c873d02b89a9a6d8b6651636399c73c4ba8c (diff)
qhy mono cameras report channels and debayer unexpectedly
Diffstat (limited to 'src/qhyccd/mod.rs')
-rw-r--r--src/qhyccd/mod.rs12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/qhyccd/mod.rs b/src/qhyccd/mod.rs
index 5300fe1..1f7bcb2 100644
--- a/src/qhyccd/mod.rs
+++ b/src/qhyccd/mod.rs
@@ -395,11 +395,14 @@ impl Camera {
// TODO: handle mono cameras correctly
if mono {
unsafe {
- check(QHYCCDCam::SetQHYCCDDebayerOnOff(self.handle, 0))?;
+ // well, this can fail if debayering just isn't supported. so let's... not
+ QHYCCDCam::SetQHYCCDDebayerOnOff(self.handle, 0);
}
+ /*
self.set_control(Control::CONTROL_WBR, 1000.0)?;
self.set_control(Control::CONTROL_WBG, 1000.0)?;
self.set_control(Control::CONTROL_WBB, 1000.0)?;
+ */
self.settings.channels = 1;
} else {
unsafe {
@@ -420,6 +423,10 @@ impl Camera {
1 | 2 | 3 | 4 => {
self.set_color_mode(false)?;
},
+ 0 => {
+ // no, the color control is not available. mono it is!
+ self.set_color_mode(true)?;
+ }
a @ _ => {
println!("unexpected response when querying color setting: {}", a);
return Err(CameraError::QHYError)
@@ -432,6 +439,9 @@ impl Camera {
self.settings.bpp = 16;
}
println!("roi set to {} x {} ???", imagew, imageh);
+ println!("gain limits: {:?}", self.get_control_limits(Control::Gain)?);
+ println!("exposure limits: {:?}", self.get_control_limits(Control::Exposure)?);
+// panic!("hi");
Ok(())
}
}