当前位置: 首页>>代码示例>>Python>>正文


Python Dispatch.openCover方法代码示例

本文整理汇总了Python中win32com.client.Dispatch.openCover方法的典型用法代码示例。如果您正苦于以下问题:Python Dispatch.openCover方法的具体用法?Python Dispatch.openCover怎么用?Python Dispatch.openCover使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在win32com.client.Dispatch的用法示例。


在下文中一共展示了Dispatch.openCover方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: ASCOMTelescope

# 需要导入模块: from win32com.client import Dispatch [as 别名]
# 或者: from win32com.client.Dispatch import openCover [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
开发者ID:astroufsc,项目名称:chimera-ascom,代码行数:104,代码来源:ascomtelescope.py


注:本文中的win32com.client.Dispatch.openCover方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。