Explorar el Código

improved output aligment and precision

Steffen Vogel hace 10 años
padre
commit
fb0996b5db
Se han modificado 1 ficheros con 6 adiciones y 6 borrados
  1. 6
    6
      Marlin/scripts/createTemperatureLookupMarlin.py

+ 6
- 6
Marlin/scripts/createTemperatureLookupMarlin.py Ver fichero

@@ -137,13 +137,13 @@ def main(argv):
137 137
     print "#define NUMTEMPS %s" % (len(temps))
138 138
     print "const short temptable[NUMTEMPS][2] PROGMEM = {"
139 139
 
140
-    counter = 0
141 140
     for temp in temps:
142
-        counter = counter +1
143
-        if counter == len(temps):
144
-            print "   {(short)(%.2f*OVERSAMPLENR), %s}  // v=%s r=%s res=%s C/count" % ((t.adc(temp)), temp, t.v(t.adc(temp)), t.r(t.adc(temp)),t.res(t.adc(temp)))
145
-        else:
146
-            print "   {(short)(%.2f*OVERSAMPLENR), %s}, // v=%s r=%s res=%s C/count" % ((t.adc(temp)), temp, t.v(t.adc(temp)), t.r(t.adc(temp)),t.res(t.adc(temp)))
141
+        print "    { (short) (%7.2f * OVERSAMPLENR ), %s\t}%s // v=%.3f\tr=%.3f\tres=%.3f degC/count" % ( t.adc(temp), temp, \
142
+                        ',' if temp != temps[-1] else ' ', \
143
+                        t.v(  t.adc(temp)), \
144
+                        t.r(  t.adc(temp)), \
145
+                        t.res(t.adc(temp)) \
146
+                    )
147 147
     print "};"
148 148
 
149 149
 def usage():

Loading…
Cancelar
Guardar