Пример #1
0
 def createChildForParameter(self, parameter):
     parameterId = parameter.getId()
     if parameterId == 1:
         from watchFaceParser.models.elements.analogDial.hoursClockHandElement import HoursClockHandElement
         self._hours = HoursClockHandElement(parameter = parameter, parent = self, name = 'Hours')
         return self._hours
     elif parameterId == 2:
         from watchFaceParser.models.elements.analogDial.minutesClockHandElement import MinutesClockHandElement
         self._minutes = MinutesClockHandElement(parameter = parameter, parent = self, name = 'Minutes')
         return self._minutes
     elif parameterId == 3:
         from watchFaceParser.models.elements.analogDial.secondsClockHandElement import SecondsClockHandElement
         self._seconds = SecondsClockHandElement(parameter = parameter, parent = self, name = 'Seconds')
         return self._seconds
     elif parameterId == 4:
         from watchFaceParser.models.elements.common.imageElement import ImageElement
         self._centerImage = ImageElement(parameter = parameter, parent = self, name = 'SecCenterImage') # SecCenterImage
         return self._centerImage
     elif parameterId == 5:
         from watchFaceParser.models.elements.common.imageElement import ImageElement
         self._centerImage = ImageElement(parameter = parameter, parent = self, name = 'HourCenterImage') # HourCenterImage
         return self._centerImage
     elif parameterId == 6:
         from watchFaceParser.models.elements.common.imageElement import ImageElement
         self._centerImage = ImageElement(parameter = parameter, parent = self, name = 'MinCenterImage')  # MinCenterImage
         return self._centerImage			
     else:
         return super(AnalogDialElement, self).createChildForParameter(parameter)
Пример #2
0
 def createChildForParameter(self, parameter):
     parameterId = parameter.getId()
     from watchFaceParser.models.elements.basic.valueElement import ValueElement
     if parameterId == 1:
         from watchFaceParser.models.elements.battery.batteryNumberElement import BatteryNumberElement
         self._text = BatteryNumberElement(parameter=parameter,
                                           parent=self,
                                           name='?_text?')
         return self._text
     elif parameterId == 2:
         from watchFaceParser.models.elements.battery.batteryGaugeElement import BatteryGaugeElement  # temp.
         self._images = BatteryGaugeElement(parameter=parameter,
                                            parent=self,
                                            name='?_images?')
         return self._images
     elif parameterId == 6:
         from watchFaceParser.models.elements.common.imageElement import ImageElement
         self._percent = ImageElement(parameter=parameter,
                                      parent=self,
                                      name='?_percent?')
         return self._percent
     elif parameterId == 7:
         from watchFaceParser.models.elements.battery.circularBatteryElement import CircularBatteryElement
         self._scale = CircularBatteryElement(parameter=parameter,
                                              parent=self,
                                              name='_scale')
         return self._scale
     else:
         return super(BatteryElement,
                      self).createChildForParameter(parameter)
Пример #3
0
 def createChildForParameter(self, parameter):
     parameterId = parameter.getId()
     if parameterId == 1:
         from watchFaceParser.models.elements.common.twoDigitsElement import TwoDigitsElement
         self._hours = TwoDigitsElement(parameter=parameter,
                                        parent=self,
                                        name='Hours')
         return self._hours
     elif parameterId == 2:
         from watchFaceParser.models.elements.common.twoDigitsElement import TwoDigitsElement
         self._minutes = TwoDigitsElement(parameter=parameter,
                                          parent=self,
                                          name='Minutes')
         return self._minutes
     elif parameterId == 3:
         from watchFaceParser.models.elements.common.twoDigitsElement import TwoDigitsElement
         self._seconds = TwoDigitsElement(parameter=parameter,
                                          parent=self,
                                          name='Seconds')
         return self._seconds
     elif parameterId == 4:
         from watchFaceParser.models.elements.time.amPmElement import AmPmElement
         self._amPm = AmPmElement(parameter=parameter,
                                  parent=self,
                                  name='AmPm')
         return self._amPm
     elif parameterId == 5:
         pass
     elif parameterId == 10:
         from watchFaceParser.models.elements.common.imageElement import ImageElement
         self._delimiter = ImageElement(parameter=parameter,
                                        parent=self,
                                        name='Delimiter')
         return self._delimiter
     elif parameterId == 11:
         from watchFaceParser.models.elements.common.imageElement import ImageElement
         self._delimiter2 = ImageElement(parameter=parameter,
                                         parent=self,
                                         name='Delimiter2')
         return self._delimiter2
     elif parameterId == 12:
         from watchFaceParser.models.elements.time.pmElement import PmElement
         self._pm = PmElement(parameter=parameter, parent=self, name='Pm')
         return self._pm
     else:
         return super(TimeElement, self).createChildForParameter(parameter)
Пример #4
0
 def createChildForParameter(self, parameter):
     parameterId = parameter.getId()
     if parameterId == 1:
         from watchFaceParser.models.elements.common.imageElement import ImageElement
         self._image = ImageElement(parameter=parameter,
                                    parent=self,
                                    name='Image')
         return self._image
     elif parameterId == 3:
         pass
     elif parameterId == 4:
         from watchFaceParser.models.elements.common.imageElement import ImageElement
         self._frontImage = ImageElement(parameter=parameter,
                                         parent=self,
                                         name='FrontImage')
         return self._frontImage
     else:
         return super(BackgroundElement,
                      self).createChildForParameter(parameter)
