Package org.openpnp.model

Examples of org.openpnp.model.Location


    }
  }
 
  public Object getValueAt(int row, int col) {
    Camera camera = cameras.get(row);
    Location loc = camera.getLocation();
    switch (col) {
    case 0:
      return camera.getId();
    case 1:
      return camera.getLooking();
View Full Code Here




    @Override
    public Location getLocation(ReferenceHeadMountable hm) {
        return new Location(LengthUnit.Millimeters, x, y, z, c).add(hm
                .getHeadOffsets());
    }
View Full Code Here

     *
     * @param head
     * @return
     */
    protected Location getHeadLocation(Head head) {
        Location l = headLocations.get(head);
        if (l == null) {
            l = new Location(LengthUnit.Millimeters, 0, 0, 0, 0);
            setHeadLocation(head, l);
        }
        return l;
    }
View Full Code Here

        // Convert the Location to millimeters, since that's the unit that
        // this driver works in natively.
        location = location.convertToUnits(LengthUnit.Millimeters);

        // Get the current location of the Head that we'll move
        Location hl = getHeadLocation(hm.getHead());
       
        String movable;
        if (hm.toString().equals("N1")) {
            movable = "Nozzle1";
        }
        else if (hm.toString().equals("N2")) {
            movable = "Nozzle2";
        }
        else if (hm.toString().contains("Camera")) {
            movable = "Camera";
        }
        else if (hm.toString().equals("A1")) {
            movable = "Actuator";
        }
        else {
            throw new Exception("Don't know what " + hm.toString() + " is.");
        }
       
        send(String.format("m,%s,%f,%f,%f,%f", movable, location.getX(), location.getY(), location.getZ(), location.getRotation()));
       
        // Now that movement is complete, update the stored Location to the new
        // Location, unless the incoming Location specified an axis with a value
        // of NaN. NaN is interpreted to mean "Don't move this axis" so we don't
        // update the value, either.

        hl = hl.derive(
                Double.isNaN(location.getX()) ? null : location.getX(),
                Double.isNaN(location.getY()) ? null : location.getY(),
                Double.isNaN(location.getZ()) ? null : location.getZ(),
                Double.isNaN(location.getRotation()) ? null : location.getRotation());
View Full Code Here

    x = y = z= c = 0;
  }
 
  @Override
    public Location getLocation(ReferenceHeadMountable hm) {
        return new Location(LengthUnit.Millimeters, x, y, z, c).add(hm
                .getHeadOffsets());
    }
View Full Code Here

        fireTableCellUpdated(rowIndex, columnIndex);
      }
      else if (columnIndex == 2) {
        LengthCellValue value = (LengthCellValue) aValue;
        Length length = value.getLength();
        Location location = boardLocation.getLocation();
        location = Length.setLocationField(configuration, location, length, Length.Field.X);
        boardLocation.setLocation(location);
      }
      else if (columnIndex == 3) {
        LengthCellValue value = (LengthCellValue) aValue;
        Length length = value.getLength();
        Location location = boardLocation.getLocation();
        location = Length.setLocationField(configuration, location, length, Length.Field.Y);
        boardLocation.setLocation(location);
      }
      else if (columnIndex == 4) {
        LengthCellValue value = (LengthCellValue) aValue;
        Length length = value.getLength();
        Location location = boardLocation.getLocation();
        location = Length.setLocationField(configuration, location, length, Length.Field.Z);
        boardLocation.setLocation(location);
      }
      else if (columnIndex == 5) {
                boardLocation.setLocation(boardLocation.getLocation().derive(null, null, null, Double.parseDouble(aValue.toString())));
View Full Code Here

    }
  }

  public Object getValueAt(int row, int col) {
    BoardLocation boardLocation = job.getBoardLocations().get(row);
    Location loc = boardLocation.getLocation();
    switch (col) {
    case 0:
      return boardLocation.getBoard().getName();
    case 1:
      return boardLocation.getSide();
    case 2:
      return new LengthCellValue(loc.getLengthX());
    case 3:
      return new LengthCellValue(loc.getLengthY());
    case 4:
      return new LengthCellValue(loc.getLengthZ());
    case 5:
      return String.format(configuration.getLengthDisplayFormat(), loc.getRotation(), "");
    default:
      return null;
    }
  }
View Full Code Here

    public void home(ReferenceHead head) throws Exception {
        // TODO: figure out how to home
        // sendCommand("G28.2");

        // TODO: This homeLocation really needs to be Head specific.
        Location homeLocation = this.homeLocation
                .convertToUnits(LengthUnit.Millimeters);
        sendCommand(String.format(Locale.US, "G92 X%2.2f Y%2.2f Z%2.2f A%2.2f",
                homeLocation.getX(), homeLocation.getY(), homeLocation.getZ(),
                homeLocation.getRotation()));

        x = homeLocation.getX();
        y = homeLocation.getY();
        z = homeLocation.getZ();
        c = homeLocation.getRotation();
    }
View Full Code Here

      }
      else if (columnIndex == 3) {
        LengthCellValue value = (LengthCellValue) aValue;
        value.setDisplayNativeUnits(true);
        Length length = value.getLength();
        Location location = placement.getLocation();
        location = Length.setLocationField(configuration, location, length, Length.Field.X, true);
        placement.setLocation(location);
      }
      else if (columnIndex == 4) {
        LengthCellValue value = (LengthCellValue) aValue;
        value.setDisplayNativeUnits(true);
        Length length = value.getLength();
        Location location = placement.getLocation();
        location = Length.setLocationField(configuration, location, length, Length.Field.Y, true);
        placement.setLocation(location);
      }
            else if (columnIndex == 5) {
                placement.setLocation(placement.getLocation().derive(null, null, null, Double.parseDouble(aValue.toString())));
View Full Code Here

    }
  }

  public Object getValueAt(int row, int col) {
    Placement placement = board.getPlacements().get(row);
    Location loc = placement.getLocation();
    switch (col) {
    case 0:
       return placement.getId();
    case 1:
      return placement.getPart();
    case 2:
       return placement.getSide();
    case 3:
      return new LengthCellValue(loc.getLengthX(), true);
    case 4:
      return new LengthCellValue(loc.getLengthY(), true);
    case 5:
      return String.format(configuration.getLengthDisplayFormat(), loc.getRotation());
    case 6:
        return placement.isPlace();
    default:
      return null;
    }
View Full Code Here

TOP

Related Classes of org.openpnp.model.Location

Copyright © 2018 www.massapicom. 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.