Example #1
0
    def __init__(self):
        super(CCDSimulator, self).__init__()
        #PyIndiDriver.PyCCD.__init__(self)
        #self.RA=0.0
        self.name = 'PyCCD Simulator'
        self.AbortGuideFrame = False
        self.AbortPrimaryFrame = False
        self.ShowStarField = True
        self.timefactor = 1.0
        self.InExposure = False
        self.ExposureRequest = 1.0
        # CCD Capability is nested structure in C++ class: capability not supported by swig
        self.cap = PyIndiDriver.CCDCapability()
        self.cap.canAbort = True
        self.cap.canBin = True
        self.cap.canSubFrame = True
        self.cap.hasCooler = False
        self.cap.hasGuideHead = True
        self.cap.hasShutter = True
        self.cap.hasST4Port = True
        # no way: capability is private, SetCapability is protected (can not extend for Python)
        #self.setCCDCapability(self.cap)
        #self.SetCapability(self.cap)

        # it is unuseful to keep these objetcs as they are not synchronized with C++ real data
        self.SimulatorSettingsNV = PyIndi.INumberVectorProperty()
        self.SimulatorSettingsN = [PyIndi.INumber() for x in range(13)]
        self.TimeFactorSV = PyIndi.ISwitchVectorProperty()
        self.TimeFactorS = [PyIndi.ISwitch() for x in range(3)]
        self.logger = logging.getLogger('PyIndiDriver.CCD')
        self.logger.info('creating an instance of PyIndiDriver.CCD')
Example #2
0
 def data(self, column):
     if (column == 0):
         return self._name
     if (column == 2):
         s=''
         s=s.zfill(PyIndi.numberFormat(s, self.inumber.format, self.inumber.value))
         PyIndi.numberFormat(s, self.inumber.format, self.inumber.value)
         return s
Example #3
0
 def data(self, column):
     if (column == 0):
         return self._name
     if (column == 2):
         s = ''
         s = s.zfill(
             PyIndi.numberFormat(s, self.inumber.format,
                                 self.inumber.value))
         PyIndi.numberFormat(s, self.inumber.format, self.inumber.value)
         return s
Example #4
0
 def setValue(self, value, column):
      if column==2:
     #    self.itext.text=str(value)
           indiproperty=self.parent().property
           propertyname=indiproperty.indiproperty.getName()
           device=indiproperty.device
           server=device.server
           nbstr=value.toPyObject()
           numval=0.0
           (r, numval)=PyIndi.f_scansexa(nbstr)
           if (r == -1):
                print("Enter a numeric/sexagesimal value")
                return False
           server.indiclient.sendNewNumber(str(device.device.getDeviceName()), propertyname, self.inumber.name, numval)
           return True
      return False
Example #5
0
 def setValue(self, value, column):
     if column == 2:
         #    self.itext.text=str(value)
         indiproperty = self.parent().property
         propertyname = indiproperty.indiproperty.getName()
         device = indiproperty.device
         server = device.server
         nbstr = value.toPyObject()
         numval = 0.0
         (r, numval) = PyIndi.f_scansexa(nbstr)
         if (r == -1):
             print("Enter a numeric/sexagesimal value")
             return False
         server.indiclient.sendNewNumber(str(device.device.getDeviceName()),
                                         propertyname, self.inumber.name,
                                         numval)
         return True
     return False