forked from protonphoton/LJ
Bugfixs
This commit is contained in:
parent
c27151ec62
commit
798ac06fd1
14 changed files with 299 additions and 158 deletions
|
|
@ -54,7 +54,7 @@ def OSCstop():
|
|||
osc_terminate()
|
||||
|
||||
|
||||
def Send(oscaddress,oscargs=''):
|
||||
def SendLJ(oscaddress,oscargs=''):
|
||||
|
||||
try:
|
||||
msg = oscbuildparse.OSCMessage(oscaddress, None, [oscargs])
|
||||
|
|
@ -64,6 +64,13 @@ def Send(oscaddress,oscargs=''):
|
|||
except:
|
||||
print ('Connection to LJ refused : died ?')
|
||||
pass
|
||||
|
||||
# Answer to LJ pings
|
||||
def OSCping(value):
|
||||
# Will receive message address, and message data flattened in s, x, y
|
||||
print("I got /ping with value", value)
|
||||
SendLJ("/pong",value)
|
||||
|
||||
'''
|
||||
def handlerfunction(s, x, y):
|
||||
# Will receive message data unpacked in s, x, y
|
||||
|
|
|
|||
|
|
@ -581,18 +581,20 @@ def NewTime(timeshift):
|
|||
if DisplayAnything:
|
||||
UpdateAnything()
|
||||
|
||||
# /quit
|
||||
def OSCquit():
|
||||
|
||||
def OSCstart(value):
|
||||
# Will receive message address, and message data flattened in s, x, y
|
||||
print("Planetarium OSC server got /planet/start with value", value)
|
||||
|
||||
WebStatus("Planet stopping")
|
||||
print("Stopping OSC...")
|
||||
lj3.OSCstop()
|
||||
sys.exit()
|
||||
|
||||
def OSCUI(value):
|
||||
# Will receive message address, and message data flattened in s, x, y
|
||||
print("Planetarium OSC server got /planet/planetUI with value", value)
|
||||
|
||||
def WebStatus(message):
|
||||
lj3.Send("/status",message)
|
||||
lj3.SendLJ("/status",message)
|
||||
|
||||
#
|
||||
# Main part
|
||||
|
|
@ -606,8 +608,9 @@ try:
|
|||
print("Starting OSC at 127.0.0.1 port",OSCinPort,"...")
|
||||
osc_startup()
|
||||
osc_udp_server("127.0.0.1", OSCinPort, "InPort")
|
||||
osc_method("/planet/start*", OSCstart)
|
||||
osc_method("/planet/planetUI*", OSCUI)
|
||||
osc_method("/ping*", lj3.OSCping)
|
||||
osc_method("/quit", OSCquit)
|
||||
|
||||
WebStatus("Load Cities.")
|
||||
ts = load.timescale()
|
||||
|
|
@ -635,7 +638,7 @@ try:
|
|||
UpdateStars(ts)
|
||||
|
||||
WebStatus("Ready")
|
||||
lj3.Send("/planet/start",1)
|
||||
lj3.SendLJ("/planet/start",1)
|
||||
print ("Done.")
|
||||
|
||||
# UpdateStars() Todo
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue