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
diff options
context:
space:
mode:
authorDavid Crocker <dcrocker@eschertech.com>2021-12-02 13:45:19 +0300
committerDavid Crocker <dcrocker@eschertech.com>2021-12-02 13:45:19 +0300
commita2be2d386d01b7851c5808fea177c2c484dad4a8 (patch)
tree2ce16f512b907ba279d6c938df5117a14fc52ab8
parent89b18e78fcc233a67cbe34689ccfaa4913e713ad (diff)
Added support for build time reported by REALvision slicer
-rw-r--r--src/Storage/FileInfoParser.cpp107
1 files changed, 61 insertions, 46 deletions
diff --git a/src/Storage/FileInfoParser.cpp b/src/Storage/FileInfoParser.cpp
index 9b4e6aed..895b2f2d 100644
--- a/src/Storage/FileInfoParser.cpp
+++ b/src/Storage/FileInfoParser.cpp
@@ -756,7 +756,7 @@ bool FileInfoParser::FindPrintTime(const char* bufp) noexcept
" estimated printing time", // slic3r PE older versions "; estimated printing time = 1h 5m 24s"
";TIME", // Cura ";TIME:38846"
" Build time", // S3D "; Build time: 0 hours 42 minutes"
- // also REALvisionCore/F3 Reactor "; Build time: 2:11:47" (we don't currently parse this correctly)
+ // also REALvision "; Build time: 2:11:47"
" Build Time", // KISSlicer "; Estimated Build Time: 332.83 minutes"
// also KISSSlicer 2 alpha "; Calculated-during-export Build Time: 130.62 minutes"
";Print Time:", // Ideamaker
@@ -784,68 +784,83 @@ bool FileInfoParser::FindPrintTime(const char* bufp) noexcept
{
++pos;
}
- if (*pos == 'd')
+ if (*pos == ':') // special code for REALvision
{
- days = secs;
- if (StringStartsWithIgnoreCase(pos, "day")) // not sure if any slicer needs this, but include it j.i.c.
- {
- pos += 3;
- if (*pos == 's')
- {
- ++pos;
- }
- }
- else
- {
- ++pos;
- }
- secs = SafeStrtof(pos, &pos);
- while (*pos == ' ' || *pos == ':')
+ minutes = secs;
+ secs = SafeStrtof(pos + 1, &pos);
+ if (*pos == ':')
{
- ++pos;
+ hours = minutes;
+ minutes = secs;
+ secs = SafeStrtof(pos + 1, &pos);
+ // I am assuming that it stops at hours
}
}
- if (*pos == 'h')
+ else
{
- hours = secs;
- if (StringStartsWithIgnoreCase(pos, "hour")) // S3D
+ if (*pos == 'd')
{
- pos += 4;
- if (*pos == 's')
+ days = secs;
+ if (StringStartsWithIgnoreCase(pos, "day")) // not sure if any slicer needs this, but include it j.i.c.
+ {
+ pos += 3;
+ if (*pos == 's')
+ {
+ ++pos;
+ }
+ }
+ else
{
++pos;
}
- }
- else
- {
- ++pos;
- }
- secs = SafeStrtof(pos, &pos);
- while (*pos == ' ' || *pos == ':') // Fusion 360 gives e.g. ";Print time: 40m:36s"
- {
- ++pos;
- }
- }
- if (*pos == 'm')
- {
- minutes = secs;
- if (StringStartsWithIgnoreCase(pos, "minute"))
- {
- pos += 6;
- if (*pos == 's')
+ secs = SafeStrtof(pos, &pos);
+ while (*pos == ' ' || *pos == ':')
{
++pos;
}
}
- else if (StringStartsWithIgnoreCase(pos, "min")) // Fusion 360
+ if (*pos == 'h')
{
- pos += 3;
+ hours = secs;
+ if (StringStartsWithIgnoreCase(pos, "hour")) // S3D
+ {
+ pos += 4;
+ if (*pos == 's')
+ {
+ ++pos;
+ }
+ }
+ else
+ {
+ ++pos;
+ }
+ secs = SafeStrtof(pos, &pos);
+ while (*pos == ' ' || *pos == ':') // Fusion 360 gives e.g. ";Print time: 40m:36s"
+ {
+ ++pos;
+ }
}
- else
+ if (*pos == 'm')
{
- ++pos;
+ minutes = secs;
+ if (StringStartsWithIgnoreCase(pos, "minute"))
+ {
+ pos += 6;
+ if (*pos == 's')
+ {
+ ++pos;
+ }
+ }
+ else if (StringStartsWithIgnoreCase(pos, "min")) // Fusion 360
+ {
+ pos += 3;
+ }
+ else
+ {
+ ++pos;
+ }
+ secs = SafeStrtof(pos, &pos);
}
- secs = SafeStrtof(pos, &pos);
}
}
parsedFileInfo.printTime = lrintf(((days * 24.0 + hours) * 60.0 + minutes) * 60.0 + secs);