WebUI simulator finally OK

This commit is contained in:
nrhck 2018-12-31 03:41:02 +01:00
parent 9b4800aa7b
commit 4166fda47b
7 changed files with 36 additions and 33 deletions

View File

@ -1,7 +1,7 @@
[General]
set = 5
curve = 0
lasernumber = 2
lasernumber = 1
debug = 2
ljayserverip = 127.0.0.1
nozoscip = 127.0.0.1
@ -28,7 +28,7 @@ warpdest = [[-1500., 1500.],
[laser1]
color = -1
ip = 192.168.1.4
ip = 192.168.1.3
kpps = 25000
centerx = 506
centery = 413

View File

@ -4,6 +4,24 @@ By Sam Neurohack, Loloster, Cocoa
LICENCE : CC BY
Dear
I'm part of a group of laser freaks that use etherdreams in demoparty and many other occasions. Recently we started using your wonderful dac emulator that is so useful.
It compiles and works flawlessly in fairly new computers, we tried successfully several os X and different linux flavors, but with older generation i5 M560 (a dual core 2.67 Ghz) when i run ./visualiser I get an error :
thread 'main' panicked at 'could not build default app window: GlutinCreationError(NoAvailablePixelFormat)', libcore/result.rs:1009:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.
My guess is to modify the display creation in... nannou ?
I don't speak Rust, but the dac emulator import a nannou crate, so I can't modify the code in dac emulator directly ?
Would you consider supporting older computers by testing configuration and then modifying the display creation accordingly ?
This will be very helpfull
![LJ](http://www.teamlaser.fr/thsf/images/fulls/THSF9-33.jpg)

View File

@ -201,8 +201,6 @@ def Draw1PL():
framy.rPolyLineOneColor(Left, c = red, PL = 0, closed = False, xpos = 0, ypos = 10, resize = 1.5, rotx =0, roty =0 , rotz=0)
framy.rPolyLineOneColor(Right, c = green, PL = 0, closed = False, xpos = 0, ypos = 10, resize = 1.5, rotx =0, roty =0 , rotz=0)
Left = []
Right = []
x = -1
@ -216,8 +214,6 @@ def Draw1PL():
framy.rPolyLineOneColor(Left, c = red, PL = 0, closed = False, xpos = 0, ypos = 25, resize = 1.5, rotx =0, roty =0 , rotz=0)
framy.rPolyLineOneColor(Right, c = green, PL = 0, closed = False, xpos = 0, ypos = 25, resize = 1.5, rotx =0, roty =0 , rotz=0)
Left = []
Right = []
x = -1
@ -232,15 +228,8 @@ def Draw1PL():
framy.rPolyLineOneColor(Right, c = green, PL = 0, closed = False, xpos = 0, ypos = 50, resize = 1.5, rotx =0, roty =0 , rotz=0)
'''
framy.rPolyLineOneColor(Shape, c = white, PL = 0, closed = False, xpos = 200, ypos = 250, resize = 1.5, rotx =0, roty =0 , rotz=0)
framy.rPolyLineOneColor(Left, c = red, PL = 1, closed = False, xpos = 200, ypos = 250, resize = 1.5, rotx =0, roty =0 , rotz=0)
framy.rPolyLineOneColor(Right, c = blue, PL = 2, closed = False, xpos = 200, ypos = 250, resize = 1.5, rotx =0, roty =0 , rotz=0)
'''
framy.LinesPL(0)
time.sleep(0.1)
time.sleep(0.005)
white = rgb2int(255,255,255)
red = rgb2int(255,0,0)

View File

@ -169,8 +169,8 @@ def Draw1PL():
Shape.append(Proj(x,y,z,0,0,counter))
Left.append( Proj(x+LeftShift(z*25),y,z,0,0,counter))
Right.append(Proj(x+RightShift(z*25),y,z,0,0,counter))
Left.append( Proj(x+LeftShift(z*25),y,z,0,counter,0))
Right.append(Proj(x+RightShift(z*25),y,z,0,counter,0))
#framy.PolyLineOneColor(Shape, c = white, PL = 0, closed = False)
framy.PolyLineOneColor(Left, c = red, PL = 0, closed = False)

View File

@ -197,7 +197,7 @@ def osc_thread():
try:
while True:
time.sleep(1)
time.sleep(0.1)
osc_frame()
for laserid in range(0,gstt.LaserNumber): # Laser not used -> led is not lit

View File

@ -251,10 +251,7 @@ class DAC(object):
# Lower case pl is the actual point list coordinates
print "Init laser",self.mylaser,"asking for ckey", self.clientkey+str(self.mylaser)
self.pl = ast.literal_eval(r.get(self.clientkey + str(self.mylaser)))
#if self.mylaser ==0:
#print "DAC Init Laser", self.mylaser
#print "pl :", self.pl
#print "EDH/"+str(self.mylaser),r.get('/EDH/'+str(self.mylaser))
if r.get('/EDH/'+str(self.mylaser)) == None:
#print "Laser",self.mylaser,"NO EDH !! Computing one..."
homographyp.newEDH(self.mylaser)
@ -328,7 +325,6 @@ class DAC(object):
def play_stream(self):
# print last playback state
#print "laser", self.mylaser, "Pb : ",self.last_status.playback_state
# error if etherdream is already playing state (from other source)
@ -347,7 +343,6 @@ class DAC(object):
order = int(r.get('/order/'+str(self.mylaser)))
#print "laser", self.mylaser, "order : ",order
if order == 0:
# USER point list

View File

@ -551,7 +551,7 @@
var ctx = canvas.getContext("2d");
var lastpoint = { x: 0, y: 0, color: 0};
ctx.clearRect(0,0,400,400);
ctx.save
//ctx.save
// Todo : laser point will have black points to go from a polyline to another. Need to discard those black points.
@ -565,8 +565,9 @@
// Begin a new path
// 0.7 reduces max coordinates in a more browser compatible resolution.
ctx.clearRect(0,0,400,400);
ctx.beginPath();
//ctx.clearRect(0,0,400,400);
ctx.moveTo(pl2[0]*0.5, pl2[1]*0.5);
lastpoint.color = pl2[2];
@ -585,8 +586,8 @@
{
ctx.strokeStyle = "#"+(lastpoint.color + Math.pow(16, 6)).toString(16).slice(-6);
ctx.stroke();
//ctx.closePath()
ctx.restore
ctx.closePath()
//ctx.restore
ctx.beginPath();
//ctx.clearRect(0,0,400,400);
@ -600,8 +601,8 @@
ctx.strokeStyle = "#"+((pl2[2+(i*3)]) + Math.pow(16, 6)).toString(16).slice(-6);
ctx.stroke();
//ctx.closePath()
ctx.restore
ctx.closePath()
//ctx.restore
//ctx.clearRect(0,0,400,400);
}