SINGLENOZZLE: EXTRUDERS versus HOTENDS

This commit is contained in:
Scott Lahteine
2016-05-26 17:43:20 -07:00
parent 32f8300cc6
commit cd441ce652
50 changed files with 554 additions and 462 deletions

View File

@ -593,28 +593,28 @@ void lcd_set_home_offsets() {
#if TEMP_SENSOR_0 != 0
void watch_temp_callback_E0() { thermalManager.start_watching_heater(0); }
#endif
#if EXTRUDERS > 1 && TEMP_SENSOR_1 != 0
#if HOTENDS > 1 && TEMP_SENSOR_1 != 0
void watch_temp_callback_E1() { thermalManager.start_watching_heater(1); }
#endif // EXTRUDERS > 1
#if EXTRUDERS > 2 && TEMP_SENSOR_2 != 0
#endif // HOTENDS > 1
#if HOTENDS > 2 && TEMP_SENSOR_2 != 0
void watch_temp_callback_E2() { thermalManager.start_watching_heater(2); }
#endif // EXTRUDERS > 2
#if EXTRUDERS > 3 && TEMP_SENSOR_3 != 0
#endif // HOTENDS > 2
#if HOTENDS > 3 && TEMP_SENSOR_3 != 0
void watch_temp_callback_E3() { thermalManager.start_watching_heater(3); }
#endif // EXTRUDERS > 3
#endif // HOTENDS > 3
#else
#if TEMP_SENSOR_0 != 0
void watch_temp_callback_E0() {}
#endif
#if EXTRUDERS > 1 && TEMP_SENSOR_1 != 0
#if HOTENDS > 1 && TEMP_SENSOR_1 != 0
void watch_temp_callback_E1() {}
#endif // EXTRUDERS > 1
#if EXTRUDERS > 2 && TEMP_SENSOR_2 != 0
#endif // HOTENDS > 1
#if HOTENDS > 2 && TEMP_SENSOR_2 != 0
void watch_temp_callback_E2() {}
#endif // EXTRUDERS > 2
#if EXTRUDERS > 3 && TEMP_SENSOR_3 != 0
#endif // HOTENDS > 2
#if HOTENDS > 3 && TEMP_SENSOR_3 != 0
void watch_temp_callback_E3() {}
#endif // EXTRUDERS > 3
#endif // HOTENDS > 3
#endif
#if ENABLED(THERMAL_PROTECTION_BED) && WATCH_BED_TEMP_PERIOD > 0
@ -654,28 +654,28 @@ static void lcd_tune_menu() {
// Nozzle:
// Nozzle [1-4]:
//
#if EXTRUDERS == 1
#if HOTENDS == 1
#if TEMP_SENSOR_0 != 0
MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE, &thermalManager.target_temperature[0], 0, HEATER_0_MAXTEMP - 15, watch_temp_callback_E0);
#endif
#else //EXTRUDERS > 1
#else //HOTENDS > 1
#if TEMP_SENSOR_0 != 0
MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N1, &thermalManager.target_temperature[0], 0, HEATER_0_MAXTEMP - 15, watch_temp_callback_E0);
#endif
#if TEMP_SENSOR_1 != 0
MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N2, &thermalManager.target_temperature[1], 0, HEATER_1_MAXTEMP - 15, watch_temp_callback_E1);
#endif
#if EXTRUDERS > 2
#if HOTENDS > 2
#if TEMP_SENSOR_2 != 0
MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N3, &thermalManager.target_temperature[2], 0, HEATER_2_MAXTEMP - 15, watch_temp_callback_E2);
#endif
#if EXTRUDERS > 3
#if HOTENDS > 3
#if TEMP_SENSOR_3 != 0
MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N4, &thermalManager.target_temperature[3], 0, HEATER_3_MAXTEMP - 15, watch_temp_callback_E3);
#endif
#endif // EXTRUDERS > 3
#endif // EXTRUDERS > 2
#endif // EXTRUDERS > 1
#endif // HOTENDS > 3
#endif // HOTENDS > 2
#endif // HOTENDS > 1
//
// Bed:
@ -777,24 +777,24 @@ void _lcd_preheat(int endnum, const float temph, const float tempb, const int fa
void lcd_preheat_abs0() { _lcd_preheat(0, absPreheatHotendTemp, absPreheatHPBTemp, absPreheatFanSpeed); }
#endif
#if EXTRUDERS > 1
#if HOTENDS > 1
void lcd_preheat_pla1() { _lcd_preheat(1, plaPreheatHotendTemp, plaPreheatHPBTemp, plaPreheatFanSpeed); }
void lcd_preheat_abs1() { _lcd_preheat(1, absPreheatHotendTemp, absPreheatHPBTemp, absPreheatFanSpeed); }
#if EXTRUDERS > 2
#if HOTENDS > 2
void lcd_preheat_pla2() { _lcd_preheat(2, plaPreheatHotendTemp, plaPreheatHPBTemp, plaPreheatFanSpeed); }
void lcd_preheat_abs2() { _lcd_preheat(2, absPreheatHotendTemp, absPreheatHPBTemp, absPreheatFanSpeed); }
#if EXTRUDERS > 3
#if HOTENDS > 3
void lcd_preheat_pla3() { _lcd_preheat(3, plaPreheatHotendTemp, plaPreheatHPBTemp, plaPreheatFanSpeed); }
void lcd_preheat_abs3() { _lcd_preheat(3, absPreheatHotendTemp, absPreheatHPBTemp, absPreheatFanSpeed); }
#endif
#endif
void lcd_preheat_pla0123() {
#if EXTRUDERS > 1
#if HOTENDS > 1
thermalManager.setTargetHotend(plaPreheatHotendTemp, 1);
#if EXTRUDERS > 2
#if HOTENDS > 2
thermalManager.setTargetHotend(plaPreheatHotendTemp, 2);
#if EXTRUDERS > 3
#if HOTENDS > 3
thermalManager.setTargetHotend(plaPreheatHotendTemp, 3);
#endif
#endif
@ -802,11 +802,11 @@ void _lcd_preheat(int endnum, const float temph, const float tempb, const int fa
lcd_preheat_pla0();
}
void lcd_preheat_abs0123() {
#if EXTRUDERS > 1
#if HOTENDS > 1
thermalManager.setTargetHotend(absPreheatHotendTemp, 1);
#if EXTRUDERS > 2
#if HOTENDS > 2
thermalManager.setTargetHotend(absPreheatHotendTemp, 2);
#if EXTRUDERS > 3
#if HOTENDS > 3
thermalManager.setTargetHotend(absPreheatHotendTemp, 3);
#endif
#endif
@ -814,7 +814,7 @@ void _lcd_preheat(int endnum, const float temph, const float tempb, const int fa
lcd_preheat_abs0();
}
#endif // EXTRUDERS > 1
#endif // HOTENDS > 1
#if TEMP_SENSOR_BED != 0
void lcd_preheat_pla_bedonly() { _lcd_preheat(0, 0, plaPreheatHPBTemp, plaPreheatFanSpeed); }
@ -826,14 +826,14 @@ void _lcd_preheat(int endnum, const float temph, const float tempb, const int fa
static void lcd_preheat_pla_menu() {
START_MENU();
MENU_ITEM(back, MSG_PREPARE);
#if EXTRUDERS == 1
#if HOTENDS == 1
MENU_ITEM(function, MSG_PREHEAT_PLA, lcd_preheat_pla0);
#else
MENU_ITEM(function, MSG_PREHEAT_PLA_N MSG_H1, lcd_preheat_pla0);
MENU_ITEM(function, MSG_PREHEAT_PLA_N MSG_H2, lcd_preheat_pla1);
#if EXTRUDERS > 2
#if HOTENDS > 2
MENU_ITEM(function, MSG_PREHEAT_PLA_N MSG_H3, lcd_preheat_pla2);
#if EXTRUDERS > 3
#if HOTENDS > 3
MENU_ITEM(function, MSG_PREHEAT_PLA_N MSG_H4, lcd_preheat_pla3);
#endif
#endif
@ -848,14 +848,14 @@ void _lcd_preheat(int endnum, const float temph, const float tempb, const int fa
static void lcd_preheat_abs_menu() {
START_MENU();
MENU_ITEM(back, MSG_PREPARE);
#if EXTRUDERS == 1
#if HOTENDS == 1
MENU_ITEM(function, MSG_PREHEAT_ABS, lcd_preheat_abs0);
#else
MENU_ITEM(function, MSG_PREHEAT_ABS_N MSG_H1, lcd_preheat_abs0);
MENU_ITEM(function, MSG_PREHEAT_ABS_N MSG_H2, lcd_preheat_abs1);
#if EXTRUDERS > 2
#if HOTENDS > 2
MENU_ITEM(function, MSG_PREHEAT_ABS_N MSG_H3, lcd_preheat_abs2);
#if EXTRUDERS > 3
#if HOTENDS > 3
MENU_ITEM(function, MSG_PREHEAT_ABS_N MSG_H4, lcd_preheat_abs3);
#endif
#endif
@ -1380,8 +1380,8 @@ static void lcd_control_menu() {
#if ENABLED(PID_AUTOTUNE_MENU)
#if ENABLED(PIDTEMP)
int autotune_temp[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(150);
const int heater_maxtemp[EXTRUDERS] = ARRAY_BY_EXTRUDERS(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP);
int autotune_temp[HOTENDS] = ARRAY_BY_HOTENDS1(150);
const int heater_maxtemp[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP);
#endif
#if ENABLED(PIDTEMPBED)
@ -1409,14 +1409,14 @@ static void lcd_control_menu() {
// Helpers for editing PID Ki & Kd values
// grab the PID value out of the temp variable; scale it; then update the PID driver
void copy_and_scalePID_i(int e) {
#if DISABLED(PID_PARAMS_PER_EXTRUDER)
#if DISABLED(PID_PARAMS_PER_HOTEND)
UNUSED(e);
#endif
PID_PARAM(Ki, e) = scalePID_i(raw_Ki);
thermalManager.updatePID();
}
void copy_and_scalePID_d(int e) {
#if DISABLED(PID_PARAMS_PER_EXTRUDER)
#if DISABLED(PID_PARAMS_PER_HOTEND)
UNUSED(e);
#endif
PID_PARAM(Kd, e) = scalePID_d(raw_Kd);
@ -1435,17 +1435,17 @@ static void lcd_control_menu() {
#endif
_PIDTEMP_FUNCTIONS(0);
#if ENABLED(PID_PARAMS_PER_EXTRUDER)
#if EXTRUDERS > 1
#if ENABLED(PID_PARAMS_PER_HOTEND)
#if HOTENDS > 1
_PIDTEMP_FUNCTIONS(1);
#if EXTRUDERS > 2
#if HOTENDS > 2
_PIDTEMP_FUNCTIONS(2);
#if EXTRUDERS > 3
#if HOTENDS > 3
_PIDTEMP_FUNCTIONS(3);
#endif //EXTRUDERS > 3
#endif //EXTRUDERS > 2
#endif //EXTRUDERS > 1
#endif //PID_PARAMS_PER_EXTRUDER
#endif //HOTENDS > 3
#endif //HOTENDS > 2
#endif //HOTENDS > 1
#endif //PID_PARAMS_PER_HOTEND
#endif //PIDTEMP
@ -1466,28 +1466,28 @@ static void lcd_control_temperature_menu() {
// Nozzle:
// Nozzle [1-4]:
//
#if EXTRUDERS == 1
#if HOTENDS == 1
#if TEMP_SENSOR_0 != 0
MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE, &thermalManager.target_temperature[0], 0, HEATER_0_MAXTEMP - 15, watch_temp_callback_E0);
#endif
#else //EXTRUDERS > 1
#else //HOTENDS > 1
#if TEMP_SENSOR_0 != 0
MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N1, &thermalManager.target_temperature[0], 0, HEATER_0_MAXTEMP - 15, watch_temp_callback_E0);
#endif
#if TEMP_SENSOR_1 != 0
MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N2, &thermalManager.target_temperature[1], 0, HEATER_1_MAXTEMP - 15, watch_temp_callback_E1);
#endif
#if EXTRUDERS > 2
#if HOTENDS > 2
#if TEMP_SENSOR_2 != 0
MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N3, &thermalManager.target_temperature[2], 0, HEATER_2_MAXTEMP - 15, watch_temp_callback_E2);
#endif
#if EXTRUDERS > 3
#if HOTENDS > 3
#if TEMP_SENSOR_3 != 0
MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N4, &thermalManager.target_temperature[3], 0, HEATER_3_MAXTEMP - 15, watch_temp_callback_E3);
#endif
#endif // EXTRUDERS > 3
#endif // EXTRUDERS > 2
#endif // EXTRUDERS > 1
#endif // HOTENDS > 3
#endif // HOTENDS > 2
#endif // HOTENDS > 1
//
// Bed:
@ -1558,18 +1558,18 @@ static void lcd_control_temperature_menu() {
#define PID_MENU_ITEMS(ELABEL, eindex) _PID_MENU_ITEMS(ELABEL, eindex)
#endif
#if ENABLED(PID_PARAMS_PER_EXTRUDER) && EXTRUDERS > 1
#if ENABLED(PID_PARAMS_PER_HOTEND) && HOTENDS > 1
PID_MENU_ITEMS(MSG_E1, 0);
PID_MENU_ITEMS(MSG_E2, 1);
#if EXTRUDERS > 2
#if HOTENDS > 2
PID_MENU_ITEMS(MSG_E3, 2);
#if EXTRUDERS > 3
#if HOTENDS > 3
PID_MENU_ITEMS(MSG_E4, 3);
#endif //EXTRUDERS > 3
#endif //EXTRUDERS > 2
#else //!PID_PARAMS_PER_EXTRUDER || EXTRUDERS == 1
#endif //HOTENDS > 3
#endif //HOTENDS > 2
#else //!PID_PARAMS_PER_HOTEND || HOTENDS == 1
PID_MENU_ITEMS("", 0);
#endif //!PID_PARAMS_PER_EXTRUDER || EXTRUDERS == 1
#endif //!PID_PARAMS_PER_HOTEND || HOTENDS == 1
#endif //PIDTEMP