Interface Machine

    • Field Detail

      • DEFAULT_TASK_BUSY_TIMEOUT_MS

        static final long DEFAULT_TASK_BUSY_TIMEOUT_MS
        See Also:
        Constant Field Values
    • Method Detail

      • getAxes

        java.util.List<Axis> getAxes()
        Gets a List of Axes attached to the Machine.
        Returns:
      • getAxis

        Axis getAxis​(java.lang.String id)
      • getHeads

        java.util.List<Head> getHeads()
        Gets all active heads on the machine.
        Returns:
      • getHead

        Head getHead​(java.lang.String id)
      • getHeadByName

        Head getHeadByName​(java.lang.String name)
      • getSignalers

        java.util.List<Signaler> getSignalers()
        Gets a List of Signalers attached to the Machine.
        Returns:
      • getSignaler

        Signaler getSignaler​(java.lang.String id)
      • getSignalerByName

        Signaler getSignalerByName​(java.lang.String name)
      • getFeeders

        java.util.List<Feeder> getFeeders()
        Gets a List of Feeders attached to the Machine.
        Returns:
      • getFeeder

        Feeder getFeeder​(java.lang.String id)
      • getFeederByName

        Feeder getFeederByName​(java.lang.String name)
      • getCameras

        java.util.List<Camera> getCameras()
        Gets a List of Cameras attached to the Machine that are not attached to Heads.
        Returns:
      • getAllCameras

        java.util.List<Camera> getAllCameras()
        Gets a list of all Cameras attached to the Machine and to all the Heads.
        Returns:
      • getCamera

        Camera getCamera​(java.lang.String id)
      • getActuators

        java.util.List<Actuator> getActuators()
        Get a list of Actuators that are attached to this Machine and not to a Head.
        Returns:
      • getAllActuators

        java.util.List<Actuator> getAllActuators()
        Gets a list of all Actuator attached to the Machine and to all the Heads.
        Returns:
      • getActuator

        Actuator getActuator​(java.lang.String id)
        Get the Actuator attached to this Machine and not to a Head that has the specified id.
        Parameters:
        id -
        Returns:
      • getActuatorByName

        Actuator getActuatorByName​(java.lang.String name)
      • getDrivers

        java.util.List<Driver> getDrivers()
        Gets a List of Drivers attached to the Machine.
        Returns:
      • getDriver

        Driver getDriver​(java.lang.String id)
      • home

        void home()
           throws java.lang.Exception
        Commands all Heads to perform visual homing if available. Depending on the head configuration of the machine the home positions may not all be the same but the end result should be that any head commanded to move to a certain position will end up in the same position.
        Throws:
        java.lang.Exception
      • isEnabled

        boolean isEnabled()
        Returns whether the Machine is currently ready for commands.
      • isHomed

        boolean isHomed()
        Returns whether the Machine is homed
      • setEnabled

        void setEnabled​(boolean enabled)
                 throws java.lang.Exception
        Attempts to bring the Machine to a ready state or attempts to immediately stop it depending on the value of enabled. If true, this would include turning on motor drivers, turning on compressors, resetting solenoids, etc. If the Machine is unable to become ready for any reason it should throw an Exception explaining the reason. This method should block until the Machine is ready. After this method is called successfully, isEnabled() should return true unless the Machine encounters some error. If false, stops the machine and disables it as soon as possible. This may include turning off power to motors and stopping compressors. It is expected that the machine may need to be re-homed after this is called. If the Machine cannot be stopped for any reason, this method may throw an Exception explaining the reason but this should probably only happen in very extreme cases. This method should effectively be considered a software emergency stop. After this method returns, isEnabled() should return false until setEnabled(true) is successfully called again.
        Throws:
        java.lang.Exception
      • setHomed

        void setHomed​(boolean homed)
      • getCompatibleAxisClasses

        java.util.List<java.lang.Class<? extends Axis>> getCompatibleAxisClasses()
      • getCompatibleFeederClasses

        java.util.List<java.lang.Class<? extends Feeder>> getCompatibleFeederClasses()
      • getCompatibleCameraClasses

        java.util.List<java.lang.Class<? extends Camera>> getCompatibleCameraClasses()
      • getCompatibleNozzleClasses

        java.util.List<java.lang.Class<? extends Nozzle>> getCompatibleNozzleClasses()
      • getCompatibleActuatorClasses

        java.util.List<java.lang.Class<? extends Actuator>> getCompatibleActuatorClasses()
      • getCompatibleSignalerClasses

        java.util.List<java.lang.Class<? extends Signaler>> getCompatibleSignalerClasses()
      • getCompatibleDriverClasses

        java.util.List<java.lang.Class<? extends Driver>> getCompatibleDriverClasses()
      • getCompatibleMotionPlannerClasses

        java.util.List<java.lang.Class<? extends MotionPlanner>> getCompatibleMotionPlannerClasses()
      • addAxis

        void addAxis​(Axis axis)
              throws java.lang.Exception
        Throws:
        java.lang.Exception
      • removeAxis

        void removeAxis​(Axis axis)
      • permutateAxis

        void permutateAxis​(Axis axis,
                           int direction)
      • addDriver

        void addDriver​(Driver driver)
                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • removeDriver

        void removeDriver​(Driver driver)
      • permutateDriver

        void permutateDriver​(Driver driver,
                             int direction)
      • addFeeder

        void addFeeder​(Feeder feeder)
                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • removeFeeder

        void removeFeeder​(Feeder feeder)
      • addSignaler

        void addSignaler​(Signaler signaler)
                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • removeSignaler

        void removeSignaler​(Signaler signaler)
      • addCamera

        void addCamera​(Camera camera)
                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • removeCamera

        void removeCamera​(Camera camera)
      • permutateCamera

        void permutateCamera​(Camera driver,
                             int direction)
      • addActuator

        void addActuator​(Actuator actuator)
                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • removeActuator

        void removeActuator​(Actuator actuator)
      • permutateActuator

        void permutateActuator​(Actuator actuator,
                               int direction)
      • submit

        java.util.concurrent.Future<java.lang.Object> submit​(java.lang.Runnable runnable)
      • submit

        <T> java.util.concurrent.Future<T> submit​(java.util.concurrent.Callable<T> callable)
      • submit

        <T> java.util.concurrent.Future<T> submit​(java.util.concurrent.Callable<T> callable,
                                                  com.google.common.util.concurrent.FutureCallback<T> callback)
      • getHomeAfterEnabled

        boolean getHomeAfterEnabled()
      • submit

        <T> java.util.concurrent.Future<T> submit​(java.util.concurrent.Callable<T> callable,
                                                  com.google.common.util.concurrent.FutureCallback<T> callback,
                                                  boolean ignoreEnabled)
        Submit a task to be run with access to the Machine. The submit() and execute() methods are the primary entry points into executing any blocking operation on the Machine. If you are doing anything that results in the Machine doing something it should happen here. With the submit() method, tasks can be cancelled and interrupted via the returned Future. Tasks which operate in a loop should check Thread.currentThread().isInterrupted(). When a task begins the MachineListeners are notified with machineBusy(true). When the task ends, if there are no more tasks to run then machineBusy(false) is called. TODO: When any task is running the driver for the machine is locked and any calls to the driver outside of the task will throw an Exception. If any tasks throws an Exception then all queued future tasks are cancelled. If a task includes a callback the callback is executed before the next task begins. TODO: By supplying a tag you can guarantee that there is only one of a certain type of task queued. Attempting to queue another task with the same tag will return null and the task will not be queued.
        Parameters:
        callable -
        callback -
        ignoreEnabled - True if the task should execute even if the machine is not enabled. This is specifically for enabling the machine and should not typically be used elsewhere.
      • execute

        <T> T execute​(java.util.concurrent.Callable<T> callable,
                      boolean onlyIfEnabled,
                      long busyTimeout,
                      long executeTimeout)
               throws java.lang.Exception
        Execute a task to be run with access to the Machine. The submit() and execute() methods are the primary entry points into executing any blocking operation on the Machine. If you are doing anything that results in the Machine doing something it should happen here. With the execute() method, tasks are executed and waited for, rather than queued. If called from inside a machine task the execution is immediate. If called from a different thread, the task is submitted and then the calling thread will wait for completion. Return value and exceptions are always handled as if called directly.
        Type Parameters:
        T -
        Parameters:
        callable -
        onlyIfEnabled - True if the task must only be executed if the machine is enabled.
        busyTimeout - If the machine is busy executing other submitted task, the execution will be rejected when the timeout (in milliseconds) expires, throwing a TimeoutException. This will typically happen, when a long-running operation like a Job is pending.
        executeTimeout - If the execution takes longer than this time (in milliseconds) the method throws a TimeoutException. Note the callable will still continue after that.
        Returns:
        Throws:
        java.lang.Exception
      • execute

        default <T> T execute​(java.util.concurrent.Callable<T> callable,
                              boolean onlyIfEnabled,
                              long busyTimeout)
                       throws java.lang.Exception
        Calls execute(Callable, boolean, long, long) with default busy timeout.
        Throws:
        java.lang.Exception
      • execute

        default <T> T execute​(java.util.concurrent.Callable<T> callable)
                       throws java.lang.Exception
        Calls execute(Callable, boolean, long, long) with default busy timeout.
        Type Parameters:
        T -
        Parameters:
        callable -
        Returns:
        Throws:
        java.lang.Exception
      • executeIfEnabled

        default <T> T executeIfEnabled​(java.util.concurrent.Callable<T> callable)
                                throws java.lang.Exception
        Same as execute(Callable, boolean, long, long) but the task is only executed if the Machine is enabled.
        Type Parameters:
        T -
        Parameters:
        callable -
        Returns:
        Throws:
        java.lang.Exception
      • isTask

        boolean isTask​(java.lang.Thread thread)
        Determines whether the given thread is a task thread currently executed by the machine.
        Parameters:
        thread -
        Returns:
      • isBusy

        boolean isBusy()
        Returns:
        True if a machine task is currently running/pending.
      • getDefaultHead

        Head getDefaultHead()
                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getPartAlignments

        java.util.List<PartAlignment> getPartAlignments()
      • getDiscardLocation

        Location getDiscardLocation()
      • getDefaultBoardLocation

        Location getDefaultBoardLocation()
      • setSpeed

        void setSpeed​(double speed)
      • getSpeed

        double getSpeed()
      • getProperty

        java.lang.Object getProperty​(java.lang.String name)
      • setProperty

        void setProperty​(java.lang.String name,
                         java.lang.Object value)
      • getNozzleTips

        java.util.List<NozzleTip> getNozzleTips()
        Get a list of the NozzleTips currently attached to the Nozzle.
        Returns:
      • addNozzleTip

        void addNozzleTip​(NozzleTip nozzleTip)
                   throws java.lang.Exception
        Throws:
        java.lang.Exception
      • removeNozzleTip

        void removeNozzleTip​(NozzleTip nozzleTip)
      • getNozzleTip

        NozzleTip getNozzleTip​(java.lang.String id)
      • getNozzleTipByName

        NozzleTip getNozzleTipByName​(java.lang.String name)
      • isAutoToolSelect

        boolean isAutoToolSelect()
        Returns:
        True if the tool in machine controls should be auto-selected based on targeted user action.
      • isSafeZPark

        boolean isSafeZPark()
        Returns:
        True if the Z Park button should move all other HeadMountables to Safe Z.
      • isParkAfterHomed

        boolean isParkAfterHomed()
        Returns:
        True if the machine heads should be parked after the machine was homed.
      • getUnsafeZRoamingDistance

        Length getUnsafeZRoamingDistance()
        Virtual Z axes (typically on cameras) are invisible, therefore it can easily be overlooked by users that it is at unsafe Z. When they later press the Move tool to camera location button, an unexpected Z down-move will result, potentially crashing the tool. The maximum allowable roaming distance at unsafe Z therefore limits the jogging area within which an unsafe virtual Z is kept. It should be enough to fine-adjust a captured location, but jogging further away will automatically move the virtual axis to Safe Z.
        Returns:
        Maximum allowable roaming distance at unsafe Z.
      • isPoolScriptingEngines

        boolean isPoolScriptingEngines()
        Returns:
        True if scripting engines should be pooled for faster reuse.
      • isAutoLoadMostRecentJob

        boolean isAutoLoadMostRecentJob()
        Returns:
        True if automatic loading of most recent job at start has been enabled.