Skip to content

Commit

Permalink
added more LCD messages, set LED on
Browse files Browse the repository at this point in the history
  • Loading branch information
caternuson committed Aug 3, 2016
1 parent 397ea7f commit b888ffe
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 11 deletions.
2 changes: 1 addition & 1 deletion boot_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import campi

camera = campi.Campi()
#camera.LCD_LED_On()
camera.LCD_LED_On()

selection = 1

Expand Down
17 changes: 14 additions & 3 deletions camera_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

camera = campi.Campi()
camera.set_cam_config("resolution",(1920, 1080))
#camera.LCD_LED_On()
camera.LCD_LED_On()

# timelapse control thread
timelapse = None
Expand Down Expand Up @@ -104,8 +104,16 @@ def send_status(self, ):
if timelapse == None:
return
status = timelapse.get_status()
camera.disp_msg("Timelapse Running. {0} of {1}".format(
status['image_count'], status['total_imgs']))
if status['is_alive']:
camera.disp_msg(' Timelapse '+\
' running... '+\
' {0} of {1} '.format(
status['image_count'],
status['total_imgs'])
)
else:
camera.disp_msg(' Timelapse '+\
' DONE ')
self.write_message(json.dumps(status))

class TimelapseCancelHandler(tornado.web.RequestHandler):
Expand Down Expand Up @@ -232,4 +240,7 @@ def __init__(self):
if __name__ == '__main__':
tornado.httpserver.HTTPServer(MainServerApp()).listen(PORT)
print "Server started on port {0}.".format(PORT)
camera.disp_msg(' '+\
' SERVER '+\
' STARTED ')
tornado.ioloop.IOLoop.instance().start()
12 changes: 6 additions & 6 deletions campi.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def capture_with_histogram(self, filename, fill=False):
im_in = Image.open(hname)
im_out = Image.new('RGBA', im_in.size)
im_out.paste(im_in)
width, height = im_in.size
width, height = im_out.size
draw = ImageDraw.Draw(im_out)

# add rule of thirds lines
Expand Down Expand Up @@ -185,14 +185,14 @@ def capture_with_histogram(self, filename, fill=False):
bl.append((int(i*xs),height-int(bh[i]*ys)))

# draw it
lw = max(5,int((0.005*max(im_out.size))))
lw = int((0.01*max(im_out.size)))
if (fill):
rpoly = [(0,height)] + rl + [(width,height)]
gpoly = [(0,height)] + gl + [(width,height)]
bpoly = [(0,height)] + bl + [(width,height)]
draw.polygon(rpoly, fill=(255,0,0,90))
draw.polygon(gpoly, fill=(0,255,0,90))
draw.polygon(bpoly, fill=(0,0,255,90))
draw.polygon(rpoly, fill=(255,0,0,40))
draw.polygon(gpoly, fill=(0,255,0,40))
draw.polygon(bpoly, fill=(0,0,255,40))
draw.line(rl, fill='red', width=lw)
draw.line(gl, fill='green', width=lw)
draw.line(bl, fill='blue', width=lw)
Expand All @@ -213,7 +213,7 @@ def capture_with_histogram(self, filename, fill=False):
draw.text((10,10+N*fh), line, font=font)
N += 1

# save it and clean up
# save it and clean up
im_out.save(filename, quality=95)
os.remove(hname)

Expand Down
2 changes: 1 addition & 1 deletion templates/configure.html
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
return power_down();
});
$("#preview").attr("src","static/test_pattern.jpg")
send_config(JSON.parse('{% raw config %}'));
update_ui(JSON.parse('{% raw config %}'));
});

function send_config() {
Expand Down

0 comments on commit b888ffe

Please sign in to comment.