Class UnitInfo
UnitInfo object which holds information about a scanned unit. This object may be retrieved from MES Production interface.
Inheritance
Inherited Members
Namespace: Virinco.WATS.Interface.MES.Production
Assembly: Virinco.WATS.Interface.MES.dll
Syntax
public class UnitInfo
Properties
BatchNumber
Batch number
Declaration
public string BatchNumber { get; }
Property Value
Type | Description |
---|---|
System.String |
PartNumber
Part number
Declaration
public string PartNumber { get; }
Property Value
Type | Description |
---|---|
System.String |
PartNumberDescription
Description of a product
Declaration
public string PartNumberDescription { get; }
Property Value
Type | Description |
---|---|
System.String |
PartNumberName
Name of product
Declaration
public string PartNumberName { get; }
Property Value
Type | Description |
---|---|
System.String |
Product_Data
XML data attached to product. May be queried by GetInfo(String, UnitInfo.DataType)
Declaration
public string Product_Data { get; }
Property Value
Type | Description |
---|---|
System.String |
Revision
Revision of a product
Declaration
public string Revision { get; }
Property Value
Type | Description |
---|---|
System.String |
Revision_Data
XML data attached to revision. May be queried by GetInfo(String, UnitInfo.DataType)
Declaration
public string Revision_Data { get; }
Property Value
Type | Description |
---|---|
System.String |
RevisionDescription
Description of a revision (overrides ProductDescription)
Declaration
public string RevisionDescription { get; }
Property Value
Type | Description |
---|---|
System.String |
SerialDate
When unit is produced
Declaration
public DateTime? SerialDate { get; }
Property Value
Type | Description |
---|---|
System.Nullable<System.DateTime> |
SerialNumber
Unit's Serial Number
Declaration
public string SerialNumber { get; }
Property Value
Type | Description |
---|---|
System.String |
Unit_Data
XML data attached to unit. May be queried by GetInfo(String, UnitInfo.DataType)
Declaration
public string Unit_Data { get; }
Property Value
Type | Description |
---|---|
System.String |
Methods
GetChild(Int32)
Get Child UnitInfo object at index
Declaration
public UnitInfo GetChild(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index |
Returns
Type | Description |
---|---|
UnitInfo |
GetChildCount()
Get the number of child UnitInfo objects
Declaration
public int GetChildCount()
Returns
Type | Description |
---|---|
System.Int32 | Number of child units or -1 of unknown |
GetChildren()
Get Child UnitInfo object at index
Declaration
public UnitInfo[] GetChildren()
Returns
Type | Description |
---|---|
UnitInfo[] |
GetInfo(String, Int32)
Query XML data given a XPath and XML UnitInfo.DataType
Declaration
public string GetInfo(string XPath, int type)
Parameters
Type | Name | Description |
---|---|---|
System.String | XPath | The XPath to query |
System.Int32 | type | The XML type to query (0=UnitData,1=ProductData,2=RevisionData) |
Returns
Type | Description |
---|---|
System.String | XPath query result as string |
GetInfo(String, UnitInfo.DataType)
Query XML data given a XPath and XML UnitInfo.DataType
Declaration
public string GetInfo(string XPath, UnitInfo.DataType type)
Parameters
Type | Name | Description |
---|---|---|
System.String | XPath | The XPath to query |
UnitInfo.DataType | type | The XML type to query |
Returns
Type | Description |
---|---|
System.String | XPath query result as string |
GetInfoByField(String, Int32)
Query XML data given a field name
Declaration
[Obsolete("GetInfoByField is deprecated, please use GetTagValue instead.")]
public string GetInfoByField(string Field, int Type)
Parameters
Type | Name | Description |
---|---|---|
System.String | Field | Name of field |
System.Int32 | Type | Type of XML data (0=UnitData,1=ProductData,2=RevisionData) |
Returns
Type | Description |
---|---|
System.String | Attribute value |
GetInfoByField(String, UnitInfo.DataType)
Query XML data given a field name
Declaration
[Obsolete("GetInfoByField is deprecated, please use GetTagValue instead.")]
public string GetInfoByField(string Field, UnitInfo.DataType Type)
Parameters
Type | Name | Description |
---|---|---|
System.String | Field | Name of field |
UnitInfo.DataType | Type | Type of XML data (enum) |
Returns
Type | Description |
---|---|
System.String | Attribute value |
GetParent()
Get parent UnitInfo object
Declaration
public UnitInfo GetParent()
Returns
Type | Description |
---|---|
UnitInfo |
GetTagValue(String, Int32)
Query data attached to unit, product or revision.
Declaration
public string GetTagValue(string Tag, int Type)
Parameters
Type | Name | Description |
---|---|---|
System.String | Tag | Name of Tag |
System.Int32 | Type | Type of XML data (0=UnitData,1=ProductData,2=RevisionData) |
Returns
Type | Description |
---|---|
System.String | Tag value |
GetTagValue(String, UnitInfo.DataType)
Query data attached to unit, product or revision.
Declaration
public string GetTagValue(string Tag, UnitInfo.DataType Type)
Parameters
Type | Name | Description |
---|---|---|
System.String | Tag | Name of Tag |
UnitInfo.DataType | Type | Type of XML data (enum) |
Returns
Type | Description |
---|---|
System.String | Tag value |
HasParent()
Indicates if the unit is a top level unit
Declaration
public bool HasParent()
Returns
Type | Description |
---|---|
System.Boolean | Boolean value indicating if the unit has any parent units. |
SetTagValue(String, String)
Change or add the value of a unit tag.
Declaration
public bool SetTagValue(string Tag, string TagValue)
Parameters
Type | Name | Description |
---|---|---|
System.String | Tag | Name of Tag. |
System.String | TagValue | Value of Tag. |
Returns
Type | Description |
---|---|
System.Boolean | Success |