Example #1
0
    def getProperties(self):
        properties = PropertyList()
        configuration = self.getConfiguration()
        properties.append(Property('workspace', Format.STRING, self.getPath()))
        prop = Property('name', Format.STRING, self.getName())
        prop.setIsEditable(True)
        properties.append(prop)

        prop = Property('description', Format.STRING, self.getDescription())
        prop.setIsEditable(True)
        properties.append(prop)

        properties.append(
            Property('date', Format.STRING, self.getCreationDate()))
        properties.append(
            Property('symbols', Format.DECIMAL,
                     len(self.getVocabulary().getSymbols())))
        properties.append(
            Property('messages', Format.DECIMAL,
                     len(self.getVocabulary().getMessages())))
        fields = 0
        for sym in self.getVocabulary().getSymbols():
            fields = fields + len(sym.getField().getExtendedFields())
        properties.append(Property('fields', Format.DECIMAL, fields))

        prop = Property(
            configuration.VOCABULARY_GLOBAL_FORMAT, Format.STRING,
            configuration.getVocabularyInferenceParameter(
                configuration.VOCABULARY_GLOBAL_FORMAT))
        prop.setIsEditable(True)
        prop.setPossibleValues(Format.getSupportedFormats())
        properties.append(prop)

        prop = Property(
            configuration.VOCABULARY_GLOBAL_UNITSIZE, Format.STRING,
            configuration.getVocabularyInferenceParameter(
                configuration.VOCABULARY_GLOBAL_UNITSIZE))
        prop.setIsEditable(True)
        prop.setPossibleValues([
            UnitSize.NONE, UnitSize.BITS4, UnitSize.BITS8, UnitSize.BITS16,
            UnitSize.BITS32, UnitSize.BITS64
        ])
        properties.append(prop)

        prop = Property(
            configuration.VOCABULARY_GLOBAL_SIGN, Format.STRING,
            configuration.getVocabularyInferenceParameter(
                configuration.VOCABULARY_GLOBAL_SIGN))
        prop.setIsEditable(True)
        prop.setPossibleValues([Sign.SIGNED, Sign.UNSIGNED])
        properties.append(prop)

        prop = Property(
            configuration.VOCABULARY_GLOBAL_ENDIANESS, Format.STRING,
            configuration.getVocabularyInferenceParameter(
                configuration.VOCABULARY_GLOBAL_ENDIANESS))
        prop.setIsEditable(True)
        prop.setPossibleValues([Endianess.BIG, Endianess.LITTLE])
        properties.append(prop)
        return properties
Example #2
0
    def getProperties(self):
        properties = PropertyList()
        configuration = self.getConfiguration()
        properties.append(Property("workspace", Format.STRING, self.getPath()))
        prop = Property("name", Format.STRING, self.getName())
        prop.setIsEditable(True)
        properties.append(prop)

        prop = Property("description", Format.STRING, self.getDescription())
        prop.setIsEditable(True)
        properties.append(prop)

        properties.append(Property("date", Format.STRING, self.getCreationDate()))
        properties.append(Property("symbols", Format.DECIMAL, len(self.getVocabulary().getSymbols())))
        properties.append(Property("messages", Format.DECIMAL, len(self.getVocabulary().getMessages())))
        fields = 0
        for sym in self.getVocabulary().getSymbols():
            fields = fields + len(sym.getField().getExtendedFields())
        properties.append(Property("fields", Format.DECIMAL, fields))

        prop = Property(
            configuration.VOCABULARY_GLOBAL_FORMAT,
            Format.STRING,
            configuration.getVocabularyInferenceParameter(configuration.VOCABULARY_GLOBAL_FORMAT),
        )
        prop.setIsEditable(True)
        prop.setPossibleValues(Format.getSupportedFormats())
        properties.append(prop)

        prop = Property(
            configuration.VOCABULARY_GLOBAL_UNITSIZE,
            Format.STRING,
            configuration.getVocabularyInferenceParameter(configuration.VOCABULARY_GLOBAL_UNITSIZE),
        )
        prop.setIsEditable(True)
        prop.setPossibleValues(
            [UnitSize.NONE, UnitSize.BITS4, UnitSize.BITS8, UnitSize.BITS16, UnitSize.BITS32, UnitSize.BITS64]
        )
        properties.append(prop)

        prop = Property(
            configuration.VOCABULARY_GLOBAL_SIGN,
            Format.STRING,
            configuration.getVocabularyInferenceParameter(configuration.VOCABULARY_GLOBAL_SIGN),
        )
        prop.setIsEditable(True)
        prop.setPossibleValues([Sign.SIGNED, Sign.UNSIGNED])
        properties.append(prop)

        prop = Property(
            configuration.VOCABULARY_GLOBAL_ENDIANESS,
            Format.STRING,
            configuration.getVocabularyInferenceParameter(configuration.VOCABULARY_GLOBAL_ENDIANESS),
        )
        prop.setIsEditable(True)
        prop.setPossibleValues([Endianess.BIG, Endianess.LITTLE])
        properties.append(prop)
        return properties