Esempio n. 1
0
  @Override
  public void fillWithDimensionItem(Segment segment, DimensionItem dimensionItem) {
    StorageElementLink storageElementLink =
        ((SheetDimentionItem) dimensionItem).getStorageElementLink();
    Board board = (Board) storageElementLink.getStoreElement();
    segment.setMaterialLength(board.getLength());
    segment.setMaterialWidth(board.getWidth());

    int length =
        FacadeContext.getCutterFacade()
            .trim(dimensionItem.getDimension(), board.getBoardDef().getCutter())
            .getWidth();
    int width =
        FacadeContext.getCutterFacade()
            .trim(dimensionItem.getDimension(), board.getBoardDef().getCutter())
            .getHeight();

    if (storageElementLink.getStripsEntity() instanceof StripsEntity) {
      length -= board.getBoardDef().getReservedLength().intValue();
      width -= board.getBoardDef().getReservedLength().intValue();
    }

    segment.setLength(length);
    segment.setWidth(width);
  }
Esempio n. 2
0
 @Override
 public List<RestBoardDimension> getRestDimensions(Strips strips) {
   ArrayList<RestBoardDimension> dimensions = new ArrayList<RestBoardDimension>();
   for (Segment segment : strips.getItems()) {
     if (segment.getElements().length > 0) {
       StorageElementLink storageElementLink =
           FacadeContext.getBoardFacade().getStorageElementLinkBy(segment);
       Board board =
           storageElementLink != null
               ? (Board) storageElementLink.getStoreElement()
               : ((SheetDimentionItem) segment.getDimensionItem()).getBoard();
       dimensions.addAll(getFreeDimensions(board, segment));
     }
   }
   return dimensions;
 }