This commit is contained in:
Alban 2020-10-04 21:31:00 +00:00
commit 847fd0562e
8 changed files with 63 additions and 31 deletions

26
LJ.conf
View File

@ -2,7 +2,7 @@
lasernumber = 4 lasernumber = 4
debug = 0 debug = 0
ljayserverip = 0.0.0.0 ljayserverip = 0.0.0.0
wwwip = 192.168.2.43 wwwip = 192.168.2.44
nozoscip = 127.0.0.1 nozoscip = 127.0.0.1
bhoroscip = 127.0.0.1 bhoroscip = 127.0.0.1
autostart = artnet autostart = artnet
@ -10,7 +10,7 @@ autostart = artnet
[laser0] [laser0]
color = -1 color = -1
type = DS1000 type = DS1000
ip = 192.168.2.44 ip = 192.168.2.3
kpps = 25000 kpps = 25000
centerx = -393 centerx = -393
centery = 390 centery = 390
@ -30,7 +30,7 @@ warpdest = [[-1500., 1500.],
[laser1] [laser1]
color = -1 color = -1
type = LOCAL type = LOCAL
ip = 192.168.2.43 ip = 192.168.2.5
kpps = 25000 kpps = 25000
centerx = 0 centerx = 0
centery = 0 centery = 0
@ -51,11 +51,11 @@ warpdest = [[-1500., 1500.],
color = -1 color = -1
type = LUKE400 type = LUKE400
ip = 192.168.2.6 ip = 192.168.2.6
kpps = 25000 kpps = 20361
centerx = 0 centerx = -3798
centery = 0 centery = -13079
zoomx = 79 zoomx = 73.0
zoomy = 82 zoomy = 70.0
sizex = 32000 sizex = 32000
sizey = 32000 sizey = 32000
finangle = 0.2792526803190927 finangle = 0.2792526803190927
@ -72,15 +72,15 @@ color = -1
type = LUKE400 type = LUKE400
ip = 192.168.2.4 ip = 192.168.2.4
kpps = 25000 kpps = 25000
centerx = -3797 centerx = 2531
centery = -1 centery = -1
zoomx = 51.0 zoomx = 85.0
zoomy = 48.0 zoomy = 70.0
sizex = 32000 sizex = 32000
sizey = 32000 sizey = 32000
finangle = 0.0 finangle = 0.0
swapx = -1 swapx = 1
swapy = -1 swapy = 1
lsteps = [(1.0, 8),(0.25, 3), (0.75, 3), (1.0, 10)] lsteps = [(1.0, 8),(0.25, 3), (0.75, 3), (1.0, 10)]
warpdest = [[-1500., 1500.], warpdest = [[-1500., 1500.],
[ 1500., 1500.], [ 1500., 1500.],

View File

@ -16,6 +16,6 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
import dac import dac3 as dac
dac.find_dac() dac.find_dac()

View File

@ -65,6 +65,8 @@ lsteps is a string like "[ (1.0, 8),(0.25, 3), (0.75, 3), (1.0, 10)]"
/regen : regen webui index html page. /regen : regen webui index html page.
/plugins/start pluginame
/plugins/stop pluginame
/pl/clientnumber/lasernumber value : value is the pointlist to draw as string type. For string format see code in clients directory. /pl/clientnumber/lasernumber value : value is the pointlist to draw as string type. For string format see code in clients directory.
@ -99,7 +101,7 @@ r = redis.StrictRedis(host=gstt.LjayServerIP , port=6379, db=0)
#r = redis.StrictRedis(host=gstt.LjayServerIP , port=6379, db=0, password='-+F816Y+-') #r = redis.StrictRedis(host=gstt.LjayServerIP , port=6379, db=0, password='-+F816Y+-')
GenericCommands = ["start","align","ljclient","scene","addest","deldest","dest","clientnumber","vcvrack","fft","mitraille","faceosc","midigen","viewgen","audiogen","noteon","cc","ljpong","ljwars","mouse","emergency","simu","status","run","nozoid","planet","live","words","ai","bank0","pose","lj","cycl","glyph","pong","maxw","custom1","square","regen","trckr","aurora","line1","ForwardUI","settings","debug","pl"] GenericCommands = ["start","align","ljclient","scene","addest","deldest","dest","clientnumber","vcvrack","fft","mitraille","faceosc","midigen","viewgen","audiogen","noteon","cc","ljpong","ljwars","mouse","emergency","simu","status","run","nozoid","planet","live","words","ai","bank0","pose","lj","cycl","glyph","pong","maxw","custom1","square","regen","trckr","aurora","line1","ForwardUI","settings","debug","pl","plugins"]
def UserOn(laser): def UserOn(laser):
@ -327,6 +329,30 @@ def handler(oscpath, args):
print("Back to normal for laser ", laser) print("Back to normal for laser ", laser)
UserOn(laser) UserOn(laser)
# Plugins commands :
elif oscpath[1] == "plugins":
# /plugins/start pluginame
if oscpath[2] == "start":
print()
print("Starting plugin :",args[0])
print()
plugins.Start(args[0])
# /plugins/stop pluginame
if oscpath[2] == "stop":
print()
print("Stopping plugin :",args[0])
print()
plugins.Kill(args[0])
# /plugins/restart pluginame
if oscpath[2] == "restart":
print()
print("Restarting plugin :",args[0])
print()
plugins.Restart(args[0])
# Settings commands : # Settings commands :
elif oscpath[1] == "settings": elif oscpath[1] == "settings":
if oscpath[2] == "lasers": if oscpath[2] == "lasers":

View File

@ -1,6 +1,6 @@
# coding=UTF-8 # coding=UTF-8
''' '''
nozoscip
LJ Global state LJ Global state
v0.8.0 v0.8.0
@ -34,7 +34,7 @@ xy_center = [screen_size[0]/2,screen_size[1]/2]
LjayServerIP = '192.168.1.13' LjayServerIP = '192.168.1.13'
oscIPin = '192.168.1.15' oscIPin = '192.168.1.15'
nozoscip = '192.168.1.15' nozoscIP = '192.168.1.15'
wwwIP = '192.168.1.15' wwwIP = '192.168.1.15'
# gstt.Laser select to what laser modifcation will occur. # gstt.Laser select to what laser modifcation will occur.

View File

@ -987,7 +987,7 @@ def Text(message, c, layer, xpos, ypos, resize, rotx, roty, rotz):
for xy in char_layer_list: for xy in char_layer_list:
char_draw.append((xy[0] + x_offset,xy[1],c)) char_draw.append((xy[0] + x_offset,xy[1],c))
i +=1 i +=1
#print ch,char_layer_list,char_draw print(ch, c, xpos, ypos, resize, char_draw)
rPolyLineOneColor(char_draw, c, layer , False, xpos, ypos, resize, rotx, roty, rotz) rPolyLineOneColor(char_draw, c, layer , False, xpos, ypos, resize, rotx, roty, rotz)
#dots.append(char_draw) #dots.append(char_draw)

View File

@ -182,12 +182,11 @@ def OSCsend(name, oscaddress, oscargs =''):
# for each plugin will automatically add /pluginame before oscpath to send like /aurora/scim 1, if oscpath = "/scim 1" # for each plugin will automatically add /pluginame before oscpath to send like /aurora/scim 1, if oscpath = "/scim 1"
def SendAll(oscpath): def SendAll(oscpath):
if gstt.debug > 0: print("Sending to all plugins ", "/pluginame"+oscpath)
print("Sending to all plugins ", oscpath)
for plugin in list(gstt.plugins.keys()): for plugin in list(gstt.plugins.keys()):
if gstt.debug > 0: if gstt.debug > 0:
print("sending ",oscpath,"to", plugin) print("sending ","/"+plugin+oscpath,"to", plugin)
#sendWSall("/"+ plugin + "/start 0") #sendWSall("/"+ plugin + "/start 0")
Send(plugin, "/"+plugin+oscpath) Send(plugin, "/"+plugin+oscpath)

View File

@ -321,9 +321,10 @@ def Circle(LAY):
def Word(LAY): def Word(LAY):
lj.Text(LAY['word'], c = LAY['color'], layer = LAY['number'], xpos = 300, ypos = 300, resize = LAY['scale']*20, rotx = LAY['Xrotdirec'], roty = LAY['Yrotdirec'], rotz = LAY['Zrotdirec'])
lj.Text(LAY['word'], c = LAY['color'], layer = LAY['number'], xpos = LAY['Xcoord']+LAY['lineSize']/2, ypos = LAY['Ycoord'], resize = LAY['scale']*10, rotx = LAY['Xrotdirec'], roty = LAY['Yrotdirec'], rotz = LAY['Zrotdirec']) #lj.Text(LAY['word'], c = LAY['color'], layer = LAY['number'], xpos = LAY['Xcoord'], ypos = LAY['Ycoord'], resize = LAY['scale']*10, rotx = LAY['Xrotdirec'], roty = LAY['Yrotdirec'], rotz = LAY['Zrotdirec'])
#lj.rPolyLineOneColor([(x/2,y/2),((x+1)/2,(y+1)/2)], c = LAY['color'], layer = l, xpos = 0, ypos = 0, resize = LAY['scale'], rotx = LAY['Xrotdirec'], roty = LAY['Yrotdirec'], rotz = LAY['Zrotdirec']) #lj.rPolyLineOneColor([(x/2,y/2),((x+1)/2,(y+1)/2)], c = LAY['color'], layer = l, xpos = 0, ypos = 0, resize = LAY['scale'], rotx = LAY['Xrotdirec'], roty = LAY['Yrotdirec'], rotz = LAY['Zrotdirec'])
#lj.rPolyLineOneColor([(x/2,y/2,0),((x+1)/2,(y+1)/2,0)], c = z2color(Field['stars'][starnumber][2], LAY['color']), layer = LAY['number'], closed = False, xpos = -200, ypos = 0, resize = LAY['scale'], rotx = LAY['Xrotdirec'], roty = LAY['Yrotdirec'], rotz = LAY['Zrotdirec'])
def Dot00(LAY): def Dot00(LAY):
@ -590,7 +591,7 @@ for lifes in range(0,lifenb,1):
entities.append([randint(100,width-100), randint(100,height-100), random(), randint(45,16700000), randint(-2,2)]) entities.append([randint(100,width-100), randint(100,height-100), random(), randint(45,16700000), randint(-2,2)])
print("entities", entities) #print("Butterlfy entities :", entities)
wingpos = random() wingpos = random()

View File

@ -179,8 +179,9 @@ print()
log.infog("Aurora v0.1b") log.infog("Aurora v0.1b")
OSCinPort = 8090 OSCinPort = 8090
ljscene = 1
ljscene = 0 StartFXs = ["anim.Word", "anim.Word","anim.Starfield","anim.Starfield"]
# Useful variables init. # Useful variables init.
white = lj.rgb2int(255,255,255) white = lj.rgb2int(255,255,255)
@ -190,6 +191,8 @@ green = lj.rgb2int(0,255,0)
cyan = lj.rgb2int(255,0,255) cyan = lj.rgb2int(255,0,255)
yellow = lj.rgb2int(255,255,0) yellow = lj.rgb2int(255,255,0)
StartColors = [blue, blue, green, red]
screen_size = [700,700] screen_size = [700,700]
xy_center = [screen_size[0]/2,screen_size[1]/2] xy_center = [screen_size[0]/2,screen_size[1]/2]
@ -210,7 +213,7 @@ log.info('Startup...')
argsparser = argparse.ArgumentParser(description="Aurora for LJ") argsparser = argparse.ArgumentParser(description="Aurora for LJ")
argsparser.add_argument("-r","--redisIP",help="IP of the Redis server used by LJ (127.0.0.1 by default) ",type=str) argsparser.add_argument("-r","--redisIP",help="IP of the Redis server used by LJ (127.0.0.1 by default) ",type=str)
argsparser.add_argument("-m","--myIP",help="IP to bind (0.0.0.0 by default) ",type=str) argsparser.add_argument("-m","--myIP",help="IP to bind (0.0.0.0 by default) ",type=str)
argsparser.add_argument("-s","--scene",help="LJ scene number (0 by default)",type=int) argsparser.add_argument("-s","--scene",help="LJ scene number (1 by default)",type=int)
argsparser.add_argument("-v","--verbose",help="Verbosity level (0 by default)",type=int) argsparser.add_argument("-v","--verbose",help="Verbosity level (0 by default)",type=int)
argsparser.add_argument("-L","--Lasers",help="Number of lasers connected (1 by default).",type=int) argsparser.add_argument("-L","--Lasers",help="Number of lasers connected (1 by default).",type=int)
argsparser.add_argument('-song',help="Run according to external (LIVE is default)", dest='song', action='store_true') argsparser.add_argument('-song',help="Run according to external (LIVE is default)", dest='song', action='store_true')
@ -228,7 +231,7 @@ else:
if args.scene: if args.scene:
ljscene = args.scene ljscene = args.scene
else: else:
ljscene = 0 ljscene = 1
# Redis Computer IP # Redis Computer IP
if args.redisIP != None: if args.redisIP != None:
@ -285,10 +288,10 @@ for l in range(lasernumber):
Layer.append({'number': 0, 'FX': "user.User4", Layer.append({'number': 0, 'FX': "user.User4",
'Xcoord': 45, 'Ycoord': 45, 'Zcoord': 0, 'Xcoord': 45, 'Ycoord': 45, 'Zcoord': 0,
'scandots': 64, 'scale': 45, 'color': red, "run": False, 'scandots': 64, 'scale': 45, 'color': white, "run": False,
'intensity': 255, 'closed': False, 'intensity': 255, 'closed': False,
'lineSize': 64, 'radius': 45, 'wavefreq': 3, 'lineSize': 64, 'radius': 45, 'wavefreq': 3,
'word': "hello", 'word': "Sonoptik",
'step': 0, 'steps': 60, 'stepmax': 60, 'stepvals': [], 'step': 0, 'steps': 60, 'stepmax': 60, 'stepvals': [],
'Xtransamt': 0, 'Ytransamt': 0, 'Ztransamt': 0, 'Xtransamt': 0, 'Ytransamt': 0, 'Ztransamt': 0,
'Xtranspeed': 0, 'Ytranspeed': 0, 'Ztranspeed': 0, 'Xtranspeed': 0, 'Ytranspeed': 0, 'Ztranspeed': 0,
@ -298,10 +301,13 @@ for l in range(lasernumber):
}) })
Layer[l]['number']= l Layer[l]['number']= l
Layer[l]['FX'] = StartFXs[l]
Layer[l]['color'] = StartColors[l]
multi = {"radius": 300 } multi = {"radius": 300 }
# #
# Destination : name, number, active, layer , scene, laser) # Destination : name, number, active, layer , scene, laser)
# #
@ -492,7 +498,7 @@ def OSChandler(path, tags, args, source):
# /aurora/scim # /aurora/scim
if path.find('/aurora/scim') == 0: if path.find('/aurora/scim') == 0:
print("OScim sending to LJ2 /scim",int(args[0])+24) print("OScim sending to LJ /scim",int(args[0])+24)
lj.SendLJ("/scim", [int(args[0])+24]) lj.SendLJ("/scim", [int(args[0])+24])
''' '''
@ -514,7 +520,7 @@ def OSCim(path, tags, args, source):
newarg = path.split(" ") newarg = path.split(" ")
newlaser = args[0]+24 newlaser = args[0]+24
print("OSim sending to LJ2 /scim",str(newlaser)) print("OSim sending to LJ /scim",str(newlaser))
lj.SendLJ("/scim", [newlaser]) lj.SendLJ("/scim", [newlaser])
print("sending knobs value for new layer") print("sending knobs value for new layer")
UpdateKnobs(newlaser) UpdateKnobs(newlaser)