Class WorkPieceModule
- Namespace
- Loehnert.Lisrt.TypeAndResult.LisrtModule
- Assembly
- Loehnert.Lisrt.TypeAndResult.dll
Represents a type that holds a test item and a measure cycle.
public class WorkPieceModule : LisrtModule, INotifyPropertyChangedEx, ILisrtModule, INotifyPropertyChanged, IHasServiceView
- Inheritance
-
PropertyChangedBaseWorkPieceModule
- Implements
-
INotifyPropertyChangedEx
- Inherited Members
-
PropertyChangedBase.Refresh()PropertyChangedBase.IsNotifyingPropertyChangedBase.PropertyChanged
Constructors
WorkPieceModule(TypeDataModule, string)
Initializes a new instance of the WorkPieceModule class. Calls the WorkPieceModule(TypeDataModule, string, Station, IShell, Uri) without a station (null) and gets the IShell by IoC. Gets the Uri for the icon by IoC, with the IconContractName.
public WorkPieceModule(TypeDataModule typeDataModule, string name)
Parameters
typeDataModuleTypeDataModuleThe ILisrtModule that contains the type data.
namestringName of the module.
Exceptions
- ArgumentNullException
Thrown when
nameis null, empty or whitespace.- ArgumentNullException
Thrown when
typeDataModuleis null.
WorkPieceModule(TypeDataModule, string, Station)
Initializes a new instance of the WorkPieceModule class. Calls the WorkPieceModule(TypeDataModule, string, Station, IShell, Uri) and gets the IShell by IoC. Gets the Uri for the icon by IoC, with the IconContractName.
public WorkPieceModule(TypeDataModule typeDataModule, string name, Station station)
Parameters
typeDataModuleTypeDataModuleThe ILisrtModule that contains the type data.
namestringName of the module.
stationStationTest bench station.
Exceptions
- ArgumentNullException
Thrown when
nameis null, empty or whitespace.- ArgumentNullException
Thrown when
typeDataModuleis null.
WorkPieceModule(TypeDataModule, string, Station, IShell, Uri)
Initializes a new instance of the WorkPieceModule class.
public WorkPieceModule(TypeDataModule typeDataModule, string name, Station station, IShell shell, Uri icon = null)
Parameters
typeDataModuleTypeDataModuleThe ILisrtModule that contains the type data.
namestringName of the module.
stationStationTest bench station.
shellIShellShell for the service window.
iconUriIcon for the module tree. null for a default icon.
Exceptions
- ArgumentNullException
Thrown when
nameis null, empty or whitespace.- ArgumentNullException
Thrown when
typeDataModuleorshellis null.
Fields
IconContractName
Contract name for a custom module tree icon. Must be an Uri to an image, icon or XAML file.
public const string IconContractName = "WorkPieceIcon"
Field Value
Properties
Icon
Gets the icon for the module.
public override Uri Icon { get; }
Property Value
Station
Gets or sets the station.
public Station Station { get; set; }
Property Value
TreeItem
Gets the tree item view model.
public override ITreeItem TreeItem { get; }
Property Value
WorkPiece
Gets or sets the work piece.
[AlsoNotifyFor("Icon")]
public WorkPiece WorkPiece { get; set; }
Property Value
Methods
GetNewMeasureCycle()
Gets a new measure cycle and adds them to the WorkPiece.
public MeasureCycle GetNewMeasureCycle()
Returns
- MeasureCycle
The new measure cycle.
Exceptions
- InvalidOperationException
Thrown when WorkPiece, Station or TypeData (from the TypeDataModule, given with the constructor) is null.
RemoveWorkPiece()
Removes the current test item.
public WorkPiece RemoveWorkPiece()
Returns
- WorkPiece
The removed test item.
SetWorkPiece(string)
Sets the test item with a new WorkPiece.
public void SetWorkPiece(string serialNumber)
Parameters
serialNumberstringSerial number of the test item.
Exceptions
- ArgumentNullException
Thrown when
serialNumberis null, empty or whitespace.
ShowServiceView()
Shows the service window.
public void ShowServiceView()
Events
Evaluated
Occurs when a MeasureCycle of the WorkPiece has evaluated.
public event EventHandler<EvaluatedEventArgs> Evaluated