old_contents: class BlitzGuiMixin(object):
      def connect_to_logger(self):
          """
          Connects the application to the data logger via a TCP connection
          """
  
          self.application.connect_to_logger()
  
          # update the UI
          self.connect_action.setEnabled(False)
          self.disconnect_action.setEnabled(True)
          self.start_session_action.setEnabled(True)
          self.stop_session_action.setEnabled(False)
          self.motor_control.setEnabled(True)
          self.status_bar.showMessage("Connected to logger")
  
      def disconnect_from_logger(self):
          """
          Disconnects the application from the data logger
          """
  
          self.application.connect_to_logger()
  
          # update the UI
          self.connect_action.setEnabled(True)
          self.disconnect_action.setEnabled(False)
          self.start_session_action.setEnabled(False)
          self.stop_session_action.setEnabled(False)
          self.motor_control.setEnabled(False)
          self.status_bar.showMessage("Disconnected from logger")
  
      def start_session(self):
          """
          Disconnects the application from the data logger
          """
  
          self.application.start_logging()
  
          self.start_session_action.setEnabled(False)
          self.stop_session_action.setEnabled(True)
          self.status_bar.showMessage("Starting session")
  
      def stop_session(self):
          """
          Disconnects the application from the data logger
          """
  
          self.application.stop_logging()
  
          self.start_session_action.setEnabled(True)
          self.stop_session_action.setEnabled(False)
          self.status_bar.showMessage("Stopping session")
  
      def send_move_command(self, angle):
          # clamp to safe range
          if angle < 0: angle = 0
          if angle > 40: angle = 40
  
          # start the command - 0985 is the "set motor on board 09" command
          # the following 8 zeroes are the timestamp
          command = '098500000000'
  
          # build the message - the angle should be packed as a sixteen bit hex value
          command += hex(angle).replace('0x','').rjust(2, '0')
  
          # send the command
          self.application.send_command(command)
  
  
  
  
new_contents: class BlitzGuiMixin(object):
      def connect_to_logger(self):
          """
          Connects the application to the data logger via a TCP connection
          """
  
          self.application.connect_to_logger()
  
          # update the UI
          self.connect_action.setEnabled(False)
          self.disconnect_action.setEnabled(True)
          self.start_session_action.setEnabled(True)
          self.stop_session_action.setEnabled(False)
          self.motor_control.setEnabled(True)
          self.status_bar.showMessage("Connected to logger")
  
      def disconnect_from_logger(self):
          """
          Disconnects the application from the data logger
          """
  
          self.application.connect_to_logger()
  
          # update the UI
          self.connect_action.setEnabled(True)
          self.disconnect_action.setEnabled(False)
          self.start_session_action.setEnabled(False)
          self.stop_session_action.setEnabled(False)
          self.motor_control.setEnabled(False)
          self.status_bar.showMessage("Disconnected from logger")
  
      def start_session(self):
          """
          Disconnects the application from the data logger
          """
  
          self.application.start_logging()
  
          self.start_session_action.setEnabled(False)
          self.stop_session_action.setEnabled(True)
          self.status_bar.showMessage("Starting session")
  
      def stop_session(self):
          """
          Disconnects the application from the data logger
          """
  
          self.application.stop_logging()
  
          self.start_session_action.setEnabled(True)
          self.stop_session_action.setEnabled(False)
          self.status_bar.showMessage("Stopping session")
  
      def send_move_command(self, angle):
          # clamp to safe range
          if angle < 0: angle = 0
          if angle > 40: angle = 40
  
          # start the command - 0985 is the "set motor on board 09" command
          # the following 8 zeroes are the timestamp
          command = '09850000000000'
  
          # build the message - the angle should be packed as a sixteen bit hex value
          command += hex(angle).replace('0x','').rjust(2, '0')
  
          # send the command
          self.application.send_command(command)
  
  
  
  
subject: Correct length motor command message