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.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 {