Esempio n. 1
0
  private void drawYGrid(GC gc, double lineStart, double lineStep) {
    Color color_light_blue = new Color(display, 220, 220, 255);

    // double line = minValue;
    double line = lineStart;

    while (line <= maxValue) {
      int y = valueToGraph(line);
      gc.setForeground(color_light_blue);
      gc.drawLine(xStart, y, xEnd, y);
      gc.setForeground(color_black);

      String valueText;
      if (lineStep >= 1d) {
        valueText = Util.doubleToString0(line);
      } else if (lineStep >= 0.1d) {
        valueText = Util.doubleToString1(line);
      } else if (lineStep >= 0.01d) {
        valueText = Util.doubleToString2(line);
      } else {
        valueText = Util.doubleToStringFull(line);
      }

      Painter.drawText(valueText, gc, xStart, y, PosHorizontal.RIGHT, PosVerical.CENTER);
      line += lineStep;
    }
  }
Esempio n. 2
0
 protected StationRawSource(TsDB tsdb, Station station, String[] schema) {
   super(tsdb);
   throwNulls(station, schema);
   this.station = station;
   this.schema = schema;
   if (this.schema.length == 0) {
     throw new RuntimeException("no schema");
   }
   if (!station.isValidSchemaWithVirtualSensors(schema)) {
     throw new RuntimeException(
         "not valid schema: "
             + Util.arrayToString(schema)
             + " in "
             + Util.arrayToString(station.loggerType.sensorNames));
   }
 }