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


Python Dispatch.Connected方法代码示例

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


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

示例1: Dispatch

# 需要导入模块: from win32com.client import Dispatch [as 别名]
# 或者: from win32com.client.Dispatch import Connected [as 别名]
# Methods from:
# http://www.ascom-standards.org/Help/Developer/html/Methods_T_ASCOM_DriverAccess_Telescope.htm
from win32com.client import Dispatch
T = Dispatch('ScopeSim.Telescope')
T.Connected = True

#Is the telescope parked?
if T.AtPark:
    print "Telescope Parked, Unparking."
    T.Unpark()
else:
    print "Telescope is not Parked"

#Is the telescope tracking?
if T.Tracking:
    print "Telescope Tracking..."
else:
    print "Telescope is not Tracking. Enabling track."
    if T.CanSetTracking:
        T.Tracking = True

#Find home
T.FindHome()

#Slew it RA, DEC
if T.CanSlew and not T.AtPark and T.Tracking:
    print "Telescope Can Slew"
	RA, dec = (3.0953796295106035, 7.238022260366756e-05)
	print("Slewing to", RA, dec)
	T.SlewToCoordinates(RA, dec)
	print("Slewing to 1 hour east of meridian...")
开发者ID:wschoenell,项目名称:willy_scripts,代码行数:33,代码来源:ascom_test_telescope.py


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