def __init__(self, ): super().__init__() self.client = indiBase.Client('astro-comp.fritz.box') self.client2 = indiBase.Client('astro-comp.fritz.box') self.expose = None self.ccdDevice = None self.initUI() self.runTest()
def test_getPort_not_ok1(): test = indiBase.Client() assert 0 == test.getPort()
def test_getHost_not_ok1(): test = indiBase.Client() assert '' == test.getHost()
# (c) 2018 # # Licence APL2.0 # ########################################################### # standard libraries from unittest import mock # external packages import PyQt5 from PyQt5.QtTest import QTest # local import from indibase import indiBase from indibase import indiXML app = PyQt5.QtWidgets.QApplication([]) test = indiBase.Client() testServer = 'localhost' # # # testing main # # def test_setServer1(): test.setServer() assert ('', 7624) == test.host def test_setServer2():
return number = self.ccdDevice.getNumber('CCD_EXPOSURE') print('Exposing for {0:3.5f} seconds'.format( number['CCD_EXPOSURE_VALUE'])) def getBlob(self, deviceName, deviceProperty): print('got blob ') if deviceName == 'CCD Simulator': blob = self.ccdDevice.getBlob(propertyName=deviceProperty) if blob['format'] == '.fits': value = blob['value'] elif blob['format'] == '.fi': value = zlib.decompress(blob['value']) else: print('format not known') return imageHDU = fits.HDUList.fromstring(value) imageHDU.writeto(self.imagePath, overwrite=True) def quit(self): self.client.disconnectServer() self.close() PyQt5.QtWidgets.QApplication.instance().quit() app = PyQt5.QtWidgets.QApplication(sys.argv) client = indiBase.Client('astro-mount.fritz.box') widget = IndiPythonBase(client) rc = app.exec_() sys.exit(rc)
def showExposure(self, deviceName, deviceProperty): if deviceName != 'CCD Simulator': return if deviceProperty != 'CCD_EXPOSURE': return ccdDevice = self.client.getDevice('CCD Simulator') number = ccdDevice.getNumber('CCD_EXPOSURE') print('Exposing for {0:3.1f} seconds'.format( number['CCD_EXPOSURE_VALUE'])) def showCoordinates(self, deviceName, deviceProperty): if deviceName != 'Telescope Simulator': return if deviceProperty != 'EQUATORIAL_EOD_COORD': return telDevice = self.client.getDevice('Telescope Simulator') number = telDevice.getNumber('EQUATORIAL_EOD_COORD') text = 'RA:{0:3.5f}, DEC:{1:3.5f}'.format(number['RA'], number['DEC']) self.coord.setText(text) def quit(self): self.close() PyQt5.QtWidgets.QApplication.instance().quit() app = PyQt5.QtWidgets.QApplication(sys.argv) client = indiBase.Client('192.168.2.57') widget = IndiPythonBase(client) rc = app.exec_() sys.exit(rc)