From 144854e4b1a7ac38c5ddd2b0d45c495f491aa5dc Mon Sep 17 00:00:00 2001 From: Andy Wortman Date: Sat, 27 Jul 2019 20:07:05 -0700 Subject: significant rewrite for threaded qhy operation --- src/qhyccd/QHYCCDCam.rs | 70 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 69 insertions(+), 1 deletion(-) (limited to 'src/qhyccd/QHYCCDCam.rs') diff --git a/src/qhyccd/QHYCCDCam.rs b/src/qhyccd/QHYCCDCam.rs index c0a0775..2f6b4fb 100644 --- a/src/qhyccd/QHYCCDCam.rs +++ b/src/qhyccd/QHYCCDCam.rs @@ -24,7 +24,7 @@ impl From for QHYResult { } #[repr(u32)] -#[derive(Copy, Clone, Debug)] +#[derive(Copy, Clone, Debug, PartialEq, Eq)] pub enum Control { Brightness = 0, // !< image brightness Contrast = 1, //1 image contrast @@ -84,6 +84,74 @@ pub enum Control { OutputDataAlignment = 55 //55 } +impl Control { + pub fn requires_reset(&self) -> bool { + match self { + Control::Brightness + | Control::Contrast + | Control::CONTROL_WBR + | Control::CONTROL_WBB + | Control::CONTROL_WBG + | Control::Gamma + | Control::Gain + | Control::Offset + | Control::Exposure + | Control::Speed + | Control::TransferBit + | Control::Channels + | Control::Bin1x1Mode + | Control::Bin2x2Mode + | Control::Bin3x3Mode + | Control::Bin4x4Mode + | Control::USBTraffic => { + true + } + | Control::CurTemp + | Control::CurPWM + | Control::ManulPwm + | Control::CFWPort + | Control::Cooler + | Control::St4port + | Control::Color + | Control::CAM_MECHANICALSHUTTER + | Control::CAM_TRIGER_INTERFACE + | Control::CAM_TECOVERPROTECT_INTERFACE + | Control::CAM_SINGNALCLAMP_INTERFACE + | Control::CAM_FINETONE_INTERFACE + | Control::CAM_SHUTTERMOTORHEATING_INTERFACE + | Control::CAM_CALIBRATEFPN_INTERFACE + | Control::CAM_CHIPTEMPERATURESENSOR_INTERFACE + | Control::CAM_USBREADOUTSLOWEST_INTERFACE + | Control::CAM_8BITS + | Control::CAM_16BITS + | Control::CAM_GPS + | Control::CAM_IGNOREOVERSCAN_INTERFACE + | Control::QHYCCD_3A_AUTOBALANCE + | Control::QHYCCD_3A_AUTOEXPOSURE + | Control::QHYCCD_3A_AUTOFOCUS + | Control::CONTROL_AMPV + | Control::CONTROL_VCAM + | Control::CAM_VIEW_MODE + | Control::CONTROL_CFWSLOTSNUM + | Control::IS_EXPOSING_DONE + | Control::ScreenStretchB + | Control::ScreenStretchW + | Control::CONTROL_DDR + | Control::CAM_LIGHT_PERFORMANCE_MODE + | Control::CAM_QHY5II_GUIDE_MODE + | Control::DDR_BUFFER_CAPACITY + | Control::DDR_BUFFER_READ_THRESHOLD + | Control::DefaultOffset + | Control::OutputDataActualBits + | Control::OutputDataAlignment => { + false + } + _ => { false } + } + } +} + + #[repr(u32)] #[derive(Copy, Clone, Debug)] pub enum Bayer -- cgit v1.1