Class MeasureProcess
Represents the measure results of a Process instance.
Inherited Members
Namespace: Loehnert.TypeAndResult
Assembly: Loehnert.TypeAndResult.dll
Syntax
public class MeasureProcess : EntityBase, INotifyPropertyChanged, ITrackable
Constructors
MeasureProcess(Process)
Initializes a new instance of the MeasureProcess class.
Declaration
public MeasureProcess(Process process)
Parameters
Type | Name | Description |
---|---|---|
Process | process | The associated process. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown when |
Properties
Classification
Gets or sets the classification.
Declaration
public Classification Classification { get; set; }
Property Value
Type | Description |
---|---|
Classification |
EndTimeStamp
Gets or sets the start time stamp (UTC).
Declaration
public DateTime EndTimeStamp { get; set; }
Property Value
Type | Description |
---|---|
System.DateTime |
MeasureCycle
Gets the associated measure cycle.
Declaration
public virtual MeasureCycle MeasureCycle { get; }
Property Value
Type | Description |
---|---|
MeasureCycle |
MeasureCycleId
Gets the foreign key for the measure cycle.
Declaration
public int MeasureCycleId { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Parameters
Gets the collection for additional parameters.
Declaration
public virtual EntityCollection<MeasureProcessParameter> Parameters { get; }
Property Value
Type | Description |
---|---|
EntityCollection<MeasureProcessParameter> |
Process
Gets the associated process.
Declaration
public virtual Process Process { get; }
Property Value
Type | Description |
---|---|
Process |
ProcessId
Gets the foreign key for the process.
Declaration
public int ProcessId { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Results
Gets the measure results of this process.
Declaration
public virtual ObservableCollection<Result> Results { get; }
Property Value
Type | Description |
---|---|
System.Collections.ObjectModel.ObservableCollection<Result> |
StartTimeStamp
Gets or sets the start time stamp (UTC).
Declaration
public DateTime StartTimeStamp { get; set; }
Property Value
Type | Description |
---|---|
System.DateTime |
Methods
Evaluate(Boolean)
Evaluates the measure process.
Declaration
public MeasureProcessResult Evaluate(bool throwExceptionIfAttributIsNotEvaluated = true)
Parameters
Type | Name | Description |
---|---|---|
Boolean | throwExceptionIfAttributIsNotEvaluated | Indicates if an exception should be thrown while an attribute is not measured. |
Returns
Type | Description |
---|---|
MeasureProcessResult | The result of measure process evaluation. |
Remarks
The Classification property is set to Pass,
if all required attributes (see EvaluationRequired) are evaluated and passed,
if an attribute is failed the Classification is set to Fail.
If any required attribute is not evaluated, Classification is set to Error and
an AttributeNotMeasuredException is thrown (depending on throwExceptionIfAttributIsNotEvaluated
).
A not required attribute is ignored for evaluation.
The EndTimeStamp is set to System.DateTime.UtcNow.
Exceptions
Type | Condition |
---|---|
AttributeNotMeasuredException | Thrown when any required attribute in the Process has no result in Results and |
EvaluateAttribute(String, Double, String)
Declaration
public Result EvaluateAttribute(string attributeKey, double value, string text = "")
Parameters
Type | Name | Description |
---|---|---|
String | attributeKey | Key of the attribute to evaluate. |
Double | value | Value for evaluation. |
String | text | Additional text for evaluation. |
Returns
Type | Description |
---|---|
Result | The result of the attribute evaluation. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown when |
System.Collections.Generic.KeyNotFoundException | Thrown when an attribute with the specified |
PreEvaluate()
Evaluates the measure process, but doesn't set the EndTimeStamp and Classification properties.
Declaration
public MeasureProcessResult PreEvaluate()
Returns
Type | Description |
---|---|
MeasureProcessResult | The result of measure process evaluation. |
Remarks
See Evaluate(Boolean) for details.
ToString()
Returns a string that represents the current object.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String | A string that represents the current object. |