diff options
author | David Crocker <dcrocker@eschertech.com> | 2020-03-08 23:29:10 +0300 |
---|---|---|
committer | David Crocker <dcrocker@eschertech.com> | 2020-03-08 23:29:10 +0300 |
commit | d6c387ceb68cc7b56eb371834b5698a702acb3f4 (patch) | |
tree | 769b97e210bb500889f0072b3de7e07a3848848d /src/Endstops | |
parent | 8586a96c969594bd31cc9b2275e54b41e179a74b (diff) |
Z probe changes and per-tool M208 changes
M208 is now configured and reported per tool instead of globally
Partial refactoring to support multiple Z probes, including new P
parameter to M401 and m402
Diffstat (limited to 'src/Endstops')
-rw-r--r-- | src/Endstops/ZProbe.cpp | 5 | ||||
-rw-r--r-- | src/Endstops/ZProbe.h | 7 |
2 files changed, 8 insertions, 4 deletions
diff --git a/src/Endstops/ZProbe.cpp b/src/Endstops/ZProbe.cpp index 6d6b3283..ae1e97f9 100644 --- a/src/Endstops/ZProbe.cpp +++ b/src/Endstops/ZProbe.cpp @@ -49,6 +49,7 @@ constexpr ObjectModelTableEntry ZProbe::objectModelTable[] = // Within each group, these entries must be in alphabetical order // 0. Probe members { "calibrationTemperature", OBJECT_MODEL_FUNC(self->calibTemperature, 1), ObjectModelEntryFlags::none }, + { "deployedByUser", OBJECT_MODEL_FUNC(self->isDeployedByUser), ObjectModelEntryFlags::none }, { "disablesHeaters", OBJECT_MODEL_FUNC((bool)self->misc.parts.turnHeatersOff), ObjectModelEntryFlags::none }, { "diveHeight", OBJECT_MODEL_FUNC(self->diveHeight, 1), ObjectModelEntryFlags::none }, { "maxProbeCount", OBJECT_MODEL_FUNC((int32_t)self->misc.parts.maxTaps), ObjectModelEntryFlags::none }, @@ -64,13 +65,13 @@ constexpr ObjectModelTableEntry ZProbe::objectModelTable[] = { "value", OBJECT_MODEL_FUNC_NOSELF(&valueArrayDescriptor), ObjectModelEntryFlags::live }, }; -constexpr uint8_t ZProbe::objectModelTableDescriptor[] = { 1, 14 }; +constexpr uint8_t ZProbe::objectModelTableDescriptor[] = { 1, 15 }; DEFINE_GET_OBJECT_MODEL_TABLE(ZProbe) #endif -ZProbe::ZProbe(unsigned int num, ZProbeType p_type) noexcept : EndstopOrZProbe(), number(num) +ZProbe::ZProbe(unsigned int num, ZProbeType p_type) noexcept : EndstopOrZProbe(), number(num), isDeployedByUser(false) { SetDefaults(); type = p_type; diff --git a/src/Endstops/ZProbe.h b/src/Endstops/ZProbe.h index 9d43476e..363ac91e 100644 --- a/src/Endstops/ZProbe.h +++ b/src/Endstops/ZProbe.h @@ -49,14 +49,15 @@ public: bool GetSaveToConfigOverride() const noexcept { return misc.parts.saveToConfigOverride; } int GetAdcValue() const noexcept { return adcValue; } unsigned int GetMaxTaps() const { return misc.parts.maxTaps; } - void SetProbingAway(const bool probingAway) noexcept { misc.parts.probingAway = probingAway; } - int GetReading() const noexcept; int GetSecondaryValues(int& v1) const noexcept; + bool IsDeployedByUser() const noexcept { return isDeployedByUser; } + void SetProbingAway(const bool probingAway) noexcept { misc.parts.probingAway = probingAway; } GCodeResult HandleG31(GCodeBuffer& gb, const StringRef& reply) THROWS_GCODE_EXCEPTION; void SetTriggerHeight(float height) noexcept { triggerHeight = height; } void SetSaveToConfigOverride() noexcept { misc.parts.saveToConfigOverride = true; } + void SetDeployedByUser(bool b) noexcept { isDeployedByUser = b; } #if HAS_MASS_STORAGE bool WriteParameters(FileStore *f, unsigned int probeNumber) const noexcept; @@ -93,6 +94,8 @@ protected: float travelSpeed; // the speed at which we travel to the probe point float recoveryTime; // Z probe recovery time float tolerance; // maximum difference between probe heights when doing >1 taps + + bool isDeployedByUser; // true if the user has used the M401 command to deploy this probe and not sent M402 to retract it }; // MotorStall Z probes have no port, also in a CAN environment the local and remote proxy versions are the same |