PFW-1362 SpoolJoin needs to known what the previous slot was
This commit is contained in:
parent
1010f23959
commit
63b4abb66d
|
|
@ -58,12 +58,17 @@ uint8_t SpoolJoin::isSpoolJoinEnabled()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SpoolJoin::setSlot(uint8_t slot)
|
||||||
|
{
|
||||||
|
currentMMUSlot = slot;
|
||||||
|
}
|
||||||
|
|
||||||
uint8_t SpoolJoin::nextSlot()
|
uint8_t SpoolJoin::nextSlot()
|
||||||
{
|
{
|
||||||
SERIAL_ECHOPGM("SpoolJoin: Changing slot from ");
|
SERIAL_ECHOPGM("SpoolJoin: Changing slot from ");
|
||||||
SERIAL_ECHO((int)currentMMUSlot);
|
SERIAL_ECHO((int)currentMMUSlot);
|
||||||
if (currentMMUSlot == 4) currentMMUSlot = 0;
|
|
||||||
|
if (currentMMUSlot >= 4) currentMMUSlot = 0;
|
||||||
else currentMMUSlot++;
|
else currentMMUSlot++;
|
||||||
|
|
||||||
SERIAL_ECHOPGM(" to ");
|
SERIAL_ECHOPGM(" to ");
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,10 @@ public:
|
||||||
/// @brief Check if SpoolJoin is enabled
|
/// @brief Check if SpoolJoin is enabled
|
||||||
uint8_t isSpoolJoinEnabled();
|
uint8_t isSpoolJoinEnabled();
|
||||||
|
|
||||||
|
/// @brief Update the saved MMU slot number so SpoolJoin can determine the next slot to use
|
||||||
|
/// @param slot number of the slot to set
|
||||||
|
void setSlot(uint8_t slot);
|
||||||
|
|
||||||
/// @brief Fetch the next slot number should count from 0 to 4.
|
/// @brief Fetch the next slot number should count from 0 to 4.
|
||||||
/// When filament slot 4 is depleted, the next slot should be 0.
|
/// When filament slot 4 is depleted, the next slot should be 0.
|
||||||
/// @returns the next slot, ranges from 0 to 4
|
/// @returns the next slot, ranges from 0 to 4
|
||||||
|
|
|
||||||
|
|
@ -307,6 +307,7 @@ bool MMU2::tool_change(uint8_t index) {
|
||||||
plan_set_e_position(current_position[E_AXIS]);
|
plan_set_e_position(current_position[E_AXIS]);
|
||||||
|
|
||||||
extruder = index; //filament change is finished
|
extruder = index; //filament change is finished
|
||||||
|
SpoolJoin::spooljoin.setSlot(index);
|
||||||
|
|
||||||
// @@TODO really report onto the serial? May be for the Octoprint? Not important now
|
// @@TODO really report onto the serial? May be for the Octoprint? Not important now
|
||||||
// SERIAL_ECHO_START();
|
// SERIAL_ECHO_START();
|
||||||
|
|
@ -339,6 +340,7 @@ bool MMU2::tool_change(char code, uint8_t slot) {
|
||||||
logic.ToolChange(slot);
|
logic.ToolChange(slot);
|
||||||
manage_response(false, false);
|
manage_response(false, false);
|
||||||
extruder = slot;
|
extruder = slot;
|
||||||
|
SpoolJoin::spooljoin.setSlot(slot);
|
||||||
set_extrude_min_temp(EXTRUDE_MINTEMP);
|
set_extrude_min_temp(EXTRUDE_MINTEMP);
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
|
|
@ -485,6 +487,7 @@ bool MMU2::load_filament_to_nozzle(uint8_t index) {
|
||||||
execute_extruder_sequence((const E_Step *)load_to_nozzle_sequence, sizeof(load_to_nozzle_sequence) / sizeof (load_to_nozzle_sequence[0]));
|
execute_extruder_sequence((const E_Step *)load_to_nozzle_sequence, sizeof(load_to_nozzle_sequence) / sizeof (load_to_nozzle_sequence[0]));
|
||||||
|
|
||||||
extruder = index;
|
extruder = index;
|
||||||
|
SpoolJoin::spooljoin.setSlot(index);
|
||||||
|
|
||||||
Sound_MakeSound(e_SOUND_TYPE_StandardConfirm);
|
Sound_MakeSound(e_SOUND_TYPE_StandardConfirm);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue