Class MesBase
Base class for use in Production, Product, Software, Equipment and Asset...
Inherited Members
Namespace: Virinco.WATS.Interface.MES
Assembly: Virinco.WATS.Interface.MES.dll
Syntax
public class MesBase
Constructors
MesBase()
Base constructor
Declaration
public MesBase()
MesBase(String)
Constructor with culture
Declaration
public MesBase(string CultureCode)
Parameters
Type | Name | Description |
---|---|---|
System.String | CultureCode |
Fields
adminToken
Declaration
protected string adminToken
Field Value
Type | Description |
---|---|
System.String |
Properties
CultureCode
Language code
Declaration
public string CultureCode { get; set; }
Property Value
Type | Description |
---|---|
System.String |
LastException
Property to retrive the last Exception thrown
Declaration
public Exception LastException { get; }
Property Value
Type | Description |
---|---|
System.Exception |
LogExceptions
Property to set if any Exception should be written to eventlog
Declaration
public bool LogExceptions { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
RethrowException
Property to set if any Exception should be thrown
Declaration
public bool RethrowException { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
DisplayMesTestGUI()
GUI for simple MES connectivity testing
Declaration
public void DisplayMesTestGUI()
GetCommonUserSettings(String)
Gets user settings
Declaration
public CommonUserSettings GetCommonUserSettings(string UserName)
Parameters
Type | Name | Description |
---|---|---|
System.String | UserName |
Returns
Type | Description |
---|---|
Virinco.WATS.Configuration.CommonUserSettings |
GetGeneralOptionBool(String)
General bool option
Declaration
public bool GetGeneralOptionBool(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key |
Returns
Type | Description |
---|---|
System.Boolean |
GetGeneralOptionInt(String)
Declaration
public int GetGeneralOptionInt(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key |
Returns
Type | Description |
---|---|
System.Int32 |
GetGeneralOptionString(String)
General string option
Declaration
public string GetGeneralOptionString(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key |
Returns
Type | Description |
---|---|
System.String |
GetMesServerSettings(out String[], out Boolean[], out Int32[], String[], String[], String[])
Gets MES Server settings
Declaration
public void GetMesServerSettings(out string[] stringValues, out bool[] boolValues, out int[] numberValues, string[] stringKeys = null, string[] boolKeys = null, string[] numberKeys = null)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | stringValues | |
System.Boolean[] | boolValues | |
System.Int32[] | numberValues | |
System.String[] | stringKeys | |
System.String[] | boolKeys | |
System.String[] | numberKeys |
GetProcesses(Boolean, Boolean, Boolean)
Get Processes. By default will only test operations be returned
Declaration
public Process[] GetProcesses(bool IsTestOperation = true, bool IsRepairOperation = false, bool IsWIPOperation = false)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | IsTestOperation | return processes marked as test operation |
System.Boolean | IsRepairOperation | return processes marked as repair operation |
System.Boolean | IsWIPOperation | return processes marked as WIP operation |
Returns
Type | Description |
---|---|
Virinco.WATS.Service.MES.Contract.Process[] |
GetStorageValue(String)
Get string value stored with a given key (KeyValue pair)
Declaration
public string GetStorageValue(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | KeyValue.KEY |
Returns
Type | Description |
---|---|
System.String | string value stored with the Key |
GetStorageXml(String)
Get XML stored with a given key (KeyValue pair)
Declaration
public string GetStorageXml(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key |
Returns
Type | Description |
---|---|
System.String | XML value stored with the Key |
isConnected()
Returns true if connection to server is ok. TODO: Also check database on server
Declaration
public bool isConnected()
Returns
Type | Description |
---|---|
System.Boolean |
PutStorageData(String, String, String)
Add string and or XML data (xml datatype) to a given key
Declaration
public bool PutStorageData(string key, string value, string xml)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | KeyValue.KEY |
System.String | value | KeyValue.stringvalue |
System.String | xml | KeyValue.xmldata |
Returns
Type | Description |
---|---|
System.Boolean |
RemoveStorageData(String)
Remove KeyValue with a given Key
Declaration
public bool RemoveStorageData(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | KeyValue.KEY |
Returns
Type | Description |
---|---|
System.Boolean |
RESTDeleteJson<responseType>(String, Object, Boolean)
Perform WATS REST DELETE call to WATS
Declaration
public responseType RESTDeleteJson<responseType>(string query, object obj = null, bool useAdminCredentials = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | query | See swagger doc |
System.Object | obj | See swagger doc |
System.Boolean | useAdminCredentials | Uses administrative credentials set by SetAdminCredentials(String, String) |
Returns
Type | Description |
---|---|
responseType |
Type Parameters
Name | Description |
---|---|
responseType | See swagger doc |
RESTGetJson<responseType>(String, Boolean)
Perform WATS REST GET call to WATS
Declaration
public responseType RESTGetJson<responseType>(string query, bool useAdminCredentials = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | query | See swagger doc |
System.Boolean | useAdminCredentials | Uses administrative credentials set by SetAdminCredentials(String, String) |
Returns
Type | Description |
---|---|
responseType |
Type Parameters
Name | Description |
---|---|
responseType | See swagger doc |
RESTPostJson<responseType>(String, Object, Boolean)
Perform WATS REST GET call to WATS
Declaration
public responseType RESTPostJson<responseType>(string query, object obj, bool useAdminCredentials = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | query | See swagger doc |
System.Object | obj | See swagger doc |
System.Boolean | useAdminCredentials | Uses administrative credentials set by SetAdminCredentials(String, String) |
Returns
Type | Description |
---|---|
responseType |
Type Parameters
Name | Description |
---|---|
responseType | See swagger doc |
RESTPutJson<responseType>(String, Object, Boolean)
Perform WATS REST GET call to WATS
Declaration
public responseType RESTPutJson<responseType>(string query, object obj = null, bool useAdminCredentials = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | query | See swagger doc |
System.Object | obj | See swagger doc |
System.Boolean | useAdminCredentials | Uses administrative credentials set by SetAdminCredentials(String, String) |
Returns
Type | Description |
---|---|
responseType |
Type Parameters
Name | Description |
---|---|
responseType | See swagger doc |
SetAdminCredentials(String, String)
Allow to use alternative credentials when calling "admistrative functions"
Declaration
public void SetAdminCredentials(string userName, string password)
Parameters
Type | Name | Description |
---|---|---|
System.String | userName | |
System.String | password |
StartTraceToEventLog()
Starts to collect trace information to eventlog (API debug purpose)
Declaration
public void StartTraceToEventLog()
StopTraceToEventLog()
Stop trace information to eventlog (stop API debug)
Declaration
public void StopTraceToEventLog()
TranslateArray(String, String[])
Translates an array of english texts
Declaration
public string[] TranslateArray(string CultureCode, string[] englishText)
Parameters
Type | Name | Description |
---|---|---|
System.String | CultureCode | |
System.String[] | englishText |
Returns
Type | Description |
---|---|
System.String[] |
TranslateArray(String[])
Define language in CultureCode property
Declaration
public string[] TranslateArray(string[] englishText)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | englishText |
Returns
Type | Description |
---|---|
System.String[] |
TranslateString(String, Object[])
Define language in CultureCode property
Declaration
public string TranslateString(string EnglishText, object[] arguments)
Parameters
Type | Name | Description |
---|---|---|
System.String | EnglishText | |
System.Object[] | arguments |
Returns
Type | Description |
---|---|
System.String |
TranslateString(String, String, Object[])
Translates english to language given by Culture
Declaration
public string TranslateString(string Culture, string EnglishText, object[] arguments)
Parameters
Type | Name | Description |
---|---|---|
System.String | Culture | |
System.String | EnglishText | |
System.Object[] | arguments |
Returns
Type | Description |
---|---|
System.String |