×

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

Bi-monthly release with minor bug fixes and improvements

Hide default INDI properties

  • Posts: 4
  • Thank you received: 0
Hello,
is it safe and possible to delete default properties without modifing the core INDI classes?

For instance, the telescope class defines SerialPort and BaudRate, but my hardware works in another way. I am wondering if it is possible to remove these properties working from the derived class so not to show them to the user.

It seems to me that deleteProperty does not get to the point since the delete properties are still listed...

thanks
7 years 10 months ago #8727

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

It varies from driver from driver, for INDI::Telescope, it's possible to delete the port and baud rate properties in ISGetProperties() of your derived driver.
7 years 10 months ago #8731

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

  • Posts: 4
  • Thank you received: 0
Possibly I still need some help...

In my code I have two ISGetProperties functions that call eachother:
// the first 
void ISGetProperties(const char *dev)
{
    if(dev && strcmp(mydev, dev)) return;
    ISInit();
    mydriverclass->ISGetProperties(dev);
}
 
// and the second
void MyDriverClass::ISGetProperties(const char *dev)
{
    INDI::Telescope::ISGetProperties(dev);
 
    // some unrelated code here
 
    addAuxControls();
}

unfortunately I could not find where to put the following code:
deleteProperty(PortTP.name);
deleteProperty(BaudRateSP.name);

I suppose the second to be the function I should change, but the deleteProperty calls do not work either before or after the call to the INDI::Telescope::ISGetProperties(dev) function. What am I doing wrong?

thanks
7 years 10 months ago #8732

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

  • Posts: 24
  • Thank you received: 6
7 years 10 months ago #8733

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

  • Posts: 4
  • Thank you received: 0
Thanks, but neither this works :(

I also tried inside ::initProperties, both before and after call to INDI::Telescope::initProperties but no result...
The properties remain always visible in interfaces and also with indi_getprop.

Other ideas?

P.S.: I am working with self compiled INDI v 1.2.0 on OpenSUSE
7 years 10 months ago #8734

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

  • Posts: 24
  • Thank you received: 6
Is your code in a repo such as github to look at?

As here is another example: github.com/indilib/indi/blob/master/libi...perfectstar.cpp#L136

Hard to tell what's going on without seeing more context
7 years 10 months ago #8735

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


It should work in the second function AFTER INDI::Telescope::ISGetProperties(dev) since it is that function that defines both properties. I tested it in the simulator driver and the properties are deleted from the client.
7 years 10 months ago #8737

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

  • Posts: 193
  • Thank you received: 46

Which client are you using to determine the property had not been deleted ? I've seen some clients, dont remember offhand which, that dont remove the deleted property from displays when the delete method is invoked.
7 years 10 months ago #8792

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

  • Posts: 4
  • Thank you received: 0
KNRO: I attempted your same test WITHOUT success.
To be sure it does not depend on my installation of the OS or of the INDI library, I repeated the whole job using a Virtual Machine downloaded from osboxes.org.
I used again the openSuse distribution 13.2, upgraded the system, installed the required packages and then a freshly downloaded indilib sources.
I loaded only the indi_simulator_telescope driver into indiserver and tried using DCD to connect (all properties appear) and disconnect (connect properties remain visible and the interface DOES NOT return back to pre-connection situation!).
At this point I also implemented the change in the driver with deleteProperty called into ISGetProperties but, as before, the properties still REMAIN VISIBLE both in DCD and with indi_getprop.
GERRYR: I only tested with these two interfaces.
AJK: in this case there are simply the deleteProperty lines of my own: all the rest is the standard distribution code...
I am going to repeat the same test within an Ubuntu VM just in case...
Last edit: 7 years 10 months ago by Andrea Di Paola.
7 years 10 months ago #8816

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

Time to create page: 0.829 seconds