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
typeDataModule
TypeDataModuleThe ILisrtModule that contains the type data.
name
stringName of the module.
Exceptions
- ArgumentNullException
Thrown when
name
is null, empty or whitespace.- ArgumentNullException
Thrown when
typeDataModule
is 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
typeDataModule
TypeDataModuleThe ILisrtModule that contains the type data.
name
stringName of the module.
station
StationTest bench station.
Exceptions
- ArgumentNullException
Thrown when
name
is null, empty or whitespace.- ArgumentNullException
Thrown when
typeDataModule
is 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
typeDataModule
TypeDataModuleThe ILisrtModule that contains the type data.
name
stringName of the module.
station
StationTest bench station.
shell
IShellShell for the service window.
icon
UriIcon for the module tree. null for a default icon.
Exceptions
- ArgumentNullException
Thrown when
name
is null, empty or whitespace.- ArgumentNullException
Thrown when
typeDataModule
orshell
is 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
serialNumber
stringSerial number of the test item.
Exceptions
- ArgumentNullException
Thrown when
serialNumber
is 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