Package org.openpnp.spi

Examples of org.openpnp.spi.Machine


        System.out.println("Configuration directory: " + workingDirectory);

        Configuration.initialize(workingDirectory);
        Configuration.get().load();

        Machine machine = Configuration.get().getMachine();
        ReferenceMachine referenceMachine = (ReferenceMachine) machine;
        TestDriver testDriver = (TestDriver) referenceMachine.getDriver();
        BasicJobTestDriverDelegate delegate = new BasicJobTestDriverDelegate();
        testDriver.setDelegate(delegate);

        TestCompleteNotifier notifier = new TestCompleteNotifier();

        JobProcessor jobProcessor = machine.getJobProcessor();
        jobProcessor.addListener(new BasicJobTestProcessorListener(notifier));
        jobProcessor.setDelegate(new BasicJobTestJobProcessorDelegate());

        Job job = createSimpleJob();

        Head h1 = machine.getHead("H1");
        Nozzle n1 = h1.getNozzle("N1");
        Nozzle n2 = h1.getNozzle("N2");

        delegate.expectMove("Move N1 to F1", n1, new Location(LengthUnit.Millimeters, -10, 0, 0, 0), 1.0);
        delegate.expectPick(n1);
       
        delegate.expectMove("Move N2 to F1", n2, new Location(LengthUnit.Millimeters, -20, 0, 0, 0), 1.0);
        delegate.expectPick(n2);
       
        delegate.expectMove("Move N1 to R1, Safe-Z", n1, new Location(LengthUnit.Millimeters, 0, 10, 0, 45), 1.0);
        delegate.expectMove("Move N1 to R1, Z", n1, new Location(LengthUnit.Millimeters, 0, 10, 0.825500, 45), 1.0);
        delegate.expectPlace(n1);
        delegate.expectMove("Move N1 to R1, Safe-Z", n1, new Location(LengthUnit.Millimeters, 0, 10, 0, 45), 1.0);
       
        delegate.expectMove("Move N2 to R2, Safe-Z", n2, new Location(LengthUnit.Millimeters, 00, 20, 0, 90), 1.0);
        delegate.expectMove("Move N2 to R2, Z", n2, new Location(LengthUnit.Millimeters, 00, 20, 0.825500, 90), 1.0);
        delegate.expectPlace(n2);
        delegate.expectMove("Move N2 to R2, Safe-Z", n2, new Location(LengthUnit.Millimeters, 00, 20, 0, 90), 1.0);
       
        jobProcessor.load(job);
        machine.setEnabled(true);
        synchronized (notifier) {
            jobProcessor.start();
            notifier.wait();
        }
        if (notifier.failed) {
View Full Code Here


  @Override
    public void run() {
    state = JobState.Running;
    fireJobStateChanged();
   
    Machine machine = Configuration.get().getMachine();
   
    preProcessJob(machine);
   
    for (Head head : machine.getHeads()) {
      fireDetailedStatusUpdated(String.format("Move head %s to Safe-Z.", head.getId()));   
 
      if (!shouldJobProcessingContinue()) {
        return;
      }
 
      try {
        head.moveToSafeZ(1.0);
      }
      catch (Exception e) {
        fireJobEncounteredError(JobError.MachineMovementError, e.getMessage());
        return;
      }
    }
   
    JobPlanner jobPlanner = machine.getJobPlanner();
    Head head = machine.getHeads().get(0);
   
    jobPlanner.setJob(job);

        Set<PlacementSolution> solutions;
    while ((solutions = jobPlanner.getNextPlacementSolutions(head)) != null) {
View Full Code Here

  }
 
  @Override
  public void run() {
    Set<PlacementSolution> solutions;
    Machine machine = Configuration.get().getMachine();
    Head head = machine.getHeads().get(0);
    JobPlanner jobPlanner = machine.getJobPlanner();

    //pre job stuff
    state = JobState.Running;
    fireJobStateChanged();
    try {
View Full Code Here

TOP

Related Classes of org.openpnp.spi.Machine

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.