parameters: (self, comp_xml)
docstring: Computes the base ID range of an XMLComponentParser object.
docstring_summary: Computes the base ID range of an XMLComponentParser object.
docstring_tokens: Computes the base ID range of an XMLComponentParser object .
function: def __compute_component_base_id_range(self, comp_xml):
          """
          Computes the base ID range of an XMLComponentParser object.
          """
          if not comp_xml:
              return None
          highest_ID = None
  
          event_id_list = []
          for event in comp_xml.get_events():
              # if len(event.get_ids()) != 1:
              #   print("Component of type {} has multiple IDs for event {}. Please check if the ACConstants.ini file has all the ids set to zero.".format(comp_xml.get_component().get_name() , event.get_name()))
              id = self.__id_to_int(event.get_ids()[0])
  
              if id in event_id_list:
                  print(
                      "IDCollisionError: Event ID {} in component {} is used more than once in the same component.".format(
                          id, comp_xml.get_component().get_name()
                      )
                  )
                  sys.exit(-1)
              event_id_list.append(id)
  
              if highest_ID is None or id > highest_ID:
                  highest_ID = id
  
          channel_id_list = []
          for channel in comp_xml.get_channels():
              # if len(event.get_ids()) != 1:
              #   print("Component of type {} has multiple IDs for event {}. Please check if the ACConstants.ini file has all the ids set to zero.".format(comp_xml.get_component().get_name() , event.get_name()))
              id = self.__id_to_int(channel.get_ids()[0])
  
              if id in channel_id_list:
                  print(
                      "IDCollisionError: Channel ID {} in component {} is used more than once in the same component.".format(
                          id, comp_xml.get_component().get_name()
                      )
                  )
                  sys.exit(-1)
              channel_id_list.append(id)
  
              if highest_ID is None or id > highest_ID:
                  highest_ID = id
  
          command_id_list = []
          for commands in comp_xml.get_commands():
              # if len(event.get_ids()) != 1:
              #   print("Component of type {} has multiple IDs for event {}. Please check if the ACConstants.ini file has all the ids set to zero.".format(comp_xml.get_component().get_name() , event.get_name()))
              id = self.__id_to_int(commands.get_opcodes()[0])
  
              if id in command_id_list:
                  print(
                      "IDCollisionError: Command ID {} in component {} is used more than once in the same component.".format(
                          id, comp_xml.get_component().get_name()
                      )
                  )
                  sys.exit(-1)
              command_id_list.append(id)
  
              if highest_ID is None or id > highest_ID:
                  highest_ID = id
  
          parameter_id_list = []
          parameter_opcode_list = []
          for parameters in comp_xml.get_parameters():
              # if len(event.get_ids()) != 1:
              #   print("Component of type {} has multiple IDs for event {}. Please check if the ACConstants.ini file has all the ids set to zero.".format(comp_xml.get_component().get_name() , event.get_name()))
              # Check ids
              id = self.__id_to_int(parameters.get_ids()[0])
  
              if id in parameter_id_list:
                  print(
                      "IDCollisionError: Parameter ID {} in component {} is used more than once in the same component.".format(
                          id, comp_xml.get_component().get_name()
                      )
                  )
                  sys.exit(-1)
              parameter_id_list.append(id)
  
              if highest_ID is None or id > highest_ID:
                  highest_ID = id
  
              # check set/save op and make sure they don't collide with command IDs
              # Set opcodes
  
              id = self.__id_to_int(parameters.get_set_opcodes()[0])
  
              if id in parameter_opcode_list:
                  print(
                      "IDCollisionError: Parameter set opcode {} in component {} is used more than once in the same component.".format(
                          id, comp_xml.get_component().get_name()
                      )
                  )
                  sys.exit(-1)
              if id in command_id_list:
                  print(
                      "IDCollisionError: Parameter set opcode {} in component {} is the same as another command id in this component.".format(
                          id, comp_xml.get_component().get_name()
                      )
                  )
                  sys.exit(-1)
              parameter_opcode_list.append(id)
  
              if highest_ID is None or id > highest_ID:
                  highest_ID = id
  
              # Save opcodes
  
              id = self.__id_to_int(parameters.get_save_opcodes()[0])
  
              if id in parameter_opcode_list:
                  print(
                      "IDCollisionError: Parameter save opcode {} in component {} is used more than once in the same component.".format(
                          id, comp_xml.get_component().get_name()
                      )
                  )
                  sys.exit(-1)
              if id in command_id_list:
                  print(
                      "IDCollisionError: Parameter save opcode {} in component {} is the same as another command id in this component.".format(
                          id, comp_xml.get_component().get_name()
                      )
                  )
                  sys.exit(-1)
              parameter_opcode_list.append(id)
  
              if highest_ID is None or id > highest_ID:
                  highest_ID = id
  
          if highest_ID is not None:
              return highest_ID + 1
