diff options
author | David Crocker <dcrocker@eschertech.com> | 2017-10-26 22:01:47 +0300 |
---|---|---|
committer | David Crocker <dcrocker@eschertech.com> | 2017-10-26 22:02:03 +0300 |
commit | c1983ffa6d33e88f491f1c21f35310fe2f3c88c8 (patch) | |
tree | b3c4c86d69d45313866f6a625ddb80f927bd4e9b /src | |
parent | 6e680b168367ef8a2a871081e8ec014792c7ee3a (diff) |
1.20beta2+1, various fixes
Fixed DHT temperatire sensors (thanks chrishamm)
Fixed saving of tool offsets by M500 if they were probed (thanks
chrishamm)
Other minor changes
Diffstat (limited to 'src')
-rw-r--r-- | src/Alligator/Pins_Alligator.h | 3 | ||||
-rw-r--r-- | src/Duet/Pins_Duet.h | 1 | ||||
-rw-r--r-- | src/DuetNG/Pins_DuetNG.h | 1 | ||||
-rw-r--r-- | src/GCodes/GCodeBuffer.cpp | 16 | ||||
-rw-r--r-- | src/GCodes/GCodeBuffer.h | 3 | ||||
-rw-r--r-- | src/GCodes/GCodeQueue.cpp | 10 | ||||
-rw-r--r-- | src/GCodes/GCodes.cpp | 60 | ||||
-rw-r--r-- | src/GCodes/GCodes.h | 2 | ||||
-rw-r--r-- | src/GCodes/GCodes2.cpp | 15 | ||||
-rw-r--r-- | src/Heating/Heat.cpp | 9 | ||||
-rw-r--r-- | src/Heating/Sensors/DhtSensor.cpp | 2 | ||||
-rw-r--r-- | src/Heating/Sensors/DhtSensor.h | 5 | ||||
-rw-r--r-- | src/Heating/Sensors/TemperatureSensor.cpp | 4 | ||||
-rw-r--r-- | src/Movement/BedProbing/RandomProbePointSet.cpp | 2 | ||||
-rw-r--r-- | src/Movement/DDA.h | 2 | ||||
-rw-r--r-- | src/PrintMonitor.cpp | 2 | ||||
-rw-r--r-- | src/RADDS/Pins_RADDS.h | 2 | ||||
-rw-r--r-- | src/RepRap.cpp | 8 | ||||
-rw-r--r-- | src/Scanner.cpp | 2 | ||||
-rw-r--r-- | src/Tools/Tool.cpp | 8 | ||||
-rw-r--r-- | src/Tools/Tool.h | 7 | ||||
-rw-r--r-- | src/Version.h | 4 |
22 files changed, 80 insertions, 88 deletions
diff --git a/src/Alligator/Pins_Alligator.h b/src/Alligator/Pins_Alligator.h index 1167e492..c1d72520 100644 --- a/src/Alligator/Pins_Alligator.h +++ b/src/Alligator/Pins_Alligator.h @@ -19,7 +19,10 @@ const size_t NumFirmwareUpdateModules = 1; #define DEFAULT_BOARD_TYPE BoardType::Alligator_2 #define SUPPORT_INKJET 0 // set nonzero to support inkjet control +#define SUPPORT_ROLAND 0 // set nonzero to support Roland mill #define SUPPORT_SCANNER 0 // set nonzero to support FreeLSS scanners +#define SUPPORT_IOBITS 0 // set to support P parameter in G0/G1 commands +#define SUPPORT_DHT_SENSOR 0 // set nonzero to support DHT temperature/humidity sensors // The physical capabilities of the machine diff --git a/src/Duet/Pins_Duet.h b/src/Duet/Pins_Duet.h index 76623c34..e160645d 100644 --- a/src/Duet/Pins_Duet.h +++ b/src/Duet/Pins_Duet.h @@ -21,6 +21,7 @@ const size_t NumFirmwareUpdateModules = 1; #define SUPPORT_INKJET 0 // set nonzero to support inkjet control #define SUPPORT_ROLAND 0 // set nonzero to support Roland mill #define SUPPORT_SCANNER 0 // set nonzero to support FreeLSS scanners +#define SUPPORT_DHT_SENSOR 0 // set nonzero to support DHT temperature/humidity sensors // The physical capabilities of the machine diff --git a/src/DuetNG/Pins_DuetNG.h b/src/DuetNG/Pins_DuetNG.h index 047dfc18..4822995a 100644 --- a/src/DuetNG/Pins_DuetNG.h +++ b/src/DuetNG/Pins_DuetNG.h @@ -35,6 +35,7 @@ const size_t NumFirmwareUpdateModules = 1; // 1 module #define SUPPORT_ROLAND 0 // set nonzero to support Roland mill #define SUPPORT_SCANNER 1 // set zero to disable support for FreeLSS scanners #define SUPPORT_IOBITS 1 // set to support P parameter in G0/G1 commands +#define SUPPORT_DHT_SENSOR 1 // set nonzero to support DHT temperature/humidity sensors // The physical capabilities of the machine diff --git a/src/GCodes/GCodeBuffer.cpp b/src/GCodes/GCodeBuffer.cpp index 5c444a9d..666731b5 100644 --- a/src/GCodes/GCodeBuffer.cpp +++ b/src/GCodes/GCodeBuffer.cpp @@ -348,19 +348,25 @@ void GCodeBuffer::DecodeCommand() bufferState = GCodeBufferState::ready; } -// Add an entire string, overwriting any existing content -bool GCodeBuffer::Put(const char *str, size_t len) +// Add an entire string, overwriting any existing content and adding '\n' at the end if necessary to make it a complete line +void GCodeBuffer::Put(const char *str, size_t len) { Init(); for (size_t i = 0; i < len; i++) { - if (Put(str[i])) + if (Put(str[i])) // if the line is complete { - return true; + return; } } - return false; + (void)Put('\n'); // because there wasn't one at the end of the string +} + +// Add a null-terminated string, overwriting any existing content +void GCodeBuffer::Put(const char *str) +{ + Put(str, strlen(str)); } void GCodeBuffer::SetFinished(bool f) diff --git a/src/GCodes/GCodeBuffer.h b/src/GCodes/GCodeBuffer.h index f917f1d4..f610ecd3 100644 --- a/src/GCodes/GCodeBuffer.h +++ b/src/GCodes/GCodeBuffer.h @@ -21,7 +21,8 @@ public: void Init(); // Set it up to parse another G-code void Diagnostics(MessageType mtype); // Write some debug info bool Put(char c) __attribute__((hot)); // Add a character to the end - bool Put(const char *str, size_t len); // Add an entire string, overwriting any existing content + void Put(const char *str, size_t len); // Add an entire string, overwriting any existing content + void Put(const char *str); // Add a null-terminated string, overwriting any existing content bool Seen(char c) __attribute__((hot)); // Is a character present? char GetCommandLetter() const { return commandLetter; } diff --git a/src/GCodes/GCodeQueue.cpp b/src/GCodes/GCodeQueue.cpp index 0e701acf..e3676150 100644 --- a/src/GCodes/GCodeQueue.cpp +++ b/src/GCodes/GCodeQueue.cpp @@ -136,10 +136,7 @@ bool GCodeQueue::QueueCode(GCodeBuffer &gb, uint32_t segmentsLeft) { reprap.GetPlatform().Message(DebugMessage, "(swap) "); } - if (!gb.Put(codeToRun, codeToRunLength)) - { - gb.Put('\n'); - } + gb.Put(codeToRun, codeToRunLength); } } @@ -243,10 +240,7 @@ void QueuedCode::AssignFrom(GCodeBuffer &gb) void QueuedCode::AssignTo(GCodeBuffer *gb) { gb->SetToolNumberAdjust(toolNumberAdjust); - if (!gb->Put(code, strlen(code) + 1)) - { - gb->Put('\n'); - } + gb->Put(code); } // End diff --git a/src/GCodes/GCodes.cpp b/src/GCodes/GCodes.cpp index 6acf9fb7..1e5777f9 100644 --- a/src/GCodes/GCodes.cpp +++ b/src/GCodes/GCodes.cpp @@ -288,7 +288,7 @@ void GCodes::Spin() { if (gb.MachineState().previous == nullptr) { - CancelPrint(false, false); + StopPrint(false); } else { @@ -1089,8 +1089,7 @@ void GCodes::RunStateMachine(GCodeBuffer& gb, StringRef& reply) } else { - const float *offsets = tool->GetOffsets(); - tool->SetOffset(Z_AXIS, offsets[Z_AXIS] + g30zHeightError, true); + tool->SetOffset(Z_AXIS, tool->GetOffset(Z_AXIS) + g30zHeightError, true); } } else @@ -1309,7 +1308,7 @@ void GCodes::DoFilePrint(GCodeBuffer& gb, StringRef& reply) && IsCodeQueueIdle() // must also wait until deferred command queue has caught up ) { - CancelPrint(true, true); + StopPrint(true); } } else @@ -1330,8 +1329,7 @@ void GCodes::DoFilePrint(GCodeBuffer& gb, StringRef& reply) HandleReply(gb, false, ""); if (pausePending && &gb == fileGCode && !gb.IsDoingFileMacro()) { - const char* const m226Command = "M226\n"; - gb.Put(m226Command, strlen(m226Command) + 1); + gb.Put("M226"); pausePending = false; } } @@ -1645,7 +1643,7 @@ bool GCodes::LowVoltagePause() // Run the auto-pause script if (powerFailScript != nullptr) { - autoPauseGCode->Put(powerFailScript, strlen(powerFailScript) + 1); + autoPauseGCode->Put(powerFailScript); } autoPauseGCode->SetState(GCodeState::powerFailPausing1); isPaused = true; @@ -2870,10 +2868,9 @@ void GCodes::GetCurrentCoordinates(StringRef& s) const const Tool * const currentTool = reprap.GetCurrentTool(); if (currentTool != nullptr) { - const float * const offset = currentTool->GetOffsets(); for (size_t i = 0; i < numVisibleAxes; ++i) { - liveCoordinates[i] += offset[i]; + liveCoordinates[i] += currentTool->GetOffset(i); } } @@ -3152,25 +3149,18 @@ GCodeResult GCodes::SetOrReportOffsets(GCodeBuffer &gb, StringRef& reply) } } - // Deal with setting offsets - float offset[MaxAxes]; - for (size_t i = 0; i < MaxAxes; ++i) - { - offset[i] = tool->GetOffsets()[i]; - } - bool settingOffset = false; for (size_t axis = 0; axis < numVisibleAxes; ++axis) { - gb.TryGetFValue(axisLetters[axis], offset[axis], settingOffset); - } - if (settingOffset) - { - if (!LockMovement(gb)) + if (gb.Seen(axisLetters[axis])) { - return GCodeResult::notFinished; + if (!LockMovement(gb)) + { + return GCodeResult::notFinished; + } + settingOffset = true; + tool->SetOffset(axis, gb.GetFValue(), gb.MachineState().runningM501); } - tool->SetOffsets(offset); } // Deal with setting temperatures @@ -3204,7 +3194,7 @@ GCodeResult GCodes::SetOrReportOffsets(GCodeBuffer &gb, StringRef& reply) reply.printf("Tool %d offsets:", tool->Number()); for (size_t axis = 0; axis < numVisibleAxes; ++axis) { - reply.catf(" %c%.2f", axisLetters[axis], (double)offset[axis]); + reply.catf(" %c%.2f", axisLetters[axis], (double)tool->GetOffset(axis)); } if (hCount != 0) { @@ -3926,7 +3916,7 @@ bool GCodes::IsCodeQueueIdle() const // Cancel the current SD card print. // This is called from Pid.cpp when there is a heater fault, and from elsewhere in this module. -void GCodes::CancelPrint(bool printStats, bool deleteResumeFile) +void GCodes::StopPrint(bool normalCompletion) { segmentsLeft = 0; isPaused = pausePending = false; @@ -3969,16 +3959,14 @@ void GCodes::CancelPrint(bool printStats, bool deleteResumeFile) // Pronterface expects a "Done printing" message platform.Message(UsbMessage, "Done printing file"); } - if (printStats) - { - const uint32_t printMinutes = lrintf(reprap.GetPrintMonitor().GetPrintDuration()/60.0); - platform.MessageF(LoggedGenericMessage, "Finished printing file %s, print time was %" PRIu32 "h %" PRIu32 "m\n", - printingFilename, printMinutes/60u, printMinutes % 60u); - } + const uint32_t printMinutes = lrintf(reprap.GetPrintMonitor().GetPrintDuration()/60.0); + platform.MessageF(LoggedGenericMessage, "%s printing file %s, print time was %" PRIu32 "h %" PRIu32 "m\n", + (normalCompletion) ? "Finished" : "Cancelled", + printingFilename, printMinutes/60u, printMinutes % 60u); } reprap.GetPrintMonitor().StoppedPrint(); // must do this after printing the simulation details because it clears the filename - if (deleteResumeFile && simulationMode == 0) + if (normalCompletion && simulationMode == 0) { platform.GetMassStorage()->Delete(platform.GetSysDir(), RESUME_AFTER_POWER_FAIL_G, true); } @@ -4069,7 +4057,7 @@ void GCodes::ToolOffsetTransform(const float coordsIn[MaxAxes], float coordsOut[ && (axis != Y_AXIS || IsBitSet(yAxes, Y_AXIS)) ) { - const float totalOffset = currentTool->GetOffsets()[axis] + axisOffsets[axis]; + const float totalOffset = currentTool->GetOffset(axis) + axisOffsets[axis]; const size_t inputAxis = (IsBitSet(explicitAxes, axis)) ? axis : (IsBitSet(xAxes, axis)) ? X_AXIS : (IsBitSet(yAxes, axis)) ? Y_AXIS @@ -4101,15 +4089,15 @@ void GCodes::ToolOffsetInverseTransform(const float coordsIn[MaxAxes], float coo size_t numXAxes = 0, numYAxes = 0; for (size_t axis = 0; axis < numVisibleAxes; ++axis) { - coordsOut[axis] = coordsIn[axis] + currentTool->GetOffsets()[axis]; + coordsOut[axis] = coordsIn[axis] + currentTool->GetOffset(axis); if (IsBitSet(xAxes, axis)) { - xCoord += coordsIn[axis]/axisScaleFactors[axis] + currentTool->GetOffsets()[axis]; + xCoord += coordsIn[axis]/axisScaleFactors[axis] + currentTool->GetOffset(axis); ++numXAxes; } if (IsBitSet(yAxes, axis)) { - yCoord += coordsIn[axis]/axisScaleFactors[axis] + currentTool->GetOffsets()[axis]; + yCoord += coordsIn[axis]/axisScaleFactors[axis] + currentTool->GetOffset(axis); ++numYAxes; } } diff --git a/src/GCodes/GCodes.h b/src/GCodes/GCodes.h index bbe13e46..db1ac8da 100644 --- a/src/GCodes/GCodes.h +++ b/src/GCodes/GCodes.h @@ -170,7 +170,7 @@ public: bool AllAxesAreHomed() const; // Return true if all axes are homed - void CancelPrint(bool printStats, bool deleteResumeFile); // Cancel the current print + void StopPrint(bool normalCompletion); // Stop the current print void MoveStoppedByZProbe() { zProbeTriggered = true; } // Called from the step ISR when the Z probe is triggered, causing the move to be aborted diff --git a/src/GCodes/GCodes2.cpp b/src/GCodes/GCodes2.cpp index 8767b4a1..5920f434 100644 --- a/src/GCodes/GCodes2.cpp +++ b/src/GCodes/GCodes2.cpp @@ -293,16 +293,13 @@ bool GCodes::HandleMcode(GCodeBuffer& gb, StringRef& reply) return false; } { - bool wasPaused = isPaused; // isPaused gets cleared by CancelPrint - CancelPrint(true, &gb == fileGCode); // if this is normal end-of-print commanded by the file, deleted the ressurrect.g file - if (wasPaused) + const bool wasPaused = isPaused; // isPaused gets cleared by CancelPrint + StopPrint(&gb == fileGCode); // if this is normal end-of-print commanded by the file, deleted the resurrect.g file + + // If we are cancelling a paused print with M0 and we are homed and cancel.g exists then run it and do nothing else + if (wasPaused && code == 0 && AllAxesAreHomed() && DoFileMacro(gb, CANCEL_G, false)) { - reply.copy("Print cancelled"); - // If we are cancelling a paused print with M0 and we are homed and cancel.g exists then run it and do nothing else - if (code == 0 && AllAxesAreHomed() && DoFileMacro(gb, CANCEL_G, false)) - { - break; - } + break; } } diff --git a/src/Heating/Heat.cpp b/src/Heating/Heat.cpp index b67a8abc..e1326c76 100644 --- a/src/Heating/Heat.cpp +++ b/src/Heating/Heat.cpp @@ -23,6 +23,10 @@ Licence: GPL #include "RepRap.h" #include "Sensors/TemperatureSensor.h" +#if SUPPORT_DHT_SENSOR +# include "Sensors/DhtSensor.h" +#endif + Heat::Heat(Platform& p) : platform(p), active(false), coldExtrude(false), bedHeater(DefaultBedHeater), chamberHeater(DefaultChamberHeater), heaterBeingTuned(-1), lastHeaterTuned(-1) { @@ -146,6 +150,11 @@ void Heat::Spin() heaterBeingTuned = -1; } } + +#if SUPPORT_DHT_SENSOR + // If the DHT temperature sensor is active, it needs to be spinned too + DhtSensor::Spin(); +#endif } platform.ClassReport(longWait); } diff --git a/src/Heating/Sensors/DhtSensor.cpp b/src/Heating/Sensors/DhtSensor.cpp index 7b683e4f..868f22d8 100644 --- a/src/Heating/Sensors/DhtSensor.cpp +++ b/src/Heating/Sensors/DhtSensor.cpp @@ -10,7 +10,7 @@ #include "RepRap.h" #include "GCodes/GCodeBuffer.h" -#ifdef DUET_NG +#if SUPPORT_DHT_SENSOR const uint32_t MinimumReadInterval = 2000; // ms const uint32_t MaximumReadTime = 50; // ms diff --git a/src/Heating/Sensors/DhtSensor.h b/src/Heating/Sensors/DhtSensor.h index 1445a0af..fbb104cc 100644 --- a/src/Heating/Sensors/DhtSensor.h +++ b/src/Heating/Sensors/DhtSensor.h @@ -8,9 +8,10 @@ #ifndef SRC_HEATING_SENSORS_DHTSENSOR_H_ #define SRC_HEATING_SENSORS_DHTSENSOR_H_ -#ifdef DUET_NG +#include "RepRapFirmware.h" + +#if SUPPORT_DHT_SENSOR -#include "Heating/Heat.h" #include "TemperatureSensor.h" enum class DhtSensorType diff --git a/src/Heating/Sensors/TemperatureSensor.cpp b/src/Heating/Sensors/TemperatureSensor.cpp index 852c9796..0634fa4c 100644 --- a/src/Heating/Sensors/TemperatureSensor.cpp +++ b/src/Heating/Sensors/TemperatureSensor.cpp @@ -10,7 +10,7 @@ #include "CpuTemperatureSensor.h" #endif -#ifdef DUET_NG +#if SUPPORT_DHT_SENSOR #include "DhtSensor.h" #endif @@ -106,7 +106,7 @@ TemperatureSensor *TemperatureSensor::Create(unsigned int channel) { ts = new CurrentLoopTemperatureSensor(channel); } -#ifdef DUET_NG +#if SUPPORT_DHT_SENSOR else if (channel == DhtTemperatureChannel || channel == DhtHumidityChannel) { ts = new DhtSensor(channel); diff --git a/src/Movement/BedProbing/RandomProbePointSet.cpp b/src/Movement/BedProbing/RandomProbePointSet.cpp index a86d565a..282ea48e 100644 --- a/src/Movement/BedProbing/RandomProbePointSet.cpp +++ b/src/Movement/BedProbing/RandomProbePointSet.cpp @@ -230,7 +230,7 @@ bool RandomProbePointSet::GoodProbePointOrdering(size_t numPoints) const // Print out the probe heights and any errors void RandomProbePointSet::ReportProbeHeights(size_t numPoints, StringRef& reply) const { - reply.copy("Bed probe heights:"); + reply.copy("G32 bed probe heights:"); float sum = 0.0; float sumOfSquares = 0.0; for (size_t i = 0; i < numPoints; ++i) diff --git a/src/Movement/DDA.h b/src/Movement/DDA.h index 83a8fc9c..231e1db8 100644 --- a/src/Movement/DDA.h +++ b/src/Movement/DDA.h @@ -78,11 +78,11 @@ public: void MoveAborted(); + uint32_t GetClocksNeeded() const { return clocksNeeded; } bool IsGoodToPrepare() const; #if SUPPORT_IOBITS uint32_t GetMoveStartTime() const { return moveStartTime; } - uint32_t GetClocksNeeded() const { return clocksNeeded; } IoBits_t GetIoBits() const { return ioBits; } #endif diff --git a/src/PrintMonitor.cpp b/src/PrintMonitor.cpp index 3093a6df..e1f0eff8 100644 --- a/src/PrintMonitor.cpp +++ b/src/PrintMonitor.cpp @@ -1087,7 +1087,7 @@ unsigned int PrintMonitor::FindFilamentUsed(const char* buf, size_t len, float * // Look for filament usage as generated by S3D if (!filamentsFound) { - const char *filamentLengthStr = "ilament length:"; // comment string used by S3D + const char *filamentLengthStr = "ilament length"; // comment string used by S3D p = buf; while (filamentsFound < maxFilaments && (p = strstr(p, filamentLengthStr)) != nullptr) { diff --git a/src/RADDS/Pins_RADDS.h b/src/RADDS/Pins_RADDS.h index eb56525c..dbf7fc23 100644 --- a/src/RADDS/Pins_RADDS.h +++ b/src/RADDS/Pins_RADDS.h @@ -22,6 +22,8 @@ const size_t NumFirmwareUpdateModules = 1; #define SUPPORT_INKJET 0 // set nonzero to support inkjet control #define SUPPORT_ROLAND 0 // set nonzero to support Roland mill #define SUPPORT_SCANNER 0 // set nonzero to support FreeLSS scanners +#define SUPPORT_IOBITS 0 // set to support P parameter in G0/G1 commands +#define SUPPORT_DHT_SENSOR 0 // set nonzero to support DHT temperature/humidity sensors // The physical capabilities of the machine diff --git a/src/RepRap.cpp b/src/RepRap.cpp index 25ebfd99..2618d31a 100644 --- a/src/RepRap.cpp +++ b/src/RepRap.cpp @@ -595,10 +595,9 @@ OutputBuffer *RepRap::GetStatusResponse(uint8_t type, ResponseSource source) if (currentTool != nullptr) { - const float *offset = currentTool->GetOffsets(); for (size_t i = 0; i < numAxes; ++i) { - liveCoordinates[i] += offset[i]; + liveCoordinates[i] += currentTool->GetOffset(i); } } @@ -1294,10 +1293,9 @@ OutputBuffer *RepRap::GetLegacyStatusResponse(uint8_t type, int seq) const Tool* const currentTool = reprap.GetCurrentTool(); if (currentTool != nullptr) { - const float *offset = currentTool->GetOffsets(); for (size_t i = 0; i < numAxes; ++i) { - liveCoordinates[i] += offset[i]; + liveCoordinates[i] += currentTool->GetOffset(i); } } response->catf(",\"pos\":"); // announce the XYZ position @@ -1768,7 +1766,7 @@ bool RepRap::WriteToolParameters(FileStore *f) const { if (IsBitSet(axesProbed, axis)) { - scratchString.catf(" %c%.2f", GCodes::axisLetters[axis], (double)(t->GetOffsets()[axis])); + scratchString.catf(" %c%.2f", GCodes::axisLetters[axis], (double)(t->GetOffset(axis))); } } } diff --git a/src/Scanner.cpp b/src/Scanner.cpp index dc2d1821..3bcf4076 100644 --- a/src/Scanner.cpp +++ b/src/Scanner.cpp @@ -526,7 +526,7 @@ void Scanner::DoFileMacro(const char *filename) snprintf(gcode, ARRAY_SIZE(gcode), "M98 P%s\n", filename); gcode[ARRAY_UPB(gcode)] = 0; - serialGCode->Put(gcode, strlen(gcode)); + serialGCode->Put(gcode); } } diff --git a/src/Tools/Tool.cpp b/src/Tools/Tool.cpp index 8f69ba33..d5921268 100644 --- a/src/Tools/Tool.cpp +++ b/src/Tools/Tool.cpp @@ -462,14 +462,6 @@ bool Tool::WriteSettings(FileStore *f) const return ok; } -void Tool::SetOffsets(const float offs[MaxAxes]) -{ - for (size_t i = 0; i < MaxAxes; ++i) - { - offset[i] = offs[i]; - } -} - void Tool::SetOffset(size_t axis, float offs, bool byProbing) { offset[axis] = offs; diff --git a/src/Tools/Tool.h b/src/Tools/Tool.h index 4b0d2909..9f06e908 100644 --- a/src/Tools/Tool.h +++ b/src/Tools/Tool.h @@ -47,8 +47,7 @@ public: static Tool *Create(int toolNumber, const char *name, long d[], size_t dCount, long h[], size_t hCount, AxesBitmap xMap, AxesBitmap yMap, FansBitmap fanMap, StringRef& reply); static void Delete(Tool *t); - const float *GetOffsets() const; - void SetOffsets(const float offs[MaxAxes]); + float GetOffset(size_t axis) const pre(axis < MaxAxes); void SetOffset(size_t axis, float offs, bool byProbing) pre(axis < MaxAxes); AxesBitmap GetAxisOffsetsProbed() const { return axisOffsetsProbed; } size_t DriveCount() const; @@ -146,9 +145,9 @@ inline size_t Tool::DriveCount() const return driveCount; } -inline const float *Tool::GetOffsets() const +inline float Tool::GetOffset(size_t axis) const { - return offset; + return offset[axis]; } #endif /* TOOL_H_ */ diff --git a/src/Version.h b/src/Version.h index d4e6ab47..999670c4 100644 --- a/src/Version.h +++ b/src/Version.h @@ -9,11 +9,11 @@ #define SRC_VERSION_H_ #ifndef VERSION -# define VERSION "1.20beta2" +# define VERSION "1.20beta2+1" #endif #ifndef DATE -# define DATE "2017-10-25" +# define DATE "2017-10-26" #endif #define AUTHORS "reprappro, dc42, chrishamm, t3p3, dnewman" |