Esempio n. 1
0
    def draw3(self, drawer, resources, state):
        assert (type(resources) == list)
        images = []

        temperature = state.getCurrentTemperature()
        if not temperature:
            if self.getSymbols().getNoDataImageIndex():
                images.append(
                    resources[self.getSymbols().getNoDataImageIndex()])
        else:
            temperature = int(temperature)
            if temperature < 0:
                temperature = -temperature
                if self.getSymbols().getMinusImageIndex():
                    images.append(
                        resources[self.getSymbols().getMinusImageIndex()])

            images.extend(self.getCurrent().getImagesForNumber(
                resources, temperature))

            if self.getSymbols().getDegreesImageIndex():
                images.append(
                    resources[self.getSymbols().getDegreesImageIndex()])

        from watchFaceParser.helpers.drawerHelper import DrawerHelper
        DrawerHelper.drawImages(drawer, images,
                                uint2int(self.getCurrent().getSpacing()),
                                self.getCurrent().getAlignment(),
                                self.getCurrent().getBox())
    def draw3(self, drawer, resources, state):
        symbols = self._parent._parent.getSymbols()
        # appendDegreesForBoth = self._parent.getAppendDegreesForBoth()

        if self.getDay():
            temperature = state.getDayTemperature()
            if temperature:
                images = []
                if temperature < 0:
                    temperature = -temperature
                    if symbols.getMinusImageIndex():
                        images.append(resources[symbols.getMinusImageIndex()])
                images.extend(self.getDay().getImagesForNumber(resources, temperature, 2))
                if symbols:
                    if symbols.getDegreesImageIndex():
                        images.append(resources[symbols.getDegreesImageIndex()])

                from watchFaceParser.helpers.drawerHelper import DrawerHelper
                DrawerHelper.drawImages(drawer, images, uint2int(self.getDay().getSpacing()), self.getDay().getAlignment(), self.getDay().getBox())

        if self.getNight():
            temperature = state.getNightTemperature()
            if temperature:
                images = []
                if temperature < 0:
                    temperature = -temperature
                    if symbols.getMinusImageIndex():
                        images.append(resources[symbols.getMinusImageIndex()])
                images.extend(self.getNight().getImagesForNumber(resources, temperature, 2))
                if symbols:
                    if symbols.getDegreesImageIndex():
                        images.append(resources[symbols.getDegreesImageIndex()])

                from watchFaceParser.helpers.drawerHelper import DrawerHelper
                DrawerHelper.drawImages(drawer, images, uint2int(self.getNight().getSpacing()), self.getNight().getAlignment(), self.getNight().getBox())
Esempio n. 3
0
    def draw3(self, drawer, resources, state):
        images = []

        if self.getIconImageIndex():
            images.append(resources[self.getIconImageIndex()])

        images = images + self.getStep().getImagesForNumber(resources, state.getSteps())

        from watchFaceParser.helpers.drawerHelper import DrawerHelper
        DrawerHelper.drawImages(drawer, images, int(self.getStep().getSpacing()), self.getStep().getAlignment(), self.getStep().getBox())
    def draw3(self, drawer, resources, state):
        assert(type(resources) == list)
        monthAndDay = self._parent

        images = self.getNumber().getImagesForNumber(resources, state.getTime().month, 2 if monthAndDay.getTwoDigitsMonth() else 1)

        images.append(resources[self.getDelimiterImageIndex()])
        for image in self.getNumber().getImagesForNumber(resources, state.getTime().day, 2 if monthAndDay.getTwoDigitsDay() else 1):
            images.append(image)

        from watchFaceParser.helpers.drawerHelper import DrawerHelper
        DrawerHelper.drawImages(drawer, images, uint2int(self.getNumber().getSpacing()), self.getNumber().getAlignment(), self.getNumber().getBox())