function_tokens: def __compute_component_base_id_range ( self , comp_xml ) : if not comp_xml : return None highest_ID = None event_id_list = [ ] for event in comp_xml . get_events ( ) : # if len(event.get_ids()) != 1: #   print("Component of type {} has multiple IDs for event {}. Please check if the ACConstants.ini file has all the ids set to zero.".format(comp_xml.get_component().get_name() , event.get_name())) id = self . __id_to_int ( event . get_ids ( ) [ 0 ] ) if id in event_id_list : print ( "IDCollisionError: Event ID {} in component {} is used more than once in the same component." . format ( id , comp_xml . get_component ( ) . get_name ( ) ) ) sys . exit ( - 1 ) event_id_list . append ( id ) if highest_ID is None or id > highest_ID : highest_ID = id channel_id_list = [ ] for channel in comp_xml . get_channels ( ) : # if len(event.get_ids()) != 1: #   print("Component of type {} has multiple IDs for event {}. Please check if the ACConstants.ini file has all the ids set to zero.".format(comp_xml.get_component().get_name() , event.get_name())) id = self . __id_to_int ( channel . get_ids ( ) [ 0 ] ) if id in channel_id_list : print ( "IDCollisionError: Channel ID {} in component {} is used more than once in the same component." . format ( id , comp_xml . get_component ( ) . get_name ( ) ) ) sys . exit ( - 1 ) channel_id_list . append ( id ) if highest_ID is None or id > highest_ID : highest_ID = id command_id_list = [ ] for commands in comp_xml . get_commands ( ) : # if len(event.get_ids()) != 1: #   print("Component of type {} has multiple IDs for event {}. Please check if the ACConstants.ini file has all the ids set to zero.".format(comp_xml.get_component().get_name() , event.get_name())) id = self . __id_to_int ( commands . get_opcodes ( ) [ 0 ] ) if id in command_id_list : print ( "IDCollisionError: Command ID {} in component {} is used more than once in the same component." . format ( id , comp_xml . get_component ( ) . get_name ( ) ) ) sys . exit ( - 1 ) command_id_list . append ( id ) if highest_ID is None or id > highest_ID : highest_ID = id parameter_id_list = [ ] parameter_opcode_list = [ ] for parameters in comp_xml . get_parameters ( ) : # if len(event.get_ids()) != 1: #   print("Component of type {} has multiple IDs for event {}. Please check if the ACConstants.ini file has all the ids set to zero.".format(comp_xml.get_component().get_name() , event.get_name())) # Check ids id = self . __id_to_int ( parameters . get_ids ( ) [ 0 ] ) if id in parameter_id_list : print ( "IDCollisionError: Parameter ID {} in component {} is used more than once in the same component." . format ( id , comp_xml . get_component ( ) . get_name ( ) ) ) sys . exit ( - 1 ) parameter_id_list . append ( id ) if highest_ID is None or id > highest_ID : highest_ID = id # check set/save op and make sure they don't collide with command IDs # Set opcodes id = self . __id_to_int ( parameters . get_set_opcodes ( ) [ 0 ] ) if id in parameter_opcode_list : print ( "IDCollisionError: Parameter set opcode {} in component {} is used more than once in the same component." . format ( id , comp_xml . get_component ( ) . get_name ( ) ) ) sys . exit ( - 1 ) if id in command_id_list : print ( "IDCollisionError: Parameter set opcode {} in component {} is the same as another command id in this component." . format ( id , comp_xml . get_component ( ) . get_name ( ) ) ) sys . exit ( - 1 ) parameter_opcode_list . append ( id ) if highest_ID is None or id > highest_ID : highest_ID = id # Save opcodes id = self . __id_to_int ( parameters . get_save_opcodes ( ) [ 0 ] ) if id in parameter_opcode_list : print ( "IDCollisionError: Parameter save opcode {} in component {} is used more than once in the same component." . format ( id , comp_xml . get_component ( ) . get_name ( ) ) ) sys . exit ( - 1 ) if id in command_id_list : print ( "IDCollisionError: Parameter save opcode {} in component {} is the same as another command id in this component." . format ( id , comp_xml . get_component ( ) . get_name ( ) ) ) sys . exit ( - 1 ) parameter_opcode_list . append ( id ) if highest_ID is None or id > highest_ID : highest_ID = id if highest_ID is not None : return highest_ID + 1