Table of Contents

Class SetupAngleReport

Namespace
Hi.MillingForces.Training
Assembly
HiNc.dll

One tool's entry of the setup-angle report file that LocalProjectService.EstimateSetupAngle writes to its dstRelFile: the SetupAngleEstimate flattened for transport, plus the inputs of the call that made it. The file is a JSON array of these, one per estimated tool, in the estimates' order; ToJson(IEnumerable<SetupAngleReport>) and FromJson(string) are its two ends.

A public named type on purpose, never an anonymous one: the shipped assembly is obfuscated with only its public API kept, and an anonymous type there is renamed and loses its constructor parameter names, on which System.Text.Json throws NotSupportedException before a byte is written (the rule of IToPresentDto). The property names are the JSON keys verbatim. NaN is a value here (a failed or degenerate estimate) and is written as the literal NaN.

public sealed record SetupAngleReport : IEquatable<SetupAngleReport>
Inheritance
SetupAngleReport
Implements
Inherited Members
Extension Methods

Properties

AlternativeAngle_deg

With ScaleFixed: the other angle (deg) the fit allows, mirrored about the line the model moment swings along; NaN when the objective holds a single minimum, and otherwise.

public double AlternativeAngle_deg { get; init; }

Property Value

double

AlternativeObjectiveRatio

With ScaleFixed: the objective at AlternativeAngle_deg over that at Angle_deg (1 or more; near 1 the data cannot choose); NaN otherwise.

public double AlternativeObjectiveRatio { get; init; }

Property Value

double

Angle_deg

Estimated rotation (deg) folded into [0, Period_deg); positive = the Mx→My sense of the spindle-rotation frame.

public double Angle_deg { get; init; }

Property Value

double

ChannelToModelRatio

With ScaleFixed: the channel's amplitude over the model moment's along its line at the pinned scale (ScaleRatio, 1 when NaN), |cos(φ+α)| when that scale is right; at 1 or more no angle makes the magnitudes agree. NaN otherwise.

public double ChannelToModelRatio { get; init; }

Property Value

double

Contrast

Contrast of the objective over the angle grid; near 0 means the cut does not constrain the angle.

public double Contrast { get; init; }

Property Value

double

CorrelationR

Pearson correlation R between the measured Mx/My samples and the rotated, scaled model.

public double CorrelationR { get; init; }

Property Value

double

Curve

Grid samples of the objective over the angle.

public IReadOnlyList<SetupAngleReportCurvePoint> Curve { get; init; }

Property Value

IReadOnlyList<SetupAngleReportCurvePoint>

FixedScaleAngle_deg

The angle (deg) re-estimated with the scale pinned to 1 (free-scale fits); with ScaleFixed the angle itself, at the pinned scale.

public double FixedScaleAngle_deg { get; init; }

Property Value

double

FluteNum

Flute count of the cutter the samples came from.

public int FluteNum { get; init; }

Property Value

int

JsonOptions

The serializer options of the report file: indented; NaN and the infinities as named literals, since a failed or degenerate estimate is NaN and the default options refuse it.

public static JsonSerializerOptions JsonOptions { get; }

Property Value

JsonSerializerOptions

KnownPara

Name of the known cutting parameter the model was built from.

public string KnownPara { get; init; }

Property Value

string

LowSignalChannel

The channel the low-signal warning named; null when none.

public string LowSignalChannel { get; init; }

Property Value

string

MagnitudeSensitivity_deg

With ScaleFixed: degrees the angle moves for each 1 % of error in the pinned scale (assumed 1: the coefficients' magnitude, the observation height, the holder calibration and the sampled pulses; measured from Mz: the observation height and effective radius, the torque-to-bending ratio of the coefficients and of the holder's calibrations, and the sampled pulses once more, by less – the torque's zero read from the gaps between the flutes keeps its undistorted mean in the ratio, so its loss nearly matches the bending's; a cut without a gap wide enough takes the slope with an intercept, which keeps the torque's harmonics alone, and they lose more to the sampling than the bending's fundamental); NaN otherwise.

public double MagnitudeSensitivity_deg { get; init; }

Property Value

double

MeanModelRipple

Energy-weighted mean of the used steps' model ripple (0..1): how strongly the cut modulates the transverse moment within a turn, the model-side identifiability measure.

public double MeanModelRipple { get; init; }

Property Value

double

MirrorAngle_deg

Best angle (deg) under the mirrored-frame hypothesis.

public double MirrorAngle_deg { get; init; }

Property Value

double

MirrorObjectiveRatio

Objective of the mirrored hypothesis over the plain one (< 1 favours the mirror).

