How to use the qtpyvcp.actions.base_actions.setTaskMode function in qtpyvcp

To help you get started, we’ve selected a few qtpyvcp examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kcjengr / qtpyvcp / qtpyvcp / actions / machine_actions.py View on Github external
command (str) : A valid RS274 gcode command string. Multiple MDI commands
            can be separated with a ``;`` and will be issued sequentially.
        rest (bool, optional): Whether to reset the Task Mode to the state
            the machine was in prior to issuing the MDI command.
    """
    if reset:
        # save the previous mode
        global PREVIOUS_MODE
        PREVIOUS_MODE = STAT.task_mode
        # Force `interp_state` update on next status cycle. This is needed because
        # some commands might take less than `cycle_time` (50ms) to complete,
        # so status would not even notice that the interp_state had changed and the
        # reset mode method would not be called.
        STATUS.old['interp_state'] = -1

    if setTaskMode(linuxcnc.MODE_MDI):
        # issue multiple MDI commands separated by ';'
        for cmd in command.strip().split(';'):
            LOG.info("Issuing MDI command: %s", cmd)
            CMD.mdi(cmd)
    else:
        LOG.error("Failed to issue MDI command: {}".format(command))
github kcjengr / qtpyvcp / qtpyvcp / actions / machine_actions.py View on Github external
def _unhome_joint(jnum):
    setTaskMode(linuxcnc.MODE_MANUAL)
    CMD.teleop_enable(False)
    CMD.unhome(jnum)
github kcjengr / qtpyvcp / qtpyvcp / actions / machine_actions.py View on Github external
def _home_joint(jnum):
    setTaskMode(linuxcnc.MODE_MANUAL)
    CMD.teleop_enable(False)
    CMD.home(jnum)
github kcjengr / qtpyvcp / qtpyvcp / actions / program_actions.py View on Github external
def step():
    """Steps program line by line

    ActionButton syntax::

        program.step

    """
    if STAT.state == linuxcnc.RCS_EXEC and STAT.paused:
        CMD.auto(linuxcnc.AUTO_STEP)
    elif setTaskMode(linuxcnc.MODE_AUTO):
        CMD.auto(linuxcnc.AUTO_STEP)
github kcjengr / qtpyvcp / qtpyvcp / actions / machine_actions.py View on Github external
def mdi():
        """Change mode to MDI

        ActionButton syntax:
        ::

            machine.mode.mdi

        """
        setTaskMode(linuxcnc.MODE_MDI)
github kcjengr / qtpyvcp / qtpyvcp / actions / machine_actions.py View on Github external
def auto():
        """Change mode to Auto

        ActionButton syntax:
        ::

            machine.mode.auto

        """
        setTaskMode(linuxcnc.MODE_AUTO)