Package org.openpnp.model

Examples of org.openpnp.model.Board


                putValue(SHORT_DESCRIPTION, "Import");
            }
            public void actionPerformed(ActionEvent e) {
                topFile = new File(textFieldTopFile.getText());
                bottomFile = new File(textFieldBottomFile.getText());
                board = new Board();
                List<Placement> placements = new ArrayList<Placement>();
                try {
                    placements.addAll(parseFile(topFile, Side.Top, chckbxCreateMissingParts.isSelected()));
                    placements.addAll(parseFile(bottomFile, Side.Bottom, chckbxCreateMissingParts.isSelected()));
                }
View Full Code Here


              MessageBoxes.errorBox(getTopLevelAncestor(), "Import Failed", e);
              return;
          }
         
        try {
            Board importedBoard = boardImporter.importBoard((Frame) getTopLevelAncestor());
            Board existingBoard = getSelectedBoardLocation().getBoard();
            for (Placement placement : importedBoard.getPlacements()) {
                existingBoard.addPlacement(placement);
            }
            placementsTableModel.fireTableDataChanged();
        }
        catch (Exception e) {
            MessageBoxes.errorBox(getTopLevelAncestor(), "Import Failed", e);
View Full Code Here

              putValue(SHORT_DESCRIPTION, "Import");
          }
          public void actionPerformed(ActionEvent e) {
              topFile = new File(textFieldTopFile.getText());
              bottomFile = new File(textFieldBottomFile.getText());
              board = new Board();
              List<Placement> placements = new ArrayList<Placement>();
              try {
                  if (topFile.exists()) {
                      placements.addAll(parseFile(topFile, Side.Top, chckbxCreateMissingParts.isSelected()));
                  }
View Full Code Here

    }

    private Job createSimpleJob() {
        Job job = new Job();

        Board board = new Board();
        board.setName("test");

        board.addPlacement(createPlacement("R1", "R-0805-10K", 10, 10, 0, 45,
                Side.Top));
        board.addPlacement(createPlacement("R2", "R-0805-10K", 20, 20, 0, 90,
                Side.Top));

        BoardLocation boardLocation = new BoardLocation(board);
        boardLocation.setLocation(new Location(LengthUnit.Millimeters, 0, 0, 0,
                0));
View Full Code Here

          @Override
          public void valueChanged(ListSelectionEvent e) {
            if (e.getValueIsAdjusting()) {
              return;
            }
            Board board = getSelectedBoard();
            boardSelectionActionGroup.setEnabled(board != null);
            if (board == null) {
              placementsTableModel.setBoard(null);
            }
            else {
View Full Code Here

//    Machine machine = configuration.getMachine();
    Head head = machine.getHeads().get(0);
    JobPlanner jobPlanner = machine.getJobPlanner();

    for (BoardLocation jobBoard : job.getBoardLocations()) {
      Board board = jobBoard.getBoard();
     
      for (Placement placement : board.getPlacements()) {
        if (placement.getSide() != jobBoard.getSide()) {
          continue;
        }
       
        Part part = placement.getPart();
        if (part == null) {
          fireJobEncounteredError(JobError.PartError, String.format("Part not found for Board %s, Placement %s", board.getName(), placement.getId()));
          return;
        }
      } 
            // Dry run of solutions to look for errors
      jobPlanner.setJob(job);
View Full Code Here

  }
 
  @Override
  public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
    try {
      Board board = boards.get(rowIndex);
      if (columnIndex == 0) {
        board.setName(aValue.toString());
      }
    }
    catch (Exception e) {
      // TODO: dialog, bad input
    }
View Full Code Here

      // TODO: dialog, bad input
    }
  }

  public Object getValueAt(int row, int col) {
    Board board = boards.get(row);
    switch (col) {
    case 0:
      return board.getName();
    case 1:
      return board.getFile().getPath();
    default:
      return null;
    }
  }
View Full Code Here

TOP

Related Classes of org.openpnp.model.Board

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.