User Tools

Site Tools


processing:thermometer_example

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
processing:thermometer_example [2013/08/04 03:19] – [How to make a thermometer] mithatprocessing:thermometer_example [2013/08/04 03:32] – [Updating the data] mithat
Line 346: Line 346:
          
     background(#296783);     background(#296783);
-    drawDigitalTemp(condition.getInt(ATTRIBUTE_CONDITION_TEMPERATURE), +     
-        units.getString(ATTRIBUTE_UNIT_TEMPERATURE), width/2, height/2); +    int temperature = condition.getInt(ATTRIBUTE_CONDITION_TEMPERATURE); 
-    drawMeter(70, -40, 120, 10, height-2*BORDER, width-10-BORDER, BORDER);+    drawDigitalTemp(temperature, units.getString(ATTRIBUTE_UNIT_TEMPERATURE), 
 +                    width/2, height/2); 
 +    drawMeter(temperature, -40, 120, 10, height-2*BORDER, width-10-BORDER, BORDER);
   }   }
   catch (Exception e) {   catch (Exception e) {
Line 365: Line 367:
  
 /** /**
- * Render the temperature numerically at a given canvas location.+ * Render temperature numerically at a given canvas location.
  *  *
  * @param temperature the temperature to be drawn (int)  * @param temperature the temperature to be drawn (int)
Line 385: Line 387:
  
 /** /**
- * Render the temperature graphically.+ * Render a value on a vertical meter.
  *  *
  * @param val      the value to be drawn (float)  * @param val      the value to be drawn (float)
Line 479: Line 481:
  
     background(#296783);     background(#296783);
-    drawDigitalTemp(condition.getInt(ATTRIBUTE_CONDITION_TEMPERATURE) +    int temperature = condition.getInt(ATTRIBUTE_CONDITION_TEMPERATURE); 
-                    units.getString(ATTRIBUTE_UNIT_TEMPERATURE), width/2, height/2); +    drawDigitalTemp(temperature, units.getString(ATTRIBUTE_UNIT_TEMPERATURE), 
-    drawMeter(70, -40, 120, 10, height-2*BORDER, width-10-BORDER, BORDER);+                    width/2, height/2); 
 +    drawMeter(temperature, -40, 120, 10, height-2*BORDER, width-10-BORDER, BORDER);
  
     // uncomment println below for debugging.      // uncomment println below for debugging. 
Line 520: Line 523:
  
 /** /**
- * Render the temperature graphically.+ * Render a value on a vertical meter.
  *  *
  * @param val      the value to be drawn (float)  * @param val      the value to be drawn (float)
processing/thermometer_example.txt · Last modified: 2013/08/04 03:55 by mithat

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki