summaryrefslogtreecommitdiff
path: root/src/qhyccd/QHYCCDCam.rs
diff options
context:
space:
mode:
authorAndy Wortman <ixineeringeverywhere@gmail.com>2019-07-27 20:07:05 -0700
committerAndy Wortman <ixineeringeverywhere@gmail.com>2019-07-27 20:07:05 -0700
commit144854e4b1a7ac38c5ddd2b0d45c495f491aa5dc (patch)
tree55306a36cfe8fef91a38496510acf34a771e582e /src/qhyccd/QHYCCDCam.rs
parent0d887779b8dee042999d04a29d4a095a3df93a6c (diff)
significant rewrite for threaded qhy operation
Diffstat (limited to 'src/qhyccd/QHYCCDCam.rs')
-rw-r--r--src/qhyccd/QHYCCDCam.rs70
1 files changed, 69 insertions, 1 deletions
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<u32> 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