Bläddra i källkod

improved output aligment and precision

Steffen Vogel 10 år sedan
förälder
incheckning
fb0996b5db
1 ändrade filer med 6 tillägg och 6 borttagningar
  1. 6
    6
      Marlin/scripts/createTemperatureLookupMarlin.py

+ 6
- 6
Marlin/scripts/createTemperatureLookupMarlin.py Visa fil

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

Laddar…
Avbryt
Spara