Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Modifying M100 to accept T commands
#1
I am currently trying to modify M100 to accept T commands to allow a specific extruder on 2.0 models to be cleaned using T1 or T2 rather than both being cleaned. The problem is that I am not very knowledgeable in C so I have been playing around in a fork trying to get it to compile with Travis. The Commands.cpp took a while to get it to compile and even with it passing I am not sure if it is correct.

The code in question is -
Code:
//Davinci Specific, Clean noozle and light management
#if ENABLE_CLEAN_NOZZLE
        case 100:
        if(com->hasT())
        {
            if(com->T == 1)
                Printer::cleanNozzle1();
                    break;
                if(com->T == 2)
                Printer::cleanNozzle2();
                break;
        }
        else
        {
            Printer::cleanNozzle();
            break;
        }
#endif

I've added cleanNozzle1 and cleanNozzle2 to Printer.cpp, they are the same as cleanNozzle except in each one the other nozzle wipe is removed from the sections that apply to models 2 or 3. I've done a copy of them because I was not sure how to handle something like "M100 T1" being sent from a printer that isn't a 2.0 so by copying the entire code they should just be sent to the normal cleaning routine.

If anyone would like to take a look at my changes to verify or help, my fork is here - https://github.com/limited660/Repetier-F...92-DaVinci
The files changed are Commands.cpp, Printer.cpp and Printer.h. I think I got everything required just because it finally passed in Travis but I will test it tonight. I didn't want to do a pull request yet because I am sure there is a cleaner way of "error handling" than just copying it, it would be ideal to check the "MODEL" variable in Commands.cpp but I am not sure how to do that.

The goal of this is to be able to send M100 T1 and clean extruder 1 only or send M100 T2 and clean extruder 2 only; M100 should do both. The numbers could also be 0 and 1 which I think is how most slicers reference them.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)