From cb69d2e1c7ced951cbf7a31ee286b0ed92cab8a8 Mon Sep 17 00:00:00 2001 From: rcoh Date: Fri, 18 Feb 2011 16:56:43 -0500 Subject: Adding Epydoc generated docs. --- .../SmootLight.renderers.IndoorRenderer-pysrc.html | 151 +++++++++++++++++++++ 1 file changed, 151 insertions(+) create mode 100644 html/SmootLight.renderers.IndoorRenderer-pysrc.html (limited to 'html/SmootLight.renderers.IndoorRenderer-pysrc.html') diff --git a/html/SmootLight.renderers.IndoorRenderer-pysrc.html b/html/SmootLight.renderers.IndoorRenderer-pysrc.html new file mode 100644 index 0000000..26a51cc --- /dev/null +++ b/html/SmootLight.renderers.IndoorRenderer-pysrc.html @@ -0,0 +1,151 @@ + + + + + SmootLight.renderers.IndoorRenderer + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package SmootLight :: + Package renderers :: + Module IndoorRenderer + + + + + + +
[hide private]
[frames] | no frames]
+
+

Source Code for Module SmootLight.renderers.IndoorRenderer

+
+ 1  from operationscore.Renderer import * 
+ 2  import util.PacketComposition as composer  
+ 3  import util.NetworkOps as network 
+ 4  import util.TimeOps as timeops 
+ 5  import socket,pdb 
+ 6  sock_port = 6038 
+
7 -class IndoorRenderer(Renderer): +
8 """IndoorRenderer is a renderer for a specific Light System""" + 9 +
10 - def initRenderer(self): +
11 self.stripLocations = {} #Dict that stores info necessary to render to +12 #strips +13 self.sockets = {} #dict of (IP)->Socket +14 #a strip +15 powerSupplies = self.argDict['PowerSupply'] +16 if not type(powerSupplies) == type([]): +17 powerSupplies = [powerSupplies] +18 for powerSupply in powerSupplies: +19 ip = powerSupply['IP'] +20 stripsInPowerSupply = powerSupply['PortMapping'] +21 for stripId in stripsInPowerSupply: +22 self.stripLocations[stripId] = (ip, \ +23 stripsInPowerSupply[stripId]) +24 self.broadSocket = network.getBroadcastSocket(6038) +
25 - def render(self, lightSystem, currentTime=timeops.time()): +
26 #try: +27 for pixelStrip in lightSystem.pixelStrips: +28 stripId = pixelStrip.argDict['Id'] +29 (ip, port) = self.stripLocations[stripId] +30 if not ip in self.sockets: #do we have a socket to this +31 #strip? if not, spin off a new one +32 self.sockets[ip] = network.getConnectedSocket(ip,sock_port) +33 packet = composer.composePixelStripPacket(pixelStrip, port, currentTime) +34 self.sockets[ip].send(packet, 0x00) +35 +36 synchPacket = composer.composeSynchPacket() +
37 #pdb.set_trace() +38 #self.broadSocket.sendto(synchPacket, ('10.0.32.255', 6038)) +39 +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + -- cgit v1.2.3