Skip to content

Commit

Permalink
Finished camera
Browse files Browse the repository at this point in the history
  • Loading branch information
tyspa1 committed Aug 16, 2015
1 parent 7fab545 commit 3c7f67f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions apps/camera/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def __init__(self):
#Setup buttons
self.capture = pygame.image.load('/home/pi/tyos/apps/camera/camera.png')
self.gallery = pygame.image.load('/home/pi/tyos/apps/camera/images/gallery.png')
self.settings = pygame.image.load('/home/pi/tyos/apps/camera/images/gear.png')
self.door = pygame.image.load('/home/pi/tyos/apps/camera/images/door.png')
self.right = pygame.image.load('/home/pi/tyos/apps/camera/images/right.png')
self.left = pygame.image.load('/home/pi/tyos/apps/camera/images/left.png')
self.home = pygame.image.load('/home/pi/tyos/apps/camera/images/home.png')
Expand Down Expand Up @@ -95,7 +95,7 @@ def display(self):
#Blit buttons
self.screen.blit(self.capture, (125, 400))
self.screen.blit(self.gallery, (20, 415))
self.screen.blit(self.settings, (240, 410))
self.screen.blit(self.door, (240, 410))

if self.no_files:
self.screen.blit(self.no_files_image, (79, 200))
Expand Down Expand Up @@ -153,8 +153,15 @@ def display(self):

if event.pos[0] > 255:
if self.mode == 'capture':
print 'settings'
self.mode = 'settings'
print 'exiting...'
os.remove('/home/pi/tyos/apps/camera/index.dat')
new = open('/home/pi/tyos/apps/camera/index.dat', 'w+')
new.write(str(self.index))
new.close()
cam = Popen(['sudo', 'python', '/home/pi/tyos/src/main.py'])
pygame.quit()
sys.exit()


if self.mode == 'gallery':
if self.current_image == len(self.images) - 1:
Expand Down
Binary file added apps/camera/images/door.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3c7f67f

Please sign in to comment.