Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Duet3D/RepRapFirmware.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Hammacher <bmasterc@gmail.com>2021-07-21 14:50:07 +0300
committerChristian Hammacher <bmasterc@gmail.com>2021-07-21 14:50:07 +0300
commit72fc1c8ff2be93a31baa7ac57b4e85e4f9533a39 (patch)
tree6ccd7d04e4b89c5dc0199295ad0289c233fc50dd /src
parent6288d72fb0242a44cf48cc4ca4f4c4af284e2f66 (diff)
More work towards 3.4
Added new "cancelling" state to state.status Experimental support for M911/916 is now enabled
Diffstat (limited to 'src')
-rw-r--r--src/Fans/Fan.cpp2
-rw-r--r--src/Fans/Fan.h2
-rw-r--r--src/Fans/FansManager.cpp2
-rw-r--r--src/Fans/FansManager.h2
-rw-r--r--src/GCodes/GCodes.cpp19
-rw-r--r--src/GCodes/GCodes.h9
-rw-r--r--src/GCodes/GCodes2.cpp3
-rw-r--r--src/GCodes/GCodes3.cpp2
-rw-r--r--src/GCodes/GCodes4.cpp3
-rw-r--r--src/GCodes/ObjectTracker.cpp2
-rw-r--r--src/GCodes/ObjectTracker.h2
-rw-r--r--src/Heating/FOPDT.cpp4
-rw-r--r--src/Heating/FOPDT.h2
-rw-r--r--src/Heating/Heat.cpp4
-rw-r--r--src/Heating/Heat.h2
-rw-r--r--src/Movement/Kinematics/HangprinterKinematics.cpp2
-rw-r--r--src/Movement/Kinematics/HangprinterKinematics.h4
-rw-r--r--src/Movement/Kinematics/Kinematics.h4
-rw-r--r--src/Movement/Kinematics/LinearDeltaKinematics.cpp3
-rw-r--r--src/Movement/Kinematics/LinearDeltaKinematics.h4
-rw-r--r--src/Movement/Kinematics/RotaryDeltaKinematics.cpp2
-rw-r--r--src/Movement/Kinematics/RotaryDeltaKinematics.h4
-rw-r--r--src/Movement/Kinematics/ZLeadscrewKinematics.cpp2
-rw-r--r--src/Movement/Kinematics/ZLeadscrewKinematics.h2
-rw-r--r--src/Movement/Move.cpp2
-rw-r--r--src/Movement/Move.h2
-rw-r--r--src/Platform/Platform.cpp10
-rw-r--r--src/Platform/Platform.h5
-rw-r--r--src/Platform/RepRap.cpp16
-rw-r--r--src/Platform/RepRap.h2
-rw-r--r--src/Tools/Tool.cpp2
-rw-r--r--src/Tools/Tool.h2
32 files changed, 55 insertions, 73 deletions
diff --git a/src/Fans/Fan.cpp b/src/Fans/Fan.cpp
index 97f7c501..aae2e6fc 100644
--- a/src/Fans/Fan.cpp
+++ b/src/Fans/Fan.cpp
@@ -194,7 +194,7 @@ GCodeResult Fan::SetPwm(float speed, const StringRef& reply) noexcept
return Refresh(reply);
}
-#if HAS_MASS_STORAGE
+#if HAS_MASS_STORAGE || HAS_LINUX_INTERFACE
// Save the settings of this fan if it isn't thermostatic
bool Fan::WriteSettings(FileStore *f, size_t fanNum) const noexcept
diff --git a/src/Fans/Fan.h b/src/Fans/Fan.h
index 691166da..52ed20b5 100644
--- a/src/Fans/Fan.h
+++ b/src/Fans/Fan.h
@@ -48,7 +48,7 @@ public:
bool HasMonitoredSensors() const noexcept { return sensorsMonitored.IsNonEmpty(); }
const char *GetName() const noexcept { return name.c_str(); }
-#if HAS_MASS_STORAGE
+#if HAS_MASS_STORAGE || HAS_LINUX_INTERFACE
bool WriteSettings(FileStore *f, size_t fanNum) const noexcept; // save the settings of this fan if it isn't thermostatic
#endif
diff --git a/src/Fans/FansManager.cpp b/src/Fans/FansManager.cpp
index 12cd572b..75ecc3e2 100644
--- a/src/Fans/FansManager.cpp
+++ b/src/Fans/FansManager.cpp
@@ -75,7 +75,7 @@ size_t FansManager::GetNumFansToReport() const noexcept
return numFans;
}
-#if HAS_MASS_STORAGE
+#if HAS_MASS_STORAGE || HAS_LINUX_INTERFACE
bool FansManager::WriteFanSettings(FileStore *f) const noexcept
{
diff --git a/src/Fans/FansManager.h b/src/Fans/FansManager.h
index 309e62b3..bd9d7589 100644
--- a/src/Fans/FansManager.h
+++ b/src/Fans/FansManager.h
@@ -41,7 +41,7 @@ public:
#if SUPPORT_CAN_EXPANSION
void ProcessRemoteFanRpms(CanAddress src, const CanMessageFansReport& msg) noexcept;
#endif
-#if HAS_MASS_STORAGE
+#if HAS_MASS_STORAGE || HAS_LINUX_INTERFACE
bool WriteFanSettings(FileStore *f) const noexcept;
#endif
diff --git a/src/GCodes/GCodes.cpp b/src/GCodes/GCodes.cpp
index ba83e8b8..e057f9a2 100644
--- a/src/GCodes/GCodes.cpp
+++ b/src/GCodes/GCodes.cpp
@@ -1004,7 +1004,7 @@ void GCodes::DoPause(GCodeBuffer& gb, PauseReason reason, const char *msg, uint1
pauseRestorePoint.toolNumber = reprap.GetCurrentToolNumber();
pauseRestorePoint.fanSpeed = lastDefaultFanSpeed;
-#if HAS_MASS_STORAGE
+#if HAS_MASS_STORAGE || HAS_LINUX_INTERFACE
if (simulationMode == 0)
{
SaveResumeInfo(false); // create the resume file so that we can resume after power down
@@ -1325,16 +1325,10 @@ bool GCodes::ReHomeOnStall(DriversBitmap stalledDrivers) noexcept
#endif
-#if HAS_MASS_STORAGE
+#if HAS_MASS_STORAGE || HAS_LINUX_INTERFACE
void GCodes::SaveResumeInfo(bool wasPowerFailure) noexcept
{
-#if HAS_LINUX_INTERFACE
- if (reprap.UsingLinuxInterface())
- {
- return; // we can't yet save to the Pi
- }
-#endif
const char* const printingFilename = reprap.GetPrintMonitor().GetPrintingFilename();
if (printingFilename != nullptr)
{
@@ -4174,13 +4168,8 @@ void GCodes::StopPrint(StopPrintReason reason) noexcept
platform.MessageF(LoggedGenericMessage, "%s printing file %s, print time was %" PRIu32 "h %" PRIu32 "m\n",
(reason == StopPrintReason::normalCompletion) ? "Finished" : "Cancelled",
printingFilename, printMinutes/60u, printMinutes % 60u);
-#if HAS_MASS_STORAGE
- if ( reason == StopPrintReason::normalCompletion
- && simulationMode == 0
-# if HAS_LINUX_INTERFACE
- && !reprap.UsingLinuxInterface()
-# endif
- )
+#if HAS_MASS_STORAGE || HAS_LINUX_INTERFACE
+ if (reason == StopPrintReason::normalCompletion && simulationMode == 0)
{
platform.DeleteSysFile(RESUME_AFTER_POWER_FAIL_G);
}
diff --git a/src/GCodes/GCodes.h b/src/GCodes/GCodes.h
index 40d0ca69..9f484946 100644
--- a/src/GCodes/GCodes.h
+++ b/src/GCodes/GCodes.h
@@ -77,11 +77,12 @@ enum class StopPrintReason
enum class PauseState : uint8_t
{
- // Do not change the order of these! We rely on notPaused < pausing < { paused, resuming}
+ // Do not change the order of these! We rely on notPaused < pausing < { paused, resuming, cancelling }
notPaused = 0,
pausing,
paused,
- resuming
+ resuming,
+ cancelling
};
struct M585Settings
@@ -400,7 +401,7 @@ private:
#if SUPPORT_WORKPLACE_COORDINATES
GCodeResult GetSetWorkplaceCoordinates(GCodeBuffer& gb, const StringRef& reply, bool compute) THROWS(GCodeException); // Set workspace coordinates
-# if HAS_MASS_STORAGE
+# if HAS_MASS_STORAGE || HAS_LINUX_INTERFACE
bool WriteWorkplaceCoordinates(FileStore *f) const noexcept;
# endif
#endif
@@ -482,7 +483,7 @@ private:
void EndSimulation(GCodeBuffer *gb) noexcept; // Restore positions etc. when exiting simulation mode
bool IsCodeQueueIdle() const noexcept; // Return true if the code queue is idle
-#if HAS_MASS_STORAGE
+#if HAS_MASS_STORAGE || HAS_LINUX_INTERFACE
void SaveResumeInfo(bool wasPowerFailure) noexcept;
#endif
diff --git a/src/GCodes/GCodes2.cpp b/src/GCodes/GCodes2.cpp
index 742e5575..0ef13cc9 100644
--- a/src/GCodes/GCodes2.cpp
+++ b/src/GCodes/GCodes2.cpp
@@ -536,6 +536,7 @@ bool GCodes::HandleMcode(GCodeBuffer& gb, const StringRef& reply) THROWS(GCodeEx
break;
}
+ pauseState = PauseState::cancelling;
const bool leaveHeatersOn = (gb.Seen('H') && gb.GetIValue() > 0);
gb.SetState((leaveHeatersOn) ? GCodeState::stoppingWithHeatersOn : GCodeState::stoppingWithHeatersOff);
(void)DoFileMacro(gb, (code == 0) ? STOP_G : SLEEP_G, false, SystemHelperMacroCode);
@@ -4409,7 +4410,7 @@ bool GCodes::HandleMcode(GCodeBuffer& gb, const StringRef& reply) THROWS(GCodeEx
break;
#endif
-#if HAS_MASS_STORAGE
+#if HAS_MASS_STORAGE || HAS_LINUX_INTERFACE
case 916:
if (!platform.SysFileExists(RESUME_AFTER_POWER_FAIL_G))
{
diff --git a/src/GCodes/GCodes3.cpp b/src/GCodes/GCodes3.cpp
index b48ae06b..3f991bf0 100644
--- a/src/GCodes/GCodes3.cpp
+++ b/src/GCodes/GCodes3.cpp
@@ -196,7 +196,7 @@ GCodeResult GCodes::GetSetWorkplaceCoordinates(GCodeBuffer& gb, const StringRef&
return GCodeResult::badOrMissingParameter;
}
-# if HAS_MASS_STORAGE
+# if HAS_MASS_STORAGE || HAS_LINUX_INTERFACE
// Save all the workplace coordinate offsets to file returning true if successful. Used by M500 and by SaveResumeInfo.
bool GCodes::WriteWorkplaceCoordinates(FileStore *f) const noexcept
diff --git a/src/GCodes/GCodes4.cpp b/src/GCodes/GCodes4.cpp
index ce9cad7e..34a28473 100644
--- a/src/GCodes/GCodes4.cpp
+++ b/src/GCodes/GCodes4.cpp
@@ -618,6 +618,7 @@ void GCodes::RunStateMachine(GCodeBuffer& gb, const StringRef& reply) noexcept
case GCodeState::stoppingWithHeatersOn: // M0 H1 or M1 H1 after executing stop.g/sleep.g if present
if (LockMovementAndWaitForStandstill(gb))
{
+ pauseState = PauseState::notPaused;
platform.SetDriversIdle();
gb.SetState(GCodeState::normal);
}
@@ -1421,7 +1422,7 @@ void GCodes::RunStateMachine(GCodeBuffer& gb, const StringRef& reply) noexcept
}
else
{
-# if HAS_MASS_STORAGE
+# if HAS_MASS_STORAGE || HAS_LINUX_INTERFACE
SaveResumeInfo(true); // create the resume file so that we can resume after power down
# endif
platform.Message(LoggedGenericMessage, "Print auto-paused due to low voltage\n");
diff --git a/src/GCodes/ObjectTracker.cpp b/src/GCodes/ObjectTracker.cpp
index bbd7d70b..37fb4eb1 100644
--- a/src/GCodes/ObjectTracker.cpp
+++ b/src/GCodes/ObjectTracker.cpp
@@ -265,7 +265,7 @@ void ObjectTracker::ResumePrinting(GCodeBuffer& gb) noexcept
}
}
-#if HAS_MASS_STORAGE
+#if HAS_MASS_STORAGE || HAS_LINUX_INTERFACE
// Write the object details to file, returning true if successful
bool ObjectTracker::WriteObjectDirectory(FileStore *f) const noexcept
diff --git a/src/GCodes/ObjectTracker.h b/src/GCodes/ObjectTracker.h
index bb12d5d5..a3b2b098 100644
--- a/src/GCodes/ObjectTracker.h
+++ b/src/GCodes/ObjectTracker.h
@@ -52,7 +52,7 @@ public:
bool IsCancelled(size_t objectNumber) const noexcept { return objectsCancelled.IsBitSet(objectNumber); }
#endif
-#if HAS_MASS_STORAGE
+#if HAS_MASS_STORAGE || HAS_LINUX_INTERFACE
bool WriteObjectDirectory(FileStore *f) const noexcept;
#endif
diff --git a/src/Heating/FOPDT.cpp b/src/Heating/FOPDT.cpp
index 3ffee68d..a4021864 100644
--- a/src/Heating/FOPDT.cpp
+++ b/src/Heating/FOPDT.cpp
@@ -7,7 +7,7 @@
#include "FOPDT.h"
-#if HAS_MASS_STORAGE
+#if HAS_MASS_STORAGE || HAS_LINUX_INTERFACE
# include "Storage/FileStore.h"
#endif
@@ -146,7 +146,7 @@ void FopDt::SetM301PidParameters(const M301PidParameters& pp) noexcept
pidParametersOverridden = true;
}
-#if HAS_MASS_STORAGE
+#if HAS_MASS_STORAGE || HAS_LINUX_INTERFACE
// Write the model parameters to file returning true if no error
bool FopDt::WriteParameters(FileStore *f, size_t heater) const noexcept
diff --git a/src/Heating/FOPDT.h b/src/Heating/FOPDT.h
index 84ac8123..7edee12a 100644
--- a/src/Heating/FOPDT.h
+++ b/src/Heating/FOPDT.h
@@ -72,7 +72,7 @@ public:
return (forLoadChange) ? loadChangeParams : setpointChangeParams;
}
-#if HAS_MASS_STORAGE
+#if HAS_MASS_STORAGE || HAS_LINUX_INTERFACE
bool WriteParameters(FileStore *f, size_t heater) const noexcept; // erite the model parameters to file returning true if no error
#endif
diff --git a/src/Heating/Heat.cpp b/src/Heating/Heat.cpp
index 24dacd12..ed81067d 100644
--- a/src/Heating/Heat.cpp
+++ b/src/Heating/Heat.cpp
@@ -714,7 +714,7 @@ float Heat::GetHighestTemperatureLimit() const noexcept
return limit;
}
-#if HAS_MASS_STORAGE
+#if HAS_MASS_STORAGE || HAS_LINUX_INTERFACE
// Write heater model parameters to file returning true if no error
bool Heat::WriteModelParameters(FileStore *f) const noexcept
@@ -1080,7 +1080,7 @@ void Heat::InsertSensor(TemperatureSensor *newSensor) noexcept
}
}
-#if HAS_MASS_STORAGE
+#if HAS_MASS_STORAGE || HAS_LINUX_INTERFACE
// Save some resume information returning true if successful.
// We assume that the bed and chamber heaters are either on and active, or off (not on standby).
diff --git a/src/Heating/Heat.h b/src/Heating/Heat.h
index 6bb51e21..bcd9e2ed 100644
--- a/src/Heating/Heat.h
+++ b/src/Heating/Heat.h
@@ -127,7 +127,7 @@ public:
void SwitchOff(int heater) noexcept; // Turn off a specific heater
void FeedForwardAdjustment(unsigned int heater, float fanPwmChange, float extrusionChange) const noexcept;
-#if HAS_MASS_STORAGE
+#if HAS_MASS_STORAGE || HAS_LINUX_INTERFACE
bool WriteModelParameters(FileStore *f) const noexcept; // Write heater model parameters to file returning true if no error
bool WriteBedAndChamberTempSettings(FileStore *f) const noexcept; // Save some resume information
#endif
diff --git a/src/Movement/Kinematics/HangprinterKinematics.cpp b/src/Movement/Kinematics/HangprinterKinematics.cpp
index 3d5c65aa..11083cee 100644
--- a/src/Movement/Kinematics/HangprinterKinematics.cpp
+++ b/src/Movement/Kinematics/HangprinterKinematics.cpp
@@ -435,7 +435,7 @@ AxesBitmap HangprinterKinematics::MustBeHomedAxes(AxesBitmap axesMoving, bool di
return axesMoving;
}
-#if HAS_MASS_STORAGE
+#if HAS_MASS_STORAGE || HAS_LINUX_INTERFACE
// Write the parameters that are set by auto calibration to a file, returning true if success
bool HangprinterKinematics::WriteCalibrationParameters(FileStore *f) const noexcept
diff --git a/src/Movement/Kinematics/HangprinterKinematics.h b/src/Movement/Kinematics/HangprinterKinematics.h
index 9258745c..c974c2fe 100644
--- a/src/Movement/Kinematics/HangprinterKinematics.h
+++ b/src/Movement/Kinematics/HangprinterKinematics.h
@@ -24,7 +24,7 @@ public:
bool SupportsAutoCalibration() const noexcept override { return true; }
bool DoAutoCalibration(size_t numFactors, const RandomProbePointSet& probePoints, const StringRef& reply) noexcept override;
void SetCalibrationDefaults() noexcept override { Init(); }
-#if HAS_MASS_STORAGE
+#if HAS_MASS_STORAGE || HAS_LINUX_INTERFACE
bool WriteCalibrationParameters(FileStore *f) const noexcept override;
#endif
LimitPositionResult LimitPosition(float finalCoords[], const float * null initialCoords, size_t numAxes, AxesBitmap axesToLimit, bool isCoordinated, bool applyM208Limits) const noexcept override;
@@ -37,7 +37,7 @@ public:
AxesBitmap GetHomingFileName(AxesBitmap toBeHomed, AxesBitmap alreadyHomed, size_t numVisibleAxes, const StringRef& filename) const noexcept override;
bool QueryTerminateHomingMove(size_t axis) const noexcept override;
void OnHomingSwitchTriggered(size_t axis, bool highEnd, const float stepsPerMm[], DDA& dda) const noexcept override;
-#if HAS_MASS_STORAGE
+#if HAS_MASS_STORAGE || HAS_LINUX_INTERFACE
bool WriteResumeSettings(FileStore *f) const noexcept override;
#endif
diff --git a/src/Movement/Kinematics/Kinematics.h b/src/Movement/Kinematics/Kinematics.h
index addd6098..6b1eaae1 100644
--- a/src/Movement/Kinematics/Kinematics.h
+++ b/src/Movement/Kinematics/Kinematics.h
@@ -124,7 +124,7 @@ public:
// Do nothing if auto calibration is not supported.
virtual void SetCalibrationDefaults() noexcept { }
-#if HAS_MASS_STORAGE
+#if HAS_MASS_STORAGE || HAS_LINUX_INTERFACE
// Write the parameters that are set by auto calibration to the config-override.g file, returning true if success
// Just return true if auto calibration is not supported.
virtual bool WriteCalibrationParameters(FileStore *f) const noexcept { return true; }
@@ -186,7 +186,7 @@ public:
// This default is good for Cartesian and Core printers, but not deltas or SCARA
virtual AxesBitmap MustBeHomedAxes(AxesBitmap axesMoving, bool disallowMovesBeforeHoming) const noexcept { return (disallowMovesBeforeHoming) ? axesMoving : AxesBitmap(); }
-#if HAS_MASS_STORAGE
+#if HAS_MASS_STORAGE || HAS_LINUX_INTERFACE
// Write any calibration data that we need to resume a print after power fail, returning true if successful. Override where necessary.
virtual bool WriteResumeSettings(FileStore *f) const noexcept { return true; }
#endif
diff --git a/src/Movement/Kinematics/LinearDeltaKinematics.cpp b/src/Movement/Kinematics/LinearDeltaKinematics.cpp
index 7328294c..e504f31e 100644
--- a/src/Movement/Kinematics/LinearDeltaKinematics.cpp
+++ b/src/Movement/Kinematics/LinearDeltaKinematics.cpp
@@ -785,7 +785,7 @@ void LinearDeltaKinematics::PrintParameters(const StringRef& reply) const noexce
(double)(xTilt * 100.0), (double)(yTilt * 100.0));
}
-#if HAS_MASS_STORAGE
+#if HAS_MASS_STORAGE || HAS_LINUX_INTERFACE
// Write the parameters that are set by auto calibration to a file, returning true if success
bool LinearDeltaKinematics::WriteCalibrationParameters(FileStore *f) const noexcept
@@ -814,6 +814,7 @@ bool LinearDeltaKinematics::WriteCalibrationParameters(FileStore *f) const noexc
return ok;
}
+
// Write any calibration data that we need to resume a print after power fail, returning true if successful
bool LinearDeltaKinematics::WriteResumeSettings(FileStore *f) const noexcept
{
diff --git a/src/Movement/Kinematics/LinearDeltaKinematics.h b/src/Movement/Kinematics/LinearDeltaKinematics.h
index bdc008cf..d0e9cdcd 100644
--- a/src/Movement/Kinematics/LinearDeltaKinematics.h
+++ b/src/Movement/Kinematics/LinearDeltaKinematics.h
@@ -27,7 +27,7 @@ public:
bool DoAutoCalibration(size_t numFactors, const RandomProbePointSet& probePoints, const StringRef& reply) noexcept override;
void SetCalibrationDefaults() noexcept override { Init(); }
-#if HAS_MASS_STORAGE
+#if HAS_MASS_STORAGE || HAS_LINUX_INTERFACE
bool WriteCalibrationParameters(FileStore *f) const noexcept override;
#endif
@@ -44,7 +44,7 @@ public:
bool QueryTerminateHomingMove(size_t axis) const noexcept override;
void OnHomingSwitchTriggered(size_t axis, bool highEnd, const float stepsPerMm[], DDA& dda) const noexcept override;
-#if HAS_MASS_STORAGE
+#if HAS_MASS_STORAGE || HAS_LINUX_INTERFACE
bool WriteResumeSettings(FileStore *f) const noexcept override;
#endif
diff --git a/src/Movement/Kinematics/RotaryDeltaKinematics.cpp b/src/Movement/Kinematics/RotaryDeltaKinematics.cpp
index 53d15d47..595304a0 100644
--- a/src/Movement/Kinematics/RotaryDeltaKinematics.cpp
+++ b/src/Movement/Kinematics/RotaryDeltaKinematics.cpp
@@ -560,7 +560,7 @@ void RotaryDeltaKinematics::PrintParameters(const StringRef& reply) const noexce
(double)angleCorrections[DELTA_A_AXIS], (double)angleCorrections[DELTA_B_AXIS], (double)angleCorrections[DELTA_C_AXIS]);
}
-#if HAS_MASS_STORAGE
+#if HAS_MASS_STORAGE || HAS_LINUX_INTERFACE
// Add a space, character, and 3-element vector to the string
static void CatVector3(const StringRef& str, char c, const float vec[3]) noexcept
diff --git a/src/Movement/Kinematics/RotaryDeltaKinematics.h b/src/Movement/Kinematics/RotaryDeltaKinematics.h
index 1ff6bef2..807e301c 100644
--- a/src/Movement/Kinematics/RotaryDeltaKinematics.h
+++ b/src/Movement/Kinematics/RotaryDeltaKinematics.h
@@ -24,7 +24,7 @@ public:
bool SupportsAutoCalibration() const noexcept override { return true; }
bool DoAutoCalibration(size_t numFactors, const RandomProbePointSet& probePoints, const StringRef& reply) noexcept override;
void SetCalibrationDefaults() noexcept override { Init(); }
-#if HAS_MASS_STORAGE
+#if HAS_MASS_STORAGE || HAS_LINUX_INTERFACE
bool WriteCalibrationParameters(FileStore *f) const noexcept override;
#endif
LimitPositionResult LimitPosition(float finalCoords[], const float * null initialCoords, size_t numVisibleAxes, AxesBitmap axesToLimit, bool isCoordinated, bool applyM208Limits) const noexcept override;
@@ -37,7 +37,7 @@ public:
AxesBitmap GetHomingFileName(AxesBitmap toBeHomed, AxesBitmap alreadyHomed, size_t numVisibleAxes, const StringRef& filename) const noexcept override;
bool QueryTerminateHomingMove(size_t axis) const noexcept override;
void OnHomingSwitchTriggered(size_t axis, bool highEnd, const float stepsPerMm[], DDA& dda) const noexcept override;
-#if HAS_MASS_STORAGE
+#if HAS_MASS_STORAGE || HAS_LINUX_INTERFACE
bool WriteResumeSettings(FileStore *f) const noexcept override;
#endif
diff --git a/src/Movement/Kinematics/ZLeadscrewKinematics.cpp b/src/Movement/Kinematics/ZLeadscrewKinematics.cpp
index 61293b5c..63c2201c 100644
--- a/src/Movement/Kinematics/ZLeadscrewKinematics.cpp
+++ b/src/Movement/Kinematics/ZLeadscrewKinematics.cpp
@@ -421,7 +421,7 @@ void ZLeadscrewKinematics::AppendCorrections(const floatc_t corrections[], const
}
}
-#if HAS_MASS_STORAGE
+#if HAS_MASS_STORAGE || HAS_LINUX_INTERFACE
// Write any calibration data that we need to resume a print after power fail, returning true if successful
bool ZLeadscrewKinematics::WriteResumeSettings(FileStore *f) const noexcept
diff --git a/src/Movement/Kinematics/ZLeadscrewKinematics.h b/src/Movement/Kinematics/ZLeadscrewKinematics.h
index 5c8d0834..75d2a489 100644
--- a/src/Movement/Kinematics/ZLeadscrewKinematics.h
+++ b/src/Movement/Kinematics/ZLeadscrewKinematics.h
@@ -20,7 +20,7 @@ public:
bool Configure(unsigned int mCode, GCodeBuffer& gb, const StringRef& reply, bool& error) THROWS(GCodeException) override;
bool SupportsAutoCalibration() const noexcept override;
bool DoAutoCalibration(size_t numFactors, const RandomProbePointSet& probePoints, const StringRef& reply) noexcept override;
-#if HAS_MASS_STORAGE
+#if HAS_MASS_STORAGE || HAS_LINUX_INTERFACE
bool WriteResumeSettings(FileStore *f) const noexcept override;
#endif
diff --git a/src/Movement/Move.cpp b/src/Movement/Move.cpp
index 41b26b2b..b6fae1fa 100644
--- a/src/Movement/Move.cpp
+++ b/src/Movement/Move.cpp
@@ -953,7 +953,7 @@ void Move::SetIdleTimeout(float timeout) noexcept
reprap.MoveUpdated();
}
-#if HAS_MASS_STORAGE
+#if HAS_MASS_STORAGE || HAS_LINUX_INTERFACE
// Write settings for resuming the print
// The GCodes module deals with the head position so all we need worry about is the bed compensation
diff --git a/src/Movement/Move.h b/src/Movement/Move.h
index bf891f1e..19df4f89 100644
--- a/src/Movement/Move.h
+++ b/src/Movement/Move.h
@@ -159,7 +159,7 @@ public:
int32_t GetAccumulatedExtrusion(size_t extruder, bool& isPrinting) noexcept; // Return and reset the accumulated commanded extrusion amount
-#if HAS_MASS_STORAGE
+#if HAS_MASS_STORAGE || HAS_LINUX_INTERFACE
bool WriteResumeSettings(FileStore *f) const noexcept; // Write settings for resuming the print
#endif
diff --git a/src/Platform/Platform.cpp b/src/Platform/Platform.cpp
index 1bb22aac..2bf9c55d 100644
--- a/src/Platform/Platform.cpp
+++ b/src/Platform/Platform.cpp
@@ -4100,10 +4100,6 @@ bool Platform::FileExists(const char* folder, const char *filename) const noexce
return MassStorage::CombineName(location.GetRef(), folder, filename) && MassStorage::FileExists(location.c_str());
}
-#endif
-
-#if HAS_MASS_STORAGE
-
// Return a pointer to a string holding the directory where the system files are. Lock the sysdir lock before calling this.
const char* Platform::InternalGetSysDir() const noexcept
{
@@ -4116,12 +4112,6 @@ bool Platform::Delete(const char* folder, const char *filename) const noexcept
return MassStorage::CombineName(location.GetRef(), folder, filename) && MassStorage::Delete(location.c_str(), true);
}
-bool Platform::DirectoryExists(const char *folder, const char *dir) const noexcept
-{
- String<MaxFilenameLength> location;
- return MassStorage::CombineName(location.GetRef(), folder, dir) && MassStorage::DirectoryExists(location.c_str());
-}
-
// Set the system files path
GCodeResult Platform::SetSysDir(const char* dir, const StringRef& reply) noexcept
{
diff --git a/src/Platform/Platform.h b/src/Platform/Platform.h
index ac73580e..b3919efc 100644
--- a/src/Platform/Platform.h
+++ b/src/Platform/Platform.h
@@ -395,10 +395,7 @@ public:
#if HAS_MASS_STORAGE || HAS_LINUX_INTERFACE
FileStore* OpenFile(const char* folder, const char* fileName, OpenMode mode, uint32_t preAllocSize = 0) const noexcept;
bool FileExists(const char* folder, const char *filename) const noexcept;
-#endif
-#if HAS_MASS_STORAGE
bool Delete(const char* folder, const char *filename) const noexcept;
- bool DirectoryExists(const char *folder, const char *dir) const noexcept;
const char* GetWebDir() const noexcept; // Where the html etc files are
const char* GetGCodeDir() const noexcept; // Where the gcodes are
@@ -820,7 +817,7 @@ private:
#endif
// Files
-#if HAS_MASS_STORAGE
+#if HAS_MASS_STORAGE || HAS_LINUX_INTERFACE
const char *sysDir;
mutable ReadWriteLock sysDirLock;
#endif
diff --git a/src/Platform/RepRap.cpp b/src/Platform/RepRap.cpp
index b22f035d..216c004b 100644
--- a/src/Platform/RepRap.cpp
+++ b/src/Platform/RepRap.cpp
@@ -2502,21 +2502,22 @@ size_t RepRap::GetStatusIndex() const noexcept
: (gCodes->GetPauseState() == PauseState::pausing) ? 4 // Pausing
: (gCodes->GetPauseState() == PauseState::resuming) ? 5 // Resuming
: (gCodes->GetPauseState() == PauseState::paused) ? 6 // Paused
+ : (gCodes->GetPauseState() == PauseState::cancelling) ? 7 // Paused
: (printMonitor->IsPrinting())
- ? ((gCodes->IsSimulating()) ? 7 // Simulating
- : 8 // Printing
+ ? ((gCodes->IsSimulating()) ? 8 // Simulating
+ : 9 // Printing
)
- : (gCodes->IsDoingToolChange()) ? 9 // Changing tool
+ : (gCodes->IsDoingToolChange()) ? 10 // Changing tool
: (gCodes->DoingFileMacro() || !move->NoLiveMovement() ||
- gCodes->WaitingForAcknowledgement()) ? 10 // Busy
- : 11; // Idle
+ gCodes->WaitingForAcknowledgement()) ? 11 // Busy
+ : 12; // Idle
}
// Get the status character for the new-style status response
char RepRap::GetStatusCharacter() const noexcept
{
- return "CFHODRSMPTBI"[GetStatusIndex()];
+ return "CFHODRSAMPTBI"[GetStatusIndex()];
}
const char* RepRap::GetStatusString() const noexcept
@@ -2530,6 +2531,7 @@ const char* RepRap::GetStatusString() const noexcept
"pausing",
"resuming",
"paused",
+ "cancelling",
"simulating",
"processing",
"changingTool",
@@ -2631,7 +2633,7 @@ GCodeResult RepRap::ClearTemperatureFault(int8_t wasDudHeater, const StringRef&
return rslt;
}
-#if HAS_MASS_STORAGE
+#if HAS_MASS_STORAGE || HAS_LINUX_INTERFACE
// Save some resume information, returning true if successful
// We assume that the tool configuration doesn't change, only the temperatures and the mix
diff --git a/src/Platform/RepRap.h b/src/Platform/RepRap.h
index 80cac81b..14c3a2c4 100644
--- a/src/Platform/RepRap.h
+++ b/src/Platform/RepRap.h
@@ -161,7 +161,7 @@ public:
void SetAlert(const char *msg, const char *title, int mode, float timeout, AxesBitmap controls) noexcept;
void ClearAlert() noexcept;
-#if HAS_MASS_STORAGE
+#if HAS_MASS_STORAGE || HAS_LINUX_INTERFACE
bool WriteToolSettings(FileStore *f) noexcept; // save some information for the resume file
bool WriteToolParameters(FileStore *f, const bool forceWriteOffsets) noexcept; // save some information in config-override.g
#endif
diff --git a/src/Tools/Tool.cpp b/src/Tools/Tool.cpp
index 8e92c31f..6493039d 100644
--- a/src/Tools/Tool.cpp
+++ b/src/Tools/Tool.cpp
@@ -571,7 +571,7 @@ void Tool::DefineMix(const float m[]) noexcept
reprap.ToolsUpdated();
}
-#if HAS_MASS_STORAGE
+#if HAS_MASS_STORAGE || HAS_LINUX_INTERFACE
// Write the tool's settings to file returning true if successful. The settings written leave the tool selected unless it is off.
bool Tool::WriteSettings(FileStore *f) const noexcept
diff --git a/src/Tools/Tool.h b/src/Tools/Tool.h
index a12356ef..01c26ffc 100644
--- a/src/Tools/Tool.h
+++ b/src/Tools/Tool.h
@@ -98,7 +98,7 @@ public:
uint32_t GetSpindleRpm() const noexcept { return spindleRpm; }
void SetSpindleRpm(uint32_t rpm) THROWS(GCodeException);
-#if HAS_MASS_STORAGE
+#if HAS_MASS_STORAGE || HAS_LINUX_INTERFACE
bool WriteSettings(FileStore *f) const noexcept; // write the tool's settings to file
#endif