diff options
author | Christian Hammacher <bmasterc@gmail.com> | 2021-10-25 12:13:00 +0300 |
---|---|---|
committer | Christian Hammacher <bmasterc@gmail.com> | 2021-10-25 12:13:00 +0300 |
commit | 4fab707f0c205bb55e1c98a72be37b1069dc7ba3 (patch) | |
tree | ffe1db2df45cefcf08ef0dd59e29c9bbe294fc1e /src/PrintMonitor/PrintMonitor.cpp | |
parent | af4c424a01b73a7bb4ad9b2e9ebdf1f6172990bb (diff) |
Work towards v3.4-b6
Added SBC data types for null, uint64_t, and datetimes
Added new OM handler for file positions
Refactored GCodes::GetFilePosition
Diffstat (limited to 'src/PrintMonitor/PrintMonitor.cpp')
-rw-r--r-- | src/PrintMonitor/PrintMonitor.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/PrintMonitor/PrintMonitor.cpp b/src/PrintMonitor/PrintMonitor.cpp index 1eacde89..96cbac0f 100644 --- a/src/PrintMonitor/PrintMonitor.cpp +++ b/src/PrintMonitor/PrintMonitor.cpp @@ -56,7 +56,7 @@ constexpr ObjectModelTableEntry PrintMonitor::objectModelTable[] = #endif { "duration", OBJECT_MODEL_FUNC_IF(self->IsPrinting(), self->GetPrintOrSimulatedDuration()), ObjectModelEntryFlags::live }, { "file", OBJECT_MODEL_FUNC(self, 1), ObjectModelEntryFlags::none }, - { "filePosition", OBJECT_MODEL_FUNC((uint64_t)self->gCodes.GetPrintingFilePosition()), ObjectModelEntryFlags::live }, + { "filePosition", OBJECT_MODEL_FUNC(self->gCodes.GetFilePosition()), ObjectModelEntryFlags::live }, { "firstLayerDuration", OBJECT_MODEL_FUNC_NOSELF(nullptr), ObjectModelEntryFlags::obsolete }, { "lastDuration", OBJECT_MODEL_FUNC_IF(!self->IsPrinting(), (int32_t)self->gCodes.GetLastDuration()), ObjectModelEntryFlags::none }, { "lastFileName", OBJECT_MODEL_FUNC_IF(!self->filenameBeingPrinted.IsEmpty() && !self->IsPrinting(), self->filenameBeingPrinted.c_str()), ObjectModelEntryFlags::none }, @@ -77,7 +77,7 @@ constexpr ObjectModelTableEntry PrintMonitor::objectModelTable[] = { "layerHeight", OBJECT_MODEL_FUNC(self->printingFileInfo.layerHeight, 2), ObjectModelEntryFlags::none }, { "printTime", OBJECT_MODEL_FUNC_IF(self->printingFileInfo.printTime != 0, (int32_t)self->printingFileInfo.printTime), ObjectModelEntryFlags::none }, { "simulatedTime", OBJECT_MODEL_FUNC_IF(self->printingFileInfo.simulatedTime != 0, (int32_t)self->printingFileInfo.simulatedTime), ObjectModelEntryFlags::none }, - { "size", OBJECT_MODEL_FUNC((uint64_t)self->printingFileInfo.fileSize), ObjectModelEntryFlags::none }, + { "size", OBJECT_MODEL_FUNC(self->printingFileInfo.fileSize), ObjectModelEntryFlags::none }, // 2. TimesLeft members { "filament", OBJECT_MODEL_FUNC(self->EstimateTimeLeftAsExpression(filamentBased)), ObjectModelEntryFlags::live }, @@ -360,7 +360,7 @@ float PrintMonitor::FractionOfFilePrinted() const noexcept { return -1.0; } - return (float)gCodes.GetPrintingFilePosition() / (float)printingFileInfo.fileSize; + return (float)gCodes.GetFilePosition() / (float)printingFileInfo.fileSize; } // Estimate the print time left in seconds on a preset estimation method |