Class FileInfoParser
- Namespace
- DuetControlServer.Files.Parser
- Assembly
- DuetControlServer.dll
Class used to retrieve information from G-code jobs
public class FileInfoParser
- Inheritance
-
FileInfoParser
- Inherited Members
Constructors
FileInfoParser(CodeFactory, Expressions, FilePathResolver, ILogger<FileInfoParser>, IOptions<Settings>)
Class used to retrieve information from G-code jobs
public FileInfoParser(CodeFactory codeFactory, Expressions expressions, FilePathResolver filePath, ILogger<FileInfoParser> logger, IOptions<Settings> settings)
Parameters
codeFactoryCodeFactoryCode factory
expressionsExpressionsExpression evaluator
filePathFilePathResolverFile path helper
loggerILogger<FileInfoParser>settingsIOptions<Settings>Settings
Methods
ParseAsync(string, bool, CancellationToken)
Parse a G-code file
public Task<GCodeFileInfo> ParseAsync(string fileName, bool readThumbnailContent, CancellationToken cancellationToken = default)
Parameters
fileNamestringFile to analyze
readThumbnailContentboolWhether thumbnail content shall be returned
cancellationTokenCancellationTokenOptional cancellation token
Returns
- Task<GCodeFileInfo>
Information about the file
ParseFileFragment(string, long, bool, long?)
public ValueTask<string> ParseFileFragment(string filename, long offset, bool isThumbnail, long? explicitLineNumber = null)
Parameters
Returns
UpdateSimulatedTimeAsync(string, int, CancellationToken)
Update the last simulation time in a job file
public Task UpdateSimulatedTimeAsync(string filename, int totalSeconds, CancellationToken cancellationToken = default)
Parameters
filenamestringPath to the job file
totalSecondsintTotal print or simulated time
cancellationTokenCancellationTokenCancellation token
Returns
- Task
Asynchronous task