-
Notifications
You must be signed in to change notification settings - Fork 245
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prepare custom filament temperatures
- Loading branch information
Showing
21 changed files
with
375 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,10 @@ enum class Type : uint8_t { | |
PP, | ||
FLEX, | ||
PA, | ||
CUSTOM_1, | ||
CUSTOM_2, | ||
CUSTOM_3, | ||
CUSTOM_4, | ||
_last = PA | ||
}; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
#include "custom_filament_tools.hpp" | ||
|
||
namespace custom_filament_tools { | ||
|
||
int8_t currentslot; | ||
|
||
void SetCurrentSlot(int8_t slot) { | ||
currentslot = slot; | ||
} | ||
|
||
int8_t GetCurrentSlot() { | ||
return currentslot; | ||
} | ||
|
||
int16_t GetSlotTemp(custom_filament_setting setting) { | ||
switch (currentslot) { | ||
case 0: | ||
if (setting == custom_filament_setting::nozzle_temp) { | ||
return config_store().filament_nozzle_temp_1.get(); | ||
} else if (setting == custom_filament_setting::nozzle_preheat_temp) { | ||
return config_store().filament_nozzle_preheat_temp_1.get(); | ||
} else if (setting == custom_filament_setting::heatbed_temp) { | ||
return config_store().filament_heatbed_temp_1.get(); | ||
} | ||
break; | ||
case 1: | ||
if (setting == custom_filament_setting::nozzle_temp) { | ||
return config_store().filament_nozzle_temp_2.get(); | ||
} else if (setting == custom_filament_setting::nozzle_preheat_temp) { | ||
return config_store().filament_nozzle_preheat_temp_2.get(); | ||
} else if (setting == custom_filament_setting::heatbed_temp) { | ||
return config_store().filament_heatbed_temp_2.get(); | ||
} | ||
break; | ||
case 2: | ||
if (setting == custom_filament_setting::nozzle_temp) { | ||
return config_store().filament_nozzle_temp_3.get(); | ||
} else if (setting == custom_filament_setting::nozzle_preheat_temp) { | ||
return config_store().filament_nozzle_preheat_temp_3.get(); | ||
} else if (setting == custom_filament_setting::heatbed_temp) { | ||
return config_store().filament_heatbed_temp_3.get(); | ||
} | ||
break; | ||
case 3: | ||
if (setting == custom_filament_setting::nozzle_temp) { | ||
return config_store().filament_nozzle_temp_4.get(); | ||
} else if (setting == custom_filament_setting::nozzle_preheat_temp) { | ||
return config_store().filament_nozzle_preheat_temp_4.get(); | ||
} else if (setting == custom_filament_setting::heatbed_temp) { | ||
return config_store().filament_heatbed_temp_4.get(); | ||
} | ||
break; | ||
default: | ||
assert("Wrong custom filament slot"); | ||
break; | ||
}; | ||
return 0; | ||
}; | ||
|
||
void SetSlotTemp(custom_filament_setting setting, int16_t temp) { | ||
switch (custom_filament_tools::GetCurrentSlot()) { | ||
case 0: | ||
if (setting == custom_filament_setting::nozzle_temp) { | ||
config_store().filament_nozzle_temp_1.set(temp); | ||
} else if (setting == custom_filament_setting::nozzle_preheat_temp) { | ||
config_store().filament_nozzle_preheat_temp_1.set(temp); | ||
} else if (setting == custom_filament_setting::heatbed_temp) { | ||
config_store().filament_heatbed_temp_1.set(temp); | ||
} | ||
break; | ||
case 1: | ||
if (setting == custom_filament_setting::nozzle_temp) { | ||
config_store().filament_nozzle_temp_2.set(temp); | ||
} else if (setting == custom_filament_setting::nozzle_preheat_temp) { | ||
config_store().filament_nozzle_preheat_temp_2.set(temp); | ||
} else if (setting == custom_filament_setting::heatbed_temp) { | ||
config_store().filament_heatbed_temp_2.set(temp); | ||
} | ||
break; | ||
case 2: | ||
if (setting == custom_filament_setting::nozzle_temp) { | ||
config_store().filament_nozzle_temp_3.set(temp); | ||
} else if (setting == custom_filament_setting::nozzle_preheat_temp) { | ||
config_store().filament_nozzle_preheat_temp_3.set(temp); | ||
} else if (setting == custom_filament_setting::heatbed_temp) { | ||
config_store().filament_heatbed_temp_3.set(temp); | ||
} | ||
break; | ||
case 3: | ||
if (setting == custom_filament_setting::nozzle_temp) { | ||
config_store().filament_nozzle_temp_4.set(temp); | ||
} else if (setting == custom_filament_setting::nozzle_preheat_temp) { | ||
config_store().filament_nozzle_preheat_temp_4.set(temp); | ||
} else if (setting == custom_filament_setting::heatbed_temp) { | ||
config_store().filament_heatbed_temp_4.set(temp); | ||
} | ||
break; | ||
default: | ||
assert("Wrong custom filament slot"); | ||
break; | ||
} | ||
}; | ||
} // namespace custom_filament_tools |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#pragma once | ||
|
||
namespace custom_filament_tools { | ||
|
||
enum custom_filament_setting { | ||
nozzle_temp = 0, | ||
nozzle_preheat_temp = 1, | ||
heatbed_temp = 2 | ||
}; | ||
void SetCurrentSlot(int8_t slot); | ||
int8_t GetCurrentSlot(); | ||
int16_t GetSlotTemp(custom_filament_setting setting); | ||
void SetSlotTemp(custom_filament_setting setting, int16_t temp); | ||
|
||
} // namespace custom_filament_tools |
Oops, something went wrong.