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/Reprap.h
David Crocker b9d6994ba5 Version 0.78f-dc42
M563 command extended to allow the tool number origin to be adjusted. If
there is no P parameter in the command then the S parameter specifies an
offset to be added to tool numbers in T, G10, M104 and M109 commands.
This is so that multi-media gcode files generated by slic3r can be
printed without having to edit all the tool numbers in the gcode file
first. This extension is intended to be temporary, until slicer provides
a mechanism for specifying the tool numbers. A separate offset is
maintained for each data source (USB, web or SD card) and the offset for
data from the SD card is reset to zero when a new file is started. To
use this facility to print slic3r multi-media gcode files, add M563 S1
to your start gcode.

M104 and M109 commands now accept an optional T parameter to specify the
tool number, as generated by slic3r in multi-media gcode files.

Movement code from RepRapPro's dev branch incorporated, including
5-point manual or automatic bed compensation mechanism.

Heater status (off/standby/on) is included in the status poll response
for the web interface. This will be used in a future version of the web
interface.

Incorporated code from RepRapPro dev branch to allow many more
M-commands to return values as well as set them.

Incorporated code from RepRapPro dev branch to implement the M119 and
M135 commands. There is currently a bug in the M135 (set heat sample
interval) command, which means that if you change the interval from its
default value of 0.5 seconds then you need to adjust the I parameter by
the same ratio and the D parameter by the inverse ratio.

Extrusion totals are reset to zero when starting a new print from SD
card.
2014-07-28 18:02:14 +01:00

109 lines
2.8 KiB
C++

/****************************************************************************************************
RepRapFirmware - Reprap
RepRap is a simple class that acts as a container for an instance of all the others.
-----------------------------------------------------------------------------------------------------
Version 0.1
21 May 2013
Adrian Bowyer
RepRap Professional Ltd
http://reprappro.com
Licence: GPL
****************************************************************************************************/
#ifndef REPRAP_H
#define REPRAP_H
class RepRap
{
public:
RepRap();
void EmergencyStop();
void Init();
void Spin();
void Exit();
void Interrupt();
void Diagnostics();
void Timing();
bool Debug() const;
void SetDebug(bool d);
void AddTool(Tool* t);
void SelectTool(int toolNumber);
void StandbyTool(int toolNumber);
Tool* GetCurrentTool();
Tool* GetTool(int toolNumber);
void SetToolVariables(int toolNumber, float* standbyTemperatures, float* activeTemperatures);
void PrintTool(int toolNumber, char* reply) const;
Platform* GetPlatform() const;
Move* GetMove() const;
Heat* GetHeat() const;
GCodes* GetGCodes() const;
Network* GetNetwork() const;
Webserver* GetWebserver() const;
void Tick();
bool IsStopped() const;
uint16_t GetTicksInSpinState() const;
uint16_t GetExtrudersInUse() const;
uint16_t GetHeatersInUse() const;
private:
Platform* platform;
Network* network;
Move* move;
Heat* heat;
GCodes* gCodes;
Webserver* webserver;
Tool* toolList;
Tool* currentTool;
uint16_t ticksInSpinState;
uint8_t spinState;
bool debug;
float fastLoop, slowLoop;
float lastTime;
bool stopped;
bool active;
bool resetting;
uint16_t activeExtruders;
uint16_t activeHeaters;
};
inline Platform* RepRap::GetPlatform() const { return platform; }
inline Move* RepRap::GetMove() const { return move; }
inline Heat* RepRap::GetHeat() const { return heat; }
inline GCodes* RepRap::GetGCodes() const { return gCodes; }
inline Network* RepRap::GetNetwork() const { return network; }
inline Webserver* RepRap::GetWebserver() const { return webserver; }
inline bool RepRap::Debug() const { return debug; }
inline Tool* RepRap::GetCurrentTool() { return currentTool; }
inline uint16_t RepRap::GetExtrudersInUse() const { return activeExtruders; }
inline uint16_t RepRap::GetHeatersInUse() const { return activeHeaters; }
inline void RepRap::SetDebug(bool d)
{
debug = d;
if(debug)
{
platform->Message(BOTH_MESSAGE, "Debugging enabled\n");
}
else
{
platform->Message(WEB_MESSAGE, "");
}
}
inline void RepRap::Interrupt() { move->Interrupt(); }
inline bool RepRap::IsStopped() const { return stopped; }
inline uint16_t RepRap::GetTicksInSpinState() const { return ticksInSpinState; }
#endif