Документ взят из кэша поисковой машины. Адрес оригинального документа : http://www.apo.nmsu.edu/Telescopes/TCC/html/mirror_device_wrapper_8py_source.html
Дата изменения: Tue Sep 15 02:25:37 2015
Дата индексирования: Sun Apr 10 04:39:14 2016
Кодировка:

Поисковые слова: annular solar eclipse
lsst.tcc: python/tcc/mir/mirrorDeviceWrapper.py Source File
lsst.tcc  1.2.2-3-g89ecb63
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
mirrorDeviceWrapper.py
Go to the documentation of this file.
1 from __future__ import division, absolute_import
2 
3 from twistedActor import DeviceWrapper
4 from mirrorCtrl import MirrorCtrlWrapper
5 from mirrorCtrl.fakeGalil import FakeGalil
6 
7 from .mirrorDevice import MirrorDevice
8 
9 __all__ = ["MirrorDeviceWrapper"]
10 
11 class MirrorDeviceWrapper(DeviceWrapper):
12  """!A wrapper for an MirrorDevice talking to a fake mirror controller
13  """
14  def __init__(self,
15  name,
16  mirror,
17  galilClass = FakeGalil,
18  stateCallback = None,
19  port = 0,
20  modelName = "mirror",
21  debug = False,
22  ):
23  """!Construct a MirrorDeviceWrapper that manages its fake mirror controller
24 
25  @param[in] name keyword dictionary name (typically "mirror")
26  @param[in] mirror Mirror object from mirrorCtrl.mirrors
27  @param[in] galilClass fake Galil class; normally FakeGalil.
28  @param[in] stateCallback function to call when connection state of hardware controller or device changes;
29  receives one argument: this device wrapper
30  @param[in] port port on which mirror controller listens
31  @param[in] modelName name of mirror controller keyword dictionary; normally "mirror"
32  @param[in] debug print debug messages to stdout?
33  """
34  self.modelName = modelName
35  controllerWrapper = MirrorCtrlWrapper(
36  mirror=mirror,
37  galilClass = galilClass,
38  )
39  DeviceWrapper.__init__(self, name=name, stateCallback=stateCallback, controllerWrapper=controllerWrapper, debug=debug)
40 
41  def _makeDevice(self):
42  port = self.port
43  if port is None:
44  raise RuntimeError("Controller port is unknown")
45  self.debugMsg("_makeDevice, port=%s" % (port,))
46  self.device = MirrorDevice(
47  name=self.name,
48  host="localhost",
49  port=port,
50  modelName=self.modelName,
51  )
52 
53 
def __init__
Construct a MirrorDeviceWrapper that manages its fake mirror controller.
A wrapper for an MirrorDevice talking to a fake mirror controller.