Lagreeni wrote: Hi,
I imported the IndiClient class from the script to my GUI and am trying to call newProperty, but I hit an issue with the arguments. I don't know how to call the functions ie: newProperty(self, p) because of the "p", property, parameter. I'm not very well versed with Python, so I imagine I'm missing something very obvious, but its doing a dang good job of eluding me. I'm not even sure if just calling the function newProperty or even nd18 would work.
class IndiClient(PyIndi.BaseClient): def __init__(self): super(IndiClient, self).__init__() self.dwheel = None def newDevice(self, d): pass #connecting the filter wheel via a basic client def newProperty(self, p): if p.getName() == "FILTER_SLOT": self.dwheel = p # you shoul define all other virtual functions and I would suggest also def removeProperty(self, p): if p.getName() == "FILTER_SLOT": self.dwheel = None def nd18(self): if self.dwheel: slot=self.dwheel.getNumber("FILTER_SLOT") slot.value=1 self.sendNewNumber(slot)
As the Indiclient has its own thread, calling indi client from the gui should be ok, but calling the gui from the client (refreshing a value for instance) won't work without some sort of synchronization (queue, or use a Qthread for the indi client if you're in Qt).
tltr: How do you connect a GUI to a PyIndi client? Can you call one of the PyIndi functions such as newProperty(self, p) and if so, how?
Lagreeni wrote: Hi Oleg,
This might be a really silly question, but on the gtkindiclient source (DCD-0.13 device control device) you linked to, I can't figure out where to actually download the module gtkindiclient.
cd dcd ./dcd.py