Table of Contents

Class MeasureCycle

Namespace
Loehnert.TypeAndResult
Assembly
Loehnert.TypeAndResult.dll

Represents a measure cycle for a work piece.

public class MeasureCycle : EntityBase, INotifyPropertyChanged, ITrackable
Inheritance
MeasureCycle
Implements
Inherited Members
Extension Methods

Constructors

MeasureCycle(TypeData, WorkPiece, Station)

Initializes a new instance of the MeasureCycle class and sets the StartTimeStamp to UtcNow and Type to Production.

public MeasureCycle(TypeData typeData, WorkPiece workPiece, Station station)

Parameters

typeData TypeData

Associated type data.

workPiece WorkPiece

Associated work piece.

station Station

Associated station.

Exceptions

ArgumentNullException

Thrown when typeData, workPiece or station is null.

MeasureCycle(TypeData, WorkPiece, Station, MeasurementType)

Initializes a new instance of the MeasureCycle class and sets the StartTimeStamp to UtcNow.

public MeasureCycle(TypeData typeData, WorkPiece workPiece, Station station, MeasurementType measurementType)

Parameters

typeData TypeData

Associated type data.

workPiece WorkPiece

Associated work piece.

station Station

Associated station.

measurementType MeasurementType

Associated measurement type.

Exceptions

ArgumentNullException

Thrown when typeData, workPiece, station or measurementType is null.

Properties

Classification

Gets or sets the classification.

public Classification Classification { get; set; }

Property Value

Classification

EndTimeStamp

Gets or sets the start time stamp (UTC).

public DateTime EndTimeStamp { get; set; }

Property Value

DateTime

MeasureProcesses

Gets the measure processes.

public virtual ObservableCollection<MeasureProcess> MeasureProcesses { get; }

Property Value

ObservableCollection<MeasureProcess>

MeasurementType

Gets the measurement type.

public virtual MeasurementType MeasurementType { get; }

Property Value

MeasurementType

MeasurementTypeId

Gets the foreign key of the MeasurementType.

[JsonIgnore]
public int MeasurementTypeId { get; }

Property Value

int

Parameters

Gets the collection for additional parameters.

public virtual EntityCollection<MeasureCycleParameter> Parameters { get; }

Property Value

EntityCollection<MeasureCycleParameter>

StartTimeStamp

Gets or sets the start time stamp (UTC).

public DateTime StartTimeStamp { get; set; }

Property Value

DateTime

Station

Gets associated station.

public virtual Station Station { get; }

Property Value

Station

StationId

Gets the foreign key of the Station.

[JsonIgnore]
public int StationId { get; }

Property Value

int

TypeData

Gets the associated type data.

public virtual TypeData TypeData { get; }

Property Value

TypeData

TypeDataId

Gets the foreign key of the TypeData.

[JsonIgnore]
public int TypeDataId { get; }

Property Value

int

WorkPiece

Gets the associated work piece.

public virtual WorkPiece WorkPiece { get; }

Property Value

WorkPiece

WorkPieceId

Gets the foreign key of the WorkPiece.

[JsonIgnore]
public int WorkPieceId { get; }

Property Value

int

Methods

AddNewMeasureProcess(Process)

Gets a new instance of the MeasureProcesses class and adds it to MeasureProcesses.

public MeasureProcess AddNewMeasureProcess(Process process)

Parameters

process Process

Process that belongs to the new measure process.

Returns

MeasureProcess

A new measure process.

AddNewMeasureProcess(string)

Gets a new instance of the MeasureProcesses class and adds it to MeasureProcesses.

public MeasureProcess AddNewMeasureProcess(string process)

Parameters

process string

Process that belongs to the measure process.

Returns

MeasureProcess

A new measure process.

Evaluate(bool)

Evaluates the measure cycle and sets the Classification to Pass when all processes are passed.

public MeasureCycleResult Evaluate(bool throwExceptionIfProcessIsNotEvaluated = true)

Parameters

throwExceptionIfProcessIsNotEvaluated bool

Indicates if an exception should be thrown while an process is not evaluated.

Returns

MeasureCycleResult

The result of the measure cycle evaluation.

Exceptions

ProcessNotEvaluatedException

Thrown if a process is missing and throwExceptionIfProcessIsNotEvaluated is true.

PreEvaluate()

Evaluates the MeasureCycle, but doesn't set EndTimeStamp and Classification properties.

public MeasureCycleResult PreEvaluate()

Returns

MeasureCycleResult

The result of the measure cycle evaluation.

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.