Beispiel #1
0
 def process(self,event):
     should_write = False
     type = event.get_data()['type']
     value = event.get_data()['value']
     if(type=='magnification_level'):
         self.latest_magnification_level = value['number']
         self.latest_adjustment = (value['x'],value['y'])
         should_write = True
     elif(type=='adjustment'):
         self.latest_adjustment = (value[0],value[1])
         should_write = True
     elif(type=='crosshair'):
         self.latest_crosshair_number = value
         should_write = True
     if(should_write):
         self.saveToFile()
Beispiel #2
0
 def process(self, event):
     topic = event.get_topic()
     data = event.get_data()
     if (topic == 'zoom'):
         self.zoom(data)
     elif (topic == 'adjust'):
         self.adjust(data)
Beispiel #3
0
 def process(self, event):
     topic = event.get_topic()
     data = event.get_data()
     if (data == 'next'):
         new_crosshair_number = self.crosshair_number + 1
         if (new_crosshair_number > 6):
             new_crosshair_number = 1
     else:
         new_crosshair_number = data
     self.set_crosshair(new_crosshair_number)
Beispiel #4
0
 def process(self, event):
     type = event.get_topic()
     data = event.get_data()
     if (type == 'video'):
         if (data == 'start'):
             self.start_recording_video()
         elif (data == 'end'):
             self.stop_recording_video_and_save_with_overlay()
     elif (type == 'photo'):
         self.take_photo_with_overlay()
     elif (type == 'status_update' and data['type'] == 'crosshair'):
         self.last_crosshair_number = data['value']
Beispiel #5
0
 def process(self, event):
     topic = event.get_topic()
     data = event.get_data()
     if (topic == 'touch'):
         self._check_if_button_was_touched(data)
     elif (topic == 'status_update'):
         type = data['type']
         value = data['value']
         if (type == 'photo' and value == 'start'):
             self.show_photo_in_progress_layout()
         elif (type == 'photo' and value == 'end'):
             self.show_options_layout()
         elif (type == 'video' and value == 'start'):
             self.show_video_recording_in_progress_layout()
         elif (type == 'video' and value == 'end'):
             self.show_options_layout()
     elif (topic == 'layout'):
         if (data == 'options'):
             self.show_options_layout()
         elif (data == 'standard'):
             self.show_standard_layout()
Beispiel #6
0
 def process(self, event):
     topic = event.get_topic()
     data = event.get_data()
     if (topic == 'notification'):
         self.show_notification_for_seconds(data, 3)
     elif (topic == 'status_update'):
         type = data['type']
         value = data['value']
         if (type == 'magnification_level'):
             self.data['magnification_level'] = value[
                 'human_readable_value']
             self.data['x'] = value['x']
             self.data['y'] = value['y']
         elif (type == 'range'):
             self.data['range'] = value
         elif (type == 'adjustment'):
             self.data['x'] = value[0]
             self.data['y'] = value[1]
         elif (type == 'layout' and value == 'options'):
             self.should_show_coords = True
         elif (type == 'layout' and value == 'standard'):
             self.should_show_coords = False
         self._update_overlay()