Skip to content

Commit

Permalink
Update IDEX menus, add post-M605 event G-code (MarlinFirmware#20133)
Browse files Browse the repository at this point in the history
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
  • Loading branch information
InsanityAutomation and thinkyhead authored Nov 16, 2020
1 parent 101d57d commit e955dce
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 9 deletions.
3 changes: 3 additions & 0 deletions Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,9 @@

// Default x offset in duplication mode (typically set to half print bed width)
#define DEFAULT_DUPLICATION_X_OFFSET 100

// Default action to execute following M605 mode change commands. Typically G28X to apply new mode.
//#define EVENT_GCODE_IDEX_AFTER_MODECHANGE "G28X"
#endif

// Activate a solenoid on the active extruder with M380. Disable all with M381.
Expand Down
4 changes: 4 additions & 0 deletions Marlin/src/gcode/control/M605.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@
}
idex_set_parked(false);
set_duplication_enabled(false);

#ifdef EVENT_GCODE_IDEX_AFTER_MODECHANGE
gcode.process_subcommands_now_P(PSTR(EVENT_GCODE_IDEX_AFTER_MODECHANGE));
#endif
}
else if (!parser.seen('W')) // if no S or W parameter, the DXC mode gets reset to the user's default
dual_x_carriage_mode = DEFAULT_DUAL_X_CARRIAGE_MODE;
Expand Down
1 change: 1 addition & 0 deletions Marlin/src/lcd/language/language_en.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ namespace Language_en {
PROGMEM Language_Str MSG_IDEX_MODE_DUPLICATE = _UxGT("Duplication");
PROGMEM Language_Str MSG_IDEX_MODE_MIRRORED_COPY = _UxGT("Mirrored Copy");
PROGMEM Language_Str MSG_IDEX_MODE_FULL_CTRL = _UxGT("Full Control");
PROGMEM Language_Str MSG_IDEX_DUPE_GAP = _UxGT("Duplicate X-Gap");
PROGMEM Language_Str MSG_HOTEND_OFFSET_X = _UxGT("2nd Nozzle X");
PROGMEM Language_Str MSG_HOTEND_OFFSET_Y = _UxGT("2nd Nozzle Y");
PROGMEM Language_Str MSG_HOTEND_OFFSET_Z = _UxGT("2nd Nozzle Z");
Expand Down
15 changes: 9 additions & 6 deletions Marlin/src/lcd/menu/menu_configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,16 +194,19 @@ void menu_advanced_settings();
START_MENU();
BACK_ITEM(MSG_CONFIGURATION);

GCODES_ITEM(MSG_IDEX_MODE_AUTOPARK, PSTR("M605 S1\nG28 X\nG1 X100"));
GCODES_ITEM(MSG_IDEX_MODE_AUTOPARK, PSTR("M605S1\nG28X\nG1X0"));
GCODES_ITEM(MSG_IDEX_MODE_DUPLICATE, need_g28
? PSTR("M605 S1\nT0\nG28\nM605 S2 X200\nG28 X\nG1 X100") // If Y or Z is not homed, do a full G28 first
: PSTR("M605 S1\nT0\nM605 S2 X200\nG28 X\nG1 X100")
? PSTR("M605S1\nT0\nG28\nM605S2\nG28X\nG1X0") // If Y or Z is not homed, do a full G28 first
: PSTR("M605S1\nT0\nM605S2\nG28X\nG1X0")
);
GCODES_ITEM(MSG_IDEX_MODE_MIRRORED_COPY, need_g28
? PSTR("M605 S1\nT0\nG28\nM605 S2 X200\nG28 X\nG1 X100\nM605 S3 X200") // If Y or Z is not homed, do a full G28 first
: PSTR("M605 S1\nT0\nM605 S2 X200\nG28 X\nG1 X100\nM605 S3 X200")
? PSTR("M605S1\nT0\nG28\nM605S2\nG28X\nG1X0\nM605S3") // If Y or Z is not homed, do a full G28 first
: PSTR("M605S1\nT0\nM605S2\nG28 X\nG1X0\nM605S3")
);
GCODES_ITEM(MSG_IDEX_MODE_FULL_CTRL, PSTR("M605 S0\nG28 X"));
GCODES_ITEM(MSG_IDEX_MODE_FULL_CTRL, PSTR("M605S0\nG28X"));

EDIT_ITEM(float42_52, MSG_IDEX_DUPE_GAP, &duplicate_extruder_x_offset, (X2_MIN_POS) - (X1_MIN_POS), (X_BED_SIZE) - 20);

END_MENU();
}

Expand Down
6 changes: 3 additions & 3 deletions buildroot/tests/mega2560-tests
Original file line number Diff line number Diff line change
Expand Up @@ -259,10 +259,10 @@ exec_test $1 $2 "Mightyboard Rev. E | CoreXY, Gradient Mix | Endstop Int. | Home

######## Example Configurations ##############
#
# Test a full-featured CR-10S config
# Test a basic DUAL_X_CARRIAGE configuration
#
use_example_configs Creality/CR-10S
exec_test $1 $2 "Full-featured CR-10S config"
use_example_configs Formbot/T_Rex_3
exec_test $1 $2 "Formbot/T_Rex_3 example configuration."

#
# BQ Hephestos 2
Expand Down

0 comments on commit e955dce

Please sign in to comment.