astroufsc / chimera

Chimera - Observatory Automation System
http://chimera.sf.net/
GNU General Public License v2.0
36 stars 18 forks source link

Adds `features` method to check if an instrument or controller features an interface or not #134

Closed wschoenell closed 8 years ago

wschoenell commented 8 years ago

As discussed on #124, I introduce a features method on ChimeraObject to check if the object is an instance of another object. That way, one can check if an instrument supports a part of the interface or not by doing, for example:

from chimera.core.manager import Manager
from chimera.interfaces.dome import DomeFlap, DomeLights

m = Manager()

dome = m.getProxy('127.0.0.1:7666/Dome/0')
print 'Flap', dome.features(DomeFlap)
print 'Lights', dome.features(DomeLights)
tribeiro commented 8 years ago

:star: x5

phsilva commented 8 years ago

very nice indeed.