Combine G-code files into fewer units

Addressing #7707
This commit is contained in:
Scott Lahteine
2017-09-23 18:09:14 -05:00
parent bfd1e75c04
commit 1587962547
52 changed files with 709 additions and 1719 deletions

View File

@ -1,75 +0,0 @@
/**
* Marlin 3D Printer Firmware
* Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "../gcode.h"
#include "../../module/temperature.h"
#include "../../module/motion.h"
#include "../../module/planner.h"
#include "../../lcd/ultralcd.h"
#if ENABLED(PRINTJOB_TIMER_AUTOSTART)
#include "../../module/printcounter.h"
#endif
/**
* M104: Set hot end temperature
*/
void GcodeSuite::M104() {
if (get_target_extruder_from_command()) return;
if (DEBUGGING(DRYRUN)) return;
const uint8_t e = target_extruder;
#if ENABLED(SINGLENOZZLE)
if (e != active_extruder) return;
#endif
if (parser.seenval('S')) {
const int16_t temp = parser.value_celsius();
thermalManager.setTargetHotend(temp, e);
#if ENABLED(DUAL_X_CARRIAGE)
if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && e == 0)
thermalManager.setTargetHotend(temp ? temp + duplicate_extruder_temp_offset : 0, 1);
#endif
#if ENABLED(PRINTJOB_TIMER_AUTOSTART)
/**
* Stop the timer at the end of print. Start is managed by 'heat and wait' M109.
* We use half EXTRUDE_MINTEMP here to allow nozzles to be put into hot
* standby mode, for instance in a dual extruder setup, without affecting
* the running print timer.
*/
if (parser.value_celsius() <= (EXTRUDE_MINTEMP) / 2) {
print_job_timer.stop();
LCD_MESSAGEPGM(WELCOME_MSG);
}
#endif
if (parser.value_celsius() > thermalManager.degHotend(e))
lcd_status_printf_P(0, PSTR("E%i %s"), e + 1, MSG_HEATING);
}
#if ENABLED(AUTOTEMP)
planner.autotemp_M104_M109();
#endif
}

View File

@ -22,6 +22,7 @@
#include "../gcode.h"
#include "../../module/temperature.h"
#include "../../module/motion.h"
#include "../../module/planner.h"
#include "../../lcd/ultralcd.h"
#include "../../Marlin.h"
@ -30,14 +31,54 @@
#include "../../module/printcounter.h"
#endif
#if ENABLED(DUAL_X_CARRIAGE)
#include "../../module/motion.h"
#endif
#if HAS_COLOR_LEDS
#include "../../feature/leds/leds.h"
#endif
/**
* M104: Set hot end temperature
*/
void GcodeSuite::M104() {
if (get_target_extruder_from_command()) return;
if (DEBUGGING(DRYRUN)) return;
const uint8_t e = target_extruder;
#if ENABLED(SINGLENOZZLE)
if (e != active_extruder) return;
#endif
if (parser.seenval('S')) {
const int16_t temp = parser.value_celsius();
thermalManager.setTargetHotend(temp, e);
#if ENABLED(DUAL_X_CARRIAGE)
if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && e == 0)
thermalManager.setTargetHotend(temp ? temp + duplicate_extruder_temp_offset : 0, 1);
#endif
#if ENABLED(PRINTJOB_TIMER_AUTOSTART)
/**
* Stop the timer at the end of print. Start is managed by 'heat and wait' M109.
* We use half EXTRUDE_MINTEMP here to allow nozzles to be put into hot
* standby mode, for instance in a dual extruder setup, without affecting
* the running print timer.
*/
if (parser.value_celsius() <= (EXTRUDE_MINTEMP) / 2) {
print_job_timer.stop();
LCD_MESSAGEPGM(WELCOME_MSG);
}
#endif
if (parser.value_celsius() > thermalManager.degHotend(e))
lcd_status_printf_P(0, PSTR("E%i %s"), e + 1, MSG_HEATING);
}
#if ENABLED(AUTOTEMP)
planner.autotemp_M104_M109();
#endif
}
/**
* M109: Sxxx Wait for extruder(s) to reach temperature. Waits only when heating.
* Rxxx Wait for extruder(s) to reach temperature. Waits when heating and cooling.

View File

@ -1,38 +0,0 @@
/**
* Marlin 3D Printer Firmware
* Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "../../inc/MarlinConfig.h"
#if HAS_HEATER_BED && HAS_TEMP_BED
#include "../gcode.h"
#include "../../module/temperature.h"
/**
* M140: Set bed temperature
*/
void GcodeSuite::M140() {
if (DEBUGGING(DRYRUN)) return;
if (parser.seenval('S')) thermalManager.setTargetBed(parser.value_celsius());
}
#endif // HAS_HEATER_BED && HAS_TEMP_BED

View File

@ -25,8 +25,8 @@
#if HAS_HEATER_BED && HAS_TEMP_BED
#include "../gcode.h"
#include "../../module/motion.h"
#include "../../module/temperature.h"
#include "../../module/motion.h"
#include "../../lcd/ultralcd.h"
#if ENABLED(PRINTJOB_TIMER_AUTOSTART)
@ -39,6 +39,14 @@
#include "../../Marlin.h" // for wait_for_heatup and idle()
/**
* M140: Set bed temperature
*/
void GcodeSuite::M140() {
if (DEBUGGING(DRYRUN)) return;
if (parser.seenval('S')) thermalManager.setTargetBed(parser.value_celsius());
}
#ifndef MIN_COOLING_SLOPE_DEG_BED
#define MIN_COOLING_SLOPE_DEG_BED 1.50
#endif