astroufsc / chimera

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

Update focuser instances for hexapod systems. Fixes #26. #117

Closed tribeiro closed 9 years ago

tribeiro commented 9 years ago

Update focuser interface, instrument and script to accommodate the use of hexapod systems. The configuration is made as a "feature". All get/set functions may receive an additional (optional) parameter selecting the axis. If no parameter is given, considers Z axis. Tested on "FakeFocuser" with no modification and worked so, in principle, no modifications to earlier drivers are required.

tribeiro commented 9 years ago

Done!

phsilva commented 9 years ago

Very nice, just a bunch of PEP8 fixes, spaces missing here and there, would be nice to fi, beside that if pretty nice. Good work.

tribeiro commented 9 years ago

Reformatting done...

wschoenell commented 9 years ago

@tribeiro,

If you change the signature of the base method like you did in the link below, you have to change ALL the methods on top of it. https://github.com/tribeiro/chimera/blob/eca91491a3cc7712a7e00cf6d92bc18793775621/src/chimera/interfaces/focuser.py#L108

Otherwise you will have this problem:

(chimera)Williams-MacBook-Pro:chimera william$ chimera-focus --to 20
Moving Z to 20 ...  Something wrong with 'move_to' action. 
Traceback (most recent call last):
  File "/Users/william/.virtualenvs/chimera/lib/python2.7/site-packages/chimera/core/cli.py", line 740, in _runAction
    method(options)
  File "/Users/william/.virtualenvs/chimera/bin/chimera-focus", line 171, in move_to
    self.focuser.moveTo(options.move_to, options.axis)
  File "/Users/william/.virtualenvs/chimera/lib/python2.7/site-packages/chimera/core/proxy.py", line 112, in __call__
    return self.sender(self.method, args, kwargs)
  File "/Users/william/.virtualenvs/chimera/lib/python2.7/site-packages/Pyro/core.py", line 456, in _invokePYRO
    return self.adapter.remoteInvocation(name, Pyro.constants.RIF_VarargsAndKeywords, vargs, kargs)
  File "/Users/william/.virtualenvs/chimera/lib/python2.7/site-packages/Pyro/protocol.py", line 497, in remoteInvocation
    return self._remoteInvocation(method, flags, *args)
  File "/Users/william/.virtualenvs/chimera/lib/python2.7/site-packages/Pyro/protocol.py", line 572, in _remoteInvocation
    answer.raiseEx()
  File "/Users/william/.virtualenvs/chimera/lib/python2.7/site-packages/Pyro/errors.py", line 72, in raiseEx
    raise self.excObj
TypeError: moveTo() takes exactly 2 arguments (3 given)
 +--- Remote traceback:
 | Traceback (most recent call last):
 |   File "/Users/william/.virtualenvs/chimera/lib/python2.7/site-packages/Pyro/protocol.py", line 759, in _handleInvocation2
 |     res = obj.Pyro_dyncall(req[1],flags,req[3])  # (method,flags,args)
 |   File "/Users/william/.virtualenvs/chimera/lib/python2.7/site-packages/chimera/core/remoteobject.py", line 96, in Pyro_dyncall
 |     return getattr(self, method)(*args, **keywords)
 |   File "/Users/william/.virtualenvs/chimera/lib/python2.7/site-packages/chimera/core/methodwrapper.py", line 112, in __call__
 |     return self.call(self.instance, *args, **kwargs)
 |   File "/Users/william/.virtualenvs/chimera/lib/python2.7/site-packages/chimera/core/lockwrapper.py", line 66, in call
 |     ret = self.func(*args, **kwargs)
 | TypeError: moveTo() takes exactly 2 arguments (3 given)
 +--- End of remote traceback

Please fix this on this PR for the fake and dc focusers and open PRs/issues on all focusers plugins.

tribeiro commented 9 years ago

Ok fixed for the fakefocuser and dcfocuser. Need to broadcast this to other focusers.

tribeiro commented 9 years ago

There was a conflict introduced by @wschoenell here

https://github.com/astroufsc/chimera/blob/master/src/scripts/chimera-focus#L222-L223

Can we merge this already?

wschoenell commented 9 years ago

After closing astroufsc/chimera-ascom#1, astroufsc/chimera-optec#1, astroufsc/chimera-astelco#2 and astroufsc/chimera-jmismart232#1, yes! :-)