public void process() {
    if (in != null) {
      double value = 0;

      if (in instanceof VSDouble) {
        VSDouble val = (VSDouble) in;
        value = val.getValue();
      } else if (in instanceof VSInteger) {
        VSInteger val = (VSInteger) in;
        value = (double) val.getValue();
      } else if (in instanceof VSByte) {
        VSByte val = (VSByte) in;
        value = (double) val.toSigned(val.getValue());
        // value=val.getValue();
      }

      if (value != oldValue) {
        panelElement = element.getPanelElement();
        if (panelElement != null) {
          panelElement.jProcessPanel(0, value, (Object) this);
          panelElement.jRepaint();
        }
        oldValue = value;
      }
    }
  }
Пример #2
0
 public void setPin(int pinIndex, int dataType, byte io) {
   if (firstTime) {
     element.jInitPins();
     firstTime = false;
   }
   element.jSetPinDataType(pinIndex, dataType);
   element.jSetPinIO(pinIndex, io);
 }
Пример #3
0
  public void drawImageCentred(Graphics g, Image image) {
    if (element != null) {
      Graphics2D g2 = (Graphics2D) g;
      Rectangle r = element.jGetBounds();

      int mitteX = r.width / 2;
      int mitteY = r.height / 2;
      int imageMitteX = image.getWidth(null) / 2;
      int imageMitteY = image.getHeight(null) / 2;

      g2.drawImage(image, r.x + mitteX - imageMitteX, r.y + mitteY - imageMitteY, null);
    }
  }
Пример #4
0
 public void setSize(int width, int height) {
   element.jSetSize(width, height);
 }
Пример #5
0
 public void setName(String name) {
   this.name = name;
   element.jSetName(name);
 }
Пример #6
0
 public void initPinVisibility(boolean top, boolean right, boolean bottom, boolean left) {
   element.jSetTopPinsVisible(top);
   element.jSetRightPinsVisible(right);
   element.jSetBottomPinsVisible(bottom);
   element.jSetLeftPinsVisible(left);
 }
Пример #7
0
 public void initPins(int topPins, int rightPins, int bottomPins, int leftPins) {
   element.jSetTopPins(topPins);
   element.jSetRightPins(rightPins);
   element.jSetBottomPins(bottomPins);
   element.jSetLeftPins(leftPins);
 }