Examples of convertToUnits()


Examples of org.openpnp.model.Length.convertToUnits()

      return;
    }
    if (length.getUnits() == null) {
      length.setUnits(Configuration.get().getSystemUnits());
    }
    length = length.convertToUnits(Configuration.get().getSystemUnits());
    textField.setText(String.format(Configuration.get().getLengthDisplayFormat(), length.getValue()));
  }
}
View Full Code Here

Examples of org.openpnp.model.Length.convertToUnits()

        return;
    }
    // Determine the scaling factor to go from Outline units to
    // Camera units.
    Length l = new Length(1, footprint.getUnits());
    l = l.convertToUnits(cameraUnitsPerPixelUnits);
    double unitScale = l.getValue();
   
    // Create a transform to scale the Shape by
    AffineTransform tx = new AffineTransform();
   
View Full Code Here

Examples of org.openpnp.model.Length.convertToUnits()

        return;
    }
    // Determine the scaling factor to go from Outline units to
    // Camera units.
    Length l = new Length(1, outline.getUnits());
    l = l.convertToUnits(cameraUnitsPerPixelUnits);
    double unitScale = l.getValue();
   
    // Create a transform to scale the Shape by
    AffineTransform tx = new AffineTransform();
   
View Full Code Here

Examples of org.openpnp.model.Length.convertToUnits()

    }
    if (displayNativeUnits && l.getUnits() != configuration.getSystemUnits()) {
      return String.format(configuration.getLengthDisplayFormatWithUnits(), l.getValue(), l.getUnits().getShortName());
    }
    else {
      l = l.convertToUnits(configuration.getSystemUnits());
      return String.format(configuration.getLengthDisplayFormat(), l.getValue());
    }
  }
}
View Full Code Here

Examples of org.openpnp.model.Location.convertToUnits()

    logger.debug(String.format("dx %f, dy %f", dx, dy));
    Location boardLocation = new Location(Configuration.get()
        .getSystemUnits(), dx, dy, 0, angle );
   
    Location oldBoardLocation = jobPanel.getSelectedBoardLocation().getLocation();
    oldBoardLocation = oldBoardLocation.convertToUnits(boardLocation.getUnits());
   
        boardLocation = boardLocation.derive(null, null, oldBoardLocation.getZ(), null);

    jobPanel.getSelectedBoardLocation().setLocation(boardLocation);
    // TODO: Set Board center point when center points are finished.
View Full Code Here

Examples of org.openpnp.model.Location.convertToUnits()

            placementBLocation,
            visionA,
            visionB);
       
    Location oldBoardLocation = jobPanel.getSelectedBoardLocation().getLocation();
    oldBoardLocation = oldBoardLocation.convertToUnits(boardLocation.getUnits());
   
    boardLocation = boardLocation.derive(null, null, oldBoardLocation.getZ(), null);

    jobPanel.getSelectedBoardLocation().setLocation(boardLocation);
    jobPanel.refreshSelectedBoardRow();
View Full Code Here

Examples of org.openpnp.model.Location.convertToUnits()

    if (selectedNozzle == null) {
      return;
    }
   
    Location l = selectedNozzle.getLocation();
    l = l.convertToUnits(configuration.getSystemUnits());
   
    double x, y, z, c;
   
    x = l.getX();
    y = l.getY();
View Full Code Here

Examples of org.openpnp.model.Location.convertToUnits()

      double height = Math.abs(endY - startY);
      // Determine how many images are needed
      BufferedImage image = camera.capture();
      // Figure out how many units per image we are getting
      Location unitsPerPixel = camera.getUnitsPerPixel();
      unitsPerPixel = unitsPerPixel.convertToUnits(Configuration.get().getSystemUnits());
      double imageWidthInUnits = unitsPerPixel.getX() * image.getWidth();
      double imageHeightInUnits = unitsPerPixel.getY() * image.getHeight();
      logger.info(String.format("Images are %d, %d pixels, %2.3f, %2.3f %s",
          image.getWidth(),
          image.getHeight(),
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.