annotate light8/dmxclient.py @ 151:990a9474d0e7

early cue stuff. the CueList will supply the CueFader with the cues to early cue stuff. the CueList will supply the CueFader with the cues to work with, and will do crossfading sooner or later. the format of cues is still very open. cuelist1 is a bogus cuelist for testing.
author dmcc
date Sun, 06 Jul 2003 16:33:06 +0000
parents 2dfe2c0ba052
children 79bc84310e80
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
45b12307c695 Initial revision
drewp
parents:
diff changeset
1 """ module for clients to use for easy talking to the dmx
45b12307c695 Initial revision
drewp
parents:
diff changeset
2 server. sending levels is now a simple call to
45b12307c695 Initial revision
drewp
parents:
diff changeset
3 dmxclient.outputlevels(..)
45b12307c695 Initial revision
drewp
parents:
diff changeset
4
45b12307c695 Initial revision
drewp
parents:
diff changeset
5 client id is formed from sys.argv[0] and the PID. """
45b12307c695 Initial revision
drewp
parents:
diff changeset
6
45b12307c695 Initial revision
drewp
parents:
diff changeset
7 import xmlrpclib,os,sys,socket,time
45b12307c695 Initial revision
drewp
parents:
diff changeset
8 _dmx=None
45b12307c695 Initial revision
drewp
parents:
diff changeset
9
45b12307c695 Initial revision
drewp
parents:
diff changeset
10 _id="%s-%s" % (sys.argv[0].replace('.py','').replace('./',''),os.getpid())
45b12307c695 Initial revision
drewp
parents:
diff changeset
11
120
b75bfbcf5979 new modules: dmxclient provides a very convenient way for clients to talk to the
drewp
parents: 0
diff changeset
12 def outputlevels(levellist):
0
45b12307c695 Initial revision
drewp
parents:
diff changeset
13 """present a list of dmx channel levels, each scaled from
45b12307c695 Initial revision
drewp
parents:
diff changeset
14 0..1. list can be any length- it will apply to the first len() dmx
45b12307c695 Initial revision
drewp
parents:
diff changeset
15 channels.
45b12307c695 Initial revision
drewp
parents:
diff changeset
16
45b12307c695 Initial revision
drewp
parents:
diff changeset
17 if the server is not found, outputlevels will block for a
45b12307c695 Initial revision
drewp
parents:
diff changeset
18 second."""
45b12307c695 Initial revision
drewp
parents:
diff changeset
19
45b12307c695 Initial revision
drewp
parents:
diff changeset
20 global _dmx,_id
45b12307c695 Initial revision
drewp
parents:
diff changeset
21
45b12307c695 Initial revision
drewp
parents:
diff changeset
22 if _dmx is None:
141
2dfe2c0ba052 fixed an err msg
drewp
parents: 120
diff changeset
23 _dmx=xmlrpclib.Server("http://dash:8030")
0
45b12307c695 Initial revision
drewp
parents:
diff changeset
24
120
b75bfbcf5979 new modules: dmxclient provides a very convenient way for clients to talk to the
drewp
parents: 0
diff changeset
25 try:
b75bfbcf5979 new modules: dmxclient provides a very convenient way for clients to talk to the
drewp
parents: 0
diff changeset
26 _dmx.outputlevels(_id,levellist)
b75bfbcf5979 new modules: dmxclient provides a very convenient way for clients to talk to the
drewp
parents: 0
diff changeset
27 except socket.error,e:
141
2dfe2c0ba052 fixed an err msg
drewp
parents: 120
diff changeset
28 print "dmx server error %s, waiting"%e
120
b75bfbcf5979 new modules: dmxclient provides a very convenient way for clients to talk to the
drewp
parents: 0
diff changeset
29 time.sleep(1)
b75bfbcf5979 new modules: dmxclient provides a very convenient way for clients to talk to the
drewp
parents: 0
diff changeset
30 except xmlrpclib.Fault,e:
b75bfbcf5979 new modules: dmxclient provides a very convenient way for clients to talk to the
drewp
parents: 0
diff changeset
31 print "outputlevels had xml fault: %s" % e
b75bfbcf5979 new modules: dmxclient provides a very convenient way for clients to talk to the
drewp
parents: 0
diff changeset
32 time.sleep(1)
0
45b12307c695 Initial revision
drewp
parents:
diff changeset
33