summaryrefslogtreecommitdiff
path: root/src/qhyccd/mod.rs
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2020-08-16 18:30:20 -0700
committeriximeow <me@iximeow.net>2020-08-16 18:30:20 -0700
commit6ba1324af6fcaf7e239605d04a93a616322d30df (patch)
tree8781a923eb9ddc1022ca836b2dc3b6409016c3ab /src/qhyccd/mod.rs
parent1f7084363e7c023e0710818f5b3364c797ef396f (diff)
very janky live view thing
Diffstat (limited to 'src/qhyccd/mod.rs')
-rw-r--r--src/qhyccd/mod.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/qhyccd/mod.rs b/src/qhyccd/mod.rs
index 72a68b9..618d151 100644
--- a/src/qhyccd/mod.rs
+++ b/src/qhyccd/mod.rs
@@ -79,7 +79,7 @@ impl Settings {
Control::Gain => { self.gain = value as u32; }
Control::Offset => { self.offset = value as u32; }
Control::Exposure => { self.exposure = value as u64; }
- Control::TransferBit => { self.transfer_bit = value as u32; }
+ Control::TransferBit => { self.transfer_bit = value as u32; self.bpp = value as u8; }
Control::Channels => { self.channels = value as u8; }
Control::USBTraffic => { self.usb_traffic = value as u32; }
Control::RowNoiseRe => { self.row_noise_re = value as u32 == 1; }
@@ -381,7 +381,11 @@ impl Camera {
pub fn set_control(&mut self, control: Control, value: f64) -> Result<()> {
unsafe {
if self.has_control(control) {
- check(QHYCCDCam::SetQHYCCDParam(self.handle, control as i32, value))?;
+ if control == Control::TransferBit {
+ check(QHYCCDCam::SetQHYCCDBitsMode(self.handle, value as i32))?;
+ } else {
+ check(QHYCCDCam::SetQHYCCDParam(self.handle, control as i32, value))?;
+ }
self.settings.update_param(control, value);
Ok(())
} else {