23740 lines
1.0 MiB
23740 lines
1.0 MiB
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.Diagnostics;
|
|
using System.Reflection;
|
|
using System.Text;
|
|
|
|
using com.itac.mes.imsapi.domain;
|
|
using com.itac.mes.imsapi.domain.container;
|
|
|
|
namespace com.itac.mes.imsapi.client.dotnet
|
|
{
|
|
class Testclient : IMSApiDotNetTestclientBase
|
|
{
|
|
private static IIMSApiDotNet imsapi = null;
|
|
private static bool initialized = false;
|
|
private static IMSApiSessionContextStruct sessionContext = null;
|
|
private static Dictionary<Int64, IMSApiSessionContextStruct> allSessions = new Dictionary<Int64, IMSApiSessionContextStruct>();
|
|
private static Dictionary<Int64, MyEventListener> myEventListeners = new Dictionary<Int64, MyEventListener>();
|
|
|
|
static void Main(string[] args)
|
|
{
|
|
//Activate IMSApi logging (that is using .NET Tracing)
|
|
//The internal .NET tracing functionality has to activate with compile option /d:TRACE
|
|
TraceListener traceListener = new TextWriterTraceListener("IMSApiDotNet.log");
|
|
//optional logging filterings:
|
|
//traceListener.Filter = new EventTypeFilter(SourceLevels.Information); //level filter
|
|
//traceListener.Filter = new SourceFilter("ARTES"); //source filter, available: PERF and CORBA
|
|
Trace.Listeners.Add(traceListener);
|
|
Trace.AutoFlush = true;
|
|
|
|
//set appid as property programmatically
|
|
//(usable for all properties
|
|
IMSApiDotNet.setProperty("itac.appid", "IMSApiDotNetTestClient");
|
|
|
|
//create imsapi instance
|
|
imsapi = IMSApiDotNet.loadLibrary();
|
|
|
|
// call apiGetVersion
|
|
Console.WriteLine();
|
|
Console.WriteLine("-----");
|
|
Console.WriteLine("calling imsapiGetLibraryVersion()");
|
|
test_imsapiGetLibraryVersion();
|
|
|
|
// call imsapiInit
|
|
Console.WriteLine();
|
|
Console.WriteLine("-----");
|
|
Console.WriteLine("calling imsapiInit()");
|
|
test_imsapiInit();
|
|
if (!initialized)
|
|
{
|
|
Console.WriteLine();
|
|
Console.WriteLine("Initialization of IMSApi failed. Exit TestClient");
|
|
Environment.Exit(-1);
|
|
}
|
|
|
|
// call apiLogin
|
|
Console.WriteLine();
|
|
Console.WriteLine("-----");
|
|
Console.WriteLine("calling regLogin()");
|
|
test_regLogin();
|
|
|
|
while (true)
|
|
{
|
|
Console.WriteLine();
|
|
Console.WriteLine("-----");
|
|
if (sessionContext != null && sessionContext.sessionId != 0)
|
|
{
|
|
Console.WriteLine("Enter function name for session <" + sessionContext.sessionId + "> (or \"quit\" or \"session\" or \"locale\"):");
|
|
}
|
|
else
|
|
{
|
|
Console.WriteLine("Enter function or \"quit\" or \"session\" (No active session!):");
|
|
}
|
|
String line = getInput();
|
|
if (line.Trim().ToLower().Equals("quit"))
|
|
{
|
|
while (allSessions.Count > 0)
|
|
{
|
|
if (sessionContext != null && myEventListeners.ContainsKey(sessionContext.sessionId))
|
|
{
|
|
// call msgUnsubscribe()
|
|
Console.WriteLine();
|
|
Console.WriteLine("-----");
|
|
Console.WriteLine("calling msgUnsubscribe()");
|
|
test_msgUnsubscribe();
|
|
}
|
|
// call regLogout()
|
|
Console.WriteLine();
|
|
Console.WriteLine("-----");
|
|
Console.WriteLine("calling regLogout()");
|
|
test_regLogout();
|
|
}
|
|
// call imsapiShutdown()
|
|
Console.WriteLine();
|
|
Console.WriteLine("-----");
|
|
Console.WriteLine("calling imsapiShutdown()");
|
|
test_imsapiShutdown();
|
|
break;
|
|
}
|
|
else if (line.Trim().ToLower().Equals("session"))
|
|
{
|
|
// choose session
|
|
Console.WriteLine();
|
|
Console.WriteLine("-----");
|
|
Console.WriteLine("Choose one of the following available sessions:");
|
|
foreach(IMSApiSessionContextStruct element in allSessions.Values)
|
|
{
|
|
Console.WriteLine(element.sessionId + " " + element.locale);
|
|
}
|
|
Console.WriteLine();
|
|
Console.WriteLine("Enter the sessionId which should be the active one:");
|
|
while(allSessions.Count > 0)
|
|
{
|
|
line = getInput();
|
|
try
|
|
{
|
|
if (allSessions.ContainsKey(Int64.Parse(line)))
|
|
{
|
|
sessionContext = allSessions[Int64.Parse(line)];
|
|
Console.WriteLine("session activated");
|
|
Console.WriteLine(fillWithSpace("sessionId: ") + "<" + sessionContext.sessionId + ">");
|
|
Console.WriteLine(fillWithSpace("locale: ") + "<" + sessionContext.locale + ">");
|
|
break;
|
|
}
|
|
}
|
|
catch (FormatException fe){}
|
|
Console.WriteLine("Wrong sessionId. try again");
|
|
}
|
|
}
|
|
else if (line.Trim().ToLower().Equals("locale"))
|
|
{
|
|
// enter locale
|
|
Console.WriteLine();
|
|
Console.WriteLine("-----");
|
|
Console.WriteLine("Enter locale for active session. Actual locale is: " + sessionContext.locale);
|
|
sessionContext.locale = getInput();
|
|
}
|
|
else
|
|
{
|
|
MethodInfo method = dectectMethod(typeof(Testclient), line);
|
|
if (method == null)
|
|
{
|
|
Console.WriteLine("Invalid method.");
|
|
continue;
|
|
}
|
|
if (method.Name.Substring(5).Equals("msgSubscribe"))
|
|
{
|
|
myEventListeners.Remove(sessionContext.sessionId);
|
|
myEventListeners.Add(sessionContext.sessionId, new MyEventListener(sessionContext.sessionId));
|
|
}
|
|
if (method.Name.Substring(5).Equals("regLogout") && myEventListeners.ContainsKey(sessionContext.sessionId))
|
|
{
|
|
// call msgUnsubscribe()
|
|
Console.WriteLine();
|
|
Console.WriteLine("-----");
|
|
Console.WriteLine("calling msgUnsubscribe()");
|
|
test_msgUnsubscribe();
|
|
myEventListeners.Remove(sessionContext.sessionId);
|
|
}
|
|
Console.WriteLine("Call function: " + method.Name.Substring(5));
|
|
method.Invoke(null, new Object[]{});
|
|
if (method.Name.Substring(5).Equals("msgUnsubscribe"))
|
|
{
|
|
myEventListeners.Remove(sessionContext.sessionId);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// printErrorText
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// gets and prints an error text for result value
|
|
/// </remarks>
|
|
public static void printErrorText(int resultValue)
|
|
{
|
|
// declare variable
|
|
String errorText = null;
|
|
// call imsapi function
|
|
int result = imsapi.imsapiGetErrorText(sessionContext, resultValue, out errorText);
|
|
Console.WriteLine();
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
errorText = "Unable to get errortext.";
|
|
}
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + resultValue + ">");
|
|
Console.WriteLine(fillWithSpace("errorText: ") + "<" + errorText + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_apiGetVersion
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of internal imsapi function "imsapigetversion"
|
|
/// </remarks>
|
|
public static void test_imsapiGetLibraryVersion()
|
|
{
|
|
// declare variables
|
|
String version = null;
|
|
// call imsapi function
|
|
int result = imsapi.imsapiGetLibraryVersion(out version);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(version);
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_imsapiInit
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the internal imsapi function "imsapiInit"
|
|
/// </remarks>
|
|
public static void test_imsapiInit()
|
|
{
|
|
// call imsapi function
|
|
int result = imsapi.imsapiInit();
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
initialized = true;
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_imsapiShutdown
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "apiShutdown"
|
|
/// </remarks>
|
|
public static void test_imsapiShutdown()
|
|
{
|
|
// call imsapi function
|
|
int result = imsapi.imsapiShutdown();
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
initialized = false;
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_regLogin
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "regLogin"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionValidationStruct sessValData
|
|
/// out IMSApiSessionContextStruct sessionContext
|
|
/// </para>
|
|
public static void test_regLogin()
|
|
{
|
|
// declare variables
|
|
IMSApiSessionValidationStruct sessValData = new IMSApiSessionValidationStruct();
|
|
IMSApiSessionContextStruct newSessionContext = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("sessValData.stationNumber (String): "));
|
|
sessValData.stationNumber = getInput();
|
|
Console.Write(fillWithSpace("sessValData.stationPassword (String): "));
|
|
sessValData.stationPassword = getInputNoEcho();
|
|
Console.Write(fillWithSpace("sessValData.user (String): "));
|
|
sessValData.user = getInput();
|
|
Console.Write(fillWithSpace("sessValData.password (String): "));
|
|
sessValData.password = getInputNoEcho();
|
|
Console.Write(fillWithSpace("sessValData.client (String): "));
|
|
sessValData.client = getInput();
|
|
Console.Write(fillWithSpace("sessValData.registrationType [S or U] (String): "));
|
|
sessValData.registrationType = getInput();
|
|
Console.Write(fillWithSpace("sessValData.systemIdentifier (String): "));
|
|
sessValData.systemIdentifier = getInput();
|
|
// call imsapi function
|
|
int result = imsapi.regLogin(sessValData, out newSessionContext);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
sessionContext = newSessionContext;
|
|
allSessions.Add(sessionContext.sessionId, sessionContext);
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
Console.WriteLine("new session established.");
|
|
Console.WriteLine(fillWithSpace("sessionId: ") + "<" + sessionContext.sessionId + ">");
|
|
Console.WriteLine(fillWithSpace("locale: ") + "<" + sessionContext.locale + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_regLogout
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "regLogout"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct session
|
|
/// </para>
|
|
public static void test_regLogout()
|
|
{
|
|
// call imsapi function
|
|
int result = imsapi.regLogout(sessionContext);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
allSessions.Remove(sessionContext.sessionId);
|
|
sessionContext = null;
|
|
if (allSessions.Count > 0)
|
|
{
|
|
IEnumerator en = allSessions.Values.GetEnumerator();
|
|
en.MoveNext();
|
|
sessionContext = (IMSApiSessionContextStruct)en.Current;
|
|
Console.WriteLine("another session now active.");
|
|
Console.WriteLine(fillWithSpace("sessionId: ") + "<" + sessionContext.sessionId + ">");
|
|
Console.WriteLine(fillWithSpace("locale: ") + "<" + sessionContext.locale + ">");
|
|
}
|
|
else
|
|
{
|
|
Console.WriteLine(fillWithSpace("no session active now!"));
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_adviceGetAdvice
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "adviceGetAdvice"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in bool ignoreStationNumber
|
|
/// in bool checkStationGroup
|
|
/// in bool checkPartGroup
|
|
/// in KeyValue[] adviceFilters
|
|
/// out Advice[] adviceArray
|
|
/// </para>
|
|
public static void test_adviceGetAdvice()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
bool ignoreStationNumber = false;
|
|
bool checkStationGroup = false;
|
|
bool checkPartGroup = false;
|
|
KeyValue[] adviceFilters = null;
|
|
Advice[] adviceArray = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("ignoreStationNumber (bool): "));
|
|
ignoreStationNumber = Boolean.Parse(getInput());
|
|
Console.Write(fillWithSpace("checkStationGroup (bool): "));
|
|
checkStationGroup = Boolean.Parse(getInput());
|
|
Console.Write(fillWithSpace("checkPartGroup (bool): "));
|
|
checkPartGroup = Boolean.Parse(getInput());
|
|
Console.Write(fillWithSpace("Enter size for adviceFilters: "));
|
|
int adviceFiltersSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
adviceFilters = new KeyValue[adviceFiltersSize];
|
|
for (int i=0; i<adviceFiltersSize; i++)
|
|
{
|
|
adviceFilters[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("adviceFilters[" + i + "] .key (String): "));
|
|
adviceFilters[i].key = getInput();
|
|
Console.Write(fillWithSpace("adviceFilters[" + i + "] .value (String): "));
|
|
adviceFilters[i].value = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.adviceGetAdvice(sessionContext, stationNumber, ignoreStationNumber, checkStationGroup, checkPartGroup, adviceFilters, out adviceArray);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; adviceArray != null && i<adviceArray.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("adviceArray[" + i + "].id: ") + "<" + adviceArray[i].id + ">");
|
|
Console.WriteLine(fillWithSpace("adviceArray[" + i + "].text: ") + "<" + adviceArray[i].text + ">");
|
|
Console.WriteLine(fillWithSpace("adviceArray[" + i + "].name: ") + "<" + adviceArray[i].name + ">");
|
|
Console.WriteLine(fillWithSpace("adviceArray[" + i + "].mdaRootKey: ") + "<" + adviceArray[i].mdaRootKey + ">");
|
|
Console.WriteLine(fillWithSpace("adviceArray[" + i + "].adviceType: ") + "<" + adviceArray[i].adviceType + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_adviceConfirmAdvice
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "adviceConfirmAdvice"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String userName
|
|
/// in String password
|
|
/// in int adviceId
|
|
/// in int confirmationStatus
|
|
/// in String[] adviceEditTextArray
|
|
/// </para>
|
|
public static void test_adviceConfirmAdvice()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String userName = "";
|
|
String password = "";
|
|
int adviceId = 0;
|
|
int confirmationStatus = 0;
|
|
String[] adviceEditTextArray = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("userName (String): "));
|
|
userName = getInput();
|
|
Console.Write(fillWithSpace("password (String): "));
|
|
password = getInputNoEcho();
|
|
Console.Write(fillWithSpace("adviceId (int): "));
|
|
adviceId = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("confirmationStatus (int): "));
|
|
confirmationStatus = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("Enter size for adviceEditTextArray: "));
|
|
int adviceEditTextArraySize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
adviceEditTextArray = new String[adviceEditTextArraySize];
|
|
for (int i=0; i<adviceEditTextArraySize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("adviceEditTextArray[" + i + "] (String): "));
|
|
adviceEditTextArray[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.adviceConfirmAdvice(sessionContext, stationNumber, userName, password, adviceId, confirmationStatus, adviceEditTextArray);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_attribCreateAttribute
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "attribCreateAttribute"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in int objectType
|
|
/// in String attributeCode
|
|
/// in String attributeDesc
|
|
/// in String uniquenessType
|
|
/// </para>
|
|
public static void test_attribCreateAttribute()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
int objectType = 0;
|
|
String attributeCode = "";
|
|
String attributeDesc = "";
|
|
String uniquenessType = "";
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("objectType (int): "));
|
|
objectType = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("attributeCode (String): "));
|
|
attributeCode = getInput();
|
|
Console.Write(fillWithSpace("attributeDesc (String): "));
|
|
attributeDesc = getInput();
|
|
Console.Write(fillWithSpace("uniquenessType (String): "));
|
|
uniquenessType = getInput();
|
|
|
|
// call imsapi function
|
|
result = imsapi.attribCreateAttribute(sessionContext, stationNumber, objectType, attributeCode, attributeDesc, uniquenessType);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_attribCheckAttributeValues
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "attribCheckAttributeValues"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in int objectType
|
|
/// in String objectNumber
|
|
/// in String objectDetail
|
|
/// in long bookDate
|
|
/// in int allowOverWrite
|
|
/// in String[] attributeUploadKeys
|
|
/// in String[] attributeUploadValues
|
|
/// out String[] attributeResultValues
|
|
/// </para>
|
|
public static void test_attribCheckAttributeValues()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
int objectType = 0;
|
|
String objectNumber = "";
|
|
String objectDetail = "";
|
|
long bookDate = 0;
|
|
int allowOverWrite = 0;
|
|
String[] attributeUploadKeys = null;
|
|
String[] attributeUploadValues = null;
|
|
String[] attributeResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("objectType (int): "));
|
|
objectType = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("objectNumber (String): "));
|
|
objectNumber = getInput();
|
|
Console.Write(fillWithSpace("objectDetail (String): "));
|
|
objectDetail = getInput();
|
|
Console.Write(fillWithSpace("bookDate (long): "));
|
|
bookDate = Int64.Parse(getInput());
|
|
Console.Write(fillWithSpace("allowOverWrite (int): "));
|
|
allowOverWrite = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("Enter size for attributeUploadKeys: "));
|
|
int attributeUploadKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
attributeUploadKeys = new String[attributeUploadKeysSize];
|
|
for (int i=0; i<attributeUploadKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("attributeUploadKeys[" + i + "] (String): "));
|
|
attributeUploadKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for attributeUploadValues: "));
|
|
int attributeUploadValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
attributeUploadValues = new String[attributeUploadValuesSize];
|
|
for (int i=0; i<attributeUploadValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("attributeUploadValues[" + i + "] (String): "));
|
|
attributeUploadValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.attribCheckAttributeValues(sessionContext, stationNumber, objectType, objectNumber, objectDetail, bookDate, allowOverWrite, attributeUploadKeys, attributeUploadValues, out attributeResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; attributeResultValues != null && i<attributeResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("attributeResultValues[" + i + "]: ") + "<" + attributeResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_attribAppendAttributeValues
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "attribAppendAttributeValues"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in int objectType
|
|
/// in String objectNumber
|
|
/// in String objectDetail
|
|
/// in long bookDate
|
|
/// in int allowOverWrite
|
|
/// in String[] attributeUploadKeys
|
|
/// in String[] attributeUploadValues
|
|
/// out String[] attributeResultValues
|
|
/// </para>
|
|
public static void test_attribAppendAttributeValues()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
int objectType = 0;
|
|
String objectNumber = "";
|
|
String objectDetail = "";
|
|
long bookDate = 0;
|
|
int allowOverWrite = 0;
|
|
String[] attributeUploadKeys = null;
|
|
String[] attributeUploadValues = null;
|
|
String[] attributeResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("objectType (int): "));
|
|
objectType = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("objectNumber (String): "));
|
|
objectNumber = getInput();
|
|
Console.Write(fillWithSpace("objectDetail (String): "));
|
|
objectDetail = getInput();
|
|
Console.Write(fillWithSpace("bookDate (long): "));
|
|
bookDate = Int64.Parse(getInput());
|
|
Console.Write(fillWithSpace("allowOverWrite (int): "));
|
|
allowOverWrite = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("Enter size for attributeUploadKeys: "));
|
|
int attributeUploadKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
attributeUploadKeys = new String[attributeUploadKeysSize];
|
|
for (int i=0; i<attributeUploadKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("attributeUploadKeys[" + i + "] (String): "));
|
|
attributeUploadKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for attributeUploadValues: "));
|
|
int attributeUploadValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
attributeUploadValues = new String[attributeUploadValuesSize];
|
|
for (int i=0; i<attributeUploadValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("attributeUploadValues[" + i + "] (String): "));
|
|
attributeUploadValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.attribAppendAttributeValues(sessionContext, stationNumber, objectType, objectNumber, objectDetail, bookDate, allowOverWrite, attributeUploadKeys, attributeUploadValues, out attributeResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; attributeResultValues != null && i<attributeResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("attributeResultValues[" + i + "]: ") + "<" + attributeResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_attribRemoveAttributeValue
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "attribRemoveAttributeValue"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in int objectType
|
|
/// in String objectNumber
|
|
/// in String objectDetail
|
|
/// in String attributeCode
|
|
/// in String attributeValueKey
|
|
/// </para>
|
|
public static void test_attribRemoveAttributeValue()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
int objectType = 0;
|
|
String objectNumber = "";
|
|
String objectDetail = "";
|
|
String attributeCode = "";
|
|
String attributeValueKey = "";
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("objectType (int): "));
|
|
objectType = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("objectNumber (String): "));
|
|
objectNumber = getInput();
|
|
Console.Write(fillWithSpace("objectDetail (String): "));
|
|
objectDetail = getInput();
|
|
Console.Write(fillWithSpace("attributeCode (String): "));
|
|
attributeCode = getInput();
|
|
Console.Write(fillWithSpace("attributeValueKey (String): "));
|
|
attributeValueKey = getInput();
|
|
|
|
// call imsapi function
|
|
result = imsapi.attribRemoveAttributeValue(sessionContext, stationNumber, objectType, objectNumber, objectDetail, attributeCode, attributeValueKey);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_attribGetAttributeValues
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "attribGetAttributeValues"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in int objectType
|
|
/// in String objectNumber
|
|
/// in String objectDetail
|
|
/// in String[] attributeCodeArray
|
|
/// in int allMergeLevel
|
|
/// in String[] attributeResultKeys
|
|
/// out String[] attributeResultValues
|
|
/// </para>
|
|
public static void test_attribGetAttributeValues()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
int objectType = 0;
|
|
String objectNumber = "";
|
|
String objectDetail = "";
|
|
String[] attributeCodeArray = null;
|
|
int allMergeLevel = 0;
|
|
String[] attributeResultKeys = null;
|
|
String[] attributeResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("objectType (int): "));
|
|
objectType = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("objectNumber (String): "));
|
|
objectNumber = getInput();
|
|
Console.Write(fillWithSpace("objectDetail (String): "));
|
|
objectDetail = getInput();
|
|
Console.Write(fillWithSpace("Enter size for attributeCodeArray: "));
|
|
int attributeCodeArraySize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
attributeCodeArray = new String[attributeCodeArraySize];
|
|
for (int i=0; i<attributeCodeArraySize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("attributeCodeArray[" + i + "] (String): "));
|
|
attributeCodeArray[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("allMergeLevel (int): "));
|
|
allMergeLevel = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("Enter size for attributeResultKeys: "));
|
|
int attributeResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
attributeResultKeys = new String[attributeResultKeysSize];
|
|
for (int i=0; i<attributeResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("attributeResultKeys[" + i + "] (String): "));
|
|
attributeResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.attribGetAttributeValues(sessionContext, stationNumber, objectType, objectNumber, objectDetail, attributeCodeArray, allMergeLevel, attributeResultKeys, out attributeResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; attributeResultValues != null && i<attributeResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("attributeResultValues[" + i + "]: ") + "<" + attributeResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_attribGetObjectsForAttributeValues
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "attribGetObjectsForAttributeValues"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in int objectType
|
|
/// in String attributeCode
|
|
/// in String attributeValue
|
|
/// in int maxRows
|
|
/// in KeyValue[] attributeFilters
|
|
/// in String[] objectResultKeys
|
|
/// out String[] objectResultValues
|
|
/// </para>
|
|
public static void test_attribGetObjectsForAttributeValues()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
int objectType = 0;
|
|
String attributeCode = "";
|
|
String attributeValue = "";
|
|
int maxRows = 0;
|
|
KeyValue[] attributeFilters = null;
|
|
String[] objectResultKeys = null;
|
|
String[] objectResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("objectType (int): "));
|
|
objectType = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("attributeCode (String): "));
|
|
attributeCode = getInput();
|
|
Console.Write(fillWithSpace("attributeValue (String): "));
|
|
attributeValue = getInput();
|
|
Console.Write(fillWithSpace("maxRows (int): "));
|
|
maxRows = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("Enter size for attributeFilters: "));
|
|
int attributeFiltersSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
attributeFilters = new KeyValue[attributeFiltersSize];
|
|
for (int i=0; i<attributeFiltersSize; i++)
|
|
{
|
|
attributeFilters[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("attributeFilters[" + i + "] .key (String): "));
|
|
attributeFilters[i].key = getInput();
|
|
Console.Write(fillWithSpace("attributeFilters[" + i + "] .value (String): "));
|
|
attributeFilters[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for objectResultKeys: "));
|
|
int objectResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
objectResultKeys = new String[objectResultKeysSize];
|
|
for (int i=0; i<objectResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("objectResultKeys[" + i + "] (String): "));
|
|
objectResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.attribGetObjectsForAttributeValues(sessionContext, stationNumber, objectType, attributeCode, attributeValue, maxRows, attributeFilters, objectResultKeys, out objectResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; objectResultValues != null && i<objectResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("objectResultValues[" + i + "]: ") + "<" + objectResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_attribGetAttributeClass
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "attribGetAttributeClass"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] attributeClassFilter
|
|
/// in String[] classResultKeys
|
|
/// out String[] classResultValues
|
|
/// in String[] classTypeResultKeys
|
|
/// out String[] classTypeResultValues
|
|
/// in String[] classItemResultKeys
|
|
/// out String[] classItemResultValues
|
|
/// in String[] classItemConditionResultKeys
|
|
/// out String[] classItemConditionResultValues
|
|
/// </para>
|
|
public static void test_attribGetAttributeClass()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] attributeClassFilter = null;
|
|
String[] classResultKeys = null;
|
|
String[] classResultValues = null;
|
|
String[] classTypeResultKeys = null;
|
|
String[] classTypeResultValues = null;
|
|
String[] classItemResultKeys = null;
|
|
String[] classItemResultValues = null;
|
|
String[] classItemConditionResultKeys = null;
|
|
String[] classItemConditionResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for attributeClassFilter: "));
|
|
int attributeClassFilterSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
attributeClassFilter = new KeyValue[attributeClassFilterSize];
|
|
for (int i=0; i<attributeClassFilterSize; i++)
|
|
{
|
|
attributeClassFilter[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("attributeClassFilter[" + i + "] .key (String): "));
|
|
attributeClassFilter[i].key = getInput();
|
|
Console.Write(fillWithSpace("attributeClassFilter[" + i + "] .value (String): "));
|
|
attributeClassFilter[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for classResultKeys: "));
|
|
int classResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
classResultKeys = new String[classResultKeysSize];
|
|
for (int i=0; i<classResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("classResultKeys[" + i + "] (String): "));
|
|
classResultKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for classTypeResultKeys: "));
|
|
int classTypeResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
classTypeResultKeys = new String[classTypeResultKeysSize];
|
|
for (int i=0; i<classTypeResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("classTypeResultKeys[" + i + "] (String): "));
|
|
classTypeResultKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for classItemResultKeys: "));
|
|
int classItemResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
classItemResultKeys = new String[classItemResultKeysSize];
|
|
for (int i=0; i<classItemResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("classItemResultKeys[" + i + "] (String): "));
|
|
classItemResultKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for classItemConditionResultKeys: "));
|
|
int classItemConditionResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
classItemConditionResultKeys = new String[classItemConditionResultKeysSize];
|
|
for (int i=0; i<classItemConditionResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("classItemConditionResultKeys[" + i + "] (String): "));
|
|
classItemConditionResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.attribGetAttributeClass(sessionContext, stationNumber, attributeClassFilter, classResultKeys, out classResultValues, classTypeResultKeys, out classTypeResultValues, classItemResultKeys, out classItemResultValues, classItemConditionResultKeys, out classItemConditionResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; classResultValues != null && i<classResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("classResultValues[" + i + "]: ") + "<" + classResultValues[i] + ">");
|
|
}
|
|
for (int i=0; classTypeResultValues != null && i<classTypeResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("classTypeResultValues[" + i + "]: ") + "<" + classTypeResultValues[i] + ">");
|
|
}
|
|
for (int i=0; classItemResultValues != null && i<classItemResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("classItemResultValues[" + i + "]: ") + "<" + classItemResultValues[i] + ">");
|
|
}
|
|
for (int i=0; classItemConditionResultValues != null && i<classItemConditionResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("classItemConditionResultValues[" + i + "]: ") + "<" + classItemConditionResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_attribGetAttributeCondition
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "attribGetAttributeCondition"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] attributeConditionFilter
|
|
/// in String[] conditionResultKeys
|
|
/// out String[] conditionResultValues
|
|
/// </para>
|
|
public static void test_attribGetAttributeCondition()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] attributeConditionFilter = null;
|
|
String[] conditionResultKeys = null;
|
|
String[] conditionResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for attributeConditionFilter: "));
|
|
int attributeConditionFilterSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
attributeConditionFilter = new KeyValue[attributeConditionFilterSize];
|
|
for (int i=0; i<attributeConditionFilterSize; i++)
|
|
{
|
|
attributeConditionFilter[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("attributeConditionFilter[" + i + "] .key (String): "));
|
|
attributeConditionFilter[i].key = getInput();
|
|
Console.Write(fillWithSpace("attributeConditionFilter[" + i + "] .value (String): "));
|
|
attributeConditionFilter[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for conditionResultKeys: "));
|
|
int conditionResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
conditionResultKeys = new String[conditionResultKeysSize];
|
|
for (int i=0; i<conditionResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("conditionResultKeys[" + i + "] (String): "));
|
|
conditionResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.attribGetAttributeCondition(sessionContext, stationNumber, attributeConditionFilter, conditionResultKeys, out conditionResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; conditionResultValues != null && i<conditionResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("conditionResultValues[" + i + "]: ") + "<" + conditionResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_attribCreateAttributeCondition
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "attribCreateAttributeCondition"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String[] conditionKeys
|
|
/// in String[] conditionValues
|
|
/// out String[] conditionResultValues
|
|
/// </para>
|
|
public static void test_attribCreateAttributeCondition()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String[] conditionKeys = null;
|
|
String[] conditionValues = null;
|
|
String[] conditionResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for conditionKeys: "));
|
|
int conditionKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
conditionKeys = new String[conditionKeysSize];
|
|
for (int i=0; i<conditionKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("conditionKeys[" + i + "] (String): "));
|
|
conditionKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for conditionValues: "));
|
|
int conditionValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
conditionValues = new String[conditionValuesSize];
|
|
for (int i=0; i<conditionValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("conditionValues[" + i + "] (String): "));
|
|
conditionValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.attribCreateAttributeCondition(sessionContext, stationNumber, conditionKeys, conditionValues, out conditionResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; conditionResultValues != null && i<conditionResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("conditionResultValues[" + i + "]: ") + "<" + conditionResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_attribManageAttributeCondition
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "attribManageAttributeCondition"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] attributeCodeFilter
|
|
/// in String[] conditionKeys
|
|
/// in String[] conditionValues
|
|
/// out String[] conditionResultValues
|
|
/// </para>
|
|
public static void test_attribManageAttributeCondition()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] attributeCodeFilter = null;
|
|
String[] conditionKeys = null;
|
|
String[] conditionValues = null;
|
|
String[] conditionResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for attributeCodeFilter: "));
|
|
int attributeCodeFilterSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
attributeCodeFilter = new KeyValue[attributeCodeFilterSize];
|
|
for (int i=0; i<attributeCodeFilterSize; i++)
|
|
{
|
|
attributeCodeFilter[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("attributeCodeFilter[" + i + "] .key (String): "));
|
|
attributeCodeFilter[i].key = getInput();
|
|
Console.Write(fillWithSpace("attributeCodeFilter[" + i + "] .value (String): "));
|
|
attributeCodeFilter[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for conditionKeys: "));
|
|
int conditionKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
conditionKeys = new String[conditionKeysSize];
|
|
for (int i=0; i<conditionKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("conditionKeys[" + i + "] (String): "));
|
|
conditionKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for conditionValues: "));
|
|
int conditionValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
conditionValues = new String[conditionValuesSize];
|
|
for (int i=0; i<conditionValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("conditionValues[" + i + "] (String): "));
|
|
conditionValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.attribManageAttributeCondition(sessionContext, stationNumber, attributeCodeFilter, conditionKeys, conditionValues, out conditionResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; conditionResultValues != null && i<conditionResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("conditionResultValues[" + i + "]: ") + "<" + conditionResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_attribRemoveAttributeClassValue
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "attribRemoveAttributeClassValue"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String[] attributeRemoveKeys
|
|
/// in String[] attributeRemoveValues
|
|
/// out String[] attributeRemoveResult
|
|
/// </para>
|
|
public static void test_attribRemoveAttributeClassValue()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String[] attributeRemoveKeys = null;
|
|
String[] attributeRemoveValues = null;
|
|
String[] attributeRemoveResult = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for attributeRemoveKeys: "));
|
|
int attributeRemoveKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
attributeRemoveKeys = new String[attributeRemoveKeysSize];
|
|
for (int i=0; i<attributeRemoveKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("attributeRemoveKeys[" + i + "] (String): "));
|
|
attributeRemoveKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for attributeRemoveValues: "));
|
|
int attributeRemoveValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
attributeRemoveValues = new String[attributeRemoveValuesSize];
|
|
for (int i=0; i<attributeRemoveValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("attributeRemoveValues[" + i + "] (String): "));
|
|
attributeRemoveValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.attribRemoveAttributeClassValue(sessionContext, stationNumber, attributeRemoveKeys, attributeRemoveValues, out attributeRemoveResult);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; attributeRemoveResult != null && i<attributeRemoveResult.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("attributeRemoveResult[" + i + "]: ") + "<" + attributeRemoveResult[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_attribEditAttributeClassState
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "attribEditAttributeClassState"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] attributeClassData
|
|
/// </para>
|
|
public static void test_attribEditAttributeClassState()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] attributeClassData = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for attributeClassData: "));
|
|
int attributeClassDataSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
attributeClassData = new KeyValue[attributeClassDataSize];
|
|
for (int i=0; i<attributeClassDataSize; i++)
|
|
{
|
|
attributeClassData[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("attributeClassData[" + i + "] .key (String): "));
|
|
attributeClassData[i].key = getInput();
|
|
Console.Write(fillWithSpace("attributeClassData[" + i + "] .value (String): "));
|
|
attributeClassData[i].value = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.attribEditAttributeClassState(sessionContext, stationNumber, attributeClassData);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_attribCreateAttributeClass
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "attribCreateAttributeClass"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] attributeClassCreateFilter
|
|
/// in String[] classCreateKeys
|
|
/// in String[] classCreateValues
|
|
/// in String[] classCreateResultKeys
|
|
/// out String[] classCreateResultValues
|
|
/// </para>
|
|
public static void test_attribCreateAttributeClass()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] attributeClassCreateFilter = null;
|
|
String[] classCreateKeys = null;
|
|
String[] classCreateValues = null;
|
|
String[] classCreateResultKeys = null;
|
|
String[] classCreateResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for attributeClassCreateFilter: "));
|
|
int attributeClassCreateFilterSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
attributeClassCreateFilter = new KeyValue[attributeClassCreateFilterSize];
|
|
for (int i=0; i<attributeClassCreateFilterSize; i++)
|
|
{
|
|
attributeClassCreateFilter[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("attributeClassCreateFilter[" + i + "] .key (String): "));
|
|
attributeClassCreateFilter[i].key = getInput();
|
|
Console.Write(fillWithSpace("attributeClassCreateFilter[" + i + "] .value (String): "));
|
|
attributeClassCreateFilter[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for classCreateKeys: "));
|
|
int classCreateKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
classCreateKeys = new String[classCreateKeysSize];
|
|
for (int i=0; i<classCreateKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("classCreateKeys[" + i + "] (String): "));
|
|
classCreateKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for classCreateValues: "));
|
|
int classCreateValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
classCreateValues = new String[classCreateValuesSize];
|
|
for (int i=0; i<classCreateValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("classCreateValues[" + i + "] (String): "));
|
|
classCreateValues[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for classCreateResultKeys: "));
|
|
int classCreateResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
classCreateResultKeys = new String[classCreateResultKeysSize];
|
|
for (int i=0; i<classCreateResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("classCreateResultKeys[" + i + "] (String): "));
|
|
classCreateResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.attribCreateAttributeClass(sessionContext, stationNumber, attributeClassCreateFilter, classCreateKeys, classCreateValues, classCreateResultKeys, out classCreateResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; classCreateResultValues != null && i<classCreateResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("classCreateResultValues[" + i + "]: ") + "<" + classCreateResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_attribManageAttributeClassAttribute
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "attribManageAttributeClassAttribute"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] attributeClassManageAttributeFilter
|
|
/// in String[] classAttributeKeys
|
|
/// in String[] classAttributeValues
|
|
/// out String[] classAttributeResultValues
|
|
/// </para>
|
|
public static void test_attribManageAttributeClassAttribute()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] attributeClassManageAttributeFilter = null;
|
|
String[] classAttributeKeys = null;
|
|
String[] classAttributeValues = null;
|
|
String[] classAttributeResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for attributeClassManageAttributeFilter: "));
|
|
int attributeClassManageAttributeFilterSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
attributeClassManageAttributeFilter = new KeyValue[attributeClassManageAttributeFilterSize];
|
|
for (int i=0; i<attributeClassManageAttributeFilterSize; i++)
|
|
{
|
|
attributeClassManageAttributeFilter[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("attributeClassManageAttributeFilter[" + i + "] .key (String): "));
|
|
attributeClassManageAttributeFilter[i].key = getInput();
|
|
Console.Write(fillWithSpace("attributeClassManageAttributeFilter[" + i + "] .value (String): "));
|
|
attributeClassManageAttributeFilter[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for classAttributeKeys: "));
|
|
int classAttributeKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
classAttributeKeys = new String[classAttributeKeysSize];
|
|
for (int i=0; i<classAttributeKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("classAttributeKeys[" + i + "] (String): "));
|
|
classAttributeKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for classAttributeValues: "));
|
|
int classAttributeValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
classAttributeValues = new String[classAttributeValuesSize];
|
|
for (int i=0; i<classAttributeValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("classAttributeValues[" + i + "] (String): "));
|
|
classAttributeValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.attribManageAttributeClassAttribute(sessionContext, stationNumber, attributeClassManageAttributeFilter, classAttributeKeys, classAttributeValues, out classAttributeResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; classAttributeResultValues != null && i<classAttributeResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("classAttributeResultValues[" + i + "]: ") + "<" + classAttributeResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_attribManageAttributeClassCondition
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "attribManageAttributeClassCondition"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] attributeClassManageAttributeFilter
|
|
/// in String[] classConditionKeys
|
|
/// in String[] classConditionValues
|
|
/// out String[] classConditionResultValues
|
|
/// </para>
|
|
public static void test_attribManageAttributeClassCondition()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] attributeClassManageAttributeFilter = null;
|
|
String[] classConditionKeys = null;
|
|
String[] classConditionValues = null;
|
|
String[] classConditionResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for attributeClassManageAttributeFilter: "));
|
|
int attributeClassManageAttributeFilterSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
attributeClassManageAttributeFilter = new KeyValue[attributeClassManageAttributeFilterSize];
|
|
for (int i=0; i<attributeClassManageAttributeFilterSize; i++)
|
|
{
|
|
attributeClassManageAttributeFilter[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("attributeClassManageAttributeFilter[" + i + "] .key (String): "));
|
|
attributeClassManageAttributeFilter[i].key = getInput();
|
|
Console.Write(fillWithSpace("attributeClassManageAttributeFilter[" + i + "] .value (String): "));
|
|
attributeClassManageAttributeFilter[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for classConditionKeys: "));
|
|
int classConditionKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
classConditionKeys = new String[classConditionKeysSize];
|
|
for (int i=0; i<classConditionKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("classConditionKeys[" + i + "] (String): "));
|
|
classConditionKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for classConditionValues: "));
|
|
int classConditionValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
classConditionValues = new String[classConditionValuesSize];
|
|
for (int i=0; i<classConditionValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("classConditionValues[" + i + "] (String): "));
|
|
classConditionValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.attribManageAttributeClassCondition(sessionContext, stationNumber, attributeClassManageAttributeFilter, classConditionKeys, classConditionValues, out classConditionResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; classConditionResultValues != null && i<classConditionResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("classConditionResultValues[" + i + "]: ") + "<" + classConditionResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_attribCreateAttributeCode
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "attribCreateAttributeCode"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String[] codeKeys
|
|
/// in String[] codeValues
|
|
/// out String[] codeResultValues
|
|
/// </para>
|
|
public static void test_attribCreateAttributeCode()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String[] codeKeys = null;
|
|
String[] codeValues = null;
|
|
String[] codeResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for codeKeys: "));
|
|
int codeKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
codeKeys = new String[codeKeysSize];
|
|
for (int i=0; i<codeKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("codeKeys[" + i + "] (String): "));
|
|
codeKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for codeValues: "));
|
|
int codeValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
codeValues = new String[codeValuesSize];
|
|
for (int i=0; i<codeValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("codeValues[" + i + "] (String): "));
|
|
codeValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.attribCreateAttributeCode(sessionContext, stationNumber, codeKeys, codeValues, out codeResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; codeResultValues != null && i<codeResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("codeResultValues[" + i + "]: ") + "<" + codeResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_attribUpdateAttributeCode
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "attribUpdateAttributeCode"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String[] codeKeys
|
|
/// in String[] codeValues
|
|
/// out String[] codeResultValues
|
|
/// </para>
|
|
public static void test_attribUpdateAttributeCode()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String[] codeKeys = null;
|
|
String[] codeValues = null;
|
|
String[] codeResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for codeKeys: "));
|
|
int codeKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
codeKeys = new String[codeKeysSize];
|
|
for (int i=0; i<codeKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("codeKeys[" + i + "] (String): "));
|
|
codeKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for codeValues: "));
|
|
int codeValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
codeValues = new String[codeValuesSize];
|
|
for (int i=0; i<codeValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("codeValues[" + i + "] (String): "));
|
|
codeValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.attribUpdateAttributeCode(sessionContext, stationNumber, codeKeys, codeValues, out codeResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; codeResultValues != null && i<codeResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("codeResultValues[" + i + "]: ") + "<" + codeResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_attribGetAttributeCode
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "attribGetAttributeCode"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] attributeCodeFilter
|
|
/// in String[] codeResultKeys
|
|
/// out String[] codeResultValues
|
|
/// in String[] conditionResultKeys
|
|
/// out String[] conditionResultValues
|
|
/// </para>
|
|
public static void test_attribGetAttributeCode()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] attributeCodeFilter = null;
|
|
String[] codeResultKeys = null;
|
|
String[] codeResultValues = null;
|
|
String[] conditionResultKeys = null;
|
|
String[] conditionResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for attributeCodeFilter: "));
|
|
int attributeCodeFilterSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
attributeCodeFilter = new KeyValue[attributeCodeFilterSize];
|
|
for (int i=0; i<attributeCodeFilterSize; i++)
|
|
{
|
|
attributeCodeFilter[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("attributeCodeFilter[" + i + "] .key (String): "));
|
|
attributeCodeFilter[i].key = getInput();
|
|
Console.Write(fillWithSpace("attributeCodeFilter[" + i + "] .value (String): "));
|
|
attributeCodeFilter[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for codeResultKeys: "));
|
|
int codeResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
codeResultKeys = new String[codeResultKeysSize];
|
|
for (int i=0; i<codeResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("codeResultKeys[" + i + "] (String): "));
|
|
codeResultKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for conditionResultKeys: "));
|
|
int conditionResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
conditionResultKeys = new String[conditionResultKeysSize];
|
|
for (int i=0; i<conditionResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("conditionResultKeys[" + i + "] (String): "));
|
|
conditionResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.attribGetAttributeCode(sessionContext, stationNumber, attributeCodeFilter, codeResultKeys, out codeResultValues, conditionResultKeys, out conditionResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; codeResultValues != null && i<codeResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("codeResultValues[" + i + "]: ") + "<" + codeResultValues[i] + ">");
|
|
}
|
|
for (int i=0; conditionResultValues != null && i<conditionResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("conditionResultValues[" + i + "]: ") + "<" + conditionResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_attribCreateAttributeCodeByCatalog
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "attribCreateAttributeCodeByCatalog"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] attributeCodeFilter
|
|
/// </para>
|
|
public static void test_attribCreateAttributeCodeByCatalog()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] attributeCodeFilter = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for attributeCodeFilter: "));
|
|
int attributeCodeFilterSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
attributeCodeFilter = new KeyValue[attributeCodeFilterSize];
|
|
for (int i=0; i<attributeCodeFilterSize; i++)
|
|
{
|
|
attributeCodeFilter[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("attributeCodeFilter[" + i + "] .key (String): "));
|
|
attributeCodeFilter[i].key = getInput();
|
|
Console.Write(fillWithSpace("attributeCodeFilter[" + i + "] .value (String): "));
|
|
attributeCodeFilter[i].value = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.attribCreateAttributeCodeByCatalog(sessionContext, stationNumber, attributeCodeFilter);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_attribGetAllAttributeValue
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "attribGetAllAttributeValue"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] attributeValueSearchFilter
|
|
/// in String[] attributeValueSearchKeys
|
|
/// in String[] attributeValueSearchValues
|
|
/// in String[] attributeValueResultKeys
|
|
/// out String[] attributeValueSearchResultValues
|
|
/// </para>
|
|
public static void test_attribGetAllAttributeValue()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] attributeValueSearchFilter = null;
|
|
String[] attributeValueSearchKeys = null;
|
|
String[] attributeValueSearchValues = null;
|
|
String[] attributeValueResultKeys = null;
|
|
String[] attributeValueSearchResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for attributeValueSearchFilter: "));
|
|
int attributeValueSearchFilterSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
attributeValueSearchFilter = new KeyValue[attributeValueSearchFilterSize];
|
|
for (int i=0; i<attributeValueSearchFilterSize; i++)
|
|
{
|
|
attributeValueSearchFilter[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("attributeValueSearchFilter[" + i + "] .key (String): "));
|
|
attributeValueSearchFilter[i].key = getInput();
|
|
Console.Write(fillWithSpace("attributeValueSearchFilter[" + i + "] .value (String): "));
|
|
attributeValueSearchFilter[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for attributeValueSearchKeys: "));
|
|
int attributeValueSearchKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
attributeValueSearchKeys = new String[attributeValueSearchKeysSize];
|
|
for (int i=0; i<attributeValueSearchKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("attributeValueSearchKeys[" + i + "] (String): "));
|
|
attributeValueSearchKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for attributeValueSearchValues: "));
|
|
int attributeValueSearchValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
attributeValueSearchValues = new String[attributeValueSearchValuesSize];
|
|
for (int i=0; i<attributeValueSearchValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("attributeValueSearchValues[" + i + "] (String): "));
|
|
attributeValueSearchValues[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for attributeValueResultKeys: "));
|
|
int attributeValueResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
attributeValueResultKeys = new String[attributeValueResultKeysSize];
|
|
for (int i=0; i<attributeValueResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("attributeValueResultKeys[" + i + "] (String): "));
|
|
attributeValueResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.attribGetAllAttributeValue(sessionContext, stationNumber, attributeValueSearchFilter, attributeValueSearchKeys, attributeValueSearchValues, attributeValueResultKeys, out attributeValueSearchResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; attributeValueSearchResultValues != null && i<attributeValueSearchResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("attributeValueSearchResultValues[" + i + "]: ") + "<" + attributeValueSearchResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_attribGetAttributeValuesForObjectType
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "attribGetAttributeValuesForObjectType"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] attributeFilterKeys
|
|
/// in String[] attributeFilterArrayKeys
|
|
/// in String[] attributeFilterArrayValues
|
|
/// in String[] attributeResultKeys
|
|
/// out String[] attributeResultValues
|
|
/// </para>
|
|
public static void test_attribGetAttributeValuesForObjectType()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] attributeFilterKeys = null;
|
|
String[] attributeFilterArrayKeys = null;
|
|
String[] attributeFilterArrayValues = null;
|
|
String[] attributeResultKeys = null;
|
|
String[] attributeResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for attributeFilterKeys: "));
|
|
int attributeFilterKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
attributeFilterKeys = new KeyValue[attributeFilterKeysSize];
|
|
for (int i=0; i<attributeFilterKeysSize; i++)
|
|
{
|
|
attributeFilterKeys[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("attributeFilterKeys[" + i + "] .key (String): "));
|
|
attributeFilterKeys[i].key = getInput();
|
|
Console.Write(fillWithSpace("attributeFilterKeys[" + i + "] .value (String): "));
|
|
attributeFilterKeys[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for attributeFilterArrayKeys: "));
|
|
int attributeFilterArrayKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
attributeFilterArrayKeys = new String[attributeFilterArrayKeysSize];
|
|
for (int i=0; i<attributeFilterArrayKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("attributeFilterArrayKeys[" + i + "] (String): "));
|
|
attributeFilterArrayKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for attributeFilterArrayValues: "));
|
|
int attributeFilterArrayValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
attributeFilterArrayValues = new String[attributeFilterArrayValuesSize];
|
|
for (int i=0; i<attributeFilterArrayValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("attributeFilterArrayValues[" + i + "] (String): "));
|
|
attributeFilterArrayValues[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for attributeResultKeys: "));
|
|
int attributeResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
attributeResultKeys = new String[attributeResultKeysSize];
|
|
for (int i=0; i<attributeResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("attributeResultKeys[" + i + "] (String): "));
|
|
attributeResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.attribGetAttributeValuesForObjectType(sessionContext, stationNumber, attributeFilterKeys, attributeFilterArrayKeys, attributeFilterArrayValues, attributeResultKeys, out attributeResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; attributeResultValues != null && i<attributeResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("attributeResultValues[" + i + "]: ") + "<" + attributeResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_attribGetAttributeHistory
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "attribGetAttributeHistory"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in int objectType
|
|
/// in String objectNumber
|
|
/// in String objectDetail
|
|
/// in String[] attributeCodeArray
|
|
/// in KeyValue[] attributeHistoryFilter
|
|
/// in String[] attributeHistoryResultKeys
|
|
/// out String[] attributeHistoryResultValues
|
|
/// </para>
|
|
public static void test_attribGetAttributeHistory()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
int objectType = 0;
|
|
String objectNumber = "";
|
|
String objectDetail = "";
|
|
String[] attributeCodeArray = null;
|
|
KeyValue[] attributeHistoryFilter = null;
|
|
String[] attributeHistoryResultKeys = null;
|
|
String[] attributeHistoryResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("objectType (int): "));
|
|
objectType = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("objectNumber (String): "));
|
|
objectNumber = getInput();
|
|
Console.Write(fillWithSpace("objectDetail (String): "));
|
|
objectDetail = getInput();
|
|
Console.Write(fillWithSpace("Enter size for attributeCodeArray: "));
|
|
int attributeCodeArraySize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
attributeCodeArray = new String[attributeCodeArraySize];
|
|
for (int i=0; i<attributeCodeArraySize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("attributeCodeArray[" + i + "] (String): "));
|
|
attributeCodeArray[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for attributeHistoryFilter: "));
|
|
int attributeHistoryFilterSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
attributeHistoryFilter = new KeyValue[attributeHistoryFilterSize];
|
|
for (int i=0; i<attributeHistoryFilterSize; i++)
|
|
{
|
|
attributeHistoryFilter[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("attributeHistoryFilter[" + i + "] .key (String): "));
|
|
attributeHistoryFilter[i].key = getInput();
|
|
Console.Write(fillWithSpace("attributeHistoryFilter[" + i + "] .value (String): "));
|
|
attributeHistoryFilter[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for attributeHistoryResultKeys: "));
|
|
int attributeHistoryResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
attributeHistoryResultKeys = new String[attributeHistoryResultKeysSize];
|
|
for (int i=0; i<attributeHistoryResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("attributeHistoryResultKeys[" + i + "] (String): "));
|
|
attributeHistoryResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.attribGetAttributeHistory(sessionContext, stationNumber, objectType, objectNumber, objectDetail, attributeCodeArray, attributeHistoryFilter, attributeHistoryResultKeys, out attributeHistoryResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; attributeHistoryResultValues != null && i<attributeHistoryResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("attributeHistoryResultValues[" + i + "]: ") + "<" + attributeHistoryResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_batchAssignBatchNumberToWorkOrder
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "batchAssignBatchNumberToWorkOrder"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String workOrderNumber
|
|
/// in String partNumber
|
|
/// in String bomVersion
|
|
/// in String bomIndex
|
|
/// in String bomVersionErp
|
|
/// in int processLayer
|
|
/// in String batchNumber
|
|
/// in double quantity
|
|
/// in int activateWorkOrder
|
|
/// </para>
|
|
public static void test_batchAssignBatchNumberToWorkOrder()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String workOrderNumber = "";
|
|
String partNumber = "";
|
|
String bomVersion = "";
|
|
String bomIndex = "";
|
|
String bomVersionErp = "";
|
|
int processLayer = 0;
|
|
String batchNumber = "";
|
|
double quantity = 0.0;
|
|
int activateWorkOrder = 0;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("workOrderNumber (String): "));
|
|
workOrderNumber = getInput();
|
|
Console.Write(fillWithSpace("partNumber (String): "));
|
|
partNumber = getInput();
|
|
Console.Write(fillWithSpace("bomVersion (String): "));
|
|
bomVersion = getInput();
|
|
Console.Write(fillWithSpace("bomIndex (String): "));
|
|
bomIndex = getInput();
|
|
Console.Write(fillWithSpace("bomVersionErp (String): "));
|
|
bomVersionErp = getInput();
|
|
Console.Write(fillWithSpace("processLayer (int): "));
|
|
processLayer = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("batchNumber (String): "));
|
|
batchNumber = getInput();
|
|
Console.Write(fillWithSpace("quantity (double): "));
|
|
quantity = Double.Parse(getInput());
|
|
Console.Write(fillWithSpace("activateWorkOrder (int): "));
|
|
activateWorkOrder = Int32.Parse(getInput());
|
|
|
|
// call imsapi function
|
|
result = imsapi.batchAssignBatchNumberToWorkOrder(sessionContext, stationNumber, workOrderNumber, partNumber, bomVersion, bomIndex, bomVersionErp, processLayer, batchNumber, quantity, activateWorkOrder);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_batchRegisterBatch
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "batchRegisterBatch"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String batchNumber
|
|
/// in int processLayer
|
|
/// in int ignoreBatchComplete
|
|
/// in long registerDate
|
|
/// </para>
|
|
public static void test_batchRegisterBatch()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String batchNumber = "";
|
|
int processLayer = 0;
|
|
int ignoreBatchComplete = 0;
|
|
long registerDate = 0;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("batchNumber (String): "));
|
|
batchNumber = getInput();
|
|
Console.Write(fillWithSpace("processLayer (int): "));
|
|
processLayer = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("ignoreBatchComplete (int): "));
|
|
ignoreBatchComplete = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("registerDate (long): "));
|
|
registerDate = Int64.Parse(getInput());
|
|
|
|
// call imsapi function
|
|
result = imsapi.batchRegisterBatch(sessionContext, stationNumber, batchNumber, processLayer, ignoreBatchComplete, registerDate);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_batchUnregisterBatch
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "batchUnregisterBatch"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String batchNumber
|
|
/// in int processLayer
|
|
/// in double batchTotalQuantity
|
|
/// in int batchComplete
|
|
/// in long unregisterDate
|
|
/// </para>
|
|
public static void test_batchUnregisterBatch()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String batchNumber = "";
|
|
int processLayer = 0;
|
|
double batchTotalQuantity = 0.0;
|
|
int batchComplete = 0;
|
|
long unregisterDate = 0;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("batchNumber (String): "));
|
|
batchNumber = getInput();
|
|
Console.Write(fillWithSpace("processLayer (int): "));
|
|
processLayer = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("batchTotalQuantity (double): "));
|
|
batchTotalQuantity = Double.Parse(getInput());
|
|
Console.Write(fillWithSpace("batchComplete (int): "));
|
|
batchComplete = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("unregisterDate (long): "));
|
|
unregisterDate = Int64.Parse(getInput());
|
|
|
|
// call imsapi function
|
|
result = imsapi.batchUnregisterBatch(sessionContext, stationNumber, batchNumber, processLayer, batchTotalQuantity, batchComplete, unregisterDate);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_batchSplitBatchNumberToSerialNumber
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "batchSplitBatchNumberToSerialNumber"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// inout String serialNumberRef
|
|
/// inout String serialNumberPos
|
|
/// in String batchNumber
|
|
/// in int processLayer
|
|
/// in double usedBatchQuantity
|
|
/// in int duplicateSerialNumber
|
|
/// in int ignoreBatchComplete
|
|
/// </para>
|
|
public static void test_batchSplitBatchNumberToSerialNumber()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String serialNumberRef = "";
|
|
String serialNumberPos = "";
|
|
String batchNumber = "";
|
|
int processLayer = 0;
|
|
double usedBatchQuantity = 0.0;
|
|
int duplicateSerialNumber = 0;
|
|
int ignoreBatchComplete = 0;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumberRef (String): "));
|
|
serialNumberRef = getInput();
|
|
Console.Write(fillWithSpace("serialNumberPos (String): "));
|
|
serialNumberPos = getInput();
|
|
Console.Write(fillWithSpace("batchNumber (String): "));
|
|
batchNumber = getInput();
|
|
Console.Write(fillWithSpace("processLayer (int): "));
|
|
processLayer = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("usedBatchQuantity (double): "));
|
|
usedBatchQuantity = Double.Parse(getInput());
|
|
Console.Write(fillWithSpace("duplicateSerialNumber (int): "));
|
|
duplicateSerialNumber = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("ignoreBatchComplete (int): "));
|
|
ignoreBatchComplete = Int32.Parse(getInput());
|
|
|
|
// call imsapi function
|
|
result = imsapi.batchSplitBatchNumberToSerialNumber(sessionContext, stationNumber, ref serialNumberRef, ref serialNumberPos, batchNumber, processLayer, usedBatchQuantity, duplicateSerialNumber, ignoreBatchComplete);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
Console.WriteLine(fillWithSpace("serialNumberRef: ") + "<" + serialNumberRef + ">");
|
|
Console.WriteLine(fillWithSpace("serialNumberPos: ") + "<" + serialNumberPos + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_batchMergeBatch
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "batchMergeBatch"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String serialNumberRef
|
|
/// in String serialNumberPos
|
|
/// in String batchNumber
|
|
/// in int processLayer
|
|
/// in double usedBatchQuantity
|
|
/// in int duplicateSerialNumber
|
|
/// in int ignoreBatchComplete
|
|
/// </para>
|
|
public static void test_batchMergeBatch()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String serialNumberRef = "";
|
|
String serialNumberPos = "";
|
|
String batchNumber = "";
|
|
int processLayer = 0;
|
|
double usedBatchQuantity = 0.0;
|
|
int duplicateSerialNumber = 0;
|
|
int ignoreBatchComplete = 0;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumberRef (String): "));
|
|
serialNumberRef = getInput();
|
|
Console.Write(fillWithSpace("serialNumberPos (String): "));
|
|
serialNumberPos = getInput();
|
|
Console.Write(fillWithSpace("batchNumber (String): "));
|
|
batchNumber = getInput();
|
|
Console.Write(fillWithSpace("processLayer (int): "));
|
|
processLayer = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("usedBatchQuantity (double): "));
|
|
usedBatchQuantity = Double.Parse(getInput());
|
|
Console.Write(fillWithSpace("duplicateSerialNumber (int): "));
|
|
duplicateSerialNumber = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("ignoreBatchComplete (int): "));
|
|
ignoreBatchComplete = Int32.Parse(getInput());
|
|
|
|
// call imsapi function
|
|
result = imsapi.batchMergeBatch(sessionContext, stationNumber, serialNumberRef, serialNumberPos, batchNumber, processLayer, usedBatchQuantity, duplicateSerialNumber, ignoreBatchComplete);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_batchGetRegisteredBatch
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "batchGetRegisteredBatch"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in int processLayer
|
|
/// in String[] batchResultKeys
|
|
/// out String[] batchResultValues
|
|
/// </para>
|
|
public static void test_batchGetRegisteredBatch()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
int processLayer = 0;
|
|
String[] batchResultKeys = null;
|
|
String[] batchResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("processLayer (int): "));
|
|
processLayer = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("Enter size for batchResultKeys: "));
|
|
int batchResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
batchResultKeys = new String[batchResultKeysSize];
|
|
for (int i=0; i<batchResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("batchResultKeys[" + i + "] (String): "));
|
|
batchResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.batchGetRegisteredBatch(sessionContext, stationNumber, processLayer, batchResultKeys, out batchResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; batchResultValues != null && i<batchResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("batchResultValues[" + i + "]: ") + "<" + batchResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_batchGetBatchInfo
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "batchGetBatchInfo"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] batchInfoFilter
|
|
/// in String[] batchInfoResultKeys
|
|
/// out String[] batchInfoResultValues
|
|
/// </para>
|
|
public static void test_batchGetBatchInfo()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] batchInfoFilter = null;
|
|
String[] batchInfoResultKeys = null;
|
|
String[] batchInfoResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for batchInfoFilter: "));
|
|
int batchInfoFilterSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
batchInfoFilter = new KeyValue[batchInfoFilterSize];
|
|
for (int i=0; i<batchInfoFilterSize; i++)
|
|
{
|
|
batchInfoFilter[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("batchInfoFilter[" + i + "] .key (String): "));
|
|
batchInfoFilter[i].key = getInput();
|
|
Console.Write(fillWithSpace("batchInfoFilter[" + i + "] .value (String): "));
|
|
batchInfoFilter[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for batchInfoResultKeys: "));
|
|
int batchInfoResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
batchInfoResultKeys = new String[batchInfoResultKeysSize];
|
|
for (int i=0; i<batchInfoResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("batchInfoResultKeys[" + i + "] (String): "));
|
|
batchInfoResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.batchGetBatchInfo(sessionContext, stationNumber, batchInfoFilter, batchInfoResultKeys, out batchInfoResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; batchInfoResultValues != null && i<batchInfoResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("batchInfoResultValues[" + i + "]: ") + "<" + batchInfoResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_batchUnregBatch
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "batchUnregBatch"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] batchUploadKeyValues
|
|
/// </para>
|
|
public static void test_batchUnregBatch()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] batchUploadKeyValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for batchUploadKeyValues: "));
|
|
int batchUploadKeyValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
batchUploadKeyValues = new KeyValue[batchUploadKeyValuesSize];
|
|
for (int i=0; i<batchUploadKeyValuesSize; i++)
|
|
{
|
|
batchUploadKeyValues[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("batchUploadKeyValues[" + i + "] .key (String): "));
|
|
batchUploadKeyValues[i].key = getInput();
|
|
Console.Write(fillWithSpace("batchUploadKeyValues[" + i + "] .value (String): "));
|
|
batchUploadKeyValues[i].value = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.batchUnregBatch(sessionContext, stationNumber, batchUploadKeyValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_configCreateParameters
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "configCreateParameters"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in KeyValue[] options
|
|
/// in String[] parameterUploadKeys
|
|
/// in String[] parameterUploadValues
|
|
/// in String[] parameterResultKeys
|
|
/// out String[] parameterResultValues
|
|
/// </para>
|
|
public static void test_configCreateParameters()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
KeyValue[] options = null;
|
|
String[] parameterUploadKeys = null;
|
|
String[] parameterUploadValues = null;
|
|
String[] parameterResultKeys = null;
|
|
String[] parameterResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("Enter size for options: "));
|
|
int optionsSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
options = new KeyValue[optionsSize];
|
|
for (int i=0; i<optionsSize; i++)
|
|
{
|
|
options[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("options[" + i + "] .key (String): "));
|
|
options[i].key = getInput();
|
|
Console.Write(fillWithSpace("options[" + i + "] .value (String): "));
|
|
options[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for parameterUploadKeys: "));
|
|
int parameterUploadKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
parameterUploadKeys = new String[parameterUploadKeysSize];
|
|
for (int i=0; i<parameterUploadKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("parameterUploadKeys[" + i + "] (String): "));
|
|
parameterUploadKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for parameterUploadValues: "));
|
|
int parameterUploadValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
parameterUploadValues = new String[parameterUploadValuesSize];
|
|
for (int i=0; i<parameterUploadValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("parameterUploadValues[" + i + "] (String): "));
|
|
parameterUploadValues[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for parameterResultKeys: "));
|
|
int parameterResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
parameterResultKeys = new String[parameterResultKeysSize];
|
|
for (int i=0; i<parameterResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("parameterResultKeys[" + i + "] (String): "));
|
|
parameterResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.configCreateParameters(sessionContext, options, parameterUploadKeys, parameterUploadValues, parameterResultKeys, out parameterResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; parameterResultValues != null && i<parameterResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("parameterResultValues[" + i + "]: ") + "<" + parameterResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_configUpdateParameters
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "configUpdateParameters"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in KeyValue[] options
|
|
/// in String[] parameterUploadKeys
|
|
/// in String[] parameterUploadValues
|
|
/// in String[] parameterResultKeys
|
|
/// out String[] parameterResultValues
|
|
/// </para>
|
|
public static void test_configUpdateParameters()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
KeyValue[] options = null;
|
|
String[] parameterUploadKeys = null;
|
|
String[] parameterUploadValues = null;
|
|
String[] parameterResultKeys = null;
|
|
String[] parameterResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("Enter size for options: "));
|
|
int optionsSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
options = new KeyValue[optionsSize];
|
|
for (int i=0; i<optionsSize; i++)
|
|
{
|
|
options[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("options[" + i + "] .key (String): "));
|
|
options[i].key = getInput();
|
|
Console.Write(fillWithSpace("options[" + i + "] .value (String): "));
|
|
options[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for parameterUploadKeys: "));
|
|
int parameterUploadKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
parameterUploadKeys = new String[parameterUploadKeysSize];
|
|
for (int i=0; i<parameterUploadKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("parameterUploadKeys[" + i + "] (String): "));
|
|
parameterUploadKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for parameterUploadValues: "));
|
|
int parameterUploadValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
parameterUploadValues = new String[parameterUploadValuesSize];
|
|
for (int i=0; i<parameterUploadValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("parameterUploadValues[" + i + "] (String): "));
|
|
parameterUploadValues[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for parameterResultKeys: "));
|
|
int parameterResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
parameterResultKeys = new String[parameterResultKeysSize];
|
|
for (int i=0; i<parameterResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("parameterResultKeys[" + i + "] (String): "));
|
|
parameterResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.configUpdateParameters(sessionContext, options, parameterUploadKeys, parameterUploadValues, parameterResultKeys, out parameterResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; parameterResultValues != null && i<parameterResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("parameterResultValues[" + i + "]: ") + "<" + parameterResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_configGetParameters
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "configGetParameters"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in KeyValue[] options
|
|
/// in KeyValue[] parameterFilter
|
|
/// in String[] parameterResultKeys
|
|
/// out String[] parameterResultValues
|
|
/// </para>
|
|
public static void test_configGetParameters()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
KeyValue[] options = null;
|
|
KeyValue[] parameterFilter = null;
|
|
String[] parameterResultKeys = null;
|
|
String[] parameterResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("Enter size for options: "));
|
|
int optionsSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
options = new KeyValue[optionsSize];
|
|
for (int i=0; i<optionsSize; i++)
|
|
{
|
|
options[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("options[" + i + "] .key (String): "));
|
|
options[i].key = getInput();
|
|
Console.Write(fillWithSpace("options[" + i + "] .value (String): "));
|
|
options[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for parameterFilter: "));
|
|
int parameterFilterSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
parameterFilter = new KeyValue[parameterFilterSize];
|
|
for (int i=0; i<parameterFilterSize; i++)
|
|
{
|
|
parameterFilter[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("parameterFilter[" + i + "] .key (String): "));
|
|
parameterFilter[i].key = getInput();
|
|
Console.Write(fillWithSpace("parameterFilter[" + i + "] .value (String): "));
|
|
parameterFilter[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for parameterResultKeys: "));
|
|
int parameterResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
parameterResultKeys = new String[parameterResultKeysSize];
|
|
for (int i=0; i<parameterResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("parameterResultKeys[" + i + "] (String): "));
|
|
parameterResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.configGetParameters(sessionContext, options, parameterFilter, parameterResultKeys, out parameterResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; parameterResultValues != null && i<parameterResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("parameterResultValues[" + i + "]: ") + "<" + parameterResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_configDeleteParameters
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "configDeleteParameters"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in KeyValue[] options
|
|
/// in KeyValue[] parameterFilter
|
|
/// in String[] parameterResultKeys
|
|
/// out String[] parameterResultValues
|
|
/// </para>
|
|
public static void test_configDeleteParameters()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
KeyValue[] options = null;
|
|
KeyValue[] parameterFilter = null;
|
|
String[] parameterResultKeys = null;
|
|
String[] parameterResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("Enter size for options: "));
|
|
int optionsSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
options = new KeyValue[optionsSize];
|
|
for (int i=0; i<optionsSize; i++)
|
|
{
|
|
options[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("options[" + i + "] .key (String): "));
|
|
options[i].key = getInput();
|
|
Console.Write(fillWithSpace("options[" + i + "] .value (String): "));
|
|
options[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for parameterFilter: "));
|
|
int parameterFilterSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
parameterFilter = new KeyValue[parameterFilterSize];
|
|
for (int i=0; i<parameterFilterSize; i++)
|
|
{
|
|
parameterFilter[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("parameterFilter[" + i + "] .key (String): "));
|
|
parameterFilter[i].key = getInput();
|
|
Console.Write(fillWithSpace("parameterFilter[" + i + "] .value (String): "));
|
|
parameterFilter[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for parameterResultKeys: "));
|
|
int parameterResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
parameterResultKeys = new String[parameterResultKeysSize];
|
|
for (int i=0; i<parameterResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("parameterResultKeys[" + i + "] (String): "));
|
|
parameterResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.configDeleteParameters(sessionContext, options, parameterFilter, parameterResultKeys, out parameterResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; parameterResultValues != null && i<parameterResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("parameterResultValues[" + i + "]: ") + "<" + parameterResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_configGetValues
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "configGetValues"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in KeyValue[] options
|
|
/// in KeyValue[] configContext
|
|
/// in KeyValue[] parameterFilter
|
|
/// in String[] parameterResultKeys
|
|
/// out String[] parameterResultValues
|
|
/// in String[] resultKeys
|
|
/// out String[] resultValues
|
|
/// </para>
|
|
public static void test_configGetValues()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
KeyValue[] options = null;
|
|
KeyValue[] configContext = null;
|
|
KeyValue[] parameterFilter = null;
|
|
String[] parameterResultKeys = null;
|
|
String[] parameterResultValues = null;
|
|
String[] resultKeys = null;
|
|
String[] resultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("Enter size for options: "));
|
|
int optionsSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
options = new KeyValue[optionsSize];
|
|
for (int i=0; i<optionsSize; i++)
|
|
{
|
|
options[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("options[" + i + "] .key (String): "));
|
|
options[i].key = getInput();
|
|
Console.Write(fillWithSpace("options[" + i + "] .value (String): "));
|
|
options[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for configContext: "));
|
|
int configContextSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
configContext = new KeyValue[configContextSize];
|
|
for (int i=0; i<configContextSize; i++)
|
|
{
|
|
configContext[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("configContext[" + i + "] .key (String): "));
|
|
configContext[i].key = getInput();
|
|
Console.Write(fillWithSpace("configContext[" + i + "] .value (String): "));
|
|
configContext[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for parameterFilter: "));
|
|
int parameterFilterSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
parameterFilter = new KeyValue[parameterFilterSize];
|
|
for (int i=0; i<parameterFilterSize; i++)
|
|
{
|
|
parameterFilter[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("parameterFilter[" + i + "] .key (String): "));
|
|
parameterFilter[i].key = getInput();
|
|
Console.Write(fillWithSpace("parameterFilter[" + i + "] .value (String): "));
|
|
parameterFilter[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for parameterResultKeys: "));
|
|
int parameterResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
parameterResultKeys = new String[parameterResultKeysSize];
|
|
for (int i=0; i<parameterResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("parameterResultKeys[" + i + "] (String): "));
|
|
parameterResultKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for resultKeys: "));
|
|
int resultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
resultKeys = new String[resultKeysSize];
|
|
for (int i=0; i<resultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("resultKeys[" + i + "] (String): "));
|
|
resultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.configGetValues(sessionContext, options, configContext, parameterFilter, parameterResultKeys, out parameterResultValues, resultKeys, out resultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; parameterResultValues != null && i<parameterResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("parameterResultValues[" + i + "]: ") + "<" + parameterResultValues[i] + ">");
|
|
}
|
|
for (int i=0; resultValues != null && i<resultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("resultValues[" + i + "]: ") + "<" + resultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_configUpdateValues
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "configUpdateValues"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in KeyValue[] options
|
|
/// in KeyValue[] configContext
|
|
/// in String[] uploadKeys
|
|
/// in String[] uploadValues
|
|
/// in String[] resultKeys
|
|
/// out String[] resultValues
|
|
/// </para>
|
|
public static void test_configUpdateValues()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
KeyValue[] options = null;
|
|
KeyValue[] configContext = null;
|
|
String[] uploadKeys = null;
|
|
String[] uploadValues = null;
|
|
String[] resultKeys = null;
|
|
String[] resultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("Enter size for options: "));
|
|
int optionsSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
options = new KeyValue[optionsSize];
|
|
for (int i=0; i<optionsSize; i++)
|
|
{
|
|
options[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("options[" + i + "] .key (String): "));
|
|
options[i].key = getInput();
|
|
Console.Write(fillWithSpace("options[" + i + "] .value (String): "));
|
|
options[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for configContext: "));
|
|
int configContextSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
configContext = new KeyValue[configContextSize];
|
|
for (int i=0; i<configContextSize; i++)
|
|
{
|
|
configContext[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("configContext[" + i + "] .key (String): "));
|
|
configContext[i].key = getInput();
|
|
Console.Write(fillWithSpace("configContext[" + i + "] .value (String): "));
|
|
configContext[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for uploadKeys: "));
|
|
int uploadKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
uploadKeys = new String[uploadKeysSize];
|
|
for (int i=0; i<uploadKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("uploadKeys[" + i + "] (String): "));
|
|
uploadKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for uploadValues: "));
|
|
int uploadValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
uploadValues = new String[uploadValuesSize];
|
|
for (int i=0; i<uploadValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("uploadValues[" + i + "] (String): "));
|
|
uploadValues[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for resultKeys: "));
|
|
int resultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
resultKeys = new String[resultKeysSize];
|
|
for (int i=0; i<resultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("resultKeys[" + i + "] (String): "));
|
|
resultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.configUpdateValues(sessionContext, options, configContext, uploadKeys, uploadValues, resultKeys, out resultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; resultValues != null && i<resultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("resultValues[" + i + "]: ") + "<" + resultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_configDeleteValues
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "configDeleteValues"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in KeyValue[] options
|
|
/// in KeyValue[] configContext
|
|
/// in String[] uploadKeys
|
|
/// in String[] uploadValues
|
|
/// in String[] resultKeys
|
|
/// out String[] resultValues
|
|
/// </para>
|
|
public static void test_configDeleteValues()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
KeyValue[] options = null;
|
|
KeyValue[] configContext = null;
|
|
String[] uploadKeys = null;
|
|
String[] uploadValues = null;
|
|
String[] resultKeys = null;
|
|
String[] resultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("Enter size for options: "));
|
|
int optionsSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
options = new KeyValue[optionsSize];
|
|
for (int i=0; i<optionsSize; i++)
|
|
{
|
|
options[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("options[" + i + "] .key (String): "));
|
|
options[i].key = getInput();
|
|
Console.Write(fillWithSpace("options[" + i + "] .value (String): "));
|
|
options[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for configContext: "));
|
|
int configContextSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
configContext = new KeyValue[configContextSize];
|
|
for (int i=0; i<configContextSize; i++)
|
|
{
|
|
configContext[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("configContext[" + i + "] .key (String): "));
|
|
configContext[i].key = getInput();
|
|
Console.Write(fillWithSpace("configContext[" + i + "] .value (String): "));
|
|
configContext[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for uploadKeys: "));
|
|
int uploadKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
uploadKeys = new String[uploadKeysSize];
|
|
for (int i=0; i<uploadKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("uploadKeys[" + i + "] (String): "));
|
|
uploadKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for uploadValues: "));
|
|
int uploadValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
uploadValues = new String[uploadValuesSize];
|
|
for (int i=0; i<uploadValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("uploadValues[" + i + "] (String): "));
|
|
uploadValues[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for resultKeys: "));
|
|
int resultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
resultKeys = new String[resultKeysSize];
|
|
for (int i=0; i<resultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("resultKeys[" + i + "] (String): "));
|
|
resultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.configDeleteValues(sessionContext, options, configContext, uploadKeys, uploadValues, resultKeys, out resultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; resultValues != null && i<resultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("resultValues[" + i + "]: ") + "<" + resultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_configGetDimensionValues
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "configGetDimensionValues"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in KeyValue[] options
|
|
/// in KeyValue[] dimensionFilter
|
|
/// out String[] resultValues
|
|
/// </para>
|
|
public static void test_configGetDimensionValues()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
KeyValue[] options = null;
|
|
KeyValue[] dimensionFilter = null;
|
|
String[] resultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("Enter size for options: "));
|
|
int optionsSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
options = new KeyValue[optionsSize];
|
|
for (int i=0; i<optionsSize; i++)
|
|
{
|
|
options[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("options[" + i + "] .key (String): "));
|
|
options[i].key = getInput();
|
|
Console.Write(fillWithSpace("options[" + i + "] .value (String): "));
|
|
options[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for dimensionFilter: "));
|
|
int dimensionFilterSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
dimensionFilter = new KeyValue[dimensionFilterSize];
|
|
for (int i=0; i<dimensionFilterSize; i++)
|
|
{
|
|
dimensionFilter[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("dimensionFilter[" + i + "] .key (String): "));
|
|
dimensionFilter[i].key = getInput();
|
|
Console.Write(fillWithSpace("dimensionFilter[" + i + "] .value (String): "));
|
|
dimensionFilter[i].value = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.configGetDimensionValues(sessionContext, options, dimensionFilter, out resultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; resultValues != null && i<resultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("resultValues[" + i + "]: ") + "<" + resultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_customFunction
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "customFunction"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String methodName
|
|
/// in String[] inArgs
|
|
/// out String[] outArgs
|
|
/// out String customErrorString
|
|
/// </para>
|
|
public static void test_customFunction()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String methodName = "";
|
|
String[] inArgs = null;
|
|
String[] outArgs = null;
|
|
String customErrorString = "";
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("methodName (String): "));
|
|
methodName = getInput();
|
|
Console.Write(fillWithSpace("Enter size for inArgs: "));
|
|
int inArgsSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
inArgs = new String[inArgsSize];
|
|
for (int i=0; i<inArgsSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("inArgs[" + i + "] (String): "));
|
|
inArgs[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.customFunction(sessionContext, methodName, inArgs, out outArgs, out customErrorString);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; outArgs != null && i<outArgs.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("outArgs[" + i + "]: ") + "<" + outArgs[i] + ">");
|
|
}
|
|
Console.WriteLine(fillWithSpace("customErrorString: ") + "<" + customErrorString + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_customGetDbObjectMetaData
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "customGetDbObjectMetaData"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] dbObjectFilterKeyValues
|
|
/// in String[] dbColumnMetaDataResultKeys
|
|
/// out String[] dbColumnMetaDataResultValues
|
|
/// </para>
|
|
public static void test_customGetDbObjectMetaData()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] dbObjectFilterKeyValues = null;
|
|
String[] dbColumnMetaDataResultKeys = null;
|
|
String[] dbColumnMetaDataResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for dbObjectFilterKeyValues: "));
|
|
int dbObjectFilterKeyValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
dbObjectFilterKeyValues = new KeyValue[dbObjectFilterKeyValuesSize];
|
|
for (int i=0; i<dbObjectFilterKeyValuesSize; i++)
|
|
{
|
|
dbObjectFilterKeyValues[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("dbObjectFilterKeyValues[" + i + "] .key (String): "));
|
|
dbObjectFilterKeyValues[i].key = getInput();
|
|
Console.Write(fillWithSpace("dbObjectFilterKeyValues[" + i + "] .value (String): "));
|
|
dbObjectFilterKeyValues[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for dbColumnMetaDataResultKeys: "));
|
|
int dbColumnMetaDataResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
dbColumnMetaDataResultKeys = new String[dbColumnMetaDataResultKeysSize];
|
|
for (int i=0; i<dbColumnMetaDataResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("dbColumnMetaDataResultKeys[" + i + "] (String): "));
|
|
dbColumnMetaDataResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.customGetDbObjectMetaData(sessionContext, stationNumber, dbObjectFilterKeyValues, dbColumnMetaDataResultKeys, out dbColumnMetaDataResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; dbColumnMetaDataResultValues != null && i<dbColumnMetaDataResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("dbColumnMetaDataResultValues[" + i + "]: ") + "<" + dbColumnMetaDataResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_customGetDbObjectData
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "customGetDbObjectData"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] dbObjectSearchKeyValues
|
|
/// in String[] dbColumnFilterKeys
|
|
/// in String[] dbColumnFilterValues
|
|
/// in String[] dbColumnOrderKeys
|
|
/// in String[] dbColumnOrderValues
|
|
/// in String[] dbColumnResultKeys
|
|
/// out String[] dbColumnResultValues
|
|
/// </para>
|
|
public static void test_customGetDbObjectData()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] dbObjectSearchKeyValues = null;
|
|
String[] dbColumnFilterKeys = null;
|
|
String[] dbColumnFilterValues = null;
|
|
String[] dbColumnOrderKeys = null;
|
|
String[] dbColumnOrderValues = null;
|
|
String[] dbColumnResultKeys = null;
|
|
String[] dbColumnResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for dbObjectSearchKeyValues: "));
|
|
int dbObjectSearchKeyValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
dbObjectSearchKeyValues = new KeyValue[dbObjectSearchKeyValuesSize];
|
|
for (int i=0; i<dbObjectSearchKeyValuesSize; i++)
|
|
{
|
|
dbObjectSearchKeyValues[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("dbObjectSearchKeyValues[" + i + "] .key (String): "));
|
|
dbObjectSearchKeyValues[i].key = getInput();
|
|
Console.Write(fillWithSpace("dbObjectSearchKeyValues[" + i + "] .value (String): "));
|
|
dbObjectSearchKeyValues[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for dbColumnFilterKeys: "));
|
|
int dbColumnFilterKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
dbColumnFilterKeys = new String[dbColumnFilterKeysSize];
|
|
for (int i=0; i<dbColumnFilterKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("dbColumnFilterKeys[" + i + "] (String): "));
|
|
dbColumnFilterKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for dbColumnFilterValues: "));
|
|
int dbColumnFilterValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
dbColumnFilterValues = new String[dbColumnFilterValuesSize];
|
|
for (int i=0; i<dbColumnFilterValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("dbColumnFilterValues[" + i + "] (String): "));
|
|
dbColumnFilterValues[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for dbColumnOrderKeys: "));
|
|
int dbColumnOrderKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
dbColumnOrderKeys = new String[dbColumnOrderKeysSize];
|
|
for (int i=0; i<dbColumnOrderKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("dbColumnOrderKeys[" + i + "] (String): "));
|
|
dbColumnOrderKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for dbColumnOrderValues: "));
|
|
int dbColumnOrderValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
dbColumnOrderValues = new String[dbColumnOrderValuesSize];
|
|
for (int i=0; i<dbColumnOrderValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("dbColumnOrderValues[" + i + "] (String): "));
|
|
dbColumnOrderValues[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for dbColumnResultKeys: "));
|
|
int dbColumnResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
dbColumnResultKeys = new String[dbColumnResultKeysSize];
|
|
for (int i=0; i<dbColumnResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("dbColumnResultKeys[" + i + "] (String): "));
|
|
dbColumnResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.customGetDbObjectData(sessionContext, stationNumber, dbObjectSearchKeyValues, dbColumnFilterKeys, dbColumnFilterValues, dbColumnOrderKeys, dbColumnOrderValues, dbColumnResultKeys, out dbColumnResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; dbColumnResultValues != null && i<dbColumnResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("dbColumnResultValues[" + i + "]: ") + "<" + dbColumnResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_customModifyDbObjectData
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "customModifyDbObjectData"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] dbObjectModifyKeyValues
|
|
/// in String[] dbColumnInsertKeys
|
|
/// in String[] dbColumnInsertValues
|
|
/// in String[] dbColumnInsertResultKeys
|
|
/// in String[] dbColumnUpdateKeys
|
|
/// in String[] dbColumnUpdateValues
|
|
/// in String[] dbColumnUpdateResultKeys
|
|
/// in String[] dbRowDeleteFilterKeys
|
|
/// in String[] dbRowDeleteFilterValues
|
|
/// out String[] dbColumnInsertResultValues
|
|
/// out String[] dbColumnUpdateResultValues
|
|
/// out String[] dbColumnDeleteResultValues
|
|
/// </para>
|
|
public static void test_customModifyDbObjectData()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] dbObjectModifyKeyValues = null;
|
|
String[] dbColumnInsertKeys = null;
|
|
String[] dbColumnInsertValues = null;
|
|
String[] dbColumnInsertResultKeys = null;
|
|
String[] dbColumnUpdateKeys = null;
|
|
String[] dbColumnUpdateValues = null;
|
|
String[] dbColumnUpdateResultKeys = null;
|
|
String[] dbRowDeleteFilterKeys = null;
|
|
String[] dbRowDeleteFilterValues = null;
|
|
String[] dbColumnInsertResultValues = null;
|
|
String[] dbColumnUpdateResultValues = null;
|
|
String[] dbColumnDeleteResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for dbObjectModifyKeyValues: "));
|
|
int dbObjectModifyKeyValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
dbObjectModifyKeyValues = new KeyValue[dbObjectModifyKeyValuesSize];
|
|
for (int i=0; i<dbObjectModifyKeyValuesSize; i++)
|
|
{
|
|
dbObjectModifyKeyValues[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("dbObjectModifyKeyValues[" + i + "] .key (String): "));
|
|
dbObjectModifyKeyValues[i].key = getInput();
|
|
Console.Write(fillWithSpace("dbObjectModifyKeyValues[" + i + "] .value (String): "));
|
|
dbObjectModifyKeyValues[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for dbColumnInsertKeys: "));
|
|
int dbColumnInsertKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
dbColumnInsertKeys = new String[dbColumnInsertKeysSize];
|
|
for (int i=0; i<dbColumnInsertKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("dbColumnInsertKeys[" + i + "] (String): "));
|
|
dbColumnInsertKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for dbColumnInsertValues: "));
|
|
int dbColumnInsertValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
dbColumnInsertValues = new String[dbColumnInsertValuesSize];
|
|
for (int i=0; i<dbColumnInsertValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("dbColumnInsertValues[" + i + "] (String): "));
|
|
dbColumnInsertValues[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for dbColumnInsertResultKeys: "));
|
|
int dbColumnInsertResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
dbColumnInsertResultKeys = new String[dbColumnInsertResultKeysSize];
|
|
for (int i=0; i<dbColumnInsertResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("dbColumnInsertResultKeys[" + i + "] (String): "));
|
|
dbColumnInsertResultKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for dbColumnUpdateKeys: "));
|
|
int dbColumnUpdateKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
dbColumnUpdateKeys = new String[dbColumnUpdateKeysSize];
|
|
for (int i=0; i<dbColumnUpdateKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("dbColumnUpdateKeys[" + i + "] (String): "));
|
|
dbColumnUpdateKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for dbColumnUpdateValues: "));
|
|
int dbColumnUpdateValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
dbColumnUpdateValues = new String[dbColumnUpdateValuesSize];
|
|
for (int i=0; i<dbColumnUpdateValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("dbColumnUpdateValues[" + i + "] (String): "));
|
|
dbColumnUpdateValues[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for dbColumnUpdateResultKeys: "));
|
|
int dbColumnUpdateResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
dbColumnUpdateResultKeys = new String[dbColumnUpdateResultKeysSize];
|
|
for (int i=0; i<dbColumnUpdateResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("dbColumnUpdateResultKeys[" + i + "] (String): "));
|
|
dbColumnUpdateResultKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for dbRowDeleteFilterKeys: "));
|
|
int dbRowDeleteFilterKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
dbRowDeleteFilterKeys = new String[dbRowDeleteFilterKeysSize];
|
|
for (int i=0; i<dbRowDeleteFilterKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("dbRowDeleteFilterKeys[" + i + "] (String): "));
|
|
dbRowDeleteFilterKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for dbRowDeleteFilterValues: "));
|
|
int dbRowDeleteFilterValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
dbRowDeleteFilterValues = new String[dbRowDeleteFilterValuesSize];
|
|
for (int i=0; i<dbRowDeleteFilterValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("dbRowDeleteFilterValues[" + i + "] (String): "));
|
|
dbRowDeleteFilterValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.customModifyDbObjectData(sessionContext, stationNumber, dbObjectModifyKeyValues, dbColumnInsertKeys, dbColumnInsertValues, dbColumnInsertResultKeys, dbColumnUpdateKeys, dbColumnUpdateValues, dbColumnUpdateResultKeys, dbRowDeleteFilterKeys, dbRowDeleteFilterValues, out dbColumnInsertResultValues, out dbColumnUpdateResultValues, out dbColumnDeleteResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; dbColumnInsertResultValues != null && i<dbColumnInsertResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("dbColumnInsertResultValues[" + i + "]: ") + "<" + dbColumnInsertResultValues[i] + ">");
|
|
}
|
|
for (int i=0; dbColumnUpdateResultValues != null && i<dbColumnUpdateResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("dbColumnUpdateResultValues[" + i + "]: ") + "<" + dbColumnUpdateResultValues[i] + ">");
|
|
}
|
|
for (int i=0; dbColumnDeleteResultValues != null && i<dbColumnDeleteResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("dbColumnDeleteResultValues[" + i + "]: ") + "<" + dbColumnDeleteResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_customGetFunctionInfo
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "customGetFunctionInfo"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in KeyValue[] functionInfoFilterKeyValues
|
|
/// in String[] functionInfoResultKeys
|
|
/// out String[] functionInfoResultValues
|
|
/// in String[] parameterInfoResultKeys
|
|
/// out String[] parameterInfoResultValues
|
|
/// in String[] returnInfoResultKeys
|
|
/// out String[] returnInfoResultValues
|
|
/// in String[] errorCodeResultKeys
|
|
/// out String[] errorCodeResultValues
|
|
/// </para>
|
|
public static void test_customGetFunctionInfo()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
KeyValue[] functionInfoFilterKeyValues = null;
|
|
String[] functionInfoResultKeys = null;
|
|
String[] functionInfoResultValues = null;
|
|
String[] parameterInfoResultKeys = null;
|
|
String[] parameterInfoResultValues = null;
|
|
String[] returnInfoResultKeys = null;
|
|
String[] returnInfoResultValues = null;
|
|
String[] errorCodeResultKeys = null;
|
|
String[] errorCodeResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("Enter size for functionInfoFilterKeyValues: "));
|
|
int functionInfoFilterKeyValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
functionInfoFilterKeyValues = new KeyValue[functionInfoFilterKeyValuesSize];
|
|
for (int i=0; i<functionInfoFilterKeyValuesSize; i++)
|
|
{
|
|
functionInfoFilterKeyValues[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("functionInfoFilterKeyValues[" + i + "] .key (String): "));
|
|
functionInfoFilterKeyValues[i].key = getInput();
|
|
Console.Write(fillWithSpace("functionInfoFilterKeyValues[" + i + "] .value (String): "));
|
|
functionInfoFilterKeyValues[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for functionInfoResultKeys: "));
|
|
int functionInfoResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
functionInfoResultKeys = new String[functionInfoResultKeysSize];
|
|
for (int i=0; i<functionInfoResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("functionInfoResultKeys[" + i + "] (String): "));
|
|
functionInfoResultKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for parameterInfoResultKeys: "));
|
|
int parameterInfoResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
parameterInfoResultKeys = new String[parameterInfoResultKeysSize];
|
|
for (int i=0; i<parameterInfoResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("parameterInfoResultKeys[" + i + "] (String): "));
|
|
parameterInfoResultKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for returnInfoResultKeys: "));
|
|
int returnInfoResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
returnInfoResultKeys = new String[returnInfoResultKeysSize];
|
|
for (int i=0; i<returnInfoResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("returnInfoResultKeys[" + i + "] (String): "));
|
|
returnInfoResultKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for errorCodeResultKeys: "));
|
|
int errorCodeResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
errorCodeResultKeys = new String[errorCodeResultKeysSize];
|
|
for (int i=0; i<errorCodeResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("errorCodeResultKeys[" + i + "] (String): "));
|
|
errorCodeResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.customGetFunctionInfo(sessionContext, functionInfoFilterKeyValues, functionInfoResultKeys, out functionInfoResultValues, parameterInfoResultKeys, out parameterInfoResultValues, returnInfoResultKeys, out returnInfoResultValues, errorCodeResultKeys, out errorCodeResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; functionInfoResultValues != null && i<functionInfoResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("functionInfoResultValues[" + i + "]: ") + "<" + functionInfoResultValues[i] + ">");
|
|
}
|
|
for (int i=0; parameterInfoResultValues != null && i<parameterInfoResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("parameterInfoResultValues[" + i + "]: ") + "<" + parameterInfoResultValues[i] + ">");
|
|
}
|
|
for (int i=0; returnInfoResultValues != null && i<returnInfoResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("returnInfoResultValues[" + i + "]: ") + "<" + returnInfoResultValues[i] + ">");
|
|
}
|
|
for (int i=0; errorCodeResultValues != null && i<errorCodeResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("errorCodeResultValues[" + i + "]: ") + "<" + errorCodeResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_customGetFunctions
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "customGetFunctions"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in KeyValue[] functionFilterKeyValues
|
|
/// in String[] functionInfoResultKeys
|
|
/// out String[] functionInfoResultValues
|
|
/// </para>
|
|
public static void test_customGetFunctions()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
KeyValue[] functionFilterKeyValues = null;
|
|
String[] functionInfoResultKeys = null;
|
|
String[] functionInfoResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("Enter size for functionFilterKeyValues: "));
|
|
int functionFilterKeyValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
functionFilterKeyValues = new KeyValue[functionFilterKeyValuesSize];
|
|
for (int i=0; i<functionFilterKeyValuesSize; i++)
|
|
{
|
|
functionFilterKeyValues[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("functionFilterKeyValues[" + i + "] .key (String): "));
|
|
functionFilterKeyValues[i].key = getInput();
|
|
Console.Write(fillWithSpace("functionFilterKeyValues[" + i + "] .value (String): "));
|
|
functionFilterKeyValues[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for functionInfoResultKeys: "));
|
|
int functionInfoResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
functionInfoResultKeys = new String[functionInfoResultKeysSize];
|
|
for (int i=0; i<functionInfoResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("functionInfoResultKeys[" + i + "] (String): "));
|
|
functionInfoResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.customGetFunctions(sessionContext, functionFilterKeyValues, functionInfoResultKeys, out functionInfoResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; functionInfoResultValues != null && i<functionInfoResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("functionInfoResultValues[" + i + "]: ") + "<" + functionInfoResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_edaGetNextFreeExternalData
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "edaGetNextFreeExternalData"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in int objectType
|
|
/// in String objectNumber
|
|
/// in String objectDetail
|
|
/// in int functionMode
|
|
/// in String[] nextFreeExternalDataFilterKeys
|
|
/// in String[] nextFreeExternalDataFilterValues
|
|
/// in String[] nextFreeExternalDataResultKeys
|
|
/// out String[] nextFreeExternalDataResultValues
|
|
/// </para>
|
|
public static void test_edaGetNextFreeExternalData()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
int objectType = 0;
|
|
String objectNumber = "";
|
|
String objectDetail = "";
|
|
int functionMode = 0;
|
|
String[] nextFreeExternalDataFilterKeys = null;
|
|
String[] nextFreeExternalDataFilterValues = null;
|
|
String[] nextFreeExternalDataResultKeys = null;
|
|
String[] nextFreeExternalDataResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("objectType (int): "));
|
|
objectType = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("objectNumber (String): "));
|
|
objectNumber = getInput();
|
|
Console.Write(fillWithSpace("objectDetail (String): "));
|
|
objectDetail = getInput();
|
|
Console.Write(fillWithSpace("functionMode (int): "));
|
|
functionMode = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("Enter size for nextFreeExternalDataFilterKeys: "));
|
|
int nextFreeExternalDataFilterKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
nextFreeExternalDataFilterKeys = new String[nextFreeExternalDataFilterKeysSize];
|
|
for (int i=0; i<nextFreeExternalDataFilterKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("nextFreeExternalDataFilterKeys[" + i + "] (String): "));
|
|
nextFreeExternalDataFilterKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for nextFreeExternalDataFilterValues: "));
|
|
int nextFreeExternalDataFilterValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
nextFreeExternalDataFilterValues = new String[nextFreeExternalDataFilterValuesSize];
|
|
for (int i=0; i<nextFreeExternalDataFilterValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("nextFreeExternalDataFilterValues[" + i + "] (String): "));
|
|
nextFreeExternalDataFilterValues[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for nextFreeExternalDataResultKeys: "));
|
|
int nextFreeExternalDataResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
nextFreeExternalDataResultKeys = new String[nextFreeExternalDataResultKeysSize];
|
|
for (int i=0; i<nextFreeExternalDataResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("nextFreeExternalDataResultKeys[" + i + "] (String): "));
|
|
nextFreeExternalDataResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.edaGetNextFreeExternalData(sessionContext, stationNumber, objectType, objectNumber, objectDetail, functionMode, nextFreeExternalDataFilterKeys, nextFreeExternalDataFilterValues, nextFreeExternalDataResultKeys, out nextFreeExternalDataResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; nextFreeExternalDataResultValues != null && i<nextFreeExternalDataResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("nextFreeExternalDataResultValues[" + i + "]: ") + "<" + nextFreeExternalDataResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_edaAssignExternalData
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "edaAssignExternalData"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in int objectType
|
|
/// in String objectNumber
|
|
/// in String objectDetail
|
|
/// in String[] assignExternalDataUploadKeys
|
|
/// in String[] assignExternalDataUploadValues
|
|
/// </para>
|
|
public static void test_edaAssignExternalData()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
int objectType = 0;
|
|
String objectNumber = "";
|
|
String objectDetail = "";
|
|
String[] assignExternalDataUploadKeys = null;
|
|
String[] assignExternalDataUploadValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("objectType (int): "));
|
|
objectType = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("objectNumber (String): "));
|
|
objectNumber = getInput();
|
|
Console.Write(fillWithSpace("objectDetail (String): "));
|
|
objectDetail = getInput();
|
|
Console.Write(fillWithSpace("Enter size for assignExternalDataUploadKeys: "));
|
|
int assignExternalDataUploadKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
assignExternalDataUploadKeys = new String[assignExternalDataUploadKeysSize];
|
|
for (int i=0; i<assignExternalDataUploadKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("assignExternalDataUploadKeys[" + i + "] (String): "));
|
|
assignExternalDataUploadKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for assignExternalDataUploadValues: "));
|
|
int assignExternalDataUploadValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
assignExternalDataUploadValues = new String[assignExternalDataUploadValuesSize];
|
|
for (int i=0; i<assignExternalDataUploadValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("assignExternalDataUploadValues[" + i + "] (String): "));
|
|
assignExternalDataUploadValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.edaAssignExternalData(sessionContext, stationNumber, objectType, objectNumber, objectDetail, assignExternalDataUploadKeys, assignExternalDataUploadValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_edaGetObjectsForExternalData
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "edaGetObjectsForExternalData"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String[] objectExternalDataFilterKeys
|
|
/// in String[] objectExternalDataFilterValues
|
|
/// in String[] objectExternalDataResultKeys
|
|
/// out String[] objectExternalDataResultValues
|
|
/// </para>
|
|
public static void test_edaGetObjectsForExternalData()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String[] objectExternalDataFilterKeys = null;
|
|
String[] objectExternalDataFilterValues = null;
|
|
String[] objectExternalDataResultKeys = null;
|
|
String[] objectExternalDataResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for objectExternalDataFilterKeys: "));
|
|
int objectExternalDataFilterKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
objectExternalDataFilterKeys = new String[objectExternalDataFilterKeysSize];
|
|
for (int i=0; i<objectExternalDataFilterKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("objectExternalDataFilterKeys[" + i + "] (String): "));
|
|
objectExternalDataFilterKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for objectExternalDataFilterValues: "));
|
|
int objectExternalDataFilterValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
objectExternalDataFilterValues = new String[objectExternalDataFilterValuesSize];
|
|
for (int i=0; i<objectExternalDataFilterValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("objectExternalDataFilterValues[" + i + "] (String): "));
|
|
objectExternalDataFilterValues[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for objectExternalDataResultKeys: "));
|
|
int objectExternalDataResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
objectExternalDataResultKeys = new String[objectExternalDataResultKeysSize];
|
|
for (int i=0; i<objectExternalDataResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("objectExternalDataResultKeys[" + i + "] (String): "));
|
|
objectExternalDataResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.edaGetObjectsForExternalData(sessionContext, stationNumber, objectExternalDataFilterKeys, objectExternalDataFilterValues, objectExternalDataResultKeys, out objectExternalDataResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; objectExternalDataResultValues != null && i<objectExternalDataResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("objectExternalDataResultValues[" + i + "]: ") + "<" + objectExternalDataResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_edaGetExternalDataForObject
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "edaGetExternalDataForObject"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String[] externalDataFilterKeys
|
|
/// in String[] externalDataFilterValues
|
|
/// in String[] externalDataResultKeys
|
|
/// out String[] externalDataResultValues
|
|
/// </para>
|
|
public static void test_edaGetExternalDataForObject()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String[] externalDataFilterKeys = null;
|
|
String[] externalDataFilterValues = null;
|
|
String[] externalDataResultKeys = null;
|
|
String[] externalDataResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for externalDataFilterKeys: "));
|
|
int externalDataFilterKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
externalDataFilterKeys = new String[externalDataFilterKeysSize];
|
|
for (int i=0; i<externalDataFilterKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("externalDataFilterKeys[" + i + "] (String): "));
|
|
externalDataFilterKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for externalDataFilterValues: "));
|
|
int externalDataFilterValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
externalDataFilterValues = new String[externalDataFilterValuesSize];
|
|
for (int i=0; i<externalDataFilterValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("externalDataFilterValues[" + i + "] (String): "));
|
|
externalDataFilterValues[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for externalDataResultKeys: "));
|
|
int externalDataResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
externalDataResultKeys = new String[externalDataResultKeysSize];
|
|
for (int i=0; i<externalDataResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("externalDataResultKeys[" + i + "] (String): "));
|
|
externalDataResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.edaGetExternalDataForObject(sessionContext, stationNumber, externalDataFilterKeys, externalDataFilterValues, externalDataResultKeys, out externalDataResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; externalDataResultValues != null && i<externalDataResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("externalDataResultValues[" + i + "]: ") + "<" + externalDataResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_edaManageExternalData
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "edaManageExternalData"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in int functionMode
|
|
/// in String[] partGroupArray
|
|
/// in String[] partNumberArray
|
|
/// in KeyValue[] manageExternalData
|
|
/// in String[] externalDataValues
|
|
/// </para>
|
|
public static void test_edaManageExternalData()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
int functionMode = 0;
|
|
String[] partGroupArray = null;
|
|
String[] partNumberArray = null;
|
|
KeyValue[] manageExternalData = null;
|
|
String[] externalDataValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("functionMode (int): "));
|
|
functionMode = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("Enter size for partGroupArray: "));
|
|
int partGroupArraySize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
partGroupArray = new String[partGroupArraySize];
|
|
for (int i=0; i<partGroupArraySize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("partGroupArray[" + i + "] (String): "));
|
|
partGroupArray[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for partNumberArray: "));
|
|
int partNumberArraySize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
partNumberArray = new String[partNumberArraySize];
|
|
for (int i=0; i<partNumberArraySize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("partNumberArray[" + i + "] (String): "));
|
|
partNumberArray[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for manageExternalData: "));
|
|
int manageExternalDataSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
manageExternalData = new KeyValue[manageExternalDataSize];
|
|
for (int i=0; i<manageExternalDataSize; i++)
|
|
{
|
|
manageExternalData[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("manageExternalData[" + i + "] .key (String): "));
|
|
manageExternalData[i].key = getInput();
|
|
Console.Write(fillWithSpace("manageExternalData[" + i + "] .value (String): "));
|
|
manageExternalData[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for externalDataValues: "));
|
|
int externalDataValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
externalDataValues = new String[externalDataValuesSize];
|
|
for (int i=0; i<externalDataValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("externalDataValues[" + i + "] (String): "));
|
|
externalDataValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.edaManageExternalData(sessionContext, stationNumber, functionMode, partGroupArray, partNumberArray, manageExternalData, externalDataValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_equCheckEquipmentData
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "equCheckEquipmentData"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String workOrderNumber
|
|
/// in String serialNumber
|
|
/// in String partNumber
|
|
/// in int processLayer
|
|
/// in int returnFailuresOnly
|
|
/// in String[] equipmentResultKeys
|
|
/// out String[] equipmentResultValues
|
|
/// </para>
|
|
public static void test_equCheckEquipmentData()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String workOrderNumber = "";
|
|
String serialNumber = "";
|
|
String partNumber = "";
|
|
int processLayer = 0;
|
|
int returnFailuresOnly = 0;
|
|
String[] equipmentResultKeys = null;
|
|
String[] equipmentResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("workOrderNumber (String): "));
|
|
workOrderNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumber (String): "));
|
|
serialNumber = getInput();
|
|
Console.Write(fillWithSpace("partNumber (String): "));
|
|
partNumber = getInput();
|
|
Console.Write(fillWithSpace("processLayer (int): "));
|
|
processLayer = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("returnFailuresOnly (int): "));
|
|
returnFailuresOnly = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("Enter size for equipmentResultKeys: "));
|
|
int equipmentResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
equipmentResultKeys = new String[equipmentResultKeysSize];
|
|
for (int i=0; i<equipmentResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("equipmentResultKeys[" + i + "] (String): "));
|
|
equipmentResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.equCheckEquipmentData(sessionContext, stationNumber, workOrderNumber, serialNumber, partNumber, processLayer, returnFailuresOnly, equipmentResultKeys, out equipmentResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; equipmentResultValues != null && i<equipmentResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("equipmentResultValues[" + i + "]: ") + "<" + equipmentResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_equUpdateEquipmentData
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "equUpdateEquipmentData"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in int setupFlag
|
|
/// in String serialNumber
|
|
/// in String workOrderNumber
|
|
/// in int processLayer
|
|
/// in String[] equipmentUploadKeys
|
|
/// in String[] equipmentUploadValues
|
|
/// out String[] equipmentResultValues
|
|
/// </para>
|
|
public static void test_equUpdateEquipmentData()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
int setupFlag = 0;
|
|
String serialNumber = "";
|
|
String workOrderNumber = "";
|
|
int processLayer = 0;
|
|
String[] equipmentUploadKeys = null;
|
|
String[] equipmentUploadValues = null;
|
|
String[] equipmentResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("setupFlag (int): "));
|
|
setupFlag = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("serialNumber (String): "));
|
|
serialNumber = getInput();
|
|
Console.Write(fillWithSpace("workOrderNumber (String): "));
|
|
workOrderNumber = getInput();
|
|
Console.Write(fillWithSpace("processLayer (int): "));
|
|
processLayer = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("Enter size for equipmentUploadKeys: "));
|
|
int equipmentUploadKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
equipmentUploadKeys = new String[equipmentUploadKeysSize];
|
|
for (int i=0; i<equipmentUploadKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("equipmentUploadKeys[" + i + "] (String): "));
|
|
equipmentUploadKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for equipmentUploadValues: "));
|
|
int equipmentUploadValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
equipmentUploadValues = new String[equipmentUploadValuesSize];
|
|
for (int i=0; i<equipmentUploadValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("equipmentUploadValues[" + i + "] (String): "));
|
|
equipmentUploadValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.equUpdateEquipmentData(sessionContext, stationNumber, setupFlag, serialNumber, workOrderNumber, processLayer, equipmentUploadKeys, equipmentUploadValues, out equipmentResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; equipmentResultValues != null && i<equipmentResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("equipmentResultValues[" + i + "]: ") + "<" + equipmentResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_equGetSetupEquipmentData
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "equGetSetupEquipmentData"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] equipmentSetupFilters
|
|
/// in String[] equipmentSetupResultKeys
|
|
/// out String[] equipmentSetupResultValues
|
|
/// </para>
|
|
public static void test_equGetSetupEquipmentData()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] equipmentSetupFilters = null;
|
|
String[] equipmentSetupResultKeys = null;
|
|
String[] equipmentSetupResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for equipmentSetupFilters: "));
|
|
int equipmentSetupFiltersSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
equipmentSetupFilters = new KeyValue[equipmentSetupFiltersSize];
|
|
for (int i=0; i<equipmentSetupFiltersSize; i++)
|
|
{
|
|
equipmentSetupFilters[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("equipmentSetupFilters[" + i + "] .key (String): "));
|
|
equipmentSetupFilters[i].key = getInput();
|
|
Console.Write(fillWithSpace("equipmentSetupFilters[" + i + "] .value (String): "));
|
|
equipmentSetupFilters[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for equipmentSetupResultKeys: "));
|
|
int equipmentSetupResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
equipmentSetupResultKeys = new String[equipmentSetupResultKeysSize];
|
|
for (int i=0; i<equipmentSetupResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("equipmentSetupResultKeys[" + i + "] (String): "));
|
|
equipmentSetupResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.equGetSetupEquipmentData(sessionContext, stationNumber, equipmentSetupFilters, equipmentSetupResultKeys, out equipmentSetupResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; equipmentSetupResultValues != null && i<equipmentSetupResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("equipmentSetupResultValues[" + i + "]: ") + "<" + equipmentSetupResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_equGetRequiredEquipmentData
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "equGetRequiredEquipmentData"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String workOrderNumber
|
|
/// in String serialNumber
|
|
/// in String partNumber
|
|
/// in int processLayer
|
|
/// in String pmGroup
|
|
/// in String[] equipmentResultKeys
|
|
/// out String[] equipmentResultValues
|
|
/// </para>
|
|
public static void test_equGetRequiredEquipmentData()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String workOrderNumber = "";
|
|
String serialNumber = "";
|
|
String partNumber = "";
|
|
int processLayer = 0;
|
|
String pmGroup = "";
|
|
String[] equipmentResultKeys = null;
|
|
String[] equipmentResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("workOrderNumber (String): "));
|
|
workOrderNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumber (String): "));
|
|
serialNumber = getInput();
|
|
Console.Write(fillWithSpace("partNumber (String): "));
|
|
partNumber = getInput();
|
|
Console.Write(fillWithSpace("processLayer (int): "));
|
|
processLayer = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("pmGroup (String): "));
|
|
pmGroup = getInput();
|
|
Console.Write(fillWithSpace("Enter size for equipmentResultKeys: "));
|
|
int equipmentResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
equipmentResultKeys = new String[equipmentResultKeysSize];
|
|
for (int i=0; i<equipmentResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("equipmentResultKeys[" + i + "] (String): "));
|
|
equipmentResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.equGetRequiredEquipmentData(sessionContext, stationNumber, workOrderNumber, serialNumber, partNumber, processLayer, pmGroup, equipmentResultKeys, out equipmentResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; equipmentResultValues != null && i<equipmentResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("equipmentResultValues[" + i + "]: ") + "<" + equipmentResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_equGetRequiredEquipmentDetail
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "equGetRequiredEquipmentDetail"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] requiredEquipmentFilterKeys
|
|
/// in String[] requiredEquipmentResultKeys
|
|
/// out String[] requiredEquipmentResultValues
|
|
/// </para>
|
|
public static void test_equGetRequiredEquipmentDetail()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] requiredEquipmentFilterKeys = null;
|
|
String[] requiredEquipmentResultKeys = null;
|
|
String[] requiredEquipmentResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for requiredEquipmentFilterKeys: "));
|
|
int requiredEquipmentFilterKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
requiredEquipmentFilterKeys = new KeyValue[requiredEquipmentFilterKeysSize];
|
|
for (int i=0; i<requiredEquipmentFilterKeysSize; i++)
|
|
{
|
|
requiredEquipmentFilterKeys[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("requiredEquipmentFilterKeys[" + i + "] .key (String): "));
|
|
requiredEquipmentFilterKeys[i].key = getInput();
|
|
Console.Write(fillWithSpace("requiredEquipmentFilterKeys[" + i + "] .value (String): "));
|
|
requiredEquipmentFilterKeys[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for requiredEquipmentResultKeys: "));
|
|
int requiredEquipmentResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
requiredEquipmentResultKeys = new String[requiredEquipmentResultKeysSize];
|
|
for (int i=0; i<requiredEquipmentResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("requiredEquipmentResultKeys[" + i + "] (String): "));
|
|
requiredEquipmentResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.equGetRequiredEquipmentDetail(sessionContext, stationNumber, requiredEquipmentFilterKeys, requiredEquipmentResultKeys, out requiredEquipmentResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; requiredEquipmentResultValues != null && i<requiredEquipmentResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("requiredEquipmentResultValues[" + i + "]: ") + "<" + requiredEquipmentResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_equRemoveEquipment
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "equRemoveEquipment"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String workOrderNumber
|
|
/// in String serialNumber
|
|
/// in int processLayer
|
|
/// </para>
|
|
public static void test_equRemoveEquipment()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String workOrderNumber = "";
|
|
String serialNumber = "";
|
|
int processLayer = 0;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("workOrderNumber (String): "));
|
|
workOrderNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumber (String): "));
|
|
serialNumber = getInput();
|
|
Console.Write(fillWithSpace("processLayer (int): "));
|
|
processLayer = Int32.Parse(getInput());
|
|
|
|
// call imsapi function
|
|
result = imsapi.equRemoveEquipment(sessionContext, stationNumber, workOrderNumber, serialNumber, processLayer);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_equSetLocation
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "equSetLocation"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String equipmentNo
|
|
/// in String equipmentIndex
|
|
/// in String location
|
|
/// </para>
|
|
public static void test_equSetLocation()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String equipmentNo = "";
|
|
String equipmentIndex = "";
|
|
String location = "";
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("equipmentNo (String): "));
|
|
equipmentNo = getInput();
|
|
Console.Write(fillWithSpace("equipmentIndex (String): "));
|
|
equipmentIndex = getInput();
|
|
Console.Write(fillWithSpace("location (String): "));
|
|
location = getInput();
|
|
|
|
// call imsapi function
|
|
result = imsapi.equSetLocation(sessionContext, stationNumber, equipmentNo, equipmentIndex, location);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_equGetEquipment
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "equGetEquipment"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] equipmentGetFilters
|
|
/// in String[] equipmentGetResultKeys
|
|
/// out String[] equipmentGetResultValues
|
|
/// </para>
|
|
public static void test_equGetEquipment()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] equipmentGetFilters = null;
|
|
String[] equipmentGetResultKeys = null;
|
|
String[] equipmentGetResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for equipmentGetFilters: "));
|
|
int equipmentGetFiltersSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
equipmentGetFilters = new KeyValue[equipmentGetFiltersSize];
|
|
for (int i=0; i<equipmentGetFiltersSize; i++)
|
|
{
|
|
equipmentGetFilters[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("equipmentGetFilters[" + i + "] .key (String): "));
|
|
equipmentGetFilters[i].key = getInput();
|
|
Console.Write(fillWithSpace("equipmentGetFilters[" + i + "] .value (String): "));
|
|
equipmentGetFilters[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for equipmentGetResultKeys: "));
|
|
int equipmentGetResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
equipmentGetResultKeys = new String[equipmentGetResultKeysSize];
|
|
for (int i=0; i<equipmentGetResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("equipmentGetResultKeys[" + i + "] (String): "));
|
|
equipmentGetResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.equGetEquipment(sessionContext, stationNumber, equipmentGetFilters, equipmentGetResultKeys, out equipmentGetResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; equipmentGetResultValues != null && i<equipmentGetResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("equipmentGetResultValues[" + i + "]: ") + "<" + equipmentGetResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_equUpdateEquipment
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "equUpdateEquipment"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String[] equipmentUpdateKeys
|
|
/// in String[] equipmentUpdateValues
|
|
/// out String[] equipmentUpdateResultValues
|
|
/// </para>
|
|
public static void test_equUpdateEquipment()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String[] equipmentUpdateKeys = null;
|
|
String[] equipmentUpdateValues = null;
|
|
String[] equipmentUpdateResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for equipmentUpdateKeys: "));
|
|
int equipmentUpdateKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
equipmentUpdateKeys = new String[equipmentUpdateKeysSize];
|
|
for (int i=0; i<equipmentUpdateKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("equipmentUpdateKeys[" + i + "] (String): "));
|
|
equipmentUpdateKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for equipmentUpdateValues: "));
|
|
int equipmentUpdateValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
equipmentUpdateValues = new String[equipmentUpdateValuesSize];
|
|
for (int i=0; i<equipmentUpdateValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("equipmentUpdateValues[" + i + "] (String): "));
|
|
equipmentUpdateValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.equUpdateEquipment(sessionContext, stationNumber, equipmentUpdateKeys, equipmentUpdateValues, out equipmentUpdateResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; equipmentUpdateResultValues != null && i<equipmentUpdateResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("equipmentUpdateResultValues[" + i + "]: ") + "<" + equipmentUpdateResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_equReportQuantity
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "equReportQuantity"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String[] equReportQuantityKeys
|
|
/// in String[] equReportQuantityValues
|
|
/// out String[] equReportQuantityResultValues
|
|
/// </para>
|
|
public static void test_equReportQuantity()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String[] equReportQuantityKeys = null;
|
|
String[] equReportQuantityValues = null;
|
|
String[] equReportQuantityResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for equReportQuantityKeys: "));
|
|
int equReportQuantityKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
equReportQuantityKeys = new String[equReportQuantityKeysSize];
|
|
for (int i=0; i<equReportQuantityKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("equReportQuantityKeys[" + i + "] (String): "));
|
|
equReportQuantityKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for equReportQuantityValues: "));
|
|
int equReportQuantityValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
equReportQuantityValues = new String[equReportQuantityValuesSize];
|
|
for (int i=0; i<equReportQuantityValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("equReportQuantityValues[" + i + "] (String): "));
|
|
equReportQuantityValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.equReportQuantity(sessionContext, stationNumber, equReportQuantityKeys, equReportQuantityValues, out equReportQuantityResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; equReportQuantityResultValues != null && i<equReportQuantityResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("equReportQuantityResultValues[" + i + "]: ") + "<" + equReportQuantityResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_equCreateEquipment
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "equCreateEquipment"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String[] equipmentUploadKeys
|
|
/// in String[] equipmentUploadValues
|
|
/// out String[] equipmentUploadResultValues
|
|
/// </para>
|
|
public static void test_equCreateEquipment()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String[] equipmentUploadKeys = null;
|
|
String[] equipmentUploadValues = null;
|
|
String[] equipmentUploadResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for equipmentUploadKeys: "));
|
|
int equipmentUploadKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
equipmentUploadKeys = new String[equipmentUploadKeysSize];
|
|
for (int i=0; i<equipmentUploadKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("equipmentUploadKeys[" + i + "] (String): "));
|
|
equipmentUploadKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for equipmentUploadValues: "));
|
|
int equipmentUploadValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
equipmentUploadValues = new String[equipmentUploadValuesSize];
|
|
for (int i=0; i<equipmentUploadValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("equipmentUploadValues[" + i + "] (String): "));
|
|
equipmentUploadValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.equCreateEquipment(sessionContext, stationNumber, equipmentUploadKeys, equipmentUploadValues, out equipmentUploadResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; equipmentUploadResultValues != null && i<equipmentUploadResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("equipmentUploadResultValues[" + i + "]: ") + "<" + equipmentUploadResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_equGetCarrierAssignRule
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "equGetCarrierAssignRule"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] carrierGetFilters
|
|
/// in String[] carrierGetMainResultKeys
|
|
/// in String[] carrierGetSerialNoAssignRuleResultKeys
|
|
/// in String[] carrierGetCarrierAssignRuleResultKeys
|
|
/// out String[] carrierGetMainResultValues
|
|
/// out String[] carrierGetSerialNoAssignRuleResultValues
|
|
/// out String[] carrierGetCarrierAssignRuleResultValues
|
|
/// </para>
|
|
public static void test_equGetCarrierAssignRule()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] carrierGetFilters = null;
|
|
String[] carrierGetMainResultKeys = null;
|
|
String[] carrierGetSerialNoAssignRuleResultKeys = null;
|
|
String[] carrierGetCarrierAssignRuleResultKeys = null;
|
|
String[] carrierGetMainResultValues = null;
|
|
String[] carrierGetSerialNoAssignRuleResultValues = null;
|
|
String[] carrierGetCarrierAssignRuleResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for carrierGetFilters: "));
|
|
int carrierGetFiltersSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
carrierGetFilters = new KeyValue[carrierGetFiltersSize];
|
|
for (int i=0; i<carrierGetFiltersSize; i++)
|
|
{
|
|
carrierGetFilters[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("carrierGetFilters[" + i + "] .key (String): "));
|
|
carrierGetFilters[i].key = getInput();
|
|
Console.Write(fillWithSpace("carrierGetFilters[" + i + "] .value (String): "));
|
|
carrierGetFilters[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for carrierGetMainResultKeys: "));
|
|
int carrierGetMainResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
carrierGetMainResultKeys = new String[carrierGetMainResultKeysSize];
|
|
for (int i=0; i<carrierGetMainResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("carrierGetMainResultKeys[" + i + "] (String): "));
|
|
carrierGetMainResultKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for carrierGetSerialNoAssignRuleResultKeys: "));
|
|
int carrierGetSerialNoAssignRuleResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
carrierGetSerialNoAssignRuleResultKeys = new String[carrierGetSerialNoAssignRuleResultKeysSize];
|
|
for (int i=0; i<carrierGetSerialNoAssignRuleResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("carrierGetSerialNoAssignRuleResultKeys[" + i + "] (String): "));
|
|
carrierGetSerialNoAssignRuleResultKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for carrierGetCarrierAssignRuleResultKeys: "));
|
|
int carrierGetCarrierAssignRuleResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
carrierGetCarrierAssignRuleResultKeys = new String[carrierGetCarrierAssignRuleResultKeysSize];
|
|
for (int i=0; i<carrierGetCarrierAssignRuleResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("carrierGetCarrierAssignRuleResultKeys[" + i + "] (String): "));
|
|
carrierGetCarrierAssignRuleResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.equGetCarrierAssignRule(sessionContext, stationNumber, carrierGetFilters, carrierGetMainResultKeys, carrierGetSerialNoAssignRuleResultKeys, carrierGetCarrierAssignRuleResultKeys, out carrierGetMainResultValues, out carrierGetSerialNoAssignRuleResultValues, out carrierGetCarrierAssignRuleResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; carrierGetMainResultValues != null && i<carrierGetMainResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("carrierGetMainResultValues[" + i + "]: ") + "<" + carrierGetMainResultValues[i] + ">");
|
|
}
|
|
for (int i=0; carrierGetSerialNoAssignRuleResultValues != null && i<carrierGetSerialNoAssignRuleResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("carrierGetSerialNoAssignRuleResultValues[" + i + "]: ") + "<" + carrierGetSerialNoAssignRuleResultValues[i] + ">");
|
|
}
|
|
for (int i=0; carrierGetCarrierAssignRuleResultValues != null && i<carrierGetCarrierAssignRuleResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("carrierGetCarrierAssignRuleResultValues[" + i + "]: ") + "<" + carrierGetCarrierAssignRuleResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_equGetCarrierAssigned
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "equGetCarrierAssigned"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] carrierGetFilters
|
|
/// in String[] carrierMainResultKeys
|
|
/// out String[] carrierMainResultValues
|
|
/// in String[] carrierSerialNoAssignedResultKeys
|
|
/// out String[] carrierSerialNoAssignedResultValues
|
|
/// in String[] carrierCarrierAssignedResultKeys
|
|
/// out String[] carrierCarrierAssignedResultValues
|
|
/// </para>
|
|
public static void test_equGetCarrierAssigned()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] carrierGetFilters = null;
|
|
String[] carrierMainResultKeys = null;
|
|
String[] carrierMainResultValues = null;
|
|
String[] carrierSerialNoAssignedResultKeys = null;
|
|
String[] carrierSerialNoAssignedResultValues = null;
|
|
String[] carrierCarrierAssignedResultKeys = null;
|
|
String[] carrierCarrierAssignedResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for carrierGetFilters: "));
|
|
int carrierGetFiltersSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
carrierGetFilters = new KeyValue[carrierGetFiltersSize];
|
|
for (int i=0; i<carrierGetFiltersSize; i++)
|
|
{
|
|
carrierGetFilters[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("carrierGetFilters[" + i + "] .key (String): "));
|
|
carrierGetFilters[i].key = getInput();
|
|
Console.Write(fillWithSpace("carrierGetFilters[" + i + "] .value (String): "));
|
|
carrierGetFilters[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for carrierMainResultKeys: "));
|
|
int carrierMainResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
carrierMainResultKeys = new String[carrierMainResultKeysSize];
|
|
for (int i=0; i<carrierMainResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("carrierMainResultKeys[" + i + "] (String): "));
|
|
carrierMainResultKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for carrierSerialNoAssignedResultKeys: "));
|
|
int carrierSerialNoAssignedResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
carrierSerialNoAssignedResultKeys = new String[carrierSerialNoAssignedResultKeysSize];
|
|
for (int i=0; i<carrierSerialNoAssignedResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("carrierSerialNoAssignedResultKeys[" + i + "] (String): "));
|
|
carrierSerialNoAssignedResultKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for carrierCarrierAssignedResultKeys: "));
|
|
int carrierCarrierAssignedResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
carrierCarrierAssignedResultKeys = new String[carrierCarrierAssignedResultKeysSize];
|
|
for (int i=0; i<carrierCarrierAssignedResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("carrierCarrierAssignedResultKeys[" + i + "] (String): "));
|
|
carrierCarrierAssignedResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.equGetCarrierAssigned(sessionContext, stationNumber, carrierGetFilters, carrierMainResultKeys, out carrierMainResultValues, carrierSerialNoAssignedResultKeys, out carrierSerialNoAssignedResultValues, carrierCarrierAssignedResultKeys, out carrierCarrierAssignedResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; carrierMainResultValues != null && i<carrierMainResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("carrierMainResultValues[" + i + "]: ") + "<" + carrierMainResultValues[i] + ">");
|
|
}
|
|
for (int i=0; carrierSerialNoAssignedResultValues != null && i<carrierSerialNoAssignedResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("carrierSerialNoAssignedResultValues[" + i + "]: ") + "<" + carrierSerialNoAssignedResultValues[i] + ">");
|
|
}
|
|
for (int i=0; carrierCarrierAssignedResultValues != null && i<carrierCarrierAssignedResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("carrierCarrierAssignedResultValues[" + i + "]: ") + "<" + carrierCarrierAssignedResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_equGetCarrierAssignmentHistoryData
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "equGetCarrierAssignmentHistoryData"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] carrierGetFilters
|
|
/// in String[] carrierSerialNumberAssignedHistoryResultKeys
|
|
/// out String[] carrierSerialNumberAssignedHistoryResultValues
|
|
/// in String[] carrierCarrierAssignedHistoryResultKeys
|
|
/// out String[] carrierCarrierAssignedHistoryResultValues
|
|
/// </para>
|
|
public static void test_equGetCarrierAssignmentHistoryData()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] carrierGetFilters = null;
|
|
String[] carrierSerialNumberAssignedHistoryResultKeys = null;
|
|
String[] carrierSerialNumberAssignedHistoryResultValues = null;
|
|
String[] carrierCarrierAssignedHistoryResultKeys = null;
|
|
String[] carrierCarrierAssignedHistoryResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for carrierGetFilters: "));
|
|
int carrierGetFiltersSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
carrierGetFilters = new KeyValue[carrierGetFiltersSize];
|
|
for (int i=0; i<carrierGetFiltersSize; i++)
|
|
{
|
|
carrierGetFilters[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("carrierGetFilters[" + i + "] .key (String): "));
|
|
carrierGetFilters[i].key = getInput();
|
|
Console.Write(fillWithSpace("carrierGetFilters[" + i + "] .value (String): "));
|
|
carrierGetFilters[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for carrierSerialNumberAssignedHistoryResultKeys: "));
|
|
int carrierSerialNumberAssignedHistoryResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
carrierSerialNumberAssignedHistoryResultKeys = new String[carrierSerialNumberAssignedHistoryResultKeysSize];
|
|
for (int i=0; i<carrierSerialNumberAssignedHistoryResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("carrierSerialNumberAssignedHistoryResultKeys[" + i + "] (String): "));
|
|
carrierSerialNumberAssignedHistoryResultKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for carrierCarrierAssignedHistoryResultKeys: "));
|
|
int carrierCarrierAssignedHistoryResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
carrierCarrierAssignedHistoryResultKeys = new String[carrierCarrierAssignedHistoryResultKeysSize];
|
|
for (int i=0; i<carrierCarrierAssignedHistoryResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("carrierCarrierAssignedHistoryResultKeys[" + i + "] (String): "));
|
|
carrierCarrierAssignedHistoryResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.equGetCarrierAssignmentHistoryData(sessionContext, stationNumber, carrierGetFilters, carrierSerialNumberAssignedHistoryResultKeys, out carrierSerialNumberAssignedHistoryResultValues, carrierCarrierAssignedHistoryResultKeys, out carrierCarrierAssignedHistoryResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; carrierSerialNumberAssignedHistoryResultValues != null && i<carrierSerialNumberAssignedHistoryResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("carrierSerialNumberAssignedHistoryResultValues[" + i + "]: ") + "<" + carrierSerialNumberAssignedHistoryResultValues[i] + ">");
|
|
}
|
|
for (int i=0; carrierCarrierAssignedHistoryResultValues != null && i<carrierCarrierAssignedHistoryResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("carrierCarrierAssignedHistoryResultValues[" + i + "]: ") + "<" + carrierCarrierAssignedHistoryResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_equGetCarrierToSerialNumber
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "equGetCarrierToSerialNumber"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] carrierToSerialNumberFilters
|
|
/// in String[] carrierToSerialNumberResultKeys
|
|
/// out String[] carrierToSerialNumberResultValues
|
|
/// </para>
|
|
public static void test_equGetCarrierToSerialNumber()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] carrierToSerialNumberFilters = null;
|
|
String[] carrierToSerialNumberResultKeys = null;
|
|
String[] carrierToSerialNumberResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for carrierToSerialNumberFilters: "));
|
|
int carrierToSerialNumberFiltersSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
carrierToSerialNumberFilters = new KeyValue[carrierToSerialNumberFiltersSize];
|
|
for (int i=0; i<carrierToSerialNumberFiltersSize; i++)
|
|
{
|
|
carrierToSerialNumberFilters[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("carrierToSerialNumberFilters[" + i + "] .key (String): "));
|
|
carrierToSerialNumberFilters[i].key = getInput();
|
|
Console.Write(fillWithSpace("carrierToSerialNumberFilters[" + i + "] .value (String): "));
|
|
carrierToSerialNumberFilters[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for carrierToSerialNumberResultKeys: "));
|
|
int carrierToSerialNumberResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
carrierToSerialNumberResultKeys = new String[carrierToSerialNumberResultKeysSize];
|
|
for (int i=0; i<carrierToSerialNumberResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("carrierToSerialNumberResultKeys[" + i + "] (String): "));
|
|
carrierToSerialNumberResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.equGetCarrierToSerialNumber(sessionContext, stationNumber, carrierToSerialNumberFilters, carrierToSerialNumberResultKeys, out carrierToSerialNumberResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; carrierToSerialNumberResultValues != null && i<carrierToSerialNumberResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("carrierToSerialNumberResultValues[" + i + "]: ") + "<" + carrierToSerialNumberResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_equGetCarrierToCarrier
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "equGetCarrierToCarrier"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] carrierToCarrierFilters
|
|
/// in String[] carrierToCarrierResultKeys
|
|
/// out String[] carrierToCarrierResultValues
|
|
/// </para>
|
|
public static void test_equGetCarrierToCarrier()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] carrierToCarrierFilters = null;
|
|
String[] carrierToCarrierResultKeys = null;
|
|
String[] carrierToCarrierResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for carrierToCarrierFilters: "));
|
|
int carrierToCarrierFiltersSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
carrierToCarrierFilters = new KeyValue[carrierToCarrierFiltersSize];
|
|
for (int i=0; i<carrierToCarrierFiltersSize; i++)
|
|
{
|
|
carrierToCarrierFilters[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("carrierToCarrierFilters[" + i + "] .key (String): "));
|
|
carrierToCarrierFilters[i].key = getInput();
|
|
Console.Write(fillWithSpace("carrierToCarrierFilters[" + i + "] .value (String): "));
|
|
carrierToCarrierFilters[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for carrierToCarrierResultKeys: "));
|
|
int carrierToCarrierResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
carrierToCarrierResultKeys = new String[carrierToCarrierResultKeysSize];
|
|
for (int i=0; i<carrierToCarrierResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("carrierToCarrierResultKeys[" + i + "] (String): "));
|
|
carrierToCarrierResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.equGetCarrierToCarrier(sessionContext, stationNumber, carrierToCarrierFilters, carrierToCarrierResultKeys, out carrierToCarrierResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; carrierToCarrierResultValues != null && i<carrierToCarrierResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("carrierToCarrierResultValues[" + i + "]: ") + "<" + carrierToCarrierResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_equAssignSerialNumberToCarrier
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "equAssignSerialNumberToCarrier"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String equipmentNumber
|
|
/// in String equipmentIndex
|
|
/// in int setState
|
|
/// in String[] assignSerialNumberToCarrierKeys
|
|
/// in String[] assignSerialNumberToCarrierValues
|
|
/// out String[] assignSerialNumberToCarrierResultValues
|
|
/// </para>
|
|
public static void test_equAssignSerialNumberToCarrier()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String equipmentNumber = "";
|
|
String equipmentIndex = "";
|
|
int setState = 0;
|
|
String[] assignSerialNumberToCarrierKeys = null;
|
|
String[] assignSerialNumberToCarrierValues = null;
|
|
String[] assignSerialNumberToCarrierResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("equipmentNumber (String): "));
|
|
equipmentNumber = getInput();
|
|
Console.Write(fillWithSpace("equipmentIndex (String): "));
|
|
equipmentIndex = getInput();
|
|
Console.Write(fillWithSpace("setState (int): "));
|
|
setState = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("Enter size for assignSerialNumberToCarrierKeys: "));
|
|
int assignSerialNumberToCarrierKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
assignSerialNumberToCarrierKeys = new String[assignSerialNumberToCarrierKeysSize];
|
|
for (int i=0; i<assignSerialNumberToCarrierKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("assignSerialNumberToCarrierKeys[" + i + "] (String): "));
|
|
assignSerialNumberToCarrierKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for assignSerialNumberToCarrierValues: "));
|
|
int assignSerialNumberToCarrierValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
assignSerialNumberToCarrierValues = new String[assignSerialNumberToCarrierValuesSize];
|
|
for (int i=0; i<assignSerialNumberToCarrierValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("assignSerialNumberToCarrierValues[" + i + "] (String): "));
|
|
assignSerialNumberToCarrierValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.equAssignSerialNumberToCarrier(sessionContext, stationNumber, equipmentNumber, equipmentIndex, setState, assignSerialNumberToCarrierKeys, assignSerialNumberToCarrierValues, out assignSerialNumberToCarrierResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; assignSerialNumberToCarrierResultValues != null && i<assignSerialNumberToCarrierResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("assignSerialNumberToCarrierResultValues[" + i + "]: ") + "<" + assignSerialNumberToCarrierResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_equRemoveSerialNumberFromCarrier
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "equRemoveSerialNumberFromCarrier"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String equipmentNumber
|
|
/// in String equipmentIndex
|
|
/// in String[] removeSerialNumberFromCarrierKeys
|
|
/// in String[] removeSerialNumberFromCarrierValues
|
|
/// out String[] removeSerialNumberFromCarrierResultValues
|
|
/// </para>
|
|
public static void test_equRemoveSerialNumberFromCarrier()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String equipmentNumber = "";
|
|
String equipmentIndex = "";
|
|
String[] removeSerialNumberFromCarrierKeys = null;
|
|
String[] removeSerialNumberFromCarrierValues = null;
|
|
String[] removeSerialNumberFromCarrierResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("equipmentNumber (String): "));
|
|
equipmentNumber = getInput();
|
|
Console.Write(fillWithSpace("equipmentIndex (String): "));
|
|
equipmentIndex = getInput();
|
|
Console.Write(fillWithSpace("Enter size for removeSerialNumberFromCarrierKeys: "));
|
|
int removeSerialNumberFromCarrierKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
removeSerialNumberFromCarrierKeys = new String[removeSerialNumberFromCarrierKeysSize];
|
|
for (int i=0; i<removeSerialNumberFromCarrierKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("removeSerialNumberFromCarrierKeys[" + i + "] (String): "));
|
|
removeSerialNumberFromCarrierKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for removeSerialNumberFromCarrierValues: "));
|
|
int removeSerialNumberFromCarrierValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
removeSerialNumberFromCarrierValues = new String[removeSerialNumberFromCarrierValuesSize];
|
|
for (int i=0; i<removeSerialNumberFromCarrierValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("removeSerialNumberFromCarrierValues[" + i + "] (String): "));
|
|
removeSerialNumberFromCarrierValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.equRemoveSerialNumberFromCarrier(sessionContext, stationNumber, equipmentNumber, equipmentIndex, removeSerialNumberFromCarrierKeys, removeSerialNumberFromCarrierValues, out removeSerialNumberFromCarrierResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; removeSerialNumberFromCarrierResultValues != null && i<removeSerialNumberFromCarrierResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("removeSerialNumberFromCarrierResultValues[" + i + "]: ") + "<" + removeSerialNumberFromCarrierResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_equAssignCarrierToCarrier
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "equAssignCarrierToCarrier"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String equipmentNumber
|
|
/// in String equipmentIndex
|
|
/// in String[] assignCarrierToCarrierKeys
|
|
/// in String[] assignCarrierToCarrierValues
|
|
/// out String[] assignCarrierToCarrierResultValues
|
|
/// </para>
|
|
public static void test_equAssignCarrierToCarrier()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String equipmentNumber = "";
|
|
String equipmentIndex = "";
|
|
String[] assignCarrierToCarrierKeys = null;
|
|
String[] assignCarrierToCarrierValues = null;
|
|
String[] assignCarrierToCarrierResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("equipmentNumber (String): "));
|
|
equipmentNumber = getInput();
|
|
Console.Write(fillWithSpace("equipmentIndex (String): "));
|
|
equipmentIndex = getInput();
|
|
Console.Write(fillWithSpace("Enter size for assignCarrierToCarrierKeys: "));
|
|
int assignCarrierToCarrierKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
assignCarrierToCarrierKeys = new String[assignCarrierToCarrierKeysSize];
|
|
for (int i=0; i<assignCarrierToCarrierKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("assignCarrierToCarrierKeys[" + i + "] (String): "));
|
|
assignCarrierToCarrierKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for assignCarrierToCarrierValues: "));
|
|
int assignCarrierToCarrierValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
assignCarrierToCarrierValues = new String[assignCarrierToCarrierValuesSize];
|
|
for (int i=0; i<assignCarrierToCarrierValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("assignCarrierToCarrierValues[" + i + "] (String): "));
|
|
assignCarrierToCarrierValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.equAssignCarrierToCarrier(sessionContext, stationNumber, equipmentNumber, equipmentIndex, assignCarrierToCarrierKeys, assignCarrierToCarrierValues, out assignCarrierToCarrierResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; assignCarrierToCarrierResultValues != null && i<assignCarrierToCarrierResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("assignCarrierToCarrierResultValues[" + i + "]: ") + "<" + assignCarrierToCarrierResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_equRemoveCarrierFromCarrier
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "equRemoveCarrierFromCarrier"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String equipmentNumber
|
|
/// in String equipmentIndex
|
|
/// in String[] removeCarrierFromCarrierKeys
|
|
/// in String[] removeCarrierFromCarrierValues
|
|
/// out String[] removeCarrierFromCarrierResultValues
|
|
/// </para>
|
|
public static void test_equRemoveCarrierFromCarrier()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String equipmentNumber = "";
|
|
String equipmentIndex = "";
|
|
String[] removeCarrierFromCarrierKeys = null;
|
|
String[] removeCarrierFromCarrierValues = null;
|
|
String[] removeCarrierFromCarrierResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("equipmentNumber (String): "));
|
|
equipmentNumber = getInput();
|
|
Console.Write(fillWithSpace("equipmentIndex (String): "));
|
|
equipmentIndex = getInput();
|
|
Console.Write(fillWithSpace("Enter size for removeCarrierFromCarrierKeys: "));
|
|
int removeCarrierFromCarrierKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
removeCarrierFromCarrierKeys = new String[removeCarrierFromCarrierKeysSize];
|
|
for (int i=0; i<removeCarrierFromCarrierKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("removeCarrierFromCarrierKeys[" + i + "] (String): "));
|
|
removeCarrierFromCarrierKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for removeCarrierFromCarrierValues: "));
|
|
int removeCarrierFromCarrierValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
removeCarrierFromCarrierValues = new String[removeCarrierFromCarrierValuesSize];
|
|
for (int i=0; i<removeCarrierFromCarrierValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("removeCarrierFromCarrierValues[" + i + "] (String): "));
|
|
removeCarrierFromCarrierValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.equRemoveCarrierFromCarrier(sessionContext, stationNumber, equipmentNumber, equipmentIndex, removeCarrierFromCarrierKeys, removeCarrierFromCarrierValues, out removeCarrierFromCarrierResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; removeCarrierFromCarrierResultValues != null && i<removeCarrierFromCarrierResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("removeCarrierFromCarrierResultValues[" + i + "]: ") + "<" + removeCarrierFromCarrierResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_equSetEquipmentLocation
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "equSetEquipmentLocation"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String[] equipmentLocationKeys
|
|
/// in String[] equipmentLocationValues
|
|
/// out String[] equipmentLocationResultValues
|
|
/// </para>
|
|
public static void test_equSetEquipmentLocation()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String[] equipmentLocationKeys = null;
|
|
String[] equipmentLocationValues = null;
|
|
String[] equipmentLocationResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for equipmentLocationKeys: "));
|
|
int equipmentLocationKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
equipmentLocationKeys = new String[equipmentLocationKeysSize];
|
|
for (int i=0; i<equipmentLocationKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("equipmentLocationKeys[" + i + "] (String): "));
|
|
equipmentLocationKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for equipmentLocationValues: "));
|
|
int equipmentLocationValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
equipmentLocationValues = new String[equipmentLocationValuesSize];
|
|
for (int i=0; i<equipmentLocationValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("equipmentLocationValues[" + i + "] (String): "));
|
|
equipmentLocationValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.equSetEquipmentLocation(sessionContext, stationNumber, equipmentLocationKeys, equipmentLocationValues, out equipmentLocationResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; equipmentLocationResultValues != null && i<equipmentLocationResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("equipmentLocationResultValues[" + i + "]: ") + "<" + equipmentLocationResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_equGetCarrierLocation
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "equGetCarrierLocation"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] carrierLocationFilters
|
|
/// in String[] carrierLocationResultKeys
|
|
/// out String[] carrierLocationResultValues
|
|
/// </para>
|
|
public static void test_equGetCarrierLocation()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] carrierLocationFilters = null;
|
|
String[] carrierLocationResultKeys = null;
|
|
String[] carrierLocationResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for carrierLocationFilters: "));
|
|
int carrierLocationFiltersSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
carrierLocationFilters = new KeyValue[carrierLocationFiltersSize];
|
|
for (int i=0; i<carrierLocationFiltersSize; i++)
|
|
{
|
|
carrierLocationFilters[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("carrierLocationFilters[" + i + "] .key (String): "));
|
|
carrierLocationFilters[i].key = getInput();
|
|
Console.Write(fillWithSpace("carrierLocationFilters[" + i + "] .value (String): "));
|
|
carrierLocationFilters[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for carrierLocationResultKeys: "));
|
|
int carrierLocationResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
carrierLocationResultKeys = new String[carrierLocationResultKeysSize];
|
|
for (int i=0; i<carrierLocationResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("carrierLocationResultKeys[" + i + "] (String): "));
|
|
carrierLocationResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.equGetCarrierLocation(sessionContext, stationNumber, carrierLocationFilters, carrierLocationResultKeys, out carrierLocationResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; carrierLocationResultValues != null && i<carrierLocationResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("carrierLocationResultValues[" + i + "]: ") + "<" + carrierLocationResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_equGetEquipmentLocationHist
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "equGetEquipmentLocationHist"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] equipmentLocationFilters
|
|
/// in String[] equipmentLocationResultKeys
|
|
/// out String[] equipmentLocationResultValues
|
|
/// </para>
|
|
public static void test_equGetEquipmentLocationHist()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] equipmentLocationFilters = null;
|
|
String[] equipmentLocationResultKeys = null;
|
|
String[] equipmentLocationResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for equipmentLocationFilters: "));
|
|
int equipmentLocationFiltersSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
equipmentLocationFilters = new KeyValue[equipmentLocationFiltersSize];
|
|
for (int i=0; i<equipmentLocationFiltersSize; i++)
|
|
{
|
|
equipmentLocationFilters[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("equipmentLocationFilters[" + i + "] .key (String): "));
|
|
equipmentLocationFilters[i].key = getInput();
|
|
Console.Write(fillWithSpace("equipmentLocationFilters[" + i + "] .value (String): "));
|
|
equipmentLocationFilters[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for equipmentLocationResultKeys: "));
|
|
int equipmentLocationResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
equipmentLocationResultKeys = new String[equipmentLocationResultKeysSize];
|
|
for (int i=0; i<equipmentLocationResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("equipmentLocationResultKeys[" + i + "] (String): "));
|
|
equipmentLocationResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.equGetEquipmentLocationHist(sessionContext, stationNumber, equipmentLocationFilters, equipmentLocationResultKeys, out equipmentLocationResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; equipmentLocationResultValues != null && i<equipmentLocationResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("equipmentLocationResultValues[" + i + "]: ") + "<" + equipmentLocationResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_equSetupAssetEquipment
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "equSetupAssetEquipment"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String[] setupAssetEquipmentUploadKeys
|
|
/// in String[] setupAssetEquipmentUploadValues
|
|
/// in String[] setupAssetEquipmentResultKeys
|
|
/// out String[] setupAssetEquipmentResultValues
|
|
/// </para>
|
|
public static void test_equSetupAssetEquipment()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String[] setupAssetEquipmentUploadKeys = null;
|
|
String[] setupAssetEquipmentUploadValues = null;
|
|
String[] setupAssetEquipmentResultKeys = null;
|
|
String[] setupAssetEquipmentResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for setupAssetEquipmentUploadKeys: "));
|
|
int setupAssetEquipmentUploadKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
setupAssetEquipmentUploadKeys = new String[setupAssetEquipmentUploadKeysSize];
|
|
for (int i=0; i<setupAssetEquipmentUploadKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("setupAssetEquipmentUploadKeys[" + i + "] (String): "));
|
|
setupAssetEquipmentUploadKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for setupAssetEquipmentUploadValues: "));
|
|
int setupAssetEquipmentUploadValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
setupAssetEquipmentUploadValues = new String[setupAssetEquipmentUploadValuesSize];
|
|
for (int i=0; i<setupAssetEquipmentUploadValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("setupAssetEquipmentUploadValues[" + i + "] (String): "));
|
|
setupAssetEquipmentUploadValues[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for setupAssetEquipmentResultKeys: "));
|
|
int setupAssetEquipmentResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
setupAssetEquipmentResultKeys = new String[setupAssetEquipmentResultKeysSize];
|
|
for (int i=0; i<setupAssetEquipmentResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("setupAssetEquipmentResultKeys[" + i + "] (String): "));
|
|
setupAssetEquipmentResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.equSetupAssetEquipment(sessionContext, stationNumber, setupAssetEquipmentUploadKeys, setupAssetEquipmentUploadValues, setupAssetEquipmentResultKeys, out setupAssetEquipmentResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; setupAssetEquipmentResultValues != null && i<setupAssetEquipmentResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("setupAssetEquipmentResultValues[" + i + "]: ") + "<" + setupAssetEquipmentResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_equGetAssetEquipmentSetup
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "equGetAssetEquipmentSetup"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] getAssetEquipmentSetupFilters
|
|
/// in String[] getAssetEquipmentSetupResultKeys
|
|
/// out String[] getAssetEquipmentSetupResultValues
|
|
/// </para>
|
|
public static void test_equGetAssetEquipmentSetup()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] getAssetEquipmentSetupFilters = null;
|
|
String[] getAssetEquipmentSetupResultKeys = null;
|
|
String[] getAssetEquipmentSetupResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for getAssetEquipmentSetupFilters: "));
|
|
int getAssetEquipmentSetupFiltersSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
getAssetEquipmentSetupFilters = new KeyValue[getAssetEquipmentSetupFiltersSize];
|
|
for (int i=0; i<getAssetEquipmentSetupFiltersSize; i++)
|
|
{
|
|
getAssetEquipmentSetupFilters[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("getAssetEquipmentSetupFilters[" + i + "] .key (String): "));
|
|
getAssetEquipmentSetupFilters[i].key = getInput();
|
|
Console.Write(fillWithSpace("getAssetEquipmentSetupFilters[" + i + "] .value (String): "));
|
|
getAssetEquipmentSetupFilters[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for getAssetEquipmentSetupResultKeys: "));
|
|
int getAssetEquipmentSetupResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
getAssetEquipmentSetupResultKeys = new String[getAssetEquipmentSetupResultKeysSize];
|
|
for (int i=0; i<getAssetEquipmentSetupResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("getAssetEquipmentSetupResultKeys[" + i + "] (String): "));
|
|
getAssetEquipmentSetupResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.equGetAssetEquipmentSetup(sessionContext, stationNumber, getAssetEquipmentSetupFilters, getAssetEquipmentSetupResultKeys, out getAssetEquipmentSetupResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; getAssetEquipmentSetupResultValues != null && i<getAssetEquipmentSetupResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("getAssetEquipmentSetupResultValues[" + i + "]: ") + "<" + getAssetEquipmentSetupResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_equGetAssignedCavity
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "equGetAssignedCavity"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] cavityGetAssignedCavityFilters
|
|
/// in String[] cavityGetAssignedCavityResultKeys
|
|
/// out String[] cavityGetAssignedCavityResultValues
|
|
/// </para>
|
|
public static void test_equGetAssignedCavity()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] cavityGetAssignedCavityFilters = null;
|
|
String[] cavityGetAssignedCavityResultKeys = null;
|
|
String[] cavityGetAssignedCavityResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for cavityGetAssignedCavityFilters: "));
|
|
int cavityGetAssignedCavityFiltersSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
cavityGetAssignedCavityFilters = new KeyValue[cavityGetAssignedCavityFiltersSize];
|
|
for (int i=0; i<cavityGetAssignedCavityFiltersSize; i++)
|
|
{
|
|
cavityGetAssignedCavityFilters[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("cavityGetAssignedCavityFilters[" + i + "] .key (String): "));
|
|
cavityGetAssignedCavityFilters[i].key = getInput();
|
|
Console.Write(fillWithSpace("cavityGetAssignedCavityFilters[" + i + "] .value (String): "));
|
|
cavityGetAssignedCavityFilters[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for cavityGetAssignedCavityResultKeys: "));
|
|
int cavityGetAssignedCavityResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
cavityGetAssignedCavityResultKeys = new String[cavityGetAssignedCavityResultKeysSize];
|
|
for (int i=0; i<cavityGetAssignedCavityResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("cavityGetAssignedCavityResultKeys[" + i + "] (String): "));
|
|
cavityGetAssignedCavityResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.equGetAssignedCavity(sessionContext, stationNumber, cavityGetAssignedCavityFilters, cavityGetAssignedCavityResultKeys, out cavityGetAssignedCavityResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; cavityGetAssignedCavityResultValues != null && i<cavityGetAssignedCavityResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("cavityGetAssignedCavityResultValues[" + i + "]: ") + "<" + cavityGetAssignedCavityResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_equManagePartCavityRule
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "equManagePartCavityRule"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String cavityPartNumber
|
|
/// in String[] managePartCavityRuleKeys
|
|
/// in String[] managePartCavityRuleValues
|
|
/// out String[] managePartCavityRuleResultValues
|
|
/// </para>
|
|
public static void test_equManagePartCavityRule()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String cavityPartNumber = "";
|
|
String[] managePartCavityRuleKeys = null;
|
|
String[] managePartCavityRuleValues = null;
|
|
String[] managePartCavityRuleResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("cavityPartNumber (String): "));
|
|
cavityPartNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for managePartCavityRuleKeys: "));
|
|
int managePartCavityRuleKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
managePartCavityRuleKeys = new String[managePartCavityRuleKeysSize];
|
|
for (int i=0; i<managePartCavityRuleKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("managePartCavityRuleKeys[" + i + "] (String): "));
|
|
managePartCavityRuleKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for managePartCavityRuleValues: "));
|
|
int managePartCavityRuleValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
managePartCavityRuleValues = new String[managePartCavityRuleValuesSize];
|
|
for (int i=0; i<managePartCavityRuleValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("managePartCavityRuleValues[" + i + "] (String): "));
|
|
managePartCavityRuleValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.equManagePartCavityRule(sessionContext, stationNumber, cavityPartNumber, managePartCavityRuleKeys, managePartCavityRuleValues, out managePartCavityRuleResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; managePartCavityRuleResultValues != null && i<managePartCavityRuleResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("managePartCavityRuleResultValues[" + i + "]: ") + "<" + managePartCavityRuleResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_equManageCavityEquipmentRule
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "equManageCavityEquipmentRule"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String equipmentPartNumber
|
|
/// in String[] manageCavityEquipmentRuleKeys
|
|
/// in String[] manageCavityEquipmentRuleValues
|
|
/// out String[] manageCavityEquipmentRuleResultValues
|
|
/// </para>
|
|
public static void test_equManageCavityEquipmentRule()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String equipmentPartNumber = "";
|
|
String[] manageCavityEquipmentRuleKeys = null;
|
|
String[] manageCavityEquipmentRuleValues = null;
|
|
String[] manageCavityEquipmentRuleResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("equipmentPartNumber (String): "));
|
|
equipmentPartNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for manageCavityEquipmentRuleKeys: "));
|
|
int manageCavityEquipmentRuleKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
manageCavityEquipmentRuleKeys = new String[manageCavityEquipmentRuleKeysSize];
|
|
for (int i=0; i<manageCavityEquipmentRuleKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("manageCavityEquipmentRuleKeys[" + i + "] (String): "));
|
|
manageCavityEquipmentRuleKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for manageCavityEquipmentRuleValues: "));
|
|
int manageCavityEquipmentRuleValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
manageCavityEquipmentRuleValues = new String[manageCavityEquipmentRuleValuesSize];
|
|
for (int i=0; i<manageCavityEquipmentRuleValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("manageCavityEquipmentRuleValues[" + i + "] (String): "));
|
|
manageCavityEquipmentRuleValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.equManageCavityEquipmentRule(sessionContext, stationNumber, equipmentPartNumber, manageCavityEquipmentRuleKeys, manageCavityEquipmentRuleValues, out manageCavityEquipmentRuleResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; manageCavityEquipmentRuleResultValues != null && i<manageCavityEquipmentRuleResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("manageCavityEquipmentRuleResultValues[" + i + "]: ") + "<" + manageCavityEquipmentRuleResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_equAssignCavityToEquipment
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "equAssignCavityToEquipment"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] assignEquipmentKeys
|
|
/// in String[] assignCavityKeys
|
|
/// in String[] assignCavityValues
|
|
/// out String[] assignCavityResultValues
|
|
/// </para>
|
|
public static void test_equAssignCavityToEquipment()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] assignEquipmentKeys = null;
|
|
String[] assignCavityKeys = null;
|
|
String[] assignCavityValues = null;
|
|
String[] assignCavityResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for assignEquipmentKeys: "));
|
|
int assignEquipmentKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
assignEquipmentKeys = new KeyValue[assignEquipmentKeysSize];
|
|
for (int i=0; i<assignEquipmentKeysSize; i++)
|
|
{
|
|
assignEquipmentKeys[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("assignEquipmentKeys[" + i + "] .key (String): "));
|
|
assignEquipmentKeys[i].key = getInput();
|
|
Console.Write(fillWithSpace("assignEquipmentKeys[" + i + "] .value (String): "));
|
|
assignEquipmentKeys[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for assignCavityKeys: "));
|
|
int assignCavityKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
assignCavityKeys = new String[assignCavityKeysSize];
|
|
for (int i=0; i<assignCavityKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("assignCavityKeys[" + i + "] (String): "));
|
|
assignCavityKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for assignCavityValues: "));
|
|
int assignCavityValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
assignCavityValues = new String[assignCavityValuesSize];
|
|
for (int i=0; i<assignCavityValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("assignCavityValues[" + i + "] (String): "));
|
|
assignCavityValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.equAssignCavityToEquipment(sessionContext, stationNumber, assignEquipmentKeys, assignCavityKeys, assignCavityValues, out assignCavityResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; assignCavityResultValues != null && i<assignCavityResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("assignCavityResultValues[" + i + "]: ") + "<" + assignCavityResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_equRemoveCavityFromEquipment
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "equRemoveCavityFromEquipment"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] removeEquipmentKeys
|
|
/// in String[] removeCavityKeys
|
|
/// in String[] removeCavityValues
|
|
/// out String[] removeCavityResultValues
|
|
/// </para>
|
|
public static void test_equRemoveCavityFromEquipment()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] removeEquipmentKeys = null;
|
|
String[] removeCavityKeys = null;
|
|
String[] removeCavityValues = null;
|
|
String[] removeCavityResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for removeEquipmentKeys: "));
|
|
int removeEquipmentKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
removeEquipmentKeys = new KeyValue[removeEquipmentKeysSize];
|
|
for (int i=0; i<removeEquipmentKeysSize; i++)
|
|
{
|
|
removeEquipmentKeys[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("removeEquipmentKeys[" + i + "] .key (String): "));
|
|
removeEquipmentKeys[i].key = getInput();
|
|
Console.Write(fillWithSpace("removeEquipmentKeys[" + i + "] .value (String): "));
|
|
removeEquipmentKeys[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for removeCavityKeys: "));
|
|
int removeCavityKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
removeCavityKeys = new String[removeCavityKeysSize];
|
|
for (int i=0; i<removeCavityKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("removeCavityKeys[" + i + "] (String): "));
|
|
removeCavityKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for removeCavityValues: "));
|
|
int removeCavityValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
removeCavityValues = new String[removeCavityValuesSize];
|
|
for (int i=0; i<removeCavityValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("removeCavityValues[" + i + "] (String): "));
|
|
removeCavityValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.equRemoveCavityFromEquipment(sessionContext, stationNumber, removeEquipmentKeys, removeCavityKeys, removeCavityValues, out removeCavityResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; removeCavityResultValues != null && i<removeCavityResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("removeCavityResultValues[" + i + "]: ") + "<" + removeCavityResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_equUpdateAssignedCavity
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "equUpdateAssignedCavity"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] updateEquipmentKeys
|
|
/// in String[] updateAssignedCavityKeys
|
|
/// in String[] updateAssignedCavityValues
|
|
/// out String[] updateAssignedCavityResultValues
|
|
/// </para>
|
|
public static void test_equUpdateAssignedCavity()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] updateEquipmentKeys = null;
|
|
String[] updateAssignedCavityKeys = null;
|
|
String[] updateAssignedCavityValues = null;
|
|
String[] updateAssignedCavityResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for updateEquipmentKeys: "));
|
|
int updateEquipmentKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
updateEquipmentKeys = new KeyValue[updateEquipmentKeysSize];
|
|
for (int i=0; i<updateEquipmentKeysSize; i++)
|
|
{
|
|
updateEquipmentKeys[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("updateEquipmentKeys[" + i + "] .key (String): "));
|
|
updateEquipmentKeys[i].key = getInput();
|
|
Console.Write(fillWithSpace("updateEquipmentKeys[" + i + "] .value (String): "));
|
|
updateEquipmentKeys[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for updateAssignedCavityKeys: "));
|
|
int updateAssignedCavityKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
updateAssignedCavityKeys = new String[updateAssignedCavityKeysSize];
|
|
for (int i=0; i<updateAssignedCavityKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("updateAssignedCavityKeys[" + i + "] (String): "));
|
|
updateAssignedCavityKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for updateAssignedCavityValues: "));
|
|
int updateAssignedCavityValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
updateAssignedCavityValues = new String[updateAssignedCavityValuesSize];
|
|
for (int i=0; i<updateAssignedCavityValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("updateAssignedCavityValues[" + i + "] (String): "));
|
|
updateAssignedCavityValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.equUpdateAssignedCavity(sessionContext, stationNumber, updateEquipmentKeys, updateAssignedCavityKeys, updateAssignedCavityValues, out updateAssignedCavityResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; updateAssignedCavityResultValues != null && i<updateAssignedCavityResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("updateAssignedCavityResultValues[" + i + "]: ") + "<" + updateAssignedCavityResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_equGetPartCavityAssignRule
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "equGetPartCavityAssignRule"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] partCavityAssignRuleFilters
|
|
/// in String[] partCavityAssignRuleResultKeys
|
|
/// out String[] partCavityAssignRuleResultValues
|
|
/// </para>
|
|
public static void test_equGetPartCavityAssignRule()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] partCavityAssignRuleFilters = null;
|
|
String[] partCavityAssignRuleResultKeys = null;
|
|
String[] partCavityAssignRuleResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for partCavityAssignRuleFilters: "));
|
|
int partCavityAssignRuleFiltersSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
partCavityAssignRuleFilters = new KeyValue[partCavityAssignRuleFiltersSize];
|
|
for (int i=0; i<partCavityAssignRuleFiltersSize; i++)
|
|
{
|
|
partCavityAssignRuleFilters[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("partCavityAssignRuleFilters[" + i + "] .key (String): "));
|
|
partCavityAssignRuleFilters[i].key = getInput();
|
|
Console.Write(fillWithSpace("partCavityAssignRuleFilters[" + i + "] .value (String): "));
|
|
partCavityAssignRuleFilters[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for partCavityAssignRuleResultKeys: "));
|
|
int partCavityAssignRuleResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
partCavityAssignRuleResultKeys = new String[partCavityAssignRuleResultKeysSize];
|
|
for (int i=0; i<partCavityAssignRuleResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("partCavityAssignRuleResultKeys[" + i + "] (String): "));
|
|
partCavityAssignRuleResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.equGetPartCavityAssignRule(sessionContext, stationNumber, partCavityAssignRuleFilters, partCavityAssignRuleResultKeys, out partCavityAssignRuleResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; partCavityAssignRuleResultValues != null && i<partCavityAssignRuleResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("partCavityAssignRuleResultValues[" + i + "]: ") + "<" + partCavityAssignRuleResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_equGetCavityEquipmentAssignRule
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "equGetCavityEquipmentAssignRule"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] cavityEquipmentAssignRuleFilters
|
|
/// in String[] cavityEquipmentAssignRuleResultKeys
|
|
/// out String[] cavityEquipmentAssignRuleResultValues
|
|
/// </para>
|
|
public static void test_equGetCavityEquipmentAssignRule()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] cavityEquipmentAssignRuleFilters = null;
|
|
String[] cavityEquipmentAssignRuleResultKeys = null;
|
|
String[] cavityEquipmentAssignRuleResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for cavityEquipmentAssignRuleFilters: "));
|
|
int cavityEquipmentAssignRuleFiltersSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
cavityEquipmentAssignRuleFilters = new KeyValue[cavityEquipmentAssignRuleFiltersSize];
|
|
for (int i=0; i<cavityEquipmentAssignRuleFiltersSize; i++)
|
|
{
|
|
cavityEquipmentAssignRuleFilters[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("cavityEquipmentAssignRuleFilters[" + i + "] .key (String): "));
|
|
cavityEquipmentAssignRuleFilters[i].key = getInput();
|
|
Console.Write(fillWithSpace("cavityEquipmentAssignRuleFilters[" + i + "] .value (String): "));
|
|
cavityEquipmentAssignRuleFilters[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for cavityEquipmentAssignRuleResultKeys: "));
|
|
int cavityEquipmentAssignRuleResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
cavityEquipmentAssignRuleResultKeys = new String[cavityEquipmentAssignRuleResultKeysSize];
|
|
for (int i=0; i<cavityEquipmentAssignRuleResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("cavityEquipmentAssignRuleResultKeys[" + i + "] (String): "));
|
|
cavityEquipmentAssignRuleResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.equGetCavityEquipmentAssignRule(sessionContext, stationNumber, cavityEquipmentAssignRuleFilters, cavityEquipmentAssignRuleResultKeys, out cavityEquipmentAssignRuleResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; cavityEquipmentAssignRuleResultValues != null && i<cavityEquipmentAssignRuleResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("cavityEquipmentAssignRuleResultValues[" + i + "]: ") + "<" + cavityEquipmentAssignRuleResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_execRuleSet
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "execRuleSet"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in int processLayer
|
|
/// in String ruleType
|
|
/// in String ruleSet
|
|
/// in KeyValue[] ruleProperties
|
|
/// out RuleResult[] ruleResults
|
|
/// </para>
|
|
public static void test_execRuleSet()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
int processLayer = 0;
|
|
String ruleType = "";
|
|
String ruleSet = "";
|
|
KeyValue[] ruleProperties = null;
|
|
RuleResult[] ruleResults = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("processLayer (int): "));
|
|
processLayer = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("ruleType (String): "));
|
|
ruleType = getInput();
|
|
Console.Write(fillWithSpace("ruleSet (String): "));
|
|
ruleSet = getInput();
|
|
Console.Write(fillWithSpace("Enter size for ruleProperties: "));
|
|
int rulePropertiesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
ruleProperties = new KeyValue[rulePropertiesSize];
|
|
for (int i=0; i<rulePropertiesSize; i++)
|
|
{
|
|
ruleProperties[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("ruleProperties[" + i + "] .key (String): "));
|
|
ruleProperties[i].key = getInput();
|
|
Console.Write(fillWithSpace("ruleProperties[" + i + "] .value (String): "));
|
|
ruleProperties[i].value = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.execRuleSet(sessionContext, stationNumber, processLayer, ruleType, ruleSet, ruleProperties, out ruleResults);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; ruleResults != null && i<ruleResults.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("ruleResults[" + i + "].ruleResult: ") + "<" + ruleResults[i].ruleResult + ">");
|
|
Console.WriteLine(fillWithSpace("ruleResults[" + i + "].prio: ") + "<" + ruleResults[i].prio + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_execFormula
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "execFormula"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] formulaReferences
|
|
/// in String[] formulaKeys
|
|
/// in String[] formulaValues
|
|
/// in String[] parameterKeys
|
|
/// in String[] parameterValues
|
|
/// in String[] resultKeys
|
|
/// out String[] resultValues
|
|
/// in String[] missingParameterKeys
|
|
/// out String[] missingParameterValues
|
|
/// </para>
|
|
public static void test_execFormula()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] formulaReferences = null;
|
|
String[] formulaKeys = null;
|
|
String[] formulaValues = null;
|
|
String[] parameterKeys = null;
|
|
String[] parameterValues = null;
|
|
String[] resultKeys = null;
|
|
String[] resultValues = null;
|
|
String[] missingParameterKeys = null;
|
|
String[] missingParameterValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for formulaReferences: "));
|
|
int formulaReferencesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
formulaReferences = new KeyValue[formulaReferencesSize];
|
|
for (int i=0; i<formulaReferencesSize; i++)
|
|
{
|
|
formulaReferences[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("formulaReferences[" + i + "] .key (String): "));
|
|
formulaReferences[i].key = getInput();
|
|
Console.Write(fillWithSpace("formulaReferences[" + i + "] .value (String): "));
|
|
formulaReferences[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for formulaKeys: "));
|
|
int formulaKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
formulaKeys = new String[formulaKeysSize];
|
|
for (int i=0; i<formulaKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("formulaKeys[" + i + "] (String): "));
|
|
formulaKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for formulaValues: "));
|
|
int formulaValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
formulaValues = new String[formulaValuesSize];
|
|
for (int i=0; i<formulaValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("formulaValues[" + i + "] (String): "));
|
|
formulaValues[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for parameterKeys: "));
|
|
int parameterKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
parameterKeys = new String[parameterKeysSize];
|
|
for (int i=0; i<parameterKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("parameterKeys[" + i + "] (String): "));
|
|
parameterKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for parameterValues: "));
|
|
int parameterValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
parameterValues = new String[parameterValuesSize];
|
|
for (int i=0; i<parameterValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("parameterValues[" + i + "] (String): "));
|
|
parameterValues[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for resultKeys: "));
|
|
int resultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
resultKeys = new String[resultKeysSize];
|
|
for (int i=0; i<resultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("resultKeys[" + i + "] (String): "));
|
|
resultKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for missingParameterKeys: "));
|
|
int missingParameterKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
missingParameterKeys = new String[missingParameterKeysSize];
|
|
for (int i=0; i<missingParameterKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("missingParameterKeys[" + i + "] (String): "));
|
|
missingParameterKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.execFormula(sessionContext, stationNumber, formulaReferences, formulaKeys, formulaValues, parameterKeys, parameterValues, resultKeys, out resultValues, missingParameterKeys, out missingParameterValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; resultValues != null && i<resultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("resultValues[" + i + "]: ") + "<" + resultValues[i] + ">");
|
|
}
|
|
for (int i=0; missingParameterValues != null && i<missingParameterValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("missingParameterValues[" + i + "]: ") + "<" + missingParameterValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_execFormulaCatalog
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "execFormulaCatalog"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String[] formulaKeys
|
|
/// in String[] formulaValues
|
|
/// in String[] parameterKeys
|
|
/// in String[] parameterValues
|
|
/// in String[] formularResultKeys
|
|
/// out String[] formularResultValues
|
|
/// </para>
|
|
public static void test_execFormulaCatalog()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String[] formulaKeys = null;
|
|
String[] formulaValues = null;
|
|
String[] parameterKeys = null;
|
|
String[] parameterValues = null;
|
|
String[] formularResultKeys = null;
|
|
String[] formularResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for formulaKeys: "));
|
|
int formulaKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
formulaKeys = new String[formulaKeysSize];
|
|
for (int i=0; i<formulaKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("formulaKeys[" + i + "] (String): "));
|
|
formulaKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for formulaValues: "));
|
|
int formulaValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
formulaValues = new String[formulaValuesSize];
|
|
for (int i=0; i<formulaValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("formulaValues[" + i + "] (String): "));
|
|
formulaValues[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for parameterKeys: "));
|
|
int parameterKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
parameterKeys = new String[parameterKeysSize];
|
|
for (int i=0; i<parameterKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("parameterKeys[" + i + "] (String): "));
|
|
parameterKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for parameterValues: "));
|
|
int parameterValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
parameterValues = new String[parameterValuesSize];
|
|
for (int i=0; i<parameterValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("parameterValues[" + i + "] (String): "));
|
|
parameterValues[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for formularResultKeys: "));
|
|
int formularResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
formularResultKeys = new String[formularResultKeysSize];
|
|
for (int i=0; i<formularResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("formularResultKeys[" + i + "] (String): "));
|
|
formularResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.execFormulaCatalog(sessionContext, stationNumber, formulaKeys, formulaValues, parameterKeys, parameterValues, formularResultKeys, out formularResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; formularResultValues != null && i<formularResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("formularResultValues[" + i + "]: ") + "<" + formularResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_execTimerProcess
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "execTimerProcess"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] timerProcessFilter
|
|
/// in String[] timerProcessResultKeys
|
|
/// out String[] timerProcessResultValues
|
|
/// </para>
|
|
public static void test_execTimerProcess()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] timerProcessFilter = null;
|
|
String[] timerProcessResultKeys = null;
|
|
String[] timerProcessResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for timerProcessFilter: "));
|
|
int timerProcessFilterSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
timerProcessFilter = new KeyValue[timerProcessFilterSize];
|
|
for (int i=0; i<timerProcessFilterSize; i++)
|
|
{
|
|
timerProcessFilter[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("timerProcessFilter[" + i + "] .key (String): "));
|
|
timerProcessFilter[i].key = getInput();
|
|
Console.Write(fillWithSpace("timerProcessFilter[" + i + "] .value (String): "));
|
|
timerProcessFilter[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for timerProcessResultKeys: "));
|
|
int timerProcessResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
timerProcessResultKeys = new String[timerProcessResultKeysSize];
|
|
for (int i=0; i<timerProcessResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("timerProcessResultKeys[" + i + "] (String): "));
|
|
timerProcessResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.execTimerProcess(sessionContext, stationNumber, timerProcessFilter, timerProcessResultKeys, out timerProcessResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; timerProcessResultValues != null && i<timerProcessResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("timerProcessResultValues[" + i + "]: ") + "<" + timerProcessResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_imsapiGetErrorText
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "imsapiGetErrorText"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in int errorCode
|
|
/// out String errorString
|
|
/// </para>
|
|
public static void test_imsapiGetErrorText()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
int errorCode = 0;
|
|
String errorString = "";
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("errorCode (int): "));
|
|
errorCode = Int32.Parse(getInput());
|
|
|
|
// call imsapi function
|
|
result = imsapi.imsapiGetErrorText(sessionContext, errorCode, out errorString);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
Console.WriteLine(fillWithSpace("errorString: ") + "<" + errorString + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_imsapiGetGroups
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "imsapiGetGroups"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// out ImsApiGroupStruct[] groupArray
|
|
/// </para>
|
|
public static void test_imsapiGetGroups()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
ImsApiGroupStruct[] groupArray = null;
|
|
|
|
// call imsapi function
|
|
result = imsapi.imsapiGetGroups(sessionContext, out groupArray);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; groupArray != null && i<groupArray.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("groupArray[" + i + "].groupName: ") + "<" + groupArray[i].groupName + ">");
|
|
Console.WriteLine(fillWithSpace("groupArray[" + i + "].groupDescr: ") + "<" + groupArray[i].groupDescr + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_imsapiGetFunctions
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "imsapiGetFunctions"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String groupName
|
|
/// out ImsApiFunctionStruct[] functionArray
|
|
/// </para>
|
|
public static void test_imsapiGetFunctions()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String groupName = "";
|
|
ImsApiFunctionStruct[] functionArray = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("groupName (String): "));
|
|
groupName = getInput();
|
|
|
|
// call imsapi function
|
|
result = imsapi.imsapiGetFunctions(sessionContext, groupName, out functionArray);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; functionArray != null && i<functionArray.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("functionArray[" + i + "].functionName: ") + "<" + functionArray[i].functionName + ">");
|
|
Console.WriteLine(fillWithSpace("functionArray[" + i + "].functionDescr: ") + "<" + functionArray[i].functionDescr + ">");
|
|
Console.WriteLine(fillWithSpace("functionArray[" + i + "].groupName: ") + "<" + functionArray[i].groupName + ">");
|
|
Console.WriteLine(fillWithSpace("functionArray[" + i + "].sinceVersion: ") + "<" + functionArray[i].sinceVersion + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_imsapiGetFunctionInfo
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "imsapiGetFunctionInfo"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String functionName
|
|
/// out ImsApiFunctionStruct functionInfo
|
|
/// out ImsApiParameterStruct[] parameterArray
|
|
/// </para>
|
|
public static void test_imsapiGetFunctionInfo()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String functionName = "";
|
|
ImsApiFunctionStruct functionInfo = new ImsApiFunctionStruct();
|
|
ImsApiParameterStruct[] parameterArray = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("functionName (String): "));
|
|
functionName = getInput();
|
|
|
|
// call imsapi function
|
|
result = imsapi.imsapiGetFunctionInfo(sessionContext, functionName, out functionInfo, out parameterArray);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
Console.WriteLine(fillWithSpace("functionInfo.functionName: ") + "<" + functionInfo.functionName + ">");
|
|
Console.WriteLine(fillWithSpace("functionInfo.functionDescr: ") + "<" + functionInfo.functionDescr + ">");
|
|
Console.WriteLine(fillWithSpace("functionInfo.groupName: ") + "<" + functionInfo.groupName + ">");
|
|
Console.WriteLine(fillWithSpace("functionInfo.sinceVersion: ") + "<" + functionInfo.sinceVersion + ">");
|
|
for (int i=0; parameterArray != null && i<parameterArray.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("parameterArray[" + i + "].paramName: ") + "<" + parameterArray[i].paramName + ">");
|
|
Console.WriteLine(fillWithSpace("parameterArray[" + i + "].paramDescr: ") + "<" + parameterArray[i].paramDescr + ">");
|
|
Console.WriteLine(fillWithSpace("parameterArray[" + i + "].dataType: ") + "<" + parameterArray[i].dataType + ">");
|
|
Console.WriteLine(fillWithSpace("parameterArray[" + i + "].conditionParamName: ") + "<" + parameterArray[i].conditionParamName + ">");
|
|
Console.WriteLine(fillWithSpace("parameterArray[" + i + "].hasKeys: ") + "<" + parameterArray[i].hasKeys + ">");
|
|
Console.WriteLine(fillWithSpace("parameterArray[" + i + "].keyParamName: ") + "<" + parameterArray[i].keyParamName + ">");
|
|
Console.WriteLine(fillWithSpace("parameterArray[" + i + "].direction: ") + "<" + parameterArray[i].direction + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_imsapiGetParameterConditions
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "imsapiGetParameterConditions"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String functionName
|
|
/// in String parameterName
|
|
/// out String conditionParamName
|
|
/// out ImsApiParamConditionStruct[] parameterConditionArray
|
|
/// </para>
|
|
public static void test_imsapiGetParameterConditions()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String functionName = "";
|
|
String parameterName = "";
|
|
String conditionParamName = "";
|
|
ImsApiParamConditionStruct[] parameterConditionArray = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("functionName (String): "));
|
|
functionName = getInput();
|
|
Console.Write(fillWithSpace("parameterName (String): "));
|
|
parameterName = getInput();
|
|
|
|
// call imsapi function
|
|
result = imsapi.imsapiGetParameterConditions(sessionContext, functionName, parameterName, out conditionParamName, out parameterConditionArray);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
Console.WriteLine(fillWithSpace("conditionParamName: ") + "<" + conditionParamName + ">");
|
|
for (int i=0; parameterConditionArray != null && i<parameterConditionArray.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("parameterConditionArray[" + i + "].conditionValue: ") + "<" + parameterConditionArray[i].conditionValue + ">");
|
|
Console.WriteLine(fillWithSpace("parameterConditionArray[" + i + "].conditionDescr: ") + "<" + parameterConditionArray[i].conditionDescr + ">");
|
|
Console.WriteLine(fillWithSpace("parameterConditionArray[" + i + "].sinceVersion: ") + "<" + parameterConditionArray[i].sinceVersion + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_imsapiGetParameterInfo
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "imsapiGetParameterInfo"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String functionName
|
|
/// in String parameterName
|
|
/// in String conditionValue
|
|
/// out ImsApiParameterStruct parameter
|
|
/// out ImsApiParamConditionStruct condition
|
|
/// out ImsApiKeyStruct[] keys
|
|
/// </para>
|
|
public static void test_imsapiGetParameterInfo()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String functionName = "";
|
|
String parameterName = "";
|
|
String conditionValue = "";
|
|
ImsApiParameterStruct parameter = new ImsApiParameterStruct();
|
|
ImsApiParamConditionStruct condition = new ImsApiParamConditionStruct();
|
|
ImsApiKeyStruct[] keys = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("functionName (String): "));
|
|
functionName = getInput();
|
|
Console.Write(fillWithSpace("parameterName (String): "));
|
|
parameterName = getInput();
|
|
Console.Write(fillWithSpace("conditionValue (String): "));
|
|
conditionValue = getInput();
|
|
|
|
// call imsapi function
|
|
result = imsapi.imsapiGetParameterInfo(sessionContext, functionName, parameterName, conditionValue, out parameter, out condition, out keys);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
Console.WriteLine(fillWithSpace("parameter.paramName: ") + "<" + parameter.paramName + ">");
|
|
Console.WriteLine(fillWithSpace("parameter.paramDescr: ") + "<" + parameter.paramDescr + ">");
|
|
Console.WriteLine(fillWithSpace("parameter.dataType: ") + "<" + parameter.dataType + ">");
|
|
Console.WriteLine(fillWithSpace("parameter.conditionParamName: ") + "<" + parameter.conditionParamName + ">");
|
|
Console.WriteLine(fillWithSpace("parameter.hasKeys: ") + "<" + parameter.hasKeys + ">");
|
|
Console.WriteLine(fillWithSpace("parameter.keyParamName: ") + "<" + parameter.keyParamName + ">");
|
|
Console.WriteLine(fillWithSpace("parameter.direction: ") + "<" + parameter.direction + ">");
|
|
Console.WriteLine(fillWithSpace("condition.conditionValue: ") + "<" + condition.conditionValue + ">");
|
|
Console.WriteLine(fillWithSpace("condition.conditionDescr: ") + "<" + condition.conditionDescr + ">");
|
|
Console.WriteLine(fillWithSpace("condition.sinceVersion: ") + "<" + condition.sinceVersion + ">");
|
|
for (int i=0; keys != null && i<keys.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("keys[" + i + "].keyName: ") + "<" + keys[i].keyName + ">");
|
|
Console.WriteLine(fillWithSpace("keys[" + i + "].keyDescr: ") + "<" + keys[i].keyDescr + ">");
|
|
Console.WriteLine(fillWithSpace("keys[" + i + "].dataType: ") + "<" + keys[i].dataType + ">");
|
|
Console.WriteLine(fillWithSpace("keys[" + i + "].sinceVersion: ") + "<" + keys[i].sinceVersion + ">");
|
|
Console.WriteLine(fillWithSpace("keys[" + i + "].isRequired: ") + "<" + keys[i].isRequired + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_imsapiGetSystemInfos
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "imsapiGetSystemInfos"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String[] systemInfoResultKeys
|
|
/// out String[] systemInfoResultValues
|
|
/// </para>
|
|
public static void test_imsapiGetSystemInfos()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String[] systemInfoResultKeys = null;
|
|
String[] systemInfoResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("Enter size for systemInfoResultKeys: "));
|
|
int systemInfoResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
systemInfoResultKeys = new String[systemInfoResultKeysSize];
|
|
for (int i=0; i<systemInfoResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("systemInfoResultKeys[" + i + "] (String): "));
|
|
systemInfoResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.imsapiGetSystemInfos(sessionContext, systemInfoResultKeys, out systemInfoResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; systemInfoResultValues != null && i<systemInfoResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("systemInfoResultValues[" + i + "]: ") + "<" + systemInfoResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_imsapiGetErrorList
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "imsapiGetErrorList"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String[] localeArray
|
|
/// in String[] groupNameArray
|
|
/// in String[] functionNameArray
|
|
/// in int[] errorCodes
|
|
/// in String[] errorCodeResultKeys
|
|
/// out String[] errorCodeResultValues
|
|
/// </para>
|
|
public static void test_imsapiGetErrorList()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String[] localeArray = null;
|
|
String[] groupNameArray = null;
|
|
String[] functionNameArray = null;
|
|
int[] errorCodes = null;
|
|
String[] errorCodeResultKeys = null;
|
|
String[] errorCodeResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("Enter size for localeArray: "));
|
|
int localeArraySize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
localeArray = new String[localeArraySize];
|
|
for (int i=0; i<localeArraySize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("localeArray[" + i + "] (String): "));
|
|
localeArray[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for groupNameArray: "));
|
|
int groupNameArraySize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
groupNameArray = new String[groupNameArraySize];
|
|
for (int i=0; i<groupNameArraySize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("groupNameArray[" + i + "] (String): "));
|
|
groupNameArray[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for functionNameArray: "));
|
|
int functionNameArraySize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
functionNameArray = new String[functionNameArraySize];
|
|
for (int i=0; i<functionNameArraySize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("functionNameArray[" + i + "] (String): "));
|
|
functionNameArray[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for errorCodes: "));
|
|
int errorCodesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
errorCodes = new int[errorCodesSize];
|
|
for (int i=0; i<errorCodesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("errorCodes[" + i + "] (int): "));
|
|
errorCodes[i] = Int32.Parse(getInput());
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for errorCodeResultKeys: "));
|
|
int errorCodeResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
errorCodeResultKeys = new String[errorCodeResultKeysSize];
|
|
for (int i=0; i<errorCodeResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("errorCodeResultKeys[" + i + "] (String): "));
|
|
errorCodeResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.imsapiGetErrorList(sessionContext, localeArray, groupNameArray, functionNameArray, errorCodes, errorCodeResultKeys, out errorCodeResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; errorCodeResultValues != null && i<errorCodeResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("errorCodeResultValues[" + i + "]: ") + "<" + errorCodeResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_lockGetLockedObjects
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "lockGetLockedObjects"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in int objectType
|
|
/// in String objectNumber
|
|
/// in String objectDetail
|
|
/// in String lockGroupName
|
|
/// in long lockDateFrom
|
|
/// in long lockDateTo
|
|
/// in int lockState
|
|
/// in int maxRows
|
|
/// in String[] objectResultKeys
|
|
/// out String[] objectResultValues
|
|
/// </para>
|
|
public static void test_lockGetLockedObjects()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
int objectType = 0;
|
|
String objectNumber = "";
|
|
String objectDetail = "";
|
|
String lockGroupName = "";
|
|
long lockDateFrom = 0;
|
|
long lockDateTo = 0;
|
|
int lockState = 0;
|
|
int maxRows = 0;
|
|
String[] objectResultKeys = null;
|
|
String[] objectResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("objectType (int): "));
|
|
objectType = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("objectNumber (String): "));
|
|
objectNumber = getInput();
|
|
Console.Write(fillWithSpace("objectDetail (String): "));
|
|
objectDetail = getInput();
|
|
Console.Write(fillWithSpace("lockGroupName (String): "));
|
|
lockGroupName = getInput();
|
|
Console.Write(fillWithSpace("lockDateFrom (long): "));
|
|
lockDateFrom = Int64.Parse(getInput());
|
|
Console.Write(fillWithSpace("lockDateTo (long): "));
|
|
lockDateTo = Int64.Parse(getInput());
|
|
Console.Write(fillWithSpace("lockState (int): "));
|
|
lockState = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("maxRows (int): "));
|
|
maxRows = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("Enter size for objectResultKeys: "));
|
|
int objectResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
objectResultKeys = new String[objectResultKeysSize];
|
|
for (int i=0; i<objectResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("objectResultKeys[" + i + "] (String): "));
|
|
objectResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.lockGetLockedObjects(sessionContext, stationNumber, objectType, objectNumber, objectDetail, lockGroupName, lockDateFrom, lockDateTo, lockState, maxRows, objectResultKeys, out objectResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; objectResultValues != null && i<objectResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("objectResultValues[" + i + "]: ") + "<" + objectResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_lockObjects
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "lockObjects"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in int objectType
|
|
/// in String lockGroupName
|
|
/// in String lockInformation
|
|
/// in long lockDate
|
|
/// in int lockDependencies
|
|
/// in String[] objectUploadKeys
|
|
/// in String[] objectUploadValues
|
|
/// out String[] objectResultValues
|
|
/// </para>
|
|
public static void test_lockObjects()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
int objectType = 0;
|
|
String lockGroupName = "";
|
|
String lockInformation = "";
|
|
long lockDate = 0;
|
|
int lockDependencies = 0;
|
|
String[] objectUploadKeys = null;
|
|
String[] objectUploadValues = null;
|
|
String[] objectResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("objectType (int): "));
|
|
objectType = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("lockGroupName (String): "));
|
|
lockGroupName = getInput();
|
|
Console.Write(fillWithSpace("lockInformation (String): "));
|
|
lockInformation = getInput();
|
|
Console.Write(fillWithSpace("lockDate (long): "));
|
|
lockDate = Int64.Parse(getInput());
|
|
Console.Write(fillWithSpace("lockDependencies (int): "));
|
|
lockDependencies = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("Enter size for objectUploadKeys: "));
|
|
int objectUploadKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
objectUploadKeys = new String[objectUploadKeysSize];
|
|
for (int i=0; i<objectUploadKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("objectUploadKeys[" + i + "] (String): "));
|
|
objectUploadKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for objectUploadValues: "));
|
|
int objectUploadValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
objectUploadValues = new String[objectUploadValuesSize];
|
|
for (int i=0; i<objectUploadValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("objectUploadValues[" + i + "] (String): "));
|
|
objectUploadValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.lockObjects(sessionContext, stationNumber, objectType, lockGroupName, lockInformation, lockDate, lockDependencies, objectUploadKeys, objectUploadValues, out objectResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; objectResultValues != null && i<objectResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("objectResultValues[" + i + "]: ") + "<" + objectResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_lockUnlockObjects
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "lockUnlockObjects"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in int objectType
|
|
/// in String lockGroupName
|
|
/// in String unlockInformation
|
|
/// in int unlockCompleteGroup
|
|
/// in long unlockDate
|
|
/// in int lockDependencies
|
|
/// in String[] objectUploadKeys
|
|
/// in String[] objectUploadValues
|
|
/// out String[] objectResultValues
|
|
/// </para>
|
|
public static void test_lockUnlockObjects()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
int objectType = 0;
|
|
String lockGroupName = "";
|
|
String unlockInformation = "";
|
|
int unlockCompleteGroup = 0;
|
|
long unlockDate = 0;
|
|
int lockDependencies = 0;
|
|
String[] objectUploadKeys = null;
|
|
String[] objectUploadValues = null;
|
|
String[] objectResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("objectType (int): "));
|
|
objectType = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("lockGroupName (String): "));
|
|
lockGroupName = getInput();
|
|
Console.Write(fillWithSpace("unlockInformation (String): "));
|
|
unlockInformation = getInput();
|
|
Console.Write(fillWithSpace("unlockCompleteGroup (int): "));
|
|
unlockCompleteGroup = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("unlockDate (long): "));
|
|
unlockDate = Int64.Parse(getInput());
|
|
Console.Write(fillWithSpace("lockDependencies (int): "));
|
|
lockDependencies = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("Enter size for objectUploadKeys: "));
|
|
int objectUploadKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
objectUploadKeys = new String[objectUploadKeysSize];
|
|
for (int i=0; i<objectUploadKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("objectUploadKeys[" + i + "] (String): "));
|
|
objectUploadKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for objectUploadValues: "));
|
|
int objectUploadValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
objectUploadValues = new String[objectUploadValuesSize];
|
|
for (int i=0; i<objectUploadValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("objectUploadValues[" + i + "] (String): "));
|
|
objectUploadValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.lockUnlockObjects(sessionContext, stationNumber, objectType, lockGroupName, unlockInformation, unlockCompleteGroup, unlockDate, lockDependencies, objectUploadKeys, objectUploadValues, out objectResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; objectResultValues != null && i<objectResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("objectResultValues[" + i + "]: ") + "<" + objectResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_lockGetLockGroups
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "lockGetLockGroups"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] lockGroupFilter
|
|
/// in String[] lockGroupResultKeys
|
|
/// in String[] lockClassResultKeys
|
|
/// in String[] lockOutResultKeys
|
|
/// out String[] lockGroupResultValues
|
|
/// out String[] lockClassResultValues
|
|
/// out String[] lockOutResultValues
|
|
/// </para>
|
|
public static void test_lockGetLockGroups()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] lockGroupFilter = null;
|
|
String[] lockGroupResultKeys = null;
|
|
String[] lockClassResultKeys = null;
|
|
String[] lockOutResultKeys = null;
|
|
String[] lockGroupResultValues = null;
|
|
String[] lockClassResultValues = null;
|
|
String[] lockOutResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for lockGroupFilter: "));
|
|
int lockGroupFilterSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
lockGroupFilter = new KeyValue[lockGroupFilterSize];
|
|
for (int i=0; i<lockGroupFilterSize; i++)
|
|
{
|
|
lockGroupFilter[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("lockGroupFilter[" + i + "] .key (String): "));
|
|
lockGroupFilter[i].key = getInput();
|
|
Console.Write(fillWithSpace("lockGroupFilter[" + i + "] .value (String): "));
|
|
lockGroupFilter[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for lockGroupResultKeys: "));
|
|
int lockGroupResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
lockGroupResultKeys = new String[lockGroupResultKeysSize];
|
|
for (int i=0; i<lockGroupResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("lockGroupResultKeys[" + i + "] (String): "));
|
|
lockGroupResultKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for lockClassResultKeys: "));
|
|
int lockClassResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
lockClassResultKeys = new String[lockClassResultKeysSize];
|
|
for (int i=0; i<lockClassResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("lockClassResultKeys[" + i + "] (String): "));
|
|
lockClassResultKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for lockOutResultKeys: "));
|
|
int lockOutResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
lockOutResultKeys = new String[lockOutResultKeysSize];
|
|
for (int i=0; i<lockOutResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("lockOutResultKeys[" + i + "] (String): "));
|
|
lockOutResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.lockGetLockGroups(sessionContext, stationNumber, lockGroupFilter, lockGroupResultKeys, lockClassResultKeys, lockOutResultKeys, out lockGroupResultValues, out lockClassResultValues, out lockOutResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; lockGroupResultValues != null && i<lockGroupResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("lockGroupResultValues[" + i + "]: ") + "<" + lockGroupResultValues[i] + ">");
|
|
}
|
|
for (int i=0; lockClassResultValues != null && i<lockClassResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("lockClassResultValues[" + i + "]: ") + "<" + lockClassResultValues[i] + ">");
|
|
}
|
|
for (int i=0; lockOutResultValues != null && i<lockOutResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("lockOutResultValues[" + i + "]: ") + "<" + lockOutResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdaGetRecipeData
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdaGetRecipeData"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in int recipeVersionId
|
|
/// in String function
|
|
/// in String functionStep
|
|
/// in String measurementName
|
|
/// in double sequentialNumber
|
|
/// in String type
|
|
/// in String measurementType
|
|
/// in int objectType
|
|
/// in KeyValue[] recipeFilters
|
|
/// in String[] recipeResultKeys
|
|
/// out String[] recipeResultValues
|
|
/// </para>
|
|
public static void test_mdaGetRecipeData()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
int recipeVersionId = 0;
|
|
String function = "";
|
|
String functionStep = "";
|
|
String measurementName = "";
|
|
double sequentialNumber = 0.0;
|
|
String type = "";
|
|
String measurementType = "";
|
|
int objectType = 0;
|
|
KeyValue[] recipeFilters = null;
|
|
String[] recipeResultKeys = null;
|
|
String[] recipeResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("recipeVersionId (int): "));
|
|
recipeVersionId = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("function (String): "));
|
|
function = getInput();
|
|
Console.Write(fillWithSpace("functionStep (String): "));
|
|
functionStep = getInput();
|
|
Console.Write(fillWithSpace("measurementName (String): "));
|
|
measurementName = getInput();
|
|
Console.Write(fillWithSpace("sequentialNumber (double): "));
|
|
sequentialNumber = Double.Parse(getInput());
|
|
Console.Write(fillWithSpace("type (String): "));
|
|
type = getInput();
|
|
Console.Write(fillWithSpace("measurementType (String): "));
|
|
measurementType = getInput();
|
|
Console.Write(fillWithSpace("objectType (int): "));
|
|
objectType = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("Enter size for recipeFilters: "));
|
|
int recipeFiltersSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
recipeFilters = new KeyValue[recipeFiltersSize];
|
|
for (int i=0; i<recipeFiltersSize; i++)
|
|
{
|
|
recipeFilters[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("recipeFilters[" + i + "] .key (String): "));
|
|
recipeFilters[i].key = getInput();
|
|
Console.Write(fillWithSpace("recipeFilters[" + i + "] .value (String): "));
|
|
recipeFilters[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for recipeResultKeys: "));
|
|
int recipeResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
recipeResultKeys = new String[recipeResultKeysSize];
|
|
for (int i=0; i<recipeResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("recipeResultKeys[" + i + "] (String): "));
|
|
recipeResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdaGetRecipeData(sessionContext, stationNumber, recipeVersionId, function, functionStep, measurementName, sequentialNumber, type, measurementType, objectType, recipeFilters, recipeResultKeys, out recipeResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; recipeResultValues != null && i<recipeResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("recipeResultValues[" + i + "]: ") + "<" + recipeResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdaActivateRecipe
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdaActivateRecipe"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in int functionMode
|
|
/// in int recipeId
|
|
/// in int recipeVersionId
|
|
/// </para>
|
|
public static void test_mdaActivateRecipe()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
int functionMode = 0;
|
|
int recipeId = 0;
|
|
int recipeVersionId = 0;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("functionMode (int): "));
|
|
functionMode = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("recipeId (int): "));
|
|
recipeId = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("recipeVersionId (int): "));
|
|
recipeVersionId = Int32.Parse(getInput());
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdaActivateRecipe(sessionContext, stationNumber, functionMode, recipeId, recipeVersionId);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdaCreateRecipe
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdaCreateRecipe"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String versionName
|
|
/// in String versionDesc
|
|
/// in int majorVersionChange
|
|
/// in bool activate
|
|
/// in long creationDate
|
|
/// in int objectType
|
|
/// in KeyValue[] recipeFilters
|
|
/// in String[] recipeUploadKeys
|
|
/// in String[] recipeUploadValues
|
|
/// out String[] recipeResultValues
|
|
/// </para>
|
|
public static void test_mdaCreateRecipe()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String versionName = "";
|
|
String versionDesc = "";
|
|
int majorVersionChange = 0;
|
|
bool activate = false;
|
|
long creationDate = 0;
|
|
int objectType = 0;
|
|
KeyValue[] recipeFilters = null;
|
|
String[] recipeUploadKeys = null;
|
|
String[] recipeUploadValues = null;
|
|
String[] recipeResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("versionName (String): "));
|
|
versionName = getInput();
|
|
Console.Write(fillWithSpace("versionDesc (String): "));
|
|
versionDesc = getInput();
|
|
Console.Write(fillWithSpace("majorVersionChange (int): "));
|
|
majorVersionChange = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("activate (bool): "));
|
|
activate = Boolean.Parse(getInput());
|
|
Console.Write(fillWithSpace("creationDate (long): "));
|
|
creationDate = Int64.Parse(getInput());
|
|
Console.Write(fillWithSpace("objectType (int): "));
|
|
objectType = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("Enter size for recipeFilters: "));
|
|
int recipeFiltersSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
recipeFilters = new KeyValue[recipeFiltersSize];
|
|
for (int i=0; i<recipeFiltersSize; i++)
|
|
{
|
|
recipeFilters[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("recipeFilters[" + i + "] .key (String): "));
|
|
recipeFilters[i].key = getInput();
|
|
Console.Write(fillWithSpace("recipeFilters[" + i + "] .value (String): "));
|
|
recipeFilters[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for recipeUploadKeys: "));
|
|
int recipeUploadKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
recipeUploadKeys = new String[recipeUploadKeysSize];
|
|
for (int i=0; i<recipeUploadKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("recipeUploadKeys[" + i + "] (String): "));
|
|
recipeUploadKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for recipeUploadValues: "));
|
|
int recipeUploadValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
recipeUploadValues = new String[recipeUploadValuesSize];
|
|
for (int i=0; i<recipeUploadValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("recipeUploadValues[" + i + "] (String): "));
|
|
recipeUploadValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdaCreateRecipe(sessionContext, stationNumber, versionName, versionDesc, majorVersionChange, activate, creationDate, objectType, recipeFilters, recipeUploadKeys, recipeUploadValues, out recipeResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; recipeResultValues != null && i<recipeResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("recipeResultValues[" + i + "]: ") + "<" + recipeResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdaGetDocuments
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdaGetDocuments"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] attributeFilters
|
|
/// in KeyValue[] dataTypeFilters
|
|
/// in String[] mdaResultKeys
|
|
/// out String[] mdaResultValues
|
|
/// </para>
|
|
public static void test_mdaGetDocuments()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] attributeFilters = null;
|
|
KeyValue[] dataTypeFilters = null;
|
|
String[] mdaResultKeys = null;
|
|
String[] mdaResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for attributeFilters: "));
|
|
int attributeFiltersSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
attributeFilters = new KeyValue[attributeFiltersSize];
|
|
for (int i=0; i<attributeFiltersSize; i++)
|
|
{
|
|
attributeFilters[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("attributeFilters[" + i + "] .key (String): "));
|
|
attributeFilters[i].key = getInput();
|
|
Console.Write(fillWithSpace("attributeFilters[" + i + "] .value (String): "));
|
|
attributeFilters[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for dataTypeFilters: "));
|
|
int dataTypeFiltersSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
dataTypeFilters = new KeyValue[dataTypeFiltersSize];
|
|
for (int i=0; i<dataTypeFiltersSize; i++)
|
|
{
|
|
dataTypeFilters[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("dataTypeFilters[" + i + "] .key (String): "));
|
|
dataTypeFilters[i].key = getInput();
|
|
Console.Write(fillWithSpace("dataTypeFilters[" + i + "] .value (String): "));
|
|
dataTypeFilters[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for mdaResultKeys: "));
|
|
int mdaResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
mdaResultKeys = new String[mdaResultKeysSize];
|
|
for (int i=0; i<mdaResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("mdaResultKeys[" + i + "] (String): "));
|
|
mdaResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdaGetDocuments(sessionContext, stationNumber, attributeFilters, dataTypeFilters, mdaResultKeys, out mdaResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; mdaResultValues != null && i<mdaResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("mdaResultValues[" + i + "]: ") + "<" + mdaResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdaUploadDocument
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdaUploadDocument"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in int targetType
|
|
/// in KeyValue[] attributeValues
|
|
/// in KeyValue[] mdaValues
|
|
/// in byte[] content
|
|
/// </para>
|
|
public static void test_mdaUploadDocument()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
int targetType = 0;
|
|
KeyValue[] attributeValues = null;
|
|
KeyValue[] mdaValues = null;
|
|
byte[] content = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("targetType (int): "));
|
|
targetType = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("Enter size for attributeValues: "));
|
|
int attributeValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
attributeValues = new KeyValue[attributeValuesSize];
|
|
for (int i=0; i<attributeValuesSize; i++)
|
|
{
|
|
attributeValues[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("attributeValues[" + i + "] .key (String): "));
|
|
attributeValues[i].key = getInput();
|
|
Console.Write(fillWithSpace("attributeValues[" + i + "] .value (String): "));
|
|
attributeValues[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for mdaValues: "));
|
|
int mdaValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
mdaValues = new KeyValue[mdaValuesSize];
|
|
for (int i=0; i<mdaValuesSize; i++)
|
|
{
|
|
mdaValues[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("mdaValues[" + i + "] .key (String): "));
|
|
mdaValues[i].key = getInput();
|
|
Console.Write(fillWithSpace("mdaValues[" + i + "] .value (String): "));
|
|
mdaValues[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for content: "));
|
|
int contentSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
content = new byte[contentSize];
|
|
for (int i=0; i<contentSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("content[" + i + "] (byte): "));
|
|
content[i] = Byte.Parse(getInput());
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdaUploadDocument(sessionContext, stationNumber, targetType, attributeValues, mdaValues, content);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdaGetDocumentContent
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdaGetDocumentContent"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in long documentId
|
|
/// out byte[] content
|
|
/// </para>
|
|
public static void test_mdaGetDocumentContent()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
long documentId = 0;
|
|
byte[] content = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("documentId (long): "));
|
|
documentId = Int64.Parse(getInput());
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdaGetDocumentContent(sessionContext, stationNumber, documentId, out content);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; content != null && i<content.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("content[" + i + "]: ") + "<" + content[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdaGetRecipeHeaderAndVersion
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdaGetRecipeHeaderAndVersion"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in int objectType
|
|
/// in KeyValue[] recipeHeaderFilter
|
|
/// in String[] recipeHeaderResultKeys
|
|
/// out String[] recipeHeaderResultValues
|
|
/// </para>
|
|
public static void test_mdaGetRecipeHeaderAndVersion()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
int objectType = 0;
|
|
KeyValue[] recipeHeaderFilter = null;
|
|
String[] recipeHeaderResultKeys = null;
|
|
String[] recipeHeaderResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("objectType (int): "));
|
|
objectType = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("Enter size for recipeHeaderFilter: "));
|
|
int recipeHeaderFilterSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
recipeHeaderFilter = new KeyValue[recipeHeaderFilterSize];
|
|
for (int i=0; i<recipeHeaderFilterSize; i++)
|
|
{
|
|
recipeHeaderFilter[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("recipeHeaderFilter[" + i + "] .key (String): "));
|
|
recipeHeaderFilter[i].key = getInput();
|
|
Console.Write(fillWithSpace("recipeHeaderFilter[" + i + "] .value (String): "));
|
|
recipeHeaderFilter[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for recipeHeaderResultKeys: "));
|
|
int recipeHeaderResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
recipeHeaderResultKeys = new String[recipeHeaderResultKeysSize];
|
|
for (int i=0; i<recipeHeaderResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("recipeHeaderResultKeys[" + i + "] (String): "));
|
|
recipeHeaderResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdaGetRecipeHeaderAndVersion(sessionContext, stationNumber, objectType, recipeHeaderFilter, recipeHeaderResultKeys, out recipeHeaderResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; recipeHeaderResultValues != null && i<recipeHeaderResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("recipeHeaderResultValues[" + i + "]: ") + "<" + recipeHeaderResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdaActivateDocument
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdaActivateDocument"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String[] mdaActivateDocumentKeys
|
|
/// in String[] mdaActivateDocumentValues
|
|
/// out String[] mdaActivateDocumentResult
|
|
/// </para>
|
|
public static void test_mdaActivateDocument()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String[] mdaActivateDocumentKeys = null;
|
|
String[] mdaActivateDocumentValues = null;
|
|
String[] mdaActivateDocumentResult = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for mdaActivateDocumentKeys: "));
|
|
int mdaActivateDocumentKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
mdaActivateDocumentKeys = new String[mdaActivateDocumentKeysSize];
|
|
for (int i=0; i<mdaActivateDocumentKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("mdaActivateDocumentKeys[" + i + "] (String): "));
|
|
mdaActivateDocumentKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for mdaActivateDocumentValues: "));
|
|
int mdaActivateDocumentValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
mdaActivateDocumentValues = new String[mdaActivateDocumentValuesSize];
|
|
for (int i=0; i<mdaActivateDocumentValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("mdaActivateDocumentValues[" + i + "] (String): "));
|
|
mdaActivateDocumentValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdaActivateDocument(sessionContext, stationNumber, mdaActivateDocumentKeys, mdaActivateDocumentValues, out mdaActivateDocumentResult);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; mdaActivateDocumentResult != null && i<mdaActivateDocumentResult.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("mdaActivateDocumentResult[" + i + "]: ") + "<" + mdaActivateDocumentResult[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdaUploadCustomFunction
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdaUploadCustomFunction"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] mdaValues
|
|
/// in byte[] content
|
|
/// </para>
|
|
public static void test_mdaUploadCustomFunction()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] mdaValues = null;
|
|
byte[] content = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for mdaValues: "));
|
|
int mdaValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
mdaValues = new KeyValue[mdaValuesSize];
|
|
for (int i=0; i<mdaValuesSize; i++)
|
|
{
|
|
mdaValues[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("mdaValues[" + i + "] .key (String): "));
|
|
mdaValues[i].key = getInput();
|
|
Console.Write(fillWithSpace("mdaValues[" + i + "] .value (String): "));
|
|
mdaValues[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for content: "));
|
|
int contentSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
content = new byte[contentSize];
|
|
for (int i=0; i<contentSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("content[" + i + "] (byte): "));
|
|
content[i] = Byte.Parse(getInput());
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdaUploadCustomFunction(sessionContext, stationNumber, mdaValues, content);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdataGetPartData
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdataGetPartData"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] partFilter
|
|
/// in String[] partDataResultKeys
|
|
/// out String[] partDataResultValues
|
|
/// </para>
|
|
public static void test_mdataGetPartData()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] partFilter = null;
|
|
String[] partDataResultKeys = null;
|
|
String[] partDataResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for partFilter: "));
|
|
int partFilterSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
partFilter = new KeyValue[partFilterSize];
|
|
for (int i=0; i<partFilterSize; i++)
|
|
{
|
|
partFilter[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("partFilter[" + i + "] .key (String): "));
|
|
partFilter[i].key = getInput();
|
|
Console.Write(fillWithSpace("partFilter[" + i + "] .value (String): "));
|
|
partFilter[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for partDataResultKeys: "));
|
|
int partDataResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
partDataResultKeys = new String[partDataResultKeysSize];
|
|
for (int i=0; i<partDataResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("partDataResultKeys[" + i + "] (String): "));
|
|
partDataResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdataGetPartData(sessionContext, stationNumber, partFilter, partDataResultKeys, out partDataResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; partDataResultValues != null && i<partDataResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("partDataResultValues[" + i + "]: ") + "<" + partDataResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdataGetProductInfo
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdataGetProductInfo"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String partNumber
|
|
/// in int bomVersion
|
|
/// in String bomIndex
|
|
/// in int processVersion
|
|
/// in int desolvingFlag
|
|
/// in int onlyReleased
|
|
/// in int onlyValid
|
|
/// in String[] productInfoResultKeys
|
|
/// out String[] productInfoResultValues
|
|
/// </para>
|
|
public static void test_mdataGetProductInfo()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String partNumber = "";
|
|
int bomVersion = 0;
|
|
String bomIndex = "";
|
|
int processVersion = 0;
|
|
int desolvingFlag = 0;
|
|
int onlyReleased = 0;
|
|
int onlyValid = 0;
|
|
String[] productInfoResultKeys = null;
|
|
String[] productInfoResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("partNumber (String): "));
|
|
partNumber = getInput();
|
|
Console.Write(fillWithSpace("bomVersion (int): "));
|
|
bomVersion = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("bomIndex (String): "));
|
|
bomIndex = getInput();
|
|
Console.Write(fillWithSpace("processVersion (int): "));
|
|
processVersion = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("desolvingFlag (int): "));
|
|
desolvingFlag = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("onlyReleased (int): "));
|
|
onlyReleased = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("onlyValid (int): "));
|
|
onlyValid = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("Enter size for productInfoResultKeys: "));
|
|
int productInfoResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
productInfoResultKeys = new String[productInfoResultKeysSize];
|
|
for (int i=0; i<productInfoResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("productInfoResultKeys[" + i + "] (String): "));
|
|
productInfoResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdataGetProductInfo(sessionContext, stationNumber, partNumber, bomVersion, bomIndex, processVersion, desolvingFlag, onlyReleased, onlyValid, productInfoResultKeys, out productInfoResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; productInfoResultValues != null && i<productInfoResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("productInfoResultValues[" + i + "]: ") + "<" + productInfoResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdataBomVerify
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdataBomVerify"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in int processLayer
|
|
/// in String workOrderNumber
|
|
/// in String productNumber
|
|
/// in String bareBoardNumber
|
|
/// in String bomIndex
|
|
/// in String bomInfo
|
|
/// in int bomValidFrom
|
|
/// in String bomVersionERP
|
|
/// in int verifyCompNameBased
|
|
/// in int createNewBom
|
|
/// in String[] bomUploadKeys
|
|
/// in String[] bomUploadValues
|
|
/// out String[] bomResultValues
|
|
/// </para>
|
|
public static void test_mdataBomVerify()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
int processLayer = 0;
|
|
String workOrderNumber = "";
|
|
String productNumber = "";
|
|
String bareBoardNumber = "";
|
|
String bomIndex = "";
|
|
String bomInfo = "";
|
|
int bomValidFrom = 0;
|
|
String bomVersionERP = "";
|
|
int verifyCompNameBased = 0;
|
|
int createNewBom = 0;
|
|
String[] bomUploadKeys = null;
|
|
String[] bomUploadValues = null;
|
|
String[] bomResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("processLayer (int): "));
|
|
processLayer = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("workOrderNumber (String): "));
|
|
workOrderNumber = getInput();
|
|
Console.Write(fillWithSpace("productNumber (String): "));
|
|
productNumber = getInput();
|
|
Console.Write(fillWithSpace("bareBoardNumber (String): "));
|
|
bareBoardNumber = getInput();
|
|
Console.Write(fillWithSpace("bomIndex (String): "));
|
|
bomIndex = getInput();
|
|
Console.Write(fillWithSpace("bomInfo (String): "));
|
|
bomInfo = getInput();
|
|
Console.Write(fillWithSpace("bomValidFrom (int): "));
|
|
bomValidFrom = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("bomVersionERP (String): "));
|
|
bomVersionERP = getInput();
|
|
Console.Write(fillWithSpace("verifyCompNameBased (int): "));
|
|
verifyCompNameBased = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("createNewBom (int): "));
|
|
createNewBom = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("Enter size for bomUploadKeys: "));
|
|
int bomUploadKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
bomUploadKeys = new String[bomUploadKeysSize];
|
|
for (int i=0; i<bomUploadKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("bomUploadKeys[" + i + "] (String): "));
|
|
bomUploadKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for bomUploadValues: "));
|
|
int bomUploadValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
bomUploadValues = new String[bomUploadValuesSize];
|
|
for (int i=0; i<bomUploadValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("bomUploadValues[" + i + "] (String): "));
|
|
bomUploadValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdataBomVerify(sessionContext, stationNumber, processLayer, workOrderNumber, productNumber, bareBoardNumber, bomIndex, bomInfo, bomValidFrom, bomVersionERP, verifyCompNameBased, createNewBom, bomUploadKeys, bomUploadValues, out bomResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; bomResultValues != null && i<bomResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("bomResultValues[" + i + "]: ") + "<" + bomResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdataGetBomData
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdataGetBomData"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] bomDataFilter
|
|
/// in String[] bomDataResultKeys
|
|
/// out String[] bomDataResultValues
|
|
/// </para>
|
|
public static void test_mdataGetBomData()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] bomDataFilter = null;
|
|
String[] bomDataResultKeys = null;
|
|
String[] bomDataResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for bomDataFilter: "));
|
|
int bomDataFilterSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
bomDataFilter = new KeyValue[bomDataFilterSize];
|
|
for (int i=0; i<bomDataFilterSize; i++)
|
|
{
|
|
bomDataFilter[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("bomDataFilter[" + i + "] .key (String): "));
|
|
bomDataFilter[i].key = getInput();
|
|
Console.Write(fillWithSpace("bomDataFilter[" + i + "] .value (String): "));
|
|
bomDataFilter[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for bomDataResultKeys: "));
|
|
int bomDataResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
bomDataResultKeys = new String[bomDataResultKeysSize];
|
|
for (int i=0; i<bomDataResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("bomDataResultKeys[" + i + "] (String): "));
|
|
bomDataResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdataGetBomData(sessionContext, stationNumber, bomDataFilter, bomDataResultKeys, out bomDataResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; bomDataResultValues != null && i<bomDataResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("bomDataResultValues[" + i + "]: ") + "<" + bomDataResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdataGetCalendarData
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdataGetCalendarData"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String[] calendarDataResultKeys
|
|
/// out String[] calendarDataResultValues
|
|
/// </para>
|
|
public static void test_mdataGetCalendarData()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String[] calendarDataResultKeys = null;
|
|
String[] calendarDataResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for calendarDataResultKeys: "));
|
|
int calendarDataResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
calendarDataResultKeys = new String[calendarDataResultKeysSize];
|
|
for (int i=0; i<calendarDataResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("calendarDataResultKeys[" + i + "] (String): "));
|
|
calendarDataResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdataGetCalendarData(sessionContext, stationNumber, calendarDataResultKeys, out calendarDataResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; calendarDataResultValues != null && i<calendarDataResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("calendarDataResultValues[" + i + "]: ") + "<" + calendarDataResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdataGetWorkplanData
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdataGetWorkplanData"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] workplanFilter
|
|
/// in String[] workplanDataResultKeys
|
|
/// out String[] workplanDataResultValues
|
|
/// </para>
|
|
public static void test_mdataGetWorkplanData()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] workplanFilter = null;
|
|
String[] workplanDataResultKeys = null;
|
|
String[] workplanDataResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for workplanFilter: "));
|
|
int workplanFilterSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
workplanFilter = new KeyValue[workplanFilterSize];
|
|
for (int i=0; i<workplanFilterSize; i++)
|
|
{
|
|
workplanFilter[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("workplanFilter[" + i + "] .key (String): "));
|
|
workplanFilter[i].key = getInput();
|
|
Console.Write(fillWithSpace("workplanFilter[" + i + "] .value (String): "));
|
|
workplanFilter[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for workplanDataResultKeys: "));
|
|
int workplanDataResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
workplanDataResultKeys = new String[workplanDataResultKeysSize];
|
|
for (int i=0; i<workplanDataResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("workplanDataResultKeys[" + i + "] (String): "));
|
|
workplanDataResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdataGetWorkplanData(sessionContext, stationNumber, workplanFilter, workplanDataResultKeys, out workplanDataResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; workplanDataResultValues != null && i<workplanDataResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("workplanDataResultValues[" + i + "]: ") + "<" + workplanDataResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdataGetFailureDataForStation
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdataGetFailureDataForStation"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in int functionMode
|
|
/// in String[] failureDataResultKeys
|
|
/// out String[] failureDataResultValues
|
|
/// </para>
|
|
public static void test_mdataGetFailureDataForStation()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
int functionMode = 0;
|
|
String[] failureDataResultKeys = null;
|
|
String[] failureDataResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("functionMode (int): "));
|
|
functionMode = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("Enter size for failureDataResultKeys: "));
|
|
int failureDataResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
failureDataResultKeys = new String[failureDataResultKeysSize];
|
|
for (int i=0; i<failureDataResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("failureDataResultKeys[" + i + "] (String): "));
|
|
failureDataResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdataGetFailureDataForStation(sessionContext, stationNumber, functionMode, failureDataResultKeys, out failureDataResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; failureDataResultValues != null && i<failureDataResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("failureDataResultValues[" + i + "]: ") + "<" + failureDataResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdataGetFailureDefinition
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdataGetFailureDefinition"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in int stationMode
|
|
/// in int functionMode
|
|
/// in KeyValue[] failureDataFilter
|
|
/// in String[] failureDataResultKeys
|
|
/// out String[] failureDataResultValues
|
|
/// </para>
|
|
public static void test_mdataGetFailureDefinition()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
int stationMode = 0;
|
|
int functionMode = 0;
|
|
KeyValue[] failureDataFilter = null;
|
|
String[] failureDataResultKeys = null;
|
|
String[] failureDataResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("stationMode (int): "));
|
|
stationMode = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("functionMode (int): "));
|
|
functionMode = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("Enter size for failureDataFilter: "));
|
|
int failureDataFilterSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
failureDataFilter = new KeyValue[failureDataFilterSize];
|
|
for (int i=0; i<failureDataFilterSize; i++)
|
|
{
|
|
failureDataFilter[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("failureDataFilter[" + i + "] .key (String): "));
|
|
failureDataFilter[i].key = getInput();
|
|
Console.Write(fillWithSpace("failureDataFilter[" + i + "] .value (String): "));
|
|
failureDataFilter[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for failureDataResultKeys: "));
|
|
int failureDataResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
failureDataResultKeys = new String[failureDataResultKeysSize];
|
|
for (int i=0; i<failureDataResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("failureDataResultKeys[" + i + "] (String): "));
|
|
failureDataResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdataGetFailureDefinition(sessionContext, stationNumber, stationMode, functionMode, failureDataFilter, failureDataResultKeys, out failureDataResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; failureDataResultValues != null && i<failureDataResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("failureDataResultValues[" + i + "]: ") + "<" + failureDataResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdataSetProductionCycleTime
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdataSetProductionCycleTime"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String serialNumber
|
|
/// in String serialNumberPos
|
|
/// in String workOrderNumber
|
|
/// in int processLayer
|
|
/// in double setupCycleTime
|
|
/// in double prodCycleTime
|
|
/// in String processType
|
|
/// in int cycleTimeForMultipleBoard
|
|
/// </para>
|
|
public static void test_mdataSetProductionCycleTime()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String serialNumber = "";
|
|
String serialNumberPos = "";
|
|
String workOrderNumber = "";
|
|
int processLayer = 0;
|
|
double setupCycleTime = 0.0;
|
|
double prodCycleTime = 0.0;
|
|
String processType = "";
|
|
int cycleTimeForMultipleBoard = 0;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumber (String): "));
|
|
serialNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumberPos (String): "));
|
|
serialNumberPos = getInput();
|
|
Console.Write(fillWithSpace("workOrderNumber (String): "));
|
|
workOrderNumber = getInput();
|
|
Console.Write(fillWithSpace("processLayer (int): "));
|
|
processLayer = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("setupCycleTime (double): "));
|
|
setupCycleTime = Double.Parse(getInput());
|
|
Console.Write(fillWithSpace("prodCycleTime (double): "));
|
|
prodCycleTime = Double.Parse(getInput());
|
|
Console.Write(fillWithSpace("processType (String): "));
|
|
processType = getInput();
|
|
Console.Write(fillWithSpace("cycleTimeForMultipleBoard (int): "));
|
|
cycleTimeForMultipleBoard = Int32.Parse(getInput());
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdataSetProductionCycleTime(sessionContext, stationNumber, serialNumber, serialNumberPos, workOrderNumber, processLayer, setupCycleTime, prodCycleTime, processType, cycleTimeForMultipleBoard);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdataCreateWorkorder
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdataCreateWorkorder"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] workorderUploadKeyValues
|
|
/// in String[] workorderResultKeys
|
|
/// out String[] workorderResultValues
|
|
/// </para>
|
|
public static void test_mdataCreateWorkorder()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] workorderUploadKeyValues = null;
|
|
String[] workorderResultKeys = null;
|
|
String[] workorderResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for workorderUploadKeyValues: "));
|
|
int workorderUploadKeyValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
workorderUploadKeyValues = new KeyValue[workorderUploadKeyValuesSize];
|
|
for (int i=0; i<workorderUploadKeyValuesSize; i++)
|
|
{
|
|
workorderUploadKeyValues[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("workorderUploadKeyValues[" + i + "] .key (String): "));
|
|
workorderUploadKeyValues[i].key = getInput();
|
|
Console.Write(fillWithSpace("workorderUploadKeyValues[" + i + "] .value (String): "));
|
|
workorderUploadKeyValues[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for workorderResultKeys: "));
|
|
int workorderResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
workorderResultKeys = new String[workorderResultKeysSize];
|
|
for (int i=0; i<workorderResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("workorderResultKeys[" + i + "] (String): "));
|
|
workorderResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdataCreateWorkorder(sessionContext, stationNumber, workorderUploadKeyValues, workorderResultKeys, out workorderResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; workorderResultValues != null && i<workorderResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("workorderResultValues[" + i + "]: ") + "<" + workorderResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdataChangeWorkorderData
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdataChangeWorkorderData"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] workorderChangeData
|
|
/// </para>
|
|
public static void test_mdataChangeWorkorderData()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] workorderChangeData = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for workorderChangeData: "));
|
|
int workorderChangeDataSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
workorderChangeData = new KeyValue[workorderChangeDataSize];
|
|
for (int i=0; i<workorderChangeDataSize; i++)
|
|
{
|
|
workorderChangeData[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("workorderChangeData[" + i + "] .key (String): "));
|
|
workorderChangeData[i].key = getInput();
|
|
Console.Write(fillWithSpace("workorderChangeData[" + i + "] .value (String): "));
|
|
workorderChangeData[i].value = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdataChangeWorkorderData(sessionContext, stationNumber, workorderChangeData);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdataGetProductsForLineOrStation
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdataGetProductsForLineOrStation"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] productForLineOrStationFilter
|
|
/// in String[] bomResultKeys
|
|
/// out String[] bomResultValues
|
|
/// in String[] workplanResultKeys
|
|
/// out String[] workplanResultValues
|
|
/// </para>
|
|
public static void test_mdataGetProductsForLineOrStation()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] productForLineOrStationFilter = null;
|
|
String[] bomResultKeys = null;
|
|
String[] bomResultValues = null;
|
|
String[] workplanResultKeys = null;
|
|
String[] workplanResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for productForLineOrStationFilter: "));
|
|
int productForLineOrStationFilterSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
productForLineOrStationFilter = new KeyValue[productForLineOrStationFilterSize];
|
|
for (int i=0; i<productForLineOrStationFilterSize; i++)
|
|
{
|
|
productForLineOrStationFilter[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("productForLineOrStationFilter[" + i + "] .key (String): "));
|
|
productForLineOrStationFilter[i].key = getInput();
|
|
Console.Write(fillWithSpace("productForLineOrStationFilter[" + i + "] .value (String): "));
|
|
productForLineOrStationFilter[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for bomResultKeys: "));
|
|
int bomResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
bomResultKeys = new String[bomResultKeysSize];
|
|
for (int i=0; i<bomResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("bomResultKeys[" + i + "] (String): "));
|
|
bomResultKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for workplanResultKeys: "));
|
|
int workplanResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
workplanResultKeys = new String[workplanResultKeysSize];
|
|
for (int i=0; i<workplanResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("workplanResultKeys[" + i + "] (String): "));
|
|
workplanResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdataGetProductsForLineOrStation(sessionContext, stationNumber, productForLineOrStationFilter, bomResultKeys, out bomResultValues, workplanResultKeys, out workplanResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; bomResultValues != null && i<bomResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("bomResultValues[" + i + "]: ") + "<" + bomResultValues[i] + ">");
|
|
}
|
|
for (int i=0; workplanResultValues != null && i<workplanResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("workplanResultValues[" + i + "]: ") + "<" + workplanResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdataGetMachineAssetStructure
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdataGetMachineAssetStructure"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] machineAssetStructureFilter
|
|
/// in String[] machineAssetStructureResultKeys
|
|
/// out String[] machineAssetStructureValues
|
|
/// </para>
|
|
public static void test_mdataGetMachineAssetStructure()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] machineAssetStructureFilter = null;
|
|
String[] machineAssetStructureResultKeys = null;
|
|
String[] machineAssetStructureValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for machineAssetStructureFilter: "));
|
|
int machineAssetStructureFilterSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
machineAssetStructureFilter = new KeyValue[machineAssetStructureFilterSize];
|
|
for (int i=0; i<machineAssetStructureFilterSize; i++)
|
|
{
|
|
machineAssetStructureFilter[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("machineAssetStructureFilter[" + i + "] .key (String): "));
|
|
machineAssetStructureFilter[i].key = getInput();
|
|
Console.Write(fillWithSpace("machineAssetStructureFilter[" + i + "] .value (String): "));
|
|
machineAssetStructureFilter[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for machineAssetStructureResultKeys: "));
|
|
int machineAssetStructureResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
machineAssetStructureResultKeys = new String[machineAssetStructureResultKeysSize];
|
|
for (int i=0; i<machineAssetStructureResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("machineAssetStructureResultKeys[" + i + "] (String): "));
|
|
machineAssetStructureResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdataGetMachineAssetStructure(sessionContext, stationNumber, machineAssetStructureFilter, machineAssetStructureResultKeys, out machineAssetStructureValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; machineAssetStructureValues != null && i<machineAssetStructureValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("machineAssetStructureValues[" + i + "]: ") + "<" + machineAssetStructureValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdataGetWorkplanActivities
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdataGetWorkplanActivities"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] workplanFilter
|
|
/// in String[] workplanDataResultKeys
|
|
/// out String[] workplanDataResultValues
|
|
/// in String[] activitiesDataResultKeys
|
|
/// out String[] activitiesDataResultValues
|
|
/// in String[] activityParamResultKeys
|
|
/// out String[] activityParamResultValues
|
|
/// in String[] deviceDataResultKeys
|
|
/// out String[] deviceDataResultValues
|
|
/// </para>
|
|
public static void test_mdataGetWorkplanActivities()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] workplanFilter = null;
|
|
String[] workplanDataResultKeys = null;
|
|
String[] workplanDataResultValues = null;
|
|
String[] activitiesDataResultKeys = null;
|
|
String[] activitiesDataResultValues = null;
|
|
String[] activityParamResultKeys = null;
|
|
String[] activityParamResultValues = null;
|
|
String[] deviceDataResultKeys = null;
|
|
String[] deviceDataResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for workplanFilter: "));
|
|
int workplanFilterSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
workplanFilter = new KeyValue[workplanFilterSize];
|
|
for (int i=0; i<workplanFilterSize; i++)
|
|
{
|
|
workplanFilter[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("workplanFilter[" + i + "] .key (String): "));
|
|
workplanFilter[i].key = getInput();
|
|
Console.Write(fillWithSpace("workplanFilter[" + i + "] .value (String): "));
|
|
workplanFilter[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for workplanDataResultKeys: "));
|
|
int workplanDataResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
workplanDataResultKeys = new String[workplanDataResultKeysSize];
|
|
for (int i=0; i<workplanDataResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("workplanDataResultKeys[" + i + "] (String): "));
|
|
workplanDataResultKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for activitiesDataResultKeys: "));
|
|
int activitiesDataResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
activitiesDataResultKeys = new String[activitiesDataResultKeysSize];
|
|
for (int i=0; i<activitiesDataResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("activitiesDataResultKeys[" + i + "] (String): "));
|
|
activitiesDataResultKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for activityParamResultKeys: "));
|
|
int activityParamResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
activityParamResultKeys = new String[activityParamResultKeysSize];
|
|
for (int i=0; i<activityParamResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("activityParamResultKeys[" + i + "] (String): "));
|
|
activityParamResultKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for deviceDataResultKeys: "));
|
|
int deviceDataResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
deviceDataResultKeys = new String[deviceDataResultKeysSize];
|
|
for (int i=0; i<deviceDataResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("deviceDataResultKeys[" + i + "] (String): "));
|
|
deviceDataResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdataGetWorkplanActivities(sessionContext, stationNumber, workplanFilter, workplanDataResultKeys, out workplanDataResultValues, activitiesDataResultKeys, out activitiesDataResultValues, activityParamResultKeys, out activityParamResultValues, deviceDataResultKeys, out deviceDataResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; workplanDataResultValues != null && i<workplanDataResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("workplanDataResultValues[" + i + "]: ") + "<" + workplanDataResultValues[i] + ">");
|
|
}
|
|
for (int i=0; activitiesDataResultValues != null && i<activitiesDataResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("activitiesDataResultValues[" + i + "]: ") + "<" + activitiesDataResultValues[i] + ">");
|
|
}
|
|
for (int i=0; activityParamResultValues != null && i<activityParamResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("activityParamResultValues[" + i + "]: ") + "<" + activityParamResultValues[i] + ">");
|
|
}
|
|
for (int i=0; deviceDataResultValues != null && i<deviceDataResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("deviceDataResultValues[" + i + "]: ") + "<" + deviceDataResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdataGetContactData
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdataGetContactData"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] contactFilter
|
|
/// in String[] contactResultKeys
|
|
/// out String[] contactResultValues
|
|
/// out bool hasMore
|
|
/// </para>
|
|
public static void test_mdataGetContactData()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] contactFilter = null;
|
|
String[] contactResultKeys = null;
|
|
String[] contactResultValues = null;
|
|
bool hasMore = false;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for contactFilter: "));
|
|
int contactFilterSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
contactFilter = new KeyValue[contactFilterSize];
|
|
for (int i=0; i<contactFilterSize; i++)
|
|
{
|
|
contactFilter[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("contactFilter[" + i + "] .key (String): "));
|
|
contactFilter[i].key = getInput();
|
|
Console.Write(fillWithSpace("contactFilter[" + i + "] .value (String): "));
|
|
contactFilter[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for contactResultKeys: "));
|
|
int contactResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
contactResultKeys = new String[contactResultKeysSize];
|
|
for (int i=0; i<contactResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("contactResultKeys[" + i + "] (String): "));
|
|
contactResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdataGetContactData(sessionContext, stationNumber, contactFilter, contactResultKeys, out contactResultValues, out hasMore);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; contactResultValues != null && i<contactResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("contactResultValues[" + i + "]: ") + "<" + contactResultValues[i] + ">");
|
|
}
|
|
Console.WriteLine(fillWithSpace("hasMore: ") + "<" + hasMore + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdataGetStationConfiguration
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdataGetStationConfiguration"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] stationConfigFilter
|
|
/// in String[] stationConfigCodeResultKeys
|
|
/// out String[] stationConfigCodeResultValues
|
|
/// in String[] stationParamResultKeys
|
|
/// out String[] stationParamResultValues
|
|
/// in String[] stationLicenseResultKeys
|
|
/// out String[] stationLicenseResultValues
|
|
/// </para>
|
|
public static void test_mdataGetStationConfiguration()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] stationConfigFilter = null;
|
|
String[] stationConfigCodeResultKeys = null;
|
|
String[] stationConfigCodeResultValues = null;
|
|
String[] stationParamResultKeys = null;
|
|
String[] stationParamResultValues = null;
|
|
String[] stationLicenseResultKeys = null;
|
|
String[] stationLicenseResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for stationConfigFilter: "));
|
|
int stationConfigFilterSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
stationConfigFilter = new KeyValue[stationConfigFilterSize];
|
|
for (int i=0; i<stationConfigFilterSize; i++)
|
|
{
|
|
stationConfigFilter[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("stationConfigFilter[" + i + "] .key (String): "));
|
|
stationConfigFilter[i].key = getInput();
|
|
Console.Write(fillWithSpace("stationConfigFilter[" + i + "] .value (String): "));
|
|
stationConfigFilter[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for stationConfigCodeResultKeys: "));
|
|
int stationConfigCodeResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
stationConfigCodeResultKeys = new String[stationConfigCodeResultKeysSize];
|
|
for (int i=0; i<stationConfigCodeResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("stationConfigCodeResultKeys[" + i + "] (String): "));
|
|
stationConfigCodeResultKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for stationParamResultKeys: "));
|
|
int stationParamResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
stationParamResultKeys = new String[stationParamResultKeysSize];
|
|
for (int i=0; i<stationParamResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("stationParamResultKeys[" + i + "] (String): "));
|
|
stationParamResultKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for stationLicenseResultKeys: "));
|
|
int stationLicenseResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
stationLicenseResultKeys = new String[stationLicenseResultKeysSize];
|
|
for (int i=0; i<stationLicenseResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("stationLicenseResultKeys[" + i + "] (String): "));
|
|
stationLicenseResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdataGetStationConfiguration(sessionContext, stationNumber, stationConfigFilter, stationConfigCodeResultKeys, out stationConfigCodeResultValues, stationParamResultKeys, out stationParamResultValues, stationLicenseResultKeys, out stationLicenseResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; stationConfigCodeResultValues != null && i<stationConfigCodeResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("stationConfigCodeResultValues[" + i + "]: ") + "<" + stationConfigCodeResultValues[i] + ">");
|
|
}
|
|
for (int i=0; stationParamResultValues != null && i<stationParamResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("stationParamResultValues[" + i + "]: ") + "<" + stationParamResultValues[i] + ">");
|
|
}
|
|
for (int i=0; stationLicenseResultValues != null && i<stationLicenseResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("stationLicenseResultValues[" + i + "]: ") + "<" + stationLicenseResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdataGetWorkorders
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdataGetWorkorders"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] mdataGetWorkordersFilters
|
|
/// in String[] mdataGetWorkordersResultKeys
|
|
/// out String[] mdataGetWorkordersResultValues
|
|
/// out bool hasMore
|
|
/// </para>
|
|
public static void test_mdataGetWorkorders()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] mdataGetWorkordersFilters = null;
|
|
String[] mdataGetWorkordersResultKeys = null;
|
|
String[] mdataGetWorkordersResultValues = null;
|
|
bool hasMore = false;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for mdataGetWorkordersFilters: "));
|
|
int mdataGetWorkordersFiltersSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
mdataGetWorkordersFilters = new KeyValue[mdataGetWorkordersFiltersSize];
|
|
for (int i=0; i<mdataGetWorkordersFiltersSize; i++)
|
|
{
|
|
mdataGetWorkordersFilters[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("mdataGetWorkordersFilters[" + i + "] .key (String): "));
|
|
mdataGetWorkordersFilters[i].key = getInput();
|
|
Console.Write(fillWithSpace("mdataGetWorkordersFilters[" + i + "] .value (String): "));
|
|
mdataGetWorkordersFilters[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for mdataGetWorkordersResultKeys: "));
|
|
int mdataGetWorkordersResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
mdataGetWorkordersResultKeys = new String[mdataGetWorkordersResultKeysSize];
|
|
for (int i=0; i<mdataGetWorkordersResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("mdataGetWorkordersResultKeys[" + i + "] (String): "));
|
|
mdataGetWorkordersResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdataGetWorkorders(sessionContext, stationNumber, mdataGetWorkordersFilters, mdataGetWorkordersResultKeys, out mdataGetWorkordersResultValues, out hasMore);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; mdataGetWorkordersResultValues != null && i<mdataGetWorkordersResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("mdataGetWorkordersResultValues[" + i + "]: ") + "<" + mdataGetWorkordersResultValues[i] + ">");
|
|
}
|
|
Console.WriteLine(fillWithSpace("hasMore: ") + "<" + hasMore + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdataGetCostCenter
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdataGetCostCenter"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] mdataGetCostCenterFilter
|
|
/// in String[] mdataGetCostCenterKeys
|
|
/// out String[] mdataGetCostCenterValues
|
|
/// out bool hasMore
|
|
/// </para>
|
|
public static void test_mdataGetCostCenter()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] mdataGetCostCenterFilter = null;
|
|
String[] mdataGetCostCenterKeys = null;
|
|
String[] mdataGetCostCenterValues = null;
|
|
bool hasMore = false;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for mdataGetCostCenterFilter: "));
|
|
int mdataGetCostCenterFilterSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
mdataGetCostCenterFilter = new KeyValue[mdataGetCostCenterFilterSize];
|
|
for (int i=0; i<mdataGetCostCenterFilterSize; i++)
|
|
{
|
|
mdataGetCostCenterFilter[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("mdataGetCostCenterFilter[" + i + "] .key (String): "));
|
|
mdataGetCostCenterFilter[i].key = getInput();
|
|
Console.Write(fillWithSpace("mdataGetCostCenterFilter[" + i + "] .value (String): "));
|
|
mdataGetCostCenterFilter[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for mdataGetCostCenterKeys: "));
|
|
int mdataGetCostCenterKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
mdataGetCostCenterKeys = new String[mdataGetCostCenterKeysSize];
|
|
for (int i=0; i<mdataGetCostCenterKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("mdataGetCostCenterKeys[" + i + "] (String): "));
|
|
mdataGetCostCenterKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdataGetCostCenter(sessionContext, stationNumber, mdataGetCostCenterFilter, mdataGetCostCenterKeys, out mdataGetCostCenterValues, out hasMore);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; mdataGetCostCenterValues != null && i<mdataGetCostCenterValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("mdataGetCostCenterValues[" + i + "]: ") + "<" + mdataGetCostCenterValues[i] + ">");
|
|
}
|
|
Console.WriteLine(fillWithSpace("hasMore: ") + "<" + hasMore + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdataGetWageType
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdataGetWageType"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] mdataGetWageTypeFilter
|
|
/// in String[] mdataGetWageTypeKeys
|
|
/// out String[] mdataGetWageTypeValues
|
|
/// out bool hasMore
|
|
/// </para>
|
|
public static void test_mdataGetWageType()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] mdataGetWageTypeFilter = null;
|
|
String[] mdataGetWageTypeKeys = null;
|
|
String[] mdataGetWageTypeValues = null;
|
|
bool hasMore = false;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for mdataGetWageTypeFilter: "));
|
|
int mdataGetWageTypeFilterSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
mdataGetWageTypeFilter = new KeyValue[mdataGetWageTypeFilterSize];
|
|
for (int i=0; i<mdataGetWageTypeFilterSize; i++)
|
|
{
|
|
mdataGetWageTypeFilter[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("mdataGetWageTypeFilter[" + i + "] .key (String): "));
|
|
mdataGetWageTypeFilter[i].key = getInput();
|
|
Console.Write(fillWithSpace("mdataGetWageTypeFilter[" + i + "] .value (String): "));
|
|
mdataGetWageTypeFilter[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for mdataGetWageTypeKeys: "));
|
|
int mdataGetWageTypeKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
mdataGetWageTypeKeys = new String[mdataGetWageTypeKeysSize];
|
|
for (int i=0; i<mdataGetWageTypeKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("mdataGetWageTypeKeys[" + i + "] (String): "));
|
|
mdataGetWageTypeKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdataGetWageType(sessionContext, stationNumber, mdataGetWageTypeFilter, mdataGetWageTypeKeys, out mdataGetWageTypeValues, out hasMore);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; mdataGetWageTypeValues != null && i<mdataGetWageTypeValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("mdataGetWageTypeValues[" + i + "]: ") + "<" + mdataGetWageTypeValues[i] + ">");
|
|
}
|
|
Console.WriteLine(fillWithSpace("hasMore: ") + "<" + hasMore + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdataGetUserData
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdataGetUserData"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] mdataGetUserDataFilter
|
|
/// in String[] mdataGetUserDataKeys
|
|
/// out String[] mdataGetUserDataValues
|
|
/// out bool hasMore
|
|
/// </para>
|
|
public static void test_mdataGetUserData()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] mdataGetUserDataFilter = null;
|
|
String[] mdataGetUserDataKeys = null;
|
|
String[] mdataGetUserDataValues = null;
|
|
bool hasMore = false;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for mdataGetUserDataFilter: "));
|
|
int mdataGetUserDataFilterSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
mdataGetUserDataFilter = new KeyValue[mdataGetUserDataFilterSize];
|
|
for (int i=0; i<mdataGetUserDataFilterSize; i++)
|
|
{
|
|
mdataGetUserDataFilter[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("mdataGetUserDataFilter[" + i + "] .key (String): "));
|
|
mdataGetUserDataFilter[i].key = getInput();
|
|
Console.Write(fillWithSpace("mdataGetUserDataFilter[" + i + "] .value (String): "));
|
|
mdataGetUserDataFilter[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for mdataGetUserDataKeys: "));
|
|
int mdataGetUserDataKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
mdataGetUserDataKeys = new String[mdataGetUserDataKeysSize];
|
|
for (int i=0; i<mdataGetUserDataKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("mdataGetUserDataKeys[" + i + "] (String): "));
|
|
mdataGetUserDataKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdataGetUserData(sessionContext, stationNumber, mdataGetUserDataFilter, mdataGetUserDataKeys, out mdataGetUserDataValues, out hasMore);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; mdataGetUserDataValues != null && i<mdataGetUserDataValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("mdataGetUserDataValues[" + i + "]: ") + "<" + mdataGetUserDataValues[i] + ">");
|
|
}
|
|
Console.WriteLine(fillWithSpace("hasMore: ") + "<" + hasMore + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdataChangeWorkorderBomData
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdataChangeWorkorderBomData"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String workorderNumber
|
|
/// in String[] changeWorkorderBomUploadKeys
|
|
/// in String[] changeWorkorderBomUploadValues
|
|
/// out String[] changeWorkorderBomResultValues
|
|
/// </para>
|
|
public static void test_mdataChangeWorkorderBomData()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String workorderNumber = "";
|
|
String[] changeWorkorderBomUploadKeys = null;
|
|
String[] changeWorkorderBomUploadValues = null;
|
|
String[] changeWorkorderBomResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("workorderNumber (String): "));
|
|
workorderNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for changeWorkorderBomUploadKeys: "));
|
|
int changeWorkorderBomUploadKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
changeWorkorderBomUploadKeys = new String[changeWorkorderBomUploadKeysSize];
|
|
for (int i=0; i<changeWorkorderBomUploadKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("changeWorkorderBomUploadKeys[" + i + "] (String): "));
|
|
changeWorkorderBomUploadKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for changeWorkorderBomUploadValues: "));
|
|
int changeWorkorderBomUploadValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
changeWorkorderBomUploadValues = new String[changeWorkorderBomUploadValuesSize];
|
|
for (int i=0; i<changeWorkorderBomUploadValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("changeWorkorderBomUploadValues[" + i + "] (String): "));
|
|
changeWorkorderBomUploadValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdataChangeWorkorderBomData(sessionContext, stationNumber, workorderNumber, changeWorkorderBomUploadKeys, changeWorkorderBomUploadValues, out changeWorkorderBomResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; changeWorkorderBomResultValues != null && i<changeWorkorderBomResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("changeWorkorderBomResultValues[" + i + "]: ") + "<" + changeWorkorderBomResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdataGetOrderCluster
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdataGetOrderCluster"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] orderClusterFilter
|
|
/// in String[] orderClusterHeadResultKeys
|
|
/// in String[] orderClusterItemResultKeys
|
|
/// out String[] orderClusterHeadResultValues
|
|
/// out String[] orderClusterItemResultValues
|
|
/// out bool hasMore
|
|
/// </para>
|
|
public static void test_mdataGetOrderCluster()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] orderClusterFilter = null;
|
|
String[] orderClusterHeadResultKeys = null;
|
|
String[] orderClusterItemResultKeys = null;
|
|
String[] orderClusterHeadResultValues = null;
|
|
String[] orderClusterItemResultValues = null;
|
|
bool hasMore = false;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for orderClusterFilter: "));
|
|
int orderClusterFilterSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
orderClusterFilter = new KeyValue[orderClusterFilterSize];
|
|
for (int i=0; i<orderClusterFilterSize; i++)
|
|
{
|
|
orderClusterFilter[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("orderClusterFilter[" + i + "] .key (String): "));
|
|
orderClusterFilter[i].key = getInput();
|
|
Console.Write(fillWithSpace("orderClusterFilter[" + i + "] .value (String): "));
|
|
orderClusterFilter[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for orderClusterHeadResultKeys: "));
|
|
int orderClusterHeadResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
orderClusterHeadResultKeys = new String[orderClusterHeadResultKeysSize];
|
|
for (int i=0; i<orderClusterHeadResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("orderClusterHeadResultKeys[" + i + "] (String): "));
|
|
orderClusterHeadResultKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for orderClusterItemResultKeys: "));
|
|
int orderClusterItemResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
orderClusterItemResultKeys = new String[orderClusterItemResultKeysSize];
|
|
for (int i=0; i<orderClusterItemResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("orderClusterItemResultKeys[" + i + "] (String): "));
|
|
orderClusterItemResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdataGetOrderCluster(sessionContext, stationNumber, orderClusterFilter, orderClusterHeadResultKeys, orderClusterItemResultKeys, out orderClusterHeadResultValues, out orderClusterItemResultValues, out hasMore);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; orderClusterHeadResultValues != null && i<orderClusterHeadResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("orderClusterHeadResultValues[" + i + "]: ") + "<" + orderClusterHeadResultValues[i] + ">");
|
|
}
|
|
for (int i=0; orderClusterItemResultValues != null && i<orderClusterItemResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("orderClusterItemResultValues[" + i + "]: ") + "<" + orderClusterItemResultValues[i] + ">");
|
|
}
|
|
Console.WriteLine(fillWithSpace("hasMore: ") + "<" + hasMore + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdataDeleteOrderCluster
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdataDeleteOrderCluster"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] orderClusterDeleteFilter
|
|
/// </para>
|
|
public static void test_mdataDeleteOrderCluster()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] orderClusterDeleteFilter = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for orderClusterDeleteFilter: "));
|
|
int orderClusterDeleteFilterSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
orderClusterDeleteFilter = new KeyValue[orderClusterDeleteFilterSize];
|
|
for (int i=0; i<orderClusterDeleteFilterSize; i++)
|
|
{
|
|
orderClusterDeleteFilter[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("orderClusterDeleteFilter[" + i + "] .key (String): "));
|
|
orderClusterDeleteFilter[i].key = getInput();
|
|
Console.Write(fillWithSpace("orderClusterDeleteFilter[" + i + "] .value (String): "));
|
|
orderClusterDeleteFilter[i].value = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdataDeleteOrderCluster(sessionContext, stationNumber, orderClusterDeleteFilter);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdataCreateOrderCluster
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdataCreateOrderCluster"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] createOrderClusterValues
|
|
/// in String[] createOrderClusterItemUploadKeys
|
|
/// in String[] createOrderClusterItemUploadValues
|
|
/// out String[] createOrderClusterResultValues
|
|
/// out String[] createOrderClusterItemResultValues
|
|
/// </para>
|
|
public static void test_mdataCreateOrderCluster()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] createOrderClusterValues = null;
|
|
String[] createOrderClusterItemUploadKeys = null;
|
|
String[] createOrderClusterItemUploadValues = null;
|
|
String[] createOrderClusterResultValues = null;
|
|
String[] createOrderClusterItemResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for createOrderClusterValues: "));
|
|
int createOrderClusterValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
createOrderClusterValues = new KeyValue[createOrderClusterValuesSize];
|
|
for (int i=0; i<createOrderClusterValuesSize; i++)
|
|
{
|
|
createOrderClusterValues[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("createOrderClusterValues[" + i + "] .key (String): "));
|
|
createOrderClusterValues[i].key = getInput();
|
|
Console.Write(fillWithSpace("createOrderClusterValues[" + i + "] .value (String): "));
|
|
createOrderClusterValues[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for createOrderClusterItemUploadKeys: "));
|
|
int createOrderClusterItemUploadKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
createOrderClusterItemUploadKeys = new String[createOrderClusterItemUploadKeysSize];
|
|
for (int i=0; i<createOrderClusterItemUploadKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("createOrderClusterItemUploadKeys[" + i + "] (String): "));
|
|
createOrderClusterItemUploadKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for createOrderClusterItemUploadValues: "));
|
|
int createOrderClusterItemUploadValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
createOrderClusterItemUploadValues = new String[createOrderClusterItemUploadValuesSize];
|
|
for (int i=0; i<createOrderClusterItemUploadValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("createOrderClusterItemUploadValues[" + i + "] (String): "));
|
|
createOrderClusterItemUploadValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdataCreateOrderCluster(sessionContext, stationNumber, createOrderClusterValues, createOrderClusterItemUploadKeys, createOrderClusterItemUploadValues, out createOrderClusterResultValues, out createOrderClusterItemResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; createOrderClusterResultValues != null && i<createOrderClusterResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("createOrderClusterResultValues[" + i + "]: ") + "<" + createOrderClusterResultValues[i] + ">");
|
|
}
|
|
for (int i=0; createOrderClusterItemResultValues != null && i<createOrderClusterItemResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("createOrderClusterItemResultValues[" + i + "]: ") + "<" + createOrderClusterItemResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdataUpdateOrderCluster
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdataUpdateOrderCluster"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String clusterName
|
|
/// in KeyValue[] updateOrderClusterValues
|
|
/// in String[] createOrderClusterItemUploadKeys
|
|
/// in String[] createOrderClusterItemUploadValues
|
|
/// in String[] updateOrderClusterItemUploadKeys
|
|
/// in String[] updateOrderClusterItemUploadValues
|
|
/// in String[] deleteOrderClusterItemUploadKeys
|
|
/// in String[] deleteOrderClusterItemUploadValues
|
|
/// out String[] createOrderClusterItemResultValues
|
|
/// out String[] updateOrderClusterItemResultValues
|
|
/// out String[] deleteOrderClusterItemResultValues
|
|
/// </para>
|
|
public static void test_mdataUpdateOrderCluster()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String clusterName = "";
|
|
KeyValue[] updateOrderClusterValues = null;
|
|
String[] createOrderClusterItemUploadKeys = null;
|
|
String[] createOrderClusterItemUploadValues = null;
|
|
String[] updateOrderClusterItemUploadKeys = null;
|
|
String[] updateOrderClusterItemUploadValues = null;
|
|
String[] deleteOrderClusterItemUploadKeys = null;
|
|
String[] deleteOrderClusterItemUploadValues = null;
|
|
String[] createOrderClusterItemResultValues = null;
|
|
String[] updateOrderClusterItemResultValues = null;
|
|
String[] deleteOrderClusterItemResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("clusterName (String): "));
|
|
clusterName = getInput();
|
|
Console.Write(fillWithSpace("Enter size for updateOrderClusterValues: "));
|
|
int updateOrderClusterValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
updateOrderClusterValues = new KeyValue[updateOrderClusterValuesSize];
|
|
for (int i=0; i<updateOrderClusterValuesSize; i++)
|
|
{
|
|
updateOrderClusterValues[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("updateOrderClusterValues[" + i + "] .key (String): "));
|
|
updateOrderClusterValues[i].key = getInput();
|
|
Console.Write(fillWithSpace("updateOrderClusterValues[" + i + "] .value (String): "));
|
|
updateOrderClusterValues[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for createOrderClusterItemUploadKeys: "));
|
|
int createOrderClusterItemUploadKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
createOrderClusterItemUploadKeys = new String[createOrderClusterItemUploadKeysSize];
|
|
for (int i=0; i<createOrderClusterItemUploadKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("createOrderClusterItemUploadKeys[" + i + "] (String): "));
|
|
createOrderClusterItemUploadKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for createOrderClusterItemUploadValues: "));
|
|
int createOrderClusterItemUploadValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
createOrderClusterItemUploadValues = new String[createOrderClusterItemUploadValuesSize];
|
|
for (int i=0; i<createOrderClusterItemUploadValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("createOrderClusterItemUploadValues[" + i + "] (String): "));
|
|
createOrderClusterItemUploadValues[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for updateOrderClusterItemUploadKeys: "));
|
|
int updateOrderClusterItemUploadKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
updateOrderClusterItemUploadKeys = new String[updateOrderClusterItemUploadKeysSize];
|
|
for (int i=0; i<updateOrderClusterItemUploadKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("updateOrderClusterItemUploadKeys[" + i + "] (String): "));
|
|
updateOrderClusterItemUploadKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for updateOrderClusterItemUploadValues: "));
|
|
int updateOrderClusterItemUploadValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
updateOrderClusterItemUploadValues = new String[updateOrderClusterItemUploadValuesSize];
|
|
for (int i=0; i<updateOrderClusterItemUploadValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("updateOrderClusterItemUploadValues[" + i + "] (String): "));
|
|
updateOrderClusterItemUploadValues[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for deleteOrderClusterItemUploadKeys: "));
|
|
int deleteOrderClusterItemUploadKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
deleteOrderClusterItemUploadKeys = new String[deleteOrderClusterItemUploadKeysSize];
|
|
for (int i=0; i<deleteOrderClusterItemUploadKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("deleteOrderClusterItemUploadKeys[" + i + "] (String): "));
|
|
deleteOrderClusterItemUploadKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for deleteOrderClusterItemUploadValues: "));
|
|
int deleteOrderClusterItemUploadValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
deleteOrderClusterItemUploadValues = new String[deleteOrderClusterItemUploadValuesSize];
|
|
for (int i=0; i<deleteOrderClusterItemUploadValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("deleteOrderClusterItemUploadValues[" + i + "] (String): "));
|
|
deleteOrderClusterItemUploadValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdataUpdateOrderCluster(sessionContext, stationNumber, clusterName, updateOrderClusterValues, createOrderClusterItemUploadKeys, createOrderClusterItemUploadValues, updateOrderClusterItemUploadKeys, updateOrderClusterItemUploadValues, deleteOrderClusterItemUploadKeys, deleteOrderClusterItemUploadValues, out createOrderClusterItemResultValues, out updateOrderClusterItemResultValues, out deleteOrderClusterItemResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; createOrderClusterItemResultValues != null && i<createOrderClusterItemResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("createOrderClusterItemResultValues[" + i + "]: ") + "<" + createOrderClusterItemResultValues[i] + ">");
|
|
}
|
|
for (int i=0; updateOrderClusterItemResultValues != null && i<updateOrderClusterItemResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("updateOrderClusterItemResultValues[" + i + "]: ") + "<" + updateOrderClusterItemResultValues[i] + ">");
|
|
}
|
|
for (int i=0; deleteOrderClusterItemResultValues != null && i<deleteOrderClusterItemResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("deleteOrderClusterItemResultValues[" + i + "]: ") + "<" + deleteOrderClusterItemResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdataGetUserGroupData
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdataGetUserGroupData"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] mdataGetUserGroupDataFilter
|
|
/// in String[] mdataGetUserGroupDataKeys
|
|
/// out String[] mdataGetUserGroupDataValues
|
|
/// </para>
|
|
public static void test_mdataGetUserGroupData()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] mdataGetUserGroupDataFilter = null;
|
|
String[] mdataGetUserGroupDataKeys = null;
|
|
String[] mdataGetUserGroupDataValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for mdataGetUserGroupDataFilter: "));
|
|
int mdataGetUserGroupDataFilterSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
mdataGetUserGroupDataFilter = new KeyValue[mdataGetUserGroupDataFilterSize];
|
|
for (int i=0; i<mdataGetUserGroupDataFilterSize; i++)
|
|
{
|
|
mdataGetUserGroupDataFilter[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("mdataGetUserGroupDataFilter[" + i + "] .key (String): "));
|
|
mdataGetUserGroupDataFilter[i].key = getInput();
|
|
Console.Write(fillWithSpace("mdataGetUserGroupDataFilter[" + i + "] .value (String): "));
|
|
mdataGetUserGroupDataFilter[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for mdataGetUserGroupDataKeys: "));
|
|
int mdataGetUserGroupDataKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
mdataGetUserGroupDataKeys = new String[mdataGetUserGroupDataKeysSize];
|
|
for (int i=0; i<mdataGetUserGroupDataKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("mdataGetUserGroupDataKeys[" + i + "] (String): "));
|
|
mdataGetUserGroupDataKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdataGetUserGroupData(sessionContext, stationNumber, mdataGetUserGroupDataFilter, mdataGetUserGroupDataKeys, out mdataGetUserGroupDataValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; mdataGetUserGroupDataValues != null && i<mdataGetUserGroupDataValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("mdataGetUserGroupDataValues[" + i + "]: ") + "<" + mdataGetUserGroupDataValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdataGetFailureDataForPart
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdataGetFailureDataForPart"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] mdataGetFailureDataForPartFilter
|
|
/// in String[] failureDataKeys
|
|
/// out String[] failureDataValues
|
|
/// in String[] imageDataKeys
|
|
/// out String[] imageDataValues
|
|
/// </para>
|
|
public static void test_mdataGetFailureDataForPart()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] mdataGetFailureDataForPartFilter = null;
|
|
String[] failureDataKeys = null;
|
|
String[] failureDataValues = null;
|
|
String[] imageDataKeys = null;
|
|
String[] imageDataValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for mdataGetFailureDataForPartFilter: "));
|
|
int mdataGetFailureDataForPartFilterSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
mdataGetFailureDataForPartFilter = new KeyValue[mdataGetFailureDataForPartFilterSize];
|
|
for (int i=0; i<mdataGetFailureDataForPartFilterSize; i++)
|
|
{
|
|
mdataGetFailureDataForPartFilter[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("mdataGetFailureDataForPartFilter[" + i + "] .key (String): "));
|
|
mdataGetFailureDataForPartFilter[i].key = getInput();
|
|
Console.Write(fillWithSpace("mdataGetFailureDataForPartFilter[" + i + "] .value (String): "));
|
|
mdataGetFailureDataForPartFilter[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for failureDataKeys: "));
|
|
int failureDataKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
failureDataKeys = new String[failureDataKeysSize];
|
|
for (int i=0; i<failureDataKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("failureDataKeys[" + i + "] (String): "));
|
|
failureDataKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for imageDataKeys: "));
|
|
int imageDataKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
imageDataKeys = new String[imageDataKeysSize];
|
|
for (int i=0; i<imageDataKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("imageDataKeys[" + i + "] (String): "));
|
|
imageDataKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdataGetFailureDataForPart(sessionContext, stationNumber, mdataGetFailureDataForPartFilter, failureDataKeys, out failureDataValues, imageDataKeys, out imageDataValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; failureDataValues != null && i<failureDataValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("failureDataValues[" + i + "]: ") + "<" + failureDataValues[i] + ">");
|
|
}
|
|
for (int i=0; imageDataValues != null && i<imageDataValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("imageDataValues[" + i + "]: ") + "<" + imageDataValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdataCreateDetectionPoint
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdataCreateDetectionPoint"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String detectionPointName
|
|
/// in int detectionPointType
|
|
/// in KeyValue[] detectionPointKeyValues
|
|
/// </para>
|
|
public static void test_mdataCreateDetectionPoint()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String detectionPointName = "";
|
|
int detectionPointType = 0;
|
|
KeyValue[] detectionPointKeyValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("detectionPointName (String): "));
|
|
detectionPointName = getInput();
|
|
Console.Write(fillWithSpace("detectionPointType (int): "));
|
|
detectionPointType = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("Enter size for detectionPointKeyValues: "));
|
|
int detectionPointKeyValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
detectionPointKeyValues = new KeyValue[detectionPointKeyValuesSize];
|
|
for (int i=0; i<detectionPointKeyValuesSize; i++)
|
|
{
|
|
detectionPointKeyValues[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("detectionPointKeyValues[" + i + "] .key (String): "));
|
|
detectionPointKeyValues[i].key = getInput();
|
|
Console.Write(fillWithSpace("detectionPointKeyValues[" + i + "] .value (String): "));
|
|
detectionPointKeyValues[i].value = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdataCreateDetectionPoint(sessionContext, stationNumber, detectionPointName, detectionPointType, detectionPointKeyValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdataGetDetectionPoint
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdataGetDetectionPoint"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in int detectionPointType
|
|
/// in KeyValue[] detectionPointFilter
|
|
/// in String[] detectionPointKeys
|
|
/// out String[] detectionPointValues
|
|
/// out bool hasMore
|
|
/// </para>
|
|
public static void test_mdataGetDetectionPoint()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
int detectionPointType = 0;
|
|
KeyValue[] detectionPointFilter = null;
|
|
String[] detectionPointKeys = null;
|
|
String[] detectionPointValues = null;
|
|
bool hasMore = false;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("detectionPointType (int): "));
|
|
detectionPointType = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("Enter size for detectionPointFilter: "));
|
|
int detectionPointFilterSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
detectionPointFilter = new KeyValue[detectionPointFilterSize];
|
|
for (int i=0; i<detectionPointFilterSize; i++)
|
|
{
|
|
detectionPointFilter[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("detectionPointFilter[" + i + "] .key (String): "));
|
|
detectionPointFilter[i].key = getInput();
|
|
Console.Write(fillWithSpace("detectionPointFilter[" + i + "] .value (String): "));
|
|
detectionPointFilter[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for detectionPointKeys: "));
|
|
int detectionPointKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
detectionPointKeys = new String[detectionPointKeysSize];
|
|
for (int i=0; i<detectionPointKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("detectionPointKeys[" + i + "] (String): "));
|
|
detectionPointKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdataGetDetectionPoint(sessionContext, stationNumber, detectionPointType, detectionPointFilter, detectionPointKeys, out detectionPointValues, out hasMore);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; detectionPointValues != null && i<detectionPointValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("detectionPointValues[" + i + "]: ") + "<" + detectionPointValues[i] + ">");
|
|
}
|
|
Console.WriteLine(fillWithSpace("hasMore: ") + "<" + hasMore + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdataGetShiftData
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdataGetShiftData"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String[] shiftFilterKeys
|
|
/// in String[] shiftFilterValues
|
|
/// in String[] shiftResultKeys
|
|
/// out String[] shiftResultValues
|
|
/// </para>
|
|
public static void test_mdataGetShiftData()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String[] shiftFilterKeys = null;
|
|
String[] shiftFilterValues = null;
|
|
String[] shiftResultKeys = null;
|
|
String[] shiftResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for shiftFilterKeys: "));
|
|
int shiftFilterKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
shiftFilterKeys = new String[shiftFilterKeysSize];
|
|
for (int i=0; i<shiftFilterKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("shiftFilterKeys[" + i + "] (String): "));
|
|
shiftFilterKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for shiftFilterValues: "));
|
|
int shiftFilterValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
shiftFilterValues = new String[shiftFilterValuesSize];
|
|
for (int i=0; i<shiftFilterValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("shiftFilterValues[" + i + "] (String): "));
|
|
shiftFilterValues[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for shiftResultKeys: "));
|
|
int shiftResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
shiftResultKeys = new String[shiftResultKeysSize];
|
|
for (int i=0; i<shiftResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("shiftResultKeys[" + i + "] (String): "));
|
|
shiftResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdataGetShiftData(sessionContext, stationNumber, shiftFilterKeys, shiftFilterValues, shiftResultKeys, out shiftResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; shiftResultValues != null && i<shiftResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("shiftResultValues[" + i + "]: ") + "<" + shiftResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdataGetMessageClass
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdataGetMessageClass"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] messageClassFilter
|
|
/// in String[] messageClassKeys
|
|
/// out String[] messageClassValues
|
|
/// out bool hasMore
|
|
/// </para>
|
|
public static void test_mdataGetMessageClass()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] messageClassFilter = null;
|
|
String[] messageClassKeys = null;
|
|
String[] messageClassValues = null;
|
|
bool hasMore = false;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for messageClassFilter: "));
|
|
int messageClassFilterSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
messageClassFilter = new KeyValue[messageClassFilterSize];
|
|
for (int i=0; i<messageClassFilterSize; i++)
|
|
{
|
|
messageClassFilter[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("messageClassFilter[" + i + "] .key (String): "));
|
|
messageClassFilter[i].key = getInput();
|
|
Console.Write(fillWithSpace("messageClassFilter[" + i + "] .value (String): "));
|
|
messageClassFilter[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for messageClassKeys: "));
|
|
int messageClassKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
messageClassKeys = new String[messageClassKeysSize];
|
|
for (int i=0; i<messageClassKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("messageClassKeys[" + i + "] (String): "));
|
|
messageClassKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdataGetMessageClass(sessionContext, stationNumber, messageClassFilter, messageClassKeys, out messageClassValues, out hasMore);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; messageClassValues != null && i<messageClassValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("messageClassValues[" + i + "]: ") + "<" + messageClassValues[i] + ">");
|
|
}
|
|
Console.WriteLine(fillWithSpace("hasMore: ") + "<" + hasMore + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdataGetMessageCause
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdataGetMessageCause"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] messageCauseFilter
|
|
/// in String[] messageCauseKeys
|
|
/// out String[] messageCauseValues
|
|
/// out bool hasMore
|
|
/// </para>
|
|
public static void test_mdataGetMessageCause()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] messageCauseFilter = null;
|
|
String[] messageCauseKeys = null;
|
|
String[] messageCauseValues = null;
|
|
bool hasMore = false;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for messageCauseFilter: "));
|
|
int messageCauseFilterSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
messageCauseFilter = new KeyValue[messageCauseFilterSize];
|
|
for (int i=0; i<messageCauseFilterSize; i++)
|
|
{
|
|
messageCauseFilter[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("messageCauseFilter[" + i + "] .key (String): "));
|
|
messageCauseFilter[i].key = getInput();
|
|
Console.Write(fillWithSpace("messageCauseFilter[" + i + "] .value (String): "));
|
|
messageCauseFilter[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for messageCauseKeys: "));
|
|
int messageCauseKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
messageCauseKeys = new String[messageCauseKeysSize];
|
|
for (int i=0; i<messageCauseKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("messageCauseKeys[" + i + "] (String): "));
|
|
messageCauseKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdataGetMessageCause(sessionContext, stationNumber, messageCauseFilter, messageCauseKeys, out messageCauseValues, out hasMore);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; messageCauseValues != null && i<messageCauseValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("messageCauseValues[" + i + "]: ") + "<" + messageCauseValues[i] + ">");
|
|
}
|
|
Console.WriteLine(fillWithSpace("hasMore: ") + "<" + hasMore + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdataGetMessageEffect
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdataGetMessageEffect"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] messageEffectFilter
|
|
/// in String[] messageEffectKeys
|
|
/// out String[] messageEffectValues
|
|
/// out bool hasMore
|
|
/// </para>
|
|
public static void test_mdataGetMessageEffect()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] messageEffectFilter = null;
|
|
String[] messageEffectKeys = null;
|
|
String[] messageEffectValues = null;
|
|
bool hasMore = false;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for messageEffectFilter: "));
|
|
int messageEffectFilterSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
messageEffectFilter = new KeyValue[messageEffectFilterSize];
|
|
for (int i=0; i<messageEffectFilterSize; i++)
|
|
{
|
|
messageEffectFilter[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("messageEffectFilter[" + i + "] .key (String): "));
|
|
messageEffectFilter[i].key = getInput();
|
|
Console.Write(fillWithSpace("messageEffectFilter[" + i + "] .value (String): "));
|
|
messageEffectFilter[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for messageEffectKeys: "));
|
|
int messageEffectKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
messageEffectKeys = new String[messageEffectKeysSize];
|
|
for (int i=0; i<messageEffectKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("messageEffectKeys[" + i + "] (String): "));
|
|
messageEffectKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdataGetMessageEffect(sessionContext, stationNumber, messageEffectFilter, messageEffectKeys, out messageEffectValues, out hasMore);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; messageEffectValues != null && i<messageEffectValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("messageEffectValues[" + i + "]: ") + "<" + messageEffectValues[i] + ">");
|
|
}
|
|
Console.WriteLine(fillWithSpace("hasMore: ") + "<" + hasMore + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdataCreateSpecialTime
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdataCreateSpecialTime"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in int entityType
|
|
/// in String entityKey
|
|
/// in String timeEventName
|
|
/// in long dateFrom
|
|
/// in long dateTo
|
|
/// out long specialTimeId
|
|
/// </para>
|
|
public static void test_mdataCreateSpecialTime()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
int entityType = 0;
|
|
String entityKey = "";
|
|
String timeEventName = "";
|
|
long dateFrom = 0;
|
|
long dateTo = 0;
|
|
long specialTimeId = 0;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("entityType (int): "));
|
|
entityType = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("entityKey (String): "));
|
|
entityKey = getInput();
|
|
Console.Write(fillWithSpace("timeEventName (String): "));
|
|
timeEventName = getInput();
|
|
Console.Write(fillWithSpace("dateFrom (long): "));
|
|
dateFrom = Int64.Parse(getInput());
|
|
Console.Write(fillWithSpace("dateTo (long): "));
|
|
dateTo = Int64.Parse(getInput());
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdataCreateSpecialTime(sessionContext, stationNumber, entityType, entityKey, timeEventName, dateFrom, dateTo, out specialTimeId);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
Console.WriteLine(fillWithSpace("specialTimeId: ") + "<" + specialTimeId + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdataChangeWorkOrderWorkStepState
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdataChangeWorkOrderWorkStepState"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String[] workstepChangeKeys
|
|
/// in String[] workstepChangeValues
|
|
/// in String[] workstepResultKeys
|
|
/// out String[] workstepResultValues
|
|
/// </para>
|
|
public static void test_mdataChangeWorkOrderWorkStepState()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String[] workstepChangeKeys = null;
|
|
String[] workstepChangeValues = null;
|
|
String[] workstepResultKeys = null;
|
|
String[] workstepResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for workstepChangeKeys: "));
|
|
int workstepChangeKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
workstepChangeKeys = new String[workstepChangeKeysSize];
|
|
for (int i=0; i<workstepChangeKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("workstepChangeKeys[" + i + "] (String): "));
|
|
workstepChangeKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for workstepChangeValues: "));
|
|
int workstepChangeValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
workstepChangeValues = new String[workstepChangeValuesSize];
|
|
for (int i=0; i<workstepChangeValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("workstepChangeValues[" + i + "] (String): "));
|
|
workstepChangeValues[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for workstepResultKeys: "));
|
|
int workstepResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
workstepResultKeys = new String[workstepResultKeysSize];
|
|
for (int i=0; i<workstepResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("workstepResultKeys[" + i + "] (String): "));
|
|
workstepResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdataChangeWorkOrderWorkStepState(sessionContext, stationNumber, workstepChangeKeys, workstepChangeValues, workstepResultKeys, out workstepResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; workstepResultValues != null && i<workstepResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("workstepResultValues[" + i + "]: ") + "<" + workstepResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdataGetUserSkill
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdataGetUserSkill"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] userSkillFilter
|
|
/// in String[] userSkillResultKeys
|
|
/// out String[] userSkillResultValues
|
|
/// </para>
|
|
public static void test_mdataGetUserSkill()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] userSkillFilter = null;
|
|
String[] userSkillResultKeys = null;
|
|
String[] userSkillResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for userSkillFilter: "));
|
|
int userSkillFilterSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
userSkillFilter = new KeyValue[userSkillFilterSize];
|
|
for (int i=0; i<userSkillFilterSize; i++)
|
|
{
|
|
userSkillFilter[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("userSkillFilter[" + i + "] .key (String): "));
|
|
userSkillFilter[i].key = getInput();
|
|
Console.Write(fillWithSpace("userSkillFilter[" + i + "] .value (String): "));
|
|
userSkillFilter[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for userSkillResultKeys: "));
|
|
int userSkillResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
userSkillResultKeys = new String[userSkillResultKeysSize];
|
|
for (int i=0; i<userSkillResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("userSkillResultKeys[" + i + "] (String): "));
|
|
userSkillResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdataGetUserSkill(sessionContext, stationNumber, userSkillFilter, userSkillResultKeys, out userSkillResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; userSkillResultValues != null && i<userSkillResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("userSkillResultValues[" + i + "]: ") + "<" + userSkillResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdataGetWorkstepSkill
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdataGetWorkstepSkill"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] workstepSkillFilter
|
|
/// in String[] workstepSkillResultKeys
|
|
/// out String[] workstepSkillResultValues
|
|
/// </para>
|
|
public static void test_mdataGetWorkstepSkill()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] workstepSkillFilter = null;
|
|
String[] workstepSkillResultKeys = null;
|
|
String[] workstepSkillResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for workstepSkillFilter: "));
|
|
int workstepSkillFilterSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
workstepSkillFilter = new KeyValue[workstepSkillFilterSize];
|
|
for (int i=0; i<workstepSkillFilterSize; i++)
|
|
{
|
|
workstepSkillFilter[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("workstepSkillFilter[" + i + "] .key (String): "));
|
|
workstepSkillFilter[i].key = getInput();
|
|
Console.Write(fillWithSpace("workstepSkillFilter[" + i + "] .value (String): "));
|
|
workstepSkillFilter[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for workstepSkillResultKeys: "));
|
|
int workstepSkillResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
workstepSkillResultKeys = new String[workstepSkillResultKeysSize];
|
|
for (int i=0; i<workstepSkillResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("workstepSkillResultKeys[" + i + "] (String): "));
|
|
workstepSkillResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdataGetWorkstepSkill(sessionContext, stationNumber, workstepSkillFilter, workstepSkillResultKeys, out workstepSkillResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; workstepSkillResultValues != null && i<workstepSkillResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("workstepSkillResultValues[" + i + "]: ") + "<" + workstepSkillResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdataGetFormulaCatalog
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdataGetFormulaCatalog"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] formulaFilter
|
|
/// in String[] formulaResultKeys
|
|
/// in String[] formulaParamResultKeys
|
|
/// out String[] formulaResultValues
|
|
/// out String[] formulaParamResultValues
|
|
/// </para>
|
|
public static void test_mdataGetFormulaCatalog()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] formulaFilter = null;
|
|
String[] formulaResultKeys = null;
|
|
String[] formulaParamResultKeys = null;
|
|
String[] formulaResultValues = null;
|
|
String[] formulaParamResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for formulaFilter: "));
|
|
int formulaFilterSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
formulaFilter = new KeyValue[formulaFilterSize];
|
|
for (int i=0; i<formulaFilterSize; i++)
|
|
{
|
|
formulaFilter[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("formulaFilter[" + i + "] .key (String): "));
|
|
formulaFilter[i].key = getInput();
|
|
Console.Write(fillWithSpace("formulaFilter[" + i + "] .value (String): "));
|
|
formulaFilter[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for formulaResultKeys: "));
|
|
int formulaResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
formulaResultKeys = new String[formulaResultKeysSize];
|
|
for (int i=0; i<formulaResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("formulaResultKeys[" + i + "] (String): "));
|
|
formulaResultKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for formulaParamResultKeys: "));
|
|
int formulaParamResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
formulaParamResultKeys = new String[formulaParamResultKeysSize];
|
|
for (int i=0; i<formulaParamResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("formulaParamResultKeys[" + i + "] (String): "));
|
|
formulaParamResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdataGetFormulaCatalog(sessionContext, stationNumber, formulaFilter, formulaResultKeys, formulaParamResultKeys, out formulaResultValues, out formulaParamResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; formulaResultValues != null && i<formulaResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("formulaResultValues[" + i + "]: ") + "<" + formulaResultValues[i] + ">");
|
|
}
|
|
for (int i=0; formulaParamResultValues != null && i<formulaParamResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("formulaParamResultValues[" + i + "]: ") + "<" + formulaParamResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdataUpdateDetectionPoint
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdataUpdateDetectionPoint"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String detectionPointName
|
|
/// in KeyValue[] detectionPointKeyValues
|
|
/// </para>
|
|
public static void test_mdataUpdateDetectionPoint()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String detectionPointName = "";
|
|
KeyValue[] detectionPointKeyValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("detectionPointName (String): "));
|
|
detectionPointName = getInput();
|
|
Console.Write(fillWithSpace("Enter size for detectionPointKeyValues: "));
|
|
int detectionPointKeyValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
detectionPointKeyValues = new KeyValue[detectionPointKeyValuesSize];
|
|
for (int i=0; i<detectionPointKeyValuesSize; i++)
|
|
{
|
|
detectionPointKeyValues[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("detectionPointKeyValues[" + i + "] .key (String): "));
|
|
detectionPointKeyValues[i].key = getInput();
|
|
Console.Write(fillWithSpace("detectionPointKeyValues[" + i + "] .value (String): "));
|
|
detectionPointKeyValues[i].value = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdataUpdateDetectionPoint(sessionContext, stationNumber, detectionPointName, detectionPointKeyValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdataDeleteDetectionPoint
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdataDeleteDetectionPoint"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String detectionPointName
|
|
/// </para>
|
|
public static void test_mdataDeleteDetectionPoint()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String detectionPointName = "";
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("detectionPointName (String): "));
|
|
detectionPointName = getInput();
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdataDeleteDetectionPoint(sessionContext, stationNumber, detectionPointName);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdataGetTimeEvent
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdataGetTimeEvent"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] timeEventFilter
|
|
/// in String[] timeEventResultKeys
|
|
/// out String[] timeEventResultValues
|
|
/// </para>
|
|
public static void test_mdataGetTimeEvent()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] timeEventFilter = null;
|
|
String[] timeEventResultKeys = null;
|
|
String[] timeEventResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for timeEventFilter: "));
|
|
int timeEventFilterSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
timeEventFilter = new KeyValue[timeEventFilterSize];
|
|
for (int i=0; i<timeEventFilterSize; i++)
|
|
{
|
|
timeEventFilter[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("timeEventFilter[" + i + "] .key (String): "));
|
|
timeEventFilter[i].key = getInput();
|
|
Console.Write(fillWithSpace("timeEventFilter[" + i + "] .value (String): "));
|
|
timeEventFilter[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for timeEventResultKeys: "));
|
|
int timeEventResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
timeEventResultKeys = new String[timeEventResultKeysSize];
|
|
for (int i=0; i<timeEventResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("timeEventResultKeys[" + i + "] (String): "));
|
|
timeEventResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdataGetTimeEvent(sessionContext, stationNumber, timeEventFilter, timeEventResultKeys, out timeEventResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; timeEventResultValues != null && i<timeEventResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("timeEventResultValues[" + i + "]: ") + "<" + timeEventResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdataGetWeekSchedule
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdataGetWeekSchedule"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] weekScheduleFilter
|
|
/// in String[] weekScheduleHeadKeys
|
|
/// in String[] weekScheduleItemKeys
|
|
/// out String[] weekScheduleHeadValues
|
|
/// out String[] weekScheduleItemValues
|
|
/// </para>
|
|
public static void test_mdataGetWeekSchedule()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] weekScheduleFilter = null;
|
|
String[] weekScheduleHeadKeys = null;
|
|
String[] weekScheduleItemKeys = null;
|
|
String[] weekScheduleHeadValues = null;
|
|
String[] weekScheduleItemValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for weekScheduleFilter: "));
|
|
int weekScheduleFilterSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
weekScheduleFilter = new KeyValue[weekScheduleFilterSize];
|
|
for (int i=0; i<weekScheduleFilterSize; i++)
|
|
{
|
|
weekScheduleFilter[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("weekScheduleFilter[" + i + "] .key (String): "));
|
|
weekScheduleFilter[i].key = getInput();
|
|
Console.Write(fillWithSpace("weekScheduleFilter[" + i + "] .value (String): "));
|
|
weekScheduleFilter[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for weekScheduleHeadKeys: "));
|
|
int weekScheduleHeadKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
weekScheduleHeadKeys = new String[weekScheduleHeadKeysSize];
|
|
for (int i=0; i<weekScheduleHeadKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("weekScheduleHeadKeys[" + i + "] (String): "));
|
|
weekScheduleHeadKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for weekScheduleItemKeys: "));
|
|
int weekScheduleItemKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
weekScheduleItemKeys = new String[weekScheduleItemKeysSize];
|
|
for (int i=0; i<weekScheduleItemKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("weekScheduleItemKeys[" + i + "] (String): "));
|
|
weekScheduleItemKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdataGetWeekSchedule(sessionContext, stationNumber, weekScheduleFilter, weekScheduleHeadKeys, weekScheduleItemKeys, out weekScheduleHeadValues, out weekScheduleItemValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; weekScheduleHeadValues != null && i<weekScheduleHeadValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("weekScheduleHeadValues[" + i + "]: ") + "<" + weekScheduleHeadValues[i] + ">");
|
|
}
|
|
for (int i=0; weekScheduleItemValues != null && i<weekScheduleItemValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("weekScheduleItemValues[" + i + "]: ") + "<" + weekScheduleItemValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdataGetShiftModel
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdataGetShiftModel"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] shiftModelFilter
|
|
/// in String[] shiftModelHeadKeys
|
|
/// in String[] shiftModelItemKeys
|
|
/// out String[] shiftModelHeadValues
|
|
/// out String[] shiftModelItemValues
|
|
/// </para>
|
|
public static void test_mdataGetShiftModel()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] shiftModelFilter = null;
|
|
String[] shiftModelHeadKeys = null;
|
|
String[] shiftModelItemKeys = null;
|
|
String[] shiftModelHeadValues = null;
|
|
String[] shiftModelItemValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for shiftModelFilter: "));
|
|
int shiftModelFilterSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
shiftModelFilter = new KeyValue[shiftModelFilterSize];
|
|
for (int i=0; i<shiftModelFilterSize; i++)
|
|
{
|
|
shiftModelFilter[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("shiftModelFilter[" + i + "] .key (String): "));
|
|
shiftModelFilter[i].key = getInput();
|
|
Console.Write(fillWithSpace("shiftModelFilter[" + i + "] .value (String): "));
|
|
shiftModelFilter[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for shiftModelHeadKeys: "));
|
|
int shiftModelHeadKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
shiftModelHeadKeys = new String[shiftModelHeadKeysSize];
|
|
for (int i=0; i<shiftModelHeadKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("shiftModelHeadKeys[" + i + "] (String): "));
|
|
shiftModelHeadKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for shiftModelItemKeys: "));
|
|
int shiftModelItemKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
shiftModelItemKeys = new String[shiftModelItemKeysSize];
|
|
for (int i=0; i<shiftModelItemKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("shiftModelItemKeys[" + i + "] (String): "));
|
|
shiftModelItemKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdataGetShiftModel(sessionContext, stationNumber, shiftModelFilter, shiftModelHeadKeys, shiftModelItemKeys, out shiftModelHeadValues, out shiftModelItemValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; shiftModelHeadValues != null && i<shiftModelHeadValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("shiftModelHeadValues[" + i + "]: ") + "<" + shiftModelHeadValues[i] + ">");
|
|
}
|
|
for (int i=0; shiftModelItemValues != null && i<shiftModelItemValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("shiftModelItemValues[" + i + "]: ") + "<" + shiftModelItemValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdataGetAssignedShiftModel
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdataGetAssignedShiftModel"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] assignedShiftModelFilter
|
|
/// in String[] assignedShiftModelKeys
|
|
/// out String[] assignedShiftModelValues
|
|
/// </para>
|
|
public static void test_mdataGetAssignedShiftModel()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] assignedShiftModelFilter = null;
|
|
String[] assignedShiftModelKeys = null;
|
|
String[] assignedShiftModelValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for assignedShiftModelFilter: "));
|
|
int assignedShiftModelFilterSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
assignedShiftModelFilter = new KeyValue[assignedShiftModelFilterSize];
|
|
for (int i=0; i<assignedShiftModelFilterSize; i++)
|
|
{
|
|
assignedShiftModelFilter[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("assignedShiftModelFilter[" + i + "] .key (String): "));
|
|
assignedShiftModelFilter[i].key = getInput();
|
|
Console.Write(fillWithSpace("assignedShiftModelFilter[" + i + "] .value (String): "));
|
|
assignedShiftModelFilter[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for assignedShiftModelKeys: "));
|
|
int assignedShiftModelKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
assignedShiftModelKeys = new String[assignedShiftModelKeysSize];
|
|
for (int i=0; i<assignedShiftModelKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("assignedShiftModelKeys[" + i + "] (String): "));
|
|
assignedShiftModelKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdataGetAssignedShiftModel(sessionContext, stationNumber, assignedShiftModelFilter, assignedShiftModelKeys, out assignedShiftModelValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; assignedShiftModelValues != null && i<assignedShiftModelValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("assignedShiftModelValues[" + i + "]: ") + "<" + assignedShiftModelValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdataGetAssignedSpecialTime
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdataGetAssignedSpecialTime"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] assignedSpecialTimeFilter
|
|
/// in String[] assignedSpecialTimeKeys
|
|
/// out String[] assignedSpecialTimeValues
|
|
/// </para>
|
|
public static void test_mdataGetAssignedSpecialTime()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] assignedSpecialTimeFilter = null;
|
|
String[] assignedSpecialTimeKeys = null;
|
|
String[] assignedSpecialTimeValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for assignedSpecialTimeFilter: "));
|
|
int assignedSpecialTimeFilterSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
assignedSpecialTimeFilter = new KeyValue[assignedSpecialTimeFilterSize];
|
|
for (int i=0; i<assignedSpecialTimeFilterSize; i++)
|
|
{
|
|
assignedSpecialTimeFilter[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("assignedSpecialTimeFilter[" + i + "] .key (String): "));
|
|
assignedSpecialTimeFilter[i].key = getInput();
|
|
Console.Write(fillWithSpace("assignedSpecialTimeFilter[" + i + "] .value (String): "));
|
|
assignedSpecialTimeFilter[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for assignedSpecialTimeKeys: "));
|
|
int assignedSpecialTimeKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
assignedSpecialTimeKeys = new String[assignedSpecialTimeKeysSize];
|
|
for (int i=0; i<assignedSpecialTimeKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("assignedSpecialTimeKeys[" + i + "] (String): "));
|
|
assignedSpecialTimeKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdataGetAssignedSpecialTime(sessionContext, stationNumber, assignedSpecialTimeFilter, assignedSpecialTimeKeys, out assignedSpecialTimeValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; assignedSpecialTimeValues != null && i<assignedSpecialTimeValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("assignedSpecialTimeValues[" + i + "]: ") + "<" + assignedSpecialTimeValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdataRequestWorkorder
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdataRequestWorkorder"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String[] requestWorkorderKeys
|
|
/// in String[] requestWorkorderValues
|
|
/// in String[] requestWorkorderResultKeys
|
|
/// out String[] requestWorkorderResultValues
|
|
/// </para>
|
|
public static void test_mdataRequestWorkorder()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String[] requestWorkorderKeys = null;
|
|
String[] requestWorkorderValues = null;
|
|
String[] requestWorkorderResultKeys = null;
|
|
String[] requestWorkorderResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for requestWorkorderKeys: "));
|
|
int requestWorkorderKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
requestWorkorderKeys = new String[requestWorkorderKeysSize];
|
|
for (int i=0; i<requestWorkorderKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("requestWorkorderKeys[" + i + "] (String): "));
|
|
requestWorkorderKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for requestWorkorderValues: "));
|
|
int requestWorkorderValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
requestWorkorderValues = new String[requestWorkorderValuesSize];
|
|
for (int i=0; i<requestWorkorderValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("requestWorkorderValues[" + i + "] (String): "));
|
|
requestWorkorderValues[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for requestWorkorderResultKeys: "));
|
|
int requestWorkorderResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
requestWorkorderResultKeys = new String[requestWorkorderResultKeysSize];
|
|
for (int i=0; i<requestWorkorderResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("requestWorkorderResultKeys[" + i + "] (String): "));
|
|
requestWorkorderResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdataRequestWorkorder(sessionContext, stationNumber, requestWorkorderKeys, requestWorkorderValues, requestWorkorderResultKeys, out requestWorkorderResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; requestWorkorderResultValues != null && i<requestWorkorderResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("requestWorkorderResultValues[" + i + "]: ") + "<" + requestWorkorderResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdcUploadStationCondition
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdcUploadStationCondition"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String[] stationConditionUploadKeys
|
|
/// in String[] stationConditionUploadValues
|
|
/// out String[] stationConditionResultValues
|
|
/// </para>
|
|
public static void test_mdcUploadStationCondition()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String[] stationConditionUploadKeys = null;
|
|
String[] stationConditionUploadValues = null;
|
|
String[] stationConditionResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for stationConditionUploadKeys: "));
|
|
int stationConditionUploadKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
stationConditionUploadKeys = new String[stationConditionUploadKeysSize];
|
|
for (int i=0; i<stationConditionUploadKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("stationConditionUploadKeys[" + i + "] (String): "));
|
|
stationConditionUploadKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for stationConditionUploadValues: "));
|
|
int stationConditionUploadValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
stationConditionUploadValues = new String[stationConditionUploadValuesSize];
|
|
for (int i=0; i<stationConditionUploadValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("stationConditionUploadValues[" + i + "] (String): "));
|
|
stationConditionUploadValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdcUploadStationCondition(sessionContext, stationNumber, stationConditionUploadKeys, stationConditionUploadValues, out stationConditionResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; stationConditionResultValues != null && i<stationConditionResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("stationConditionResultValues[" + i + "]: ") + "<" + stationConditionResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdcGetStationConditions
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdcGetStationConditions"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in long fromDate
|
|
/// in long toDate
|
|
/// in String conditionType
|
|
/// in int objectType
|
|
/// in String[] conditionResultKeys
|
|
/// out String[] conditionResultValues
|
|
/// </para>
|
|
public static void test_mdcGetStationConditions()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
long fromDate = 0;
|
|
long toDate = 0;
|
|
String conditionType = "";
|
|
int objectType = 0;
|
|
String[] conditionResultKeys = null;
|
|
String[] conditionResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("fromDate (long): "));
|
|
fromDate = Int64.Parse(getInput());
|
|
Console.Write(fillWithSpace("toDate (long): "));
|
|
toDate = Int64.Parse(getInput());
|
|
Console.Write(fillWithSpace("conditionType (String): "));
|
|
conditionType = getInput();
|
|
Console.Write(fillWithSpace("objectType (int): "));
|
|
objectType = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("Enter size for conditionResultKeys: "));
|
|
int conditionResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
conditionResultKeys = new String[conditionResultKeysSize];
|
|
for (int i=0; i<conditionResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("conditionResultKeys[" + i + "] (String): "));
|
|
conditionResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdcGetStationConditions(sessionContext, stationNumber, fromDate, toDate, conditionType, objectType, conditionResultKeys, out conditionResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; conditionResultValues != null && i<conditionResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("conditionResultValues[" + i + "]: ") + "<" + conditionResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdcGetStationConditionsByFilter
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdcGetStationConditionsByFilter"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in int objectType
|
|
/// in String[] stationArray
|
|
/// in String[] conditionCodeArray
|
|
/// in String[] conditionTypeArray
|
|
/// in String[] messageTypeArray
|
|
/// in String[] detectionPointArray
|
|
/// in String[] resourceArray
|
|
/// in KeyValue[] conditionResultFilter
|
|
/// in String[] conditionResultKeys
|
|
/// out String[] conditionResultValues
|
|
/// </para>
|
|
public static void test_mdcGetStationConditionsByFilter()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
int objectType = 0;
|
|
String[] stationArray = null;
|
|
String[] conditionCodeArray = null;
|
|
String[] conditionTypeArray = null;
|
|
String[] messageTypeArray = null;
|
|
String[] detectionPointArray = null;
|
|
String[] resourceArray = null;
|
|
KeyValue[] conditionResultFilter = null;
|
|
String[] conditionResultKeys = null;
|
|
String[] conditionResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("objectType (int): "));
|
|
objectType = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("Enter size for stationArray: "));
|
|
int stationArraySize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
stationArray = new String[stationArraySize];
|
|
for (int i=0; i<stationArraySize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("stationArray[" + i + "] (String): "));
|
|
stationArray[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for conditionCodeArray: "));
|
|
int conditionCodeArraySize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
conditionCodeArray = new String[conditionCodeArraySize];
|
|
for (int i=0; i<conditionCodeArraySize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("conditionCodeArray[" + i + "] (String): "));
|
|
conditionCodeArray[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for conditionTypeArray: "));
|
|
int conditionTypeArraySize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
conditionTypeArray = new String[conditionTypeArraySize];
|
|
for (int i=0; i<conditionTypeArraySize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("conditionTypeArray[" + i + "] (String): "));
|
|
conditionTypeArray[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for messageTypeArray: "));
|
|
int messageTypeArraySize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
messageTypeArray = new String[messageTypeArraySize];
|
|
for (int i=0; i<messageTypeArraySize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("messageTypeArray[" + i + "] (String): "));
|
|
messageTypeArray[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for detectionPointArray: "));
|
|
int detectionPointArraySize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
detectionPointArray = new String[detectionPointArraySize];
|
|
for (int i=0; i<detectionPointArraySize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("detectionPointArray[" + i + "] (String): "));
|
|
detectionPointArray[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for resourceArray: "));
|
|
int resourceArraySize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
resourceArray = new String[resourceArraySize];
|
|
for (int i=0; i<resourceArraySize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("resourceArray[" + i + "] (String): "));
|
|
resourceArray[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for conditionResultFilter: "));
|
|
int conditionResultFilterSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
conditionResultFilter = new KeyValue[conditionResultFilterSize];
|
|
for (int i=0; i<conditionResultFilterSize; i++)
|
|
{
|
|
conditionResultFilter[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("conditionResultFilter[" + i + "] .key (String): "));
|
|
conditionResultFilter[i].key = getInput();
|
|
Console.Write(fillWithSpace("conditionResultFilter[" + i + "] .value (String): "));
|
|
conditionResultFilter[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for conditionResultKeys: "));
|
|
int conditionResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
conditionResultKeys = new String[conditionResultKeysSize];
|
|
for (int i=0; i<conditionResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("conditionResultKeys[" + i + "] (String): "));
|
|
conditionResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdcGetStationConditionsByFilter(sessionContext, stationNumber, objectType, stationArray, conditionCodeArray, conditionTypeArray, messageTypeArray, detectionPointArray, resourceArray, conditionResultFilter, conditionResultKeys, out conditionResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; conditionResultValues != null && i<conditionResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("conditionResultValues[" + i + "]: ") + "<" + conditionResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdcGetMessageType
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdcGetMessageType"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] messageTypeFilter
|
|
/// in String[] messageTypeResultKeys
|
|
/// out String[] messageTypeResultValues
|
|
/// </para>
|
|
public static void test_mdcGetMessageType()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] messageTypeFilter = null;
|
|
String[] messageTypeResultKeys = null;
|
|
String[] messageTypeResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for messageTypeFilter: "));
|
|
int messageTypeFilterSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
messageTypeFilter = new KeyValue[messageTypeFilterSize];
|
|
for (int i=0; i<messageTypeFilterSize; i++)
|
|
{
|
|
messageTypeFilter[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("messageTypeFilter[" + i + "] .key (String): "));
|
|
messageTypeFilter[i].key = getInput();
|
|
Console.Write(fillWithSpace("messageTypeFilter[" + i + "] .value (String): "));
|
|
messageTypeFilter[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for messageTypeResultKeys: "));
|
|
int messageTypeResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
messageTypeResultKeys = new String[messageTypeResultKeysSize];
|
|
for (int i=0; i<messageTypeResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("messageTypeResultKeys[" + i + "] (String): "));
|
|
messageTypeResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdcGetMessageType(sessionContext, stationNumber, messageTypeFilter, messageTypeResultKeys, out messageTypeResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; messageTypeResultValues != null && i<messageTypeResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("messageTypeResultValues[" + i + "]: ") + "<" + messageTypeResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdcCreateLog
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdcCreateLog"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in long startDate
|
|
/// in long endDate
|
|
/// in String subject
|
|
/// in String text
|
|
/// in int forLine
|
|
/// </para>
|
|
public static void test_mdcCreateLog()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
long startDate = 0;
|
|
long endDate = 0;
|
|
String subject = "";
|
|
String text = "";
|
|
int forLine = 0;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("startDate (long): "));
|
|
startDate = Int64.Parse(getInput());
|
|
Console.Write(fillWithSpace("endDate (long): "));
|
|
endDate = Int64.Parse(getInput());
|
|
Console.Write(fillWithSpace("subject (String): "));
|
|
subject = getInput();
|
|
Console.Write(fillWithSpace("text (String): "));
|
|
text = getInput();
|
|
Console.Write(fillWithSpace("forLine (int): "));
|
|
forLine = Int32.Parse(getInput());
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdcCreateLog(sessionContext, stationNumber, startDate, endDate, subject, text, forLine);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdcGetLog
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdcGetLog"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in long fromDate
|
|
/// in long toDate
|
|
/// out MdcLog[] logArray
|
|
/// </para>
|
|
public static void test_mdcGetLog()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
long fromDate = 0;
|
|
long toDate = 0;
|
|
MdcLog[] logArray = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("fromDate (long): "));
|
|
fromDate = Int64.Parse(getInput());
|
|
Console.Write(fillWithSpace("toDate (long): "));
|
|
toDate = Int64.Parse(getInput());
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdcGetLog(sessionContext, stationNumber, fromDate, toDate, out logArray);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; logArray != null && i<logArray.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("logArray[" + i + "].startDate: ") + "<" + logArray[i].startDate + ">");
|
|
Console.WriteLine(fillWithSpace("logArray[" + i + "].endDate: ") + "<" + logArray[i].endDate + ">");
|
|
Console.WriteLine(fillWithSpace("logArray[" + i + "].subject: ") + "<" + logArray[i].subject + ">");
|
|
Console.WriteLine(fillWithSpace("logArray[" + i + "].txt: ") + "<" + logArray[i].txt + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdcGetConditionCodes
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdcGetConditionCodes"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] conditionCodeFilter
|
|
/// in String[] conditionCodeResultKeys
|
|
/// out String[] conditionCodeResultValues
|
|
/// </para>
|
|
public static void test_mdcGetConditionCodes()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] conditionCodeFilter = null;
|
|
String[] conditionCodeResultKeys = null;
|
|
String[] conditionCodeResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for conditionCodeFilter: "));
|
|
int conditionCodeFilterSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
conditionCodeFilter = new KeyValue[conditionCodeFilterSize];
|
|
for (int i=0; i<conditionCodeFilterSize; i++)
|
|
{
|
|
conditionCodeFilter[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("conditionCodeFilter[" + i + "] .key (String): "));
|
|
conditionCodeFilter[i].key = getInput();
|
|
Console.Write(fillWithSpace("conditionCodeFilter[" + i + "] .value (String): "));
|
|
conditionCodeFilter[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for conditionCodeResultKeys: "));
|
|
int conditionCodeResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
conditionCodeResultKeys = new String[conditionCodeResultKeysSize];
|
|
for (int i=0; i<conditionCodeResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("conditionCodeResultKeys[" + i + "] (String): "));
|
|
conditionCodeResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdcGetConditionCodes(sessionContext, stationNumber, conditionCodeFilter, conditionCodeResultKeys, out conditionCodeResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; conditionCodeResultValues != null && i<conditionCodeResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("conditionCodeResultValues[" + i + "]: ") + "<" + conditionCodeResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdcCreateConditionCode
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdcCreateConditionCode"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String conditionClass
|
|
/// in String conditionGroup
|
|
/// in String conditionCode
|
|
/// in String conditionName
|
|
/// in String conditionDesc
|
|
/// in String conditionCause
|
|
/// in String conditionType
|
|
/// in String colorRGB
|
|
/// in String[] stationNumbers
|
|
/// in String[] lineNumbers
|
|
/// </para>
|
|
public static void test_mdcCreateConditionCode()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String conditionClass = "";
|
|
String conditionGroup = "";
|
|
String conditionCode = "";
|
|
String conditionName = "";
|
|
String conditionDesc = "";
|
|
String conditionCause = "";
|
|
String conditionType = "";
|
|
String colorRGB = "";
|
|
String[] stationNumbers = null;
|
|
String[] lineNumbers = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("conditionClass (String): "));
|
|
conditionClass = getInput();
|
|
Console.Write(fillWithSpace("conditionGroup (String): "));
|
|
conditionGroup = getInput();
|
|
Console.Write(fillWithSpace("conditionCode (String): "));
|
|
conditionCode = getInput();
|
|
Console.Write(fillWithSpace("conditionName (String): "));
|
|
conditionName = getInput();
|
|
Console.Write(fillWithSpace("conditionDesc (String): "));
|
|
conditionDesc = getInput();
|
|
Console.Write(fillWithSpace("conditionCause (String): "));
|
|
conditionCause = getInput();
|
|
Console.Write(fillWithSpace("conditionType (String): "));
|
|
conditionType = getInput();
|
|
Console.Write(fillWithSpace("colorRGB (String): "));
|
|
colorRGB = getInput();
|
|
Console.Write(fillWithSpace("Enter size for stationNumbers: "));
|
|
int stationNumbersSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
stationNumbers = new String[stationNumbersSize];
|
|
for (int i=0; i<stationNumbersSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("stationNumbers[" + i + "] (String): "));
|
|
stationNumbers[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for lineNumbers: "));
|
|
int lineNumbersSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
lineNumbers = new String[lineNumbersSize];
|
|
for (int i=0; i<lineNumbersSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("lineNumbers[" + i + "] (String): "));
|
|
lineNumbers[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdcCreateConditionCode(sessionContext, stationNumber, conditionClass, conditionGroup, conditionCode, conditionName, conditionDesc, conditionCause, conditionType, colorRGB, stationNumbers, lineNumbers);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdcRegisterUserAtLine
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdcRegisterUserAtLine"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String userId
|
|
/// in String password
|
|
/// in int registrationType
|
|
/// in long bookDate
|
|
/// </para>
|
|
public static void test_mdcRegisterUserAtLine()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String userId = "";
|
|
String password = "";
|
|
int registrationType = 0;
|
|
long bookDate = 0;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("userId (String): "));
|
|
userId = getInput();
|
|
Console.Write(fillWithSpace("password (String): "));
|
|
password = getInputNoEcho();
|
|
Console.Write(fillWithSpace("registrationType (int): "));
|
|
registrationType = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("bookDate (long): "));
|
|
bookDate = Int64.Parse(getInput());
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdcRegisterUserAtLine(sessionContext, stationNumber, userId, password, registrationType, bookDate);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdcGetRegisteredUser
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdcGetRegisteredUser"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] mdcGetRegisteredUserFilter
|
|
/// in String[] mdcGetRegisteredUserKeys
|
|
/// out String[] mdcGetRegisteredUserValues
|
|
/// </para>
|
|
public static void test_mdcGetRegisteredUser()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] mdcGetRegisteredUserFilter = null;
|
|
String[] mdcGetRegisteredUserKeys = null;
|
|
String[] mdcGetRegisteredUserValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for mdcGetRegisteredUserFilter: "));
|
|
int mdcGetRegisteredUserFilterSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
mdcGetRegisteredUserFilter = new KeyValue[mdcGetRegisteredUserFilterSize];
|
|
for (int i=0; i<mdcGetRegisteredUserFilterSize; i++)
|
|
{
|
|
mdcGetRegisteredUserFilter[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("mdcGetRegisteredUserFilter[" + i + "] .key (String): "));
|
|
mdcGetRegisteredUserFilter[i].key = getInput();
|
|
Console.Write(fillWithSpace("mdcGetRegisteredUserFilter[" + i + "] .value (String): "));
|
|
mdcGetRegisteredUserFilter[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for mdcGetRegisteredUserKeys: "));
|
|
int mdcGetRegisteredUserKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
mdcGetRegisteredUserKeys = new String[mdcGetRegisteredUserKeysSize];
|
|
for (int i=0; i<mdcGetRegisteredUserKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("mdcGetRegisteredUserKeys[" + i + "] (String): "));
|
|
mdcGetRegisteredUserKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdcGetRegisteredUser(sessionContext, stationNumber, mdcGetRegisteredUserFilter, mdcGetRegisteredUserKeys, out mdcGetRegisteredUserValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; mdcGetRegisteredUserValues != null && i<mdcGetRegisteredUserValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("mdcGetRegisteredUserValues[" + i + "]: ") + "<" + mdcGetRegisteredUserValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdcUploadDetectionPoint
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdcUploadDetectionPoint"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String[] detectionPointKeys
|
|
/// in String[] detectionPointValues
|
|
/// out String[] detectionPointResultValues
|
|
/// </para>
|
|
public static void test_mdcUploadDetectionPoint()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String[] detectionPointKeys = null;
|
|
String[] detectionPointValues = null;
|
|
String[] detectionPointResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for detectionPointKeys: "));
|
|
int detectionPointKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
detectionPointKeys = new String[detectionPointKeysSize];
|
|
for (int i=0; i<detectionPointKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("detectionPointKeys[" + i + "] (String): "));
|
|
detectionPointKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for detectionPointValues: "));
|
|
int detectionPointValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
detectionPointValues = new String[detectionPointValuesSize];
|
|
for (int i=0; i<detectionPointValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("detectionPointValues[" + i + "] (String): "));
|
|
detectionPointValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdcUploadDetectionPoint(sessionContext, stationNumber, detectionPointKeys, detectionPointValues, out detectionPointResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; detectionPointResultValues != null && i<detectionPointResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("detectionPointResultValues[" + i + "]: ") + "<" + detectionPointResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdcUpdateStationCondition
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdcUpdateStationCondition"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in int objectType
|
|
/// in long conditionId
|
|
/// in KeyValue[] stationConditionUpdateKeys
|
|
/// out String[] stationConditionResultValues
|
|
/// </para>
|
|
public static void test_mdcUpdateStationCondition()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
int objectType = 0;
|
|
long conditionId = 0;
|
|
KeyValue[] stationConditionUpdateKeys = null;
|
|
String[] stationConditionResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("objectType (int): "));
|
|
objectType = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("conditionId (long): "));
|
|
conditionId = Int64.Parse(getInput());
|
|
Console.Write(fillWithSpace("Enter size for stationConditionUpdateKeys: "));
|
|
int stationConditionUpdateKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
stationConditionUpdateKeys = new KeyValue[stationConditionUpdateKeysSize];
|
|
for (int i=0; i<stationConditionUpdateKeysSize; i++)
|
|
{
|
|
stationConditionUpdateKeys[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("stationConditionUpdateKeys[" + i + "] .key (String): "));
|
|
stationConditionUpdateKeys[i].key = getInput();
|
|
Console.Write(fillWithSpace("stationConditionUpdateKeys[" + i + "] .value (String): "));
|
|
stationConditionUpdateKeys[i].value = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdcUpdateStationCondition(sessionContext, stationNumber, objectType, conditionId, stationConditionUpdateKeys, out stationConditionResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; stationConditionResultValues != null && i<stationConditionResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("stationConditionResultValues[" + i + "]: ") + "<" + stationConditionResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdcCreateLogData
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdcCreateLogData"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String subject
|
|
/// in int forLine
|
|
/// in String[] stationLogKeys
|
|
/// in String[] stationLogValues
|
|
/// out String[] stationLogResultValues
|
|
/// </para>
|
|
public static void test_mdcCreateLogData()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String subject = "";
|
|
int forLine = 0;
|
|
String[] stationLogKeys = null;
|
|
String[] stationLogValues = null;
|
|
String[] stationLogResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("subject (String): "));
|
|
subject = getInput();
|
|
Console.Write(fillWithSpace("forLine (int): "));
|
|
forLine = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("Enter size for stationLogKeys: "));
|
|
int stationLogKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
stationLogKeys = new String[stationLogKeysSize];
|
|
for (int i=0; i<stationLogKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("stationLogKeys[" + i + "] (String): "));
|
|
stationLogKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for stationLogValues: "));
|
|
int stationLogValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
stationLogValues = new String[stationLogValuesSize];
|
|
for (int i=0; i<stationLogValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("stationLogValues[" + i + "] (String): "));
|
|
stationLogValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdcCreateLogData(sessionContext, stationNumber, subject, forLine, stationLogKeys, stationLogValues, out stationLogResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; stationLogResultValues != null && i<stationLogResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("stationLogResultValues[" + i + "]: ") + "<" + stationLogResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdcGetLogData
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdcGetLogData"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String[] stationNumbers
|
|
/// in String[] subjects
|
|
/// in String[] detectionPoints
|
|
/// in KeyValue[] stationLogFilter
|
|
/// in String[] stationLogResultKeys
|
|
/// out String[] stationLogResultValues
|
|
/// </para>
|
|
public static void test_mdcGetLogData()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String[] stationNumbers = null;
|
|
String[] subjects = null;
|
|
String[] detectionPoints = null;
|
|
KeyValue[] stationLogFilter = null;
|
|
String[] stationLogResultKeys = null;
|
|
String[] stationLogResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for stationNumbers: "));
|
|
int stationNumbersSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
stationNumbers = new String[stationNumbersSize];
|
|
for (int i=0; i<stationNumbersSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("stationNumbers[" + i + "] (String): "));
|
|
stationNumbers[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for subjects: "));
|
|
int subjectsSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
subjects = new String[subjectsSize];
|
|
for (int i=0; i<subjectsSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("subjects[" + i + "] (String): "));
|
|
subjects[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for detectionPoints: "));
|
|
int detectionPointsSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
detectionPoints = new String[detectionPointsSize];
|
|
for (int i=0; i<detectionPointsSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("detectionPoints[" + i + "] (String): "));
|
|
detectionPoints[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for stationLogFilter: "));
|
|
int stationLogFilterSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
stationLogFilter = new KeyValue[stationLogFilterSize];
|
|
for (int i=0; i<stationLogFilterSize; i++)
|
|
{
|
|
stationLogFilter[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("stationLogFilter[" + i + "] .key (String): "));
|
|
stationLogFilter[i].key = getInput();
|
|
Console.Write(fillWithSpace("stationLogFilter[" + i + "] .value (String): "));
|
|
stationLogFilter[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for stationLogResultKeys: "));
|
|
int stationLogResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
stationLogResultKeys = new String[stationLogResultKeysSize];
|
|
for (int i=0; i<stationLogResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("stationLogResultKeys[" + i + "] (String): "));
|
|
stationLogResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdcGetLogData(sessionContext, stationNumber, stationNumbers, subjects, detectionPoints, stationLogFilter, stationLogResultKeys, out stationLogResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; stationLogResultValues != null && i<stationLogResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("stationLogResultValues[" + i + "]: ") + "<" + stationLogResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdcAcknowledgeStationConditions
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdcAcknowledgeStationConditions"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String userAcknowledge
|
|
/// in long dateAcknowledge
|
|
/// in String txtAcknowledge
|
|
/// in int selectionType
|
|
/// in String[] stationConditionAcknowledgeKeys
|
|
/// in String[] stationConditionAcknowledgeValues
|
|
/// out String[] stationConditionResultValues
|
|
/// </para>
|
|
public static void test_mdcAcknowledgeStationConditions()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String userAcknowledge = "";
|
|
long dateAcknowledge = 0;
|
|
String txtAcknowledge = "";
|
|
int selectionType = 0;
|
|
String[] stationConditionAcknowledgeKeys = null;
|
|
String[] stationConditionAcknowledgeValues = null;
|
|
String[] stationConditionResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("userAcknowledge (String): "));
|
|
userAcknowledge = getInput();
|
|
Console.Write(fillWithSpace("dateAcknowledge (long): "));
|
|
dateAcknowledge = Int64.Parse(getInput());
|
|
Console.Write(fillWithSpace("txtAcknowledge (String): "));
|
|
txtAcknowledge = getInput();
|
|
Console.Write(fillWithSpace("selectionType (int): "));
|
|
selectionType = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("Enter size for stationConditionAcknowledgeKeys: "));
|
|
int stationConditionAcknowledgeKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
stationConditionAcknowledgeKeys = new String[stationConditionAcknowledgeKeysSize];
|
|
for (int i=0; i<stationConditionAcknowledgeKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("stationConditionAcknowledgeKeys[" + i + "] (String): "));
|
|
stationConditionAcknowledgeKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for stationConditionAcknowledgeValues: "));
|
|
int stationConditionAcknowledgeValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
stationConditionAcknowledgeValues = new String[stationConditionAcknowledgeValuesSize];
|
|
for (int i=0; i<stationConditionAcknowledgeValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("stationConditionAcknowledgeValues[" + i + "] (String): "));
|
|
stationConditionAcknowledgeValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdcAcknowledgeStationConditions(sessionContext, stationNumber, userAcknowledge, dateAcknowledge, txtAcknowledge, selectionType, stationConditionAcknowledgeKeys, stationConditionAcknowledgeValues, out stationConditionResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; stationConditionResultValues != null && i<stationConditionResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("stationConditionResultValues[" + i + "]: ") + "<" + stationConditionResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdcManageConditionCode
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdcManageConditionCode"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String[] manageConditionCodeUploadKeys
|
|
/// in String[] manageConditionCodeUploadValues
|
|
/// out String[] manageConditionCodeResultValues
|
|
/// </para>
|
|
public static void test_mdcManageConditionCode()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String[] manageConditionCodeUploadKeys = null;
|
|
String[] manageConditionCodeUploadValues = null;
|
|
String[] manageConditionCodeResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for manageConditionCodeUploadKeys: "));
|
|
int manageConditionCodeUploadKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
manageConditionCodeUploadKeys = new String[manageConditionCodeUploadKeysSize];
|
|
for (int i=0; i<manageConditionCodeUploadKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("manageConditionCodeUploadKeys[" + i + "] (String): "));
|
|
manageConditionCodeUploadKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for manageConditionCodeUploadValues: "));
|
|
int manageConditionCodeUploadValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
manageConditionCodeUploadValues = new String[manageConditionCodeUploadValuesSize];
|
|
for (int i=0; i<manageConditionCodeUploadValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("manageConditionCodeUploadValues[" + i + "] (String): "));
|
|
manageConditionCodeUploadValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdcManageConditionCode(sessionContext, stationNumber, manageConditionCodeUploadKeys, manageConditionCodeUploadValues, out manageConditionCodeResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; manageConditionCodeResultValues != null && i<manageConditionCodeResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("manageConditionCodeResultValues[" + i + "]: ") + "<" + manageConditionCodeResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdcGetKeyPerformanceIndicators
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdcGetKeyPerformanceIndicators"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in long fromDate
|
|
/// in long toDate
|
|
/// in String[] performanceIndicatorResultKeys
|
|
/// out String[] performanceIndicatorResultValues
|
|
/// in String[] mdeAmountResultKeys
|
|
/// out String[] mdeAmountResultValues
|
|
/// in String[] mdePlannedCycleTimeResultKeys
|
|
/// out String[] mdePlannedCycleTimeResultValues
|
|
/// in String[] mdeShiftTimeResultKeys
|
|
/// out String[] mdeShiftTimeResultValues
|
|
/// in String[] mdeConditionTimeResultKeys
|
|
/// out String[] mdeConditionTimeResultValues
|
|
/// in String[] mdePerformanceResultKeys
|
|
/// out String[] mdePerformanceResultValues
|
|
/// </para>
|
|
public static void test_mdcGetKeyPerformanceIndicators()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
long fromDate = 0;
|
|
long toDate = 0;
|
|
String[] performanceIndicatorResultKeys = null;
|
|
String[] performanceIndicatorResultValues = null;
|
|
String[] mdeAmountResultKeys = null;
|
|
String[] mdeAmountResultValues = null;
|
|
String[] mdePlannedCycleTimeResultKeys = null;
|
|
String[] mdePlannedCycleTimeResultValues = null;
|
|
String[] mdeShiftTimeResultKeys = null;
|
|
String[] mdeShiftTimeResultValues = null;
|
|
String[] mdeConditionTimeResultKeys = null;
|
|
String[] mdeConditionTimeResultValues = null;
|
|
String[] mdePerformanceResultKeys = null;
|
|
String[] mdePerformanceResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("fromDate (long): "));
|
|
fromDate = Int64.Parse(getInput());
|
|
Console.Write(fillWithSpace("toDate (long): "));
|
|
toDate = Int64.Parse(getInput());
|
|
Console.Write(fillWithSpace("Enter size for performanceIndicatorResultKeys: "));
|
|
int performanceIndicatorResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
performanceIndicatorResultKeys = new String[performanceIndicatorResultKeysSize];
|
|
for (int i=0; i<performanceIndicatorResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("performanceIndicatorResultKeys[" + i + "] (String): "));
|
|
performanceIndicatorResultKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for mdeAmountResultKeys: "));
|
|
int mdeAmountResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
mdeAmountResultKeys = new String[mdeAmountResultKeysSize];
|
|
for (int i=0; i<mdeAmountResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("mdeAmountResultKeys[" + i + "] (String): "));
|
|
mdeAmountResultKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for mdePlannedCycleTimeResultKeys: "));
|
|
int mdePlannedCycleTimeResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
mdePlannedCycleTimeResultKeys = new String[mdePlannedCycleTimeResultKeysSize];
|
|
for (int i=0; i<mdePlannedCycleTimeResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("mdePlannedCycleTimeResultKeys[" + i + "] (String): "));
|
|
mdePlannedCycleTimeResultKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for mdeShiftTimeResultKeys: "));
|
|
int mdeShiftTimeResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
mdeShiftTimeResultKeys = new String[mdeShiftTimeResultKeysSize];
|
|
for (int i=0; i<mdeShiftTimeResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("mdeShiftTimeResultKeys[" + i + "] (String): "));
|
|
mdeShiftTimeResultKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for mdeConditionTimeResultKeys: "));
|
|
int mdeConditionTimeResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
mdeConditionTimeResultKeys = new String[mdeConditionTimeResultKeysSize];
|
|
for (int i=0; i<mdeConditionTimeResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("mdeConditionTimeResultKeys[" + i + "] (String): "));
|
|
mdeConditionTimeResultKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for mdePerformanceResultKeys: "));
|
|
int mdePerformanceResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
mdePerformanceResultKeys = new String[mdePerformanceResultKeysSize];
|
|
for (int i=0; i<mdePerformanceResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("mdePerformanceResultKeys[" + i + "] (String): "));
|
|
mdePerformanceResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdcGetKeyPerformanceIndicators(sessionContext, stationNumber, fromDate, toDate, performanceIndicatorResultKeys, out performanceIndicatorResultValues, mdeAmountResultKeys, out mdeAmountResultValues, mdePlannedCycleTimeResultKeys, out mdePlannedCycleTimeResultValues, mdeShiftTimeResultKeys, out mdeShiftTimeResultValues, mdeConditionTimeResultKeys, out mdeConditionTimeResultValues, mdePerformanceResultKeys, out mdePerformanceResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; performanceIndicatorResultValues != null && i<performanceIndicatorResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("performanceIndicatorResultValues[" + i + "]: ") + "<" + performanceIndicatorResultValues[i] + ">");
|
|
}
|
|
for (int i=0; mdeAmountResultValues != null && i<mdeAmountResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("mdeAmountResultValues[" + i + "]: ") + "<" + mdeAmountResultValues[i] + ">");
|
|
}
|
|
for (int i=0; mdePlannedCycleTimeResultValues != null && i<mdePlannedCycleTimeResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("mdePlannedCycleTimeResultValues[" + i + "]: ") + "<" + mdePlannedCycleTimeResultValues[i] + ">");
|
|
}
|
|
for (int i=0; mdeShiftTimeResultValues != null && i<mdeShiftTimeResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("mdeShiftTimeResultValues[" + i + "]: ") + "<" + mdeShiftTimeResultValues[i] + ">");
|
|
}
|
|
for (int i=0; mdeConditionTimeResultValues != null && i<mdeConditionTimeResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("mdeConditionTimeResultValues[" + i + "]: ") + "<" + mdeConditionTimeResultValues[i] + ">");
|
|
}
|
|
for (int i=0; mdePerformanceResultValues != null && i<mdePerformanceResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("mdePerformanceResultValues[" + i + "]: ") + "<" + mdePerformanceResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mdcCloseStationMessage
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mdcCloseStationMessage"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] closeStationMessageUploadKeys
|
|
/// in KeyValue[] closeStationMessageFilter
|
|
/// in String[] dataBlockValues
|
|
/// in String[] controlValues
|
|
/// in String[] variableValues
|
|
/// </para>
|
|
public static void test_mdcCloseStationMessage()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] closeStationMessageUploadKeys = null;
|
|
KeyValue[] closeStationMessageFilter = null;
|
|
String[] dataBlockValues = null;
|
|
String[] controlValues = null;
|
|
String[] variableValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for closeStationMessageUploadKeys: "));
|
|
int closeStationMessageUploadKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
closeStationMessageUploadKeys = new KeyValue[closeStationMessageUploadKeysSize];
|
|
for (int i=0; i<closeStationMessageUploadKeysSize; i++)
|
|
{
|
|
closeStationMessageUploadKeys[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("closeStationMessageUploadKeys[" + i + "] .key (String): "));
|
|
closeStationMessageUploadKeys[i].key = getInput();
|
|
Console.Write(fillWithSpace("closeStationMessageUploadKeys[" + i + "] .value (String): "));
|
|
closeStationMessageUploadKeys[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for closeStationMessageFilter: "));
|
|
int closeStationMessageFilterSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
closeStationMessageFilter = new KeyValue[closeStationMessageFilterSize];
|
|
for (int i=0; i<closeStationMessageFilterSize; i++)
|
|
{
|
|
closeStationMessageFilter[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("closeStationMessageFilter[" + i + "] .key (String): "));
|
|
closeStationMessageFilter[i].key = getInput();
|
|
Console.Write(fillWithSpace("closeStationMessageFilter[" + i + "] .value (String): "));
|
|
closeStationMessageFilter[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for dataBlockValues: "));
|
|
int dataBlockValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
dataBlockValues = new String[dataBlockValuesSize];
|
|
for (int i=0; i<dataBlockValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("dataBlockValues[" + i + "] (String): "));
|
|
dataBlockValues[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for controlValues: "));
|
|
int controlValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
controlValues = new String[controlValuesSize];
|
|
for (int i=0; i<controlValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("controlValues[" + i + "] (String): "));
|
|
controlValues[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for variableValues: "));
|
|
int variableValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
variableValues = new String[variableValuesSize];
|
|
for (int i=0; i<variableValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("variableValues[" + i + "] (String): "));
|
|
variableValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mdcCloseStationMessage(sessionContext, stationNumber, closeStationMessageUploadKeys, closeStationMessageFilter, dataBlockValues, controlValues, variableValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mlCreateNewMaterialBin
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mlCreateNewMaterialBin"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String[] materialBinUploadKeys
|
|
/// in String[] materialBinUploadValues
|
|
/// out String[] materialBinResultValues
|
|
/// </para>
|
|
public static void test_mlCreateNewMaterialBin()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String[] materialBinUploadKeys = null;
|
|
String[] materialBinUploadValues = null;
|
|
String[] materialBinResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for materialBinUploadKeys: "));
|
|
int materialBinUploadKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
materialBinUploadKeys = new String[materialBinUploadKeysSize];
|
|
for (int i=0; i<materialBinUploadKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("materialBinUploadKeys[" + i + "] (String): "));
|
|
materialBinUploadKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for materialBinUploadValues: "));
|
|
int materialBinUploadValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
materialBinUploadValues = new String[materialBinUploadValuesSize];
|
|
for (int i=0; i<materialBinUploadValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("materialBinUploadValues[" + i + "] (String): "));
|
|
materialBinUploadValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mlCreateNewMaterialBin(sessionContext, stationNumber, materialBinUploadKeys, materialBinUploadValues, out materialBinResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; materialBinResultValues != null && i<materialBinResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("materialBinResultValues[" + i + "]: ") + "<" + materialBinResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mlSetMaterialBinLocation
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mlSetMaterialBinLocation"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String materialBinNumber
|
|
/// in long bookDate
|
|
/// in String binLocation
|
|
/// in String binLocationBarcode
|
|
/// in int transactionType
|
|
/// </para>
|
|
public static void test_mlSetMaterialBinLocation()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String materialBinNumber = "";
|
|
long bookDate = 0;
|
|
String binLocation = "";
|
|
String binLocationBarcode = "";
|
|
int transactionType = 0;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("materialBinNumber (String): "));
|
|
materialBinNumber = getInput();
|
|
Console.Write(fillWithSpace("bookDate (long): "));
|
|
bookDate = Int64.Parse(getInput());
|
|
Console.Write(fillWithSpace("binLocation (String): "));
|
|
binLocation = getInput();
|
|
Console.Write(fillWithSpace("binLocationBarcode (String): "));
|
|
binLocationBarcode = getInput();
|
|
Console.Write(fillWithSpace("transactionType (int): "));
|
|
transactionType = Int32.Parse(getInput());
|
|
|
|
// call imsapi function
|
|
result = imsapi.mlSetMaterialBinLocation(sessionContext, stationNumber, materialBinNumber, bookDate, binLocation, binLocationBarcode, transactionType);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mlChangeMaterialBinData
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mlChangeMaterialBinData"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String materialBinNumber
|
|
/// in KeyValue[] materialBinDataUploadValues
|
|
/// </para>
|
|
public static void test_mlChangeMaterialBinData()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String materialBinNumber = "";
|
|
KeyValue[] materialBinDataUploadValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("materialBinNumber (String): "));
|
|
materialBinNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for materialBinDataUploadValues: "));
|
|
int materialBinDataUploadValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
materialBinDataUploadValues = new KeyValue[materialBinDataUploadValuesSize];
|
|
for (int i=0; i<materialBinDataUploadValuesSize; i++)
|
|
{
|
|
materialBinDataUploadValues[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("materialBinDataUploadValues[" + i + "] .key (String): "));
|
|
materialBinDataUploadValues[i].key = getInput();
|
|
Console.Write(fillWithSpace("materialBinDataUploadValues[" + i + "] .value (String): "));
|
|
materialBinDataUploadValues[i].value = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mlChangeMaterialBinData(sessionContext, stationNumber, materialBinNumber, materialBinDataUploadValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mlGetNextMaterialBinNumber
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mlGetNextMaterialBinNumber"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String partNumber
|
|
/// out String materialBinNumber
|
|
/// </para>
|
|
public static void test_mlGetNextMaterialBinNumber()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String partNumber = "";
|
|
String materialBinNumber = "";
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("partNumber (String): "));
|
|
partNumber = getInput();
|
|
|
|
// call imsapi function
|
|
result = imsapi.mlGetNextMaterialBinNumber(sessionContext, stationNumber, partNumber, out materialBinNumber);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
Console.WriteLine(fillWithSpace("materialBinNumber: ") + "<" + materialBinNumber + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mlGetMaterialBinData
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mlGetMaterialBinData"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] materialBinFilters
|
|
/// in AttributeInfo[] attributes
|
|
/// in String[] materialBinResultKeys
|
|
/// out String[] materialBinResultValues
|
|
/// </para>
|
|
public static void test_mlGetMaterialBinData()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] materialBinFilters = null;
|
|
AttributeInfo[] attributes = null;
|
|
String[] materialBinResultKeys = null;
|
|
String[] materialBinResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for materialBinFilters: "));
|
|
int materialBinFiltersSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
materialBinFilters = new KeyValue[materialBinFiltersSize];
|
|
for (int i=0; i<materialBinFiltersSize; i++)
|
|
{
|
|
materialBinFilters[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("materialBinFilters[" + i + "] .key (String): "));
|
|
materialBinFilters[i].key = getInput();
|
|
Console.Write(fillWithSpace("materialBinFilters[" + i + "] .value (String): "));
|
|
materialBinFilters[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for attributes: "));
|
|
int attributesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
attributes = new AttributeInfo[attributesSize];
|
|
for (int i=0; i<attributesSize; i++)
|
|
{
|
|
attributes[i] = new AttributeInfo();
|
|
Console.Write(fillWithSpace("attributes[" + i + "] .attributeCode (String): "));
|
|
attributes[i].attributeCode = getInput();
|
|
Console.Write(fillWithSpace("attributes[" + i + "] .attributeValue (String): "));
|
|
attributes[i].attributeValue = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for materialBinResultKeys: "));
|
|
int materialBinResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
materialBinResultKeys = new String[materialBinResultKeysSize];
|
|
for (int i=0; i<materialBinResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("materialBinResultKeys[" + i + "] (String): "));
|
|
materialBinResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mlGetMaterialBinData(sessionContext, stationNumber, materialBinFilters, attributes, materialBinResultKeys, out materialBinResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; materialBinResultValues != null && i<materialBinResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("materialBinResultValues[" + i + "]: ") + "<" + materialBinResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mlGetStorage
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mlGetStorage"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String storageCellNumber
|
|
/// in String storageGroupNumber
|
|
/// in String storageNumber
|
|
/// in String[] storageResultKeys
|
|
/// out String[] storageResultValues
|
|
/// </para>
|
|
public static void test_mlGetStorage()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String storageCellNumber = "";
|
|
String storageGroupNumber = "";
|
|
String storageNumber = "";
|
|
String[] storageResultKeys = null;
|
|
String[] storageResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("storageCellNumber (String): "));
|
|
storageCellNumber = getInput();
|
|
Console.Write(fillWithSpace("storageGroupNumber (String): "));
|
|
storageGroupNumber = getInput();
|
|
Console.Write(fillWithSpace("storageNumber (String): "));
|
|
storageNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for storageResultKeys: "));
|
|
int storageResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
storageResultKeys = new String[storageResultKeysSize];
|
|
for (int i=0; i<storageResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("storageResultKeys[" + i + "] (String): "));
|
|
storageResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mlGetStorage(sessionContext, stationNumber, storageCellNumber, storageGroupNumber, storageNumber, storageResultKeys, out storageResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; storageResultValues != null && i<storageResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("storageResultValues[" + i + "]: ") + "<" + storageResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mlUploadMaterialBinBooking
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mlUploadMaterialBinBooking"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String[] materialBinBookingUploadKeys
|
|
/// in String[] materialBinBookingUploadValues
|
|
/// out String[] materialBinBookingResultValues
|
|
/// </para>
|
|
public static void test_mlUploadMaterialBinBooking()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String[] materialBinBookingUploadKeys = null;
|
|
String[] materialBinBookingUploadValues = null;
|
|
String[] materialBinBookingResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for materialBinBookingUploadKeys: "));
|
|
int materialBinBookingUploadKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
materialBinBookingUploadKeys = new String[materialBinBookingUploadKeysSize];
|
|
for (int i=0; i<materialBinBookingUploadKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("materialBinBookingUploadKeys[" + i + "] (String): "));
|
|
materialBinBookingUploadKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for materialBinBookingUploadValues: "));
|
|
int materialBinBookingUploadValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
materialBinBookingUploadValues = new String[materialBinBookingUploadValuesSize];
|
|
for (int i=0; i<materialBinBookingUploadValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("materialBinBookingUploadValues[" + i + "] (String): "));
|
|
materialBinBookingUploadValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mlUploadMaterialBinBooking(sessionContext, stationNumber, materialBinBookingUploadKeys, materialBinBookingUploadValues, out materialBinBookingResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; materialBinBookingResultValues != null && i<materialBinBookingResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("materialBinBookingResultValues[" + i + "]: ") + "<" + materialBinBookingResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mlSplitMaterialBin
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mlSplitMaterialBin"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String materialBinNumber
|
|
/// in String[] splitMaterialBinKeys
|
|
/// in String[] splitMaterialBinUploadValues
|
|
/// in String[] splitMaterialBinResultKeys
|
|
/// out String[] splitMaterialBinResultValues
|
|
/// </para>
|
|
public static void test_mlSplitMaterialBin()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String materialBinNumber = "";
|
|
String[] splitMaterialBinKeys = null;
|
|
String[] splitMaterialBinUploadValues = null;
|
|
String[] splitMaterialBinResultKeys = null;
|
|
String[] splitMaterialBinResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("materialBinNumber (String): "));
|
|
materialBinNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for splitMaterialBinKeys: "));
|
|
int splitMaterialBinKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
splitMaterialBinKeys = new String[splitMaterialBinKeysSize];
|
|
for (int i=0; i<splitMaterialBinKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("splitMaterialBinKeys[" + i + "] (String): "));
|
|
splitMaterialBinKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for splitMaterialBinUploadValues: "));
|
|
int splitMaterialBinUploadValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
splitMaterialBinUploadValues = new String[splitMaterialBinUploadValuesSize];
|
|
for (int i=0; i<splitMaterialBinUploadValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("splitMaterialBinUploadValues[" + i + "] (String): "));
|
|
splitMaterialBinUploadValues[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for splitMaterialBinResultKeys: "));
|
|
int splitMaterialBinResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
splitMaterialBinResultKeys = new String[splitMaterialBinResultKeysSize];
|
|
for (int i=0; i<splitMaterialBinResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("splitMaterialBinResultKeys[" + i + "] (String): "));
|
|
splitMaterialBinResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mlSplitMaterialBin(sessionContext, stationNumber, materialBinNumber, splitMaterialBinKeys, splitMaterialBinUploadValues, splitMaterialBinResultKeys, out splitMaterialBinResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; splitMaterialBinResultValues != null && i<splitMaterialBinResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("splitMaterialBinResultValues[" + i + "]: ") + "<" + splitMaterialBinResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mlGetPurchaseOrderData
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mlGetPurchaseOrderData"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] purchaseDataFilters
|
|
/// in String[] purchaseDataResultKeys
|
|
/// out String[] purchaseDataResultValues
|
|
/// out bool hasMore
|
|
/// </para>
|
|
public static void test_mlGetPurchaseOrderData()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] purchaseDataFilters = null;
|
|
String[] purchaseDataResultKeys = null;
|
|
String[] purchaseDataResultValues = null;
|
|
bool hasMore = false;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for purchaseDataFilters: "));
|
|
int purchaseDataFiltersSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
purchaseDataFilters = new KeyValue[purchaseDataFiltersSize];
|
|
for (int i=0; i<purchaseDataFiltersSize; i++)
|
|
{
|
|
purchaseDataFilters[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("purchaseDataFilters[" + i + "] .key (String): "));
|
|
purchaseDataFilters[i].key = getInput();
|
|
Console.Write(fillWithSpace("purchaseDataFilters[" + i + "] .value (String): "));
|
|
purchaseDataFilters[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for purchaseDataResultKeys: "));
|
|
int purchaseDataResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
purchaseDataResultKeys = new String[purchaseDataResultKeysSize];
|
|
for (int i=0; i<purchaseDataResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("purchaseDataResultKeys[" + i + "] (String): "));
|
|
purchaseDataResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mlGetPurchaseOrderData(sessionContext, stationNumber, purchaseDataFilters, purchaseDataResultKeys, out purchaseDataResultValues, out hasMore);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; purchaseDataResultValues != null && i<purchaseDataResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("purchaseDataResultValues[" + i + "]: ") + "<" + purchaseDataResultValues[i] + ">");
|
|
}
|
|
Console.WriteLine(fillWithSpace("hasMore: ") + "<" + hasMore + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mlGetIncomingGoods
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mlGetIncomingGoods"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] incomingGoodsFilters
|
|
/// in String[] incomingGoodsHeadResultKeys
|
|
/// in String[] incomingGoodsItemResultKeys
|
|
/// out String[] incomingGoodsHeadResultValues
|
|
/// out String[] incomingGoodsItemResultValues
|
|
/// out bool hasMore
|
|
/// </para>
|
|
public static void test_mlGetIncomingGoods()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] incomingGoodsFilters = null;
|
|
String[] incomingGoodsHeadResultKeys = null;
|
|
String[] incomingGoodsItemResultKeys = null;
|
|
String[] incomingGoodsHeadResultValues = null;
|
|
String[] incomingGoodsItemResultValues = null;
|
|
bool hasMore = false;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for incomingGoodsFilters: "));
|
|
int incomingGoodsFiltersSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
incomingGoodsFilters = new KeyValue[incomingGoodsFiltersSize];
|
|
for (int i=0; i<incomingGoodsFiltersSize; i++)
|
|
{
|
|
incomingGoodsFilters[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("incomingGoodsFilters[" + i + "] .key (String): "));
|
|
incomingGoodsFilters[i].key = getInput();
|
|
Console.Write(fillWithSpace("incomingGoodsFilters[" + i + "] .value (String): "));
|
|
incomingGoodsFilters[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for incomingGoodsHeadResultKeys: "));
|
|
int incomingGoodsHeadResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
incomingGoodsHeadResultKeys = new String[incomingGoodsHeadResultKeysSize];
|
|
for (int i=0; i<incomingGoodsHeadResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("incomingGoodsHeadResultKeys[" + i + "] (String): "));
|
|
incomingGoodsHeadResultKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for incomingGoodsItemResultKeys: "));
|
|
int incomingGoodsItemResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
incomingGoodsItemResultKeys = new String[incomingGoodsItemResultKeysSize];
|
|
for (int i=0; i<incomingGoodsItemResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("incomingGoodsItemResultKeys[" + i + "] (String): "));
|
|
incomingGoodsItemResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mlGetIncomingGoods(sessionContext, stationNumber, incomingGoodsFilters, incomingGoodsHeadResultKeys, incomingGoodsItemResultKeys, out incomingGoodsHeadResultValues, out incomingGoodsItemResultValues, out hasMore);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; incomingGoodsHeadResultValues != null && i<incomingGoodsHeadResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("incomingGoodsHeadResultValues[" + i + "]: ") + "<" + incomingGoodsHeadResultValues[i] + ">");
|
|
}
|
|
for (int i=0; incomingGoodsItemResultValues != null && i<incomingGoodsItemResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("incomingGoodsItemResultValues[" + i + "]: ") + "<" + incomingGoodsItemResultValues[i] + ">");
|
|
}
|
|
Console.WriteLine(fillWithSpace("hasMore: ") + "<" + hasMore + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mlUpdateStorageCell
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mlUpdateStorageCell"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String[] storageUpdateKeys
|
|
/// in String[] storageUpdateValues
|
|
/// out String[] storageUpdateResultValues
|
|
/// </para>
|
|
public static void test_mlUpdateStorageCell()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String[] storageUpdateKeys = null;
|
|
String[] storageUpdateValues = null;
|
|
String[] storageUpdateResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for storageUpdateKeys: "));
|
|
int storageUpdateKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
storageUpdateKeys = new String[storageUpdateKeysSize];
|
|
for (int i=0; i<storageUpdateKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("storageUpdateKeys[" + i + "] (String): "));
|
|
storageUpdateKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for storageUpdateValues: "));
|
|
int storageUpdateValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
storageUpdateValues = new String[storageUpdateValuesSize];
|
|
for (int i=0; i<storageUpdateValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("storageUpdateValues[" + i + "] (String): "));
|
|
storageUpdateValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mlUpdateStorageCell(sessionContext, stationNumber, storageUpdateKeys, storageUpdateValues, out storageUpdateResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; storageUpdateResultValues != null && i<storageUpdateResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("storageUpdateResultValues[" + i + "]: ") + "<" + storageUpdateResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mlUpdateStorageGroup
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mlUpdateStorageGroup"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String[] storageGroupUpdateKeys
|
|
/// in String[] storageGroupUpdateValues
|
|
/// out String[] storageGroupUpdateResultValues
|
|
/// </para>
|
|
public static void test_mlUpdateStorageGroup()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String[] storageGroupUpdateKeys = null;
|
|
String[] storageGroupUpdateValues = null;
|
|
String[] storageGroupUpdateResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for storageGroupUpdateKeys: "));
|
|
int storageGroupUpdateKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
storageGroupUpdateKeys = new String[storageGroupUpdateKeysSize];
|
|
for (int i=0; i<storageGroupUpdateKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("storageGroupUpdateKeys[" + i + "] (String): "));
|
|
storageGroupUpdateKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for storageGroupUpdateValues: "));
|
|
int storageGroupUpdateValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
storageGroupUpdateValues = new String[storageGroupUpdateValuesSize];
|
|
for (int i=0; i<storageGroupUpdateValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("storageGroupUpdateValues[" + i + "] (String): "));
|
|
storageGroupUpdateValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mlUpdateStorageGroup(sessionContext, stationNumber, storageGroupUpdateKeys, storageGroupUpdateValues, out storageGroupUpdateResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; storageGroupUpdateResultValues != null && i<storageGroupUpdateResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("storageGroupUpdateResultValues[" + i + "]: ") + "<" + storageGroupUpdateResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mlUpdateStorage
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mlUpdateStorage"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String[] storageUpdateKeys
|
|
/// in String[] storageUpdateValues
|
|
/// in String[] storagePartAssignmentUpdateKeys
|
|
/// in String[] storagePartAssignmentUpdateValues
|
|
/// out String[] storageUpdateResultValues
|
|
/// out String[] storagePartAssignmentUpdateResultValues
|
|
/// </para>
|
|
public static void test_mlUpdateStorage()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String[] storageUpdateKeys = null;
|
|
String[] storageUpdateValues = null;
|
|
String[] storagePartAssignmentUpdateKeys = null;
|
|
String[] storagePartAssignmentUpdateValues = null;
|
|
String[] storageUpdateResultValues = null;
|
|
String[] storagePartAssignmentUpdateResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for storageUpdateKeys: "));
|
|
int storageUpdateKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
storageUpdateKeys = new String[storageUpdateKeysSize];
|
|
for (int i=0; i<storageUpdateKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("storageUpdateKeys[" + i + "] (String): "));
|
|
storageUpdateKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for storageUpdateValues: "));
|
|
int storageUpdateValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
storageUpdateValues = new String[storageUpdateValuesSize];
|
|
for (int i=0; i<storageUpdateValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("storageUpdateValues[" + i + "] (String): "));
|
|
storageUpdateValues[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for storagePartAssignmentUpdateKeys: "));
|
|
int storagePartAssignmentUpdateKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
storagePartAssignmentUpdateKeys = new String[storagePartAssignmentUpdateKeysSize];
|
|
for (int i=0; i<storagePartAssignmentUpdateKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("storagePartAssignmentUpdateKeys[" + i + "] (String): "));
|
|
storagePartAssignmentUpdateKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for storagePartAssignmentUpdateValues: "));
|
|
int storagePartAssignmentUpdateValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
storagePartAssignmentUpdateValues = new String[storagePartAssignmentUpdateValuesSize];
|
|
for (int i=0; i<storagePartAssignmentUpdateValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("storagePartAssignmentUpdateValues[" + i + "] (String): "));
|
|
storagePartAssignmentUpdateValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mlUpdateStorage(sessionContext, stationNumber, storageUpdateKeys, storageUpdateValues, storagePartAssignmentUpdateKeys, storagePartAssignmentUpdateValues, out storageUpdateResultValues, out storagePartAssignmentUpdateResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; storageUpdateResultValues != null && i<storageUpdateResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("storageUpdateResultValues[" + i + "]: ") + "<" + storageUpdateResultValues[i] + ">");
|
|
}
|
|
for (int i=0; storagePartAssignmentUpdateResultValues != null && i<storagePartAssignmentUpdateResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("storagePartAssignmentUpdateResultValues[" + i + "]: ") + "<" + storagePartAssignmentUpdateResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mlGetStorageData
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mlGetStorageData"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] storageDataFilter
|
|
/// in String[] storageCellResultKeys
|
|
/// in String[] storageGroupResultKeys
|
|
/// in String[] storageResultKeys
|
|
/// in String[] storagePartAssignmentResultKeys
|
|
/// out String[] storageCellResultValues
|
|
/// out String[] storageGroupResultValues
|
|
/// out String[] storageResultValues
|
|
/// out String[] storagePartAssignmentResultValues
|
|
/// </para>
|
|
public static void test_mlGetStorageData()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] storageDataFilter = null;
|
|
String[] storageCellResultKeys = null;
|
|
String[] storageGroupResultKeys = null;
|
|
String[] storageResultKeys = null;
|
|
String[] storagePartAssignmentResultKeys = null;
|
|
String[] storageCellResultValues = null;
|
|
String[] storageGroupResultValues = null;
|
|
String[] storageResultValues = null;
|
|
String[] storagePartAssignmentResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for storageDataFilter: "));
|
|
int storageDataFilterSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
storageDataFilter = new KeyValue[storageDataFilterSize];
|
|
for (int i=0; i<storageDataFilterSize; i++)
|
|
{
|
|
storageDataFilter[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("storageDataFilter[" + i + "] .key (String): "));
|
|
storageDataFilter[i].key = getInput();
|
|
Console.Write(fillWithSpace("storageDataFilter[" + i + "] .value (String): "));
|
|
storageDataFilter[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for storageCellResultKeys: "));
|
|
int storageCellResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
storageCellResultKeys = new String[storageCellResultKeysSize];
|
|
for (int i=0; i<storageCellResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("storageCellResultKeys[" + i + "] (String): "));
|
|
storageCellResultKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for storageGroupResultKeys: "));
|
|
int storageGroupResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
storageGroupResultKeys = new String[storageGroupResultKeysSize];
|
|
for (int i=0; i<storageGroupResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("storageGroupResultKeys[" + i + "] (String): "));
|
|
storageGroupResultKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for storageResultKeys: "));
|
|
int storageResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
storageResultKeys = new String[storageResultKeysSize];
|
|
for (int i=0; i<storageResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("storageResultKeys[" + i + "] (String): "));
|
|
storageResultKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for storagePartAssignmentResultKeys: "));
|
|
int storagePartAssignmentResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
storagePartAssignmentResultKeys = new String[storagePartAssignmentResultKeysSize];
|
|
for (int i=0; i<storagePartAssignmentResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("storagePartAssignmentResultKeys[" + i + "] (String): "));
|
|
storagePartAssignmentResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mlGetStorageData(sessionContext, stationNumber, storageDataFilter, storageCellResultKeys, storageGroupResultKeys, storageResultKeys, storagePartAssignmentResultKeys, out storageCellResultValues, out storageGroupResultValues, out storageResultValues, out storagePartAssignmentResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; storageCellResultValues != null && i<storageCellResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("storageCellResultValues[" + i + "]: ") + "<" + storageCellResultValues[i] + ">");
|
|
}
|
|
for (int i=0; storageGroupResultValues != null && i<storageGroupResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("storageGroupResultValues[" + i + "]: ") + "<" + storageGroupResultValues[i] + ">");
|
|
}
|
|
for (int i=0; storageResultValues != null && i<storageResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("storageResultValues[" + i + "]: ") + "<" + storageResultValues[i] + ">");
|
|
}
|
|
for (int i=0; storagePartAssignmentResultValues != null && i<storagePartAssignmentResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("storagePartAssignmentResultValues[" + i + "]: ") + "<" + storagePartAssignmentResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mlGetMaterialConsumption
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mlGetMaterialConsumption"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] materialConsumptionFilters
|
|
/// in String[] materialConsumptionResultKeys
|
|
/// out String[] materialConsumptionResultValues
|
|
/// out bool hasMore
|
|
/// </para>
|
|
public static void test_mlGetMaterialConsumption()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] materialConsumptionFilters = null;
|
|
String[] materialConsumptionResultKeys = null;
|
|
String[] materialConsumptionResultValues = null;
|
|
bool hasMore = false;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for materialConsumptionFilters: "));
|
|
int materialConsumptionFiltersSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
materialConsumptionFilters = new KeyValue[materialConsumptionFiltersSize];
|
|
for (int i=0; i<materialConsumptionFiltersSize; i++)
|
|
{
|
|
materialConsumptionFilters[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("materialConsumptionFilters[" + i + "] .key (String): "));
|
|
materialConsumptionFilters[i].key = getInput();
|
|
Console.Write(fillWithSpace("materialConsumptionFilters[" + i + "] .value (String): "));
|
|
materialConsumptionFilters[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for materialConsumptionResultKeys: "));
|
|
int materialConsumptionResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
materialConsumptionResultKeys = new String[materialConsumptionResultKeysSize];
|
|
for (int i=0; i<materialConsumptionResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("materialConsumptionResultKeys[" + i + "] (String): "));
|
|
materialConsumptionResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mlGetMaterialConsumption(sessionContext, stationNumber, materialConsumptionFilters, materialConsumptionResultKeys, out materialConsumptionResultValues, out hasMore);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; materialConsumptionResultValues != null && i<materialConsumptionResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("materialConsumptionResultValues[" + i + "]: ") + "<" + materialConsumptionResultValues[i] + ">");
|
|
}
|
|
Console.WriteLine(fillWithSpace("hasMore: ") + "<" + hasMore + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_regRegisterUser
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "regRegisterUser"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String userName
|
|
/// in String password
|
|
/// in String client
|
|
/// </para>
|
|
public static void test_regRegisterUser()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String userName = "";
|
|
String password = "";
|
|
String client = "";
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("userName (String): "));
|
|
userName = getInput();
|
|
Console.Write(fillWithSpace("password (String): "));
|
|
password = getInputNoEcho();
|
|
Console.Write(fillWithSpace("client (String): "));
|
|
client = getInput();
|
|
|
|
// call imsapi function
|
|
result = imsapi.regRegisterUser(sessionContext, stationNumber, userName, password, client);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_regUnregisterUser
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "regUnregisterUser"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String userName
|
|
/// in String password
|
|
/// in String client
|
|
/// </para>
|
|
public static void test_regUnregisterUser()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String userName = "";
|
|
String password = "";
|
|
String client = "";
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("userName (String): "));
|
|
userName = getInput();
|
|
Console.Write(fillWithSpace("password (String): "));
|
|
password = getInputNoEcho();
|
|
Console.Write(fillWithSpace("client (String): "));
|
|
client = getInput();
|
|
|
|
// call imsapi function
|
|
result = imsapi.regUnregisterUser(sessionContext, stationNumber, userName, password, client);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_regGetRegisteredUser
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "regGetRegisteredUser"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// out String userName
|
|
/// out String name
|
|
/// out String firstname
|
|
/// </para>
|
|
public static void test_regGetRegisteredUser()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String userName = "";
|
|
String name = "";
|
|
String firstname = "";
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
|
|
// call imsapi function
|
|
result = imsapi.regGetRegisteredUser(sessionContext, stationNumber, out userName, out name, out firstname);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
Console.WriteLine(fillWithSpace("userName: ") + "<" + userName + ">");
|
|
Console.WriteLine(fillWithSpace("name: ") + "<" + name + ">");
|
|
Console.WriteLine(fillWithSpace("firstname: ") + "<" + firstname + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_regCheckLicense
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "regCheckLicense"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in int licenseType
|
|
/// in String[] licenseUploadKeys
|
|
/// in String[] licenseUploadValues
|
|
/// out String[] licenseResultValues
|
|
/// </para>
|
|
public static void test_regCheckLicense()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
int licenseType = 0;
|
|
String[] licenseUploadKeys = null;
|
|
String[] licenseUploadValues = null;
|
|
String[] licenseResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("licenseType (int): "));
|
|
licenseType = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("Enter size for licenseUploadKeys: "));
|
|
int licenseUploadKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
licenseUploadKeys = new String[licenseUploadKeysSize];
|
|
for (int i=0; i<licenseUploadKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("licenseUploadKeys[" + i + "] (String): "));
|
|
licenseUploadKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for licenseUploadValues: "));
|
|
int licenseUploadValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
licenseUploadValues = new String[licenseUploadValuesSize];
|
|
for (int i=0; i<licenseUploadValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("licenseUploadValues[" + i + "] (String): "));
|
|
licenseUploadValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.regCheckLicense(sessionContext, stationNumber, licenseType, licenseUploadKeys, licenseUploadValues, out licenseResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; licenseResultValues != null && i<licenseResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("licenseResultValues[" + i + "]: ") + "<" + licenseResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_setupReplaceSetupForSerialNumber
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "setupReplaceSetupForSerialNumber"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in int processLayer
|
|
/// in String serialNumber
|
|
/// in int serialNumberPos
|
|
/// in String materialNumber
|
|
/// in String compName
|
|
/// in String materialBinNumberOld
|
|
/// in String materialBinNumberNew
|
|
/// in long bookDate
|
|
/// </para>
|
|
public static void test_setupReplaceSetupForSerialNumber()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
int processLayer = 0;
|
|
String serialNumber = "";
|
|
int serialNumberPos = 0;
|
|
String materialNumber = "";
|
|
String compName = "";
|
|
String materialBinNumberOld = "";
|
|
String materialBinNumberNew = "";
|
|
long bookDate = 0;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("processLayer (int): "));
|
|
processLayer = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("serialNumber (String): "));
|
|
serialNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumberPos (int): "));
|
|
serialNumberPos = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("materialNumber (String): "));
|
|
materialNumber = getInput();
|
|
Console.Write(fillWithSpace("compName (String): "));
|
|
compName = getInput();
|
|
Console.Write(fillWithSpace("materialBinNumberOld (String): "));
|
|
materialBinNumberOld = getInput();
|
|
Console.Write(fillWithSpace("materialBinNumberNew (String): "));
|
|
materialBinNumberNew = getInput();
|
|
Console.Write(fillWithSpace("bookDate (long): "));
|
|
bookDate = Int64.Parse(getInput());
|
|
|
|
// call imsapi function
|
|
result = imsapi.setupReplaceSetupForSerialNumber(sessionContext, stationNumber, processLayer, serialNumber, serialNumberPos, materialNumber, compName, materialBinNumberOld, materialBinNumberNew, bookDate);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_setupCheck
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "setupCheck"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String serialNumberRef
|
|
/// in String serialNumberRefPos
|
|
/// in String workOrderNumber
|
|
/// in int processLayer
|
|
/// in int checkMode
|
|
/// in int resultMode
|
|
/// out String workorderNumber
|
|
/// out String productNumber
|
|
/// out String placementName
|
|
/// out int setupActive
|
|
/// out CheckSetupData[] checkSetupDataArray
|
|
/// </para>
|
|
public static void test_setupCheck()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String serialNumberRef = "";
|
|
String serialNumberRefPos = "";
|
|
String workOrderNumber = "";
|
|
int processLayer = 0;
|
|
int checkMode = 0;
|
|
int resultMode = 0;
|
|
String workorderNumber = "";
|
|
String productNumber = "";
|
|
String placementName = "";
|
|
int setupActive = 0;
|
|
CheckSetupData[] checkSetupDataArray = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumberRef (String): "));
|
|
serialNumberRef = getInput();
|
|
Console.Write(fillWithSpace("serialNumberRefPos (String): "));
|
|
serialNumberRefPos = getInput();
|
|
Console.Write(fillWithSpace("workOrderNumber (String): "));
|
|
workOrderNumber = getInput();
|
|
Console.Write(fillWithSpace("processLayer (int): "));
|
|
processLayer = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("checkMode (int): "));
|
|
checkMode = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("resultMode (int): "));
|
|
resultMode = Int32.Parse(getInput());
|
|
|
|
// call imsapi function
|
|
result = imsapi.setupCheck(sessionContext, stationNumber, serialNumberRef, serialNumberRefPos, workOrderNumber, processLayer, checkMode, resultMode, out workorderNumber, out productNumber, out placementName, out setupActive, out checkSetupDataArray);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
Console.WriteLine(fillWithSpace("workorderNumber: ") + "<" + workorderNumber + ">");
|
|
Console.WriteLine(fillWithSpace("productNumber: ") + "<" + productNumber + ">");
|
|
Console.WriteLine(fillWithSpace("placementName: ") + "<" + placementName + ">");
|
|
Console.WriteLine(fillWithSpace("setupActive: ") + "<" + setupActive + ">");
|
|
for (int i=0; checkSetupDataArray != null && i<checkSetupDataArray.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("checkSetupDataArray[" + i + "].partNumber: ") + "<" + checkSetupDataArray[i].partNumber + ">");
|
|
Console.WriteLine(fillWithSpace("checkSetupDataArray[" + i + "].parentPartNumber: ") + "<" + checkSetupDataArray[i].parentPartNumber + ">");
|
|
Console.WriteLine(fillWithSpace("checkSetupDataArray[" + i + "].compName: ") + "<" + checkSetupDataArray[i].compName + ">");
|
|
Console.WriteLine(fillWithSpace("checkSetupDataArray[" + i + "].materialBinNumber: ") + "<" + checkSetupDataArray[i].materialBinNumber + ">");
|
|
Console.WriteLine(fillWithSpace("checkSetupDataArray[" + i + "].materialBinQtyActual: ") + "<" + checkSetupDataArray[i].materialBinQtyActual + ">");
|
|
Console.WriteLine(fillWithSpace("checkSetupDataArray[" + i + "].materialBinState: ") + "<" + checkSetupDataArray[i].materialBinState + ">");
|
|
Console.WriteLine(fillWithSpace("checkSetupDataArray[" + i + "].expirationDate: ") + "<" + checkSetupDataArray[i].expirationDate + ">");
|
|
Console.WriteLine(fillWithSpace("checkSetupDataArray[" + i + "].setupPosition: ") + "<" + checkSetupDataArray[i].setupPosition + ">");
|
|
Console.WriteLine(fillWithSpace("checkSetupDataArray[" + i + "].setupStartDate: ") + "<" + checkSetupDataArray[i].setupStartDate + ">");
|
|
Console.WriteLine(fillWithSpace("checkSetupDataArray[" + i + "].setupPositionActive: ") + "<" + checkSetupDataArray[i].setupPositionActive + ">");
|
|
Console.WriteLine(fillWithSpace("checkSetupDataArray[" + i + "].machineGroup: ") + "<" + checkSetupDataArray[i].machineGroup + ">");
|
|
Console.WriteLine(fillWithSpace("checkSetupDataArray[" + i + "].returnCode: ") + "<" + checkSetupDataArray[i].returnCode + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_setupStateChange
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "setupStateChange"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in int processLayer
|
|
/// in String workOrderNumber
|
|
/// in String serialNumber
|
|
/// in int serialNumberPos
|
|
/// in int activateFlag
|
|
/// </para>
|
|
public static void test_setupStateChange()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
int processLayer = 0;
|
|
String workOrderNumber = "";
|
|
String serialNumber = "";
|
|
int serialNumberPos = 0;
|
|
int activateFlag = 0;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("processLayer (int): "));
|
|
processLayer = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("workOrderNumber (String): "));
|
|
workOrderNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumber (String): "));
|
|
serialNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumberPos (int): "));
|
|
serialNumberPos = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("activateFlag (int): "));
|
|
activateFlag = Int32.Parse(getInput());
|
|
|
|
// call imsapi function
|
|
result = imsapi.setupStateChange(sessionContext, stationNumber, processLayer, workOrderNumber, serialNumber, serialNumberPos, activateFlag);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_setupGetStationSetupDataForMaterialBin
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "setupGetStationSetupDataForMaterialBin"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String materialBinNumber
|
|
/// in String[] setupResultKeys
|
|
/// out String[] setupResultValues
|
|
/// </para>
|
|
public static void test_setupGetStationSetupDataForMaterialBin()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String materialBinNumber = "";
|
|
String[] setupResultKeys = null;
|
|
String[] setupResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("materialBinNumber (String): "));
|
|
materialBinNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for setupResultKeys: "));
|
|
int setupResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
setupResultKeys = new String[setupResultKeysSize];
|
|
for (int i=0; i<setupResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("setupResultKeys[" + i + "] (String): "));
|
|
setupResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.setupGetStationSetupDataForMaterialBin(sessionContext, stationNumber, materialBinNumber, setupResultKeys, out setupResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; setupResultValues != null && i<setupResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("setupResultValues[" + i + "]: ") + "<" + setupResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_setupGetSetupDataBySerialNumber
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "setupGetSetupDataBySerialNumber"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String serialNumber
|
|
/// in String partNumber
|
|
/// in String location
|
|
/// in int level
|
|
/// in String[] setupResultKeys
|
|
/// out String[] setupResultValues
|
|
/// </para>
|
|
public static void test_setupGetSetupDataBySerialNumber()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String serialNumber = "";
|
|
String partNumber = "";
|
|
String location = "";
|
|
int level = 0;
|
|
String[] setupResultKeys = null;
|
|
String[] setupResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumber (String): "));
|
|
serialNumber = getInput();
|
|
Console.Write(fillWithSpace("partNumber (String): "));
|
|
partNumber = getInput();
|
|
Console.Write(fillWithSpace("location (String): "));
|
|
location = getInput();
|
|
Console.Write(fillWithSpace("level (int): "));
|
|
level = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("Enter size for setupResultKeys: "));
|
|
int setupResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
setupResultKeys = new String[setupResultKeysSize];
|
|
for (int i=0; i<setupResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("setupResultKeys[" + i + "] (String): "));
|
|
setupResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.setupGetSetupDataBySerialNumber(sessionContext, stationNumber, serialNumber, partNumber, location, level, setupResultKeys, out setupResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; setupResultValues != null && i<setupResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("setupResultValues[" + i + "]: ") + "<" + setupResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_setupGetSetupName
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "setupGetSetupName"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// out String setupName
|
|
/// </para>
|
|
public static void test_setupGetSetupName()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String setupName = "";
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
|
|
// call imsapi function
|
|
result = imsapi.setupGetSetupName(sessionContext, stationNumber, out setupName);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
Console.WriteLine(fillWithSpace("setupName: ") + "<" + setupName + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_setupUpdateMaterialSetup
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "setupUpdateMaterialSetup"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in int processLayer
|
|
/// in String workOrderNumber
|
|
/// in String productNumber
|
|
/// in String setupName
|
|
/// in String[] materialSetupUploadKeys
|
|
/// in String[] materialSetupUploadValues
|
|
/// in String[] compPositionsUploadKeys
|
|
/// in String[] compPositionsUploadValues
|
|
/// out String[] materialSetupResultValues
|
|
/// out String[] compPositionsResultValues
|
|
/// </para>
|
|
public static void test_setupUpdateMaterialSetup()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
int processLayer = 0;
|
|
String workOrderNumber = "";
|
|
String productNumber = "";
|
|
String setupName = "";
|
|
String[] materialSetupUploadKeys = null;
|
|
String[] materialSetupUploadValues = null;
|
|
String[] compPositionsUploadKeys = null;
|
|
String[] compPositionsUploadValues = null;
|
|
String[] materialSetupResultValues = null;
|
|
String[] compPositionsResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("processLayer (int): "));
|
|
processLayer = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("workOrderNumber (String): "));
|
|
workOrderNumber = getInput();
|
|
Console.Write(fillWithSpace("productNumber (String): "));
|
|
productNumber = getInput();
|
|
Console.Write(fillWithSpace("setupName (String): "));
|
|
setupName = getInput();
|
|
Console.Write(fillWithSpace("Enter size for materialSetupUploadKeys: "));
|
|
int materialSetupUploadKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
materialSetupUploadKeys = new String[materialSetupUploadKeysSize];
|
|
for (int i=0; i<materialSetupUploadKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("materialSetupUploadKeys[" + i + "] (String): "));
|
|
materialSetupUploadKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for materialSetupUploadValues: "));
|
|
int materialSetupUploadValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
materialSetupUploadValues = new String[materialSetupUploadValuesSize];
|
|
for (int i=0; i<materialSetupUploadValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("materialSetupUploadValues[" + i + "] (String): "));
|
|
materialSetupUploadValues[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for compPositionsUploadKeys: "));
|
|
int compPositionsUploadKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
compPositionsUploadKeys = new String[compPositionsUploadKeysSize];
|
|
for (int i=0; i<compPositionsUploadKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("compPositionsUploadKeys[" + i + "] (String): "));
|
|
compPositionsUploadKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for compPositionsUploadValues: "));
|
|
int compPositionsUploadValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
compPositionsUploadValues = new String[compPositionsUploadValuesSize];
|
|
for (int i=0; i<compPositionsUploadValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("compPositionsUploadValues[" + i + "] (String): "));
|
|
compPositionsUploadValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.setupUpdateMaterialSetup(sessionContext, stationNumber, processLayer, workOrderNumber, productNumber, setupName, materialSetupUploadKeys, materialSetupUploadValues, compPositionsUploadKeys, compPositionsUploadValues, out materialSetupResultValues, out compPositionsResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; materialSetupResultValues != null && i<materialSetupResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("materialSetupResultValues[" + i + "]: ") + "<" + materialSetupResultValues[i] + ">");
|
|
}
|
|
for (int i=0; compPositionsResultValues != null && i<compPositionsResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("compPositionsResultValues[" + i + "]: ") + "<" + compPositionsResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_setupGetMaterialSetup
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "setupGetMaterialSetup"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in int processLayer
|
|
/// in int setupFlag
|
|
/// in long setupStartDate
|
|
/// in long setupEndDate
|
|
/// in String[] setupResultKeys
|
|
/// out String[] setupResultValues
|
|
/// in String[] componentResultKeys
|
|
/// out String[] componentResultValues
|
|
/// </para>
|
|
public static void test_setupGetMaterialSetup()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
int processLayer = 0;
|
|
int setupFlag = 0;
|
|
long setupStartDate = 0;
|
|
long setupEndDate = 0;
|
|
String[] setupResultKeys = null;
|
|
String[] setupResultValues = null;
|
|
String[] componentResultKeys = null;
|
|
String[] componentResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("processLayer (int): "));
|
|
processLayer = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("setupFlag (int): "));
|
|
setupFlag = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("setupStartDate (long): "));
|
|
setupStartDate = Int64.Parse(getInput());
|
|
Console.Write(fillWithSpace("setupEndDate (long): "));
|
|
setupEndDate = Int64.Parse(getInput());
|
|
Console.Write(fillWithSpace("Enter size for setupResultKeys: "));
|
|
int setupResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
setupResultKeys = new String[setupResultKeysSize];
|
|
for (int i=0; i<setupResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("setupResultKeys[" + i + "] (String): "));
|
|
setupResultKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for componentResultKeys: "));
|
|
int componentResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
componentResultKeys = new String[componentResultKeysSize];
|
|
for (int i=0; i<componentResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("componentResultKeys[" + i + "] (String): "));
|
|
componentResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.setupGetMaterialSetup(sessionContext, stationNumber, processLayer, setupFlag, setupStartDate, setupEndDate, setupResultKeys, out setupResultValues, componentResultKeys, out componentResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; setupResultValues != null && i<setupResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("setupResultValues[" + i + "]: ") + "<" + setupResultValues[i] + ">");
|
|
}
|
|
for (int i=0; componentResultValues != null && i<componentResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("componentResultValues[" + i + "]: ") + "<" + componentResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_setupChangeSetupForSerialNumber
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "setupChangeSetupForSerialNumber"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String[] setupChangeSerialKeys
|
|
/// in String[] setupChangeSerialValues
|
|
/// in String[] setupChangePartKeys
|
|
/// in String[] setupChangePartValues
|
|
/// in String[] setupChangeResultKeys
|
|
/// out String[] setupChangeResultValues
|
|
/// </para>
|
|
public static void test_setupChangeSetupForSerialNumber()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String[] setupChangeSerialKeys = null;
|
|
String[] setupChangeSerialValues = null;
|
|
String[] setupChangePartKeys = null;
|
|
String[] setupChangePartValues = null;
|
|
String[] setupChangeResultKeys = null;
|
|
String[] setupChangeResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for setupChangeSerialKeys: "));
|
|
int setupChangeSerialKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
setupChangeSerialKeys = new String[setupChangeSerialKeysSize];
|
|
for (int i=0; i<setupChangeSerialKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("setupChangeSerialKeys[" + i + "] (String): "));
|
|
setupChangeSerialKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for setupChangeSerialValues: "));
|
|
int setupChangeSerialValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
setupChangeSerialValues = new String[setupChangeSerialValuesSize];
|
|
for (int i=0; i<setupChangeSerialValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("setupChangeSerialValues[" + i + "] (String): "));
|
|
setupChangeSerialValues[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for setupChangePartKeys: "));
|
|
int setupChangePartKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
setupChangePartKeys = new String[setupChangePartKeysSize];
|
|
for (int i=0; i<setupChangePartKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("setupChangePartKeys[" + i + "] (String): "));
|
|
setupChangePartKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for setupChangePartValues: "));
|
|
int setupChangePartValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
setupChangePartValues = new String[setupChangePartValuesSize];
|
|
for (int i=0; i<setupChangePartValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("setupChangePartValues[" + i + "] (String): "));
|
|
setupChangePartValues[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for setupChangeResultKeys: "));
|
|
int setupChangeResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
setupChangeResultKeys = new String[setupChangeResultKeysSize];
|
|
for (int i=0; i<setupChangeResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("setupChangeResultKeys[" + i + "] (String): "));
|
|
setupChangeResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.setupChangeSetupForSerialNumber(sessionContext, stationNumber, setupChangeSerialKeys, setupChangeSerialValues, setupChangePartKeys, setupChangePartValues, setupChangeResultKeys, out setupChangeResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; setupChangeResultValues != null && i<setupChangeResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("setupChangeResultValues[" + i + "]: ") + "<" + setupChangeResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_setupCreatePreSetup
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "setupCreatePreSetup"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] presetupHeadUploadData
|
|
/// in String[] presetupConsumerUploadKeys
|
|
/// in String[] presetupConsumerUploadValues
|
|
/// in String[] presetupSectionUploadKeys
|
|
/// in String[] presetupSectionUploadValues
|
|
/// in String[] presetupHeadResultKeys
|
|
/// in String[] presetupConsumerResultKeys
|
|
/// in String[] presetupSectionResultKeys
|
|
/// out String[] presetupHeadResultValues
|
|
/// out String[] presetupConsumerResultValues
|
|
/// out String[] presetupSectionResultValues
|
|
/// </para>
|
|
public static void test_setupCreatePreSetup()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] presetupHeadUploadData = null;
|
|
String[] presetupConsumerUploadKeys = null;
|
|
String[] presetupConsumerUploadValues = null;
|
|
String[] presetupSectionUploadKeys = null;
|
|
String[] presetupSectionUploadValues = null;
|
|
String[] presetupHeadResultKeys = null;
|
|
String[] presetupConsumerResultKeys = null;
|
|
String[] presetupSectionResultKeys = null;
|
|
String[] presetupHeadResultValues = null;
|
|
String[] presetupConsumerResultValues = null;
|
|
String[] presetupSectionResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for presetupHeadUploadData: "));
|
|
int presetupHeadUploadDataSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
presetupHeadUploadData = new KeyValue[presetupHeadUploadDataSize];
|
|
for (int i=0; i<presetupHeadUploadDataSize; i++)
|
|
{
|
|
presetupHeadUploadData[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("presetupHeadUploadData[" + i + "] .key (String): "));
|
|
presetupHeadUploadData[i].key = getInput();
|
|
Console.Write(fillWithSpace("presetupHeadUploadData[" + i + "] .value (String): "));
|
|
presetupHeadUploadData[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for presetupConsumerUploadKeys: "));
|
|
int presetupConsumerUploadKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
presetupConsumerUploadKeys = new String[presetupConsumerUploadKeysSize];
|
|
for (int i=0; i<presetupConsumerUploadKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("presetupConsumerUploadKeys[" + i + "] (String): "));
|
|
presetupConsumerUploadKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for presetupConsumerUploadValues: "));
|
|
int presetupConsumerUploadValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
presetupConsumerUploadValues = new String[presetupConsumerUploadValuesSize];
|
|
for (int i=0; i<presetupConsumerUploadValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("presetupConsumerUploadValues[" + i + "] (String): "));
|
|
presetupConsumerUploadValues[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for presetupSectionUploadKeys: "));
|
|
int presetupSectionUploadKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
presetupSectionUploadKeys = new String[presetupSectionUploadKeysSize];
|
|
for (int i=0; i<presetupSectionUploadKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("presetupSectionUploadKeys[" + i + "] (String): "));
|
|
presetupSectionUploadKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for presetupSectionUploadValues: "));
|
|
int presetupSectionUploadValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
presetupSectionUploadValues = new String[presetupSectionUploadValuesSize];
|
|
for (int i=0; i<presetupSectionUploadValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("presetupSectionUploadValues[" + i + "] (String): "));
|
|
presetupSectionUploadValues[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for presetupHeadResultKeys: "));
|
|
int presetupHeadResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
presetupHeadResultKeys = new String[presetupHeadResultKeysSize];
|
|
for (int i=0; i<presetupHeadResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("presetupHeadResultKeys[" + i + "] (String): "));
|
|
presetupHeadResultKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for presetupConsumerResultKeys: "));
|
|
int presetupConsumerResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
presetupConsumerResultKeys = new String[presetupConsumerResultKeysSize];
|
|
for (int i=0; i<presetupConsumerResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("presetupConsumerResultKeys[" + i + "] (String): "));
|
|
presetupConsumerResultKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for presetupSectionResultKeys: "));
|
|
int presetupSectionResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
presetupSectionResultKeys = new String[presetupSectionResultKeysSize];
|
|
for (int i=0; i<presetupSectionResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("presetupSectionResultKeys[" + i + "] (String): "));
|
|
presetupSectionResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.setupCreatePreSetup(sessionContext, stationNumber, presetupHeadUploadData, presetupConsumerUploadKeys, presetupConsumerUploadValues, presetupSectionUploadKeys, presetupSectionUploadValues, presetupHeadResultKeys, presetupConsumerResultKeys, presetupSectionResultKeys, out presetupHeadResultValues, out presetupConsumerResultValues, out presetupSectionResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; presetupHeadResultValues != null && i<presetupHeadResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("presetupHeadResultValues[" + i + "]: ") + "<" + presetupHeadResultValues[i] + ">");
|
|
}
|
|
for (int i=0; presetupConsumerResultValues != null && i<presetupConsumerResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("presetupConsumerResultValues[" + i + "]: ") + "<" + presetupConsumerResultValues[i] + ">");
|
|
}
|
|
for (int i=0; presetupSectionResultValues != null && i<presetupSectionResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("presetupSectionResultValues[" + i + "]: ") + "<" + presetupSectionResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_setupUpdatePreSetup
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "setupUpdatePreSetup"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] presetupHeadFilter
|
|
/// in KeyValue[] presetupHeadUploadKeys
|
|
/// in String[] presetupConsumerUploadKeys
|
|
/// in String[] presetupConsumerUploadValues
|
|
/// in String[] presetupSectionUploadKeys
|
|
/// in String[] presetupSectionUploadValues
|
|
/// out String[] presetupConsumerResultValues
|
|
/// out String[] presetupSectionResultValues
|
|
/// </para>
|
|
public static void test_setupUpdatePreSetup()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] presetupHeadFilter = null;
|
|
KeyValue[] presetupHeadUploadKeys = null;
|
|
String[] presetupConsumerUploadKeys = null;
|
|
String[] presetupConsumerUploadValues = null;
|
|
String[] presetupSectionUploadKeys = null;
|
|
String[] presetupSectionUploadValues = null;
|
|
String[] presetupConsumerResultValues = null;
|
|
String[] presetupSectionResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for presetupHeadFilter: "));
|
|
int presetupHeadFilterSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
presetupHeadFilter = new KeyValue[presetupHeadFilterSize];
|
|
for (int i=0; i<presetupHeadFilterSize; i++)
|
|
{
|
|
presetupHeadFilter[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("presetupHeadFilter[" + i + "] .key (String): "));
|
|
presetupHeadFilter[i].key = getInput();
|
|
Console.Write(fillWithSpace("presetupHeadFilter[" + i + "] .value (String): "));
|
|
presetupHeadFilter[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for presetupHeadUploadKeys: "));
|
|
int presetupHeadUploadKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
presetupHeadUploadKeys = new KeyValue[presetupHeadUploadKeysSize];
|
|
for (int i=0; i<presetupHeadUploadKeysSize; i++)
|
|
{
|
|
presetupHeadUploadKeys[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("presetupHeadUploadKeys[" + i + "] .key (String): "));
|
|
presetupHeadUploadKeys[i].key = getInput();
|
|
Console.Write(fillWithSpace("presetupHeadUploadKeys[" + i + "] .value (String): "));
|
|
presetupHeadUploadKeys[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for presetupConsumerUploadKeys: "));
|
|
int presetupConsumerUploadKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
presetupConsumerUploadKeys = new String[presetupConsumerUploadKeysSize];
|
|
for (int i=0; i<presetupConsumerUploadKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("presetupConsumerUploadKeys[" + i + "] (String): "));
|
|
presetupConsumerUploadKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for presetupConsumerUploadValues: "));
|
|
int presetupConsumerUploadValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
presetupConsumerUploadValues = new String[presetupConsumerUploadValuesSize];
|
|
for (int i=0; i<presetupConsumerUploadValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("presetupConsumerUploadValues[" + i + "] (String): "));
|
|
presetupConsumerUploadValues[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for presetupSectionUploadKeys: "));
|
|
int presetupSectionUploadKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
presetupSectionUploadKeys = new String[presetupSectionUploadKeysSize];
|
|
for (int i=0; i<presetupSectionUploadKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("presetupSectionUploadKeys[" + i + "] (String): "));
|
|
presetupSectionUploadKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for presetupSectionUploadValues: "));
|
|
int presetupSectionUploadValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
presetupSectionUploadValues = new String[presetupSectionUploadValuesSize];
|
|
for (int i=0; i<presetupSectionUploadValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("presetupSectionUploadValues[" + i + "] (String): "));
|
|
presetupSectionUploadValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.setupUpdatePreSetup(sessionContext, stationNumber, presetupHeadFilter, presetupHeadUploadKeys, presetupConsumerUploadKeys, presetupConsumerUploadValues, presetupSectionUploadKeys, presetupSectionUploadValues, out presetupConsumerResultValues, out presetupSectionResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; presetupConsumerResultValues != null && i<presetupConsumerResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("presetupConsumerResultValues[" + i + "]: ") + "<" + presetupConsumerResultValues[i] + ">");
|
|
}
|
|
for (int i=0; presetupSectionResultValues != null && i<presetupSectionResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("presetupSectionResultValues[" + i + "]: ") + "<" + presetupSectionResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_setupGetPreSetupDetails
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "setupGetPreSetupDetails"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] presetupHeadFilter
|
|
/// in String[] presetupHeadResultKeys
|
|
/// in String[] presetupConsumerResultKeys
|
|
/// in String[] presetupSectionResultKeys
|
|
/// in String[] presetupPositionResultKeys
|
|
/// in String[] presetupPositionComponentResultKeys
|
|
/// out String[] presetupHeadResultValues
|
|
/// out String[] presetupConsumerResultValues
|
|
/// out String[] presetupSectionResultValues
|
|
/// out String[] presetupPositionResultValues
|
|
/// out String[] presetupPositionComponentResultValues
|
|
/// </para>
|
|
public static void test_setupGetPreSetupDetails()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] presetupHeadFilter = null;
|
|
String[] presetupHeadResultKeys = null;
|
|
String[] presetupConsumerResultKeys = null;
|
|
String[] presetupSectionResultKeys = null;
|
|
String[] presetupPositionResultKeys = null;
|
|
String[] presetupPositionComponentResultKeys = null;
|
|
String[] presetupHeadResultValues = null;
|
|
String[] presetupConsumerResultValues = null;
|
|
String[] presetupSectionResultValues = null;
|
|
String[] presetupPositionResultValues = null;
|
|
String[] presetupPositionComponentResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for presetupHeadFilter: "));
|
|
int presetupHeadFilterSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
presetupHeadFilter = new KeyValue[presetupHeadFilterSize];
|
|
for (int i=0; i<presetupHeadFilterSize; i++)
|
|
{
|
|
presetupHeadFilter[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("presetupHeadFilter[" + i + "] .key (String): "));
|
|
presetupHeadFilter[i].key = getInput();
|
|
Console.Write(fillWithSpace("presetupHeadFilter[" + i + "] .value (String): "));
|
|
presetupHeadFilter[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for presetupHeadResultKeys: "));
|
|
int presetupHeadResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
presetupHeadResultKeys = new String[presetupHeadResultKeysSize];
|
|
for (int i=0; i<presetupHeadResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("presetupHeadResultKeys[" + i + "] (String): "));
|
|
presetupHeadResultKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for presetupConsumerResultKeys: "));
|
|
int presetupConsumerResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
presetupConsumerResultKeys = new String[presetupConsumerResultKeysSize];
|
|
for (int i=0; i<presetupConsumerResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("presetupConsumerResultKeys[" + i + "] (String): "));
|
|
presetupConsumerResultKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for presetupSectionResultKeys: "));
|
|
int presetupSectionResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
presetupSectionResultKeys = new String[presetupSectionResultKeysSize];
|
|
for (int i=0; i<presetupSectionResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("presetupSectionResultKeys[" + i + "] (String): "));
|
|
presetupSectionResultKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for presetupPositionResultKeys: "));
|
|
int presetupPositionResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
presetupPositionResultKeys = new String[presetupPositionResultKeysSize];
|
|
for (int i=0; i<presetupPositionResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("presetupPositionResultKeys[" + i + "] (String): "));
|
|
presetupPositionResultKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for presetupPositionComponentResultKeys: "));
|
|
int presetupPositionComponentResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
presetupPositionComponentResultKeys = new String[presetupPositionComponentResultKeysSize];
|
|
for (int i=0; i<presetupPositionComponentResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("presetupPositionComponentResultKeys[" + i + "] (String): "));
|
|
presetupPositionComponentResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.setupGetPreSetupDetails(sessionContext, stationNumber, presetupHeadFilter, presetupHeadResultKeys, presetupConsumerResultKeys, presetupSectionResultKeys, presetupPositionResultKeys, presetupPositionComponentResultKeys, out presetupHeadResultValues, out presetupConsumerResultValues, out presetupSectionResultValues, out presetupPositionResultValues, out presetupPositionComponentResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; presetupHeadResultValues != null && i<presetupHeadResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("presetupHeadResultValues[" + i + "]: ") + "<" + presetupHeadResultValues[i] + ">");
|
|
}
|
|
for (int i=0; presetupConsumerResultValues != null && i<presetupConsumerResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("presetupConsumerResultValues[" + i + "]: ") + "<" + presetupConsumerResultValues[i] + ">");
|
|
}
|
|
for (int i=0; presetupSectionResultValues != null && i<presetupSectionResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("presetupSectionResultValues[" + i + "]: ") + "<" + presetupSectionResultValues[i] + ">");
|
|
}
|
|
for (int i=0; presetupPositionResultValues != null && i<presetupPositionResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("presetupPositionResultValues[" + i + "]: ") + "<" + presetupPositionResultValues[i] + ">");
|
|
}
|
|
for (int i=0; presetupPositionComponentResultValues != null && i<presetupPositionComponentResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("presetupPositionComponentResultValues[" + i + "]: ") + "<" + presetupPositionComponentResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_setupSearchPreSetup
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "setupSearchPreSetup"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] presetupHeadFilter
|
|
/// in String[] presetupHeadResultKeys
|
|
/// in String[] presetupConsumerResultKeys
|
|
/// in String[] presetupSectionResultKeys
|
|
/// out String[] presetupHeadResultValues
|
|
/// out String[] presetupConsumerResultValues
|
|
/// out String[] presetupSectionResultValues
|
|
/// </para>
|
|
public static void test_setupSearchPreSetup()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] presetupHeadFilter = null;
|
|
String[] presetupHeadResultKeys = null;
|
|
String[] presetupConsumerResultKeys = null;
|
|
String[] presetupSectionResultKeys = null;
|
|
String[] presetupHeadResultValues = null;
|
|
String[] presetupConsumerResultValues = null;
|
|
String[] presetupSectionResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for presetupHeadFilter: "));
|
|
int presetupHeadFilterSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
presetupHeadFilter = new KeyValue[presetupHeadFilterSize];
|
|
for (int i=0; i<presetupHeadFilterSize; i++)
|
|
{
|
|
presetupHeadFilter[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("presetupHeadFilter[" + i + "] .key (String): "));
|
|
presetupHeadFilter[i].key = getInput();
|
|
Console.Write(fillWithSpace("presetupHeadFilter[" + i + "] .value (String): "));
|
|
presetupHeadFilter[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for presetupHeadResultKeys: "));
|
|
int presetupHeadResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
presetupHeadResultKeys = new String[presetupHeadResultKeysSize];
|
|
for (int i=0; i<presetupHeadResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("presetupHeadResultKeys[" + i + "] (String): "));
|
|
presetupHeadResultKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for presetupConsumerResultKeys: "));
|
|
int presetupConsumerResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
presetupConsumerResultKeys = new String[presetupConsumerResultKeysSize];
|
|
for (int i=0; i<presetupConsumerResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("presetupConsumerResultKeys[" + i + "] (String): "));
|
|
presetupConsumerResultKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for presetupSectionResultKeys: "));
|
|
int presetupSectionResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
presetupSectionResultKeys = new String[presetupSectionResultKeysSize];
|
|
for (int i=0; i<presetupSectionResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("presetupSectionResultKeys[" + i + "] (String): "));
|
|
presetupSectionResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.setupSearchPreSetup(sessionContext, stationNumber, presetupHeadFilter, presetupHeadResultKeys, presetupConsumerResultKeys, presetupSectionResultKeys, out presetupHeadResultValues, out presetupConsumerResultValues, out presetupSectionResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; presetupHeadResultValues != null && i<presetupHeadResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("presetupHeadResultValues[" + i + "]: ") + "<" + presetupHeadResultValues[i] + ">");
|
|
}
|
|
for (int i=0; presetupConsumerResultValues != null && i<presetupConsumerResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("presetupConsumerResultValues[" + i + "]: ") + "<" + presetupConsumerResultValues[i] + ">");
|
|
}
|
|
for (int i=0; presetupSectionResultValues != null && i<presetupSectionResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("presetupSectionResultValues[" + i + "]: ") + "<" + presetupSectionResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_setupUpdatePreSetupPosition
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "setupUpdatePreSetupPosition"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] presetupHeadFilter
|
|
/// in String[] presetupPositionUploadKeys
|
|
/// in String[] presetupPositionUploadValues
|
|
/// in String[] presetupPositionComponentUploadKeys
|
|
/// in String[] presetupPositionComponentUploadValues
|
|
/// out String[] presetupPositionResultValues
|
|
/// out String[] presetupPositionComponentResultValues
|
|
/// </para>
|
|
public static void test_setupUpdatePreSetupPosition()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] presetupHeadFilter = null;
|
|
String[] presetupPositionUploadKeys = null;
|
|
String[] presetupPositionUploadValues = null;
|
|
String[] presetupPositionComponentUploadKeys = null;
|
|
String[] presetupPositionComponentUploadValues = null;
|
|
String[] presetupPositionResultValues = null;
|
|
String[] presetupPositionComponentResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for presetupHeadFilter: "));
|
|
int presetupHeadFilterSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
presetupHeadFilter = new KeyValue[presetupHeadFilterSize];
|
|
for (int i=0; i<presetupHeadFilterSize; i++)
|
|
{
|
|
presetupHeadFilter[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("presetupHeadFilter[" + i + "] .key (String): "));
|
|
presetupHeadFilter[i].key = getInput();
|
|
Console.Write(fillWithSpace("presetupHeadFilter[" + i + "] .value (String): "));
|
|
presetupHeadFilter[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for presetupPositionUploadKeys: "));
|
|
int presetupPositionUploadKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
presetupPositionUploadKeys = new String[presetupPositionUploadKeysSize];
|
|
for (int i=0; i<presetupPositionUploadKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("presetupPositionUploadKeys[" + i + "] (String): "));
|
|
presetupPositionUploadKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for presetupPositionUploadValues: "));
|
|
int presetupPositionUploadValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
presetupPositionUploadValues = new String[presetupPositionUploadValuesSize];
|
|
for (int i=0; i<presetupPositionUploadValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("presetupPositionUploadValues[" + i + "] (String): "));
|
|
presetupPositionUploadValues[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for presetupPositionComponentUploadKeys: "));
|
|
int presetupPositionComponentUploadKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
presetupPositionComponentUploadKeys = new String[presetupPositionComponentUploadKeysSize];
|
|
for (int i=0; i<presetupPositionComponentUploadKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("presetupPositionComponentUploadKeys[" + i + "] (String): "));
|
|
presetupPositionComponentUploadKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for presetupPositionComponentUploadValues: "));
|
|
int presetupPositionComponentUploadValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
presetupPositionComponentUploadValues = new String[presetupPositionComponentUploadValuesSize];
|
|
for (int i=0; i<presetupPositionComponentUploadValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("presetupPositionComponentUploadValues[" + i + "] (String): "));
|
|
presetupPositionComponentUploadValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.setupUpdatePreSetupPosition(sessionContext, stationNumber, presetupHeadFilter, presetupPositionUploadKeys, presetupPositionUploadValues, presetupPositionComponentUploadKeys, presetupPositionComponentUploadValues, out presetupPositionResultValues, out presetupPositionComponentResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; presetupPositionResultValues != null && i<presetupPositionResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("presetupPositionResultValues[" + i + "]: ") + "<" + presetupPositionResultValues[i] + ">");
|
|
}
|
|
for (int i=0; presetupPositionComponentResultValues != null && i<presetupPositionComponentResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("presetupPositionComponentResultValues[" + i + "]: ") + "<" + presetupPositionComponentResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_setupAttachPreSetup
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "setupAttachPreSetup"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] presetupHeadFilter
|
|
/// in String[] presetupAttachPositionUploadKeys
|
|
/// in String[] presetupAttachPositionUploadValues
|
|
/// in String[] presetupAttachPositionResultKeys
|
|
/// out String[] presetupAttachPositionResultValues
|
|
/// </para>
|
|
public static void test_setupAttachPreSetup()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] presetupHeadFilter = null;
|
|
String[] presetupAttachPositionUploadKeys = null;
|
|
String[] presetupAttachPositionUploadValues = null;
|
|
String[] presetupAttachPositionResultKeys = null;
|
|
String[] presetupAttachPositionResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for presetupHeadFilter: "));
|
|
int presetupHeadFilterSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
presetupHeadFilter = new KeyValue[presetupHeadFilterSize];
|
|
for (int i=0; i<presetupHeadFilterSize; i++)
|
|
{
|
|
presetupHeadFilter[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("presetupHeadFilter[" + i + "] .key (String): "));
|
|
presetupHeadFilter[i].key = getInput();
|
|
Console.Write(fillWithSpace("presetupHeadFilter[" + i + "] .value (String): "));
|
|
presetupHeadFilter[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for presetupAttachPositionUploadKeys: "));
|
|
int presetupAttachPositionUploadKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
presetupAttachPositionUploadKeys = new String[presetupAttachPositionUploadKeysSize];
|
|
for (int i=0; i<presetupAttachPositionUploadKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("presetupAttachPositionUploadKeys[" + i + "] (String): "));
|
|
presetupAttachPositionUploadKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for presetupAttachPositionUploadValues: "));
|
|
int presetupAttachPositionUploadValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
presetupAttachPositionUploadValues = new String[presetupAttachPositionUploadValuesSize];
|
|
for (int i=0; i<presetupAttachPositionUploadValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("presetupAttachPositionUploadValues[" + i + "] (String): "));
|
|
presetupAttachPositionUploadValues[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for presetupAttachPositionResultKeys: "));
|
|
int presetupAttachPositionResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
presetupAttachPositionResultKeys = new String[presetupAttachPositionResultKeysSize];
|
|
for (int i=0; i<presetupAttachPositionResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("presetupAttachPositionResultKeys[" + i + "] (String): "));
|
|
presetupAttachPositionResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.setupAttachPreSetup(sessionContext, stationNumber, presetupHeadFilter, presetupAttachPositionUploadKeys, presetupAttachPositionUploadValues, presetupAttachPositionResultKeys, out presetupAttachPositionResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; presetupAttachPositionResultValues != null && i<presetupAttachPositionResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("presetupAttachPositionResultValues[" + i + "]: ") + "<" + presetupAttachPositionResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_setupGetRequiredMaterialForPreSetup
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "setupGetRequiredMaterialForPreSetup"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] presetupHeadFilter
|
|
/// in String[] presetupMaterialResultKeys
|
|
/// in String[] presetupMaterialAlternativeResultKeys
|
|
/// out String[] presetupMaterialResultValues
|
|
/// out String[] presetupMaterialAlternativeResultValues
|
|
/// </para>
|
|
public static void test_setupGetRequiredMaterialForPreSetup()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] presetupHeadFilter = null;
|
|
String[] presetupMaterialResultKeys = null;
|
|
String[] presetupMaterialAlternativeResultKeys = null;
|
|
String[] presetupMaterialResultValues = null;
|
|
String[] presetupMaterialAlternativeResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for presetupHeadFilter: "));
|
|
int presetupHeadFilterSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
presetupHeadFilter = new KeyValue[presetupHeadFilterSize];
|
|
for (int i=0; i<presetupHeadFilterSize; i++)
|
|
{
|
|
presetupHeadFilter[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("presetupHeadFilter[" + i + "] .key (String): "));
|
|
presetupHeadFilter[i].key = getInput();
|
|
Console.Write(fillWithSpace("presetupHeadFilter[" + i + "] .value (String): "));
|
|
presetupHeadFilter[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for presetupMaterialResultKeys: "));
|
|
int presetupMaterialResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
presetupMaterialResultKeys = new String[presetupMaterialResultKeysSize];
|
|
for (int i=0; i<presetupMaterialResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("presetupMaterialResultKeys[" + i + "] (String): "));
|
|
presetupMaterialResultKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for presetupMaterialAlternativeResultKeys: "));
|
|
int presetupMaterialAlternativeResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
presetupMaterialAlternativeResultKeys = new String[presetupMaterialAlternativeResultKeysSize];
|
|
for (int i=0; i<presetupMaterialAlternativeResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("presetupMaterialAlternativeResultKeys[" + i + "] (String): "));
|
|
presetupMaterialAlternativeResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.setupGetRequiredMaterialForPreSetup(sessionContext, stationNumber, presetupHeadFilter, presetupMaterialResultKeys, presetupMaterialAlternativeResultKeys, out presetupMaterialResultValues, out presetupMaterialAlternativeResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; presetupMaterialResultValues != null && i<presetupMaterialResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("presetupMaterialResultValues[" + i + "]: ") + "<" + presetupMaterialResultValues[i] + ">");
|
|
}
|
|
for (int i=0; presetupMaterialAlternativeResultValues != null && i<presetupMaterialAlternativeResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("presetupMaterialAlternativeResultValues[" + i + "]: ") + "<" + presetupMaterialAlternativeResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_setupCheckPreSetup
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "setupCheckPreSetup"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] presetupHeadFilter
|
|
/// in String[] presetupHeadResultKeys
|
|
/// in String[] presetupPositionResultKeys
|
|
/// in String[] presetupPositionComponentResultKeys
|
|
/// out String[] presetupHeadResultValues
|
|
/// out String[] presetupPositionResultValues
|
|
/// out String[] presetupPositionComponentResultValues
|
|
/// </para>
|
|
public static void test_setupCheckPreSetup()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] presetupHeadFilter = null;
|
|
String[] presetupHeadResultKeys = null;
|
|
String[] presetupPositionResultKeys = null;
|
|
String[] presetupPositionComponentResultKeys = null;
|
|
String[] presetupHeadResultValues = null;
|
|
String[] presetupPositionResultValues = null;
|
|
String[] presetupPositionComponentResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for presetupHeadFilter: "));
|
|
int presetupHeadFilterSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
presetupHeadFilter = new KeyValue[presetupHeadFilterSize];
|
|
for (int i=0; i<presetupHeadFilterSize; i++)
|
|
{
|
|
presetupHeadFilter[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("presetupHeadFilter[" + i + "] .key (String): "));
|
|
presetupHeadFilter[i].key = getInput();
|
|
Console.Write(fillWithSpace("presetupHeadFilter[" + i + "] .value (String): "));
|
|
presetupHeadFilter[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for presetupHeadResultKeys: "));
|
|
int presetupHeadResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
presetupHeadResultKeys = new String[presetupHeadResultKeysSize];
|
|
for (int i=0; i<presetupHeadResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("presetupHeadResultKeys[" + i + "] (String): "));
|
|
presetupHeadResultKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for presetupPositionResultKeys: "));
|
|
int presetupPositionResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
presetupPositionResultKeys = new String[presetupPositionResultKeysSize];
|
|
for (int i=0; i<presetupPositionResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("presetupPositionResultKeys[" + i + "] (String): "));
|
|
presetupPositionResultKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for presetupPositionComponentResultKeys: "));
|
|
int presetupPositionComponentResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
presetupPositionComponentResultKeys = new String[presetupPositionComponentResultKeysSize];
|
|
for (int i=0; i<presetupPositionComponentResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("presetupPositionComponentResultKeys[" + i + "] (String): "));
|
|
presetupPositionComponentResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.setupCheckPreSetup(sessionContext, stationNumber, presetupHeadFilter, presetupHeadResultKeys, presetupPositionResultKeys, presetupPositionComponentResultKeys, out presetupHeadResultValues, out presetupPositionResultValues, out presetupPositionComponentResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; presetupHeadResultValues != null && i<presetupHeadResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("presetupHeadResultValues[" + i + "]: ") + "<" + presetupHeadResultValues[i] + ">");
|
|
}
|
|
for (int i=0; presetupPositionResultValues != null && i<presetupPositionResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("presetupPositionResultValues[" + i + "]: ") + "<" + presetupPositionResultValues[i] + ">");
|
|
}
|
|
for (int i=0; presetupPositionComponentResultValues != null && i<presetupPositionComponentResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("presetupPositionComponentResultValues[" + i + "]: ") + "<" + presetupPositionComponentResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_setupGetSetupDataBySerialNumberRef
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "setupGetSetupDataBySerialNumberRef"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] serialSetupFilter
|
|
/// in String[] setupResultKeys
|
|
/// out String[] setupResultValues
|
|
/// </para>
|
|
public static void test_setupGetSetupDataBySerialNumberRef()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] serialSetupFilter = null;
|
|
String[] setupResultKeys = null;
|
|
String[] setupResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for serialSetupFilter: "));
|
|
int serialSetupFilterSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
serialSetupFilter = new KeyValue[serialSetupFilterSize];
|
|
for (int i=0; i<serialSetupFilterSize; i++)
|
|
{
|
|
serialSetupFilter[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("serialSetupFilter[" + i + "] .key (String): "));
|
|
serialSetupFilter[i].key = getInput();
|
|
Console.Write(fillWithSpace("serialSetupFilter[" + i + "] .value (String): "));
|
|
serialSetupFilter[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for setupResultKeys: "));
|
|
int setupResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
setupResultKeys = new String[setupResultKeysSize];
|
|
for (int i=0; i<setupResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("setupResultKeys[" + i + "] (String): "));
|
|
setupResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.setupGetSetupDataBySerialNumberRef(sessionContext, stationNumber, serialSetupFilter, setupResultKeys, out setupResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; setupResultValues != null && i<setupResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("setupResultValues[" + i + "]: ") + "<" + setupResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_shipRemoveSerialNumberFromShippingLot
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "shipRemoveSerialNumberFromShippingLot"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String lotNumber
|
|
/// in String serialNumber
|
|
/// in String serialNumberPos
|
|
/// in long bookDate
|
|
/// </para>
|
|
public static void test_shipRemoveSerialNumberFromShippingLot()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String lotNumber = "";
|
|
String serialNumber = "";
|
|
String serialNumberPos = "";
|
|
long bookDate = 0;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("lotNumber (String): "));
|
|
lotNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumber (String): "));
|
|
serialNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumberPos (String): "));
|
|
serialNumberPos = getInput();
|
|
Console.Write(fillWithSpace("bookDate (long): "));
|
|
bookDate = Int64.Parse(getInput());
|
|
|
|
// call imsapi function
|
|
result = imsapi.shipRemoveSerialNumberFromShippingLot(sessionContext, stationNumber, lotNumber, serialNumber, serialNumberPos, bookDate);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_shipCheckSerialNumberFromShippingLot
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "shipCheckSerialNumberFromShippingLot"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String lotNumber
|
|
/// in String serialNumber
|
|
/// in String serialNumberPos
|
|
/// </para>
|
|
public static void test_shipCheckSerialNumberFromShippingLot()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String lotNumber = "";
|
|
String serialNumber = "";
|
|
String serialNumberPos = "";
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("lotNumber (String): "));
|
|
lotNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumber (String): "));
|
|
serialNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumberPos (String): "));
|
|
serialNumberPos = getInput();
|
|
|
|
// call imsapi function
|
|
result = imsapi.shipCheckSerialNumberFromShippingLot(sessionContext, stationNumber, lotNumber, serialNumber, serialNumberPos);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_shipAddSerialNumberToShippingLot
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "shipAddSerialNumberToShippingLot"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String lotNumber
|
|
/// in String serialNumber
|
|
/// in int serialNumberPos
|
|
/// in long bookDate
|
|
/// </para>
|
|
public static void test_shipAddSerialNumberToShippingLot()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String lotNumber = "";
|
|
String serialNumber = "";
|
|
int serialNumberPos = 0;
|
|
long bookDate = 0;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("lotNumber (String): "));
|
|
lotNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumber (String): "));
|
|
serialNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumberPos (int): "));
|
|
serialNumberPos = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("bookDate (long): "));
|
|
bookDate = Int64.Parse(getInput());
|
|
|
|
// call imsapi function
|
|
result = imsapi.shipAddSerialNumberToShippingLot(sessionContext, stationNumber, lotNumber, serialNumber, serialNumberPos, bookDate);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_shipDeactivateShippingLotAtKap
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "shipDeactivateShippingLotAtKap"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String lotNumber
|
|
/// </para>
|
|
public static void test_shipDeactivateShippingLotAtKap()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String lotNumber = "";
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("lotNumber (String): "));
|
|
lotNumber = getInput();
|
|
|
|
// call imsapi function
|
|
result = imsapi.shipDeactivateShippingLotAtKap(sessionContext, stationNumber, lotNumber);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_shipActivateShippingLotAtKap
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "shipActivateShippingLotAtKap"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String lotNumber
|
|
/// </para>
|
|
public static void test_shipActivateShippingLotAtKap()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String lotNumber = "";
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("lotNumber (String): "));
|
|
lotNumber = getInput();
|
|
|
|
// call imsapi function
|
|
result = imsapi.shipActivateShippingLotAtKap(sessionContext, stationNumber, lotNumber);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_shipGetSerialNumberDataForShippingLot
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "shipGetSerialNumberDataForShippingLot"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String lotNumber
|
|
/// in String[] serialNumberResultKeys
|
|
/// out String[] serialNumberResultValues
|
|
/// </para>
|
|
public static void test_shipGetSerialNumberDataForShippingLot()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String lotNumber = "";
|
|
String[] serialNumberResultKeys = null;
|
|
String[] serialNumberResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("lotNumber (String): "));
|
|
lotNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for serialNumberResultKeys: "));
|
|
int serialNumberResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
serialNumberResultKeys = new String[serialNumberResultKeysSize];
|
|
for (int i=0; i<serialNumberResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("serialNumberResultKeys[" + i + "] (String): "));
|
|
serialNumberResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.shipGetSerialNumberDataForShippingLot(sessionContext, stationNumber, lotNumber, serialNumberResultKeys, out serialNumberResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; serialNumberResultValues != null && i<serialNumberResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("serialNumberResultValues[" + i + "]: ") + "<" + serialNumberResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_shipCompleteLot
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "shipCompleteLot"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String lotNumber
|
|
/// in int allowLessQuantity
|
|
/// in long bookDate
|
|
/// </para>
|
|
public static void test_shipCompleteLot()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String lotNumber = "";
|
|
int allowLessQuantity = 0;
|
|
long bookDate = 0;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("lotNumber (String): "));
|
|
lotNumber = getInput();
|
|
Console.Write(fillWithSpace("allowLessQuantity (int): "));
|
|
allowLessQuantity = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("bookDate (long): "));
|
|
bookDate = Int64.Parse(getInput());
|
|
|
|
// call imsapi function
|
|
result = imsapi.shipCompleteLot(sessionContext, stationNumber, lotNumber, allowLessQuantity, bookDate);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_shipSendLot
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "shipSendLot"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String lotNumber
|
|
/// in long bookDate
|
|
/// in KeyValue[] shippingLotSendValues
|
|
/// </para>
|
|
public static void test_shipSendLot()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String lotNumber = "";
|
|
long bookDate = 0;
|
|
KeyValue[] shippingLotSendValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("lotNumber (String): "));
|
|
lotNumber = getInput();
|
|
Console.Write(fillWithSpace("bookDate (long): "));
|
|
bookDate = Int64.Parse(getInput());
|
|
Console.Write(fillWithSpace("Enter size for shippingLotSendValues: "));
|
|
int shippingLotSendValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
shippingLotSendValues = new KeyValue[shippingLotSendValuesSize];
|
|
for (int i=0; i<shippingLotSendValuesSize; i++)
|
|
{
|
|
shippingLotSendValues[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("shippingLotSendValues[" + i + "] .key (String): "));
|
|
shippingLotSendValues[i].key = getInput();
|
|
Console.Write(fillWithSpace("shippingLotSendValues[" + i + "] .value (String): "));
|
|
shippingLotSendValues[i].value = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.shipSendLot(sessionContext, stationNumber, lotNumber, bookDate, shippingLotSendValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_shipReuseCompletedShippingLot
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "shipReuseCompletedShippingLot"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in int functionMode
|
|
/// in String lotNumber
|
|
/// in String[] shippingLotResultKeys
|
|
/// out String[] shippingLotResultValues
|
|
/// </para>
|
|
public static void test_shipReuseCompletedShippingLot()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
int functionMode = 0;
|
|
String lotNumber = "";
|
|
String[] shippingLotResultKeys = null;
|
|
String[] shippingLotResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("functionMode (int): "));
|
|
functionMode = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("lotNumber (String): "));
|
|
lotNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for shippingLotResultKeys: "));
|
|
int shippingLotResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
shippingLotResultKeys = new String[shippingLotResultKeysSize];
|
|
for (int i=0; i<shippingLotResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("shippingLotResultKeys[" + i + "] (String): "));
|
|
shippingLotResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.shipReuseCompletedShippingLot(sessionContext, stationNumber, functionMode, lotNumber, shippingLotResultKeys, out shippingLotResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; shippingLotResultValues != null && i<shippingLotResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("shippingLotResultValues[" + i + "]: ") + "<" + shippingLotResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_shipGetShippingLotInfo
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "shipGetShippingLotInfo"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] shippingLotFilters
|
|
/// in String[] shippingLotResultKeys
|
|
/// out String[] shippingLotResultValues
|
|
/// </para>
|
|
public static void test_shipGetShippingLotInfo()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] shippingLotFilters = null;
|
|
String[] shippingLotResultKeys = null;
|
|
String[] shippingLotResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for shippingLotFilters: "));
|
|
int shippingLotFiltersSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
shippingLotFilters = new KeyValue[shippingLotFiltersSize];
|
|
for (int i=0; i<shippingLotFiltersSize; i++)
|
|
{
|
|
shippingLotFilters[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("shippingLotFilters[" + i + "] .key (String): "));
|
|
shippingLotFilters[i].key = getInput();
|
|
Console.Write(fillWithSpace("shippingLotFilters[" + i + "] .value (String): "));
|
|
shippingLotFilters[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for shippingLotResultKeys: "));
|
|
int shippingLotResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
shippingLotResultKeys = new String[shippingLotResultKeysSize];
|
|
for (int i=0; i<shippingLotResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("shippingLotResultKeys[" + i + "] (String): "));
|
|
shippingLotResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.shipGetShippingLotInfo(sessionContext, stationNumber, shippingLotFilters, shippingLotResultKeys, out shippingLotResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; shippingLotResultValues != null && i<shippingLotResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("shippingLotResultValues[" + i + "]: ") + "<" + shippingLotResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_shipCheckSerialNumberAddToShippingLot
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "shipCheckSerialNumberAddToShippingLot"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String lotNumber
|
|
/// in String serialNumber
|
|
/// in String serialNumberPos
|
|
/// </para>
|
|
public static void test_shipCheckSerialNumberAddToShippingLot()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String lotNumber = "";
|
|
String serialNumber = "";
|
|
String serialNumberPos = "";
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("lotNumber (String): "));
|
|
lotNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumber (String): "));
|
|
serialNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumberPos (String): "));
|
|
serialNumberPos = getInput();
|
|
|
|
// call imsapi function
|
|
result = imsapi.shipCheckSerialNumberAddToShippingLot(sessionContext, stationNumber, lotNumber, serialNumber, serialNumberPos);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_shipAddChildLotToParentLot
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "shipAddChildLotToParentLot"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String lotNumberChild
|
|
/// in String lotNumberParent
|
|
/// in long bookDate
|
|
/// </para>
|
|
public static void test_shipAddChildLotToParentLot()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String lotNumberChild = "";
|
|
String lotNumberParent = "";
|
|
long bookDate = 0;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("lotNumberChild (String): "));
|
|
lotNumberChild = getInput();
|
|
Console.Write(fillWithSpace("lotNumberParent (String): "));
|
|
lotNumberParent = getInput();
|
|
Console.Write(fillWithSpace("bookDate (long): "));
|
|
bookDate = Int64.Parse(getInput());
|
|
|
|
// call imsapi function
|
|
result = imsapi.shipAddChildLotToParentLot(sessionContext, stationNumber, lotNumberChild, lotNumberParent, bookDate);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_shipRemoveChildLots
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "shipRemoveChildLots"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String lotNumberParent
|
|
/// in String[] lotNumbersChild
|
|
/// in long bookDate
|
|
/// out ResultData[] resultArray
|
|
/// </para>
|
|
public static void test_shipRemoveChildLots()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String lotNumberParent = "";
|
|
String[] lotNumbersChild = null;
|
|
long bookDate = 0;
|
|
ResultData[] resultArray = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("lotNumberParent (String): "));
|
|
lotNumberParent = getInput();
|
|
Console.Write(fillWithSpace("Enter size for lotNumbersChild: "));
|
|
int lotNumbersChildSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
lotNumbersChild = new String[lotNumbersChildSize];
|
|
for (int i=0; i<lotNumbersChildSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("lotNumbersChild[" + i + "] (String): "));
|
|
lotNumbersChild[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("bookDate (long): "));
|
|
bookDate = Int64.Parse(getInput());
|
|
|
|
// call imsapi function
|
|
result = imsapi.shipRemoveChildLots(sessionContext, stationNumber, lotNumberParent, lotNumbersChild, bookDate, out resultArray);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; resultArray != null && i<resultArray.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("resultArray[" + i + "].name: ") + "<" + resultArray[i].name + ">");
|
|
Console.WriteLine(fillWithSpace("resultArray[" + i + "].value: ") + "<" + resultArray[i].value + ">");
|
|
Console.WriteLine(fillWithSpace("resultArray[" + i + "].failCode: ") + "<" + resultArray[i].failCode + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_shipGetChildLotsForParentLot
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "shipGetChildLotsForParentLot"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String lotNumberParent
|
|
/// in String[] childLotResultKeys
|
|
/// out String[] childLotResultValues
|
|
/// </para>
|
|
public static void test_shipGetChildLotsForParentLot()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String lotNumberParent = "";
|
|
String[] childLotResultKeys = null;
|
|
String[] childLotResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("lotNumberParent (String): "));
|
|
lotNumberParent = getInput();
|
|
Console.Write(fillWithSpace("Enter size for childLotResultKeys: "));
|
|
int childLotResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
childLotResultKeys = new String[childLotResultKeysSize];
|
|
for (int i=0; i<childLotResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("childLotResultKeys[" + i + "] (String): "));
|
|
childLotResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.shipGetChildLotsForParentLot(sessionContext, stationNumber, lotNumberParent, childLotResultKeys, out childLotResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; childLotResultValues != null && i<childLotResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("childLotResultValues[" + i + "]: ") + "<" + childLotResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_shipMoveChildLots
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "shipMoveChildLots"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in StringStruct[] childLotArray
|
|
/// in String actualParentLot
|
|
/// in String newParentLot
|
|
/// in long bookDate
|
|
/// out ResultData[] resultDataArray
|
|
/// </para>
|
|
public static void test_shipMoveChildLots()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
StringStruct[] childLotArray = null;
|
|
String actualParentLot = "";
|
|
String newParentLot = "";
|
|
long bookDate = 0;
|
|
ResultData[] resultDataArray = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for childLotArray: "));
|
|
int childLotArraySize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
childLotArray = new StringStruct[childLotArraySize];
|
|
for (int i=0; i<childLotArraySize; i++)
|
|
{
|
|
childLotArray[i] = new StringStruct();
|
|
Console.Write(fillWithSpace("childLotArray[" + i + "] .value (String): "));
|
|
childLotArray[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("actualParentLot (String): "));
|
|
actualParentLot = getInput();
|
|
Console.Write(fillWithSpace("newParentLot (String): "));
|
|
newParentLot = getInput();
|
|
Console.Write(fillWithSpace("bookDate (long): "));
|
|
bookDate = Int64.Parse(getInput());
|
|
|
|
// call imsapi function
|
|
result = imsapi.shipMoveChildLots(sessionContext, stationNumber, childLotArray, actualParentLot, newParentLot, bookDate, out resultDataArray);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; resultDataArray != null && i<resultDataArray.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("resultDataArray[" + i + "].name: ") + "<" + resultDataArray[i].name + ">");
|
|
Console.WriteLine(fillWithSpace("resultDataArray[" + i + "].value: ") + "<" + resultDataArray[i].value + ">");
|
|
Console.WriteLine(fillWithSpace("resultDataArray[" + i + "].failCode: ") + "<" + resultDataArray[i].failCode + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_shipGetLotFromSerialNumber
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "shipGetLotFromSerialNumber"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String serialNumber
|
|
/// in String serialNumberPos
|
|
/// in String[] lotResultKeys
|
|
/// out String[] lotResultValues
|
|
/// </para>
|
|
public static void test_shipGetLotFromSerialNumber()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String serialNumber = "";
|
|
String serialNumberPos = "";
|
|
String[] lotResultKeys = null;
|
|
String[] lotResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumber (String): "));
|
|
serialNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumberPos (String): "));
|
|
serialNumberPos = getInput();
|
|
Console.Write(fillWithSpace("Enter size for lotResultKeys: "));
|
|
int lotResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
lotResultKeys = new String[lotResultKeysSize];
|
|
for (int i=0; i<lotResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("lotResultKeys[" + i + "] (String): "));
|
|
lotResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.shipGetLotFromSerialNumber(sessionContext, stationNumber, serialNumber, serialNumberPos, lotResultKeys, out lotResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; lotResultValues != null && i<lotResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("lotResultValues[" + i + "]: ") + "<" + lotResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_shipGetShippingPrefs
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "shipGetShippingPrefs"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in int objectType
|
|
/// in String objectNumber
|
|
/// in String objectDetail
|
|
/// in int withPackagingRule
|
|
/// in String[] shippingPrefsResultKeys
|
|
/// out String[] shippingPrefsResultValues
|
|
/// </para>
|
|
public static void test_shipGetShippingPrefs()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
int objectType = 0;
|
|
String objectNumber = "";
|
|
String objectDetail = "";
|
|
int withPackagingRule = 0;
|
|
String[] shippingPrefsResultKeys = null;
|
|
String[] shippingPrefsResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("objectType (int): "));
|
|
objectType = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("objectNumber (String): "));
|
|
objectNumber = getInput();
|
|
Console.Write(fillWithSpace("objectDetail (String): "));
|
|
objectDetail = getInput();
|
|
Console.Write(fillWithSpace("withPackagingRule (int): "));
|
|
withPackagingRule = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("Enter size for shippingPrefsResultKeys: "));
|
|
int shippingPrefsResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
shippingPrefsResultKeys = new String[shippingPrefsResultKeysSize];
|
|
for (int i=0; i<shippingPrefsResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("shippingPrefsResultKeys[" + i + "] (String): "));
|
|
shippingPrefsResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.shipGetShippingPrefs(sessionContext, stationNumber, objectType, objectNumber, objectDetail, withPackagingRule, shippingPrefsResultKeys, out shippingPrefsResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; shippingPrefsResultValues != null && i<shippingPrefsResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("shippingPrefsResultValues[" + i + "]: ") + "<" + shippingPrefsResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_smtConsumption
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "smtConsumption"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in int processLayer
|
|
/// in String lineName
|
|
/// in String setupName
|
|
/// in String productName
|
|
/// in String bomVersion
|
|
/// in String placementRecipe
|
|
/// in bool assignSerialNumbers
|
|
/// in bool bookSerialNumbers
|
|
/// in bool activateSetup
|
|
/// inout SmtSerialNo[] serialNumbers
|
|
/// inout SmtEvent[] events
|
|
/// inout SmtPlacement[] placements
|
|
/// in bool ignoreContainerProblems
|
|
/// in bool createWorkOrder
|
|
/// in bool activateWorkOrder
|
|
/// in String workOrderNumber
|
|
/// in double cycleTime
|
|
/// </para>
|
|
public static void test_smtConsumption()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
int processLayer = 0;
|
|
String lineName = "";
|
|
String setupName = "";
|
|
String productName = "";
|
|
String bomVersion = "";
|
|
String placementRecipe = "";
|
|
bool assignSerialNumbers = false;
|
|
bool bookSerialNumbers = false;
|
|
bool activateSetup = false;
|
|
SmtSerialNo[] serialNumbers = null;
|
|
SmtEvent[] events = null;
|
|
SmtPlacement[] placements = null;
|
|
bool ignoreContainerProblems = false;
|
|
bool createWorkOrder = false;
|
|
bool activateWorkOrder = false;
|
|
String workOrderNumber = "";
|
|
double cycleTime = 0.0;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("processLayer (int): "));
|
|
processLayer = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("lineName (String): "));
|
|
lineName = getInput();
|
|
Console.Write(fillWithSpace("setupName (String): "));
|
|
setupName = getInput();
|
|
Console.Write(fillWithSpace("productName (String): "));
|
|
productName = getInput();
|
|
Console.Write(fillWithSpace("bomVersion (String): "));
|
|
bomVersion = getInput();
|
|
Console.Write(fillWithSpace("placementRecipe (String): "));
|
|
placementRecipe = getInput();
|
|
Console.Write(fillWithSpace("assignSerialNumbers (bool): "));
|
|
assignSerialNumbers = Boolean.Parse(getInput());
|
|
Console.Write(fillWithSpace("bookSerialNumbers (bool): "));
|
|
bookSerialNumbers = Boolean.Parse(getInput());
|
|
Console.Write(fillWithSpace("activateSetup (bool): "));
|
|
activateSetup = Boolean.Parse(getInput());
|
|
Console.Write(fillWithSpace("Enter size for serialNumbers: "));
|
|
int serialNumbersSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
serialNumbers = new SmtSerialNo[serialNumbersSize];
|
|
for (int i=0; i<serialNumbersSize; i++)
|
|
{
|
|
serialNumbers[i] = new SmtSerialNo();
|
|
Console.Write(fillWithSpace("serialNumbers[" + i + "] .serialNumber (String): "));
|
|
serialNumbers[i].serialNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumbers[" + i + "] .serialNumberPosition (int): "));
|
|
serialNumbers[i].serialNumberPosition = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("serialNumbers[" + i + "] .serialNumberState (int): "));
|
|
serialNumbers[i].serialNumberState = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("serialNumbers[" + i + "] .validationFlag (int): "));
|
|
serialNumbers[i].validationFlag = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("serialNumbers[" + i + "] .processFlag (int): "));
|
|
serialNumbers[i].processFlag = Int32.Parse(getInput());
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for events: "));
|
|
int eventsSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
events = new SmtEvent[eventsSize];
|
|
for (int i=0; i<eventsSize; i++)
|
|
{
|
|
events[i] = new SmtEvent();
|
|
Console.Write(fillWithSpace("events[" + i + "] .eventId (int): "));
|
|
events[i].eventId = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("events[" + i + "] .eventDate (long): "));
|
|
events[i].eventDate = Int64.Parse(getInput());
|
|
Console.Write(fillWithSpace("events[" + i + "] .validationFlag (int): "));
|
|
events[i].validationFlag = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("events[" + i + "] .processFlag (int): "));
|
|
events[i].processFlag = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("events[" + i + "] .position (String): "));
|
|
events[i].position = getInput();
|
|
Console.Write(fillWithSpace("events[" + i + "] .feederBank (String): "));
|
|
events[i].feederBank = getInput();
|
|
Console.Write(fillWithSpace("events[" + i + "] .feederId (String): "));
|
|
events[i].feederId = getInput();
|
|
Console.Write(fillWithSpace("events[" + i + "] .placementId (int): "));
|
|
events[i].placementId = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("events[" + i + "] .qtyRemain (int): "));
|
|
events[i].qtyRemain = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("events[" + i + "] .qtyPlaced (int): "));
|
|
events[i].qtyPlaced = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("events[" + i + "] .qtyWasted (int): "));
|
|
events[i].qtyWasted = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("events[" + i + "] .materialBinNumber (String): "));
|
|
events[i].materialBinNumber = getInput();
|
|
Console.Write(fillWithSpace("events[" + i + "] .createMaterialBin (bool): "));
|
|
events[i].createMaterialBin = Boolean.Parse(getInput());
|
|
Console.Write(fillWithSpace("events[" + i + "] .partNumber (String): "));
|
|
events[i].partNumber = getInput();
|
|
Console.Write(fillWithSpace("events[" + i + "] .quantity (double): "));
|
|
events[i].quantity = Double.Parse(getInput());
|
|
Console.Write(fillWithSpace("events[" + i + "] .supplier (String): "));
|
|
events[i].supplier = getInput();
|
|
Console.Write(fillWithSpace("events[" + i + "] .lotNumber (String): "));
|
|
events[i].lotNumber = getInput();
|
|
Console.Write(fillWithSpace("events[" + i + "] .dateCode (String): "));
|
|
events[i].dateCode = getInput();
|
|
Console.Write(fillWithSpace("events[" + i + "] .parentPartNumber (String): "));
|
|
events[i].parentPartNumber = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for placements: "));
|
|
int placementsSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
placements = new SmtPlacement[placementsSize];
|
|
for (int i=0; i<placementsSize; i++)
|
|
{
|
|
placements[i] = new SmtPlacement();
|
|
Console.Write(fillWithSpace("placements[" + i + "] .placementId (int): "));
|
|
placements[i].placementId = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("placements[" + i + "] .compName (String): "));
|
|
placements[i].compName = getInput();
|
|
Console.Write(fillWithSpace("placements[" + i + "] .xPosition (String): "));
|
|
placements[i].xPosition = getInput();
|
|
Console.Write(fillWithSpace("placements[" + i + "] .yPosition (String): "));
|
|
placements[i].yPosition = getInput();
|
|
Console.Write(fillWithSpace("placements[" + i + "] .panelPosition (int): "));
|
|
placements[i].panelPosition = Int32.Parse(getInput());
|
|
}
|
|
Console.Write(fillWithSpace("ignoreContainerProblems (bool): "));
|
|
ignoreContainerProblems = Boolean.Parse(getInput());
|
|
Console.Write(fillWithSpace("createWorkOrder (bool): "));
|
|
createWorkOrder = Boolean.Parse(getInput());
|
|
Console.Write(fillWithSpace("activateWorkOrder (bool): "));
|
|
activateWorkOrder = Boolean.Parse(getInput());
|
|
Console.Write(fillWithSpace("workOrderNumber (String): "));
|
|
workOrderNumber = getInput();
|
|
Console.Write(fillWithSpace("cycleTime (double): "));
|
|
cycleTime = Double.Parse(getInput());
|
|
|
|
// call imsapi function
|
|
result = imsapi.smtConsumption(sessionContext, stationNumber, processLayer, lineName, setupName, productName, bomVersion, placementRecipe, assignSerialNumbers, bookSerialNumbers, activateSetup, ref serialNumbers, ref events, ref placements, ignoreContainerProblems, createWorkOrder, activateWorkOrder, workOrderNumber, cycleTime);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; serialNumbers != null && i<serialNumbers.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("serialNumbers[" + i + "].serialNumber: ") + "<" + serialNumbers[i].serialNumber + ">");
|
|
Console.WriteLine(fillWithSpace("serialNumbers[" + i + "].serialNumberPosition: ") + "<" + serialNumbers[i].serialNumberPosition + ">");
|
|
Console.WriteLine(fillWithSpace("serialNumbers[" + i + "].serialNumberState: ") + "<" + serialNumbers[i].serialNumberState + ">");
|
|
Console.WriteLine(fillWithSpace("serialNumbers[" + i + "].validationFlag: ") + "<" + serialNumbers[i].validationFlag + ">");
|
|
Console.WriteLine(fillWithSpace("serialNumbers[" + i + "].processFlag: ") + "<" + serialNumbers[i].processFlag + ">");
|
|
}
|
|
for (int i=0; events != null && i<events.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("events[" + i + "].eventId: ") + "<" + events[i].eventId + ">");
|
|
Console.WriteLine(fillWithSpace("events[" + i + "].eventDate: ") + "<" + events[i].eventDate + ">");
|
|
Console.WriteLine(fillWithSpace("events[" + i + "].validationFlag: ") + "<" + events[i].validationFlag + ">");
|
|
Console.WriteLine(fillWithSpace("events[" + i + "].processFlag: ") + "<" + events[i].processFlag + ">");
|
|
Console.WriteLine(fillWithSpace("events[" + i + "].position: ") + "<" + events[i].position + ">");
|
|
Console.WriteLine(fillWithSpace("events[" + i + "].feederBank: ") + "<" + events[i].feederBank + ">");
|
|
Console.WriteLine(fillWithSpace("events[" + i + "].feederId: ") + "<" + events[i].feederId + ">");
|
|
Console.WriteLine(fillWithSpace("events[" + i + "].placementId: ") + "<" + events[i].placementId + ">");
|
|
Console.WriteLine(fillWithSpace("events[" + i + "].qtyRemain: ") + "<" + events[i].qtyRemain + ">");
|
|
Console.WriteLine(fillWithSpace("events[" + i + "].qtyPlaced: ") + "<" + events[i].qtyPlaced + ">");
|
|
Console.WriteLine(fillWithSpace("events[" + i + "].qtyWasted: ") + "<" + events[i].qtyWasted + ">");
|
|
Console.WriteLine(fillWithSpace("events[" + i + "].materialBinNumber: ") + "<" + events[i].materialBinNumber + ">");
|
|
Console.WriteLine(fillWithSpace("events[" + i + "].createMaterialBin: ") + "<" + events[i].createMaterialBin + ">");
|
|
Console.WriteLine(fillWithSpace("events[" + i + "].partNumber: ") + "<" + events[i].partNumber + ">");
|
|
Console.WriteLine(fillWithSpace("events[" + i + "].quantity: ") + "<" + events[i].quantity + ">");
|
|
Console.WriteLine(fillWithSpace("events[" + i + "].supplier: ") + "<" + events[i].supplier + ">");
|
|
Console.WriteLine(fillWithSpace("events[" + i + "].lotNumber: ") + "<" + events[i].lotNumber + ">");
|
|
Console.WriteLine(fillWithSpace("events[" + i + "].dateCode: ") + "<" + events[i].dateCode + ">");
|
|
Console.WriteLine(fillWithSpace("events[" + i + "].parentPartNumber: ") + "<" + events[i].parentPartNumber + ">");
|
|
}
|
|
for (int i=0; placements != null && i<placements.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("placements[" + i + "].placementId: ") + "<" + placements[i].placementId + ">");
|
|
Console.WriteLine(fillWithSpace("placements[" + i + "].compName: ") + "<" + placements[i].compName + ">");
|
|
Console.WriteLine(fillWithSpace("placements[" + i + "].xPosition: ") + "<" + placements[i].xPosition + ">");
|
|
Console.WriteLine(fillWithSpace("placements[" + i + "].yPosition: ") + "<" + placements[i].yPosition + ">");
|
|
Console.WriteLine(fillWithSpace("placements[" + i + "].panelPosition: ") + "<" + placements[i].panelPosition + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_smtEventSetup
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "smtEventSetup"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in int processLayer
|
|
/// in String lineName
|
|
/// in String setupName
|
|
/// in String productName
|
|
/// in String bomVersion
|
|
/// in String placementRecipe
|
|
/// in bool assignSerialNumbers
|
|
/// in bool bookSerialNumbers
|
|
/// in bool activateSetup
|
|
/// inout SmtSerialNo[] serialNumbers
|
|
/// inout SmtEvent[] events
|
|
/// inout SmtPlacement[] placements
|
|
/// in bool ignoreContainerProblems
|
|
/// in bool createWorkOrder
|
|
/// in bool activateWorkOrder
|
|
/// in String workOrderNumber
|
|
/// in double cycleTime
|
|
/// </para>
|
|
public static void test_smtEventSetup()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
int processLayer = 0;
|
|
String lineName = "";
|
|
String setupName = "";
|
|
String productName = "";
|
|
String bomVersion = "";
|
|
String placementRecipe = "";
|
|
bool assignSerialNumbers = false;
|
|
bool bookSerialNumbers = false;
|
|
bool activateSetup = false;
|
|
SmtSerialNo[] serialNumbers = null;
|
|
SmtEvent[] events = null;
|
|
SmtPlacement[] placements = null;
|
|
bool ignoreContainerProblems = false;
|
|
bool createWorkOrder = false;
|
|
bool activateWorkOrder = false;
|
|
String workOrderNumber = "";
|
|
double cycleTime = 0.0;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("processLayer (int): "));
|
|
processLayer = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("lineName (String): "));
|
|
lineName = getInput();
|
|
Console.Write(fillWithSpace("setupName (String): "));
|
|
setupName = getInput();
|
|
Console.Write(fillWithSpace("productName (String): "));
|
|
productName = getInput();
|
|
Console.Write(fillWithSpace("bomVersion (String): "));
|
|
bomVersion = getInput();
|
|
Console.Write(fillWithSpace("placementRecipe (String): "));
|
|
placementRecipe = getInput();
|
|
Console.Write(fillWithSpace("assignSerialNumbers (bool): "));
|
|
assignSerialNumbers = Boolean.Parse(getInput());
|
|
Console.Write(fillWithSpace("bookSerialNumbers (bool): "));
|
|
bookSerialNumbers = Boolean.Parse(getInput());
|
|
Console.Write(fillWithSpace("activateSetup (bool): "));
|
|
activateSetup = Boolean.Parse(getInput());
|
|
Console.Write(fillWithSpace("Enter size for serialNumbers: "));
|
|
int serialNumbersSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
serialNumbers = new SmtSerialNo[serialNumbersSize];
|
|
for (int i=0; i<serialNumbersSize; i++)
|
|
{
|
|
serialNumbers[i] = new SmtSerialNo();
|
|
Console.Write(fillWithSpace("serialNumbers[" + i + "] .serialNumber (String): "));
|
|
serialNumbers[i].serialNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumbers[" + i + "] .serialNumberPosition (int): "));
|
|
serialNumbers[i].serialNumberPosition = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("serialNumbers[" + i + "] .serialNumberState (int): "));
|
|
serialNumbers[i].serialNumberState = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("serialNumbers[" + i + "] .validationFlag (int): "));
|
|
serialNumbers[i].validationFlag = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("serialNumbers[" + i + "] .processFlag (int): "));
|
|
serialNumbers[i].processFlag = Int32.Parse(getInput());
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for events: "));
|
|
int eventsSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
events = new SmtEvent[eventsSize];
|
|
for (int i=0; i<eventsSize; i++)
|
|
{
|
|
events[i] = new SmtEvent();
|
|
Console.Write(fillWithSpace("events[" + i + "] .eventId (int): "));
|
|
events[i].eventId = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("events[" + i + "] .eventDate (long): "));
|
|
events[i].eventDate = Int64.Parse(getInput());
|
|
Console.Write(fillWithSpace("events[" + i + "] .validationFlag (int): "));
|
|
events[i].validationFlag = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("events[" + i + "] .processFlag (int): "));
|
|
events[i].processFlag = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("events[" + i + "] .position (String): "));
|
|
events[i].position = getInput();
|
|
Console.Write(fillWithSpace("events[" + i + "] .feederBank (String): "));
|
|
events[i].feederBank = getInput();
|
|
Console.Write(fillWithSpace("events[" + i + "] .feederId (String): "));
|
|
events[i].feederId = getInput();
|
|
Console.Write(fillWithSpace("events[" + i + "] .placementId (int): "));
|
|
events[i].placementId = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("events[" + i + "] .qtyRemain (int): "));
|
|
events[i].qtyRemain = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("events[" + i + "] .qtyPlaced (int): "));
|
|
events[i].qtyPlaced = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("events[" + i + "] .qtyWasted (int): "));
|
|
events[i].qtyWasted = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("events[" + i + "] .materialBinNumber (String): "));
|
|
events[i].materialBinNumber = getInput();
|
|
Console.Write(fillWithSpace("events[" + i + "] .createMaterialBin (bool): "));
|
|
events[i].createMaterialBin = Boolean.Parse(getInput());
|
|
Console.Write(fillWithSpace("events[" + i + "] .partNumber (String): "));
|
|
events[i].partNumber = getInput();
|
|
Console.Write(fillWithSpace("events[" + i + "] .quantity (double): "));
|
|
events[i].quantity = Double.Parse(getInput());
|
|
Console.Write(fillWithSpace("events[" + i + "] .supplier (String): "));
|
|
events[i].supplier = getInput();
|
|
Console.Write(fillWithSpace("events[" + i + "] .lotNumber (String): "));
|
|
events[i].lotNumber = getInput();
|
|
Console.Write(fillWithSpace("events[" + i + "] .dateCode (String): "));
|
|
events[i].dateCode = getInput();
|
|
Console.Write(fillWithSpace("events[" + i + "] .parentPartNumber (String): "));
|
|
events[i].parentPartNumber = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for placements: "));
|
|
int placementsSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
placements = new SmtPlacement[placementsSize];
|
|
for (int i=0; i<placementsSize; i++)
|
|
{
|
|
placements[i] = new SmtPlacement();
|
|
Console.Write(fillWithSpace("placements[" + i + "] .placementId (int): "));
|
|
placements[i].placementId = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("placements[" + i + "] .compName (String): "));
|
|
placements[i].compName = getInput();
|
|
Console.Write(fillWithSpace("placements[" + i + "] .xPosition (String): "));
|
|
placements[i].xPosition = getInput();
|
|
Console.Write(fillWithSpace("placements[" + i + "] .yPosition (String): "));
|
|
placements[i].yPosition = getInput();
|
|
Console.Write(fillWithSpace("placements[" + i + "] .panelPosition (int): "));
|
|
placements[i].panelPosition = Int32.Parse(getInput());
|
|
}
|
|
Console.Write(fillWithSpace("ignoreContainerProblems (bool): "));
|
|
ignoreContainerProblems = Boolean.Parse(getInput());
|
|
Console.Write(fillWithSpace("createWorkOrder (bool): "));
|
|
createWorkOrder = Boolean.Parse(getInput());
|
|
Console.Write(fillWithSpace("activateWorkOrder (bool): "));
|
|
activateWorkOrder = Boolean.Parse(getInput());
|
|
Console.Write(fillWithSpace("workOrderNumber (String): "));
|
|
workOrderNumber = getInput();
|
|
Console.Write(fillWithSpace("cycleTime (double): "));
|
|
cycleTime = Double.Parse(getInput());
|
|
|
|
// call imsapi function
|
|
result = imsapi.smtEventSetup(sessionContext, stationNumber, processLayer, lineName, setupName, productName, bomVersion, placementRecipe, assignSerialNumbers, bookSerialNumbers, activateSetup, ref serialNumbers, ref events, ref placements, ignoreContainerProblems, createWorkOrder, activateWorkOrder, workOrderNumber, cycleTime);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; serialNumbers != null && i<serialNumbers.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("serialNumbers[" + i + "].serialNumber: ") + "<" + serialNumbers[i].serialNumber + ">");
|
|
Console.WriteLine(fillWithSpace("serialNumbers[" + i + "].serialNumberPosition: ") + "<" + serialNumbers[i].serialNumberPosition + ">");
|
|
Console.WriteLine(fillWithSpace("serialNumbers[" + i + "].serialNumberState: ") + "<" + serialNumbers[i].serialNumberState + ">");
|
|
Console.WriteLine(fillWithSpace("serialNumbers[" + i + "].validationFlag: ") + "<" + serialNumbers[i].validationFlag + ">");
|
|
Console.WriteLine(fillWithSpace("serialNumbers[" + i + "].processFlag: ") + "<" + serialNumbers[i].processFlag + ">");
|
|
}
|
|
for (int i=0; events != null && i<events.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("events[" + i + "].eventId: ") + "<" + events[i].eventId + ">");
|
|
Console.WriteLine(fillWithSpace("events[" + i + "].eventDate: ") + "<" + events[i].eventDate + ">");
|
|
Console.WriteLine(fillWithSpace("events[" + i + "].validationFlag: ") + "<" + events[i].validationFlag + ">");
|
|
Console.WriteLine(fillWithSpace("events[" + i + "].processFlag: ") + "<" + events[i].processFlag + ">");
|
|
Console.WriteLine(fillWithSpace("events[" + i + "].position: ") + "<" + events[i].position + ">");
|
|
Console.WriteLine(fillWithSpace("events[" + i + "].feederBank: ") + "<" + events[i].feederBank + ">");
|
|
Console.WriteLine(fillWithSpace("events[" + i + "].feederId: ") + "<" + events[i].feederId + ">");
|
|
Console.WriteLine(fillWithSpace("events[" + i + "].placementId: ") + "<" + events[i].placementId + ">");
|
|
Console.WriteLine(fillWithSpace("events[" + i + "].qtyRemain: ") + "<" + events[i].qtyRemain + ">");
|
|
Console.WriteLine(fillWithSpace("events[" + i + "].qtyPlaced: ") + "<" + events[i].qtyPlaced + ">");
|
|
Console.WriteLine(fillWithSpace("events[" + i + "].qtyWasted: ") + "<" + events[i].qtyWasted + ">");
|
|
Console.WriteLine(fillWithSpace("events[" + i + "].materialBinNumber: ") + "<" + events[i].materialBinNumber + ">");
|
|
Console.WriteLine(fillWithSpace("events[" + i + "].createMaterialBin: ") + "<" + events[i].createMaterialBin + ">");
|
|
Console.WriteLine(fillWithSpace("events[" + i + "].partNumber: ") + "<" + events[i].partNumber + ">");
|
|
Console.WriteLine(fillWithSpace("events[" + i + "].quantity: ") + "<" + events[i].quantity + ">");
|
|
Console.WriteLine(fillWithSpace("events[" + i + "].supplier: ") + "<" + events[i].supplier + ">");
|
|
Console.WriteLine(fillWithSpace("events[" + i + "].lotNumber: ") + "<" + events[i].lotNumber + ">");
|
|
Console.WriteLine(fillWithSpace("events[" + i + "].dateCode: ") + "<" + events[i].dateCode + ">");
|
|
Console.WriteLine(fillWithSpace("events[" + i + "].parentPartNumber: ") + "<" + events[i].parentPartNumber + ">");
|
|
}
|
|
for (int i=0; placements != null && i<placements.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("placements[" + i + "].placementId: ") + "<" + placements[i].placementId + ">");
|
|
Console.WriteLine(fillWithSpace("placements[" + i + "].compName: ") + "<" + placements[i].compName + ">");
|
|
Console.WriteLine(fillWithSpace("placements[" + i + "].xPosition: ") + "<" + placements[i].xPosition + ">");
|
|
Console.WriteLine(fillWithSpace("placements[" + i + "].yPosition: ") + "<" + placements[i].yPosition + ">");
|
|
Console.WriteLine(fillWithSpace("placements[" + i + "].panelPosition: ") + "<" + placements[i].panelPosition + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_smtSerialNumberSetup
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "smtSerialNumberSetup"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in int processLayer
|
|
/// in String lineName
|
|
/// in String setupName
|
|
/// in String productName
|
|
/// in String bomVersion
|
|
/// in String placementRecipe
|
|
/// in bool assignSerialNumbers
|
|
/// in bool bookSerialNumbers
|
|
/// in bool activateSetup
|
|
/// inout SmtSerialNo[] serialNumbers
|
|
/// inout SmtEvent[] events
|
|
/// inout SmtPlacement[] placements
|
|
/// in bool ignoreContainerProblems
|
|
/// in bool createWorkOrder
|
|
/// in bool activateWorkOrder
|
|
/// in String workOrderNumber
|
|
/// in double cycleTime
|
|
/// </para>
|
|
public static void test_smtSerialNumberSetup()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
int processLayer = 0;
|
|
String lineName = "";
|
|
String setupName = "";
|
|
String productName = "";
|
|
String bomVersion = "";
|
|
String placementRecipe = "";
|
|
bool assignSerialNumbers = false;
|
|
bool bookSerialNumbers = false;
|
|
bool activateSetup = false;
|
|
SmtSerialNo[] serialNumbers = null;
|
|
SmtEvent[] events = null;
|
|
SmtPlacement[] placements = null;
|
|
bool ignoreContainerProblems = false;
|
|
bool createWorkOrder = false;
|
|
bool activateWorkOrder = false;
|
|
String workOrderNumber = "";
|
|
double cycleTime = 0.0;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("processLayer (int): "));
|
|
processLayer = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("lineName (String): "));
|
|
lineName = getInput();
|
|
Console.Write(fillWithSpace("setupName (String): "));
|
|
setupName = getInput();
|
|
Console.Write(fillWithSpace("productName (String): "));
|
|
productName = getInput();
|
|
Console.Write(fillWithSpace("bomVersion (String): "));
|
|
bomVersion = getInput();
|
|
Console.Write(fillWithSpace("placementRecipe (String): "));
|
|
placementRecipe = getInput();
|
|
Console.Write(fillWithSpace("assignSerialNumbers (bool): "));
|
|
assignSerialNumbers = Boolean.Parse(getInput());
|
|
Console.Write(fillWithSpace("bookSerialNumbers (bool): "));
|
|
bookSerialNumbers = Boolean.Parse(getInput());
|
|
Console.Write(fillWithSpace("activateSetup (bool): "));
|
|
activateSetup = Boolean.Parse(getInput());
|
|
Console.Write(fillWithSpace("Enter size for serialNumbers: "));
|
|
int serialNumbersSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
serialNumbers = new SmtSerialNo[serialNumbersSize];
|
|
for (int i=0; i<serialNumbersSize; i++)
|
|
{
|
|
serialNumbers[i] = new SmtSerialNo();
|
|
Console.Write(fillWithSpace("serialNumbers[" + i + "] .serialNumber (String): "));
|
|
serialNumbers[i].serialNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumbers[" + i + "] .serialNumberPosition (int): "));
|
|
serialNumbers[i].serialNumberPosition = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("serialNumbers[" + i + "] .serialNumberState (int): "));
|
|
serialNumbers[i].serialNumberState = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("serialNumbers[" + i + "] .validationFlag (int): "));
|
|
serialNumbers[i].validationFlag = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("serialNumbers[" + i + "] .processFlag (int): "));
|
|
serialNumbers[i].processFlag = Int32.Parse(getInput());
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for events: "));
|
|
int eventsSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
events = new SmtEvent[eventsSize];
|
|
for (int i=0; i<eventsSize; i++)
|
|
{
|
|
events[i] = new SmtEvent();
|
|
Console.Write(fillWithSpace("events[" + i + "] .eventId (int): "));
|
|
events[i].eventId = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("events[" + i + "] .eventDate (long): "));
|
|
events[i].eventDate = Int64.Parse(getInput());
|
|
Console.Write(fillWithSpace("events[" + i + "] .validationFlag (int): "));
|
|
events[i].validationFlag = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("events[" + i + "] .processFlag (int): "));
|
|
events[i].processFlag = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("events[" + i + "] .position (String): "));
|
|
events[i].position = getInput();
|
|
Console.Write(fillWithSpace("events[" + i + "] .feederBank (String): "));
|
|
events[i].feederBank = getInput();
|
|
Console.Write(fillWithSpace("events[" + i + "] .feederId (String): "));
|
|
events[i].feederId = getInput();
|
|
Console.Write(fillWithSpace("events[" + i + "] .placementId (int): "));
|
|
events[i].placementId = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("events[" + i + "] .qtyRemain (int): "));
|
|
events[i].qtyRemain = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("events[" + i + "] .qtyPlaced (int): "));
|
|
events[i].qtyPlaced = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("events[" + i + "] .qtyWasted (int): "));
|
|
events[i].qtyWasted = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("events[" + i + "] .materialBinNumber (String): "));
|
|
events[i].materialBinNumber = getInput();
|
|
Console.Write(fillWithSpace("events[" + i + "] .createMaterialBin (bool): "));
|
|
events[i].createMaterialBin = Boolean.Parse(getInput());
|
|
Console.Write(fillWithSpace("events[" + i + "] .partNumber (String): "));
|
|
events[i].partNumber = getInput();
|
|
Console.Write(fillWithSpace("events[" + i + "] .quantity (double): "));
|
|
events[i].quantity = Double.Parse(getInput());
|
|
Console.Write(fillWithSpace("events[" + i + "] .supplier (String): "));
|
|
events[i].supplier = getInput();
|
|
Console.Write(fillWithSpace("events[" + i + "] .lotNumber (String): "));
|
|
events[i].lotNumber = getInput();
|
|
Console.Write(fillWithSpace("events[" + i + "] .dateCode (String): "));
|
|
events[i].dateCode = getInput();
|
|
Console.Write(fillWithSpace("events[" + i + "] .parentPartNumber (String): "));
|
|
events[i].parentPartNumber = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for placements: "));
|
|
int placementsSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
placements = new SmtPlacement[placementsSize];
|
|
for (int i=0; i<placementsSize; i++)
|
|
{
|
|
placements[i] = new SmtPlacement();
|
|
Console.Write(fillWithSpace("placements[" + i + "] .placementId (int): "));
|
|
placements[i].placementId = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("placements[" + i + "] .compName (String): "));
|
|
placements[i].compName = getInput();
|
|
Console.Write(fillWithSpace("placements[" + i + "] .xPosition (String): "));
|
|
placements[i].xPosition = getInput();
|
|
Console.Write(fillWithSpace("placements[" + i + "] .yPosition (String): "));
|
|
placements[i].yPosition = getInput();
|
|
Console.Write(fillWithSpace("placements[" + i + "] .panelPosition (int): "));
|
|
placements[i].panelPosition = Int32.Parse(getInput());
|
|
}
|
|
Console.Write(fillWithSpace("ignoreContainerProblems (bool): "));
|
|
ignoreContainerProblems = Boolean.Parse(getInput());
|
|
Console.Write(fillWithSpace("createWorkOrder (bool): "));
|
|
createWorkOrder = Boolean.Parse(getInput());
|
|
Console.Write(fillWithSpace("activateWorkOrder (bool): "));
|
|
activateWorkOrder = Boolean.Parse(getInput());
|
|
Console.Write(fillWithSpace("workOrderNumber (String): "));
|
|
workOrderNumber = getInput();
|
|
Console.Write(fillWithSpace("cycleTime (double): "));
|
|
cycleTime = Double.Parse(getInput());
|
|
|
|
// call imsapi function
|
|
result = imsapi.smtSerialNumberSetup(sessionContext, stationNumber, processLayer, lineName, setupName, productName, bomVersion, placementRecipe, assignSerialNumbers, bookSerialNumbers, activateSetup, ref serialNumbers, ref events, ref placements, ignoreContainerProblems, createWorkOrder, activateWorkOrder, workOrderNumber, cycleTime);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; serialNumbers != null && i<serialNumbers.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("serialNumbers[" + i + "].serialNumber: ") + "<" + serialNumbers[i].serialNumber + ">");
|
|
Console.WriteLine(fillWithSpace("serialNumbers[" + i + "].serialNumberPosition: ") + "<" + serialNumbers[i].serialNumberPosition + ">");
|
|
Console.WriteLine(fillWithSpace("serialNumbers[" + i + "].serialNumberState: ") + "<" + serialNumbers[i].serialNumberState + ">");
|
|
Console.WriteLine(fillWithSpace("serialNumbers[" + i + "].validationFlag: ") + "<" + serialNumbers[i].validationFlag + ">");
|
|
Console.WriteLine(fillWithSpace("serialNumbers[" + i + "].processFlag: ") + "<" + serialNumbers[i].processFlag + ">");
|
|
}
|
|
for (int i=0; events != null && i<events.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("events[" + i + "].eventId: ") + "<" + events[i].eventId + ">");
|
|
Console.WriteLine(fillWithSpace("events[" + i + "].eventDate: ") + "<" + events[i].eventDate + ">");
|
|
Console.WriteLine(fillWithSpace("events[" + i + "].validationFlag: ") + "<" + events[i].validationFlag + ">");
|
|
Console.WriteLine(fillWithSpace("events[" + i + "].processFlag: ") + "<" + events[i].processFlag + ">");
|
|
Console.WriteLine(fillWithSpace("events[" + i + "].position: ") + "<" + events[i].position + ">");
|
|
Console.WriteLine(fillWithSpace("events[" + i + "].feederBank: ") + "<" + events[i].feederBank + ">");
|
|
Console.WriteLine(fillWithSpace("events[" + i + "].feederId: ") + "<" + events[i].feederId + ">");
|
|
Console.WriteLine(fillWithSpace("events[" + i + "].placementId: ") + "<" + events[i].placementId + ">");
|
|
Console.WriteLine(fillWithSpace("events[" + i + "].qtyRemain: ") + "<" + events[i].qtyRemain + ">");
|
|
Console.WriteLine(fillWithSpace("events[" + i + "].qtyPlaced: ") + "<" + events[i].qtyPlaced + ">");
|
|
Console.WriteLine(fillWithSpace("events[" + i + "].qtyWasted: ") + "<" + events[i].qtyWasted + ">");
|
|
Console.WriteLine(fillWithSpace("events[" + i + "].materialBinNumber: ") + "<" + events[i].materialBinNumber + ">");
|
|
Console.WriteLine(fillWithSpace("events[" + i + "].createMaterialBin: ") + "<" + events[i].createMaterialBin + ">");
|
|
Console.WriteLine(fillWithSpace("events[" + i + "].partNumber: ") + "<" + events[i].partNumber + ">");
|
|
Console.WriteLine(fillWithSpace("events[" + i + "].quantity: ") + "<" + events[i].quantity + ">");
|
|
Console.WriteLine(fillWithSpace("events[" + i + "].supplier: ") + "<" + events[i].supplier + ">");
|
|
Console.WriteLine(fillWithSpace("events[" + i + "].lotNumber: ") + "<" + events[i].lotNumber + ">");
|
|
Console.WriteLine(fillWithSpace("events[" + i + "].dateCode: ") + "<" + events[i].dateCode + ">");
|
|
Console.WriteLine(fillWithSpace("events[" + i + "].parentPartNumber: ") + "<" + events[i].parentPartNumber + ">");
|
|
}
|
|
for (int i=0; placements != null && i<placements.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("placements[" + i + "].placementId: ") + "<" + placements[i].placementId + ">");
|
|
Console.WriteLine(fillWithSpace("placements[" + i + "].compName: ") + "<" + placements[i].compName + ">");
|
|
Console.WriteLine(fillWithSpace("placements[" + i + "].xPosition: ") + "<" + placements[i].xPosition + ">");
|
|
Console.WriteLine(fillWithSpace("placements[" + i + "].yPosition: ") + "<" + placements[i].yPosition + ">");
|
|
Console.WriteLine(fillWithSpace("placements[" + i + "].panelPosition: ") + "<" + placements[i].panelPosition + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_smtSetupData
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "smtSetupData"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in int functionMode
|
|
/// in String[] smtSetupHeaderKeys
|
|
/// in String[] smtSetupHeaderValues
|
|
/// out String[] smtSetupHeaderResultValues
|
|
/// in String[] smtSerialNumberKeys
|
|
/// in String[] smtSerialNumberValues
|
|
/// out String[] smtSerialNumberResultValues
|
|
/// in String[] smtEventKeys
|
|
/// in String[] smtEventValues
|
|
/// out String[] smtEventResultValues
|
|
/// in String[] smtPlacementKeys
|
|
/// in String[] smtPlacementValues
|
|
/// </para>
|
|
public static void test_smtSetupData()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
int functionMode = 0;
|
|
String[] smtSetupHeaderKeys = null;
|
|
String[] smtSetupHeaderValues = null;
|
|
String[] smtSetupHeaderResultValues = null;
|
|
String[] smtSerialNumberKeys = null;
|
|
String[] smtSerialNumberValues = null;
|
|
String[] smtSerialNumberResultValues = null;
|
|
String[] smtEventKeys = null;
|
|
String[] smtEventValues = null;
|
|
String[] smtEventResultValues = null;
|
|
String[] smtPlacementKeys = null;
|
|
String[] smtPlacementValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("functionMode (int): "));
|
|
functionMode = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("Enter size for smtSetupHeaderKeys: "));
|
|
int smtSetupHeaderKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
smtSetupHeaderKeys = new String[smtSetupHeaderKeysSize];
|
|
for (int i=0; i<smtSetupHeaderKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("smtSetupHeaderKeys[" + i + "] (String): "));
|
|
smtSetupHeaderKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for smtSetupHeaderValues: "));
|
|
int smtSetupHeaderValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
smtSetupHeaderValues = new String[smtSetupHeaderValuesSize];
|
|
for (int i=0; i<smtSetupHeaderValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("smtSetupHeaderValues[" + i + "] (String): "));
|
|
smtSetupHeaderValues[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for smtSerialNumberKeys: "));
|
|
int smtSerialNumberKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
smtSerialNumberKeys = new String[smtSerialNumberKeysSize];
|
|
for (int i=0; i<smtSerialNumberKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("smtSerialNumberKeys[" + i + "] (String): "));
|
|
smtSerialNumberKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for smtSerialNumberValues: "));
|
|
int smtSerialNumberValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
smtSerialNumberValues = new String[smtSerialNumberValuesSize];
|
|
for (int i=0; i<smtSerialNumberValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("smtSerialNumberValues[" + i + "] (String): "));
|
|
smtSerialNumberValues[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for smtEventKeys: "));
|
|
int smtEventKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
smtEventKeys = new String[smtEventKeysSize];
|
|
for (int i=0; i<smtEventKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("smtEventKeys[" + i + "] (String): "));
|
|
smtEventKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for smtEventValues: "));
|
|
int smtEventValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
smtEventValues = new String[smtEventValuesSize];
|
|
for (int i=0; i<smtEventValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("smtEventValues[" + i + "] (String): "));
|
|
smtEventValues[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for smtPlacementKeys: "));
|
|
int smtPlacementKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
smtPlacementKeys = new String[smtPlacementKeysSize];
|
|
for (int i=0; i<smtPlacementKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("smtPlacementKeys[" + i + "] (String): "));
|
|
smtPlacementKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for smtPlacementValues: "));
|
|
int smtPlacementValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
smtPlacementValues = new String[smtPlacementValuesSize];
|
|
for (int i=0; i<smtPlacementValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("smtPlacementValues[" + i + "] (String): "));
|
|
smtPlacementValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.smtSetupData(sessionContext, stationNumber, functionMode, smtSetupHeaderKeys, smtSetupHeaderValues, out smtSetupHeaderResultValues, smtSerialNumberKeys, smtSerialNumberValues, out smtSerialNumberResultValues, smtEventKeys, smtEventValues, out smtEventResultValues, smtPlacementKeys, smtPlacementValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; smtSetupHeaderResultValues != null && i<smtSetupHeaderResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("smtSetupHeaderResultValues[" + i + "]: ") + "<" + smtSetupHeaderResultValues[i] + ">");
|
|
}
|
|
for (int i=0; smtSerialNumberResultValues != null && i<smtSerialNumberResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("smtSerialNumberResultValues[" + i + "]: ") + "<" + smtSerialNumberResultValues[i] + ">");
|
|
}
|
|
for (int i=0; smtEventResultValues != null && i<smtEventResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("smtEventResultValues[" + i + "]: ") + "<" + smtEventResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_smtCheckMaterialBin
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "smtCheckMaterialBin"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String[] materialBinUploadKeys
|
|
/// in String[] materialBinUploadValues
|
|
/// out String[] materialBinResultValues
|
|
/// </para>
|
|
public static void test_smtCheckMaterialBin()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String[] materialBinUploadKeys = null;
|
|
String[] materialBinUploadValues = null;
|
|
String[] materialBinResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for materialBinUploadKeys: "));
|
|
int materialBinUploadKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
materialBinUploadKeys = new String[materialBinUploadKeysSize];
|
|
for (int i=0; i<materialBinUploadKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("materialBinUploadKeys[" + i + "] (String): "));
|
|
materialBinUploadKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for materialBinUploadValues: "));
|
|
int materialBinUploadValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
materialBinUploadValues = new String[materialBinUploadValuesSize];
|
|
for (int i=0; i<materialBinUploadValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("materialBinUploadValues[" + i + "] (String): "));
|
|
materialBinUploadValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.smtCheckMaterialBin(sessionContext, stationNumber, materialBinUploadKeys, materialBinUploadValues, out materialBinResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; materialBinResultValues != null && i<materialBinResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("materialBinResultValues[" + i + "]: ") + "<" + materialBinResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_smtSerialNumberCheckIn
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "smtSerialNumberCheckIn"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String[] serialNoCheckUploadKeys
|
|
/// in String[] serialNoCheckUploadValues
|
|
/// out String[] serialNoCheckResultValues
|
|
/// in String[] logInfoUploadKeys
|
|
/// in String[] logInfoUploadValues
|
|
/// out String[] logInfoResultValues
|
|
/// in String[] serialNumberStateResultKeys
|
|
/// out String[] serialNumberStateResultValues
|
|
/// in String[] recipeResultKeys
|
|
/// out String[] recipeResultValues
|
|
/// </para>
|
|
public static void test_smtSerialNumberCheckIn()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String[] serialNoCheckUploadKeys = null;
|
|
String[] serialNoCheckUploadValues = null;
|
|
String[] serialNoCheckResultValues = null;
|
|
String[] logInfoUploadKeys = null;
|
|
String[] logInfoUploadValues = null;
|
|
String[] logInfoResultValues = null;
|
|
String[] serialNumberStateResultKeys = null;
|
|
String[] serialNumberStateResultValues = null;
|
|
String[] recipeResultKeys = null;
|
|
String[] recipeResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for serialNoCheckUploadKeys: "));
|
|
int serialNoCheckUploadKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
serialNoCheckUploadKeys = new String[serialNoCheckUploadKeysSize];
|
|
for (int i=0; i<serialNoCheckUploadKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("serialNoCheckUploadKeys[" + i + "] (String): "));
|
|
serialNoCheckUploadKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for serialNoCheckUploadValues: "));
|
|
int serialNoCheckUploadValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
serialNoCheckUploadValues = new String[serialNoCheckUploadValuesSize];
|
|
for (int i=0; i<serialNoCheckUploadValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("serialNoCheckUploadValues[" + i + "] (String): "));
|
|
serialNoCheckUploadValues[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for logInfoUploadKeys: "));
|
|
int logInfoUploadKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
logInfoUploadKeys = new String[logInfoUploadKeysSize];
|
|
for (int i=0; i<logInfoUploadKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("logInfoUploadKeys[" + i + "] (String): "));
|
|
logInfoUploadKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for logInfoUploadValues: "));
|
|
int logInfoUploadValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
logInfoUploadValues = new String[logInfoUploadValuesSize];
|
|
for (int i=0; i<logInfoUploadValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("logInfoUploadValues[" + i + "] (String): "));
|
|
logInfoUploadValues[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for serialNumberStateResultKeys: "));
|
|
int serialNumberStateResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
serialNumberStateResultKeys = new String[serialNumberStateResultKeysSize];
|
|
for (int i=0; i<serialNumberStateResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("serialNumberStateResultKeys[" + i + "] (String): "));
|
|
serialNumberStateResultKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for recipeResultKeys: "));
|
|
int recipeResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
recipeResultKeys = new String[recipeResultKeysSize];
|
|
for (int i=0; i<recipeResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("recipeResultKeys[" + i + "] (String): "));
|
|
recipeResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.smtSerialNumberCheckIn(sessionContext, stationNumber, serialNoCheckUploadKeys, serialNoCheckUploadValues, out serialNoCheckResultValues, logInfoUploadKeys, logInfoUploadValues, out logInfoResultValues, serialNumberStateResultKeys, out serialNumberStateResultValues, recipeResultKeys, out recipeResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; serialNoCheckResultValues != null && i<serialNoCheckResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("serialNoCheckResultValues[" + i + "]: ") + "<" + serialNoCheckResultValues[i] + ">");
|
|
}
|
|
for (int i=0; logInfoResultValues != null && i<logInfoResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("logInfoResultValues[" + i + "]: ") + "<" + logInfoResultValues[i] + ">");
|
|
}
|
|
for (int i=0; serialNumberStateResultValues != null && i<serialNumberStateResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("serialNumberStateResultValues[" + i + "]: ") + "<" + serialNumberStateResultValues[i] + ">");
|
|
}
|
|
for (int i=0; recipeResultValues != null && i<recipeResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("recipeResultValues[" + i + "]: ") + "<" + recipeResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_trUploadTestplanResult
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "trUploadTestplanResult"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String serialNumber
|
|
/// in String serialNumberPos
|
|
/// in long bookDate
|
|
/// in String[] workStepKeys
|
|
/// in String[] workStepValues
|
|
/// out String[] workStepResults
|
|
/// in String[] varUploadKeys
|
|
/// in String[] varUploadValues
|
|
/// out String[] varUploadResults
|
|
/// in String[] varFailUploadKeys
|
|
/// in String[] varFailUploadValues
|
|
/// out String[] varFailUploadResults
|
|
/// in String[] attribUploadKeys
|
|
/// in String[] attribUploadValues
|
|
/// out String[] attribUploadResult
|
|
/// in String[] attribFailUploadKeys
|
|
/// in String[] attribFailUploadValues
|
|
/// out String[] attribFailUploadResults
|
|
/// </para>
|
|
public static void test_trUploadTestplanResult()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String serialNumber = "";
|
|
String serialNumberPos = "";
|
|
long bookDate = 0;
|
|
String[] workStepKeys = null;
|
|
String[] workStepValues = null;
|
|
String[] workStepResults = null;
|
|
String[] varUploadKeys = null;
|
|
String[] varUploadValues = null;
|
|
String[] varUploadResults = null;
|
|
String[] varFailUploadKeys = null;
|
|
String[] varFailUploadValues = null;
|
|
String[] varFailUploadResults = null;
|
|
String[] attribUploadKeys = null;
|
|
String[] attribUploadValues = null;
|
|
String[] attribUploadResult = null;
|
|
String[] attribFailUploadKeys = null;
|
|
String[] attribFailUploadValues = null;
|
|
String[] attribFailUploadResults = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumber (String): "));
|
|
serialNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumberPos (String): "));
|
|
serialNumberPos = getInput();
|
|
Console.Write(fillWithSpace("bookDate (long): "));
|
|
bookDate = Int64.Parse(getInput());
|
|
Console.Write(fillWithSpace("Enter size for workStepKeys: "));
|
|
int workStepKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
workStepKeys = new String[workStepKeysSize];
|
|
for (int i=0; i<workStepKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("workStepKeys[" + i + "] (String): "));
|
|
workStepKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for workStepValues: "));
|
|
int workStepValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
workStepValues = new String[workStepValuesSize];
|
|
for (int i=0; i<workStepValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("workStepValues[" + i + "] (String): "));
|
|
workStepValues[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for varUploadKeys: "));
|
|
int varUploadKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
varUploadKeys = new String[varUploadKeysSize];
|
|
for (int i=0; i<varUploadKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("varUploadKeys[" + i + "] (String): "));
|
|
varUploadKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for varUploadValues: "));
|
|
int varUploadValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
varUploadValues = new String[varUploadValuesSize];
|
|
for (int i=0; i<varUploadValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("varUploadValues[" + i + "] (String): "));
|
|
varUploadValues[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for varFailUploadKeys: "));
|
|
int varFailUploadKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
varFailUploadKeys = new String[varFailUploadKeysSize];
|
|
for (int i=0; i<varFailUploadKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("varFailUploadKeys[" + i + "] (String): "));
|
|
varFailUploadKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for varFailUploadValues: "));
|
|
int varFailUploadValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
varFailUploadValues = new String[varFailUploadValuesSize];
|
|
for (int i=0; i<varFailUploadValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("varFailUploadValues[" + i + "] (String): "));
|
|
varFailUploadValues[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for attribUploadKeys: "));
|
|
int attribUploadKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
attribUploadKeys = new String[attribUploadKeysSize];
|
|
for (int i=0; i<attribUploadKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("attribUploadKeys[" + i + "] (String): "));
|
|
attribUploadKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for attribUploadValues: "));
|
|
int attribUploadValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
attribUploadValues = new String[attribUploadValuesSize];
|
|
for (int i=0; i<attribUploadValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("attribUploadValues[" + i + "] (String): "));
|
|
attribUploadValues[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for attribFailUploadKeys: "));
|
|
int attribFailUploadKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
attribFailUploadKeys = new String[attribFailUploadKeysSize];
|
|
for (int i=0; i<attribFailUploadKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("attribFailUploadKeys[" + i + "] (String): "));
|
|
attribFailUploadKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for attribFailUploadValues: "));
|
|
int attribFailUploadValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
attribFailUploadValues = new String[attribFailUploadValuesSize];
|
|
for (int i=0; i<attribFailUploadValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("attribFailUploadValues[" + i + "] (String): "));
|
|
attribFailUploadValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.trUploadTestplanResult(sessionContext, stationNumber, serialNumber, serialNumberPos, bookDate, workStepKeys, workStepValues, out workStepResults, varUploadKeys, varUploadValues, out varUploadResults, varFailUploadKeys, varFailUploadValues, out varFailUploadResults, attribUploadKeys, attribUploadValues, out attribUploadResult, attribFailUploadKeys, attribFailUploadValues, out attribFailUploadResults);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; workStepResults != null && i<workStepResults.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("workStepResults[" + i + "]: ") + "<" + workStepResults[i] + ">");
|
|
}
|
|
for (int i=0; varUploadResults != null && i<varUploadResults.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("varUploadResults[" + i + "]: ") + "<" + varUploadResults[i] + ">");
|
|
}
|
|
for (int i=0; varFailUploadResults != null && i<varFailUploadResults.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("varFailUploadResults[" + i + "]: ") + "<" + varFailUploadResults[i] + ">");
|
|
}
|
|
for (int i=0; attribUploadResult != null && i<attribUploadResult.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("attribUploadResult[" + i + "]: ") + "<" + attribUploadResult[i] + ">");
|
|
}
|
|
for (int i=0; attribFailUploadResults != null && i<attribFailUploadResults.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("attribFailUploadResults[" + i + "]: ") + "<" + attribFailUploadResults[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_trCheckMergedPartsForSerialNumberComplete
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "trCheckMergedPartsForSerialNumberComplete"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String serialNumber
|
|
/// in int serialNumberPos
|
|
/// in int allMergedPartsVisible
|
|
/// in int checkMultipleBoard
|
|
/// in String[] mergePartsResultKeys
|
|
/// out String[] mergePartsResultValues
|
|
/// </para>
|
|
public static void test_trCheckMergedPartsForSerialNumberComplete()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String serialNumber = "";
|
|
int serialNumberPos = 0;
|
|
int allMergedPartsVisible = 0;
|
|
int checkMultipleBoard = 0;
|
|
String[] mergePartsResultKeys = null;
|
|
String[] mergePartsResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumber (String): "));
|
|
serialNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumberPos (int): "));
|
|
serialNumberPos = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("allMergedPartsVisible (int): "));
|
|
allMergedPartsVisible = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("checkMultipleBoard (int): "));
|
|
checkMultipleBoard = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("Enter size for mergePartsResultKeys: "));
|
|
int mergePartsResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
mergePartsResultKeys = new String[mergePartsResultKeysSize];
|
|
for (int i=0; i<mergePartsResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("mergePartsResultKeys[" + i + "] (String): "));
|
|
mergePartsResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.trCheckMergedPartsForSerialNumberComplete(sessionContext, stationNumber, serialNumber, serialNumberPos, allMergedPartsVisible, checkMultipleBoard, mergePartsResultKeys, out mergePartsResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; mergePartsResultValues != null && i<mergePartsResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("mergePartsResultValues[" + i + "]: ") + "<" + mergePartsResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_trCheckMergedPartsForSerialNumber
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "trCheckMergedPartsForSerialNumber"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] mergedPartsFilters
|
|
/// in String[] mergePartsResultKeys
|
|
/// out String[] mergePartsResultValues
|
|
/// </para>
|
|
public static void test_trCheckMergedPartsForSerialNumber()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] mergedPartsFilters = null;
|
|
String[] mergePartsResultKeys = null;
|
|
String[] mergePartsResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for mergedPartsFilters: "));
|
|
int mergedPartsFiltersSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
mergedPartsFilters = new KeyValue[mergedPartsFiltersSize];
|
|
for (int i=0; i<mergedPartsFiltersSize; i++)
|
|
{
|
|
mergedPartsFilters[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("mergedPartsFilters[" + i + "] .key (String): "));
|
|
mergedPartsFilters[i].key = getInput();
|
|
Console.Write(fillWithSpace("mergedPartsFilters[" + i + "] .value (String): "));
|
|
mergedPartsFilters[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for mergePartsResultKeys: "));
|
|
int mergePartsResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
mergePartsResultKeys = new String[mergePartsResultKeysSize];
|
|
for (int i=0; i<mergePartsResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("mergePartsResultKeys[" + i + "] (String): "));
|
|
mergePartsResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.trCheckMergedPartsForSerialNumber(sessionContext, stationNumber, mergedPartsFilters, mergePartsResultKeys, out mergePartsResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; mergePartsResultValues != null && i<mergePartsResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("mergePartsResultValues[" + i + "]: ") + "<" + mergePartsResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_trGetMergeParts
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "trGetMergeParts"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String serialNumber
|
|
/// in String serialNumberPos
|
|
/// in int resolveDirection
|
|
/// in int resolveLevel
|
|
/// in String[] mergePartsResultKeys
|
|
/// out String[] mergePartsResultValues
|
|
/// </para>
|
|
public static void test_trGetMergeParts()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String serialNumber = "";
|
|
String serialNumberPos = "";
|
|
int resolveDirection = 0;
|
|
int resolveLevel = 0;
|
|
String[] mergePartsResultKeys = null;
|
|
String[] mergePartsResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumber (String): "));
|
|
serialNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumberPos (String): "));
|
|
serialNumberPos = getInput();
|
|
Console.Write(fillWithSpace("resolveDirection (int): "));
|
|
resolveDirection = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("resolveLevel (int): "));
|
|
resolveLevel = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("Enter size for mergePartsResultKeys: "));
|
|
int mergePartsResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
mergePartsResultKeys = new String[mergePartsResultKeysSize];
|
|
for (int i=0; i<mergePartsResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("mergePartsResultKeys[" + i + "] (String): "));
|
|
mergePartsResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.trGetMergeParts(sessionContext, stationNumber, serialNumber, serialNumberPos, resolveDirection, resolveLevel, mergePartsResultKeys, out mergePartsResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; mergePartsResultValues != null && i<mergePartsResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("mergePartsResultValues[" + i + "]: ") + "<" + mergePartsResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_trCheckSerialNumberState
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "trCheckSerialNumberState"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in int processLayer
|
|
/// in int checkMultiBoard
|
|
/// in String serialNumber
|
|
/// in String serialNumberPos
|
|
/// in String[] serialNumberStateResultKeys
|
|
/// out String[] serialNumberStateResultValues
|
|
/// </para>
|
|
public static void test_trCheckSerialNumberState()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
int processLayer = 0;
|
|
int checkMultiBoard = 0;
|
|
String serialNumber = "";
|
|
String serialNumberPos = "";
|
|
String[] serialNumberStateResultKeys = null;
|
|
String[] serialNumberStateResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("processLayer (int): "));
|
|
processLayer = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("checkMultiBoard (int): "));
|
|
checkMultiBoard = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("serialNumber (String): "));
|
|
serialNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumberPos (String): "));
|
|
serialNumberPos = getInput();
|
|
Console.Write(fillWithSpace("Enter size for serialNumberStateResultKeys: "));
|
|
int serialNumberStateResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
serialNumberStateResultKeys = new String[serialNumberStateResultKeysSize];
|
|
for (int i=0; i<serialNumberStateResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("serialNumberStateResultKeys[" + i + "] (String): "));
|
|
serialNumberStateResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.trCheckSerialNumberState(sessionContext, stationNumber, processLayer, checkMultiBoard, serialNumber, serialNumberPos, serialNumberStateResultKeys, out serialNumberStateResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; serialNumberStateResultValues != null && i<serialNumberStateResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("serialNumberStateResultValues[" + i + "]: ") + "<" + serialNumberStateResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_trVerifyMerge
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "trVerifyMerge"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String serialNumberSlave
|
|
/// in String serialNumberSlavePos
|
|
/// in String serialNumberMaster
|
|
/// in String serialNumberMasterPos
|
|
/// in int checkMultiBoard
|
|
/// out SerialNumberStateData[] serialNumberStateDataArray
|
|
/// </para>
|
|
public static void test_trVerifyMerge()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String serialNumberSlave = "";
|
|
String serialNumberSlavePos = "";
|
|
String serialNumberMaster = "";
|
|
String serialNumberMasterPos = "";
|
|
int checkMultiBoard = 0;
|
|
SerialNumberStateData[] serialNumberStateDataArray = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumberSlave (String): "));
|
|
serialNumberSlave = getInput();
|
|
Console.Write(fillWithSpace("serialNumberSlavePos (String): "));
|
|
serialNumberSlavePos = getInput();
|
|
Console.Write(fillWithSpace("serialNumberMaster (String): "));
|
|
serialNumberMaster = getInput();
|
|
Console.Write(fillWithSpace("serialNumberMasterPos (String): "));
|
|
serialNumberMasterPos = getInput();
|
|
Console.Write(fillWithSpace("checkMultiBoard (int): "));
|
|
checkMultiBoard = Int32.Parse(getInput());
|
|
|
|
// call imsapi function
|
|
result = imsapi.trVerifyMerge(sessionContext, stationNumber, serialNumberSlave, serialNumberSlavePos, serialNumberMaster, serialNumberMasterPos, checkMultiBoard, out serialNumberStateDataArray);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; serialNumberStateDataArray != null && i<serialNumberStateDataArray.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("serialNumberStateDataArray[" + i + "].serialNumberSlave: ") + "<" + serialNumberStateDataArray[i].serialNumberSlave + ">");
|
|
Console.WriteLine(fillWithSpace("serialNumberStateDataArray[" + i + "].serialNumberSlavePos: ") + "<" + serialNumberStateDataArray[i].serialNumberSlavePos + ">");
|
|
Console.WriteLine(fillWithSpace("serialNumberStateDataArray[" + i + "].state: ") + "<" + serialNumberStateDataArray[i].state + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_trVerifyMergeProduct
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "trVerifyMergeProduct"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String partNumber
|
|
/// in int bomVersion
|
|
/// in String bomIndex
|
|
/// in String serialNumberSlave
|
|
/// in int level
|
|
/// </para>
|
|
public static void test_trVerifyMergeProduct()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String partNumber = "";
|
|
int bomVersion = 0;
|
|
String bomIndex = "";
|
|
String serialNumberSlave = "";
|
|
int level = 0;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("partNumber (String): "));
|
|
partNumber = getInput();
|
|
Console.Write(fillWithSpace("bomVersion (int): "));
|
|
bomVersion = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("bomIndex (String): "));
|
|
bomIndex = getInput();
|
|
Console.Write(fillWithSpace("serialNumberSlave (String): "));
|
|
serialNumberSlave = getInput();
|
|
Console.Write(fillWithSpace("level (int): "));
|
|
level = Int32.Parse(getInput());
|
|
|
|
// call imsapi function
|
|
result = imsapi.trVerifyMergeProduct(sessionContext, stationNumber, partNumber, bomVersion, bomIndex, serialNumberSlave, level);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_trChangeWorkOrder
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "trChangeWorkOrder"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in int lineFlag
|
|
/// in String[] workorderResultKeys
|
|
/// out String[] workorderResultValues
|
|
/// </para>
|
|
public static void test_trChangeWorkOrder()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
int lineFlag = 0;
|
|
String[] workorderResultKeys = null;
|
|
String[] workorderResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("lineFlag (int): "));
|
|
lineFlag = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("Enter size for workorderResultKeys: "));
|
|
int workorderResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
workorderResultKeys = new String[workorderResultKeysSize];
|
|
for (int i=0; i<workorderResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("workorderResultKeys[" + i + "] (String): "));
|
|
workorderResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.trChangeWorkOrder(sessionContext, stationNumber, lineFlag, workorderResultKeys, out workorderResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; workorderResultValues != null && i<workorderResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("workorderResultValues[" + i + "]: ") + "<" + workorderResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_trGetStationSetting
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "trGetStationSetting"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String[] stationSettingResultKeys
|
|
/// out String[] stationSettingResultValues
|
|
/// </para>
|
|
public static void test_trGetStationSetting()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String[] stationSettingResultKeys = null;
|
|
String[] stationSettingResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for stationSettingResultKeys: "));
|
|
int stationSettingResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
stationSettingResultKeys = new String[stationSettingResultKeysSize];
|
|
for (int i=0; i<stationSettingResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("stationSettingResultKeys[" + i + "] (String): "));
|
|
stationSettingResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.trGetStationSetting(sessionContext, stationNumber, stationSettingResultKeys, out stationSettingResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; stationSettingResultValues != null && i<stationSettingResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("stationSettingResultValues[" + i + "]: ") + "<" + stationSettingResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_trGetSerialNumberInfo
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "trGetSerialNumberInfo"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String serialNumber
|
|
/// in String serialNumberPos
|
|
/// in String[] serialNumberResultKeys
|
|
/// out String[] serialNumberResultValues
|
|
/// </para>
|
|
public static void test_trGetSerialNumberInfo()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String serialNumber = "";
|
|
String serialNumberPos = "";
|
|
String[] serialNumberResultKeys = null;
|
|
String[] serialNumberResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumber (String): "));
|
|
serialNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumberPos (String): "));
|
|
serialNumberPos = getInput();
|
|
Console.Write(fillWithSpace("Enter size for serialNumberResultKeys: "));
|
|
int serialNumberResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
serialNumberResultKeys = new String[serialNumberResultKeysSize];
|
|
for (int i=0; i<serialNumberResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("serialNumberResultKeys[" + i + "] (String): "));
|
|
serialNumberResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.trGetSerialNumberInfo(sessionContext, stationNumber, serialNumber, serialNumberPos, serialNumberResultKeys, out serialNumberResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; serialNumberResultValues != null && i<serialNumberResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("serialNumberResultValues[" + i + "]: ") + "<" + serialNumberResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_trGetSerialNumberUploadInfo
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "trGetSerialNumberUploadInfo"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in int processLayer
|
|
/// in String serialNumber
|
|
/// in String serialNumberPos
|
|
/// in int checkProcessStep
|
|
/// in String[] uploadInfoResultKeys
|
|
/// out String[] uploadInfoResultValues
|
|
/// </para>
|
|
public static void test_trGetSerialNumberUploadInfo()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
int processLayer = 0;
|
|
String serialNumber = "";
|
|
String serialNumberPos = "";
|
|
int checkProcessStep = 0;
|
|
String[] uploadInfoResultKeys = null;
|
|
String[] uploadInfoResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("processLayer (int): "));
|
|
processLayer = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("serialNumber (String): "));
|
|
serialNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumberPos (String): "));
|
|
serialNumberPos = getInput();
|
|
Console.Write(fillWithSpace("checkProcessStep (int): "));
|
|
checkProcessStep = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("Enter size for uploadInfoResultKeys: "));
|
|
int uploadInfoResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
uploadInfoResultKeys = new String[uploadInfoResultKeysSize];
|
|
for (int i=0; i<uploadInfoResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("uploadInfoResultKeys[" + i + "] (String): "));
|
|
uploadInfoResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.trGetSerialNumberUploadInfo(sessionContext, stationNumber, processLayer, serialNumber, serialNumberPos, checkProcessStep, uploadInfoResultKeys, out uploadInfoResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; uploadInfoResultValues != null && i<uploadInfoResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("uploadInfoResultValues[" + i + "]: ") + "<" + uploadInfoResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_trMergeParts
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "trMergeParts"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in int processLayer
|
|
/// in int duplicateSerialNumber
|
|
/// in String serialNumberMaster
|
|
/// in String serialNumberMasterPos
|
|
/// in String serialNumberSlave
|
|
/// in String serialNumberSlavePos
|
|
/// </para>
|
|
public static void test_trMergeParts()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
int processLayer = 0;
|
|
int duplicateSerialNumber = 0;
|
|
String serialNumberMaster = "";
|
|
String serialNumberMasterPos = "";
|
|
String serialNumberSlave = "";
|
|
String serialNumberSlavePos = "";
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("processLayer (int): "));
|
|
processLayer = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("duplicateSerialNumber (int): "));
|
|
duplicateSerialNumber = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("serialNumberMaster (String): "));
|
|
serialNumberMaster = getInput();
|
|
Console.Write(fillWithSpace("serialNumberMasterPos (String): "));
|
|
serialNumberMasterPos = getInput();
|
|
Console.Write(fillWithSpace("serialNumberSlave (String): "));
|
|
serialNumberSlave = getInput();
|
|
Console.Write(fillWithSpace("serialNumberSlavePos (String): "));
|
|
serialNumberSlavePos = getInput();
|
|
|
|
// call imsapi function
|
|
result = imsapi.trMergeParts(sessionContext, stationNumber, processLayer, duplicateSerialNumber, serialNumberMaster, serialNumberMasterPos, serialNumberSlave, serialNumberSlavePos);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_trRemoveMergeParts
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "trRemoveMergeParts"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in int processLayer
|
|
/// in String serialNumberSlave
|
|
/// in String serialNumberSlavePos
|
|
/// in String textInfo
|
|
/// </para>
|
|
public static void test_trRemoveMergeParts()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
int processLayer = 0;
|
|
String serialNumberSlave = "";
|
|
String serialNumberSlavePos = "";
|
|
String textInfo = "";
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("processLayer (int): "));
|
|
processLayer = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("serialNumberSlave (String): "));
|
|
serialNumberSlave = getInput();
|
|
Console.Write(fillWithSpace("serialNumberSlavePos (String): "));
|
|
serialNumberSlavePos = getInput();
|
|
Console.Write(fillWithSpace("textInfo (String): "));
|
|
textInfo = getInput();
|
|
|
|
// call imsapi function
|
|
result = imsapi.trRemoveMergeParts(sessionContext, stationNumber, processLayer, serialNumberSlave, serialNumberSlavePos, textInfo);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_trGetSerialNumberBySerialNumberRef
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "trGetSerialNumberBySerialNumberRef"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String serialNumberRef
|
|
/// in String serialNumberRefPos
|
|
/// out SerialNumberData[] serialNumberArray
|
|
/// </para>
|
|
public static void test_trGetSerialNumberBySerialNumberRef()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String serialNumberRef = "";
|
|
String serialNumberRefPos = "";
|
|
SerialNumberData[] serialNumberArray = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumberRef (String): "));
|
|
serialNumberRef = getInput();
|
|
Console.Write(fillWithSpace("serialNumberRefPos (String): "));
|
|
serialNumberRefPos = getInput();
|
|
|
|
// call imsapi function
|
|
result = imsapi.trGetSerialNumberBySerialNumberRef(sessionContext, stationNumber, serialNumberRef, serialNumberRefPos, out serialNumberArray);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; serialNumberArray != null && i<serialNumberArray.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("serialNumberArray[" + i + "].serialNumber: ") + "<" + serialNumberArray[i].serialNumber + ">");
|
|
Console.WriteLine(fillWithSpace("serialNumberArray[" + i + "].serialNumberPos: ") + "<" + serialNumberArray[i].serialNumberPos + ">");
|
|
Console.WriteLine(fillWithSpace("serialNumberArray[" + i + "].serialNumberOld: ") + "<" + serialNumberArray[i].serialNumberOld + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_trSwitchSerialNumber
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "trSwitchSerialNumber"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String serialNumberRef
|
|
/// in String serialNumberRefPos
|
|
/// inout SwitchSerialNumberData[] serialNumberArray
|
|
/// </para>
|
|
public static void test_trSwitchSerialNumber()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String serialNumberRef = "";
|
|
String serialNumberRefPos = "";
|
|
SwitchSerialNumberData[] serialNumberArray = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumberRef (String): "));
|
|
serialNumberRef = getInput();
|
|
Console.Write(fillWithSpace("serialNumberRefPos (String): "));
|
|
serialNumberRefPos = getInput();
|
|
Console.Write(fillWithSpace("Enter size for serialNumberArray: "));
|
|
int serialNumberArraySize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
serialNumberArray = new SwitchSerialNumberData[serialNumberArraySize];
|
|
for (int i=0; i<serialNumberArraySize; i++)
|
|
{
|
|
serialNumberArray[i] = new SwitchSerialNumberData();
|
|
Console.Write(fillWithSpace("serialNumberArray[" + i + "] .index (int): "));
|
|
serialNumberArray[i].index = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("serialNumberArray[" + i + "] .serialNumberNew (String): "));
|
|
serialNumberArray[i].serialNumberNew = getInput();
|
|
Console.Write(fillWithSpace("serialNumberArray[" + i + "] .serialNumberPos (String): "));
|
|
serialNumberArray[i].serialNumberPos = getInput();
|
|
Console.Write(fillWithSpace("serialNumberArray[" + i + "] .serialNumberAct (String): "));
|
|
serialNumberArray[i].serialNumberAct = getInput();
|
|
Console.Write(fillWithSpace("serialNumberArray[" + i + "] .returnCode (int): "));
|
|
serialNumberArray[i].returnCode = Int32.Parse(getInput());
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.trSwitchSerialNumber(sessionContext, stationNumber, serialNumberRef, serialNumberRefPos, ref serialNumberArray);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; serialNumberArray != null && i<serialNumberArray.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("serialNumberArray[" + i + "].index: ") + "<" + serialNumberArray[i].index + ">");
|
|
Console.WriteLine(fillWithSpace("serialNumberArray[" + i + "].serialNumberNew: ") + "<" + serialNumberArray[i].serialNumberNew + ">");
|
|
Console.WriteLine(fillWithSpace("serialNumberArray[" + i + "].serialNumberPos: ") + "<" + serialNumberArray[i].serialNumberPos + ">");
|
|
Console.WriteLine(fillWithSpace("serialNumberArray[" + i + "].serialNumberAct: ") + "<" + serialNumberArray[i].serialNumberAct + ">");
|
|
Console.WriteLine(fillWithSpace("serialNumberArray[" + i + "].returnCode: ") + "<" + serialNumberArray[i].returnCode + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_trUploadState
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "trUploadState"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in int processLayer
|
|
/// in String serialNumberRef
|
|
/// in String serialNumberRefPos
|
|
/// in int serialNumberState
|
|
/// in int duplicateSerialNumber
|
|
/// in long bookDate
|
|
/// in float cycleTime
|
|
/// in String[] serialNumberUploadKeys
|
|
/// in String[] serialNumberUploadValues
|
|
/// out String[] serialNumberResultValues
|
|
/// </para>
|
|
public static void test_trUploadState()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
int processLayer = 0;
|
|
String serialNumberRef = "";
|
|
String serialNumberRefPos = "";
|
|
int serialNumberState = 0;
|
|
int duplicateSerialNumber = 0;
|
|
long bookDate = 0;
|
|
float cycleTime = 0.0f;
|
|
String[] serialNumberUploadKeys = null;
|
|
String[] serialNumberUploadValues = null;
|
|
String[] serialNumberResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("processLayer (int): "));
|
|
processLayer = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("serialNumberRef (String): "));
|
|
serialNumberRef = getInput();
|
|
Console.Write(fillWithSpace("serialNumberRefPos (String): "));
|
|
serialNumberRefPos = getInput();
|
|
Console.Write(fillWithSpace("serialNumberState (int): "));
|
|
serialNumberState = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("duplicateSerialNumber (int): "));
|
|
duplicateSerialNumber = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("bookDate (long): "));
|
|
bookDate = Int64.Parse(getInput());
|
|
Console.Write(fillWithSpace("cycleTime (float): "));
|
|
cycleTime = Single.Parse(getInput());
|
|
Console.Write(fillWithSpace("Enter size for serialNumberUploadKeys: "));
|
|
int serialNumberUploadKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
serialNumberUploadKeys = new String[serialNumberUploadKeysSize];
|
|
for (int i=0; i<serialNumberUploadKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("serialNumberUploadKeys[" + i + "] (String): "));
|
|
serialNumberUploadKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for serialNumberUploadValues: "));
|
|
int serialNumberUploadValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
serialNumberUploadValues = new String[serialNumberUploadValuesSize];
|
|
for (int i=0; i<serialNumberUploadValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("serialNumberUploadValues[" + i + "] (String): "));
|
|
serialNumberUploadValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.trUploadState(sessionContext, stationNumber, processLayer, serialNumberRef, serialNumberRefPos, serialNumberState, duplicateSerialNumber, bookDate, cycleTime, serialNumberUploadKeys, serialNumberUploadValues, out serialNumberResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; serialNumberResultValues != null && i<serialNumberResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("serialNumberResultValues[" + i + "]: ") + "<" + serialNumberResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_trGetNextSerialNumber
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "trGetNextSerialNumber"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String workOrderNumber
|
|
/// in String partNumber
|
|
/// in int numberOfRecords
|
|
/// out SerialNumberData[] serialNumberArray
|
|
/// </para>
|
|
public static void test_trGetNextSerialNumber()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String workOrderNumber = "";
|
|
String partNumber = "";
|
|
int numberOfRecords = 0;
|
|
SerialNumberData[] serialNumberArray = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("workOrderNumber (String): "));
|
|
workOrderNumber = getInput();
|
|
Console.Write(fillWithSpace("partNumber (String): "));
|
|
partNumber = getInput();
|
|
Console.Write(fillWithSpace("numberOfRecords (int): "));
|
|
numberOfRecords = Int32.Parse(getInput());
|
|
|
|
// call imsapi function
|
|
result = imsapi.trGetNextSerialNumber(sessionContext, stationNumber, workOrderNumber, partNumber, numberOfRecords, out serialNumberArray);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; serialNumberArray != null && i<serialNumberArray.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("serialNumberArray[" + i + "].serialNumber: ") + "<" + serialNumberArray[i].serialNumber + ">");
|
|
Console.WriteLine(fillWithSpace("serialNumberArray[" + i + "].serialNumberPos: ") + "<" + serialNumberArray[i].serialNumberPos + ">");
|
|
Console.WriteLine(fillWithSpace("serialNumberArray[" + i + "].serialNumberOld: ") + "<" + serialNumberArray[i].serialNumberOld + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_trUploadFailureAndResultData
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "trUploadFailureAndResultData"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in int processLayer
|
|
/// in String serialNumberRef
|
|
/// in String serialNumberRefPos
|
|
/// in int serialNumberState
|
|
/// in int duplicateSerialNumber
|
|
/// in float cycleTime
|
|
/// in long bookDate
|
|
/// in String[] measureKeys
|
|
/// in String[] measureValues
|
|
/// out String[] measureResultValues
|
|
/// in String[] failureKeys
|
|
/// in String[] failureValues
|
|
/// out String[] failureResultValues
|
|
/// in String[] failureSlipKeys
|
|
/// in String[] failureSlipValues
|
|
/// out String[] failureSlipResultValues
|
|
/// </para>
|
|
public static void test_trUploadFailureAndResultData()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
int processLayer = 0;
|
|
String serialNumberRef = "";
|
|
String serialNumberRefPos = "";
|
|
int serialNumberState = 0;
|
|
int duplicateSerialNumber = 0;
|
|
float cycleTime = 0.0f;
|
|
long bookDate = 0;
|
|
String[] measureKeys = null;
|
|
String[] measureValues = null;
|
|
String[] measureResultValues = null;
|
|
String[] failureKeys = null;
|
|
String[] failureValues = null;
|
|
String[] failureResultValues = null;
|
|
String[] failureSlipKeys = null;
|
|
String[] failureSlipValues = null;
|
|
String[] failureSlipResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("processLayer (int): "));
|
|
processLayer = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("serialNumberRef (String): "));
|
|
serialNumberRef = getInput();
|
|
Console.Write(fillWithSpace("serialNumberRefPos (String): "));
|
|
serialNumberRefPos = getInput();
|
|
Console.Write(fillWithSpace("serialNumberState (int): "));
|
|
serialNumberState = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("duplicateSerialNumber (int): "));
|
|
duplicateSerialNumber = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("cycleTime (float): "));
|
|
cycleTime = Single.Parse(getInput());
|
|
Console.Write(fillWithSpace("bookDate (long): "));
|
|
bookDate = Int64.Parse(getInput());
|
|
Console.Write(fillWithSpace("Enter size for measureKeys: "));
|
|
int measureKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
measureKeys = new String[measureKeysSize];
|
|
for (int i=0; i<measureKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("measureKeys[" + i + "] (String): "));
|
|
measureKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for measureValues: "));
|
|
int measureValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
measureValues = new String[measureValuesSize];
|
|
for (int i=0; i<measureValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("measureValues[" + i + "] (String): "));
|
|
measureValues[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for failureKeys: "));
|
|
int failureKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
failureKeys = new String[failureKeysSize];
|
|
for (int i=0; i<failureKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("failureKeys[" + i + "] (String): "));
|
|
failureKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for failureValues: "));
|
|
int failureValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
failureValues = new String[failureValuesSize];
|
|
for (int i=0; i<failureValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("failureValues[" + i + "] (String): "));
|
|
failureValues[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for failureSlipKeys: "));
|
|
int failureSlipKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
failureSlipKeys = new String[failureSlipKeysSize];
|
|
for (int i=0; i<failureSlipKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("failureSlipKeys[" + i + "] (String): "));
|
|
failureSlipKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for failureSlipValues: "));
|
|
int failureSlipValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
failureSlipValues = new String[failureSlipValuesSize];
|
|
for (int i=0; i<failureSlipValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("failureSlipValues[" + i + "] (String): "));
|
|
failureSlipValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.trUploadFailureAndResultData(sessionContext, stationNumber, processLayer, serialNumberRef, serialNumberRefPos, serialNumberState, duplicateSerialNumber, cycleTime, bookDate, measureKeys, measureValues, out measureResultValues, failureKeys, failureValues, out failureResultValues, failureSlipKeys, failureSlipValues, out failureSlipResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; measureResultValues != null && i<measureResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("measureResultValues[" + i + "]: ") + "<" + measureResultValues[i] + ">");
|
|
}
|
|
for (int i=0; failureResultValues != null && i<failureResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("failureResultValues[" + i + "]: ") + "<" + failureResultValues[i] + ">");
|
|
}
|
|
for (int i=0; failureSlipResultValues != null && i<failureSlipResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("failureSlipResultValues[" + i + "]: ") + "<" + failureSlipResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_trGetSerialNumberHistoryData
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "trGetSerialNumberHistoryData"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String serialNumber
|
|
/// in String serialNumberPos
|
|
/// in int processLayer
|
|
/// in int desolvingSerialNumber
|
|
/// in int desolvingLevel
|
|
/// in String[] bookingResultKeys
|
|
/// out String[] bookingResultValues
|
|
/// in String[] failureDataResultKeys
|
|
/// out String[] failureDataResultValues
|
|
/// in String[] failureSlipDataResultKeys
|
|
/// out String[] failureSlipDataResultValues
|
|
/// in String[] measureDataResultKeys
|
|
/// out String[] measureDataResultValues
|
|
/// out String workOrderNumber
|
|
/// out String partNumber
|
|
/// out String customerPartNumber
|
|
/// out String partDesc
|
|
/// out String quantity
|
|
/// out long lastReportDate
|
|
/// out String lotNumber
|
|
/// out int isLocked
|
|
/// </para>
|
|
public static void test_trGetSerialNumberHistoryData()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String serialNumber = "";
|
|
String serialNumberPos = "";
|
|
int processLayer = 0;
|
|
int desolvingSerialNumber = 0;
|
|
int desolvingLevel = 0;
|
|
String[] bookingResultKeys = null;
|
|
String[] bookingResultValues = null;
|
|
String[] failureDataResultKeys = null;
|
|
String[] failureDataResultValues = null;
|
|
String[] failureSlipDataResultKeys = null;
|
|
String[] failureSlipDataResultValues = null;
|
|
String[] measureDataResultKeys = null;
|
|
String[] measureDataResultValues = null;
|
|
String workOrderNumber = "";
|
|
String partNumber = "";
|
|
String customerPartNumber = "";
|
|
String partDesc = "";
|
|
String quantity = "";
|
|
long lastReportDate = 0;
|
|
String lotNumber = "";
|
|
int isLocked = 0;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumber (String): "));
|
|
serialNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumberPos (String): "));
|
|
serialNumberPos = getInput();
|
|
Console.Write(fillWithSpace("processLayer (int): "));
|
|
processLayer = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("desolvingSerialNumber (int): "));
|
|
desolvingSerialNumber = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("desolvingLevel (int): "));
|
|
desolvingLevel = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("Enter size for bookingResultKeys: "));
|
|
int bookingResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
bookingResultKeys = new String[bookingResultKeysSize];
|
|
for (int i=0; i<bookingResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("bookingResultKeys[" + i + "] (String): "));
|
|
bookingResultKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for failureDataResultKeys: "));
|
|
int failureDataResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
failureDataResultKeys = new String[failureDataResultKeysSize];
|
|
for (int i=0; i<failureDataResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("failureDataResultKeys[" + i + "] (String): "));
|
|
failureDataResultKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for failureSlipDataResultKeys: "));
|
|
int failureSlipDataResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
failureSlipDataResultKeys = new String[failureSlipDataResultKeysSize];
|
|
for (int i=0; i<failureSlipDataResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("failureSlipDataResultKeys[" + i + "] (String): "));
|
|
failureSlipDataResultKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for measureDataResultKeys: "));
|
|
int measureDataResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
measureDataResultKeys = new String[measureDataResultKeysSize];
|
|
for (int i=0; i<measureDataResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("measureDataResultKeys[" + i + "] (String): "));
|
|
measureDataResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.trGetSerialNumberHistoryData(sessionContext, stationNumber, serialNumber, serialNumberPos, processLayer, desolvingSerialNumber, desolvingLevel, bookingResultKeys, out bookingResultValues, failureDataResultKeys, out failureDataResultValues, failureSlipDataResultKeys, out failureSlipDataResultValues, measureDataResultKeys, out measureDataResultValues, out workOrderNumber, out partNumber, out customerPartNumber, out partDesc, out quantity, out lastReportDate, out lotNumber, out isLocked);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; bookingResultValues != null && i<bookingResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("bookingResultValues[" + i + "]: ") + "<" + bookingResultValues[i] + ">");
|
|
}
|
|
for (int i=0; failureDataResultValues != null && i<failureDataResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("failureDataResultValues[" + i + "]: ") + "<" + failureDataResultValues[i] + ">");
|
|
}
|
|
for (int i=0; failureSlipDataResultValues != null && i<failureSlipDataResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("failureSlipDataResultValues[" + i + "]: ") + "<" + failureSlipDataResultValues[i] + ">");
|
|
}
|
|
for (int i=0; measureDataResultValues != null && i<measureDataResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("measureDataResultValues[" + i + "]: ") + "<" + measureDataResultValues[i] + ">");
|
|
}
|
|
Console.WriteLine(fillWithSpace("workOrderNumber: ") + "<" + workOrderNumber + ">");
|
|
Console.WriteLine(fillWithSpace("partNumber: ") + "<" + partNumber + ">");
|
|
Console.WriteLine(fillWithSpace("customerPartNumber: ") + "<" + customerPartNumber + ">");
|
|
Console.WriteLine(fillWithSpace("partDesc: ") + "<" + partDesc + ">");
|
|
Console.WriteLine(fillWithSpace("quantity: ") + "<" + quantity + ">");
|
|
Console.WriteLine(fillWithSpace("lastReportDate: ") + "<" + lastReportDate + ">");
|
|
Console.WriteLine(fillWithSpace("lotNumber: ") + "<" + lotNumber + ">");
|
|
Console.WriteLine(fillWithSpace("isLocked: ") + "<" + isLocked + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_trUploadPmQuantity
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "trUploadPmQuantity"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in int processLayer
|
|
/// in String workOrderNumber
|
|
/// in double passQty
|
|
/// in double failQty
|
|
/// in double scrapQty
|
|
/// </para>
|
|
public static void test_trUploadPmQuantity()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
int processLayer = 0;
|
|
String workOrderNumber = "";
|
|
double passQty = 0.0;
|
|
double failQty = 0.0;
|
|
double scrapQty = 0.0;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("processLayer (int): "));
|
|
processLayer = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("workOrderNumber (String): "));
|
|
workOrderNumber = getInput();
|
|
Console.Write(fillWithSpace("passQty (double): "));
|
|
passQty = Double.Parse(getInput());
|
|
Console.Write(fillWithSpace("failQty (double): "));
|
|
failQty = Double.Parse(getInput());
|
|
Console.Write(fillWithSpace("scrapQty (double): "));
|
|
scrapQty = Double.Parse(getInput());
|
|
|
|
// call imsapi function
|
|
result = imsapi.trUploadPmQuantity(sessionContext, stationNumber, processLayer, workOrderNumber, passQty, failQty, scrapQty);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_trGetProductQuantity
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "trGetProductQuantity"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in int processLayer
|
|
/// in int functionMode
|
|
/// in KeyValue[] workorderFilters
|
|
/// in KeyValue[] filterDataArray
|
|
/// in String[] productQuantityResultKeys
|
|
/// out String[] productQuantityResultValues
|
|
/// </para>
|
|
public static void test_trGetProductQuantity()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
int processLayer = 0;
|
|
int functionMode = 0;
|
|
KeyValue[] workorderFilters = null;
|
|
KeyValue[] filterDataArray = null;
|
|
String[] productQuantityResultKeys = null;
|
|
String[] productQuantityResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("processLayer (int): "));
|
|
processLayer = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("functionMode (int): "));
|
|
functionMode = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("Enter size for workorderFilters: "));
|
|
int workorderFiltersSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
workorderFilters = new KeyValue[workorderFiltersSize];
|
|
for (int i=0; i<workorderFiltersSize; i++)
|
|
{
|
|
workorderFilters[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("workorderFilters[" + i + "] .key (String): "));
|
|
workorderFilters[i].key = getInput();
|
|
Console.Write(fillWithSpace("workorderFilters[" + i + "] .value (String): "));
|
|
workorderFilters[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for filterDataArray: "));
|
|
int filterDataArraySize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
filterDataArray = new KeyValue[filterDataArraySize];
|
|
for (int i=0; i<filterDataArraySize; i++)
|
|
{
|
|
filterDataArray[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("filterDataArray[" + i + "] .key (String): "));
|
|
filterDataArray[i].key = getInput();
|
|
Console.Write(fillWithSpace("filterDataArray[" + i + "] .value (String): "));
|
|
filterDataArray[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for productQuantityResultKeys: "));
|
|
int productQuantityResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
productQuantityResultKeys = new String[productQuantityResultKeysSize];
|
|
for (int i=0; i<productQuantityResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("productQuantityResultKeys[" + i + "] (String): "));
|
|
productQuantityResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.trGetProductQuantity(sessionContext, stationNumber, processLayer, functionMode, workorderFilters, filterDataArray, productQuantityResultKeys, out productQuantityResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; productQuantityResultValues != null && i<productQuantityResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("productQuantityResultValues[" + i + "]: ") + "<" + productQuantityResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_trUploadResultDataAndRecipe
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "trUploadResultDataAndRecipe"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in int processLayer
|
|
/// in int recipeVersionId
|
|
/// in String serialNumberRef
|
|
/// in String serialNumberRefPos
|
|
/// in int serialNumberState
|
|
/// in int duplicateSerialNumber
|
|
/// in long bookDate
|
|
/// in float cycleTime
|
|
/// in int recipeVersionMode
|
|
/// in String[] resultUploadKeys
|
|
/// in String[] resultUploadValues
|
|
/// out String[] resultValues
|
|
/// </para>
|
|
public static void test_trUploadResultDataAndRecipe()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
int processLayer = 0;
|
|
int recipeVersionId = 0;
|
|
String serialNumberRef = "";
|
|
String serialNumberRefPos = "";
|
|
int serialNumberState = 0;
|
|
int duplicateSerialNumber = 0;
|
|
long bookDate = 0;
|
|
float cycleTime = 0.0f;
|
|
int recipeVersionMode = 0;
|
|
String[] resultUploadKeys = null;
|
|
String[] resultUploadValues = null;
|
|
String[] resultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("processLayer (int): "));
|
|
processLayer = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("recipeVersionId (int): "));
|
|
recipeVersionId = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("serialNumberRef (String): "));
|
|
serialNumberRef = getInput();
|
|
Console.Write(fillWithSpace("serialNumberRefPos (String): "));
|
|
serialNumberRefPos = getInput();
|
|
Console.Write(fillWithSpace("serialNumberState (int): "));
|
|
serialNumberState = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("duplicateSerialNumber (int): "));
|
|
duplicateSerialNumber = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("bookDate (long): "));
|
|
bookDate = Int64.Parse(getInput());
|
|
Console.Write(fillWithSpace("cycleTime (float): "));
|
|
cycleTime = Single.Parse(getInput());
|
|
Console.Write(fillWithSpace("recipeVersionMode (int): "));
|
|
recipeVersionMode = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("Enter size for resultUploadKeys: "));
|
|
int resultUploadKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
resultUploadKeys = new String[resultUploadKeysSize];
|
|
for (int i=0; i<resultUploadKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("resultUploadKeys[" + i + "] (String): "));
|
|
resultUploadKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for resultUploadValues: "));
|
|
int resultUploadValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
resultUploadValues = new String[resultUploadValuesSize];
|
|
for (int i=0; i<resultUploadValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("resultUploadValues[" + i + "] (String): "));
|
|
resultUploadValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.trUploadResultDataAndRecipe(sessionContext, stationNumber, processLayer, recipeVersionId, serialNumberRef, serialNumberRefPos, serialNumberState, duplicateSerialNumber, bookDate, cycleTime, recipeVersionMode, resultUploadKeys, resultUploadValues, out resultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; resultValues != null && i<resultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("resultValues[" + i + "]: ") + "<" + resultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_trUploadStationResult
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "trUploadStationResult"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String partNumber
|
|
/// in int bomVersion
|
|
/// in String bomIndex
|
|
/// in String bomVersionErp
|
|
/// in String workOrderNumber
|
|
/// in long bookDate
|
|
/// in int serialUnitTrace
|
|
/// in String[] stationResultUploadKeys
|
|
/// in String[] stationResultUploadValues
|
|
/// out String[] stationResultValues
|
|
/// </para>
|
|
public static void test_trUploadStationResult()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String partNumber = "";
|
|
int bomVersion = 0;
|
|
String bomIndex = "";
|
|
String bomVersionErp = "";
|
|
String workOrderNumber = "";
|
|
long bookDate = 0;
|
|
int serialUnitTrace = 0;
|
|
String[] stationResultUploadKeys = null;
|
|
String[] stationResultUploadValues = null;
|
|
String[] stationResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("partNumber (String): "));
|
|
partNumber = getInput();
|
|
Console.Write(fillWithSpace("bomVersion (int): "));
|
|
bomVersion = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("bomIndex (String): "));
|
|
bomIndex = getInput();
|
|
Console.Write(fillWithSpace("bomVersionErp (String): "));
|
|
bomVersionErp = getInput();
|
|
Console.Write(fillWithSpace("workOrderNumber (String): "));
|
|
workOrderNumber = getInput();
|
|
Console.Write(fillWithSpace("bookDate (long): "));
|
|
bookDate = Int64.Parse(getInput());
|
|
Console.Write(fillWithSpace("serialUnitTrace (int): "));
|
|
serialUnitTrace = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("Enter size for stationResultUploadKeys: "));
|
|
int stationResultUploadKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
stationResultUploadKeys = new String[stationResultUploadKeysSize];
|
|
for (int i=0; i<stationResultUploadKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("stationResultUploadKeys[" + i + "] (String): "));
|
|
stationResultUploadKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for stationResultUploadValues: "));
|
|
int stationResultUploadValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
stationResultUploadValues = new String[stationResultUploadValuesSize];
|
|
for (int i=0; i<stationResultUploadValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("stationResultUploadValues[" + i + "] (String): "));
|
|
stationResultUploadValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.trUploadStationResult(sessionContext, stationNumber, partNumber, bomVersion, bomIndex, bomVersionErp, workOrderNumber, bookDate, serialUnitTrace, stationResultUploadKeys, stationResultUploadValues, out stationResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; stationResultValues != null && i<stationResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("stationResultValues[" + i + "]: ") + "<" + stationResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_trAssignSerialNumberMergeAndUploadState
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "trAssignSerialNumberMergeAndUploadState"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in int processLayer
|
|
/// in String serialNumberRef
|
|
/// in String serialNumberRefPos
|
|
/// in SerialNumberData[] serialNumberArray
|
|
/// in String serialNumberSlave
|
|
/// in int doUploadState
|
|
/// in int serialNumberState
|
|
/// in int multiplePanel
|
|
/// </para>
|
|
public static void test_trAssignSerialNumberMergeAndUploadState()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
int processLayer = 0;
|
|
String serialNumberRef = "";
|
|
String serialNumberRefPos = "";
|
|
SerialNumberData[] serialNumberArray = null;
|
|
String serialNumberSlave = "";
|
|
int doUploadState = 0;
|
|
int serialNumberState = 0;
|
|
int multiplePanel = 0;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("processLayer (int): "));
|
|
processLayer = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("serialNumberRef (String): "));
|
|
serialNumberRef = getInput();
|
|
Console.Write(fillWithSpace("serialNumberRefPos (String): "));
|
|
serialNumberRefPos = getInput();
|
|
Console.Write(fillWithSpace("Enter size for serialNumberArray: "));
|
|
int serialNumberArraySize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
serialNumberArray = new SerialNumberData[serialNumberArraySize];
|
|
for (int i=0; i<serialNumberArraySize; i++)
|
|
{
|
|
serialNumberArray[i] = new SerialNumberData();
|
|
Console.Write(fillWithSpace("serialNumberArray[" + i + "] .serialNumber (String): "));
|
|
serialNumberArray[i].serialNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumberArray[" + i + "] .serialNumberPos (String): "));
|
|
serialNumberArray[i].serialNumberPos = getInput();
|
|
Console.Write(fillWithSpace("serialNumberArray[" + i + "] .serialNumberOld (String): "));
|
|
serialNumberArray[i].serialNumberOld = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("serialNumberSlave (String): "));
|
|
serialNumberSlave = getInput();
|
|
Console.Write(fillWithSpace("doUploadState (int): "));
|
|
doUploadState = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("serialNumberState (int): "));
|
|
serialNumberState = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("multiplePanel (int): "));
|
|
multiplePanel = Int32.Parse(getInput());
|
|
|
|
// call imsapi function
|
|
result = imsapi.trAssignSerialNumberMergeAndUploadState(sessionContext, stationNumber, processLayer, serialNumberRef, serialNumberRefPos, serialNumberArray, serialNumberSlave, doUploadState, serialNumberState, multiplePanel);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_trAssignSerialNumberForProductOrWorkOrder
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "trAssignSerialNumberForProductOrWorkOrder"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String workOrderNumber
|
|
/// in String partNumber
|
|
/// in String bomVersion
|
|
/// in String serialNumberRef
|
|
/// in String serialNumberRefPos
|
|
/// in int processLayer
|
|
/// in SerialNumberData[] serialNumberArray
|
|
/// in int activateWorkOrder
|
|
/// </para>
|
|
public static void test_trAssignSerialNumberForProductOrWorkOrder()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String workOrderNumber = "";
|
|
String partNumber = "";
|
|
String bomVersion = "";
|
|
String serialNumberRef = "";
|
|
String serialNumberRefPos = "";
|
|
int processLayer = 0;
|
|
SerialNumberData[] serialNumberArray = null;
|
|
int activateWorkOrder = 0;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("workOrderNumber (String): "));
|
|
workOrderNumber = getInput();
|
|
Console.Write(fillWithSpace("partNumber (String): "));
|
|
partNumber = getInput();
|
|
Console.Write(fillWithSpace("bomVersion (String): "));
|
|
bomVersion = getInput();
|
|
Console.Write(fillWithSpace("serialNumberRef (String): "));
|
|
serialNumberRef = getInput();
|
|
Console.Write(fillWithSpace("serialNumberRefPos (String): "));
|
|
serialNumberRefPos = getInput();
|
|
Console.Write(fillWithSpace("processLayer (int): "));
|
|
processLayer = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("Enter size for serialNumberArray: "));
|
|
int serialNumberArraySize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
serialNumberArray = new SerialNumberData[serialNumberArraySize];
|
|
for (int i=0; i<serialNumberArraySize; i++)
|
|
{
|
|
serialNumberArray[i] = new SerialNumberData();
|
|
Console.Write(fillWithSpace("serialNumberArray[" + i + "] .serialNumber (String): "));
|
|
serialNumberArray[i].serialNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumberArray[" + i + "] .serialNumberPos (String): "));
|
|
serialNumberArray[i].serialNumberPos = getInput();
|
|
Console.Write(fillWithSpace("serialNumberArray[" + i + "] .serialNumberOld (String): "));
|
|
serialNumberArray[i].serialNumberOld = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("activateWorkOrder (int): "));
|
|
activateWorkOrder = Int32.Parse(getInput());
|
|
|
|
// call imsapi function
|
|
result = imsapi.trAssignSerialNumberForProductOrWorkOrder(sessionContext, stationNumber, workOrderNumber, partNumber, bomVersion, serialNumberRef, serialNumberRefPos, processLayer, serialNumberArray, activateWorkOrder);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_trActivateWorkOrder
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "trActivateWorkOrder"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String workOrderNumber
|
|
/// in String serialNumber
|
|
/// in String serialNumberPos
|
|
/// in int processLayer
|
|
/// in int flag
|
|
/// </para>
|
|
public static void test_trActivateWorkOrder()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String workOrderNumber = "";
|
|
String serialNumber = "";
|
|
String serialNumberPos = "";
|
|
int processLayer = 0;
|
|
int flag = 0;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("workOrderNumber (String): "));
|
|
workOrderNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumber (String): "));
|
|
serialNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumberPos (String): "));
|
|
serialNumberPos = getInput();
|
|
Console.Write(fillWithSpace("processLayer (int): "));
|
|
processLayer = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("flag (int): "));
|
|
flag = Int32.Parse(getInput());
|
|
|
|
// call imsapi function
|
|
result = imsapi.trActivateWorkOrder(sessionContext, stationNumber, workOrderNumber, serialNumber, serialNumberPos, processLayer, flag);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_trTestPaa
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "trTestPaa"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String serialNumber
|
|
/// in int processLayer
|
|
/// in int model
|
|
/// out int resultPaa
|
|
/// out String infoText
|
|
/// </para>
|
|
public static void test_trTestPaa()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String serialNumber = "";
|
|
int processLayer = 0;
|
|
int model = 0;
|
|
int resultPaa = 0;
|
|
String infoText = "";
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumber (String): "));
|
|
serialNumber = getInput();
|
|
Console.Write(fillWithSpace("processLayer (int): "));
|
|
processLayer = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("model (int): "));
|
|
model = Int32.Parse(getInput());
|
|
|
|
// call imsapi function
|
|
result = imsapi.trTestPaa(sessionContext, stationNumber, serialNumber, processLayer, model, out resultPaa, out infoText);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
Console.WriteLine(fillWithSpace("resultPaa: ") + "<" + resultPaa + ">");
|
|
Console.WriteLine(fillWithSpace("infoText: ") + "<" + infoText + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_trTestSpa
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "trTestSpa"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String serialNumber
|
|
/// in int processLayer
|
|
/// in int model
|
|
/// out int resultCp
|
|
/// out int resultCpk
|
|
/// out String infoText
|
|
/// </para>
|
|
public static void test_trTestSpa()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String serialNumber = "";
|
|
int processLayer = 0;
|
|
int model = 0;
|
|
int resultCp = 0;
|
|
int resultCpk = 0;
|
|
String infoText = "";
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumber (String): "));
|
|
serialNumber = getInput();
|
|
Console.Write(fillWithSpace("processLayer (int): "));
|
|
processLayer = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("model (int): "));
|
|
model = Int32.Parse(getInput());
|
|
|
|
// call imsapi function
|
|
result = imsapi.trTestSpa(sessionContext, stationNumber, serialNumber, processLayer, model, out resultCp, out resultCpk, out infoText);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
Console.WriteLine(fillWithSpace("resultCp: ") + "<" + resultCp + ">");
|
|
Console.WriteLine(fillWithSpace("resultCpk: ") + "<" + resultCpk + ">");
|
|
Console.WriteLine(fillWithSpace("infoText: ") + "<" + infoText + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_trGetWorkOrderForStation
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "trGetWorkOrderForStation"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] workorderFilter
|
|
/// in String[] workorderResultKeys
|
|
/// out String[] workorderResultValues
|
|
/// </para>
|
|
public static void test_trGetWorkOrderForStation()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] workorderFilter = null;
|
|
String[] workorderResultKeys = null;
|
|
String[] workorderResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for workorderFilter: "));
|
|
int workorderFilterSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
workorderFilter = new KeyValue[workorderFilterSize];
|
|
for (int i=0; i<workorderFilterSize; i++)
|
|
{
|
|
workorderFilter[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("workorderFilter[" + i + "] .key (String): "));
|
|
workorderFilter[i].key = getInput();
|
|
Console.Write(fillWithSpace("workorderFilter[" + i + "] .value (String): "));
|
|
workorderFilter[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for workorderResultKeys: "));
|
|
int workorderResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
workorderResultKeys = new String[workorderResultKeysSize];
|
|
for (int i=0; i<workorderResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("workorderResultKeys[" + i + "] (String): "));
|
|
workorderResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.trGetWorkOrderForStation(sessionContext, stationNumber, workorderFilter, workorderResultKeys, out workorderResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; workorderResultValues != null && i<workorderResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("workorderResultValues[" + i + "]: ") + "<" + workorderResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_trGetResultDataForSerialNumber
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "trGetResultDataForSerialNumber"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in int processLayer
|
|
/// in String serialNumber
|
|
/// in int serialNumberPos
|
|
/// in String type
|
|
/// in String name
|
|
/// in int allProductEntries
|
|
/// in int onlyLastEntry
|
|
/// in KeyValue[] resultDataFilters
|
|
/// in String[] resultDataKeys
|
|
/// out String[] resultDataValues
|
|
/// </para>
|
|
public static void test_trGetResultDataForSerialNumber()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
int processLayer = 0;
|
|
String serialNumber = "";
|
|
int serialNumberPos = 0;
|
|
String type = "";
|
|
String name = "";
|
|
int allProductEntries = 0;
|
|
int onlyLastEntry = 0;
|
|
KeyValue[] resultDataFilters = null;
|
|
String[] resultDataKeys = null;
|
|
String[] resultDataValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("processLayer (int): "));
|
|
processLayer = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("serialNumber (String): "));
|
|
serialNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumberPos (int): "));
|
|
serialNumberPos = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("type (String): "));
|
|
type = getInput();
|
|
Console.Write(fillWithSpace("name (String): "));
|
|
name = getInput();
|
|
Console.Write(fillWithSpace("allProductEntries (int): "));
|
|
allProductEntries = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("onlyLastEntry (int): "));
|
|
onlyLastEntry = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("Enter size for resultDataFilters: "));
|
|
int resultDataFiltersSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
resultDataFilters = new KeyValue[resultDataFiltersSize];
|
|
for (int i=0; i<resultDataFiltersSize; i++)
|
|
{
|
|
resultDataFilters[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("resultDataFilters[" + i + "] .key (String): "));
|
|
resultDataFilters[i].key = getInput();
|
|
Console.Write(fillWithSpace("resultDataFilters[" + i + "] .value (String): "));
|
|
resultDataFilters[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for resultDataKeys: "));
|
|
int resultDataKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
resultDataKeys = new String[resultDataKeysSize];
|
|
for (int i=0; i<resultDataKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("resultDataKeys[" + i + "] (String): "));
|
|
resultDataKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.trGetResultDataForSerialNumber(sessionContext, stationNumber, processLayer, serialNumber, serialNumberPos, type, name, allProductEntries, onlyLastEntry, resultDataFilters, resultDataKeys, out resultDataValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; resultDataValues != null && i<resultDataValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("resultDataValues[" + i + "]: ") + "<" + resultDataValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_trGetSerialNumberForWorkOrderAndWorkstep
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "trGetSerialNumberForWorkOrderAndWorkstep"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in int processLayer
|
|
/// in String workOrderNumber
|
|
/// in int sequenceType
|
|
/// in int workstepNumber
|
|
/// in int multiplePanel
|
|
/// in int state
|
|
/// in int maxRows
|
|
/// in int confirmFlag
|
|
/// in int sortFlag
|
|
/// in String[] serialNumberResultKeys
|
|
/// out String[] serialNumberResultValues
|
|
/// </para>
|
|
public static void test_trGetSerialNumberForWorkOrderAndWorkstep()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
int processLayer = 0;
|
|
String workOrderNumber = "";
|
|
int sequenceType = 0;
|
|
int workstepNumber = 0;
|
|
int multiplePanel = 0;
|
|
int state = 0;
|
|
int maxRows = 0;
|
|
int confirmFlag = 0;
|
|
int sortFlag = 0;
|
|
String[] serialNumberResultKeys = null;
|
|
String[] serialNumberResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("processLayer (int): "));
|
|
processLayer = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("workOrderNumber (String): "));
|
|
workOrderNumber = getInput();
|
|
Console.Write(fillWithSpace("sequenceType (int): "));
|
|
sequenceType = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("workstepNumber (int): "));
|
|
workstepNumber = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("multiplePanel (int): "));
|
|
multiplePanel = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("state (int): "));
|
|
state = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("maxRows (int): "));
|
|
maxRows = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("confirmFlag (int): "));
|
|
confirmFlag = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("sortFlag (int): "));
|
|
sortFlag = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("Enter size for serialNumberResultKeys: "));
|
|
int serialNumberResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
serialNumberResultKeys = new String[serialNumberResultKeysSize];
|
|
for (int i=0; i<serialNumberResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("serialNumberResultKeys[" + i + "] (String): "));
|
|
serialNumberResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.trGetSerialNumberForWorkOrderAndWorkstep(sessionContext, stationNumber, processLayer, workOrderNumber, sequenceType, workstepNumber, multiplePanel, state, maxRows, confirmFlag, sortFlag, serialNumberResultKeys, out serialNumberResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; serialNumberResultValues != null && i<serialNumberResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("serialNumberResultValues[" + i + "]: ") + "<" + serialNumberResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_trRemoveSerialNumberFromSerialNumberPool
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "trRemoveSerialNumberFromSerialNumberPool"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String serialNumber
|
|
/// in String serialNumberPos
|
|
/// in String serialNumberPoolName
|
|
/// </para>
|
|
public static void test_trRemoveSerialNumberFromSerialNumberPool()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String serialNumber = "";
|
|
String serialNumberPos = "";
|
|
String serialNumberPoolName = "";
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumber (String): "));
|
|
serialNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumberPos (String): "));
|
|
serialNumberPos = getInput();
|
|
Console.Write(fillWithSpace("serialNumberPoolName (String): "));
|
|
serialNumberPoolName = getInput();
|
|
|
|
// call imsapi function
|
|
result = imsapi.trRemoveSerialNumberFromSerialNumberPool(sessionContext, stationNumber, serialNumber, serialNumberPos, serialNumberPoolName);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_trAddSerialNumberToSerialNumberPool
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "trAddSerialNumberToSerialNumberPool"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String serialNumber
|
|
/// in String serialNumberPos
|
|
/// in String serialNumberPoolName
|
|
/// out int state
|
|
/// out String partNumber
|
|
/// out String workOrderNumber
|
|
/// </para>
|
|
public static void test_trAddSerialNumberToSerialNumberPool()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String serialNumber = "";
|
|
String serialNumberPos = "";
|
|
String serialNumberPoolName = "";
|
|
int state = 0;
|
|
String partNumber = "";
|
|
String workOrderNumber = "";
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumber (String): "));
|
|
serialNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumberPos (String): "));
|
|
serialNumberPos = getInput();
|
|
Console.Write(fillWithSpace("serialNumberPoolName (String): "));
|
|
serialNumberPoolName = getInput();
|
|
|
|
// call imsapi function
|
|
result = imsapi.trAddSerialNumberToSerialNumberPool(sessionContext, stationNumber, serialNumber, serialNumberPos, serialNumberPoolName, out state, out partNumber, out workOrderNumber);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
Console.WriteLine(fillWithSpace("state: ") + "<" + state + ">");
|
|
Console.WriteLine(fillWithSpace("partNumber: ") + "<" + partNumber + ">");
|
|
Console.WriteLine(fillWithSpace("workOrderNumber: ") + "<" + workOrderNumber + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_trCreateSerialNumberPool
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "trCreateSerialNumberPool"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String serialNumberPoolName
|
|
/// in String serialNumberPoolDesc
|
|
/// in String changeOrderNumber
|
|
/// in String infoTxt
|
|
/// in int serialNumberPoolType
|
|
/// </para>
|
|
public static void test_trCreateSerialNumberPool()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String serialNumberPoolName = "";
|
|
String serialNumberPoolDesc = "";
|
|
String changeOrderNumber = "";
|
|
String infoTxt = "";
|
|
int serialNumberPoolType = 0;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumberPoolName (String): "));
|
|
serialNumberPoolName = getInput();
|
|
Console.Write(fillWithSpace("serialNumberPoolDesc (String): "));
|
|
serialNumberPoolDesc = getInput();
|
|
Console.Write(fillWithSpace("changeOrderNumber (String): "));
|
|
changeOrderNumber = getInput();
|
|
Console.Write(fillWithSpace("infoTxt (String): "));
|
|
infoTxt = getInput();
|
|
Console.Write(fillWithSpace("serialNumberPoolType (int): "));
|
|
serialNumberPoolType = Int32.Parse(getInput());
|
|
|
|
// call imsapi function
|
|
result = imsapi.trCreateSerialNumberPool(sessionContext, stationNumber, serialNumberPoolName, serialNumberPoolDesc, changeOrderNumber, infoTxt, serialNumberPoolType);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_trDeleteSerialNumberPool
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "trDeleteSerialNumberPool"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String serialNumberPoolName
|
|
/// </para>
|
|
public static void test_trDeleteSerialNumberPool()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String serialNumberPoolName = "";
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumberPoolName (String): "));
|
|
serialNumberPoolName = getInput();
|
|
|
|
// call imsapi function
|
|
result = imsapi.trDeleteSerialNumberPool(sessionContext, stationNumber, serialNumberPoolName);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_trGetSerialNumberPoolInfo
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "trGetSerialNumberPoolInfo"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String serialNumberPoolName
|
|
/// in int workOrderInfo
|
|
/// in String[] poolInfoResultKeys
|
|
/// out String[] poolInfoResultValues
|
|
/// out String changeOrder
|
|
/// out String partNumber
|
|
/// out String erpBomIndex
|
|
/// out String infoTxtChangeOrder
|
|
/// out String infoTxtSnrPool
|
|
/// out int qtyAssignedSerialNumbers
|
|
/// out int qtyIdentifiedSerialNumbers
|
|
/// out int qtyCOAssignedSerialNumbers
|
|
/// out int snrPoolState
|
|
/// out String snrPoolDescription
|
|
/// </para>
|
|
public static void test_trGetSerialNumberPoolInfo()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String serialNumberPoolName = "";
|
|
int workOrderInfo = 0;
|
|
String[] poolInfoResultKeys = null;
|
|
String[] poolInfoResultValues = null;
|
|
String changeOrder = "";
|
|
String partNumber = "";
|
|
String erpBomIndex = "";
|
|
String infoTxtChangeOrder = "";
|
|
String infoTxtSnrPool = "";
|
|
int qtyAssignedSerialNumbers = 0;
|
|
int qtyIdentifiedSerialNumbers = 0;
|
|
int qtyCOAssignedSerialNumbers = 0;
|
|
int snrPoolState = 0;
|
|
String snrPoolDescription = "";
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumberPoolName (String): "));
|
|
serialNumberPoolName = getInput();
|
|
Console.Write(fillWithSpace("workOrderInfo (int): "));
|
|
workOrderInfo = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("Enter size for poolInfoResultKeys: "));
|
|
int poolInfoResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
poolInfoResultKeys = new String[poolInfoResultKeysSize];
|
|
for (int i=0; i<poolInfoResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("poolInfoResultKeys[" + i + "] (String): "));
|
|
poolInfoResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.trGetSerialNumberPoolInfo(sessionContext, stationNumber, serialNumberPoolName, workOrderInfo, poolInfoResultKeys, out poolInfoResultValues, out changeOrder, out partNumber, out erpBomIndex, out infoTxtChangeOrder, out infoTxtSnrPool, out qtyAssignedSerialNumbers, out qtyIdentifiedSerialNumbers, out qtyCOAssignedSerialNumbers, out snrPoolState, out snrPoolDescription);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; poolInfoResultValues != null && i<poolInfoResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("poolInfoResultValues[" + i + "]: ") + "<" + poolInfoResultValues[i] + ">");
|
|
}
|
|
Console.WriteLine(fillWithSpace("changeOrder: ") + "<" + changeOrder + ">");
|
|
Console.WriteLine(fillWithSpace("partNumber: ") + "<" + partNumber + ">");
|
|
Console.WriteLine(fillWithSpace("erpBomIndex: ") + "<" + erpBomIndex + ">");
|
|
Console.WriteLine(fillWithSpace("infoTxtChangeOrder: ") + "<" + infoTxtChangeOrder + ">");
|
|
Console.WriteLine(fillWithSpace("infoTxtSnrPool: ") + "<" + infoTxtSnrPool + ">");
|
|
Console.WriteLine(fillWithSpace("qtyAssignedSerialNumbers: ") + "<" + qtyAssignedSerialNumbers + ">");
|
|
Console.WriteLine(fillWithSpace("qtyIdentifiedSerialNumbers: ") + "<" + qtyIdentifiedSerialNumbers + ">");
|
|
Console.WriteLine(fillWithSpace("qtyCOAssignedSerialNumbers: ") + "<" + qtyCOAssignedSerialNumbers + ">");
|
|
Console.WriteLine(fillWithSpace("snrPoolState: ") + "<" + snrPoolState + ">");
|
|
Console.WriteLine(fillWithSpace("snrPoolDescription: ") + "<" + snrPoolDescription + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_trGetPoolSerialNumber
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "trGetPoolSerialNumber"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String serialNumberPoolName
|
|
/// in String serialNumber
|
|
/// in String serialNumberPos
|
|
/// in int startPosition
|
|
/// in int maxRowCount
|
|
/// in int processingStateFlag
|
|
/// in int snrStateFlag
|
|
/// in String[] poolSerialNumberResultKeys
|
|
/// out String[] poolSerialNumberResultValues
|
|
/// out bool hasMore
|
|
/// out String outSerialNumberPoolName
|
|
/// </para>
|
|
public static void test_trGetPoolSerialNumber()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String serialNumberPoolName = "";
|
|
String serialNumber = "";
|
|
String serialNumberPos = "";
|
|
int startPosition = 0;
|
|
int maxRowCount = 0;
|
|
int processingStateFlag = 0;
|
|
int snrStateFlag = 0;
|
|
String[] poolSerialNumberResultKeys = null;
|
|
String[] poolSerialNumberResultValues = null;
|
|
bool hasMore = false;
|
|
String outSerialNumberPoolName = "";
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumberPoolName (String): "));
|
|
serialNumberPoolName = getInput();
|
|
Console.Write(fillWithSpace("serialNumber (String): "));
|
|
serialNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumberPos (String): "));
|
|
serialNumberPos = getInput();
|
|
Console.Write(fillWithSpace("startPosition (int): "));
|
|
startPosition = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("maxRowCount (int): "));
|
|
maxRowCount = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("processingStateFlag (int): "));
|
|
processingStateFlag = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("snrStateFlag (int): "));
|
|
snrStateFlag = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("Enter size for poolSerialNumberResultKeys: "));
|
|
int poolSerialNumberResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
poolSerialNumberResultKeys = new String[poolSerialNumberResultKeysSize];
|
|
for (int i=0; i<poolSerialNumberResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("poolSerialNumberResultKeys[" + i + "] (String): "));
|
|
poolSerialNumberResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.trGetPoolSerialNumber(sessionContext, stationNumber, serialNumberPoolName, serialNumber, serialNumberPos, startPosition, maxRowCount, processingStateFlag, snrStateFlag, poolSerialNumberResultKeys, out poolSerialNumberResultValues, out hasMore, out outSerialNumberPoolName);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; poolSerialNumberResultValues != null && i<poolSerialNumberResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("poolSerialNumberResultValues[" + i + "]: ") + "<" + poolSerialNumberResultValues[i] + ">");
|
|
}
|
|
Console.WriteLine(fillWithSpace("hasMore: ") + "<" + hasMore + ">");
|
|
Console.WriteLine(fillWithSpace("outSerialNumberPoolName: ") + "<" + outSerialNumberPoolName + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_trGetPools
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "trGetPools"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String serialNumberPoolName
|
|
/// in String changeOrder
|
|
/// in int snrPoolState
|
|
/// in String[] serialNumberPoolResultKeys
|
|
/// out String[] serialNumberPoolResultValues
|
|
/// </para>
|
|
public static void test_trGetPools()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String serialNumberPoolName = "";
|
|
String changeOrder = "";
|
|
int snrPoolState = 0;
|
|
String[] serialNumberPoolResultKeys = null;
|
|
String[] serialNumberPoolResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumberPoolName (String): "));
|
|
serialNumberPoolName = getInput();
|
|
Console.Write(fillWithSpace("changeOrder (String): "));
|
|
changeOrder = getInput();
|
|
Console.Write(fillWithSpace("snrPoolState (int): "));
|
|
snrPoolState = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("Enter size for serialNumberPoolResultKeys: "));
|
|
int serialNumberPoolResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
serialNumberPoolResultKeys = new String[serialNumberPoolResultKeysSize];
|
|
for (int i=0; i<serialNumberPoolResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("serialNumberPoolResultKeys[" + i + "] (String): "));
|
|
serialNumberPoolResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.trGetPools(sessionContext, stationNumber, serialNumberPoolName, changeOrder, snrPoolState, serialNumberPoolResultKeys, out serialNumberPoolResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; serialNumberPoolResultValues != null && i<serialNumberPoolResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("serialNumberPoolResultValues[" + i + "]: ") + "<" + serialNumberPoolResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_trIdentifyPoolSerialNumber
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "trIdentifyPoolSerialNumber"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String serialNumber
|
|
/// in String serialNumberPos
|
|
/// in String serialNumberPoolName
|
|
/// </para>
|
|
public static void test_trIdentifyPoolSerialNumber()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String serialNumber = "";
|
|
String serialNumberPos = "";
|
|
String serialNumberPoolName = "";
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumber (String): "));
|
|
serialNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumberPos (String): "));
|
|
serialNumberPos = getInput();
|
|
Console.Write(fillWithSpace("serialNumberPoolName (String): "));
|
|
serialNumberPoolName = getInput();
|
|
|
|
// call imsapi function
|
|
result = imsapi.trIdentifyPoolSerialNumber(sessionContext, stationNumber, serialNumber, serialNumberPos, serialNumberPoolName);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_trAddSerialNumberToPool
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "trAddSerialNumberToPool"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String serialNumberPoolName
|
|
/// in String[] serialNumberPoolKeys
|
|
/// in String[] serialNumberPoolValues
|
|
/// out String[] serialNumberPoolResults
|
|
/// </para>
|
|
public static void test_trAddSerialNumberToPool()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String serialNumberPoolName = "";
|
|
String[] serialNumberPoolKeys = null;
|
|
String[] serialNumberPoolValues = null;
|
|
String[] serialNumberPoolResults = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumberPoolName (String): "));
|
|
serialNumberPoolName = getInput();
|
|
Console.Write(fillWithSpace("Enter size for serialNumberPoolKeys: "));
|
|
int serialNumberPoolKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
serialNumberPoolKeys = new String[serialNumberPoolKeysSize];
|
|
for (int i=0; i<serialNumberPoolKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("serialNumberPoolKeys[" + i + "] (String): "));
|
|
serialNumberPoolKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for serialNumberPoolValues: "));
|
|
int serialNumberPoolValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
serialNumberPoolValues = new String[serialNumberPoolValuesSize];
|
|
for (int i=0; i<serialNumberPoolValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("serialNumberPoolValues[" + i + "] (String): "));
|
|
serialNumberPoolValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.trAddSerialNumberToPool(sessionContext, stationNumber, serialNumberPoolName, serialNumberPoolKeys, serialNumberPoolValues, out serialNumberPoolResults);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; serialNumberPoolResults != null && i<serialNumberPoolResults.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("serialNumberPoolResults[" + i + "]: ") + "<" + serialNumberPoolResults[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_trChangeSerialNumberPool
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "trChangeSerialNumberPool"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String serialNumberPoolName
|
|
/// in KeyValue[] serialNumberPoolData
|
|
/// </para>
|
|
public static void test_trChangeSerialNumberPool()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String serialNumberPoolName = "";
|
|
KeyValue[] serialNumberPoolData = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumberPoolName (String): "));
|
|
serialNumberPoolName = getInput();
|
|
Console.Write(fillWithSpace("Enter size for serialNumberPoolData: "));
|
|
int serialNumberPoolDataSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
serialNumberPoolData = new KeyValue[serialNumberPoolDataSize];
|
|
for (int i=0; i<serialNumberPoolDataSize; i++)
|
|
{
|
|
serialNumberPoolData[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("serialNumberPoolData[" + i + "] .key (String): "));
|
|
serialNumberPoolData[i].key = getInput();
|
|
Console.Write(fillWithSpace("serialNumberPoolData[" + i + "] .value (String): "));
|
|
serialNumberPoolData[i].value = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.trChangeSerialNumberPool(sessionContext, stationNumber, serialNumberPoolName, serialNumberPoolData);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_trGetTestplanData
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "trGetTestplanData"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String serialNumber
|
|
/// in String serialNumberPos
|
|
/// in int processLayer
|
|
/// in String workorderNumber
|
|
/// in KeyValue[] testplanFilters
|
|
/// in String[] varParamResultKeys
|
|
/// out String[] varParamResultValues
|
|
/// in String[] varFailCodeResultKeys
|
|
/// out String[] varFailCodeResultValues
|
|
/// in String[] attribParamResultKeys
|
|
/// out String[] attribParamResultValues
|
|
/// in String[] attribParamValueResultKeys
|
|
/// out String[] attribParamValueResultValues
|
|
/// in String[] attribFailCodeResultKeys
|
|
/// out String[] attribFailCodeResultValues
|
|
/// </para>
|
|
public static void test_trGetTestplanData()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String serialNumber = "";
|
|
String serialNumberPos = "";
|
|
int processLayer = 0;
|
|
String workorderNumber = "";
|
|
KeyValue[] testplanFilters = null;
|
|
String[] varParamResultKeys = null;
|
|
String[] varParamResultValues = null;
|
|
String[] varFailCodeResultKeys = null;
|
|
String[] varFailCodeResultValues = null;
|
|
String[] attribParamResultKeys = null;
|
|
String[] attribParamResultValues = null;
|
|
String[] attribParamValueResultKeys = null;
|
|
String[] attribParamValueResultValues = null;
|
|
String[] attribFailCodeResultKeys = null;
|
|
String[] attribFailCodeResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumber (String): "));
|
|
serialNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumberPos (String): "));
|
|
serialNumberPos = getInput();
|
|
Console.Write(fillWithSpace("processLayer (int): "));
|
|
processLayer = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("workorderNumber (String): "));
|
|
workorderNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for testplanFilters: "));
|
|
int testplanFiltersSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
testplanFilters = new KeyValue[testplanFiltersSize];
|
|
for (int i=0; i<testplanFiltersSize; i++)
|
|
{
|
|
testplanFilters[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("testplanFilters[" + i + "] .key (String): "));
|
|
testplanFilters[i].key = getInput();
|
|
Console.Write(fillWithSpace("testplanFilters[" + i + "] .value (String): "));
|
|
testplanFilters[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for varParamResultKeys: "));
|
|
int varParamResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
varParamResultKeys = new String[varParamResultKeysSize];
|
|
for (int i=0; i<varParamResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("varParamResultKeys[" + i + "] (String): "));
|
|
varParamResultKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for varFailCodeResultKeys: "));
|
|
int varFailCodeResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
varFailCodeResultKeys = new String[varFailCodeResultKeysSize];
|
|
for (int i=0; i<varFailCodeResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("varFailCodeResultKeys[" + i + "] (String): "));
|
|
varFailCodeResultKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for attribParamResultKeys: "));
|
|
int attribParamResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
attribParamResultKeys = new String[attribParamResultKeysSize];
|
|
for (int i=0; i<attribParamResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("attribParamResultKeys[" + i + "] (String): "));
|
|
attribParamResultKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for attribParamValueResultKeys: "));
|
|
int attribParamValueResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
attribParamValueResultKeys = new String[attribParamValueResultKeysSize];
|
|
for (int i=0; i<attribParamValueResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("attribParamValueResultKeys[" + i + "] (String): "));
|
|
attribParamValueResultKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for attribFailCodeResultKeys: "));
|
|
int attribFailCodeResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
attribFailCodeResultKeys = new String[attribFailCodeResultKeysSize];
|
|
for (int i=0; i<attribFailCodeResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("attribFailCodeResultKeys[" + i + "] (String): "));
|
|
attribFailCodeResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.trGetTestplanData(sessionContext, stationNumber, serialNumber, serialNumberPos, processLayer, workorderNumber, testplanFilters, varParamResultKeys, out varParamResultValues, varFailCodeResultKeys, out varFailCodeResultValues, attribParamResultKeys, out attribParamResultValues, attribParamValueResultKeys, out attribParamValueResultValues, attribFailCodeResultKeys, out attribFailCodeResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; varParamResultValues != null && i<varParamResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("varParamResultValues[" + i + "]: ") + "<" + varParamResultValues[i] + ">");
|
|
}
|
|
for (int i=0; varFailCodeResultValues != null && i<varFailCodeResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("varFailCodeResultValues[" + i + "]: ") + "<" + varFailCodeResultValues[i] + ">");
|
|
}
|
|
for (int i=0; attribParamResultValues != null && i<attribParamResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("attribParamResultValues[" + i + "]: ") + "<" + attribParamResultValues[i] + ">");
|
|
}
|
|
for (int i=0; attribParamValueResultValues != null && i<attribParamValueResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("attribParamValueResultValues[" + i + "]: ") + "<" + attribParamValueResultValues[i] + ">");
|
|
}
|
|
for (int i=0; attribFailCodeResultValues != null && i<attribFailCodeResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("attribFailCodeResultValues[" + i + "]: ") + "<" + attribFailCodeResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_trGetNextProductionStep
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "trGetNextProductionStep"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String serialNumber
|
|
/// in String serialNumberPos
|
|
/// in int functionMode
|
|
/// in int stateCheck
|
|
/// in int confirmFlag
|
|
/// in String[] productionStepResultKeys
|
|
/// out String[] productionStepResultValues
|
|
/// </para>
|
|
public static void test_trGetNextProductionStep()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String serialNumber = "";
|
|
String serialNumberPos = "";
|
|
int functionMode = 0;
|
|
int stateCheck = 0;
|
|
int confirmFlag = 0;
|
|
String[] productionStepResultKeys = null;
|
|
String[] productionStepResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumber (String): "));
|
|
serialNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumberPos (String): "));
|
|
serialNumberPos = getInput();
|
|
Console.Write(fillWithSpace("functionMode (int): "));
|
|
functionMode = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("stateCheck (int): "));
|
|
stateCheck = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("confirmFlag (int): "));
|
|
confirmFlag = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("Enter size for productionStepResultKeys: "));
|
|
int productionStepResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
productionStepResultKeys = new String[productionStepResultKeysSize];
|
|
for (int i=0; i<productionStepResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("productionStepResultKeys[" + i + "] (String): "));
|
|
productionStepResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.trGetNextProductionStep(sessionContext, stationNumber, serialNumber, serialNumberPos, functionMode, stateCheck, confirmFlag, productionStepResultKeys, out productionStepResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; productionStepResultValues != null && i<productionStepResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("productionStepResultValues[" + i + "]: ") + "<" + productionStepResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_trSimulateMerge
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "trSimulateMerge"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String serialNumberMaster
|
|
/// in String serialNumberMasterPos
|
|
/// in String workorderNumberMaster
|
|
/// in String serialNumberSlave
|
|
/// in String serialNumberSlavePos
|
|
/// in String workorderNumberSlave
|
|
/// in String[] simulateMergeResultKeys
|
|
/// out String[] simulateMergeResultValues
|
|
/// </para>
|
|
public static void test_trSimulateMerge()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String serialNumberMaster = "";
|
|
String serialNumberMasterPos = "";
|
|
String workorderNumberMaster = "";
|
|
String serialNumberSlave = "";
|
|
String serialNumberSlavePos = "";
|
|
String workorderNumberSlave = "";
|
|
String[] simulateMergeResultKeys = null;
|
|
String[] simulateMergeResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumberMaster (String): "));
|
|
serialNumberMaster = getInput();
|
|
Console.Write(fillWithSpace("serialNumberMasterPos (String): "));
|
|
serialNumberMasterPos = getInput();
|
|
Console.Write(fillWithSpace("workorderNumberMaster (String): "));
|
|
workorderNumberMaster = getInput();
|
|
Console.Write(fillWithSpace("serialNumberSlave (String): "));
|
|
serialNumberSlave = getInput();
|
|
Console.Write(fillWithSpace("serialNumberSlavePos (String): "));
|
|
serialNumberSlavePos = getInput();
|
|
Console.Write(fillWithSpace("workorderNumberSlave (String): "));
|
|
workorderNumberSlave = getInput();
|
|
Console.Write(fillWithSpace("Enter size for simulateMergeResultKeys: "));
|
|
int simulateMergeResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
simulateMergeResultKeys = new String[simulateMergeResultKeysSize];
|
|
for (int i=0; i<simulateMergeResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("simulateMergeResultKeys[" + i + "] (String): "));
|
|
simulateMergeResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.trSimulateMerge(sessionContext, stationNumber, serialNumberMaster, serialNumberMasterPos, workorderNumberMaster, serialNumberSlave, serialNumberSlavePos, workorderNumberSlave, simulateMergeResultKeys, out simulateMergeResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; simulateMergeResultValues != null && i<simulateMergeResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("simulateMergeResultValues[" + i + "]: ") + "<" + simulateMergeResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_trGetStationResult
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "trGetStationResult"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String workorderNumber
|
|
/// in String partNumber
|
|
/// in int bomVersion
|
|
/// in String bomIndex
|
|
/// in String bomVersionErp
|
|
/// in long fromDate
|
|
/// in long toDate
|
|
/// in String[] measurementNames
|
|
/// in int functionMode
|
|
/// in String[] stationResultKeys
|
|
/// out String[] stationResultValues
|
|
/// </para>
|
|
public static void test_trGetStationResult()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String workorderNumber = "";
|
|
String partNumber = "";
|
|
int bomVersion = 0;
|
|
String bomIndex = "";
|
|
String bomVersionErp = "";
|
|
long fromDate = 0;
|
|
long toDate = 0;
|
|
String[] measurementNames = null;
|
|
int functionMode = 0;
|
|
String[] stationResultKeys = null;
|
|
String[] stationResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("workorderNumber (String): "));
|
|
workorderNumber = getInput();
|
|
Console.Write(fillWithSpace("partNumber (String): "));
|
|
partNumber = getInput();
|
|
Console.Write(fillWithSpace("bomVersion (int): "));
|
|
bomVersion = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("bomIndex (String): "));
|
|
bomIndex = getInput();
|
|
Console.Write(fillWithSpace("bomVersionErp (String): "));
|
|
bomVersionErp = getInput();
|
|
Console.Write(fillWithSpace("fromDate (long): "));
|
|
fromDate = Int64.Parse(getInput());
|
|
Console.Write(fillWithSpace("toDate (long): "));
|
|
toDate = Int64.Parse(getInput());
|
|
Console.Write(fillWithSpace("Enter size for measurementNames: "));
|
|
int measurementNamesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
measurementNames = new String[measurementNamesSize];
|
|
for (int i=0; i<measurementNamesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("measurementNames[" + i + "] (String): "));
|
|
measurementNames[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("functionMode (int): "));
|
|
functionMode = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("Enter size for stationResultKeys: "));
|
|
int stationResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
stationResultKeys = new String[stationResultKeysSize];
|
|
for (int i=0; i<stationResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("stationResultKeys[" + i + "] (String): "));
|
|
stationResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.trGetStationResult(sessionContext, stationNumber, workorderNumber, partNumber, bomVersion, bomIndex, bomVersionErp, fromDate, toDate, measurementNames, functionMode, stationResultKeys, out stationResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; stationResultValues != null && i<stationResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("stationResultValues[" + i + "]: ") + "<" + stationResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_trCheckUserSkill
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "trCheckUserSkill"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in int processLayer
|
|
/// in String userId
|
|
/// in KeyValue[] checkUserSkillFilter
|
|
/// </para>
|
|
public static void test_trCheckUserSkill()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
int processLayer = 0;
|
|
String userId = "";
|
|
KeyValue[] checkUserSkillFilter = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("processLayer (int): "));
|
|
processLayer = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("userId (String): "));
|
|
userId = getInput();
|
|
Console.Write(fillWithSpace("Enter size for checkUserSkillFilter: "));
|
|
int checkUserSkillFilterSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
checkUserSkillFilter = new KeyValue[checkUserSkillFilterSize];
|
|
for (int i=0; i<checkUserSkillFilterSize; i++)
|
|
{
|
|
checkUserSkillFilter[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("checkUserSkillFilter[" + i + "] .key (String): "));
|
|
checkUserSkillFilter[i].key = getInput();
|
|
Console.Write(fillWithSpace("checkUserSkillFilter[" + i + "] .value (String): "));
|
|
checkUserSkillFilter[i].value = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.trCheckUserSkill(sessionContext, stationNumber, processLayer, userId, checkUserSkillFilter);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_trUploadActivity
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "trUploadActivity"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in int processLayer
|
|
/// in String serialNumberRef
|
|
/// in String serialNumberRefPos
|
|
/// in int serialNumberState
|
|
/// in int duplicateSerialNumber
|
|
/// in long bookDate
|
|
/// in float cycleTime
|
|
/// in String[] activityDataKeys
|
|
/// in String[] activityDataValues
|
|
/// out String[] activityDataResults
|
|
/// </para>
|
|
public static void test_trUploadActivity()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
int processLayer = 0;
|
|
String serialNumberRef = "";
|
|
String serialNumberRefPos = "";
|
|
int serialNumberState = 0;
|
|
int duplicateSerialNumber = 0;
|
|
long bookDate = 0;
|
|
float cycleTime = 0.0f;
|
|
String[] activityDataKeys = null;
|
|
String[] activityDataValues = null;
|
|
String[] activityDataResults = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("processLayer (int): "));
|
|
processLayer = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("serialNumberRef (String): "));
|
|
serialNumberRef = getInput();
|
|
Console.Write(fillWithSpace("serialNumberRefPos (String): "));
|
|
serialNumberRefPos = getInput();
|
|
Console.Write(fillWithSpace("serialNumberState (int): "));
|
|
serialNumberState = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("duplicateSerialNumber (int): "));
|
|
duplicateSerialNumber = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("bookDate (long): "));
|
|
bookDate = Int64.Parse(getInput());
|
|
Console.Write(fillWithSpace("cycleTime (float): "));
|
|
cycleTime = Single.Parse(getInput());
|
|
Console.Write(fillWithSpace("Enter size for activityDataKeys: "));
|
|
int activityDataKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
activityDataKeys = new String[activityDataKeysSize];
|
|
for (int i=0; i<activityDataKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("activityDataKeys[" + i + "] (String): "));
|
|
activityDataKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for activityDataValues: "));
|
|
int activityDataValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
activityDataValues = new String[activityDataValuesSize];
|
|
for (int i=0; i<activityDataValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("activityDataValues[" + i + "] (String): "));
|
|
activityDataValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.trUploadActivity(sessionContext, stationNumber, processLayer, serialNumberRef, serialNumberRefPos, serialNumberState, duplicateSerialNumber, bookDate, cycleTime, activityDataKeys, activityDataValues, out activityDataResults);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; activityDataResults != null && i<activityDataResults.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("activityDataResults[" + i + "]: ") + "<" + activityDataResults[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_trGetSerialNumberActivityUploadInfo
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "trGetSerialNumberActivityUploadInfo"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String serialNumberRef
|
|
/// in String serialNumberRefPos
|
|
/// in KeyValue[] activityFilter
|
|
/// in String[] activityDataResultKeys
|
|
/// out String[] activityDataResultValues
|
|
/// </para>
|
|
public static void test_trGetSerialNumberActivityUploadInfo()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String serialNumberRef = "";
|
|
String serialNumberRefPos = "";
|
|
KeyValue[] activityFilter = null;
|
|
String[] activityDataResultKeys = null;
|
|
String[] activityDataResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumberRef (String): "));
|
|
serialNumberRef = getInput();
|
|
Console.Write(fillWithSpace("serialNumberRefPos (String): "));
|
|
serialNumberRefPos = getInput();
|
|
Console.Write(fillWithSpace("Enter size for activityFilter: "));
|
|
int activityFilterSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
activityFilter = new KeyValue[activityFilterSize];
|
|
for (int i=0; i<activityFilterSize; i++)
|
|
{
|
|
activityFilter[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("activityFilter[" + i + "] .key (String): "));
|
|
activityFilter[i].key = getInput();
|
|
Console.Write(fillWithSpace("activityFilter[" + i + "] .value (String): "));
|
|
activityFilter[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for activityDataResultKeys: "));
|
|
int activityDataResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
activityDataResultKeys = new String[activityDataResultKeysSize];
|
|
for (int i=0; i<activityDataResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("activityDataResultKeys[" + i + "] (String): "));
|
|
activityDataResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.trGetSerialNumberActivityUploadInfo(sessionContext, stationNumber, serialNumberRef, serialNumberRefPos, activityFilter, activityDataResultKeys, out activityDataResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; activityDataResultValues != null && i<activityDataResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("activityDataResultValues[" + i + "]: ") + "<" + activityDataResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_trGetTopFailures
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "trGetTopFailures"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] trGetTopFailuresFilter
|
|
/// in String[] topFailuresResultKeys
|
|
/// out String[] topFailuresResultValues
|
|
/// </para>
|
|
public static void test_trGetTopFailures()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] trGetTopFailuresFilter = null;
|
|
String[] topFailuresResultKeys = null;
|
|
String[] topFailuresResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for trGetTopFailuresFilter: "));
|
|
int trGetTopFailuresFilterSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
trGetTopFailuresFilter = new KeyValue[trGetTopFailuresFilterSize];
|
|
for (int i=0; i<trGetTopFailuresFilterSize; i++)
|
|
{
|
|
trGetTopFailuresFilter[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("trGetTopFailuresFilter[" + i + "] .key (String): "));
|
|
trGetTopFailuresFilter[i].key = getInput();
|
|
Console.Write(fillWithSpace("trGetTopFailuresFilter[" + i + "] .value (String): "));
|
|
trGetTopFailuresFilter[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for topFailuresResultKeys: "));
|
|
int topFailuresResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
topFailuresResultKeys = new String[topFailuresResultKeysSize];
|
|
for (int i=0; i<topFailuresResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("topFailuresResultKeys[" + i + "] (String): "));
|
|
topFailuresResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.trGetTopFailures(sessionContext, stationNumber, trGetTopFailuresFilter, topFailuresResultKeys, out topFailuresResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; topFailuresResultValues != null && i<topFailuresResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("topFailuresResultValues[" + i + "]: ") + "<" + topFailuresResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_trGetCapturedRepairHistoryData
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "trGetCapturedRepairHistoryData"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in int processLayer
|
|
/// in KeyValue[] repairHistoryFilter
|
|
/// in String[] failureDataResultKey
|
|
/// in String[] failureSlipDataResultKey
|
|
/// out String[] failureDataResultValues
|
|
/// out String[] failureSlipDataResultValues
|
|
/// </para>
|
|
public static void test_trGetCapturedRepairHistoryData()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
int processLayer = 0;
|
|
KeyValue[] repairHistoryFilter = null;
|
|
String[] failureDataResultKey = null;
|
|
String[] failureSlipDataResultKey = null;
|
|
String[] failureDataResultValues = null;
|
|
String[] failureSlipDataResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("processLayer (int): "));
|
|
processLayer = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("Enter size for repairHistoryFilter: "));
|
|
int repairHistoryFilterSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
repairHistoryFilter = new KeyValue[repairHistoryFilterSize];
|
|
for (int i=0; i<repairHistoryFilterSize; i++)
|
|
{
|
|
repairHistoryFilter[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("repairHistoryFilter[" + i + "] .key (String): "));
|
|
repairHistoryFilter[i].key = getInput();
|
|
Console.Write(fillWithSpace("repairHistoryFilter[" + i + "] .value (String): "));
|
|
repairHistoryFilter[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for failureDataResultKey: "));
|
|
int failureDataResultKeySize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
failureDataResultKey = new String[failureDataResultKeySize];
|
|
for (int i=0; i<failureDataResultKeySize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("failureDataResultKey[" + i + "] (String): "));
|
|
failureDataResultKey[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for failureSlipDataResultKey: "));
|
|
int failureSlipDataResultKeySize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
failureSlipDataResultKey = new String[failureSlipDataResultKeySize];
|
|
for (int i=0; i<failureSlipDataResultKeySize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("failureSlipDataResultKey[" + i + "] (String): "));
|
|
failureSlipDataResultKey[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.trGetCapturedRepairHistoryData(sessionContext, stationNumber, processLayer, repairHistoryFilter, failureDataResultKey, failureSlipDataResultKey, out failureDataResultValues, out failureSlipDataResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; failureDataResultValues != null && i<failureDataResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("failureDataResultValues[" + i + "]: ") + "<" + failureDataResultValues[i] + ">");
|
|
}
|
|
for (int i=0; failureSlipDataResultValues != null && i<failureSlipDataResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("failureSlipDataResultValues[" + i + "]: ") + "<" + failureSlipDataResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_trGetMergeHistory
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "trGetMergeHistory"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] mergedHistoryFilters
|
|
/// in String[] mergedHistoryResultKeys
|
|
/// out String[] mergedHistoryResultValues
|
|
/// </para>
|
|
public static void test_trGetMergeHistory()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] mergedHistoryFilters = null;
|
|
String[] mergedHistoryResultKeys = null;
|
|
String[] mergedHistoryResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for mergedHistoryFilters: "));
|
|
int mergedHistoryFiltersSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
mergedHistoryFilters = new KeyValue[mergedHistoryFiltersSize];
|
|
for (int i=0; i<mergedHistoryFiltersSize; i++)
|
|
{
|
|
mergedHistoryFilters[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("mergedHistoryFilters[" + i + "] .key (String): "));
|
|
mergedHistoryFilters[i].key = getInput();
|
|
Console.Write(fillWithSpace("mergedHistoryFilters[" + i + "] .value (String): "));
|
|
mergedHistoryFilters[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for mergedHistoryResultKeys: "));
|
|
int mergedHistoryResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
mergedHistoryResultKeys = new String[mergedHistoryResultKeysSize];
|
|
for (int i=0; i<mergedHistoryResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("mergedHistoryResultKeys[" + i + "] (String): "));
|
|
mergedHistoryResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.trGetMergeHistory(sessionContext, stationNumber, mergedHistoryFilters, mergedHistoryResultKeys, out mergedHistoryResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; mergedHistoryResultValues != null && i<mergedHistoryResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("mergedHistoryResultValues[" + i + "]: ") + "<" + mergedHistoryResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_trUploadFailuresForMergedParts
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "trUploadFailuresForMergedParts"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] uploadMasterSerialNumberKeys
|
|
/// in String[] uploadSlaveSerialNumberKeys
|
|
/// in String[] uploadSlaveSerialNumberValues
|
|
/// out String[] uploadSlaveSerialNumberResults
|
|
/// in String[] uploadFailuresForSlaveSerialNumberKeys
|
|
/// in String[] uploadFailuresForSlaveSerialNumberValues
|
|
/// out String[] uploadFailuresForSlaveSerialNumberResults
|
|
/// </para>
|
|
public static void test_trUploadFailuresForMergedParts()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] uploadMasterSerialNumberKeys = null;
|
|
String[] uploadSlaveSerialNumberKeys = null;
|
|
String[] uploadSlaveSerialNumberValues = null;
|
|
String[] uploadSlaveSerialNumberResults = null;
|
|
String[] uploadFailuresForSlaveSerialNumberKeys = null;
|
|
String[] uploadFailuresForSlaveSerialNumberValues = null;
|
|
String[] uploadFailuresForSlaveSerialNumberResults = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for uploadMasterSerialNumberKeys: "));
|
|
int uploadMasterSerialNumberKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
uploadMasterSerialNumberKeys = new KeyValue[uploadMasterSerialNumberKeysSize];
|
|
for (int i=0; i<uploadMasterSerialNumberKeysSize; i++)
|
|
{
|
|
uploadMasterSerialNumberKeys[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("uploadMasterSerialNumberKeys[" + i + "] .key (String): "));
|
|
uploadMasterSerialNumberKeys[i].key = getInput();
|
|
Console.Write(fillWithSpace("uploadMasterSerialNumberKeys[" + i + "] .value (String): "));
|
|
uploadMasterSerialNumberKeys[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for uploadSlaveSerialNumberKeys: "));
|
|
int uploadSlaveSerialNumberKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
uploadSlaveSerialNumberKeys = new String[uploadSlaveSerialNumberKeysSize];
|
|
for (int i=0; i<uploadSlaveSerialNumberKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("uploadSlaveSerialNumberKeys[" + i + "] (String): "));
|
|
uploadSlaveSerialNumberKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for uploadSlaveSerialNumberValues: "));
|
|
int uploadSlaveSerialNumberValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
uploadSlaveSerialNumberValues = new String[uploadSlaveSerialNumberValuesSize];
|
|
for (int i=0; i<uploadSlaveSerialNumberValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("uploadSlaveSerialNumberValues[" + i + "] (String): "));
|
|
uploadSlaveSerialNumberValues[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for uploadFailuresForSlaveSerialNumberKeys: "));
|
|
int uploadFailuresForSlaveSerialNumberKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
uploadFailuresForSlaveSerialNumberKeys = new String[uploadFailuresForSlaveSerialNumberKeysSize];
|
|
for (int i=0; i<uploadFailuresForSlaveSerialNumberKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("uploadFailuresForSlaveSerialNumberKeys[" + i + "] (String): "));
|
|
uploadFailuresForSlaveSerialNumberKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for uploadFailuresForSlaveSerialNumberValues: "));
|
|
int uploadFailuresForSlaveSerialNumberValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
uploadFailuresForSlaveSerialNumberValues = new String[uploadFailuresForSlaveSerialNumberValuesSize];
|
|
for (int i=0; i<uploadFailuresForSlaveSerialNumberValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("uploadFailuresForSlaveSerialNumberValues[" + i + "] (String): "));
|
|
uploadFailuresForSlaveSerialNumberValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.trUploadFailuresForMergedParts(sessionContext, stationNumber, uploadMasterSerialNumberKeys, uploadSlaveSerialNumberKeys, uploadSlaveSerialNumberValues, out uploadSlaveSerialNumberResults, uploadFailuresForSlaveSerialNumberKeys, uploadFailuresForSlaveSerialNumberValues, out uploadFailuresForSlaveSerialNumberResults);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; uploadSlaveSerialNumberResults != null && i<uploadSlaveSerialNumberResults.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("uploadSlaveSerialNumberResults[" + i + "]: ") + "<" + uploadSlaveSerialNumberResults[i] + ">");
|
|
}
|
|
for (int i=0; uploadFailuresForSlaveSerialNumberResults != null && i<uploadFailuresForSlaveSerialNumberResults.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("uploadFailuresForSlaveSerialNumberResults[" + i + "]: ") + "<" + uploadFailuresForSlaveSerialNumberResults[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_trChangePoolSerialNumber
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "trChangePoolSerialNumber"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String serialNumberPoolName
|
|
/// in String[] poolSerialNumberKeys
|
|
/// in String[] poolSerialNumberValues
|
|
/// out String[] poolSerialNumberResults
|
|
/// </para>
|
|
public static void test_trChangePoolSerialNumber()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String serialNumberPoolName = "";
|
|
String[] poolSerialNumberKeys = null;
|
|
String[] poolSerialNumberValues = null;
|
|
String[] poolSerialNumberResults = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumberPoolName (String): "));
|
|
serialNumberPoolName = getInput();
|
|
Console.Write(fillWithSpace("Enter size for poolSerialNumberKeys: "));
|
|
int poolSerialNumberKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
poolSerialNumberKeys = new String[poolSerialNumberKeysSize];
|
|
for (int i=0; i<poolSerialNumberKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("poolSerialNumberKeys[" + i + "] (String): "));
|
|
poolSerialNumberKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for poolSerialNumberValues: "));
|
|
int poolSerialNumberValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
poolSerialNumberValues = new String[poolSerialNumberValuesSize];
|
|
for (int i=0; i<poolSerialNumberValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("poolSerialNumberValues[" + i + "] (String): "));
|
|
poolSerialNumberValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.trChangePoolSerialNumber(sessionContext, stationNumber, serialNumberPoolName, poolSerialNumberKeys, poolSerialNumberValues, out poolSerialNumberResults);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; poolSerialNumberResults != null && i<poolSerialNumberResults.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("poolSerialNumberResults[" + i + "]: ") + "<" + poolSerialNumberResults[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_trSplitPanel
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "trSplitPanel"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String serialNumberRef
|
|
/// in String serialNumberRefPos
|
|
/// in int functionMode
|
|
/// in String[] splitPanelKeys
|
|
/// in String[] splitPanelValues
|
|
/// out String[] splitPanelResults
|
|
/// </para>
|
|
public static void test_trSplitPanel()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String serialNumberRef = "";
|
|
String serialNumberRefPos = "";
|
|
int functionMode = 0;
|
|
String[] splitPanelKeys = null;
|
|
String[] splitPanelValues = null;
|
|
String[] splitPanelResults = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumberRef (String): "));
|
|
serialNumberRef = getInput();
|
|
Console.Write(fillWithSpace("serialNumberRefPos (String): "));
|
|
serialNumberRefPos = getInput();
|
|
Console.Write(fillWithSpace("functionMode (int): "));
|
|
functionMode = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("Enter size for splitPanelKeys: "));
|
|
int splitPanelKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
splitPanelKeys = new String[splitPanelKeysSize];
|
|
for (int i=0; i<splitPanelKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("splitPanelKeys[" + i + "] (String): "));
|
|
splitPanelKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for splitPanelValues: "));
|
|
int splitPanelValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
splitPanelValues = new String[splitPanelValuesSize];
|
|
for (int i=0; i<splitPanelValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("splitPanelValues[" + i + "] (String): "));
|
|
splitPanelValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.trSplitPanel(sessionContext, stationNumber, serialNumberRef, serialNumberRefPos, functionMode, splitPanelKeys, splitPanelValues, out splitPanelResults);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; splitPanelResults != null && i<splitPanelResults.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("splitPanelResults[" + i + "]: ") + "<" + splitPanelResults[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_trAddExternalSerialNumber
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "trAddExternalSerialNumber"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String serialNumberRef
|
|
/// in String serialNumberRefPos
|
|
/// in int serialNumberState
|
|
/// in long bookDate
|
|
/// in float cycleTime
|
|
/// in KeyValue[] workOrderUploadData
|
|
/// in String[] workOrderResultKeys
|
|
/// out String[] workOrderResultValues
|
|
/// in String[] serialNumberUploadKeys
|
|
/// in String[] serialNumberUploadValues
|
|
/// out String[] serialNumberResultValues
|
|
/// </para>
|
|
public static void test_trAddExternalSerialNumber()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String serialNumberRef = "";
|
|
String serialNumberRefPos = "";
|
|
int serialNumberState = 0;
|
|
long bookDate = 0;
|
|
float cycleTime = 0.0f;
|
|
KeyValue[] workOrderUploadData = null;
|
|
String[] workOrderResultKeys = null;
|
|
String[] workOrderResultValues = null;
|
|
String[] serialNumberUploadKeys = null;
|
|
String[] serialNumberUploadValues = null;
|
|
String[] serialNumberResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("serialNumberRef (String): "));
|
|
serialNumberRef = getInput();
|
|
Console.Write(fillWithSpace("serialNumberRefPos (String): "));
|
|
serialNumberRefPos = getInput();
|
|
Console.Write(fillWithSpace("serialNumberState (int): "));
|
|
serialNumberState = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("bookDate (long): "));
|
|
bookDate = Int64.Parse(getInput());
|
|
Console.Write(fillWithSpace("cycleTime (float): "));
|
|
cycleTime = Single.Parse(getInput());
|
|
Console.Write(fillWithSpace("Enter size for workOrderUploadData: "));
|
|
int workOrderUploadDataSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
workOrderUploadData = new KeyValue[workOrderUploadDataSize];
|
|
for (int i=0; i<workOrderUploadDataSize; i++)
|
|
{
|
|
workOrderUploadData[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("workOrderUploadData[" + i + "] .key (String): "));
|
|
workOrderUploadData[i].key = getInput();
|
|
Console.Write(fillWithSpace("workOrderUploadData[" + i + "] .value (String): "));
|
|
workOrderUploadData[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for workOrderResultKeys: "));
|
|
int workOrderResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
workOrderResultKeys = new String[workOrderResultKeysSize];
|
|
for (int i=0; i<workOrderResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("workOrderResultKeys[" + i + "] (String): "));
|
|
workOrderResultKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for serialNumberUploadKeys: "));
|
|
int serialNumberUploadKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
serialNumberUploadKeys = new String[serialNumberUploadKeysSize];
|
|
for (int i=0; i<serialNumberUploadKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("serialNumberUploadKeys[" + i + "] (String): "));
|
|
serialNumberUploadKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for serialNumberUploadValues: "));
|
|
int serialNumberUploadValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
serialNumberUploadValues = new String[serialNumberUploadValuesSize];
|
|
for (int i=0; i<serialNumberUploadValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("serialNumberUploadValues[" + i + "] (String): "));
|
|
serialNumberUploadValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.trAddExternalSerialNumber(sessionContext, stationNumber, serialNumberRef, serialNumberRefPos, serialNumberState, bookDate, cycleTime, workOrderUploadData, workOrderResultKeys, out workOrderResultValues, serialNumberUploadKeys, serialNumberUploadValues, out serialNumberResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; workOrderResultValues != null && i<workOrderResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("workOrderResultValues[" + i + "]: ") + "<" + workOrderResultValues[i] + ">");
|
|
}
|
|
for (int i=0; serialNumberResultValues != null && i<serialNumberResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("serialNumberResultValues[" + i + "]: ") + "<" + serialNumberResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_trAssignSerialnumberToOrderCluster
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "trAssignSerialnumberToOrderCluster"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] orderClusterSerialnumberHeader
|
|
/// in String[] orderClusterSerialnumberAssignKeys
|
|
/// in String[] orderClusterSerialnumberAssignValues
|
|
/// out String[] orderClusterSerialnumberAssignResultValues
|
|
/// </para>
|
|
public static void test_trAssignSerialnumberToOrderCluster()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] orderClusterSerialnumberHeader = null;
|
|
String[] orderClusterSerialnumberAssignKeys = null;
|
|
String[] orderClusterSerialnumberAssignValues = null;
|
|
String[] orderClusterSerialnumberAssignResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for orderClusterSerialnumberHeader: "));
|
|
int orderClusterSerialnumberHeaderSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
orderClusterSerialnumberHeader = new KeyValue[orderClusterSerialnumberHeaderSize];
|
|
for (int i=0; i<orderClusterSerialnumberHeaderSize; i++)
|
|
{
|
|
orderClusterSerialnumberHeader[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("orderClusterSerialnumberHeader[" + i + "] .key (String): "));
|
|
orderClusterSerialnumberHeader[i].key = getInput();
|
|
Console.Write(fillWithSpace("orderClusterSerialnumberHeader[" + i + "] .value (String): "));
|
|
orderClusterSerialnumberHeader[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for orderClusterSerialnumberAssignKeys: "));
|
|
int orderClusterSerialnumberAssignKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
orderClusterSerialnumberAssignKeys = new String[orderClusterSerialnumberAssignKeysSize];
|
|
for (int i=0; i<orderClusterSerialnumberAssignKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("orderClusterSerialnumberAssignKeys[" + i + "] (String): "));
|
|
orderClusterSerialnumberAssignKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for orderClusterSerialnumberAssignValues: "));
|
|
int orderClusterSerialnumberAssignValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
orderClusterSerialnumberAssignValues = new String[orderClusterSerialnumberAssignValuesSize];
|
|
for (int i=0; i<orderClusterSerialnumberAssignValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("orderClusterSerialnumberAssignValues[" + i + "] (String): "));
|
|
orderClusterSerialnumberAssignValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.trAssignSerialnumberToOrderCluster(sessionContext, stationNumber, orderClusterSerialnumberHeader, orderClusterSerialnumberAssignKeys, orderClusterSerialnumberAssignValues, out orderClusterSerialnumberAssignResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; orderClusterSerialnumberAssignResultValues != null && i<orderClusterSerialnumberAssignResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("orderClusterSerialnumberAssignResultValues[" + i + "]: ") + "<" + orderClusterSerialnumberAssignResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_trActivateOrderCluster
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "trActivateOrderCluster"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] orderClusterActivateData
|
|
/// </para>
|
|
public static void test_trActivateOrderCluster()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] orderClusterActivateData = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for orderClusterActivateData: "));
|
|
int orderClusterActivateDataSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
orderClusterActivateData = new KeyValue[orderClusterActivateDataSize];
|
|
for (int i=0; i<orderClusterActivateDataSize; i++)
|
|
{
|
|
orderClusterActivateData[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("orderClusterActivateData[" + i + "] .key (String): "));
|
|
orderClusterActivateData[i].key = getInput();
|
|
Console.Write(fillWithSpace("orderClusterActivateData[" + i + "] .value (String): "));
|
|
orderClusterActivateData[i].value = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.trActivateOrderCluster(sessionContext, stationNumber, orderClusterActivateData);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_trGetMultiStationSettings
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "trGetMultiStationSettings"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String[] stationMultiSettingsResultKeys
|
|
/// out String[] stationMultiSettingsResultValues
|
|
/// </para>
|
|
public static void test_trGetMultiStationSettings()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String[] stationMultiSettingsResultKeys = null;
|
|
String[] stationMultiSettingsResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for stationMultiSettingsResultKeys: "));
|
|
int stationMultiSettingsResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
stationMultiSettingsResultKeys = new String[stationMultiSettingsResultKeysSize];
|
|
for (int i=0; i<stationMultiSettingsResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("stationMultiSettingsResultKeys[" + i + "] (String): "));
|
|
stationMultiSettingsResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.trGetMultiStationSettings(sessionContext, stationNumber, stationMultiSettingsResultKeys, out stationMultiSettingsResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; stationMultiSettingsResultValues != null && i<stationMultiSettingsResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("stationMultiSettingsResultValues[" + i + "]: ") + "<" + stationMultiSettingsResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_trActivateWorkstep
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "trActivateWorkstep"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] activateWorkstepKeys
|
|
/// </para>
|
|
public static void test_trActivateWorkstep()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] activateWorkstepKeys = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for activateWorkstepKeys: "));
|
|
int activateWorkstepKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
activateWorkstepKeys = new KeyValue[activateWorkstepKeysSize];
|
|
for (int i=0; i<activateWorkstepKeysSize; i++)
|
|
{
|
|
activateWorkstepKeys[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("activateWorkstepKeys[" + i + "] .key (String): "));
|
|
activateWorkstepKeys[i].key = getInput();
|
|
Console.Write(fillWithSpace("activateWorkstepKeys[" + i + "] .value (String): "));
|
|
activateWorkstepKeys[i].value = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.trActivateWorkstep(sessionContext, stationNumber, activateWorkstepKeys);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_trSerialNumberPassing
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "trSerialNumberPassing"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in String[] serialNumberPassingKeys
|
|
/// in String[] serialNumberPassingValues
|
|
/// in String[] serialNumberPassingResultKeys
|
|
/// out String[] serialNumberPassingResultValues
|
|
/// </para>
|
|
public static void test_trSerialNumberPassing()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
String[] serialNumberPassingKeys = null;
|
|
String[] serialNumberPassingValues = null;
|
|
String[] serialNumberPassingResultKeys = null;
|
|
String[] serialNumberPassingResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for serialNumberPassingKeys: "));
|
|
int serialNumberPassingKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
serialNumberPassingKeys = new String[serialNumberPassingKeysSize];
|
|
for (int i=0; i<serialNumberPassingKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("serialNumberPassingKeys[" + i + "] (String): "));
|
|
serialNumberPassingKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for serialNumberPassingValues: "));
|
|
int serialNumberPassingValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
serialNumberPassingValues = new String[serialNumberPassingValuesSize];
|
|
for (int i=0; i<serialNumberPassingValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("serialNumberPassingValues[" + i + "] (String): "));
|
|
serialNumberPassingValues[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for serialNumberPassingResultKeys: "));
|
|
int serialNumberPassingResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
serialNumberPassingResultKeys = new String[serialNumberPassingResultKeysSize];
|
|
for (int i=0; i<serialNumberPassingResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("serialNumberPassingResultKeys[" + i + "] (String): "));
|
|
serialNumberPassingResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.trSerialNumberPassing(sessionContext, stationNumber, serialNumberPassingKeys, serialNumberPassingValues, serialNumberPassingResultKeys, out serialNumberPassingResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; serialNumberPassingResultValues != null && i<serialNumberPassingResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("serialNumberPassingResultValues[" + i + "]: ") + "<" + serialNumberPassingResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_trCheckUserSkills
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "trCheckUserSkills"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] checkUserSkillsFilter
|
|
/// in String[] checkUserSkillsResultKeys
|
|
/// out String[] checkUserSkillsResultValues
|
|
/// </para>
|
|
public static void test_trCheckUserSkills()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] checkUserSkillsFilter = null;
|
|
String[] checkUserSkillsResultKeys = null;
|
|
String[] checkUserSkillsResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for checkUserSkillsFilter: "));
|
|
int checkUserSkillsFilterSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
checkUserSkillsFilter = new KeyValue[checkUserSkillsFilterSize];
|
|
for (int i=0; i<checkUserSkillsFilterSize; i++)
|
|
{
|
|
checkUserSkillsFilter[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("checkUserSkillsFilter[" + i + "] .key (String): "));
|
|
checkUserSkillsFilter[i].key = getInput();
|
|
Console.Write(fillWithSpace("checkUserSkillsFilter[" + i + "] .value (String): "));
|
|
checkUserSkillsFilter[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for checkUserSkillsResultKeys: "));
|
|
int checkUserSkillsResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
checkUserSkillsResultKeys = new String[checkUserSkillsResultKeysSize];
|
|
for (int i=0; i<checkUserSkillsResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("checkUserSkillsResultKeys[" + i + "] (String): "));
|
|
checkUserSkillsResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.trCheckUserSkills(sessionContext, stationNumber, checkUserSkillsFilter, checkUserSkillsResultKeys, out checkUserSkillsResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; checkUserSkillsResultValues != null && i<checkUserSkillsResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("checkUserSkillsResultValues[" + i + "]: ") + "<" + checkUserSkillsResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_trRemoveSerialNumberFromOrder
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "trRemoveSerialNumberFromOrder"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] removeSerialNumberKeys
|
|
/// </para>
|
|
public static void test_trRemoveSerialNumberFromOrder()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] removeSerialNumberKeys = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for removeSerialNumberKeys: "));
|
|
int removeSerialNumberKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
removeSerialNumberKeys = new KeyValue[removeSerialNumberKeysSize];
|
|
for (int i=0; i<removeSerialNumberKeysSize; i++)
|
|
{
|
|
removeSerialNumberKeys[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("removeSerialNumberKeys[" + i + "] .key (String): "));
|
|
removeSerialNumberKeys[i].key = getInput();
|
|
Console.Write(fillWithSpace("removeSerialNumberKeys[" + i + "] .value (String): "));
|
|
removeSerialNumberKeys[i].value = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.trRemoveSerialNumberFromOrder(sessionContext, stationNumber, removeSerialNumberKeys);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mslBeginDryObject
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mslBeginDryObject"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] mslBeginDryEventParams
|
|
/// in String[] mslObjectKeys
|
|
/// in String[] mslObjectValues
|
|
/// out String[] mslResultValues
|
|
/// </para>
|
|
public static void test_mslBeginDryObject()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] mslBeginDryEventParams = null;
|
|
String[] mslObjectKeys = null;
|
|
String[] mslObjectValues = null;
|
|
String[] mslResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for mslBeginDryEventParams: "));
|
|
int mslBeginDryEventParamsSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
mslBeginDryEventParams = new KeyValue[mslBeginDryEventParamsSize];
|
|
for (int i=0; i<mslBeginDryEventParamsSize; i++)
|
|
{
|
|
mslBeginDryEventParams[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("mslBeginDryEventParams[" + i + "] .key (String): "));
|
|
mslBeginDryEventParams[i].key = getInput();
|
|
Console.Write(fillWithSpace("mslBeginDryEventParams[" + i + "] .value (String): "));
|
|
mslBeginDryEventParams[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for mslObjectKeys: "));
|
|
int mslObjectKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
mslObjectKeys = new String[mslObjectKeysSize];
|
|
for (int i=0; i<mslObjectKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("mslObjectKeys[" + i + "] (String): "));
|
|
mslObjectKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for mslObjectValues: "));
|
|
int mslObjectValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
mslObjectValues = new String[mslObjectValuesSize];
|
|
for (int i=0; i<mslObjectValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("mslObjectValues[" + i + "] (String): "));
|
|
mslObjectValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mslBeginDryObject(sessionContext, stationNumber, mslBeginDryEventParams, mslObjectKeys, mslObjectValues, out mslResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; mslResultValues != null && i<mslResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("mslResultValues[" + i + "]: ") + "<" + mslResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mslEndDryObject
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mslEndDryObject"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] mslEventParams
|
|
/// in String[] mslObjectKeys
|
|
/// in String[] mslObjectValues
|
|
/// out String[] mslResultValues
|
|
/// </para>
|
|
public static void test_mslEndDryObject()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] mslEventParams = null;
|
|
String[] mslObjectKeys = null;
|
|
String[] mslObjectValues = null;
|
|
String[] mslResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for mslEventParams: "));
|
|
int mslEventParamsSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
mslEventParams = new KeyValue[mslEventParamsSize];
|
|
for (int i=0; i<mslEventParamsSize; i++)
|
|
{
|
|
mslEventParams[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("mslEventParams[" + i + "] .key (String): "));
|
|
mslEventParams[i].key = getInput();
|
|
Console.Write(fillWithSpace("mslEventParams[" + i + "] .value (String): "));
|
|
mslEventParams[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for mslObjectKeys: "));
|
|
int mslObjectKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
mslObjectKeys = new String[mslObjectKeysSize];
|
|
for (int i=0; i<mslObjectKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("mslObjectKeys[" + i + "] (String): "));
|
|
mslObjectKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for mslObjectValues: "));
|
|
int mslObjectValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
mslObjectValues = new String[mslObjectValuesSize];
|
|
for (int i=0; i<mslObjectValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("mslObjectValues[" + i + "] (String): "));
|
|
mslObjectValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mslEndDryObject(sessionContext, stationNumber, mslEventParams, mslObjectKeys, mslObjectValues, out mslResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; mslResultValues != null && i<mslResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("mslResultValues[" + i + "]: ") + "<" + mslResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mslStartObjectExpiration
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mslStartObjectExpiration"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] mslEventParams
|
|
/// in String[] mslObjectKeys
|
|
/// in String[] mslObjectValues
|
|
/// out String[] mslResultValues
|
|
/// </para>
|
|
public static void test_mslStartObjectExpiration()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] mslEventParams = null;
|
|
String[] mslObjectKeys = null;
|
|
String[] mslObjectValues = null;
|
|
String[] mslResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for mslEventParams: "));
|
|
int mslEventParamsSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
mslEventParams = new KeyValue[mslEventParamsSize];
|
|
for (int i=0; i<mslEventParamsSize; i++)
|
|
{
|
|
mslEventParams[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("mslEventParams[" + i + "] .key (String): "));
|
|
mslEventParams[i].key = getInput();
|
|
Console.Write(fillWithSpace("mslEventParams[" + i + "] .value (String): "));
|
|
mslEventParams[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for mslObjectKeys: "));
|
|
int mslObjectKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
mslObjectKeys = new String[mslObjectKeysSize];
|
|
for (int i=0; i<mslObjectKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("mslObjectKeys[" + i + "] (String): "));
|
|
mslObjectKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for mslObjectValues: "));
|
|
int mslObjectValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
mslObjectValues = new String[mslObjectValuesSize];
|
|
for (int i=0; i<mslObjectValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("mslObjectValues[" + i + "] (String): "));
|
|
mslObjectValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mslStartObjectExpiration(sessionContext, stationNumber, mslEventParams, mslObjectKeys, mslObjectValues, out mslResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; mslResultValues != null && i<mslResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("mslResultValues[" + i + "]: ") + "<" + mslResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mslStopObjectExpiration
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mslStopObjectExpiration"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] mslEventParams
|
|
/// in String[] mslObjectKeys
|
|
/// in String[] mslObjectValues
|
|
/// out String[] mslResultValues
|
|
/// </para>
|
|
public static void test_mslStopObjectExpiration()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] mslEventParams = null;
|
|
String[] mslObjectKeys = null;
|
|
String[] mslObjectValues = null;
|
|
String[] mslResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for mslEventParams: "));
|
|
int mslEventParamsSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
mslEventParams = new KeyValue[mslEventParamsSize];
|
|
for (int i=0; i<mslEventParamsSize; i++)
|
|
{
|
|
mslEventParams[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("mslEventParams[" + i + "] .key (String): "));
|
|
mslEventParams[i].key = getInput();
|
|
Console.Write(fillWithSpace("mslEventParams[" + i + "] .value (String): "));
|
|
mslEventParams[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for mslObjectKeys: "));
|
|
int mslObjectKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
mslObjectKeys = new String[mslObjectKeysSize];
|
|
for (int i=0; i<mslObjectKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("mslObjectKeys[" + i + "] (String): "));
|
|
mslObjectKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for mslObjectValues: "));
|
|
int mslObjectValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
mslObjectValues = new String[mslObjectValuesSize];
|
|
for (int i=0; i<mslObjectValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("mslObjectValues[" + i + "] (String): "));
|
|
mslObjectValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mslStopObjectExpiration(sessionContext, stationNumber, mslEventParams, mslObjectKeys, mslObjectValues, out mslResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; mslResultValues != null && i<mslResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("mslResultValues[" + i + "]: ") + "<" + mslResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mslGetObjectInfo
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mslGetObjectInfo"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in int objectType
|
|
/// in KeyValue[] mslInfoFilters
|
|
/// in String[] mslInfoResultKeys
|
|
/// out String[] mslInfoResultValues
|
|
/// </para>
|
|
public static void test_mslGetObjectInfo()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
int objectType = 0;
|
|
KeyValue[] mslInfoFilters = null;
|
|
String[] mslInfoResultKeys = null;
|
|
String[] mslInfoResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("objectType (int): "));
|
|
objectType = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("Enter size for mslInfoFilters: "));
|
|
int mslInfoFiltersSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
mslInfoFilters = new KeyValue[mslInfoFiltersSize];
|
|
for (int i=0; i<mslInfoFiltersSize; i++)
|
|
{
|
|
mslInfoFilters[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("mslInfoFilters[" + i + "] .key (String): "));
|
|
mslInfoFilters[i].key = getInput();
|
|
Console.Write(fillWithSpace("mslInfoFilters[" + i + "] .value (String): "));
|
|
mslInfoFilters[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for mslInfoResultKeys: "));
|
|
int mslInfoResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
mslInfoResultKeys = new String[mslInfoResultKeysSize];
|
|
for (int i=0; i<mslInfoResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("mslInfoResultKeys[" + i + "] (String): "));
|
|
mslInfoResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mslGetObjectInfo(sessionContext, stationNumber, objectType, mslInfoFilters, mslInfoResultKeys, out mslInfoResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; mslInfoResultValues != null && i<mslInfoResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("mslInfoResultValues[" + i + "]: ") + "<" + mslInfoResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_mslGetMinDryTimeForSerialnumber
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "mslGetMinDryTimeForSerialnumber"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] mslInfoFilters
|
|
/// in String[] mslWorstCaseMinDryTimeResultKeys
|
|
/// out String[] mslWorstCaseMinDryTimeResultValues
|
|
/// in String[] mslMinDryTimeResultKeys
|
|
/// out String[] mslMinDryTimeResultValues
|
|
/// </para>
|
|
public static void test_mslGetMinDryTimeForSerialnumber()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] mslInfoFilters = null;
|
|
String[] mslWorstCaseMinDryTimeResultKeys = null;
|
|
String[] mslWorstCaseMinDryTimeResultValues = null;
|
|
String[] mslMinDryTimeResultKeys = null;
|
|
String[] mslMinDryTimeResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for mslInfoFilters: "));
|
|
int mslInfoFiltersSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
mslInfoFilters = new KeyValue[mslInfoFiltersSize];
|
|
for (int i=0; i<mslInfoFiltersSize; i++)
|
|
{
|
|
mslInfoFilters[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("mslInfoFilters[" + i + "] .key (String): "));
|
|
mslInfoFilters[i].key = getInput();
|
|
Console.Write(fillWithSpace("mslInfoFilters[" + i + "] .value (String): "));
|
|
mslInfoFilters[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for mslWorstCaseMinDryTimeResultKeys: "));
|
|
int mslWorstCaseMinDryTimeResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
mslWorstCaseMinDryTimeResultKeys = new String[mslWorstCaseMinDryTimeResultKeysSize];
|
|
for (int i=0; i<mslWorstCaseMinDryTimeResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("mslWorstCaseMinDryTimeResultKeys[" + i + "] (String): "));
|
|
mslWorstCaseMinDryTimeResultKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for mslMinDryTimeResultKeys: "));
|
|
int mslMinDryTimeResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
mslMinDryTimeResultKeys = new String[mslMinDryTimeResultKeysSize];
|
|
for (int i=0; i<mslMinDryTimeResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("mslMinDryTimeResultKeys[" + i + "] (String): "));
|
|
mslMinDryTimeResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.mslGetMinDryTimeForSerialnumber(sessionContext, stationNumber, mslInfoFilters, mslWorstCaseMinDryTimeResultKeys, out mslWorstCaseMinDryTimeResultValues, mslMinDryTimeResultKeys, out mslMinDryTimeResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; mslWorstCaseMinDryTimeResultValues != null && i<mslWorstCaseMinDryTimeResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("mslWorstCaseMinDryTimeResultValues[" + i + "]: ") + "<" + mslWorstCaseMinDryTimeResultValues[i] + ">");
|
|
}
|
|
for (int i=0; mslMinDryTimeResultValues != null && i<mslMinDryTimeResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("mslMinDryTimeResultValues[" + i + "]: ") + "<" + mslMinDryTimeResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_pmUploadQuantityAndFailureData
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "pmUploadQuantityAndFailureData"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] bookingFailureData
|
|
/// in String[] failureDataUploadKeys
|
|
/// in String[] failureDataUploadValues
|
|
/// out String[] failureDataUploadResultValues
|
|
/// </para>
|
|
public static void test_pmUploadQuantityAndFailureData()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] bookingFailureData = null;
|
|
String[] failureDataUploadKeys = null;
|
|
String[] failureDataUploadValues = null;
|
|
String[] failureDataUploadResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for bookingFailureData: "));
|
|
int bookingFailureDataSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
bookingFailureData = new KeyValue[bookingFailureDataSize];
|
|
for (int i=0; i<bookingFailureDataSize; i++)
|
|
{
|
|
bookingFailureData[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("bookingFailureData[" + i + "] .key (String): "));
|
|
bookingFailureData[i].key = getInput();
|
|
Console.Write(fillWithSpace("bookingFailureData[" + i + "] .value (String): "));
|
|
bookingFailureData[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for failureDataUploadKeys: "));
|
|
int failureDataUploadKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
failureDataUploadKeys = new String[failureDataUploadKeysSize];
|
|
for (int i=0; i<failureDataUploadKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("failureDataUploadKeys[" + i + "] (String): "));
|
|
failureDataUploadKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for failureDataUploadValues: "));
|
|
int failureDataUploadValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
failureDataUploadValues = new String[failureDataUploadValuesSize];
|
|
for (int i=0; i<failureDataUploadValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("failureDataUploadValues[" + i + "] (String): "));
|
|
failureDataUploadValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.pmUploadQuantityAndFailureData(sessionContext, stationNumber, bookingFailureData, failureDataUploadKeys, failureDataUploadValues, out failureDataUploadResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; failureDataUploadResultValues != null && i<failureDataUploadResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("failureDataUploadResultValues[" + i + "]: ") + "<" + failureDataUploadResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_pmGetFailureData
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "pmGetFailureData"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] failureDataFilters
|
|
/// in String[] failureDataResultKeys
|
|
/// out String[] failureDataResultValues
|
|
/// </para>
|
|
public static void test_pmGetFailureData()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] failureDataFilters = null;
|
|
String[] failureDataResultKeys = null;
|
|
String[] failureDataResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for failureDataFilters: "));
|
|
int failureDataFiltersSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
failureDataFilters = new KeyValue[failureDataFiltersSize];
|
|
for (int i=0; i<failureDataFiltersSize; i++)
|
|
{
|
|
failureDataFilters[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("failureDataFilters[" + i + "] .key (String): "));
|
|
failureDataFilters[i].key = getInput();
|
|
Console.Write(fillWithSpace("failureDataFilters[" + i + "] .value (String): "));
|
|
failureDataFilters[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for failureDataResultKeys: "));
|
|
int failureDataResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
failureDataResultKeys = new String[failureDataResultKeysSize];
|
|
for (int i=0; i<failureDataResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("failureDataResultKeys[" + i + "] (String): "));
|
|
failureDataResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.pmGetFailureData(sessionContext, stationNumber, failureDataFilters, failureDataResultKeys, out failureDataResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; failureDataResultValues != null && i<failureDataResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("failureDataResultValues[" + i + "]: ") + "<" + failureDataResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_pmGetProductQuantity
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "pmGetProductQuantity"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in int processLayer
|
|
/// in long dateFrom
|
|
/// in long dateTo
|
|
/// in int functionMode
|
|
/// in KeyValue[] productQuantityFilters
|
|
/// in String[] filterDataKeys
|
|
/// in String[] filterDataValues
|
|
/// in String[] productQuantityResultKeys
|
|
/// out String[] productQuantityResultValues
|
|
/// </para>
|
|
public static void test_pmGetProductQuantity()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
int processLayer = 0;
|
|
long dateFrom = 0;
|
|
long dateTo = 0;
|
|
int functionMode = 0;
|
|
KeyValue[] productQuantityFilters = null;
|
|
String[] filterDataKeys = null;
|
|
String[] filterDataValues = null;
|
|
String[] productQuantityResultKeys = null;
|
|
String[] productQuantityResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("processLayer (int): "));
|
|
processLayer = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("dateFrom (long): "));
|
|
dateFrom = Int64.Parse(getInput());
|
|
Console.Write(fillWithSpace("dateTo (long): "));
|
|
dateTo = Int64.Parse(getInput());
|
|
Console.Write(fillWithSpace("functionMode (int): "));
|
|
functionMode = Int32.Parse(getInput());
|
|
Console.Write(fillWithSpace("Enter size for productQuantityFilters: "));
|
|
int productQuantityFiltersSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
productQuantityFilters = new KeyValue[productQuantityFiltersSize];
|
|
for (int i=0; i<productQuantityFiltersSize; i++)
|
|
{
|
|
productQuantityFilters[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("productQuantityFilters[" + i + "] .key (String): "));
|
|
productQuantityFilters[i].key = getInput();
|
|
Console.Write(fillWithSpace("productQuantityFilters[" + i + "] .value (String): "));
|
|
productQuantityFilters[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for filterDataKeys: "));
|
|
int filterDataKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
filterDataKeys = new String[filterDataKeysSize];
|
|
for (int i=0; i<filterDataKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("filterDataKeys[" + i + "] (String): "));
|
|
filterDataKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for filterDataValues: "));
|
|
int filterDataValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
filterDataValues = new String[filterDataValuesSize];
|
|
for (int i=0; i<filterDataValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("filterDataValues[" + i + "] (String): "));
|
|
filterDataValues[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for productQuantityResultKeys: "));
|
|
int productQuantityResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
productQuantityResultKeys = new String[productQuantityResultKeysSize];
|
|
for (int i=0; i<productQuantityResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("productQuantityResultKeys[" + i + "] (String): "));
|
|
productQuantityResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.pmGetProductQuantity(sessionContext, stationNumber, processLayer, dateFrom, dateTo, functionMode, productQuantityFilters, filterDataKeys, filterDataValues, productQuantityResultKeys, out productQuantityResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; productQuantityResultValues != null && i<productQuantityResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("productQuantityResultValues[" + i + "]: ") + "<" + productQuantityResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_pmUploadBooking
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "pmUploadBooking"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] pmUploadBookingData
|
|
/// in String[] pmBookingFailureKeys
|
|
/// in String[] pmBookingFailureValues
|
|
/// out long bookingId
|
|
/// </para>
|
|
public static void test_pmUploadBooking()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] pmUploadBookingData = null;
|
|
String[] pmBookingFailureKeys = null;
|
|
String[] pmBookingFailureValues = null;
|
|
long bookingId = 0;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for pmUploadBookingData: "));
|
|
int pmUploadBookingDataSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
pmUploadBookingData = new KeyValue[pmUploadBookingDataSize];
|
|
for (int i=0; i<pmUploadBookingDataSize; i++)
|
|
{
|
|
pmUploadBookingData[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("pmUploadBookingData[" + i + "] .key (String): "));
|
|
pmUploadBookingData[i].key = getInput();
|
|
Console.Write(fillWithSpace("pmUploadBookingData[" + i + "] .value (String): "));
|
|
pmUploadBookingData[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for pmBookingFailureKeys: "));
|
|
int pmBookingFailureKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
pmBookingFailureKeys = new String[pmBookingFailureKeysSize];
|
|
for (int i=0; i<pmBookingFailureKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("pmBookingFailureKeys[" + i + "] (String): "));
|
|
pmBookingFailureKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for pmBookingFailureValues: "));
|
|
int pmBookingFailureValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
pmBookingFailureValues = new String[pmBookingFailureValuesSize];
|
|
for (int i=0; i<pmBookingFailureValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("pmBookingFailureValues[" + i + "] (String): "));
|
|
pmBookingFailureValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.pmUploadBooking(sessionContext, stationNumber, pmUploadBookingData, pmBookingFailureKeys, pmBookingFailureValues, out bookingId);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
Console.WriteLine(fillWithSpace("bookingId: ") + "<" + bookingId + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_pmUpdateBooking
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "pmUpdateBooking"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] pmUpdateBookingData
|
|
/// in String[] pmBookingFailureKeys
|
|
/// in String[] pmBookingFailureValues
|
|
/// </para>
|
|
public static void test_pmUpdateBooking()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] pmUpdateBookingData = null;
|
|
String[] pmBookingFailureKeys = null;
|
|
String[] pmBookingFailureValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for pmUpdateBookingData: "));
|
|
int pmUpdateBookingDataSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
pmUpdateBookingData = new KeyValue[pmUpdateBookingDataSize];
|
|
for (int i=0; i<pmUpdateBookingDataSize; i++)
|
|
{
|
|
pmUpdateBookingData[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("pmUpdateBookingData[" + i + "] .key (String): "));
|
|
pmUpdateBookingData[i].key = getInput();
|
|
Console.Write(fillWithSpace("pmUpdateBookingData[" + i + "] .value (String): "));
|
|
pmUpdateBookingData[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for pmBookingFailureKeys: "));
|
|
int pmBookingFailureKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
pmBookingFailureKeys = new String[pmBookingFailureKeysSize];
|
|
for (int i=0; i<pmBookingFailureKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("pmBookingFailureKeys[" + i + "] (String): "));
|
|
pmBookingFailureKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for pmBookingFailureValues: "));
|
|
int pmBookingFailureValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
pmBookingFailureValues = new String[pmBookingFailureValuesSize];
|
|
for (int i=0; i<pmBookingFailureValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("pmBookingFailureValues[" + i + "] (String): "));
|
|
pmBookingFailureValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.pmUpdateBooking(sessionContext, stationNumber, pmUpdateBookingData, pmBookingFailureKeys, pmBookingFailureValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_pmGetBooking
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "pmGetBooking"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] pmBookingFilters
|
|
/// in String[] pmBookingResultKeys
|
|
/// out String[] pmBookingResultValues
|
|
/// in String[] pmBookingFailureKeys
|
|
/// out String[] pmBookingFailureValues
|
|
/// out bool hasMore
|
|
/// </para>
|
|
public static void test_pmGetBooking()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] pmBookingFilters = null;
|
|
String[] pmBookingResultKeys = null;
|
|
String[] pmBookingResultValues = null;
|
|
String[] pmBookingFailureKeys = null;
|
|
String[] pmBookingFailureValues = null;
|
|
bool hasMore = false;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for pmBookingFilters: "));
|
|
int pmBookingFiltersSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
pmBookingFilters = new KeyValue[pmBookingFiltersSize];
|
|
for (int i=0; i<pmBookingFiltersSize; i++)
|
|
{
|
|
pmBookingFilters[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("pmBookingFilters[" + i + "] .key (String): "));
|
|
pmBookingFilters[i].key = getInput();
|
|
Console.Write(fillWithSpace("pmBookingFilters[" + i + "] .value (String): "));
|
|
pmBookingFilters[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for pmBookingResultKeys: "));
|
|
int pmBookingResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
pmBookingResultKeys = new String[pmBookingResultKeysSize];
|
|
for (int i=0; i<pmBookingResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("pmBookingResultKeys[" + i + "] (String): "));
|
|
pmBookingResultKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for pmBookingFailureKeys: "));
|
|
int pmBookingFailureKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
pmBookingFailureKeys = new String[pmBookingFailureKeysSize];
|
|
for (int i=0; i<pmBookingFailureKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("pmBookingFailureKeys[" + i + "] (String): "));
|
|
pmBookingFailureKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.pmGetBooking(sessionContext, stationNumber, pmBookingFilters, pmBookingResultKeys, out pmBookingResultValues, pmBookingFailureKeys, out pmBookingFailureValues, out hasMore);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; pmBookingResultValues != null && i<pmBookingResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("pmBookingResultValues[" + i + "]: ") + "<" + pmBookingResultValues[i] + ">");
|
|
}
|
|
for (int i=0; pmBookingFailureValues != null && i<pmBookingFailureValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("pmBookingFailureValues[" + i + "]: ") + "<" + pmBookingFailureValues[i] + ">");
|
|
}
|
|
Console.WriteLine(fillWithSpace("hasMore: ") + "<" + hasMore + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_pmUploadQuantityFailureTallyCardAndFailureData
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "pmUploadQuantityFailureTallyCardAndFailureData"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] bookingFailureData
|
|
/// in KeyValue[] failureTallyCardData
|
|
/// in String[] failureDataUploadKeys
|
|
/// in String[] failureDataUploadValues
|
|
/// out String[] failureDataUploadResultValues
|
|
/// </para>
|
|
public static void test_pmUploadQuantityFailureTallyCardAndFailureData()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] bookingFailureData = null;
|
|
KeyValue[] failureTallyCardData = null;
|
|
String[] failureDataUploadKeys = null;
|
|
String[] failureDataUploadValues = null;
|
|
String[] failureDataUploadResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for bookingFailureData: "));
|
|
int bookingFailureDataSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
bookingFailureData = new KeyValue[bookingFailureDataSize];
|
|
for (int i=0; i<bookingFailureDataSize; i++)
|
|
{
|
|
bookingFailureData[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("bookingFailureData[" + i + "] .key (String): "));
|
|
bookingFailureData[i].key = getInput();
|
|
Console.Write(fillWithSpace("bookingFailureData[" + i + "] .value (String): "));
|
|
bookingFailureData[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for failureTallyCardData: "));
|
|
int failureTallyCardDataSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
failureTallyCardData = new KeyValue[failureTallyCardDataSize];
|
|
for (int i=0; i<failureTallyCardDataSize; i++)
|
|
{
|
|
failureTallyCardData[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("failureTallyCardData[" + i + "] .key (String): "));
|
|
failureTallyCardData[i].key = getInput();
|
|
Console.Write(fillWithSpace("failureTallyCardData[" + i + "] .value (String): "));
|
|
failureTallyCardData[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for failureDataUploadKeys: "));
|
|
int failureDataUploadKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
failureDataUploadKeys = new String[failureDataUploadKeysSize];
|
|
for (int i=0; i<failureDataUploadKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("failureDataUploadKeys[" + i + "] (String): "));
|
|
failureDataUploadKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for failureDataUploadValues: "));
|
|
int failureDataUploadValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
failureDataUploadValues = new String[failureDataUploadValuesSize];
|
|
for (int i=0; i<failureDataUploadValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("failureDataUploadValues[" + i + "] (String): "));
|
|
failureDataUploadValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.pmUploadQuantityFailureTallyCardAndFailureData(sessionContext, stationNumber, bookingFailureData, failureTallyCardData, failureDataUploadKeys, failureDataUploadValues, out failureDataUploadResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; failureDataUploadResultValues != null && i<failureDataUploadResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("failureDataUploadResultValues[" + i + "]: ") + "<" + failureDataUploadResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_pmGetFailureTallyCard
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "pmGetFailureTallyCard"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] failureTallyCardFilters
|
|
/// in String[] failureTallyCardKeys
|
|
/// out String[] failureTallyCardResultValues
|
|
/// in String[] failureTallyCardFailureKeys
|
|
/// out String[] failureTallyCardFailureResultValues
|
|
/// </para>
|
|
public static void test_pmGetFailureTallyCard()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] failureTallyCardFilters = null;
|
|
String[] failureTallyCardKeys = null;
|
|
String[] failureTallyCardResultValues = null;
|
|
String[] failureTallyCardFailureKeys = null;
|
|
String[] failureTallyCardFailureResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for failureTallyCardFilters: "));
|
|
int failureTallyCardFiltersSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
failureTallyCardFilters = new KeyValue[failureTallyCardFiltersSize];
|
|
for (int i=0; i<failureTallyCardFiltersSize; i++)
|
|
{
|
|
failureTallyCardFilters[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("failureTallyCardFilters[" + i + "] .key (String): "));
|
|
failureTallyCardFilters[i].key = getInput();
|
|
Console.Write(fillWithSpace("failureTallyCardFilters[" + i + "] .value (String): "));
|
|
failureTallyCardFilters[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for failureTallyCardKeys: "));
|
|
int failureTallyCardKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
failureTallyCardKeys = new String[failureTallyCardKeysSize];
|
|
for (int i=0; i<failureTallyCardKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("failureTallyCardKeys[" + i + "] (String): "));
|
|
failureTallyCardKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for failureTallyCardFailureKeys: "));
|
|
int failureTallyCardFailureKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
failureTallyCardFailureKeys = new String[failureTallyCardFailureKeysSize];
|
|
for (int i=0; i<failureTallyCardFailureKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("failureTallyCardFailureKeys[" + i + "] (String): "));
|
|
failureTallyCardFailureKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.pmGetFailureTallyCard(sessionContext, stationNumber, failureTallyCardFilters, failureTallyCardKeys, out failureTallyCardResultValues, failureTallyCardFailureKeys, out failureTallyCardFailureResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; failureTallyCardResultValues != null && i<failureTallyCardResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("failureTallyCardResultValues[" + i + "]: ") + "<" + failureTallyCardResultValues[i] + ">");
|
|
}
|
|
for (int i=0; failureTallyCardFailureResultValues != null && i<failureTallyCardFailureResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("failureTallyCardFailureResultValues[" + i + "]: ") + "<" + failureTallyCardFailureResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_apsGetWorkorders
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "apsGetWorkorders"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] apsGetWorkordersFilters
|
|
/// in String[] apsGetWorkordersResultKeys
|
|
/// out String[] apsGetWorkordersResultValues
|
|
/// out bool hasMore
|
|
/// </para>
|
|
public static void test_apsGetWorkorders()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] apsGetWorkordersFilters = null;
|
|
String[] apsGetWorkordersResultKeys = null;
|
|
String[] apsGetWorkordersResultValues = null;
|
|
bool hasMore = false;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for apsGetWorkordersFilters: "));
|
|
int apsGetWorkordersFiltersSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
apsGetWorkordersFilters = new KeyValue[apsGetWorkordersFiltersSize];
|
|
for (int i=0; i<apsGetWorkordersFiltersSize; i++)
|
|
{
|
|
apsGetWorkordersFilters[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("apsGetWorkordersFilters[" + i + "] .key (String): "));
|
|
apsGetWorkordersFilters[i].key = getInput();
|
|
Console.Write(fillWithSpace("apsGetWorkordersFilters[" + i + "] .value (String): "));
|
|
apsGetWorkordersFilters[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for apsGetWorkordersResultKeys: "));
|
|
int apsGetWorkordersResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
apsGetWorkordersResultKeys = new String[apsGetWorkordersResultKeysSize];
|
|
for (int i=0; i<apsGetWorkordersResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("apsGetWorkordersResultKeys[" + i + "] (String): "));
|
|
apsGetWorkordersResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.apsGetWorkorders(sessionContext, stationNumber, apsGetWorkordersFilters, apsGetWorkordersResultKeys, out apsGetWorkordersResultValues, out hasMore);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; apsGetWorkordersResultValues != null && i<apsGetWorkordersResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("apsGetWorkordersResultValues[" + i + "]: ") + "<" + apsGetWorkordersResultValues[i] + ">");
|
|
}
|
|
Console.WriteLine(fillWithSpace("hasMore: ") + "<" + hasMore + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_apsGetWorkorderDetails
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "apsGetWorkorderDetails"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] apsGetWorkorderDetailsFilters
|
|
/// in String[] apsGetWorkorderDetailResultKeys
|
|
/// out String[] apsGetWorkorderDetailResultValues
|
|
/// out bool hasMore
|
|
/// </para>
|
|
public static void test_apsGetWorkorderDetails()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] apsGetWorkorderDetailsFilters = null;
|
|
String[] apsGetWorkorderDetailResultKeys = null;
|
|
String[] apsGetWorkorderDetailResultValues = null;
|
|
bool hasMore = false;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for apsGetWorkorderDetailsFilters: "));
|
|
int apsGetWorkorderDetailsFiltersSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
apsGetWorkorderDetailsFilters = new KeyValue[apsGetWorkorderDetailsFiltersSize];
|
|
for (int i=0; i<apsGetWorkorderDetailsFiltersSize; i++)
|
|
{
|
|
apsGetWorkorderDetailsFilters[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("apsGetWorkorderDetailsFilters[" + i + "] .key (String): "));
|
|
apsGetWorkorderDetailsFilters[i].key = getInput();
|
|
Console.Write(fillWithSpace("apsGetWorkorderDetailsFilters[" + i + "] .value (String): "));
|
|
apsGetWorkorderDetailsFilters[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for apsGetWorkorderDetailResultKeys: "));
|
|
int apsGetWorkorderDetailResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
apsGetWorkorderDetailResultKeys = new String[apsGetWorkorderDetailResultKeysSize];
|
|
for (int i=0; i<apsGetWorkorderDetailResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("apsGetWorkorderDetailResultKeys[" + i + "] (String): "));
|
|
apsGetWorkorderDetailResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.apsGetWorkorderDetails(sessionContext, stationNumber, apsGetWorkorderDetailsFilters, apsGetWorkorderDetailResultKeys, out apsGetWorkorderDetailResultValues, out hasMore);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; apsGetWorkorderDetailResultValues != null && i<apsGetWorkorderDetailResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("apsGetWorkorderDetailResultValues[" + i + "]: ") + "<" + apsGetWorkorderDetailResultValues[i] + ">");
|
|
}
|
|
Console.WriteLine(fillWithSpace("hasMore: ") + "<" + hasMore + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_apsGetWorkorderDetailsOptGroup
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "apsGetWorkorderDetailsOptGroup"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] apsGetWorkorderDetailsOptGroupFilters
|
|
/// in String[] apsGetWorkorderDetailsOptGroupResultKeys
|
|
/// out String[] apsGetWorkorderDetailsOptGroupResultValues
|
|
/// in KeyValue[] apsWorkorderOptimizationFilters
|
|
/// in String[] apsWorkorderOptimizationResultDataKeys
|
|
/// out String[] apsWorkorderOptimizationResultDataValues
|
|
/// out bool hasMore
|
|
/// </para>
|
|
public static void test_apsGetWorkorderDetailsOptGroup()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] apsGetWorkorderDetailsOptGroupFilters = null;
|
|
String[] apsGetWorkorderDetailsOptGroupResultKeys = null;
|
|
String[] apsGetWorkorderDetailsOptGroupResultValues = null;
|
|
KeyValue[] apsWorkorderOptimizationFilters = null;
|
|
String[] apsWorkorderOptimizationResultDataKeys = null;
|
|
String[] apsWorkorderOptimizationResultDataValues = null;
|
|
bool hasMore = false;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for apsGetWorkorderDetailsOptGroupFilters: "));
|
|
int apsGetWorkorderDetailsOptGroupFiltersSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
apsGetWorkorderDetailsOptGroupFilters = new KeyValue[apsGetWorkorderDetailsOptGroupFiltersSize];
|
|
for (int i=0; i<apsGetWorkorderDetailsOptGroupFiltersSize; i++)
|
|
{
|
|
apsGetWorkorderDetailsOptGroupFilters[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("apsGetWorkorderDetailsOptGroupFilters[" + i + "] .key (String): "));
|
|
apsGetWorkorderDetailsOptGroupFilters[i].key = getInput();
|
|
Console.Write(fillWithSpace("apsGetWorkorderDetailsOptGroupFilters[" + i + "] .value (String): "));
|
|
apsGetWorkorderDetailsOptGroupFilters[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for apsGetWorkorderDetailsOptGroupResultKeys: "));
|
|
int apsGetWorkorderDetailsOptGroupResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
apsGetWorkorderDetailsOptGroupResultKeys = new String[apsGetWorkorderDetailsOptGroupResultKeysSize];
|
|
for (int i=0; i<apsGetWorkorderDetailsOptGroupResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("apsGetWorkorderDetailsOptGroupResultKeys[" + i + "] (String): "));
|
|
apsGetWorkorderDetailsOptGroupResultKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for apsWorkorderOptimizationFilters: "));
|
|
int apsWorkorderOptimizationFiltersSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
apsWorkorderOptimizationFilters = new KeyValue[apsWorkorderOptimizationFiltersSize];
|
|
for (int i=0; i<apsWorkorderOptimizationFiltersSize; i++)
|
|
{
|
|
apsWorkorderOptimizationFilters[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("apsWorkorderOptimizationFilters[" + i + "] .key (String): "));
|
|
apsWorkorderOptimizationFilters[i].key = getInput();
|
|
Console.Write(fillWithSpace("apsWorkorderOptimizationFilters[" + i + "] .value (String): "));
|
|
apsWorkorderOptimizationFilters[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for apsWorkorderOptimizationResultDataKeys: "));
|
|
int apsWorkorderOptimizationResultDataKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
apsWorkorderOptimizationResultDataKeys = new String[apsWorkorderOptimizationResultDataKeysSize];
|
|
for (int i=0; i<apsWorkorderOptimizationResultDataKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("apsWorkorderOptimizationResultDataKeys[" + i + "] (String): "));
|
|
apsWorkorderOptimizationResultDataKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.apsGetWorkorderDetailsOptGroup(sessionContext, stationNumber, apsGetWorkorderDetailsOptGroupFilters, apsGetWorkorderDetailsOptGroupResultKeys, out apsGetWorkorderDetailsOptGroupResultValues, apsWorkorderOptimizationFilters, apsWorkorderOptimizationResultDataKeys, out apsWorkorderOptimizationResultDataValues, out hasMore);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; apsGetWorkorderDetailsOptGroupResultValues != null && i<apsGetWorkorderDetailsOptGroupResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("apsGetWorkorderDetailsOptGroupResultValues[" + i + "]: ") + "<" + apsGetWorkorderDetailsOptGroupResultValues[i] + ">");
|
|
}
|
|
for (int i=0; apsWorkorderOptimizationResultDataValues != null && i<apsWorkorderOptimizationResultDataValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("apsWorkorderOptimizationResultDataValues[" + i + "]: ") + "<" + apsWorkorderOptimizationResultDataValues[i] + ">");
|
|
}
|
|
Console.WriteLine(fillWithSpace("hasMore: ") + "<" + hasMore + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_apsGetStations
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "apsGetStations"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] apsGetStationsFilters
|
|
/// in String[] apsGetStationsResultKeys
|
|
/// out String[] apsGetStationsResultValues
|
|
/// out bool hasMore
|
|
/// </para>
|
|
public static void test_apsGetStations()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] apsGetStationsFilters = null;
|
|
String[] apsGetStationsResultKeys = null;
|
|
String[] apsGetStationsResultValues = null;
|
|
bool hasMore = false;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for apsGetStationsFilters: "));
|
|
int apsGetStationsFiltersSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
apsGetStationsFilters = new KeyValue[apsGetStationsFiltersSize];
|
|
for (int i=0; i<apsGetStationsFiltersSize; i++)
|
|
{
|
|
apsGetStationsFilters[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("apsGetStationsFilters[" + i + "] .key (String): "));
|
|
apsGetStationsFilters[i].key = getInput();
|
|
Console.Write(fillWithSpace("apsGetStationsFilters[" + i + "] .value (String): "));
|
|
apsGetStationsFilters[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for apsGetStationsResultKeys: "));
|
|
int apsGetStationsResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
apsGetStationsResultKeys = new String[apsGetStationsResultKeysSize];
|
|
for (int i=0; i<apsGetStationsResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("apsGetStationsResultKeys[" + i + "] (String): "));
|
|
apsGetStationsResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.apsGetStations(sessionContext, stationNumber, apsGetStationsFilters, apsGetStationsResultKeys, out apsGetStationsResultValues, out hasMore);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; apsGetStationsResultValues != null && i<apsGetStationsResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("apsGetStationsResultValues[" + i + "]: ") + "<" + apsGetStationsResultValues[i] + ">");
|
|
}
|
|
Console.WriteLine(fillWithSpace("hasMore: ") + "<" + hasMore + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_apsGetWorkers
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "apsGetWorkers"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] apsGetWorkersFilters
|
|
/// in String[] apsGetWorkersResultKeys
|
|
/// out String[] apsGetWorkersResultValues
|
|
/// out bool hasMore
|
|
/// </para>
|
|
public static void test_apsGetWorkers()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] apsGetWorkersFilters = null;
|
|
String[] apsGetWorkersResultKeys = null;
|
|
String[] apsGetWorkersResultValues = null;
|
|
bool hasMore = false;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for apsGetWorkersFilters: "));
|
|
int apsGetWorkersFiltersSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
apsGetWorkersFilters = new KeyValue[apsGetWorkersFiltersSize];
|
|
for (int i=0; i<apsGetWorkersFiltersSize; i++)
|
|
{
|
|
apsGetWorkersFilters[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("apsGetWorkersFilters[" + i + "] .key (String): "));
|
|
apsGetWorkersFilters[i].key = getInput();
|
|
Console.Write(fillWithSpace("apsGetWorkersFilters[" + i + "] .value (String): "));
|
|
apsGetWorkersFilters[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for apsGetWorkersResultKeys: "));
|
|
int apsGetWorkersResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
apsGetWorkersResultKeys = new String[apsGetWorkersResultKeysSize];
|
|
for (int i=0; i<apsGetWorkersResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("apsGetWorkersResultKeys[" + i + "] (String): "));
|
|
apsGetWorkersResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.apsGetWorkers(sessionContext, stationNumber, apsGetWorkersFilters, apsGetWorkersResultKeys, out apsGetWorkersResultValues, out hasMore);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; apsGetWorkersResultValues != null && i<apsGetWorkersResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("apsGetWorkersResultValues[" + i + "]: ") + "<" + apsGetWorkersResultValues[i] + ">");
|
|
}
|
|
Console.WriteLine(fillWithSpace("hasMore: ") + "<" + hasMore + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_apsGetWorkergroups
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "apsGetWorkergroups"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] apsGetWorkergroupsFilters
|
|
/// in String[] apsGetWorkergroupsResultKeys
|
|
/// out String[] apsGetWorkergroupsResultValues
|
|
/// out bool hasMore
|
|
/// </para>
|
|
public static void test_apsGetWorkergroups()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] apsGetWorkergroupsFilters = null;
|
|
String[] apsGetWorkergroupsResultKeys = null;
|
|
String[] apsGetWorkergroupsResultValues = null;
|
|
bool hasMore = false;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for apsGetWorkergroupsFilters: "));
|
|
int apsGetWorkergroupsFiltersSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
apsGetWorkergroupsFilters = new KeyValue[apsGetWorkergroupsFiltersSize];
|
|
for (int i=0; i<apsGetWorkergroupsFiltersSize; i++)
|
|
{
|
|
apsGetWorkergroupsFilters[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("apsGetWorkergroupsFilters[" + i + "] .key (String): "));
|
|
apsGetWorkergroupsFilters[i].key = getInput();
|
|
Console.Write(fillWithSpace("apsGetWorkergroupsFilters[" + i + "] .value (String): "));
|
|
apsGetWorkergroupsFilters[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for apsGetWorkergroupsResultKeys: "));
|
|
int apsGetWorkergroupsResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
apsGetWorkergroupsResultKeys = new String[apsGetWorkergroupsResultKeysSize];
|
|
for (int i=0; i<apsGetWorkergroupsResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("apsGetWorkergroupsResultKeys[" + i + "] (String): "));
|
|
apsGetWorkergroupsResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.apsGetWorkergroups(sessionContext, stationNumber, apsGetWorkergroupsFilters, apsGetWorkergroupsResultKeys, out apsGetWorkergroupsResultValues, out hasMore);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; apsGetWorkergroupsResultValues != null && i<apsGetWorkergroupsResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("apsGetWorkergroupsResultValues[" + i + "]: ") + "<" + apsGetWorkergroupsResultValues[i] + ">");
|
|
}
|
|
Console.WriteLine(fillWithSpace("hasMore: ") + "<" + hasMore + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_apsGetEquipments
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "apsGetEquipments"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] apsGetEquipmentsFilters
|
|
/// in String[] apsGetEquipmentsResultKeys
|
|
/// out String[] apsGetEquipmentsResultValues
|
|
/// out bool hasMore
|
|
/// </para>
|
|
public static void test_apsGetEquipments()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] apsGetEquipmentsFilters = null;
|
|
String[] apsGetEquipmentsResultKeys = null;
|
|
String[] apsGetEquipmentsResultValues = null;
|
|
bool hasMore = false;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for apsGetEquipmentsFilters: "));
|
|
int apsGetEquipmentsFiltersSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
apsGetEquipmentsFilters = new KeyValue[apsGetEquipmentsFiltersSize];
|
|
for (int i=0; i<apsGetEquipmentsFiltersSize; i++)
|
|
{
|
|
apsGetEquipmentsFilters[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("apsGetEquipmentsFilters[" + i + "] .key (String): "));
|
|
apsGetEquipmentsFilters[i].key = getInput();
|
|
Console.Write(fillWithSpace("apsGetEquipmentsFilters[" + i + "] .value (String): "));
|
|
apsGetEquipmentsFilters[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for apsGetEquipmentsResultKeys: "));
|
|
int apsGetEquipmentsResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
apsGetEquipmentsResultKeys = new String[apsGetEquipmentsResultKeysSize];
|
|
for (int i=0; i<apsGetEquipmentsResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("apsGetEquipmentsResultKeys[" + i + "] (String): "));
|
|
apsGetEquipmentsResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.apsGetEquipments(sessionContext, stationNumber, apsGetEquipmentsFilters, apsGetEquipmentsResultKeys, out apsGetEquipmentsResultValues, out hasMore);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; apsGetEquipmentsResultValues != null && i<apsGetEquipmentsResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("apsGetEquipmentsResultValues[" + i + "]: ") + "<" + apsGetEquipmentsResultValues[i] + ">");
|
|
}
|
|
Console.WriteLine(fillWithSpace("hasMore: ") + "<" + hasMore + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_crpManageRoute
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "crpManageRoute"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] routeUploadKeyValues
|
|
/// in String[] routeSegmentUploadKeys
|
|
/// in String[] routeSegmentUploadValues
|
|
/// out String[] routeSegmentUploadResult
|
|
/// in String[] routeSegmentTransportOrderUploadKeys
|
|
/// in String[] routeSegmentTransportOrderUploadValues
|
|
/// out String[] routeSegmentTransportOrderUploadResult
|
|
/// </para>
|
|
public static void test_crpManageRoute()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] routeUploadKeyValues = null;
|
|
String[] routeSegmentUploadKeys = null;
|
|
String[] routeSegmentUploadValues = null;
|
|
String[] routeSegmentUploadResult = null;
|
|
String[] routeSegmentTransportOrderUploadKeys = null;
|
|
String[] routeSegmentTransportOrderUploadValues = null;
|
|
String[] routeSegmentTransportOrderUploadResult = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for routeUploadKeyValues: "));
|
|
int routeUploadKeyValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
routeUploadKeyValues = new KeyValue[routeUploadKeyValuesSize];
|
|
for (int i=0; i<routeUploadKeyValuesSize; i++)
|
|
{
|
|
routeUploadKeyValues[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("routeUploadKeyValues[" + i + "] .key (String): "));
|
|
routeUploadKeyValues[i].key = getInput();
|
|
Console.Write(fillWithSpace("routeUploadKeyValues[" + i + "] .value (String): "));
|
|
routeUploadKeyValues[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for routeSegmentUploadKeys: "));
|
|
int routeSegmentUploadKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
routeSegmentUploadKeys = new String[routeSegmentUploadKeysSize];
|
|
for (int i=0; i<routeSegmentUploadKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("routeSegmentUploadKeys[" + i + "] (String): "));
|
|
routeSegmentUploadKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for routeSegmentUploadValues: "));
|
|
int routeSegmentUploadValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
routeSegmentUploadValues = new String[routeSegmentUploadValuesSize];
|
|
for (int i=0; i<routeSegmentUploadValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("routeSegmentUploadValues[" + i + "] (String): "));
|
|
routeSegmentUploadValues[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for routeSegmentTransportOrderUploadKeys: "));
|
|
int routeSegmentTransportOrderUploadKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
routeSegmentTransportOrderUploadKeys = new String[routeSegmentTransportOrderUploadKeysSize];
|
|
for (int i=0; i<routeSegmentTransportOrderUploadKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("routeSegmentTransportOrderUploadKeys[" + i + "] (String): "));
|
|
routeSegmentTransportOrderUploadKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for routeSegmentTransportOrderUploadValues: "));
|
|
int routeSegmentTransportOrderUploadValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
routeSegmentTransportOrderUploadValues = new String[routeSegmentTransportOrderUploadValuesSize];
|
|
for (int i=0; i<routeSegmentTransportOrderUploadValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("routeSegmentTransportOrderUploadValues[" + i + "] (String): "));
|
|
routeSegmentTransportOrderUploadValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.crpManageRoute(sessionContext, stationNumber, routeUploadKeyValues, routeSegmentUploadKeys, routeSegmentUploadValues, out routeSegmentUploadResult, routeSegmentTransportOrderUploadKeys, routeSegmentTransportOrderUploadValues, out routeSegmentTransportOrderUploadResult);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; routeSegmentUploadResult != null && i<routeSegmentUploadResult.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("routeSegmentUploadResult[" + i + "]: ") + "<" + routeSegmentUploadResult[i] + ">");
|
|
}
|
|
for (int i=0; routeSegmentTransportOrderUploadResult != null && i<routeSegmentTransportOrderUploadResult.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("routeSegmentTransportOrderUploadResult[" + i + "]: ") + "<" + routeSegmentTransportOrderUploadResult[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_crpGetRoute
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "crpGetRoute"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] routeFilter
|
|
/// in String[] routeResultKeys
|
|
/// out String[] routeResultValues
|
|
/// in String[] routeSegmentResultKeys
|
|
/// out String[] routeSegmentResultValues
|
|
/// in String[] routeSegmentTransportOrderResultKeys
|
|
/// out String[] routeSegmentTransportOrderResultValues
|
|
/// </para>
|
|
public static void test_crpGetRoute()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] routeFilter = null;
|
|
String[] routeResultKeys = null;
|
|
String[] routeResultValues = null;
|
|
String[] routeSegmentResultKeys = null;
|
|
String[] routeSegmentResultValues = null;
|
|
String[] routeSegmentTransportOrderResultKeys = null;
|
|
String[] routeSegmentTransportOrderResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for routeFilter: "));
|
|
int routeFilterSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
routeFilter = new KeyValue[routeFilterSize];
|
|
for (int i=0; i<routeFilterSize; i++)
|
|
{
|
|
routeFilter[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("routeFilter[" + i + "] .key (String): "));
|
|
routeFilter[i].key = getInput();
|
|
Console.Write(fillWithSpace("routeFilter[" + i + "] .value (String): "));
|
|
routeFilter[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for routeResultKeys: "));
|
|
int routeResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
routeResultKeys = new String[routeResultKeysSize];
|
|
for (int i=0; i<routeResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("routeResultKeys[" + i + "] (String): "));
|
|
routeResultKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for routeSegmentResultKeys: "));
|
|
int routeSegmentResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
routeSegmentResultKeys = new String[routeSegmentResultKeysSize];
|
|
for (int i=0; i<routeSegmentResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("routeSegmentResultKeys[" + i + "] (String): "));
|
|
routeSegmentResultKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for routeSegmentTransportOrderResultKeys: "));
|
|
int routeSegmentTransportOrderResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
routeSegmentTransportOrderResultKeys = new String[routeSegmentTransportOrderResultKeysSize];
|
|
for (int i=0; i<routeSegmentTransportOrderResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("routeSegmentTransportOrderResultKeys[" + i + "] (String): "));
|
|
routeSegmentTransportOrderResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.crpGetRoute(sessionContext, stationNumber, routeFilter, routeResultKeys, out routeResultValues, routeSegmentResultKeys, out routeSegmentResultValues, routeSegmentTransportOrderResultKeys, out routeSegmentTransportOrderResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; routeResultValues != null && i<routeResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("routeResultValues[" + i + "]: ") + "<" + routeResultValues[i] + ">");
|
|
}
|
|
for (int i=0; routeSegmentResultValues != null && i<routeSegmentResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("routeSegmentResultValues[" + i + "]: ") + "<" + routeSegmentResultValues[i] + ">");
|
|
}
|
|
for (int i=0; routeSegmentTransportOrderResultValues != null && i<routeSegmentTransportOrderResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("routeSegmentTransportOrderResultValues[" + i + "]: ") + "<" + routeSegmentTransportOrderResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_crpCreateTransportOrder
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "crpCreateTransportOrder"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] transportOrderUploadKeyValues
|
|
/// in String[] productionOrderUploadKeys
|
|
/// in String[] productionOrderUploadValues
|
|
/// in String[] pickingItemUploadKeys
|
|
/// in String[] pickingItemUploadValues
|
|
/// in String[] commissionItemUploadKeys
|
|
/// in String[] commissionItemUploadValues
|
|
/// </para>
|
|
public static void test_crpCreateTransportOrder()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] transportOrderUploadKeyValues = null;
|
|
String[] productionOrderUploadKeys = null;
|
|
String[] productionOrderUploadValues = null;
|
|
String[] pickingItemUploadKeys = null;
|
|
String[] pickingItemUploadValues = null;
|
|
String[] commissionItemUploadKeys = null;
|
|
String[] commissionItemUploadValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for transportOrderUploadKeyValues: "));
|
|
int transportOrderUploadKeyValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
transportOrderUploadKeyValues = new KeyValue[transportOrderUploadKeyValuesSize];
|
|
for (int i=0; i<transportOrderUploadKeyValuesSize; i++)
|
|
{
|
|
transportOrderUploadKeyValues[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("transportOrderUploadKeyValues[" + i + "] .key (String): "));
|
|
transportOrderUploadKeyValues[i].key = getInput();
|
|
Console.Write(fillWithSpace("transportOrderUploadKeyValues[" + i + "] .value (String): "));
|
|
transportOrderUploadKeyValues[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for productionOrderUploadKeys: "));
|
|
int productionOrderUploadKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
productionOrderUploadKeys = new String[productionOrderUploadKeysSize];
|
|
for (int i=0; i<productionOrderUploadKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("productionOrderUploadKeys[" + i + "] (String): "));
|
|
productionOrderUploadKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for productionOrderUploadValues: "));
|
|
int productionOrderUploadValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
productionOrderUploadValues = new String[productionOrderUploadValuesSize];
|
|
for (int i=0; i<productionOrderUploadValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("productionOrderUploadValues[" + i + "] (String): "));
|
|
productionOrderUploadValues[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for pickingItemUploadKeys: "));
|
|
int pickingItemUploadKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
pickingItemUploadKeys = new String[pickingItemUploadKeysSize];
|
|
for (int i=0; i<pickingItemUploadKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("pickingItemUploadKeys[" + i + "] (String): "));
|
|
pickingItemUploadKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for pickingItemUploadValues: "));
|
|
int pickingItemUploadValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
pickingItemUploadValues = new String[pickingItemUploadValuesSize];
|
|
for (int i=0; i<pickingItemUploadValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("pickingItemUploadValues[" + i + "] (String): "));
|
|
pickingItemUploadValues[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for commissionItemUploadKeys: "));
|
|
int commissionItemUploadKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
commissionItemUploadKeys = new String[commissionItemUploadKeysSize];
|
|
for (int i=0; i<commissionItemUploadKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("commissionItemUploadKeys[" + i + "] (String): "));
|
|
commissionItemUploadKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for commissionItemUploadValues: "));
|
|
int commissionItemUploadValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
commissionItemUploadValues = new String[commissionItemUploadValuesSize];
|
|
for (int i=0; i<commissionItemUploadValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("commissionItemUploadValues[" + i + "] (String): "));
|
|
commissionItemUploadValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.crpCreateTransportOrder(sessionContext, stationNumber, transportOrderUploadKeyValues, productionOrderUploadKeys, productionOrderUploadValues, pickingItemUploadKeys, pickingItemUploadValues, commissionItemUploadKeys, commissionItemUploadValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_crpChangeTransportOrder
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "crpChangeTransportOrder"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] transportOrderUploadKeyValues
|
|
/// in String[] productionOrderUploadKeys
|
|
/// in String[] productionOrderUploadValues
|
|
/// out String[] productionOrderUploadResult
|
|
/// in String[] pickingItemUploadKeys
|
|
/// in String[] pickingItemUploadValues
|
|
/// out String[] pickingItemUploadResult
|
|
/// in String[] commissionItemUploadKeys
|
|
/// in String[] commissionItemUploadValues
|
|
/// out String[] commissionItemUploadResult
|
|
/// </para>
|
|
public static void test_crpChangeTransportOrder()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] transportOrderUploadKeyValues = null;
|
|
String[] productionOrderUploadKeys = null;
|
|
String[] productionOrderUploadValues = null;
|
|
String[] productionOrderUploadResult = null;
|
|
String[] pickingItemUploadKeys = null;
|
|
String[] pickingItemUploadValues = null;
|
|
String[] pickingItemUploadResult = null;
|
|
String[] commissionItemUploadKeys = null;
|
|
String[] commissionItemUploadValues = null;
|
|
String[] commissionItemUploadResult = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for transportOrderUploadKeyValues: "));
|
|
int transportOrderUploadKeyValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
transportOrderUploadKeyValues = new KeyValue[transportOrderUploadKeyValuesSize];
|
|
for (int i=0; i<transportOrderUploadKeyValuesSize; i++)
|
|
{
|
|
transportOrderUploadKeyValues[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("transportOrderUploadKeyValues[" + i + "] .key (String): "));
|
|
transportOrderUploadKeyValues[i].key = getInput();
|
|
Console.Write(fillWithSpace("transportOrderUploadKeyValues[" + i + "] .value (String): "));
|
|
transportOrderUploadKeyValues[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for productionOrderUploadKeys: "));
|
|
int productionOrderUploadKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
productionOrderUploadKeys = new String[productionOrderUploadKeysSize];
|
|
for (int i=0; i<productionOrderUploadKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("productionOrderUploadKeys[" + i + "] (String): "));
|
|
productionOrderUploadKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for productionOrderUploadValues: "));
|
|
int productionOrderUploadValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
productionOrderUploadValues = new String[productionOrderUploadValuesSize];
|
|
for (int i=0; i<productionOrderUploadValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("productionOrderUploadValues[" + i + "] (String): "));
|
|
productionOrderUploadValues[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for pickingItemUploadKeys: "));
|
|
int pickingItemUploadKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
pickingItemUploadKeys = new String[pickingItemUploadKeysSize];
|
|
for (int i=0; i<pickingItemUploadKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("pickingItemUploadKeys[" + i + "] (String): "));
|
|
pickingItemUploadKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for pickingItemUploadValues: "));
|
|
int pickingItemUploadValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
pickingItemUploadValues = new String[pickingItemUploadValuesSize];
|
|
for (int i=0; i<pickingItemUploadValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("pickingItemUploadValues[" + i + "] (String): "));
|
|
pickingItemUploadValues[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for commissionItemUploadKeys: "));
|
|
int commissionItemUploadKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
commissionItemUploadKeys = new String[commissionItemUploadKeysSize];
|
|
for (int i=0; i<commissionItemUploadKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("commissionItemUploadKeys[" + i + "] (String): "));
|
|
commissionItemUploadKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for commissionItemUploadValues: "));
|
|
int commissionItemUploadValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
commissionItemUploadValues = new String[commissionItemUploadValuesSize];
|
|
for (int i=0; i<commissionItemUploadValuesSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("commissionItemUploadValues[" + i + "] (String): "));
|
|
commissionItemUploadValues[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.crpChangeTransportOrder(sessionContext, stationNumber, transportOrderUploadKeyValues, productionOrderUploadKeys, productionOrderUploadValues, out productionOrderUploadResult, pickingItemUploadKeys, pickingItemUploadValues, out pickingItemUploadResult, commissionItemUploadKeys, commissionItemUploadValues, out commissionItemUploadResult);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; productionOrderUploadResult != null && i<productionOrderUploadResult.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("productionOrderUploadResult[" + i + "]: ") + "<" + productionOrderUploadResult[i] + ">");
|
|
}
|
|
for (int i=0; pickingItemUploadResult != null && i<pickingItemUploadResult.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("pickingItemUploadResult[" + i + "]: ") + "<" + pickingItemUploadResult[i] + ">");
|
|
}
|
|
for (int i=0; commissionItemUploadResult != null && i<commissionItemUploadResult.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("commissionItemUploadResult[" + i + "]: ") + "<" + commissionItemUploadResult[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_crpGetTransportOrder
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "crpGetTransportOrder"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String stationNumber
|
|
/// in KeyValue[] transportOrderFilterKeyValues
|
|
/// in String[] transportOrderResultKeys
|
|
/// out String[] transportOrderResultValues
|
|
/// in String[] productionOrderResultKeys
|
|
/// out String[] productionOrderResultValues
|
|
/// in String[] pickingItemResultKeys
|
|
/// out String[] pickingItemResultValues
|
|
/// in String[] commissionItemResultKeys
|
|
/// out String[] commissionItemResultValues
|
|
/// </para>
|
|
public static void test_crpGetTransportOrder()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String stationNumber = "";
|
|
KeyValue[] transportOrderFilterKeyValues = null;
|
|
String[] transportOrderResultKeys = null;
|
|
String[] transportOrderResultValues = null;
|
|
String[] productionOrderResultKeys = null;
|
|
String[] productionOrderResultValues = null;
|
|
String[] pickingItemResultKeys = null;
|
|
String[] pickingItemResultValues = null;
|
|
String[] commissionItemResultKeys = null;
|
|
String[] commissionItemResultValues = null;
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("stationNumber (String): "));
|
|
stationNumber = getInput();
|
|
Console.Write(fillWithSpace("Enter size for transportOrderFilterKeyValues: "));
|
|
int transportOrderFilterKeyValuesSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
transportOrderFilterKeyValues = new KeyValue[transportOrderFilterKeyValuesSize];
|
|
for (int i=0; i<transportOrderFilterKeyValuesSize; i++)
|
|
{
|
|
transportOrderFilterKeyValues[i] = new KeyValue();
|
|
Console.Write(fillWithSpace("transportOrderFilterKeyValues[" + i + "] .key (String): "));
|
|
transportOrderFilterKeyValues[i].key = getInput();
|
|
Console.Write(fillWithSpace("transportOrderFilterKeyValues[" + i + "] .value (String): "));
|
|
transportOrderFilterKeyValues[i].value = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for transportOrderResultKeys: "));
|
|
int transportOrderResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
transportOrderResultKeys = new String[transportOrderResultKeysSize];
|
|
for (int i=0; i<transportOrderResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("transportOrderResultKeys[" + i + "] (String): "));
|
|
transportOrderResultKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for productionOrderResultKeys: "));
|
|
int productionOrderResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
productionOrderResultKeys = new String[productionOrderResultKeysSize];
|
|
for (int i=0; i<productionOrderResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("productionOrderResultKeys[" + i + "] (String): "));
|
|
productionOrderResultKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for pickingItemResultKeys: "));
|
|
int pickingItemResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
pickingItemResultKeys = new String[pickingItemResultKeysSize];
|
|
for (int i=0; i<pickingItemResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("pickingItemResultKeys[" + i + "] (String): "));
|
|
pickingItemResultKeys[i] = getInput();
|
|
}
|
|
Console.Write(fillWithSpace("Enter size for commissionItemResultKeys: "));
|
|
int commissionItemResultKeysSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
commissionItemResultKeys = new String[commissionItemResultKeysSize];
|
|
for (int i=0; i<commissionItemResultKeysSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("commissionItemResultKeys[" + i + "] (String): "));
|
|
commissionItemResultKeys[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.crpGetTransportOrder(sessionContext, stationNumber, transportOrderFilterKeyValues, transportOrderResultKeys, out transportOrderResultValues, productionOrderResultKeys, out productionOrderResultValues, pickingItemResultKeys, out pickingItemResultValues, commissionItemResultKeys, out commissionItemResultValues);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
for (int i=0; transportOrderResultValues != null && i<transportOrderResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("transportOrderResultValues[" + i + "]: ") + "<" + transportOrderResultValues[i] + ">");
|
|
}
|
|
for (int i=0; productionOrderResultValues != null && i<productionOrderResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("productionOrderResultValues[" + i + "]: ") + "<" + productionOrderResultValues[i] + ">");
|
|
}
|
|
for (int i=0; pickingItemResultValues != null && i<pickingItemResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("pickingItemResultValues[" + i + "]: ") + "<" + pickingItemResultValues[i] + ">");
|
|
}
|
|
for (int i=0; commissionItemResultValues != null && i<commissionItemResultValues.Length; i++)
|
|
{
|
|
Console.WriteLine(fillWithSpace("commissionItemResultValues[" + i + "]: ") + "<" + commissionItemResultValues[i] + ">");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_msgPublish
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "msgPublish"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String topic
|
|
/// in String message
|
|
/// out String msgId
|
|
/// </para>
|
|
public static void test_msgPublish()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String topic = "";
|
|
String message = "";
|
|
String msgId = "";
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("topic (String): "));
|
|
topic = getInput();
|
|
Console.Write(fillWithSpace("message (String): "));
|
|
message = getInput();
|
|
|
|
// call imsapi function
|
|
result = imsapi.msgPublish(sessionContext, topic, message, out msgId);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
Console.WriteLine(fillWithSpace("msgId: ") + "<" + msgId + ">");
|
|
}
|
|
/// <summary>
|
|
/// test_msgSubscribe
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "msgSubscribe"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// in String[] topics
|
|
/// in IMSApiDotNetListener listener
|
|
/// </para>
|
|
public static void test_msgSubscribe()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
String[] topics = null;
|
|
|
|
// read values for 'in' and 'inout' arguments
|
|
Console.Write(fillWithSpace("Enter size for topics: "));
|
|
int topicsSize = Int32.Parse(getInput());
|
|
// instantiate array
|
|
topics = new String[topicsSize];
|
|
for (int i=0; i<topicsSize; i++)
|
|
{
|
|
Console.Write(fillWithSpace("topics[" + i + "] (String): "));
|
|
topics[i] = getInput();
|
|
}
|
|
|
|
// call imsapi function
|
|
result = imsapi.msgSubscribe(sessionContext, topics, myEventListeners[sessionContext.sessionId]);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
}
|
|
|
|
private class MyEventListener : IMSApiDotNetEventListener
|
|
{
|
|
private long sessionId;
|
|
|
|
public MyEventListener(long sessionId)
|
|
{
|
|
this.sessionId = sessionId;
|
|
|
|
}
|
|
|
|
public void onMessage(MessageRecord message)
|
|
{
|
|
Console.WriteLine("Message received! sessionId=" + sessionId + ", msgId=" + message.msgId + ", topic=" + message.topic + ", value=" + message.value);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// test_msgUnsubscribe
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// demonstrates the use of the imsapi.net function "msgUnsubscribe"
|
|
/// </remarks>
|
|
/// <para>
|
|
/// in IMSApiSessionContextStruct sessionContext
|
|
/// </para>
|
|
public static void test_msgUnsubscribe()
|
|
{
|
|
/// declare variables
|
|
int result = 0;
|
|
|
|
// call imsapi function
|
|
result = imsapi.msgUnsubscribe(sessionContext);
|
|
if (result != IMSApiDotNetConstants.RES_OK)
|
|
{
|
|
printErrorText(result);
|
|
return;
|
|
}
|
|
|
|
// use or print the result and output values
|
|
Console.WriteLine();
|
|
Console.WriteLine(fillWithSpace("result value: ") + "<" + result + ">");
|
|
}
|
|
}
|
|
}
|