From 6ba1324af6fcaf7e239605d04a93a616322d30df Mon Sep 17 00:00:00 2001 From: iximeow Date: Sun, 16 Aug 2020 18:30:20 -0700 Subject: very janky live view thing --- src/qhyccd/mod.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/qhyccd') 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 { -- cgit v1.1