minor bugs

This commit is contained in:
sam 2020-09-26 18:49:51 +02:00 committed by alban
parent 2950eb9f92
commit ed6c0de14d
2 changed files with 33 additions and 28 deletions

View file

@ -116,26 +116,31 @@ def pack_point(laser, intensity, x, y, r, g, b, i = -1, u1 = 0, u2 = 0, flags =
#print("Tracer ", laser, ": packing", x, y, r, g, b, "intensity", intensity, "i", i)
if x < -32767:
x = -32767
if gstt.debug >1:
log.err("Tracer "+ str(laser) +" : x coordinates was below -32767")
log.err("Tracer "+ str(laser) +" : x coordinates " + str(x) + " was below -32767")
x = -32000
if x > 32767:
x = 32767
if gstt.debug >1:
log.err("Tracer "+ str(laser) +" : x coordinates was bigger than 32767")
log.err("Tracer "+ str(laser) +" : x coordinates "+ str(x) + " was bigger than 32767")
x = 32000
if y < -32767:
y = -32767
if gstt.debug >1:
log.err("Tracer "+ str(laser) +" : y coordinates was below -32767")
log.err("Tracer "+ str(laser) +" : y coordinates "+ str(y) + " was below -32767")
y = -32000
if y > 32767:
y = 32767
if gstt.debug >1:
log.err("Tracer "+ str(laser) +" : y coordinates was bigger than 32767")
log.err("Tracer "+ str(laser) +" : y coordinates "+ str(y) + " was bigger than 32767")
y = 32000
return struct.pack("<HhhHHHHHH", flags, x, y, r, g, b, i, u1, u2)
#return struct.pack("<HhhHHHHHH", flags, round(x), round(y), r, g, b, i, u1, u2)