Esempio n. 5
0
    def draw3(self, drawer, resources, state):
        assert(type(resources) == list)
        kilometers = state.getDistance() / 1000
        decimals = state.getDistance() % 1000 / 10

        images = self.getNumber().getImagesForNumber(resources, kilometers)
        images.append(resources[self.getDecimalPointImageIndex()])
        for image in self.getNumber().getImagesForNumber(resources, decimals):
            images.add(image)
        images.append(resources[self.getKilometerImageIndex()])

        from watchFaceParser.helpers.drawerHelper import DrawerHelper
        DrawerHelper.drawImages(drawer, images, int(self.getNumber().Spacing), self.getNumber().Alignment, self.getNumber().GetBox())
    def draw3(self, drawer, resources, state):
        assert (type(resources) == list)
        temperature = self._parent

        images = self.getTemperature().getImagesForNumber(
            resources, 27, 2)  #fixed temperature for now....

        #print ("DEBUGGGG",self.getSymbols().getDegreesImageIndex())
        images.append(resources[self.getSymbols().getDegreesImageIndex()])

        from watchFaceParser.helpers.drawerHelper import DrawerHelper
        DrawerHelper.drawImages(drawer, images,
                                uint2int(self.getTemperature().getSpacing()),
                                self.getTemperature().getAlignment(),
                                self.getTemperature().getBox())
    def draw3(self, drawer, resources, state):
        assert (type(resources) == list)
        temperature = self._parent

        images = self._parent.getText().getImagesForNumber(
            resources, state.getBatteryLevel())

        print("DEBUGGGG-", images)
        if self._parent.getPercent():
            images.append(resources[self._parent.getPercent().getImageIndex()])

        from watchFaceParser.helpers.drawerHelper import DrawerHelper
        DrawerHelper.drawImages(drawer, images,
                                uint2int(self._parent.getText().getSpacing()),
                                self._parent.getText().getAlignment(),
                                self._parent.getText().getBox())
Esempio n. 8
0
    def draw3(self, drawer, resources, state):
        assert (type(resources) == list)
        year = self._parent

        #print ("draw3",state.getTime().year)
        images = self.getYear().getImagesForNumber(resources,
                                                   state.getTime().year, 4)
        #print ("draw3",images)

        if self.getDelimiterImageIndex():
            images.append(resources[self.getDelimiterImageIndex().getValue()])
        #for image in self.getYear().getImagesForNumber(resources, state.getTime().day, 2 if monthAndDay.getTwoDigitsDay() else 1):
        #    images.append(image)

        from watchFaceParser.helpers.drawerHelper import DrawerHelper
        DrawerHelper.drawImages(drawer, images,
                                uint2int(self.getYear().getSpacing()),
                                self.getYear().getAlignment(),
                                self.getYear().getBox())
Esempio n. 9
0
    def draw3(self, drawer, images, state):
        assert (type(images) == list)

        shouldPatchPercent = False
        if self.getText() and self.getPercent() and self.getPercent().getX(
        ) == 0 and self.getPercent().getY() == 0:
            # is this hack needed for GTR also?
            shouldPatchPercent = True

        if shouldPatchPercent:
            resources = images
            assert (type(resources) == list)
            battery = state.getBatteryLevel()

            imagesTmp = self.getText().getImagesForNumber(resources, battery)
            imagesTmp.append(resources[self.getPercent().getImageIndex()])

            from watchFaceParser.helpers.drawerHelper import DrawerHelper
            DrawerHelper.drawImages(drawer, imagesTmp,
                                    uint2int(self.getText().getSpacing()),
                                    self.getText().getAlignment(),
                                    self.getText().getBox())
        else:
            if self.getText():
                self.getText().draw3(drawer, images, state)

            if self.getPercent():
                self.getPercent().draw3(drawer, images, state)

        if self.getScale():
            self.getScale().draw3(drawer, images, state)

        if self.getImages():
            self.getImages().draw3(drawer, images, state)

        if self.getBatteryLinear():
            self.getBatteryLinear().draw3(drawer, images, state)

        if self.getUnknown4():
            self.getUnknown4().draw3(drawer, images, state)
 def draw4(self, drawer, images, number, minimumDights=1):
     from watchFaceParser.helpers.drawerHelper import DrawerHelper
     DrawerHelper.drawImages(
         drawer, self.getImagesForNumber(images, number, minimumDights),
         self._spacing, self._alignment, self.getBox())