Table of Contents

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

codeFactory CodeFactory

Code factory

expressions Expressions

Expression evaluator

filePath FilePathResolver

File path helper

logger ILogger<FileInfoParser>
settings IOptions<Settings>

Settings

Methods

ParseAsync(string, bool, CancellationToken)

Parse a G-code file

public Task<GCodeFileInfo> ParseAsync(string fileName, bool readThumbnailContent, CancellationToken cancellationToken = default)

Parameters

fileName string

File to analyze

readThumbnailContent bool

Whether thumbnail content shall be returned

cancellationToken CancellationToken

Optional 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

filename string
offset long
isThumbnail bool
explicitLineNumber long?

Returns

ValueTask<string>

UpdateSimulatedTimeAsync(string, int, CancellationToken)

Update the last simulation time in a job file

public Task UpdateSimulatedTimeAsync(string filename, int totalSeconds, CancellationToken cancellationToken = default)

Parameters

filename string

Path to the job file

totalSeconds int

Total print or simulated time

cancellationToken CancellationToken

Cancellation token

Returns

Task

Asynchronous task