knro / indiwebmanager

Web Manager for INDI Server
http://www.indilib.org
GNU Lesser General Public License v2.1
44 stars 35 forks source link

Driver Aliases #26

Open knro opened 6 years ago

knro commented 6 years ago

Right now, the manager can only start drivers after parsing the drivers list. But there is no ability to specify an alias for the driver. For example, suppose I want to create a profile with 2 SBIG cameras: "SBIG FOO" and "SBIG BAR". There is no way to do this now.

So what would the best solution to approach this? Any thoughts? @juanmb @sterne-jaeger would appreciate your input on this!

sterne-jaeger commented 6 years ago

I think we reached the limits of the simple multiple select dropdown for defining a profile. Besides the missing option for adding aliases (or more general: adding new drivers on the fly), there is no option to add or remove single drivers without restarting indiserver.

I would suggest reworking the profile handling to cover both. What about the following:

Does this make sense to you?

knro commented 6 years ago

I think adding a new driver feature would be the same as alias (it is actually the same), so maybe adding that for now would be sufficient. Maybe also enable remote restart of a specific driver since @juanmb added support for that.

I like the idea of separating server from drivers. We can break down the steps into 2 separate ones, but this requires a LOT of rework and time which I don't have unfortunately.

juanmb commented 6 years ago

I would suggest trying Flask-Admin to make a new, more flexible, web interface without adding much code. I have some experience with Flask-Admin in previous projects and it simplifies the frontend code if your design follows a certain schema.

I could make a quick prototype this week to test it out.

knro commented 6 years ago

Ok sounds good, if it remains as simple as the current implementation then fantastic! I created a branch called customdrivers where I added some code for custom drivers but I will work on the rest later tonight. So we could have the ability to start INDI server standalone or for a specific profile, and also the ability to start/stop drivers at will as @sterne-jaeger suggested.

For the time being, I'd like to implement the custom drivers functionality (without a GUI even, just the API necessary to get it works). I already implemented custom drivers in KStars, and this was a long requested feature since many users cannot operate their devices if they have multiples of them (like SBIG).

Of course, users can also copy an exiting XML and edit it manually, but in the next release, it should be very easy to create a custom driver or driver alias without having to hack at the console.

knro commented 6 years ago

@juanmb @sterne-jaeger Ok I think I finished the "necessary" changes are customdrivers branch. Can you please check it out to make sure I didn't ruin anything? A simple test here indicated all is good.

sterne-jaeger commented 6 years ago

I made a quick check, looks good.

knro commented 6 years ago

Ok thanks, I merged into master now. Hopefully we don't have any issues.

knro commented 6 years ago

@juanmb Can you please update the package for pip?

juanmb commented 6 years ago

OK, I uploaded the new version to PyPI. I sent you a PR also. I made a quick test and it seems to work OK.

juanmb commented 6 years ago

@knro @sterne-jaeger Still working on it!

captura de pantalla de 2018-08-03 16-57-01

knro commented 4 years ago

@juanmb It's been a while. What's the update on this?

juanmb commented 4 years ago

I started working on other projects and I almost forgot about this!

I just uploaded the current status of this project to a new repository: https://github.com/juanmb/indi-admin. I would like to continue working on this code, but I'm not sure I can find the time for it :(

pchev commented 4 years ago

One of my user get the problem when trying to use a SBIG ST-I camera. Even there is a "SBIG ST-I" entry in indi_sbig.xml the driver is started with the default name "SBIG CCD" making some confusion and preventing to use it along with another SBIG CCD.

May I suggest that the following is added to the start command in indi_server.py at line 37 so at least the name defined in drivers.xml is taken into account: ' -n "%s"' % driver.label