Table of Contents

Class SqliteNcLuggageReader

Namespace
Hi.SqliteUtils
Assembly
HiNc.dll

Internal Use Only. The reader of a luggage archive (luggage.db, the NC play result recording's P6), opened read-only by OpenRead(string): the archive's Meta, read once, and the two luggage kinds of a step – the force arrays (TryGetMillingForceLuggage(int, out MillingForceLuggage)) and the engagement (TryGetLayerMillingEngagement(int, out LayerMillingEngagement)) – or of a range of steps (FindMillingForceLuggages(int, int), FindLayerMillingEngagements(int, int)), decoded as the step cache decodes its own columns: a force column of 8 bytes is the no-cut record and comes back as MillingForceLuggage.NoCut(n), the engagement from its WriteBin bytes. The answers keep the cache's three states: true with the object for a stored kind, true with null for a row whose column is NULL (the physics did not run on the step), false for a step without a row. Any thread may call the reader, one call at a time: every method runs under the reader's lock. After Dispose(), every method but Dispose() throws ObjectDisposedException, while DatabasePath and Meta stay readable.

public sealed class SqliteNcLuggageReader : IDisposable
Inheritance
SqliteNcLuggageReader
Implements
Inherited Members
Extension Methods

Properties

DatabasePath

The archive's full path.

public string DatabasePath { get; }

Property Value

string

Meta

The archive's metadata, read once when it was opened: the result it belongs to, the step range, whether its copy completed, the counts.

public NcLuggageMeta Meta { get; }

Property Value

NcLuggageMeta

Methods

Dispose()

Closes the archive. Idempotent; every other member but DatabasePath and Meta throws ObjectDisposedException after it.

public void Dispose()

FindLayerMillingEngagements(int, int)

The engagements of the steps of [beginIndex, endIndex) that have a row, as FindMillingForceLuggages(int, int) answers the force arrays.

public Dictionary<int, LayerMillingEngagement> FindLayerMillingEngagements(int beginIndex, int endIndex)

Parameters

beginIndex int

The first step index (inclusive).

endIndex int

The end step index (exclusive).

Returns

Dictionary<int, LayerMillingEngagement>

The step index to its engagement.

Exceptions

ObjectDisposedException

The reader was disposed.

FindMillingForceLuggages(int, int)

The force arrays of the steps of [beginIndex, endIndex) that have a row: a step without a row is not in the dictionary, a NULL column maps to null (as FindMillingForceLuggages(int, int)).

public Dictionary<int, MillingForceLuggage> FindMillingForceLuggages(int beginIndex, int endIndex)

Parameters

beginIndex int

The first step index (inclusive).

endIndex int

The end step index (exclusive).

Returns

Dictionary<int, MillingForceLuggage>

The step index to its force arrays.

Exceptions

ObjectDisposedException

The reader was disposed.

TryGetLayerMillingEngagement(int, out LayerMillingEngagement)

Reads the engagement of one step, from its WriteBin bytes.

public bool TryGetLayerMillingEngagement(int stepIndex, out LayerMillingEngagement engagement)

Parameters

stepIndex int

The step index.

engagement LayerMillingEngagement

The engagement; null for a NULL column and for no row.

Returns

bool

True when the archive holds the step's row.

Exceptions

ObjectDisposedException

The reader was disposed.

TryGetMillingForceLuggage(int, out MillingForceLuggage)

Reads the force arrays of one step: the column decoded as the step cache decodes it (a column of 8 bytes is the no-cut record).

public bool TryGetMillingForceLuggage(int stepIndex, out MillingForceLuggage luggage)

Parameters

stepIndex int

The step index.

luggage MillingForceLuggage

The force arrays; null for a NULL column (the physics did not run on the step) and for no row.

Returns

bool

True when the archive holds the step's row.

Exceptions

ObjectDisposedException

The reader was disposed.

InvalidDataException

The column's bytes are not a force record this build reads.