This repository has been archived on 2025-02-01. You can view files and clone it, but cannot push or open issues or pull requests.
reprapfirmware-dc42/Tool.h
David Crocker 71037ee4cd Version 0.78c-dc42
Bug fix: using G10 to set oly the active temperature caused the standby
temperature to be set to an undefined value, and vice versa
G10 can now be used to retrieve the active and standby temperatures as
well as set them
Bug fix: I and D parameters were set to incorrect values when the M301
and M304 commands were used. They also reported the incorrect values.
New T parameter added to M301 and M304 commands, to allow the I term to
be preset to a suitable value when PID kicks in
Adjusted default PID parameters for lower overshoot and less oscillation
Bug fix: when axis or bed compensation was enabled a homing move to seek
for one endstop could be prematurely terminated by another endstop
M122 command only outputs LWIP stats if debug is enabled. Prevents a
hang if no UDB cable is connected when M122 is executed.
Bug fix: when resetting, the heaters used to power up for a short time
M0 and M1 commands now turn the heaters off instead of to standby
Web server status poll response now includes the selected tool number
2014-07-15 15:17:41 +01:00

101 lines
2.1 KiB
C++

/****************************************************************************************************
RepRapFirmware - Tool
This class implements a tool in the RepRap machine, usually (though not necessarily) an extruder.
Tools may have zero or more drives associated with them and zero or more heaters. There are a fixed number
of tools in a given RepRap, with fixed heaters and drives. All this is specified on reboot, and cannot
be altered dynamically. This restriction may be lifted in the future. Tool descriptions are stored in
GCode macros that are loaded on reboot.
-----------------------------------------------------------------------------------------------------
Version 0.1
Created on: Apr 11, 2014
Adrian Bowyer
RepRap Professional Ltd
http://reprappro.com
Licence: GPL
****************************************************************************************************/
#ifndef TOOL_H_
#define TOOL_H_
class Tool
{
public:
Tool(int toolNumber, long d[], int dCount, long h[], int hCount);
void GetOffset(float& xx, float& yy, float& zz) const;
int DriveCount() const;
int Drive(int driveNumber) const;
int HeaterCount() const;
int Heater(int heaterNumber) const;
int Number() const;
void SetVariables(float* standby, float* active);
void GetVariables(float* standby, float* active) const;
float MaxFeedrate() const;
float InstantDv() const;
friend class RepRap;
protected:
Tool* Next() const;
void Activate(Tool* currentlyActive);
void Standby();
void AddTool(Tool* t);
void UpdateExtruderAndHeaterCount(uint16_t &extruders, uint16_t &heaters) const;
private:
int myNumber;
int* drives;
int driveCount;
int* heaters;
float* activeTemperatures;
float* standbyTemperatures;
int heaterCount;
Tool* next;
bool active;
};
inline int Tool::DriveCount() const
{
return driveCount;
}
inline int Tool::Drive(int driveNumber) const
{
return drives[driveNumber];
}
inline int Tool::HeaterCount() const
{
return heaterCount;
}
inline int Tool::Heater(int heaterNumber) const
{
return heaters[heaterNumber];
}
inline Tool* Tool::Next() const
{
return next;
}
inline int Tool::Number() const
{
return myNumber;
}
#endif /* TOOL_H_ */