Пример #5
0
 def createChildForParameter(self, parameter):
     parameterId = parameter.getId()
     if parameterId == 1:
         from watchFaceParser.models.elements.activity.stepsGoalElement import StepsGoalElement
         self._stepsGoal = StepsGoalElement(parameter=parameter,
                                            parent=self,
                                            name='?StepsGoal?')
         return self._stepsGoal
     elif parameterId == 2:
         from watchFaceParser.models.elements.activity.caloriesElement import CaloriesElement
         self._calories = CaloriesElement(parameter=parameter,
                                          parent=self,
                                          name='?Calories?')
         return self._calories
     elif parameterId == 3:
         from watchFaceParser.models.elements.activity.pulseElement import PulseElement
         self._pulse = PulseElement(parameter=parameter,
                                    parent=self,
                                    name='?Pulse?')
         return self._pulse
     elif parameterId == 4:
         from watchFaceParser.models.elements.activity.distanceElement import DistanceElement
         self._distance = DistanceElement(parameter=parameter,
                                          parent=self,
                                          name='?DistanceElement?')
         return self._distance
     elif parameterId == 5:
         from watchFaceParser.models.elements.activity.stepsElement import StepsElement
         self._steps = StepsElement(parameter=parameter,
                                    parent=self,
                                    name='?Steps?')
         return self._steps
     elif parameterId == 7:
         from watchFaceParser.models.elements.activity.starImageElement import StarImageElement
         self._starImage = StarImageElement(parameter=parameter,
                                            parent=self,
                                            name='?StarImage?')
         return self._starImage
     elif parameterId == 9:
         from watchFaceParser.models.elements.common.imageElement import ImageElement
         self._circleRange = ImageElement(parameter=parameter,
                                          parent=self,
                                          name='?CircleRange?')
         return self._circleRange
     elif parameterId == 11:
         from watchFaceParser.models.elements.activity.goal2Element import Goal2Element
         self._goal2 = Goal2Element(parameter=parameter,
                                    parent=self,
                                    name='?Goal2?')
         return self._goal2
     else:
         print("unsupported parameterid", parameterId)
         return super(ActivityElement,
                      self).createChildForParameter(parameter)
Пример #6
0
 def createChildForParameter(self, parameter):
     parameterId = parameter.getId()
     if parameterId == 5:
         from watchFaceParser.models.elements.common.imageElement import ImageElement
         self._centerImage = ImageElement(parameter=parameter,
                                          parent=self,
                                          name='CenterImage')
         return self._centerImage
     else:
         return super(ClockHandElement,
                      self).createChildForParameter(parameter)
Пример #7
0
 def createChildForParameter(self, parameter):
     parameterId = parameter.getId()
     from watchFaceParser.models.elements.basic.valueElement import ValueElement
     if parameterId == 1:
         from watchFaceParser.models.elements.battery.batteryNumberElement import BatteryNumberElement
         self._text = BatteryNumberElement(parameter=parameter,
                                           parent=self,
                                           name='?_text?')
         return self._text
     elif parameterId == 2:
         from watchFaceParser.models.elements.battery.batteryGaugeElement import BatteryGaugeElement  # temp.
         self._images = BatteryGaugeElement(parameter=parameter,
                                            parent=self,
                                            name='?_images?')
         return self._images
     elif parameterId == 6:
         from watchFaceParser.models.elements.common.imageElement import ImageElement
         self._percent = ImageElement(parameter=parameter,
                                      parent=self,
                                      name='?_percent?')
         return self._percent
     elif parameterId == 7:
         from watchFaceParser.models.elements.battery.circularBatteryElement import CircularBatteryElement
         self._scale = CircularBatteryElement(parameter=parameter,
                                              parent=self,
                                              name='_scale')
         return self._scale
     elif parameterId == 3:  #icons - this is the circular battery element found in GTS - Silver Watchface
         from watchFaceParser.models.elements.battery.batteryLinearElement import BatteryLinearElement
         self._batteryLinear = BatteryLinearElement(parameter=parameter,
                                                    parent=self,
                                                    name='?pulseLinear?')
         return self._batteryLinear
     elif parameterId == 4:  #unknown4
         from watchFaceParser.models.elements.battery.unknown4Element import Unknown4Element
         self._unknown4 = Unknown4Element(parameter=parameter,
                                          parent=self,
                                          name='Unknown4')
         return self._unknown4
     else:
         return super(BatteryElement,
                      self).createChildForParameter(parameter)
Пример #8
0
 def createChildForParameter(self, parameter):
     parameterId = parameter.getId()
     if parameterId == 1:
         #from watchFaceParser.models.elements.common.coordinatesElement import CoordinatesElement
         #self._center = CoordinatesElement(parameter = parameter, parent = self, name = 'OnlyBorder')
         #return self._center
         pass
     elif parameterId == 2:
         from resources.image.color import Color
         from watchFaceParser.models.elements.basic.valueElement import ValueElement
         self._color = Color.fromArgb(0xff000000 | parameter.getValue())
         return ValueElement(parameter=parameter,
                             parent=self,
                             name='?_color?')
     elif parameterId == 3:
         from watchFaceParser.models.elements.common.coordinatesElement import CoordinatesElement
         self._center = CoordinatesElement(parameter=parameter,
                                           parent=self,
                                           name='CenterOffset')
         return self._center
     if parameterId == 4:
         #from watchFaceParser.models.elements.common.coordinatesElement import CoordinatesElement
         #self._center = CoordinatesElement(parameter = parameter, parent = self, name = 'Shape')
         #return self._center
         pass
     elif parameterId == 5:
         from watchFaceParser.models.elements.common.imageElement import ImageElement
         self._centerImage = ImageElement(parameter=parameter,
                                          parent=self,
                                          name='Image')
         return self._centerImage
     elif parameterId == 6:
         from watchFaceParser.models.elements.common.sectorElement import SectorElement
         self._sector = SectorElement(parameter=parameter,
                                      parent=self,
                                      name='Sector')
         return self._sector
         pass
     else:
         return super(ClockHandElement,
                      self).createChildForParameter(parameter)