Class UnitStation
Information about a unit at a workstation.
[DataContract(IsReference = true)]
[KnownType(typeof(Override))]
[KnownType(typeof(Unit))]
[KnownType(typeof(UnitBuyoff))]
[KnownType(typeof(UnitComponent))]
[KnownType(typeof(UnitDefectRepair))]
[KnownType(typeof(UnitDefect))]
[KnownType(typeof(UnitTest))]
[KnownType(typeof(UnitTransition))]
[KnownType(typeof(WorkerStation))]
public class UnitStation : INotifyPropertyChanged
- Inheritance
-
UnitStation
- Implements
- Inherited Members
Properties
IsDeserializing
Gets or sets whether this object is currently being deserialized.
protected bool IsDeserializing { get; }
Property Value
Overrides
Gets or sets the overrides that were performed while the unit was at this station.
[DataMember]
public TrackableCollection<Override> Overrides { get; set; }
Property Value
ReleaseDateTime
Gets or sets the date/time when the unit was released from the station, in UTC.
[DataMember]
public DateTime? ReleaseDateTime { get; set; }
Property Value
Remarks
This will be null if there is no release date/time recorded.
ScanDateTime
Gets or sets the date/time when the unit was scanned, in UTC.
[DataMember]
public DateTime ScanDateTime { get; set; }
Property Value
Unit
Gets or sets the unit associated with this unit station.
[DataMember]
public Unit Unit { get; set; }
Property Value
UnitBuyoffs
Gets or sets the buyoffs that occurred while the unit was at this station.
[DataMember]
public TrackableCollection<UnitBuyoff> UnitBuyoffs { get; set; }
Property Value
UnitComponents
Gets or sets the component scans that occurred while the unit was at this station.
[DataMember]
public TrackableCollection<UnitComponent> UnitComponents { get; set; }
Property Value
UnitDefectRepairs
Gets or sets the defect repairs added while the unit was at this station.
[DataMember]
public TrackableCollection<UnitDefectRepair> UnitDefectRepairs { get; set; }
Property Value
UnitDefects
Gets or sets the defects added while the unit was at this station.
[DataMember]
public TrackableCollection<UnitDefect> UnitDefects { get; set; }
Property Value
UnitHasBeenIncluded
Gets or sets whether a navigation property has been included yet while getting an entity graph for a data model (to prevent doing so more than once).
public bool UnitHasBeenIncluded { get; set; }
Property Value
UnitStationId
Gets or sets the unique identifier for this unit station.
[DataMember]
public int UnitStationId { get; set; }
Property Value
UnitTests
Gets or sets the tests that were performed while the unit was at this station.
[DataMember]
public TrackableCollection<UnitTest> UnitTests { get; set; }
Property Value
UnitTransitions
Gets or sets the transitions that occurred while the unit was at this station.
[DataMember]
public TrackableCollection<UnitTransition> UnitTransitions { get; set; }
Property Value
WorkerStation
Gets or sets the worker station.
[DataMember]
public WorkerStation WorkerStation { get; set; }
Property Value
WorkerStationHasBeenIncluded
Gets or sets whether a navigation property has been included yet while getting an entity graph for a data model (to prevent doing so more than once).
public bool WorkerStationHasBeenIncluded { get; set; }
Property Value
Methods
AddExternalTest(string, DateTimeOffset, bool, string, string, IDictionary)
Add a unit test that represents a test at some external station (i.e., a third-party test station) to the unit station record.
public UnitTest AddExternalTest(string testTypeName, DateTimeOffset testDateTime, bool passed, string reason, string notes, IDictionary data)
Parameters
testTypeName
stringThe test type name.
testDateTime
DateTimeOffsetThe date/time that the test was performed.
passed
boolWhether the test passed.
reason
stringThe reason for a failed test. This can be null if the test passed.
notes
stringOptional additional notes about the test. This can be null or empty.
data
IDictionaryOptional test data to be saved with the test, or null. See the remarks for more information.
Returns
Examples
The following demonstrates passing test data. Note that any data type is supported; the data value is converted to a string before saving.
var testData = new Hashtable();
testData["LowFan"] = 1.2;
testData["HighFan"] = 2.3;
testData["Thermistors"] = true;
testData["Compressor"] = 3.4;
testData["LowerElement"] = 4.5;
testData["UpperElement"] = 5.6;
testData["ParamCode"] = "EF12";
unitStation.AddExternalTest("Run Test", DateTimeOffset.Now, true, null, null, testData);
Remarks
If data
is not null, it should be a collection of name/value pairs. Any collection that implements IDictionary can be used,
such as Hashtable, OrderedDictionary, or Dictionary<TKey, TValue>.
The name of each item in the dictionary should be a valid XML element name. These names must follow these naming rules:
- Names must start with a letter or underscore.
- Names can contain letters, digits, hyphens, underscores, and periods.
- Names cannot contain spaces.
- Names cannot start with the letters xml (or XML, or Xml, etc.).
Exceptions
- ArgumentNullException
testTypeName
is null.- XmlException
data
contains an item with an invalid XML name.
AddExternalTest(string, DateTimeOffset, bool, string, string, string)
Add a unit test that represents a test at some external station (i.e., a third-party test station) to the unit station record.
public UnitTest AddExternalTest(string testTypeName, DateTimeOffset testDateTime, bool passed, string reason, string notes, string dataXml)
Parameters
testTypeName
stringThe test type name.
testDateTime
DateTimeOffsetThe date/time that the test was performed.
passed
boolWhether the test passed.
reason
stringThe reason for a failed test. This can be null if the test passed.
notes
stringOptional additional notes about the test. This can be null or empty.
dataXml
stringOptional test-specific data, formatted as XML, or null.
Returns
Exceptions
- ArgumentNullException
testTypeName
is null.
ConvertTestDataToXml(IDictionary)
Converts a dictionary containing custom test data to a valid XML fragment.
public static string ConvertTestDataToXml(IDictionary testData)
Parameters
testData
IDictionaryOptional test data to be saved with the test, or null.
Returns
- string
A valid XML fragment representing the data in
testData
, or null if there is no test data, either becausetestData
is null, or becausetestData
contains no elements.
Exceptions
- XmlException
testData
contains an item with an invalid XML name.
OnPropertyChanged(string)
Processes property changes by raising the PropertyChanged event.
protected virtual void OnPropertyChanged(string propertyName)
Parameters
propertyName
stringThe name of the property that changed.
Events
PropertyChanged
Occurs when a property value changes.
public event PropertyChangedEventHandler PropertyChanged