Class Production
Class provided to handle unit info (on serialnumber/parnumber)
Inherited Members
Namespace: Virinco.WATS.Interface.MES.Production
Assembly: Virinco.WATS.Interface.MES.dll
Syntax
public class Production : MesBase
Constructors
Production()
Empty constructor
Declaration
public Production()
Production(String)
Constructor with Culture code
Declaration
public Production(string CultureCode)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | CultureCode |
Fields
DisplayTreeView
If IdentifyUUT(out Boolean, String) is called and this is set to true, the Display TreeView checkbox is checked. If the checkbox is not checked, the form will automatically close when the serialnumber ends with \r\n
Declaration
public bool DisplayTreeView
Field Value
| Type | Description |
|---|---|
| System.Boolean |
LastScannedSerialnumber
Holds information about the last scanned serialnumber
Declaration
public string LastScannedSerialnumber
Field Value
| Type | Description |
|---|---|
| System.String |
Methods
AddChildUnit(String, String, String, String, String, String, String, out String)
Adds a child unit. If Neither CheckPartNumber or CheckRevision is given ProductRelations according to product manager are checked
Declaration
public bool AddChildUnit(string CultureCode, string ParentSerialNumber, string ParentPartNumber, string ChildSerialNumber, string ChildPartNumber, string CheckPartNumber, string CheckRevision, out string message)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | CultureCode | Culture code used to translate the |
| System.String | ParentSerialNumber | Serial number of the parent unit. |
| System.String | ParentPartNumber | Part number of the parent unit. |
| System.String | ChildSerialNumber | Serial number of the child unit to add as child. |
| System.String | ChildPartNumber | Part number of the child unit to add as child. |
| System.String | CheckPartNumber | If given, will verify that |
| System.String | CheckRevision | If given, will verify that |
| System.String | message | Translated response message from WATS. |
Returns
| Type | Description |
|---|---|
| System.Boolean |
CreateUnit(String, String, String, String)
Creates a new unit. The part number (product) and revision will be created if they don't exist.
Declaration
public bool CreateUnit(string SerialNumber, string PartNumber, string Revision, string batchNumber)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | SerialNumber | Unit's serial number. |
| System.String | PartNumber | Unit's part number. |
| System.String | Revision | Unit's revision. |
| System.String | batchNumber | Unit's batch number. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if unit was created. |
GetUnitHistory(String, String, Boolean)
Returns list of unit history in order of newest to latest.
Declaration
public List<UnitHistory> GetUnitHistory(string serialNumber, string partNumber = null, bool details = false)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | serialNumber | Unit serial number |
| System.String | partNumber | Unit part number |
| System.Boolean | details | If |
Returns
| Type | Description |
|---|---|
| List<UnitHistory> |
GetUnitInfo(String, String)
Return UnitInfo object (no GUI)
Declaration
public UnitInfo GetUnitInfo(string SerialNumber, string PartNumber = "")
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | SerialNumber | |
| System.String | PartNumber |
Returns
| Type | Description |
|---|---|
| UnitInfo | A UnitInfo object with info about the SN supplied. |
GetUnitPhase(String, String)
Get a unit's phase.
Declaration
public Unit_Phase GetUnitPhase(string SerialNumber, string PartNumber)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | SerialNumber | Unit's serial number |
| System.String | PartNumber | Unit's part number |
Returns
| Type | Description |
|---|---|
| Virinco.WATS.Service.MES.Contract.Unit_Phase | Units current Phase enum |
GetUnitPhaseString(String, String)
Get a unit's phase.
Declaration
public string GetUnitPhaseString(string SerialNumber, string PartNumber)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | SerialNumber | Unit's serial number |
| System.String | PartNumber | Unit's part number |
Returns
| Type | Description |
|---|---|
| System.String | Units current Phase as string |
GetUnitProcess(String, String)
Get a unit's current process
Declaration
public string GetUnitProcess(string SerialNumber, string PartNumber)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | SerialNumber | Unit's serial number |
| System.String | PartNumber | Unit's part number |
Returns
| Type | Description |
|---|---|
| System.String | Unit's current process |
GetUnitStateHistory(String, String, out String[], out String[], out DateTime[])
Returns unit history of state / phase changes. Changes are returned in three corresponding arrays due to index. Latest change is found on index 0;
Declaration
public int GetUnitStateHistory(string serialNumber, string partNumber, out string[] states, out string[] phases, out DateTime[] dateTime)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | serialNumber | |
| System.String | partNumber | |
| System.String[] | states | Returned array of previous states |
| System.String[] | phases | Returned array of previous phases |
| DateTime[] | dateTime | Returned array of date / time of change |
Returns
| Type | Description |
|---|---|
| System.Int32 | Arrays + return value -1 if error, number of changes (index range) if ok |
GetUnitVerification(String, String)
Declaration
public UnitVerificationResponse GetUnitVerification(string serialNumber, string partNumber = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | serialNumber | |
| System.String | partNumber |
Returns
| Type | Description |
|---|---|
| UnitVerificationResponse |
IdentifyUUT(out Boolean, String)
Displays SN textbox if connected to service
Declaration
public UnitInfo IdentifyUUT(out bool Continue, string PartNumber = "")
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | Continue | Boolean value indicating if the process was stopped |
| System.String | PartNumber | PartNumber of unit to identify (used in case of none unique serialnumbers) |
Returns
| Type | Description |
|---|---|
| UnitInfo | A UnitInfo object of the scanned unit. |
IdentifyUUT(out Boolean, ref Process, String, String, Boolean, Boolean, String, Boolean, Boolean, StatusEnum, Dictionary<String, Object>)
Display dialog to prompt for serial number
Declaration
public UnitInfo IdentifyUUT(out bool Continue, ref Process SelectedTestOperation, string SerialNumber = "", string PartNumber = "", bool IncludeTestOperation = false, bool SelectTestOperation = true, string CustomText = null, bool AlwaysOnTop = true, bool UseWorkflow = false, StatusEnum WorkflowStatus = default(StatusEnum), Dictionary<string, object> context = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | Continue | |
| Virinco.WATS.Service.MES.Contract.Process | SelectedTestOperation | |
| System.String | SerialNumber | |
| System.String | PartNumber | |
| System.Boolean | IncludeTestOperation | |
| System.Boolean | SelectTestOperation | |
| System.String | CustomText | |
| System.Boolean | AlwaysOnTop | |
| System.Boolean | UseWorkflow | |
| Virinco.WATS.Service.MES.Contract.StatusEnum | WorkflowStatus | |
| Dictionary<System.String, System.Object> | context |
Returns
| Type | Description |
|---|---|
| UnitInfo |
isConnected()
True if connected to server
Declaration
public bool isConnected()
Returns
| Type | Description |
|---|---|
| System.Boolean |
RemoveAllChildUnits(String, String, String, out String)
Removes all children of a given unit.
Declaration
public bool RemoveAllChildUnits(string CultureCode, string ParentSerialNumber, string ParentPartNumber, out string message)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | CultureCode | Culture code used to translate the |
| System.String | ParentSerialNumber | Serial number of the parent unit to remove child units from. |
| System.String | ParentPartNumber | Part number of the parent unit to remove child units from. |
| System.String | message | Translated response message from WATS. |
Returns
| Type | Description |
|---|---|
| System.Boolean |
RemoveChildUnit(String, String, String, String, String, out String)
Removes a child unit of a given unit.
Declaration
public bool RemoveChildUnit(string CultureCode, string ParentSerialNumber, string ParentPartNumber, string ChildSerialNumber, string ChildPartNumber, out string message)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | CultureCode | Culture code used to translate the |
| System.String | ParentSerialNumber | Serial number of the parent unit. |
| System.String | ParentPartNumber | Part number of the parent unit. |
| System.String | ChildSerialNumber | Serial number of the child unit to remove as child. |
| System.String | ChildPartNumber | Part number of the child unit to remove as child. |
| System.String | message | Translated response message from WATS. |
Returns
| Type | Description |
|---|---|
| System.Boolean |
SetParent(String, String)
Create a parent/child relation between two units.
Declaration
public bool SetParent(string SerialNumber, string ParentSerialNumber)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | SerialNumber | Serial Number of child unit. |
| System.String | ParentSerialNumber | Serial Number of parent unit. |
Returns
| Type | Description |
|---|---|
| System.Boolean | Value indicating if the action was successfull or not. |
SetUnitPhase(String, String, String)
Sets a unit's phase.
Declaration
public void SetUnitPhase(string SerialNumber, string PartNumber, string Phase)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | SerialNumber | Unit's serial number |
| System.String | PartNumber | Unit's part number |
| System.String | Phase | Unit's new phase, |
SetUnitPhase(String, String, Unit_Phase)
Sets a unit's phase.
Declaration
public void SetUnitPhase(string SerialNumber, string PartNumber, Unit_Phase Phase)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | SerialNumber | Unit's serial number |
| System.String | PartNumber | Unit's part number |
| Virinco.WATS.Service.MES.Contract.Unit_Phase | Phase | Unit's new phase, |
SetUnitProcess(String, String, String)
Sets a unit's process to a given value
Declaration
public void SetUnitProcess(string SerialNumber, string PartNumber, string ProcessName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | SerialNumber | Unit's serial number |
| System.String | PartNumber | Unit's part number |
| System.String | ProcessName | Unit's new processname |
UpdateUnit(String, String, String)
Change a unit's partNumber and revision.
Declaration
public bool UpdateUnit(string SerialNumber, string NewPartNumber, string NewRevision)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | SerialNumber | Serial number of unit to update. |
| System.String | NewPartNumber | New/updated part number. |
| System.String | NewRevision | New/updated revision. |
Returns
| Type | Description |
|---|---|
| System.Boolean |
UpdateUnit(String, String, String, String)
Change a unit's partNumber and revision. partNumber can be empty, but is required if units do not have unique serial number.
Declaration
public bool UpdateUnit(string serialNumber, string partNumber, string newPartNumber, string newRevision)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | serialNumber | Serial number of unit to update. |
| System.String | partNumber | Part number of unit to update. Can be empty, but is required if units do not have unique serial number. |
| System.String | newPartNumber | New/updated part number. |
| System.String | newRevision | New/updated revision. |
Returns
| Type | Description |
|---|---|
| System.Boolean |
UpdateUnitAttribute(String, String, String)
Add or update a tag value on a unit.
Declaration
public bool UpdateUnitAttribute(string SerialNumber, string AttributeName, string AttributeValue)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | SerialNumber | Serial number of unit to update. |
| System.String | AttributeName | Tag key. |
| System.String | AttributeValue | Tag value. |
Returns
| Type | Description |
|---|---|
| System.Boolean |
UpdateUnitTag(String, String, String, String)
Add or update a tag value on a unit. partNumber can be empty, but is required if units do not have unique serial number.
Declaration
public bool UpdateUnitTag(string serialNumber, string partNumber, string tagName, string tagValue)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | serialNumber | Serial number of unit to update. |
| System.String | partNumber | Part number of unit to update. Can be empty, but is required if units do not have unique serial number. |
| System.String | tagName | Tag key. |
| System.String | tagValue | Tag value. |
Returns
| Type | Description |
|---|---|
| System.Boolean |