Giter Site home page Giter Site logo

Comments (2)

lettore avatar lettore commented on July 17, 2024

For now I'm using this method, I set the material type as the ID number of the spool instead of setting PLA etc.
Then in ercf_software.cfg

[gcode_macro _ERCF_ACTION_CHANGED]
description: Called when an action has changed.
gcode:
    # This occurs when the ERCF action status changes.  `printer.ercf.action` will contain
    # the current action string. See Happy Hare README for full list
    #
    # This could be a place to set LED status or similar. The logic here
    # demonstrates the three major action states
    {% set ACTION = printer.ercf.action|string %}

    {% if ACTION|string == "Idle" %}
        # Add your logic here
        # _STATUS_STANDBY
        {% if printer.ercf.tool|int > -1 %}
            #if material loaded is a number, then it should be a Spoolman ID
            {% if printer.ercf.material|int > 0 %} 
                #if material loaded is a number, then it should be a Spoolman ID
                {% if printer.ercf.filament == "Loaded" %} 
                {% set id = printer.ercf.material|int %}
                #set the spool ID
                {action_call_remote_method("spoolman_set_active_spool",spool_id=id)}
                {% else %}
                #clear spool ID as filament is not loaded
                {action_call_remote_method("spoolman_set_active_spool",spool_id=None)}
                {% endif %}
            #clear spool ID as it's invalid
            {% else %}
                {action_call_remote_method("spoolman_set_active_spool",spool_id=None)}
            {% endif %}     
        {% endif %}     
    {% endif %}
    
    {% if ACTION|string == "Loading" %}
        # Add your logic here
        # _STATUS_LOADING
    {% endif %}

    {% if ACTION|string == "Unloading" %}
        # Add your logic here
        # _STATUS_UNLOADING
        {action_call_remote_method("spoolman_set_active_spool",spool_id=None)}
    {% endif %}

For now it's working quite well

from ercf-software-v3.

moggieuk avatar moggieuk commented on July 17, 2024

Thanks. This is on the intended feature list for Happy Hare v2. Soon....

from ercf-software-v3.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.