This commit is contained in:
gac-S_Changer
2017-11-29 09:37:22 +01:00
parent 5c857d030a
commit d7570bcaf3
39 changed files with 1881 additions and 65 deletions

View File

@@ -17,6 +17,7 @@ run("devices/RobotSC")
#run("devices/RobotModbus")
#run("devices/OneWire")
#Raspberry login: usr=pi pwd=Buntschu
add_device(img.getContrast(), force = True)
@@ -31,6 +32,12 @@ def set_led_range(room_temp = True):
led_ctrl2.config.save()
###################################################################################################
# Motion modules
###################################################################################################
run("motion/tools")
###################################################################################################
# Barcode reader
@@ -155,9 +162,9 @@ def fit(ydata, xdata = None, draw_plot = True):
max_y= max(ydata)
index_max = ydata.index(max_y)
max_x= xdata[index_max]
print "Max index:" + str(index_max),
print " x:" + str(max_x),
print " y:" + str(max_y)
#print "Max index:" + str(index_max),
#print " x:" + str(max_x),
#print " y:" + str(max_y)
if draw_plot:
plots = plot([ydata],["data"],[xdata], title="Fit" )
@@ -191,12 +198,12 @@ def fit(ydata, xdata = None, draw_plot = True):
if abs(mean - xdata[index_max]) < abs((scale_x[0] + scale_x[1])/2):
if draw_plot:
p.addMarker(mean, None, "Mean="+str(round(mean,4)), Color.MAGENTA.darker())
print "Mean -> " + str(mean)
#print "Mean -> " + str(mean)
return (norm, mean, sigma)
else:
if draw_plot:
p.addMarker(max_x, None, "Max="+str(round(max_x,4)), Color.GRAY)
print "Invalid gaussian fit: " + str(mean)
#print "Invalid gaussian fit: " + str(mean)
return (None, None, None)
context = get_context()