MCPcopy Create free account
hub / github.com/Duet3D/RepRapFirmware / SetItemActiveTemperature

Method SetItemActiveTemperature

src/GCodes/GCodes.cpp:5808–5836  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5806}
5807
5808void GCodes::SetItemActiveTemperature(unsigned int itemNumber, float temp) noexcept
5809{
5810 try
5811 {
5812 if (itemNumber < 80)
5813 {
5814 ReadLockedPointer<Tool> const tool = (itemNumber == 79) ? GetPrimaryMovementState().GetLockedCurrentTool() : Tool::GetLockedTool(itemNumber);
5815 if (tool.IsNotNull())
5816 {
5817 tool->SetToolHeaterActiveTemperature(0, temp);
5818 if (tool->Number() == GetPrimaryMovementState().GetCurrentToolNumber() && temp > NEARLY_ABS_ZERO)
5819 {
5820 tool->HeatersToActiveOrStandby(true); // if it's the current tool then make sure it is active
5821 }
5822 }
5823 }
5824 else
5825 {
5826 const int heaterNumber = GetHeaterNumber(itemNumber);
5827 reprap.GetHeat().SetActiveTemperature(heaterNumber, temp);
5828 if (temp > NEARLY_ABS_ZERO)
5829 {
5830 String<1> dummy;
5831 reprap.GetHeat().SetActiveOrStandby(heaterNumber, nullptr, true, dummy.GetRef());
5832 }
5833 }
5834 }
5835 catch (const GCodeException&) { }
5836}
5837
5838void GCodes::SetItemStandbyTemperature(unsigned int itemNumber, float temp) noexcept
5839{

Callers 1

Adjust_SelectHelperMethod · 0.80

Calls 6

GetHeaterNumberFunction · 0.85
GetLockedCurrentToolMethod · 0.80
NumberMethod · 0.80
GetCurrentToolNumberMethod · 0.80
SetActiveOrStandbyMethod · 0.45

Tested by

no test coverage detected