def getProperties(self): properties = [] prop = Property('name', Format.STRING, self.getName()) prop.setIsEditable(True) properties.append(prop) properties.append(Property('messages', Format.DECIMAL, len(self.getMessages()))) properties.append(Property('fields', Format.DECIMAL, len(self.getExtendedFields()))) minMsgSize = None maxMsgSize = 0 avgMsgSize = 0 if len(self.getMessages()) > 0: for m in self.getMessages(): s = len(m.getData()) * 2 if minMsgSize is None or s < minMsgSize: minMsgSize = s if maxMsgSize is None or s > maxMsgSize: maxMsgSize = s avgMsgSize += s avgMsgSize = avgMsgSize / len(self.getMessages()) properties.append(Property('avg msg size (bytes)', Format.DECIMAL, avgMsgSize)) properties.append(Property('min msg size (bytes)', Format.DECIMAL, minMsgSize)) properties.append(Property('max msg size (bytes)', Format.DECIMAL, maxMsgSize)) return properties
def getProperties(self): properties = [] prop = Property('name', Format.STRING, self.getName()) prop.setIsEditable(True) properties.append(prop) properties.append( Property('messages', Format.DECIMAL, len(self.getMessages()))) properties.append( Property('fields', Format.DECIMAL, len(self.getExtendedFields()))) minMsgSize = None maxMsgSize = 0 avgMsgSize = 0 if len(self.getMessages()) > 0: for m in self.getMessages(): s = len(m.getData()) * 2 if minMsgSize is None or s < minMsgSize: minMsgSize = s if maxMsgSize is None or s > maxMsgSize: maxMsgSize = s avgMsgSize += s avgMsgSize = avgMsgSize / len(self.getMessages()) properties.append( Property('avg msg size (bytes)', Format.DECIMAL, avgMsgSize)) properties.append( Property('min msg size (bytes)', Format.DECIMAL, minMsgSize)) properties.append( Property('max msg size (bytes)', Format.DECIMAL, maxMsgSize)) return properties
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
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