Table of Contents

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
PropertyChangedBase
WorkPieceModule
Implements
INotifyPropertyChangedEx
Inherited Members
PropertyChangedBase.Refresh()
PropertyChangedBase.IsNotifying
PropertyChangedBase.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 TypeDataModule

The ILisrtModule that contains the type data.

name string

Name 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 TypeDataModule

The ILisrtModule that contains the type data.

name string

Name of the module.

station Station

Test 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 TypeDataModule

The ILisrtModule that contains the type data.

name string

Name of the module.

station Station

Test bench station.

shell IShell

Shell for the service window.

icon Uri

Icon for the module tree. null for a default icon.

Exceptions

ArgumentNullException

Thrown when name is null, empty or whitespace.

ArgumentNullException

Thrown when typeDataModule or shell 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

string

Properties

Icon

Gets the icon for the module.

public override Uri Icon { get; }

Property Value

Uri

Station

Gets or sets the station.

public Station Station { get; set; }

Property Value

Station

TreeItem

Gets the tree item view model.

public override ITreeItem TreeItem { get; }

Property Value

ITreeItem

WorkPiece

Gets or sets the work piece.

[AlsoNotifyFor("Icon")]
public WorkPiece WorkPiece { get; set; }

Property Value

WorkPiece

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 string

Serial 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

Event Type

EventHandler<EvaluatedEventArgs>