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
TypeDataAssociated type data.
workPiece
WorkPieceAssociated work piece.
station
StationAssociated station.
Exceptions
- ArgumentNullException
Thrown when
typeData
,workPiece
orstation
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
TypeDataAssociated type data.
workPiece
WorkPieceAssociated work piece.
station
StationAssociated station.
measurementType
MeasurementTypeAssociated measurement type.
Exceptions
- ArgumentNullException
Thrown when
typeData
,workPiece
,station
ormeasurementType
is null.
Properties
Classification
Gets or sets the classification.
public Classification Classification { get; set; }
Property Value
EndTimeStamp
Gets or sets the start time stamp (UTC).
public DateTime EndTimeStamp { get; set; }
Property Value
MeasureProcesses
Gets the measure processes.
public virtual ObservableCollection<MeasureProcess> MeasureProcesses { get; }
Property Value
MeasurementType
Gets the measurement type.
public virtual MeasurementType MeasurementType { get; }
Property Value
MeasurementTypeId
Gets the foreign key of the MeasurementType.
[JsonIgnore]
public int MeasurementTypeId { get; }
Property Value
Parameters
Gets the collection for additional parameters.
public virtual EntityCollection<MeasureCycleParameter> Parameters { get; }
Property Value
StartTimeStamp
Gets or sets the start time stamp (UTC).
public DateTime StartTimeStamp { get; set; }
Property Value
Station
Gets associated station.
public virtual Station Station { get; }
Property Value
StationId
Gets the foreign key of the Station.
[JsonIgnore]
public int StationId { get; }
Property Value
TypeData
Gets the associated type data.
public virtual TypeData TypeData { get; }
Property Value
TypeDataId
Gets the foreign key of the TypeData.
[JsonIgnore]
public int TypeDataId { get; }
Property Value
WorkPiece
Gets the associated work piece.
public virtual WorkPiece WorkPiece { get; }
Property Value
WorkPieceId
Gets the foreign key of the WorkPiece.
[JsonIgnore]
public int WorkPieceId { get; }
Property Value
Methods
AddNewMeasureProcess(Process)
Gets a new instance of the MeasureProcesses class and adds it to MeasureProcesses.
public MeasureProcess AddNewMeasureProcess(Process process)
Parameters
process
ProcessProcess 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
stringProcess 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
boolIndicates 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.