本文整理汇总了Python中win32com.client.Dispatch.closeCover方法的典型用法代码示例。如果您正苦于以下问题:Python Dispatch.closeCover方法的具体用法?Python Dispatch.closeCover怎么用?Python Dispatch.closeCover使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类win32com.client.Dispatch
的用法示例。
在下文中一共展示了Dispatch.closeCover方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: ASCOMTelescope
# 需要导入模块: from win32com.client import Dispatch [as 别名]
# 或者: from win32com.client.Dispatch import closeCover [as 别名]
#.........这里部分代码省略.........
def isFanning(self):
return self._isFanning
@com
def startFan(self):
# FIXME: Can be checked by SupportedActions method on ASCOM
if self['ascom_id'] in ['AstrooptikServer.Telescope']:
if self.isFanning():
return True
self._ascom.Action('Telescope:StartFans')
self.log.debug('Starting telescope fans...')
return True
else:
raise NotImplementedError()
@com
def stopFan(self):
# FIXME: Can be checked by SupportedActions method on ASCOM
if self['ascom_id'] in ['AstrooptikServer.Telescope']:
if not self.isFanning():
return True
self.log.debug('Stopping telescope fans...')
self._ascom.Action('Telescope:StopFans')
return True
else:
raise NotImplementedError()
def isOpen(self):
return self._isOpen
def getPierSide(self):
if self._ascom.SideOfPier == -1:
return TelescopePierSide.UNKNOWN
elif self._ascom.SideOfPier == 0:
return TelescopePierSide.EAST
elif self._ascom.SideOfPier == 1:
return TelescopePierSide.WEST
def setPierSide(self, side):
if self['ascom_id'] in ['AstrooptikServer.Telescope']:
if side == TelescopePierSide.WEST:
self.log.debug('Moving telescope to WEST pierside...')
self._ascom.SideOfPier = 0
return True
elif side == TelescopePierSide.EAST:
self.log.debug('Moving telescope to EAST pierside...')
self._ascom.SideOfPier = 1 # can ASA having exchanged values? Pierside=1 <-> AutoSlew=EAST
return True
else:
raise NotImplementedError()
@com
def openCover(self):
# FIXME: Can be checked by SupportedActions method on ASCOM
if self['ascom_id'] in ['AstrooptikServer.Telescope']:
self.log.debug('Opening telescope cover...')
self._ascom.openCover()
return True
else:
raise NotImplementedError()
@com
def closeCover(self):
# FIXME: Can be checked by SupportedActions method on ASCOM
if self['ascom_id'] in ['AstrooptikServer.Telescope']:
self.log.debug('Closing telescope cover...')
self._ascom.closeCover()
return True
else:
raise NotImplementedError()
# @com
# def moveEast(self, offset, slewRate=None):
# self._ascom.Asynchronous = 0
# self._ascom.Jog(offset.AS / 60.0, 'East')
# self._ascom.Asynchronous = 1
#
# @com
# def moveWest(self, offset, slewRate=None):
# self._ascom.Asynchronous = 0
# self._ascom.Jog(offset.AS / 60.0, 'West')
# self._ascom.Asynchronous = 1
#
# @com
# def moveNorth(self, offset, slewRate=None):
# self._ascom.Asynchronous = 0
# self._ascom.Jog(offset.AS / 60.0, 'North')
# self._ascom.Asynchronous = 1
#
# @com
# def moveSouth(self, offset, slewRate=None):
# self._ascom.Asynchronous = 0
# self._ascom.Jog(offset.AS / 60.0, 'South')
# self._ascom.Asynchronous = 1
#
def getMetadata(self, request):
md = super(ASCOMTelescope, self).getMetadata(request)
md.append(('PIERSIDE', self.getPierSide().__str__(), 'Side-of-pier'))
return md