One the way to 1.15rc3
Fixedbug with PrintMonitor code to find object height Qualify some omre #include filenames with paths, to reduce the number of include file paths needed in the compiler options
This commit is contained in:
parent
ed40658c45
commit
84a274f748
4 changed files with 24 additions and 20 deletions
|
@ -102,9 +102,6 @@
|
||||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/Duet}""/>
|
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/Duet}""/>
|
||||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/Duet/Lwip}""/>
|
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/Duet/Lwip}""/>
|
||||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/Duet/EMAC}""/>
|
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/Duet/EMAC}""/>
|
||||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/Libraries/Fatfs}""/>
|
|
||||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/Libraries/MCP4461}""/>
|
|
||||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/Libraries/Flash}""/>
|
|
||||||
</option>
|
</option>
|
||||||
<option id="gnu.cpp.compiler.option.preprocessor.def.1548770846" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" useByScannerDiscovery="false" valueType="definedSymbols">
|
<option id="gnu.cpp.compiler.option.preprocessor.def.1548770846" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" useByScannerDiscovery="false" valueType="definedSymbols">
|
||||||
<listOptionValue builtIn="false" value="__SAM3X8E__"/>
|
<listOptionValue builtIn="false" value="__SAM3X8E__"/>
|
||||||
|
@ -222,9 +219,6 @@
|
||||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${CoreName}/variants/duetNG}""/>
|
<listOptionValue builtIn="false" value=""${workspace_loc:/${CoreName}/variants/duetNG}""/>
|
||||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src}""/>
|
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src}""/>
|
||||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/DuetNG}""/>
|
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/DuetNG}""/>
|
||||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/Libraries/Fatfs}""/>
|
|
||||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/Libraries/MCP4461}""/>
|
|
||||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/Libraries/Flash}""/>
|
|
||||||
</option>
|
</option>
|
||||||
<option id="gnu.cpp.compiler.option.preprocessor.def.1610427238" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" useByScannerDiscovery="false" valueType="definedSymbols">
|
<option id="gnu.cpp.compiler.option.preprocessor.def.1610427238" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" useByScannerDiscovery="false" valueType="definedSymbols">
|
||||||
<listOptionValue builtIn="false" value="__SAM4E8E__"/>
|
<listOptionValue builtIn="false" value="__SAM4E8E__"/>
|
||||||
|
@ -344,9 +338,6 @@
|
||||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${CoreName}/variants/duetNG}""/>
|
<listOptionValue builtIn="false" value=""${workspace_loc:/${CoreName}/variants/duetNG}""/>
|
||||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src}""/>
|
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src}""/>
|
||||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/DuetNG}""/>
|
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/DuetNG}""/>
|
||||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/Libraries/Fatfs}""/>
|
|
||||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/Libraries/MCP4461}""/>
|
|
||||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/Libraries/Flash}""/>
|
|
||||||
</option>
|
</option>
|
||||||
<option id="gnu.cpp.compiler.option.preprocessor.def.486383061" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" useByScannerDiscovery="false" valueType="definedSymbols">
|
<option id="gnu.cpp.compiler.option.preprocessor.def.486383061" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" useByScannerDiscovery="false" valueType="definedSymbols">
|
||||||
<listOptionValue builtIn="false" value="__SAM4E8E__"/>
|
<listOptionValue builtIn="false" value="__SAM4E8E__"/>
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
****************************************************************************************************/
|
****************************************************************************************************/
|
||||||
|
|
||||||
#include "RepRapFirmware.h"
|
#include "RepRapFirmware.h"
|
||||||
#include "DueFlashStorage.h"
|
#include "Libraries/Flash/DueFlashStorage.h"
|
||||||
|
|
||||||
#include "sam/drivers/tc/tc.h"
|
#include "sam/drivers/tc/tc.h"
|
||||||
#include "sam/drivers/hsmci/hsmci.h"
|
#include "sam/drivers/hsmci/hsmci.h"
|
||||||
|
|
|
@ -494,7 +494,6 @@ bool PrintMonitor::GetFileInfo(const char *directory, const char *fileName, GCod
|
||||||
if (parseState == parsingFooter)
|
if (parseState == parsingFooter)
|
||||||
{
|
{
|
||||||
// Processing the footer. See how many bytes we need to read and if we can reuse the overlap
|
// Processing the footer. See how many bytes we need to read and if we can reuse the overlap
|
||||||
bool footerInfoComplete = true;
|
|
||||||
FilePosition pos = fileBeingParsed->Position();
|
FilePosition pos = fileBeingParsed->Position();
|
||||||
sizeToRead = (size_t)min<FilePosition>(fileBeingParsed->Length() - pos, GCODE_READ_SIZE);
|
sizeToRead = (size_t)min<FilePosition>(fileBeingParsed->Length() - pos, GCODE_READ_SIZE);
|
||||||
if (fileOverlapLength > 0)
|
if (fileOverlapLength > 0)
|
||||||
|
@ -525,23 +524,34 @@ bool PrintMonitor::GetFileInfo(const char *directory, const char *fileName, GCod
|
||||||
accumulatedReadTime += now - startTime;
|
accumulatedReadTime += now - startTime;
|
||||||
startTime = now;
|
startTime = now;
|
||||||
|
|
||||||
|
bool footerInfoComplete = true;
|
||||||
|
|
||||||
// Search for filament used
|
// Search for filament used
|
||||||
if (parsedFileInfo.numFilaments == 0)
|
if (parsedFileInfo.numFilaments == 0)
|
||||||
{
|
{
|
||||||
parsedFileInfo.numFilaments = FindFilamentUsed(buf, sizeToScan, parsedFileInfo.filamentNeeded, DRIVES - AXES);
|
parsedFileInfo.numFilaments = FindFilamentUsed(buf, sizeToScan, parsedFileInfo.filamentNeeded, DRIVES - AXES);
|
||||||
footerInfoComplete &= (parsedFileInfo.numFilaments != 0);
|
if (parsedFileInfo.numFilaments == 0)
|
||||||
|
{
|
||||||
|
footerInfoComplete = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Search for layer height
|
// Search for layer height
|
||||||
if (parsedFileInfo.layerHeight == 0.0)
|
if (parsedFileInfo.layerHeight == 0.0)
|
||||||
{
|
{
|
||||||
footerInfoComplete &= FindLayerHeight(buf, sizeToScan, parsedFileInfo.layerHeight);
|
if (!FindLayerHeight(buf, sizeToScan, parsedFileInfo.layerHeight))
|
||||||
|
{
|
||||||
|
footerInfoComplete = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Search for object height
|
// Search for object height
|
||||||
if (parsedFileInfo.objectHeight == 0.0)
|
if (parsedFileInfo.objectHeight == 0.0)
|
||||||
{
|
{
|
||||||
footerInfoComplete &= FindHeight(buf, sizeToScan, parsedFileInfo.objectHeight);
|
if (!FindHeight(buf, sizeToScan, parsedFileInfo.objectHeight))
|
||||||
|
{
|
||||||
|
footerInfoComplete = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Keep track of the time stats
|
// Keep track of the time stats
|
||||||
|
@ -917,16 +927,18 @@ bool PrintMonitor::FindHeight(const char* buf, size_t len, float& height) const
|
||||||
|
|
||||||
if (len < 5)
|
if (len < 5)
|
||||||
{
|
{
|
||||||
break;
|
break; // not enough characters left for a G1 Zx.x command
|
||||||
}
|
}
|
||||||
|
|
||||||
++buf; // move to 1 character beyond c
|
++buf; // move to 1 character beyond c
|
||||||
--len;
|
--len;
|
||||||
|
|
||||||
|
// In theory we should skip N and a line number here if they are present, but no slicers seem to generate line numbers
|
||||||
if (c == 'G')
|
if (c == 'G')
|
||||||
{
|
{
|
||||||
if (inRelativeMode)
|
if (inRelativeMode)
|
||||||
{
|
{
|
||||||
|
// We have seen a G91 in this buffer already, so we are only interested in G90 commands that switch back to absolute mode
|
||||||
if (buf[0] == '9' && buf[1] == '0' && (buf[2] < '0' || buf[2] > '9'))
|
if (buf[0] == '9' && buf[1] == '0' && (buf[2] < '0' || buf[2] > '9'))
|
||||||
{
|
{
|
||||||
// It's a G90 command so go back to absolute mode
|
// It's a G90 command so go back to absolute mode
|
||||||
|
@ -943,11 +955,10 @@ bool PrintMonitor::FindHeight(const char* buf, size_t len, float& height) const
|
||||||
// It is a G0 or G1 command. See if it has a Z parameter.
|
// It is a G0 or G1 command. See if it has a Z parameter.
|
||||||
while (len >= 4)
|
while (len >= 4)
|
||||||
{
|
{
|
||||||
c = *buf++;
|
c = *buf;
|
||||||
--len;
|
|
||||||
if (c == 'Z')
|
if (c == 'Z')
|
||||||
{
|
{
|
||||||
const char* zpos = buf;
|
const char* zpos = buf + 1;
|
||||||
// Check special case of this code ending with ";E" or "; E" - ignore such codes
|
// Check special case of this code ending with ";E" or "; E" - ignore such codes
|
||||||
while (len > 2 && *buf != '\n' && *buf != '\r' && *buf != ';')
|
while (len > 2 && *buf != '\n' && *buf != '\r' && *buf != ';')
|
||||||
{
|
{
|
||||||
|
@ -969,6 +980,8 @@ bool PrintMonitor::FindHeight(const char* buf, size_t len, float& height) const
|
||||||
{
|
{
|
||||||
break; // no Z parameter
|
break; // no Z parameter
|
||||||
}
|
}
|
||||||
|
++buf;
|
||||||
|
--len;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
#define FILESTORE_H
|
#define FILESTORE_H
|
||||||
|
|
||||||
#include "Core.h"
|
#include "Core.h"
|
||||||
#include "ff.h"
|
#include "Libraries/Fatfs/ff.h"
|
||||||
|
|
||||||
typedef uint32_t FilePosition;
|
typedef uint32_t FilePosition;
|
||||||
const FilePosition noFilePosition = 0xFFFFFFFF;
|
const FilePosition noFilePosition = 0xFFFFFFFF;
|
||||||
|
|
Reference in a new issue