Args improvments

This commit is contained in:
tmpbci 2019-03-20 17:33:09 +01:00
parent eb5b9b25f2
commit b6139525a5
9 changed files with 30 additions and 19 deletions

View File

@ -1,9 +1,9 @@
[General] [General]
lasernumber = 4 lasernumber = 4
debug = 0 debug = 0
ljayserverip = 127.0.0.1 ljayserverip = 192.168.2.13
nozoscip = 127.0.0.1 nozoscip = 127.0.0.1
bhoroscip = 127.0.0.1 bhoroscip = 192.168.2.13
[laser0] [laser0]
color = -1 color = -1

2
cli.py
View File

@ -114,7 +114,7 @@ def handle():
if args.bhoroscIP != None: if args.bhoroscIP != None:
gstt.oscIPin = args.bhoroscIP gstt.oscIPin = args.bhoroscIP
else: else:
gstt.oscIPin = '127.0.0.1' gstt.oscIPin = gstt.LjayServerIP
if args.nozoidIP != None: if args.nozoidIP != None:
gstt.nozoscIP = args.nozoidIP gstt.nozoscIP = args.nozoidIP

View File

@ -112,6 +112,8 @@ wsPORT = 9001
# OSC Server : accept OSC message on port 8002 # OSC Server : accept OSC message on port 8002
#oscIPin = "192.168.1.10"s #oscIPin = "192.168.1.10"s
extoscIPin = serverIP extoscIPin = serverIP
print "extoscIPin", extoscIPin
extoscPORTin = 8002 extoscPORTin = 8002
# OSC Client : to send OSC message to an IP port 8001 # OSC Client : to send OSC message to an IP port 8001

View File

@ -340,8 +340,9 @@ def Starfield(hori=0,verti=0):
lj3.DrawPL(3) lj3.DrawPL(3)
def OSCidiotia(address, value): def OSCidiotia(address,value):
print("Pose bank idiotia got", address, "with value", value) print("idiotia",address,value)
def OSCfield(address, value): def OSCfield(address, value):
@ -401,6 +402,10 @@ anims =[[],[],[],[]]
color = lj3.rgb2int(255,255,255) color = lj3.rgb2int(255,255,255)
prepareIdiotIA() prepareIdiotIA()
#prepareSTARFIELD() #prepareSTARFIELD()

View File

@ -52,8 +52,8 @@ from osc4py3 import oscbuildparse
from osc4py3.oscmethod import * from osc4py3.oscmethod import *
redisIP = '127.0.0.1' #redisIP = '127.0.0.1'
r = redis.StrictRedis(host=redisIP, port=6379, db=0) #r = redis.StrictRedis(host=redisIP, port=6379, db=0)
ClientNumber = 0 ClientNumber = 0
@ -230,6 +230,7 @@ def Config(redisIP,client):
r = redis.StrictRedis(host=redisIP, port=6379, db=0) r = redis.StrictRedis(host=redisIP, port=6379, db=0)
ClientNumber = client ClientNumber = client
osc_udp_client(redisIP, 8002, "LJ 8002") osc_udp_client(redisIP, 8002, "LJ 8002")
return r
def LjClient(client): def LjClient(client):

View File

@ -21,6 +21,7 @@ from osc4py3 import oscbuildparse
from osc4py3.oscmethod import * from osc4py3.oscmethod import *
OSCinPort = 8004 OSCinPort = 8004
myIP = "192.168.2.52"
print ("") print ("")
print ("Arguments parsing if needed...") print ("Arguments parsing if needed...")
@ -49,6 +50,7 @@ if args.redisIP != None:
else: else:
redisIP = '127.0.0.1' redisIP = '127.0.0.1'
print("redisIP",redisIP)
if args.verbose: if args.verbose:
debug = args.verbose debug = args.verbose
@ -56,9 +58,9 @@ else:
debug = 0 debug = 0
lj3.Config(redisIP,ljclient) r = lj3.Config(redisIP,ljclient)
print("r :",r)
width = 800 width = 800
height = 600 height = 600
centerX = width / 2 centerX = width / 2
@ -159,12 +161,12 @@ def Run():
Left = [] Left = []
Right = [] Right = []
counter =0 counter =0
WebStatus("LaserGlyph") lj3.WebStatus("LaserGlyph")
# OSC Server callbacks # OSC Server callbacks
print("Starting OSC at 127.0.0.1 port",OSCinPort,"...") print("Starting OSC at",myIP," port",OSCinPort,"...")
osc_startup() osc_startup()
osc_udp_server("127.0.0.1", OSCinPort, "InPort") osc_udp_server(myIP, OSCinPort, "InPort")
osc_method("/ping*", lj3.OSCping) osc_method("/ping*", lj3.OSCping)
osc_method("/glyph/ljclient", OSCljclient) osc_method("/glyph/ljclient", OSCljclient)
@ -227,7 +229,7 @@ def Run():
finally: finally:
WebStatus("Glyph Exit") lj3.WebStatus("Glyph Exit")
print("Stopping OSC...") print("Stopping OSC...")
lj3.OSCstop() lj3.OSCstop()
pass pass

View File

@ -52,8 +52,8 @@ from osc4py3 import oscbuildparse
from osc4py3.oscmethod import * from osc4py3.oscmethod import *
redisIP = '127.0.0.1' #redisIP = '127.0.0.1'
r = redis.StrictRedis(host=redisIP, port=6379, db=0) #r = redis.StrictRedis(host=redisIP, port=6379, db=0)
ClientNumber = 0 ClientNumber = 0
@ -230,6 +230,7 @@ def Config(redisIP,client):
r = redis.StrictRedis(host=redisIP, port=6379, db=0) r = redis.StrictRedis(host=redisIP, port=6379, db=0)
ClientNumber = client ClientNumber = client
osc_udp_client(redisIP, 8002, "LJ 8002") osc_udp_client(redisIP, 8002, "LJ 8002")
return r
def LjClient(client): def LjClient(client):

View File

@ -28,8 +28,8 @@ from osc4py3.as_eventloop import *
from osc4py3 import oscbuildparse from osc4py3 import oscbuildparse
redisIP = '127.0.0.1' #redisIP = '127.0.0.1'
r = redis.StrictRedis(host=redisIP, port=6379, db=0) #r = redis.StrictRedis(host=redisIP, port=6379, db=0)
ClientNumber = 0 ClientNumber = 0

View File

@ -204,7 +204,7 @@
var pl = ""; var pl = "";
var pl2 = new Array(); var pl2 = new Array();
var _WS = { var _WS = {
uri: 'ws://127.0.0.1:9001/', uri: 'ws://192.168.2.13:9001/',
ws: null, ws: null,
init : function (e) { init : function (e) {