Module: fabmo.js

The top-level object representing the dashboard.

Methods

clearJobQueue
(
  • callback
)

Defined in fabmo.js:570

Remove all pending jobs from the queue.

Parameters:

  • callback Function
    • err Error

      Error object if there was an error.

deleteJob
(
  • id
  • callback
)

Defined in fabmo.js:523

Delete a job (cancels if running, sends to trash otherwise.)

Parameters:

  • id Number

    The ID of the job to delete

  • callback Function
    • err Error

      Error object if there was an error.

getAppArgs ()

Defined in fabmo.js:301

If this app was invoked from another app, get the arguments (if any) that were passed on invocation.

getAppConfig
(
  • callback
)

Defined in fabmo.js:914

Get the configuration object for the currently running app. The configuration object is a JSON object of no specific description that is saved with each app. It can be used to store app-specific configuration data.

Parameters:

  • callback Function
    • err Error

      Error object if there was an error.

    • config Object

      Configuration object or {} if no configuration has been saved in the app.

getAppInfo
(
  • callback
)

Defined in fabmo.js:311

Get the information for this app.

Parameters:

  • callback Function
    • err Error

      Error object if there was an error.

    • info Object

      App information

      • name String
        The name of the App
getApps
(
  • callback
)

Defined in fabmo.js:688

Get the list of all the installed apps.

Parameters:

  • callback Function
    • err Error

      Error object if there was an error.

    • apps Object

      List of app objects representing all installed apps.

getJobHistory
(
  • options
  • callback
)

Defined in fabmo.js:581

Get a list of jobs in the history.

Parameters:

  • options Object
    • start Number

      The location in the results to start

    • count Number

      The number of jobs to return

  • callback Function
    • err Error

      Error object if there was an error.

    • jobs Object[][]

      Array of jobs in the history

getJobInfo
(
  • id
  • callback
)

Defined in fabmo.js:537

Get information about a job. This works for jobs that are pending, currently running, or in the history.

Parameters:

  • id Number

    The ID of the job to cancel

  • callback Function
    • err Error

      Error object if there was an error.

    • job Object

      Information about the requested job.

      • name String
        Job name
      • description String
        Job description
      • created_at Number
        Job creation time (UTC datetime)
      • started_at Number
        Job start time (UTC datetime)
      • finished_at Number
        Job completion time (UTC datetime)
      • state String
        Current state of the job. One of pending,running,finished,cancelled or failed
getJobsInQueue
(
  • callback
)

Defined in fabmo.js:556

Get a list of jobs that are currently pending and running.

Parameters:

  • callback Function
    • err Error

      Error object if there was an error.

    • jobs Object

      Object containing both the pending and running jobs

      • pending Array
        List of pending jobs. May be empty.
      • running Array
        List of running jobs. May be empty.
getMacros
(
  • callback
)

Defined in fabmo.js:818

Get a list of all the macros installed on the tool.

Parameters:

  • callback Object
    • err Error

      Error object if there was an error.

    • macros Object

      List of macro objects currently installed.

getVersion
(
  • callback
)

Defined in fabmo.js:940

Get the current FabMo version

