Using PyIndi client with a simple GUI

  • Posts: 10
  • Thank you received: 0
Hi,
I've been having a lot of issues creating a client for multiple devices, a filter wheel and camera. When following the PyIndi client tutorials, I'm not able to change a device property by choice. I'm now trying to control the devices through a simple button GUI to provide an interface to change a set of properties by choice. For example, I have one simple GUI with 2 buttons, one to change the filter wheel to slot 1 and the other to change it to slot 2. Going into this, I thought that it would be as simple as running a basic client in the background and import another client for the filter wheel where I could call the function newProperty through my GUI. This is the code I have for changing the filter slot (bits of it):

#######################################################
class IndiClient(PyIndi.BaseClient):
dwheel = None
def __init__(self):
super(IndiClient, self).__init__()
def newDevice(self, d):
pass #connecting the filter wheel via a basic client
def newProperty(self, p):
if p.getName() == "FILTER_SLOT":
self.nd18()
......
def nd18(self):
slot=self.dwheel.getNumber("FILTER_SLOT")
slot[0].value=1
self.sendNewNumber(slot)

##############################################################3
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.

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?
6 years 5 months ago #24928

Please Log in or Create an account to join the conversation.

  • Posts: 314
  • Thank you received: 95
Do you know about other INDI clients?
indilib.org/about/clients.html
You can try my open project Astronomy Linux
6 years 5 months ago #24929

Please Log in or Create an account to join the conversation.

  • Posts: 10
  • Thank you received: 0
I do, but I need a customized client. The other INDI clients have a lot of what I don't need. I'm just looking to make a simple interface.
6 years 5 months ago #24932

Please Log in or Create an account to join the conversation.

  • Posts: 314
  • Thank you received: 95
6 years 5 months ago #24933

Please Log in or Create an account to join the conversation.


×

INDI Library v2.0.7 is Released (01 Apr 2024)

Bi-monthly release with minor bug fixes and improvements

  • Posts: 226
  • Thank you received: 88

Rendering Error in layout Message/Item: array_keys(): Argument #1 ($array) must be of type array, null given. Please enable debug mode for more information.

Please Log in or Create an account to join the conversation.

  • Posts: 10
  • Thank you received: 0
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.
6 years 4 months ago #25698

Please Log in or Create an account to join the conversation.

  • Posts: 314
  • Thank you received: 95

Rendering Error in layout Message/Item: array_keys(): Argument #1 ($array) must be of type array, null given. Please enable debug mode for more information.

Please Log in or Create an account to join the conversation.

  • Posts: 10
  • Thank you received: 0
I don't understand though how I can edit the code for the GUI that dcd.py creates to make it my own. How would I go about doing that?
6 years 4 months ago #25745

Please Log in or Create an account to join the conversation.

  • Posts: 314
  • Thank you received: 95
You can write the letter to its author Dirk Hünniger.
You can try my open project Astronomy Linux
6 years 4 months ago #25747

Please Log in or Create an account to join the conversation.

Time to create page: 0.828 seconds