public void draw() {
    Canvas canvas = surfaceHolder.lockCanvas();
    try {
      synchronized (surfaceHolder) {
        canvas.drawColor(Color.WHITE);

        if (canvasGrid != null) {
          canvasGrid.draw(canvas);
        }

        if (canvasTrigger != null && triggerEnabled) {
          canvasTrigger.draw(canvas);
        }

        if (canvasSignal != null) {
          canvasSignal.draw(canvas);
        }

        if (canvasMeasure != null && meassureEnabled) {
          canvasMeasure.draw(canvas);
        }
      }

    } catch (Exception e) {
      e.printStackTrace();
    } finally {
      if (canvas != null) {
        surfaceHolder.unlockCanvasAndPost(canvas);
      }
    }
  }
 public void setMaxVoltage(double maxVoltage) {
   canvasMeasure.setVoltage(maxVoltage);
   canvasTrigger.setMaxVoltage(maxVoltage);
 }
 public void setSampleRate(int frecuency, int bufferSize) {
   canvasMeasure.setSampleRate(frecuency, bufferSize);
 }
 public void setPeek2Peek(double peek2peek) {
   canvasMeasure.setPeek2Peek(peek2peek);
 }