API
libqhy.py
Go to the documentation of this file.
1 # Descended from code in https://github.com/JiangXL/qhyccd-python (GPLv3)
2 # authored by H.F <moyuejian@outlook.com>
3 import ctypes
4 
5 """
6 @brief CONTROL_ID enum define
7 
8 List of function could be control
9 """
10 class CONTROL_ID:
11  CONTROL_BRIGHTNESS = ctypes.c_short(0) # image brightness
12  CONTROL_CONTRAST = ctypes.c_short(1) # image contrast
13  CONTROL_WBR = ctypes.c_short(2) # red of white balance
14  CONTROL_WBB = ctypes.c_short(3) # blue of white balance
15  CONTROL_WBG = ctypes.c_short(4) # the green of white balance
16  CONTROL_GAMMA = ctypes.c_short(5) # screen gamma
17  CONTROL_GAIN = ctypes.c_short(6) # camera gain
18  CONTROL_OFFSET = ctypes.c_short(7) # camera offset
19  CONTROL_EXPOSURE = ctypes.c_short(8) # expose time (us)
20  CONTROL_SPEED = ctypes.c_short(9) # transfer speed
21  CONTROL_TRANSFERBIT = ctypes.c_short(10) # image depth bits
22  CONTROL_CHANNELS = ctypes.c_short(11) # image channels
23  CONTROL_USBTRAFFIC = ctypes.c_short(12) # hblank
24  CONTROL_ROWNOISERE = ctypes.c_short(13) # row denoise
25  CONTROL_CURTEMP = ctypes.c_short(14) # current cmos or ccd temprature
26  CONTROL_CURPWM = ctypes.c_short(15) # current cool pwm
27  CONTROL_MANULPWM = ctypes.c_short(16) # set the cool pwm
28  CONTROL_CFWPORT = ctypes.c_short(17) # control camera color filter wheel port
29  CONTROL_COOLER = ctypes.c_short(18) # check if camera has cooler
30  CONTROL_ST4PORT = ctypes.c_short(19) # check if camera has st4port
31  CAM_COLOR = ctypes.c_short(20)
32  CAM_BIN1X1MODE = ctypes.c_short(21) # check if camera has bin1x1 mode
33  CAM_BIN2X2MODE = ctypes.c_short(22) # check if camera has bin2x2 mode
34  CAM_BIN3X3MODE = ctypes.c_short(23) # check if camera has bin3x3 mode
35  CAM_BIN4X4MODE = ctypes.c_short(24) # check if camera has bin4x4 mode
36  CAM_MECHANICALSHUTTER = ctypes.c_short(25)# mechanical shutter
37  CAM_TRIGER_INTERFACE = ctypes.c_short(26) # triger
38  CAM_TECOVERPROTECT_INTERFACE = ctypes.c_short(27) # tec overprotect
39  CAM_SINGNALCLAMP_INTERFACE = ctypes.c_short(28) # singnal clamp
40  CAM_FINETONE_INTERFACE = ctypes.c_short(29) # fine tone
41  CAM_SHUTTERMOTORHEATING_INTERFACE = ctypes.c_short(30) # shutter motor heating
42  CAM_CALIBRATEFPN_INTERFACE = ctypes.c_short(31) # calibrated frame
43  CAM_CHIPTEMPERATURESENSOR_INTERFACE = ctypes.c_short(32)# chip temperaure sensor
44  CAM_USBREADOUTSLOWEST_INTERFACE = ctypes.c_short(33) # usb readout slowest
45 
46  CAM_8BITS = ctypes.c_short(34) # 8bit depth
47  CAM_16BITS = ctypes.c_short(35) # 16bit depth
48  CAM_GPS = ctypes.c_short(36) # check if camera has gps
49 
50  CAM_IGNOREOVERSCAN_INTERFACE = ctypes.c_short(37) # ignore overscan area
51 
52  QHYCCD_3A_AUTOBALANCE = ctypes.c_short(38)
53  QHYCCD_3A_AUTOEXPOSURE = ctypes.c_short(39)
54  QHYCCD_3A_AUTOFOCUS = ctypes.c_short(40)
55  CONTROL_AMPV = ctypes.c_short(41) # ccd or cmos ampv
56  CONTROL_VCAM = ctypes.c_short(42) # Virtual Camera on off
57  CAM_VIEW_MODE = ctypes.c_short(43)
58 
59  CONTROL_CFWSLOTSNUM = ctypes.c_short(44) # check CFW slots number
60  IS_EXPOSING_DONE = ctypes.c_short(45)
61  ScreenStretchB = ctypes.c_short(46)
62  ScreenStretchW = ctypes.c_short(47)
63  CONTROL_DDR = ctypes.c_short(48)
64  CAM_LIGHT_PERFORMANCE_MODE = ctypes.c_short(49)
65 
66  CAM_QHY5II_GUIDE_MODE = ctypes.c_short(50)
67  DDR_BUFFER_CAPACITY = ctypes.c_short(51)
68  DDR_BUFFER_READ_THRESHOLD = ctypes.c_short(52)
69  DefaultGain = ctypes.c_short(53)
70  DefaultOffset = ctypes.c_short(54)
71  OutputDataActualBits = ctypes.c_short(55)
72  OutputDataAlignment = ctypes.c_short(56)
73 
74  CAM_SINGLEFRAMEMODE = ctypes.c_short(57)
75  CAM_LIVEVIDEOMODE = ctypes.c_short(58)
76  CAM_IS_COLOR = ctypes.c_short(59)
77  hasHardwareFrameCounter = ctypes.c_short(60)
78  CONTROL_MAX_ID = ctypes.c_short(71)
79  CAM_HUMIDITY = ctypes.c_short(72)
80  #check if camera has humidity sensor
81 
82 class ERR:
83  QHYCCD_READ_DIRECTLY = 0x2001
84  QHYCCD_DELAY_200MS = 0x2000
85  QHYCCD_SUCCESS = 0
86  QHYCCD_ERROR = 0xFFFFFFFF
87