def construct(self):
        block = []
        if self.configuration.params:
            comparator = params_helper.shellOnVehicleComparator(
                self.shell, self.configuration.vehicle)
            stockParams = params_helper.getParameters(
                self.itemsCache.items.getStockVehicle(
                    self.configuration.vehicle.intCD))
            for parameter in params_formatters.getRelativeDiffParams(
                    comparator):
                delta = parameter.state[1]
                value = parameter.value
                if delta > 0:
                    value -= delta
                block.append(
                    formatters.packStatusDeltaBlockData(
                        title=text_styles.middleTitle(
                            MENU.tank_params(parameter.name)),
                        valueStr=params_formatters.simplifiedDeltaParameter(
                            parameter),
                        statusBarData={
                            'value': value,
                            'delta': delta,
                            'minValue': 0,
                            'markerValue':
                            stockParams.get(parameter.name, value),
                            'maxValue': max(MAX_RELATIVE_VALUE, value + delta),
                            'useAnim': False
                        },
                        padding=formatters.packPadding(left=75)))

        return block
示例#2
0
    def construct(self):
        blocks = []
        for parameter in params_formatters.getRelativeDiffParams(
                self.__comparator):
            delta = parameter.state[1]
            value = parameter.value
            if delta > 0:
                value -= delta
            blocks.append(
                formatters.packStatusDeltaBlockData(
                    title=text_styles.middleTitle(
                        MENU.tank_params(parameter.name)),
                    valueStr=params_formatters.simplifiedDeltaParameter(
                        parameter),
                    statusBarData=SimplifiedBarVO(
                        value=value,
                        delta=delta,
                        markerValue=self.__stockParams[parameter.name]),
                    padding=self.__padding))

        return blocks
    def construct(self):
        block = []
        if self.configuration.params:
            for parameter in params_formatters.getRelativeDiffParams(
                    self.__comparator):
                delta = parameter.state[1]
                value = parameter.value
                if delta > 0:
                    value -= delta
                block.append(
                    formatters.packStatusDeltaBlockData(
                        title=text_styles.middleTitle(
                            MENU.tank_params(parameter.name)),
                        valueStr=params_formatters.simplifiedDeltaParameter(
                            parameter, self.__isSituational),
                        statusBarData=SimplifiedBarVO(
                            value=value,
                            delta=delta,
                            markerValue=self.__stockParams[parameter.name],
                            isOptional=self.__isSituational),
                        padding=formatters.packPadding(left=105, top=8)))

        return block
    def __packParamsBlock(stockParams, comparator):
        blocks = []
        for parameter in params_formatters.getRelativeDiffParams(comparator):
            delta = parameter.state[1]
            value = parameter.value
            if delta > 0:
                value -= delta
            blocks.append(
                formatters.packStatusDeltaBlockData(
                    title=text_styles.middleTitle(
                        MENU.tank_params(parameter.name)),
                    valueStr=params_formatters.simplifiedDeltaParameter(
                        parameter),
                    statusBarData={
                        'value': value,
                        'delta': delta,
                        'minValue': 0,
                        'markerValue': stockParams[parameter.name],
                        'maxValue': MAX_RELATIVE_VALUE,
                        'useAnim': False
                    },
                    padding=formatters.packPadding(left=67, top=8)))

        return blocks
示例#5
0
 def _getSimplifiedValue(self, param):
     return formatters.simplifiedDeltaParameter(param)
 def _getSimplifiedValue(self, param):
     return formatters.simplifiedDeltaParameter(param, isApproximately=True)