⚲
Project
General
Profile
Sign in
Register
Home
Projects
Help
Search
:
Leginon
All Projects
Leginon
Overview
Activity
Roadmap
Issues
News
Documents
Wiki
Forums
Files
Download (777 Bytes)
Bug #1166
» gatantest.py
Jim Pulokas
, 01/31/2011 11:41 AM
import
pythoncom
import
pywintypes
import
win32com.client
def
hasScriptFunction
(
cam
,
name
):
script
=
'if(DoesFunctionExist("%s")) Exit(1.0) else Exit(-1.0)'
script
%=
name
result
=
cam
.
ExecuteScript
(
script
)
return
result
>
0.0
script_functions
=
[
'AFGetSlitState'
,
'AFSetSlitState'
,
'AFGetSlitWidth'
,
'AFSetSlitWidth'
,
'AFDoAlignZeroLoss'
,
'IFCGetSlitState'
,
'IFCSetSlitState'
,
'IFCGetSlitWidth'
,
'IFCSetSlitWidth'
,
'IFCDoAlignZeroLoss'
,
]
pythoncom
.
CoInitializeEx
(
pythoncom
.
COINIT_MULTITHREADED
)
camera
=
win32com
.
client
.
dynamic
.
Dispatch
(
'TecnaiCCD.GatanCamera.2'
)
for
name
in
script_functions
:
if
hasScriptFunction
(
camera
,
name
):
print
'SUPPORTED:'
,
name
else
:
print
'UNSUPPORTED:'
,
name
raw_input
(
'enter to quit'
)
« Previous
1
2
3
4
5
Next »
(2-2/5)
Loading...