本文整理汇总了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...")