Parameters:

  • callback Fuction
    • err Error

      Error object if there was an error.

    • version Object

      Object describing the fabmo software version.

      • hash String
        The git hash of the currently running FabMo software
      • number String
        The user-friendly release version number (or empty string if not a released version
      • debug Boolean
        True if FabMo is running in "debug mode"
      • type String
        The type of FabMo software build. dev for development or release for released build.
hideDRO
(
  • callback
)

Defined in fabmo.js:349

Hide the DRO (Digital ReadOut) in the dashboard if it is not already hidden.

Parameters:

  • callback Function

    Called once the DRO has been hidden.

    • err Error

      Error object if there was an error.

isPresent () Boolean

Defined in fabmo.js:61

Returns:

Boolean:

True if running in the actual FabMo dashboard. False otherwise.

launchApp
(
  • id
  • args
  • callback
)

Defined in fabmo.js:324

Launch the specified app by app ID, with optional arguments.

Parameters:

  • id String

    The id of the app to launch.

  • args Object

    Arguments object to pass to the app.

  • callback Function
    • err Error

      Error object if there was an error

    • app Object

      App info for the launched app if launch was successful

manualHeartbeat ()

Defined in fabmo.js:669

Send a "heartbeat" to the system, authorizing continued manual movement. Manual moves must be continually refreshed with this heartbeat function, or the tool will stop moving.

manualMoveFixed
(
  • axis
  • speed
  • distance
  • callback
)

Defined in fabmo.js:644

Perform a fixed manual move in a single axis. (Sometimes called a nudge)

Parameters:

  • axis String

    One of x,y,z,a,b,c

  • speed Number

    Speed in current tool units

  • distance Distance

    The distance to move in current units

  • callback Function
    • err Error

      Error object if there was an error.

manualStart
(
  • axis
  • speed
)

Defined in fabmo.js:658

Start performing a manual move of the specified axis at the specified speed.

Parameters:

  • axis Number

    One of x,y,z,a,b,c

  • speed Number

    Speed in current tool units. Negative to move in the negative direction.

manualStop ()

Defined in fabmo.js:679

Stop the tool immediately.

navigate
(
  • url
  • options
)

Defined in fabmo.js:956

Control top level navigation for the dashboard. Usually this is used to open another browser/tab window with a link from within an app, or more rarely, to navigate away from the dashboard.

Parameters:

  • url String

    The URL to open

  • options Object

    Options for top-level navigation.

    • target String

      The link target (same as the target argument of window.open)

notify
(
  • type
  • message
  • callback
)

Defined in fabmo.js:394

Show a notification on the dashboard. Notifications typically show up as toaster message somewhere on the dashboard, but the dashboard reserves the right to format or even suppress these messages as suits its needs.

Parameters:

  • type String

    Type of message, which can be one of info,warn,error, or success

  • message String

    The text to be displayed in the notification.

  • callback Function

    Called once the message has been displayed

    • err Error

      Error object if there was an error.

on
(
  • name
  • callback
)

Defined in fabmo.js:239

Bind a callback to the specified event.

Parameters:

pause
(
  • options
  • callback
)

Defined in fabmo.js:608

Pause the execution of the current job or operation. Operation can be resumed.

Parameters:

ready ()

Defined in fabmo.js:282

Indicate that the app is loaded and ready to go!

requestStatus
(
  • callback
)

Defined in fabmo.js:846

Request a status report from the system. The status object is returned in the callback to this function, as well as posted with the status event. To recieve updates to system status as it changes, you should bind a handler to the status event, and not poll using requestStatus.

Parameters:

  • callback Function
    • status Object

      The status report object

      • state String
        The system state, one of idle,running,paused,stopped,manual or dead
      • posx Number
        The current x-axis position
      • posy Number
        The current y-axis position
      • posz Number
        The current z-axis position
      • posa Number
        The current a-axis position
      • posb Number
        The current b-axis position
      • posc Number
        The current c-axis position
      • in1 Number
        The current state of input 1 (0 or 1)
      • in1 Number
        The current state of input 2 (0 or 1)
      • in1 Number
        The current state of input 3 (0 or 1)
      • in1 Number
        The current state of input 4 (0 or 1)
      • in1 Number
        The current state of input 5 (0 or 1)
      • in1 Number
        The current state of input 6 (0 or 1)
      • in1 Number
        The current state of input 7 (0 or 1)
      • in1 Number
        The current state of input 8 (0 or 1)
      • unit String
        The current tool units (either in or mm)
      • line Number
        The line number in the currently running file (if a file is running)
      • nb_lines Number
        The total number of lines in the currently running file (if a file is running)
      • auth Boolean
        True if the tool is currently authorized for movement
      • current_file Object
        Object describing the currently running file (or null if not running a file)
      • job Object
        Object describing the currently running job (or null if not running a job)
resubmitJob
(
  • id
  • callback
)

Defined in fabmo.js:511

Resubmit a job by its ID. Resubmitted jobs come in at the back of the job queue.

Parameters:

  • id Number

    The ID of the job to resubmit

  • callback Function
    • err Error

      Error object if there was an error.

resume
(
  • options
  • callback
)

Defined in fabmo.js:632

Resume the current operation of the system is paused.

Parameters:

runGCode
(
  • text
  • callback
)

Defined in fabmo.js:747

Run the provided G-Code string immediately. Multiline strings are accepted.

Parameters:

  • text String

    The G-Code command(s) to run.

  • callback Function
    • err Error

      Error object if there was an error.

runMacro
(
  • id
  • callback
)

Defined in fabmo.js:830

Run the specified macro immediately. Macro does not appear in the job history.

Parameters:

  • id Number

    The id of the macro to run.

  • callback Object
    • err Error

      Error object if there was an error.

runNext
(
  • options
  • callback
)

Defined in fabmo.js:596

Run the next job in the job queue.

Parameters:

runSBP
(
  • text
  • callback
)

Defined in fabmo.js:759

Run the provided OpenSBP string immediately. Multiline strings are accepted.

Parameters:

  • text String

    The OpenSBP command(s) to run.

  • callback Function
    • err Error

      Error object if there was an error.

setAppConfig
(
  • config
  • callback
)

Defined in fabmo.js:927

Set the app configuration to the provided option.

Parameters:

  • config Object

    The configuration object to set.

  • callback Function
    • err Error

      Error object if there was an error.

    • config Object

      Configuration object or {} if no configuration has been saved in the app.

setBusy
(
  • The
)

Defined in fabmo.js:291

Set the message to display while an app is loading. You can call this any time before calling the ready() function, to indicate loading or setup progress.

Parameters:

  • The String

    message to display.

showDRO
(
  • callback
)

Defined in fabmo.js:338

Show the DRO (Digital ReadOut) in the dashboard if it is not already shown.

Parameters:

  • callback Function

    Called once the DRO has been displayed.

    • err Error

      Error object if there was an error.

startVideoStreaming
(
  • callback
)

Defined in fabmo.js:893

Add a listener to the video frame event. This will return an Image object, ready to be displayed on a canvas

Parameters:

startVideoStreaming
(
  • callback
)

Defined in fabmo.js:880

Start a connection to the video streaming service on your fabmo device. A video_frame event will be triggered each time a new frame is send to the browser.

Parameters:

stop
(
  • options
  • callback
)

Defined in fabmo.js:620

Stop execution of the current job or operation. Operation cannot be resumed.

Parameters: