Exemplo n.º 1
0
 public void process() {
   if (in instanceof VSDouble) {
     out.setValue(Math.asin(in.getValue()));
     out.setChanged(true);
     element.notifyPin(0);
   }
 }
  public void start() {
    timer =
        new javax.swing.Timer(
            delay.getValue(),
            new ActionListener() {
              public void actionPerformed(ActionEvent evt) {
                processX();
              }
            });

    started = false;

    counter = from.getValue();
    outValue.setValue(counter);
    outValue.setChanged(true);
    element.notifyPin(0);

    timer.start();
  }
  public void processX() {
    if (started) {
      outValue.setValue(counter);
      outValue.setChanged(true);
      element.notifyPin(0);

      // if (step.getValue()<=0.0000000000001) step.setValue(0.0000000000001);
      // if (to.getValue()>=99999999999999.0) to.setValue(99999999999999.0);

      counter = counter + step.getValue();
      if (counter >= to.getValue()) {
        started = false;
      }

      outImpulse.setValue(true);
      element.notifyPin(1);
      element.jNotifyWhenDestCalled(1, element);
      changed = true;
    }
  }
  public void process() {
    if (start.getValue() == true) {
      if (counter >= to.getValue()) {
        counter = from.getValue();
      }
      started = true;
    }

    if (stop.getValue()) {
      started = false;
    }

    if (delay.getValue() != oldImpuse) {
      oldImpuse = delay.getValue();
      if (timer != null) timer.setDelay(delay.getValue());
    }

    if (reset.getValue() == true) {
      counter = from.getValue();
      outValue.setValue(counter);
      outValue.setChanged(true);
      element.notifyPin(0);
    }
  }