Add multi-extruder condition

This commit is contained in:
Scott Lahteine
2020-09-20 18:29:08 -05:00
parent 8e0fac897b
commit 76d8d1742c
50 changed files with 127 additions and 144 deletions

View File

@ -70,7 +70,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) {
//planner.flow_percentage[1] = planner.flow_percentage[0];
//planner.e_factor[1]= planner.flow_percentage[1]*0.01;
planner.refresh_e_factor(0);
if (EXTRUDERS == 2) {
#if HAS_MULTI_EXTRUDER
planner.flow_percentage[1] = planner.flow_percentage[0];
planner.refresh_e_factor(1);
}

View File

@ -95,7 +95,7 @@ static void btn_ok_event_cb(lv_obj_t * btn, lv_event_t event) {
//saved_feedrate_percentage = feedrate_percentage;
planner.flow_percentage[0] = 100;
planner.e_factor[0] = planner.flow_percentage[0] * 0.01f;
#if EXTRUDERS == 2
#if HAS_MULTI_EXTRUDER
planner.flow_percentage[1] = 100;
planner.e_factor[1] = planner.flow_percentage[1] * 0.01f;
#endif

View File

@ -90,7 +90,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) {
// nothing to do
}
else if (event == LV_EVENT_RELEASED) {
if (EXTRUDERS == 2) {
if (ENABLED(HAS_MULTI_EXTRUDER)) {
if (uiCfg.curSprayerChoose == 0) {
uiCfg.curSprayerChoose = 1;
queue.inject_P(PSTR("T1"));

View File

@ -61,7 +61,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) {
thermalManager.start_watching_hotend(uiCfg.curSprayerChoose);
}
}
#if !defined(SINGLENOZZLE) && EXTRUDERS >= 2
#if !defined(SINGLENOZZLE) && HAS_MULTI_EXTRUDER
else if ((int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].target > (HEATER_1_MAXTEMP - (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1))) {
thermalManager.temp_hotend[uiCfg.curSprayerChoose].target = (float)HEATER_1_MAXTEMP - (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1);
thermalManager.start_watching_hotend(uiCfg.curSprayerChoose);
@ -117,7 +117,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) {
}
else if (event == LV_EVENT_RELEASED) {
if (uiCfg.curTempType == 0) {
if (EXTRUDERS == 2) {
if (ENABLED(HAS_MULTI_EXTRUDER)) {
if (uiCfg.curSprayerChoose == 0) {
uiCfg.curSprayerChoose = 1;
}

View File

@ -242,8 +242,10 @@ void lv_draw_printing(void) {
#endif // if 1
lv_obj_set_pos(buttonExt1, 205, 136);
if (EXTRUDERS == 2)
#if HAS_MULTI_EXTRUDER
lv_obj_set_pos(buttonExt2, 350, 136);
#endif
#if HAS_HEATED_BED
lv_obj_set_pos(buttonBedstate, 205, 186);
@ -275,11 +277,11 @@ void lv_draw_printing(void) {
lv_obj_set_style(labelExt1, &tft_style_label_rel);
lv_obj_set_pos(labelExt1, 250, 146);
if (EXTRUDERS == 2) {
#if HAS_MULTI_EXTRUDER
labelExt2 = lv_label_create(scr, NULL);
lv_obj_set_style(labelExt2, &tft_style_label_rel);
lv_obj_set_pos(labelExt2, 395, 146);
}
#endif
#if HAS_HEATED_BED
labelBed = lv_label_create(scr, NULL);
@ -344,11 +346,11 @@ void disp_ext_temp() {
sprintf(public_buf_l, printing_menu.temp1, (int)thermalManager.temp_hotend[0].celsius, (int)thermalManager.temp_hotend[0].target);
lv_label_set_text(labelExt1, public_buf_l);
if (EXTRUDERS == 2) {
#if HAS_MULTI_EXTRUDER
ZERO(public_buf_l);
sprintf(public_buf_l, printing_menu.temp1, (int)thermalManager.temp_hotend[1].celsius, (int)thermalManager.temp_hotend[1].target);
lv_label_set_text(labelExt2, public_buf_l);
}
#endif
}
void disp_bed_temp() {