public double MirrorObjectiveRatio { get; init; }

Property Value

double

MirrorPreferred

True when the mirrored measurement frame (My negated) fits markedly better than the plain rotation.

public bool MirrorPreferred { get; init; }

Property Value

bool

ModelIsotropy

1 − |Σw·Q|/Σw·B of the used steps: 1 = the model moment covers every direction over a turn, 0 = it runs along one line.

public double ModelIsotropy { get; init; }

Property Value

double

Note

Human-readable summary.

public string Note { get; init; }

Property Value

string

Objective

Objective value at the estimate (residual energy of the used steps).

public double Objective { get; init; }

Property Value

double

OutlierRatio

Fraction of the worst-fitting steps trimmed before the final estimate.

public double OutlierRatio { get; init; }

Property Value

double

Period_deg

Ambiguity period of the estimate (deg): the flute pitch of a uniform fluting, 360 otherwise.

public double Period_deg { get; init; }

Property Value

double

SampleFlags

The channels the estimate was read on (SampleFlag, as text): the ones the call asked for, or, when it named none, the moment channels the tool declares its holder has.

public string SampleFlags { get; init; }

Property Value

string

ScaleFixed

True when the angle was fit with the scale pinned (one transverse channel on a one- or two-flute cutter: to 1 as assumed, or to the ratio the torque measures when a selected Mz gave a usable one, ScaleRatio); such an estimate comes with AlternativeAngle_deg when two angles fit and is then never applied automatically; a unique angle passes to the other gates.

public bool ScaleFixed { get; init; }

Property Value

bool

ScaleRatio

Measured-over-model magnitude ratio of the fit; with ScaleFixed the ratio the torque measured when a selected Mz gave a usable one (the pinned scale: each step's torque set to the zero its bridge reads in the gaps between the flutes and the ratio taken through the origin, or the slope with an intercept where a step has too few gap samples – the Note says which and prints the zero), NaN when the scale was assumed 1 (Mz not selected, or not usable: SetupAngle-Scale–MzNotUsable).

public double ScaleRatio { get; init; }

Property Value

double

Scatter_deg

Energy-weighted circular standard deviation (deg) of the per-step angles around the estimate.

public double Scatter_deg { get; init; }

Property Value

double

SetupAngleSign

The sign convention the angle is applied with (RotationSignConvention): the rotation added to the tool's setup angle is SetupAngleSign × Angle_deg.

public int SetupAngleSign { get; init; }

Property Value

int

StepNum

Steps that carried Mx/My samples.

public int StepNum { get; init; }

Property Value

int

Steps

Per-step diagnostics.

public IReadOnlyList<SetupAngleStepEstimate> Steps { get; init; }

Property Value

IReadOnlyList<SetupAngleStepEstimate>

Succeeded

False when no estimate could be formed; Note says why.

public bool Succeeded { get; init; }

Property Value

bool

ToolId

Tool id of the cutter the samples came from; -1 when unknown.

public int ToolId { get; init; }

Property Value

int

TransverseChannels

The transverse channels the angle was fit on (SampleFlag, as text: Mx, My or both).

public string TransverseChannels { get; init; }

Property Value

string

TransverseEnergyRatio

Synchronous energy of the folded My over that of Mx; NaN with one channel.

public double TransverseEnergyRatio { get; init; }

Property Value

double

UsedStepNum

Steps that survived the signal and outlier gates.

public int UsedStepNum { get; init; }

Property Value

int

Methods

From(SetupAngleEstimate, string, SampleFlag, double)

Flattens one estimate together with the inputs of the call that made it.

public static SetupAngleReport From(SetupAngleEstimate estimate, string knownParaName, SampleFlag sampleFlags, double outlierRatio)

Parameters

estimate SetupAngleEstimate

The estimate.

knownParaName string

Name of the known cutting parameter the model was built from.

sampleFlags SampleFlag

The channels the call asked for; Virtual (none named) is written as the channels the estimate was read on, the tool's declared ones.

outlierRatio double

The call's outlier ratio.

Returns

SetupAngleReport

The entry.

FromJson(string)

Reads a report file's text back.

public static List<SetupAngleReport> FromJson(string json)

Parameters

json string

The JSON text.

Returns

List<SetupAngleReport>

The entries, in the file's order.

ToJson(IEnumerable<SetupAngleReport>)

The report file's text: a JSON array of the entries, in order.

public static string ToJson(IEnumerable<SetupAngleReport> reports)

Parameters

reports IEnumerable<SetupAngleReport>

The entries; null writes an empty array.

Returns

string

The JSON text.