@@ -1005,12 +1005,6 @@ def getCcdGain(self):
10051005 'indi_qhy_ccd' ,
10061006 'indi_simulator_ccd' ,
10071007 'indi_rpicam' ,
1008- 'indi_pylibcamera' ,
1009- 'indi_pylibcamera.py' ,
1010- './indi_pylibcamera.py' ,
1011- '././indi_pylibcamera.py' ,
1012- '/usr/bin/indi_pylibcamera' ,
1013- '/usr/local/bin/indi_pylibcamera' ,
10141008 ]:
10151009 gain_ctl = self .get_control (self .ccd_device , 'CCD_GAIN' , 'number' )
10161010 gain_index_dict = self .__map_indexes (gain_ctl , ['GAIN' ])
@@ -1074,6 +1068,12 @@ def getCcdGain(self):
10741068 return fake_gain_info
10751069 elif indi_exec in ['rpicam-still' , 'libcamera-still' , 'indi_fake_ccd' ]:
10761070 return self .ccd_device .getCcdGain ()
1071+ elif 'indi_pylibcamera' in indi_exec : # SPECIAL CASE
1072+ # the exec name can have many variations
1073+ gain_ctl = self .get_control (self .ccd_device , 'CCD_GAIN' , 'number' )
1074+ gain_index_dict = self .__map_indexes (gain_ctl , ['GAIN' ])
1075+ index = gain_index_dict ['GAIN' ]
1076+
10771077 else :
10781078 raise Exception ('Gain config not implemented for {0:s}, open an enhancement request' .format (indi_exec ))
10791079
@@ -1111,12 +1111,6 @@ def setCcdGain(self, gain_value):
11111111 'indi_qhy_ccd' ,
11121112 'indi_simulator_ccd' ,
11131113 'indi_rpicam' ,
1114- 'indi_pylibcamera' ,
1115- 'indi_pylibcamera.py' ,
1116- './indi_pylibcamera.py' ,
1117- '././indi_pylibcamera.py' ,
1118- '/usr/bin/indi_pylibcamera' ,
1119- '/usr/local/bin/indi_pylibcamera' ,
11201114 ]:
11211115 gain_config = {
11221116 "PROPERTIES" : {
@@ -1183,6 +1177,15 @@ def setCcdGain(self, gain_value):
11831177 gain_config = {}
11841178 elif indi_exec in ['rpicam-still' , 'libcamera-still' , 'indi_fake_ccd' ]:
11851179 return self .ccd_device .setCcdGain (gain_value )
1180+ elif 'indi_pylibcamera' in indi_exec : # SPECIAL CASE
1181+ # the exec name can have many variations
1182+ gain_config = {
1183+ "PROPERTIES" : {
1184+ "CCD_GAIN" : {
1185+ "GAIN" : gain_value ,
1186+ },
1187+ },
1188+ }
11861189 else :
11871190 raise Exception ('Gain config not implemented for {0:s}, open an enhancement request' .format (indi_exec ))
11881191
@@ -1220,12 +1223,6 @@ def setCcdBinning(self, bin_value):
12201223 'indi_rpicam' ,
12211224 'indi_playerone_ccd' ,
12221225 'indi_sx_ccd' ,
1223- 'indi_pylibcamera' ,
1224- 'indi_pylibcamera.py' ,
1225- './indi_pylibcamera.py' ,
1226- '././indi_pylibcamera.py' ,
1227- '/usr/bin/indi_pylibcamera' ,
1228- '/usr/local/bin/indi_pylibcamera' ,
12291226 ]:
12301227 binning_config = {
12311228 "PROPERTIES" : {
@@ -1252,6 +1249,16 @@ def setCcdBinning(self, bin_value):
12521249 return
12531250 elif indi_exec in ['rpicam-still' , 'libcamera-still' , 'indi_fake_ccd' ]:
12541251 return self .ccd_device .setCcdBinMode (bin_value )
1252+ elif 'indi_pylibcamera' in indi_exec : # SPECIAL CASE
1253+ # the exec name can have many variations
1254+ binning_config = {
1255+ "PROPERTIES" : {
1256+ "CCD_BINNING" : {
1257+ "HOR_BIN" : bin_value [0 ],
1258+ "VER_BIN" : bin_value [1 ],
1259+ },
1260+ },
1261+ }
12551262 else :
12561263 raise Exception ('Binning config not implemented for {0:s}, open an enhancement request' .format (indi_exec ))
12571264
0 commit comments