[ create a new paste ] login | about

Link: http://codepad.org/Mzi3qwUC    [ raw code | fork ]

Plain Text, pasted on Aug 19:
    def home_all_axes(event=None):
        if not manual_ok(): return
        ensure_mode(linuxcnc.MODE_MANUAL)
        isHomed=True
        for i,h in enumerate(s.homed):
            if s.axis_mask & (1<<i):
                isHomed=isHomed and h
        doHoming=True
        if isHomed:
            doHoming=prompt_areyousure(_("Warning"),_("Axis is already homed, are you sure you want to re-home?"))
        if doHoming:
            c.home(-1)

    def unhome_all_axes(event=None):
        if not manual_ok(): return
        ensure_mode(linuxcnc.MODE_MANUAL)
        c.unhome(-1)

    def home_axis(event=None):
        if not manual_ok(): return
        doHoming=True
        if s.homed["xyzabcuvw".index(vars.current_axis.get())]:
            doHoming=prompt_areyousure(_("Warning"),_("This axis is already homed, are you sure you want to re-home?"))
        if doHoming:
            ensure_mode(linuxcnc.MODE_MANUAL)
            c.home("xyzabcuvw".index(vars.current_axis.get()))

    def unhome_axis(event=None):
        if not manual_ok(): return
        ensure_mode(linuxcnc.MODE_MANUAL)
        c.unhome("xyzabcuvw".index(vars.current_axis.get()))

    def home_axis_number(num):
        ensure_mode(linuxcnc.MODE_MANUAL)
        c.home(num)

    def unhome_axis_number(num):
        ensure_mode(linuxcnc.MODE_MANUAL)
        c.unhome(num)


Create a new paste based on this one


Comments: