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:
authorDavid Crocker <dcrocker@eschertech.com>2022-03-03 16:16:18 +0300
committerDavid Crocker <dcrocker@eschertech.com>2022-03-03 16:16:18 +0300
commit4c7fd792075167c8f92f7d216b09156d0525b939 (patch)
tree94c74500de9094d2d044f9dcecff21f9ed630db7 /src
parent43615f495e00221c701b407e8901a6768d57452d (diff)
Fix N538 and N539 codes on 12864 display
Diffstat (limited to 'src')
-rw-r--r--src/Display/MenuItem.cpp4
-rw-r--r--src/Movement/DDA.h9
-rw-r--r--src/Movement/DDARing.cpp28
-rw-r--r--src/Movement/DDARing.h8
-rw-r--r--src/Movement/Move.cpp8
-rw-r--r--src/Movement/Move.h8
-rw-r--r--src/Platform/RepRap.cpp2
7 files changed, 34 insertions, 33 deletions
diff --git a/src/Display/MenuItem.cpp b/src/Display/MenuItem.cpp
index f7632fb0..8bae0a22 100644
--- a/src/Display/MenuItem.cpp
+++ b/src/Display/MenuItem.cpp
@@ -434,11 +434,11 @@ void ValueMenuItem::Draw(Lcd& lcd, PixelNumber rightMargin, bool highlight, Pixe
break;
case 38: // requested speed
- currentValue.f = reprap.GetMove().GetRequestedSpeed();
+ currentValue.f = reprap.GetMove().GetRequestedSpeedMmPerSec();
break;
case 39: // top speed
- currentValue.f = reprap.GetMove().GetTopSpeed();
+ currentValue.f = reprap.GetMove().GetTopSpeedMmPerSec();
break;
default:
diff --git a/src/Movement/DDA.h b/src/Movement/DDA.h
index c4ce6b34..96a1ab86 100644
--- a/src/Movement/DDA.h
+++ b/src/Movement/DDA.h
@@ -140,10 +140,11 @@ public:
bool FetchEndPosition(volatile int32_t ep[MaxAxesPlusExtruders], volatile float endCoords[MaxAxesPlusExtruders]) noexcept;
void SetPositions(const float move[]) noexcept; // Force the endpoints to be these
FilePosition GetFilePosition() const noexcept { return filePos; }
- float GetRequestedSpeed() const noexcept { return requestedSpeed; }
- float GetTopSpeed() const noexcept { return topSpeed; }
- float GetAcceleration() const noexcept { return acceleration; }
- float GetDeceleration() const noexcept { return deceleration; }
+ float GetRequestedSpeedMmPerClock() const noexcept { return requestedSpeed; }
+ float GetRequestedSpeedMmPerSec() const noexcept { return InverseConvertSpeedToMmPerSec(requestedSpeed); }
+ float GetTopSpeedMmPerSec() const noexcept { return InverseConvertSpeedToMmPerSec(topSpeed); }
+ float GetAccelerationMmPerSecSquared() const noexcept { return InverseConvertAcceleration(acceleration); }
+ float GetDecelerationMmPerSecSquared() const noexcept { return InverseConvertAcceleration(deceleration); }
float GetVirtualExtruderPosition() const noexcept { return virtualExtruderPosition; }
float AdvanceBabyStepping(DDARing& ring, size_t axis, float amount) noexcept; // Try to push babystepping earlier in the move queue
const Tool *GetTool() const noexcept { return tool; }
diff --git a/src/Movement/DDARing.cpp b/src/Movement/DDARing.cpp
index bae5b3c4..ed8d9e00 100644
--- a/src/Movement/DDARing.cpp
+++ b/src/Movement/DDARing.cpp
@@ -738,28 +738,28 @@ void DDARing::ResetExtruderPositions() noexcept
liveCoordinatesChanged = true;
}
-float DDARing::GetRequestedSpeed() const noexcept
+float DDARing::GetRequestedSpeedMmPerSec() const noexcept
{
- DDA* const cdda = currentDda; // capture volatile variable
- return (cdda != nullptr) ? cdda->GetRequestedSpeed() : 0.0;
+ const DDA* const cdda = currentDda; // capture volatile variable
+ return (cdda != nullptr) ? cdda->GetRequestedSpeedMmPerSec() : 0.0;
}
-float DDARing::GetTopSpeed() const noexcept
+float DDARing::GetTopSpeedMmPerSec() const noexcept
{
- DDA* const cdda = currentDda; // capture volatile variable
- return (cdda != nullptr) ? cdda->GetTopSpeed() : 0.0;
+ const DDA* const cdda = currentDda; // capture volatile variable
+ return (cdda != nullptr) ? cdda->GetTopSpeedMmPerSec() : 0.0;
}
-float DDARing::GetAcceleration() const noexcept
+float DDARing::GetAccelerationMmPerSecSquared() const noexcept
{
- DDA* const cdda = currentDda; // capture volatile variable
- return (cdda != nullptr) ? cdda->GetAcceleration() : 0.0;
+ const DDA* const cdda = currentDda; // capture volatile variable
+ return (cdda != nullptr) ? cdda->GetAccelerationMmPerSecSquared() : 0.0;
}
-float DDARing::GetDeceleration() const noexcept
+float DDARing::GetDecelerationMmPerSecSquared() const noexcept
{
- DDA* const cdda = currentDda; // capture volatile variable
- return (cdda != nullptr) ? cdda->GetDeceleration() : 0.0;
+ const DDA* const cdda = currentDda; // capture volatile variable
+ return (cdda != nullptr) ? cdda->GetDecelerationMmPerSecSquared() : 0.0;
}
// Pause the print as soon as we can, returning true if we are able to skip any moves and updating 'rp' to the first move we skipped.
@@ -849,7 +849,7 @@ bool DDARing::PauseMoves(RestorePoint& rp) noexcept
rp.initialUserC1 = dda->GetInitialUserC1();
if (dda->UsingStandardFeedrate())
{
- rp.feedRate = dda->GetRequestedSpeed();
+ rp.feedRate = dda->GetRequestedSpeedMmPerClock();
}
rp.virtualExtruderPosition = dda->GetVirtualExtruderPosition();
rp.filePos = dda->GetFilePosition();
@@ -920,7 +920,7 @@ bool DDARing::LowPowerOrStallPause(RestorePoint& rp) noexcept
// We are going to skip some moves, or part of a move.
// Store the parameters of the first move we are going to execute when we resume
- rp.feedRate = dda->GetRequestedSpeed();
+ rp.feedRate = dda->GetRequestedSpeedMmPerClock();
rp.virtualExtruderPosition = dda->GetVirtualExtruderPosition();
rp.filePos = dda->GetFilePosition();
rp.proportionDone = dda->GetProportionDone(abortedMove); // store how much of the complete multi-segment move's extrusion has been done
diff --git a/src/Movement/DDARing.h b/src/Movement/DDARing.h
index bd654828..a9fd9a2f 100644
--- a/src/Movement/DDARing.h
+++ b/src/Movement/DDARing.h
@@ -56,10 +56,10 @@ public:
DDA *GetCurrentDDA() const noexcept { return currentDda; } // Return the DDA of the currently-executing move, or nullptr
- float GetRequestedSpeed() const noexcept;
- float GetTopSpeed() const noexcept;
- float GetAcceleration() const noexcept;
- float GetDeceleration() const noexcept;
+ float GetRequestedSpeedMmPerSec() const noexcept;
+ float GetTopSpeedMmPerSec() const noexcept;
+ float GetAccelerationMmPerSecSquared() const noexcept;
+ float GetDecelerationMmPerSecSquared() const noexcept;
int32_t GetEndPoint(size_t drive) const noexcept { return liveEndPoints[drive]; } // Get the current position of a motor
void GetCurrentMachinePosition(float m[MaxAxes], bool disableMotorMapping) const noexcept; // Get the current position in untransformed coords
diff --git a/src/Movement/Move.cpp b/src/Movement/Move.cpp
index fb72c6a2..403f0a63 100644
--- a/src/Movement/Move.cpp
+++ b/src/Movement/Move.cpp
@@ -122,14 +122,14 @@ constexpr ObjectModelTableEntry Move::objectModelTable[] =
{ "timeout", OBJECT_MODEL_FUNC(0.001f * (float)self->idleTimeout, 1), ObjectModelEntryFlags::none },
// 2. move.currentMove members
- { "acceleration", OBJECT_MODEL_FUNC(InverseConvertAcceleration(self->GetAcceleration()), 1), ObjectModelEntryFlags::live },
- { "deceleration", OBJECT_MODEL_FUNC(InverseConvertAcceleration(self->GetDeceleration()), 1), ObjectModelEntryFlags::live },
+ { "acceleration", OBJECT_MODEL_FUNC(self->GetAccelerationMmPerSecSquared(), 1), ObjectModelEntryFlags::live },
+ { "deceleration", OBJECT_MODEL_FUNC(self->GetDecelerationMmPerSecSquared(), 1), ObjectModelEntryFlags::live },
# if SUPPORT_LASER
{ "laserPwm", OBJECT_MODEL_FUNC_IF_NOSELF(reprap.GetGCodes().GetMachineType() == MachineType::laser,
reprap.GetPlatform().GetLaserPwm(), 2), ObjectModelEntryFlags::live },
# endif
- { "requestedSpeed", OBJECT_MODEL_FUNC(InverseConvertSpeedToMmPerSec(self->GetRequestedSpeed()), 1), ObjectModelEntryFlags::live },
- { "topSpeed", OBJECT_MODEL_FUNC(InverseConvertSpeedToMmPerSec(self->GetTopSpeed()), 1), ObjectModelEntryFlags::live },
+ { "requestedSpeed", OBJECT_MODEL_FUNC(self->GetRequestedSpeedMmPerSec(), 1), ObjectModelEntryFlags::live },
+ { "topSpeed", OBJECT_MODEL_FUNC(self->GetTopSpeedMmPerSec(), 1), ObjectModelEntryFlags::live },
// 3. move.calibration members
{ "final", OBJECT_MODEL_FUNC(self, 5), ObjectModelEntryFlags::none },
diff --git a/src/Movement/Move.h b/src/Movement/Move.h
index 057c79b4..6007f9d1 100644
--- a/src/Movement/Move.h
+++ b/src/Movement/Move.h
@@ -156,10 +156,10 @@ public:
const RandomProbePointSet& GetProbePoints() const noexcept { return probePoints; } // Return the probe point set constructed from G30 commands
DDARing& GetMainDDARing() noexcept { return mainDDARing; }
- float GetTopSpeed() const noexcept { return mainDDARing.GetTopSpeed(); }
- float GetRequestedSpeed() const noexcept { return mainDDARing.GetRequestedSpeed(); }
- float GetAcceleration() const noexcept { return mainDDARing.GetAcceleration(); }
- float GetDeceleration() const noexcept { return mainDDARing.GetDeceleration(); }
+ float GetTopSpeedMmPerSec() const noexcept { return mainDDARing.GetTopSpeedMmPerSec(); }
+ float GetRequestedSpeedMmPerSec() const noexcept { return mainDDARing.GetRequestedSpeedMmPerSec(); }
+ float GetAccelerationMmPerSecSquared() const noexcept { return mainDDARing.GetAccelerationMmPerSecSquared(); }
+ float GetDecelerationMmPerSecSquared() const noexcept { return mainDDARing.GetDecelerationMmPerSecSquared(); }
void AdjustLeadscrews(const floatc_t corrections[]) noexcept; // Called by some Kinematics classes to adjust the leadscrews
diff --git a/src/Platform/RepRap.cpp b/src/Platform/RepRap.cpp
index 22820563..8c615785 100644
--- a/src/Platform/RepRap.cpp
+++ b/src/Platform/RepRap.cpp
@@ -1377,7 +1377,7 @@ OutputBuffer *RepRap::GetStatusResponse(uint8_t type, ResponseSource source) con
AppendFloatArray(response, "extr", GetExtrudersInUse(), [this](size_t extruder) noexcept { return move->LiveCoordinate(ExtruderToLogicalDrive(extruder), currentTool); }, 1);
// Current speeds
- response->catf("},\"speeds\":{\"requested\":%.1f,\"top\":%.1f}", (double)InverseConvertSpeedToMmPerSec(move->GetRequestedSpeed()), (double)InverseConvertSpeedToMmPerSec(move->GetTopSpeed()));
+ response->catf("},\"speeds\":{\"requested\":%.1f,\"top\":%.1f}", (double)move->GetRequestedSpeedMmPerSec(), (double)move->GetTopSpeedMmPerSec());
// Current tool number
response->catf(",\"currentTool\":%d", GetCurrentToolNumber());