fixed sequence to floating point conversion in usals parameters
authorStefan Pluecken <stefan.pluecken@multimedia-labs.de>
Sun, 1 Jan 2006 13:32:30 +0000 (13:32 +0000)
committerStefan Pluecken <stefan.pluecken@multimedia-labs.de>
Sun, 1 Jan 2006 13:32:30 +0000 (13:32 +0000)
lib/python/Components/NimManager.py
lib/python/Components/config.py

index 60484d615a2e725116a94f8f74ff93aaa48b9c40..b3be2603f433db5aca0c9034ccd569e88ce49684 100644 (file)
@@ -127,9 +127,9 @@ class SecConfigure:
                                                else:
                                                        loValue = rotorParam.WEST
                                                self.addLNBSimple(sec, slotid = x, diseqcmode = 3,
-                                                       longitude = float(str(nim.longitude.value[0]) + "." + str(nim.longitude.value[1])),
+                                                       longitude = configsequencearg.getFloat(nim.longitude),
                                                        loDirection = loValue,
-                                                       latitude = float(str(nim.latitude.value[0]) + "." + str(nim.latitude.value[1])),
+                                                       latitude = configsequencearg.getFloat(nim.latitude),
                                                        laDirection = laValue)
 #                                      pass
                                elif currentConfigSelectionElement(nim.configMode) == "nothing":
@@ -254,9 +254,9 @@ class SecConfigure:
                                                sec.setCommandOrder(currCO)
                                                
                                if currentConfigSelectionElement(currLnb.diseqcMode) == "1_2":
-                                       latitude = float(str(currLnb.latitude.value[0]) + "." + str(currLnb.latitude.value[1]))
+                                       latitude = configsequencearg.getFloat(currLnb.latitude)
                                        sec.setLatitude(latitude)
-                                       longitude = float(str(currLnb.longitude.value[0]) + "." + str(currLnb.longitude.value[1]))
+                                       longitude = configsequencearg.getFloat(currLnb.longitude)
                                        sec.setLongitude(longitude)
                                        if currentConfigSelectionElement(currLnb.latitudeOrientation) == "north":
                                                sec.setLaDirection(rotorParam.NORTH)
index 25684fc186dcda69b112869e5ffd145f6db476d2..40a460c2e3d134dc0b534459131a84028b0aaba1 100644 (file)
@@ -181,6 +181,9 @@ class configSequenceArg:
                # configsequencearg.get("FLOAT", [(min,max),(min1,max1)]) => x.y with min <= x <= max and min1 <= y <= max1
                if (type == "FLOAT"):
                        return (("."), args, "")
+               
+       def getFloat(self, element):
+               return float(("%d.%0" + str(len(str(element.vals[1][1][1]))) + "d") % (element.value[0], element.value[1]))
 
 configsequencearg = configSequenceArg()