Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help
Special pages
SBGrid Resources
SBGrid Consortium
SBGrid Data Bank
Software Webinars
PyMOL Webinar
PyMOL Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
RUCAP UM-5
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Getting UM-5 data of the users position into socket by your script rucap.py == This device has got only OS Windows support on current time. First, you need runing PyMol with [https://code.google.com/p/immersive-viz/source/browse/trunk/MolViz.py MolViz.py]. And optional with [https://code.google.com/p/immersive-viz/source/browse/trunk/MolVizGeneratedGui.py MolVizGui.py], that make fine settings of interface RUCAP (That is [https://code.google.com/p/immersive-viz/wiki/UserManual UserManual] for GUI). Any model is good, but for example, [https://code.google.com/p/immersive-viz/source/browse/trunk/1jnx.pdb 1jnx.pdb] you will take from the same [https://code.google.com/p/immersive-viz/source/browse/trunk/ repo]. ./pymol -l MolViz.py 1jnx.pdb | python MolVizGui.py MolViz.py runing the [https://code.google.com/p/immersive-viz/source/browse/trunk/SocketServer.py SocketServer.py]. For convert data to MolViz format you need run next socket script client '''rucap.py''': <source lang="python"> # -*- coding: cp1251 # rucup.py - wraper for RUCAP driver (rucap.dll - http://rucap.ru/um5/support#sdk) # need code from https://code.google.com/p/immersive-viz/source/browse/trunk/ # Take data from UM-5 and put to the socket on port 4440. #----- The server used to listen for head tracking # self.server = Server(self, 4440) #----- The server used to listen for the GUI to update the values / display info # self.gui = Server(self, 4441) # from ctypes import * import socket HOST = "localhost" # remote host-computer (localhost) PORT = 4440 # port on remote host RUCAP_VERSION = 3 RUCAP_RESULT_OK = 0; RUCAP_RESULT_FAIL = 1; RUCAP_RESULT_TRACKERAPP_OFF = 2; RUCAP_RESULT_UNPLUGGED = 3; RUCAP_RESULT_DEVICE_NOT_CREATED = 4; RUCAP_RESULT_BAD_VERSION = 5; # load dll a = CDLL("rucap.dll") # call function, that returned int a.RucapCreateDevice.restype = c_int print "RucapCreateDevice:" print a.RucapCreateDevice(c_int(RUCAP_VERSION)) # initialisation of device if (a.RucapCreateDevice(c_int(RUCAP_VERSION)) == RUCAP_RESULT_OK): print "Can`t create ruCap device\n" a.RucapGetHeadPos.restype = c_int x = c_float(0.0) y = c_float(0.0) z = c_float(0.0) sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.connect((HOST, PORT)) # main loop while (1) : if a.RucapGetHeadPos(byref(x),byref(y),byref(z)): print "No Position!" else : #print '%f %f %f\n' % ( x.value, y.value, z.value) print x.value, y.value, z.value sock.send('X%.15f;Y%.15f;Z%.15f;\n' % ( x.value, y.value, z.value)) #result = sock.recv(1024) #print "Recive:", result sock.close() </source>
Summary:
Please note that all contributions to PyMOL Wiki are considered to be released under the GNU Free Documentation License 1.2 (see
PyMOL Wiki:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
RUCAP UM-5
(section)
Add topic