Recipe Groups
- The GetRecipeNames Function returns a list of the Recipe Groups.
- Returns Empty String Array if service is not reachable.
- NetworkNode is the name of the network node of the OAS Service to connect to. Leave blank for localhost connection.
- Optional ErrorString will be set to Success when function is successful and an error message when in error.
C#
using System;
namespace OASDataSample
{
class Program
{
static OASConfig.Config oasc = new OASConfig.Config();
static void Main(string[] args)
{
string NetworkNode = "";
Array Groups = null;
string ErrorString = "";
Groups = oasc.GetRecipeNames(NetworkNode, ref ErrorString);
if (ErrorString == "Success")
{
foreach (string Group in Groups)
{
Console.WriteLine(Group);
}
if (Groups.Length == 0)
{
Console.WriteLine("No Recipes to show.");
}
}
else
{
Console.WriteLine(ErrorString);
}
}
}
}
VB
Imports System
Namespace OASDataSample
Class Program
Shared oasc As OASConfig.Config = New OASConfig.Config()
Public Shared Sub Main(ByVal args As String())
Dim NetworkNode As String = ""
Dim Groups As Array = Nothing
Dim ErrorString As String = ""
Groups = oasc.GetRecipeNames(NetworkNode, ErrorString)
If ErrorString = "Success" Then
For Each Group As String In Groups
Console.WriteLine(Group)
Next
If Groups.Length = 0 Then
Console.WriteLine("No Recipes to show.")
End If
Else
Console.WriteLine(ErrorString)
End If
End Sub
End Class
End Namespace
- The AddRecipeGroup Function adds a Recipe Group to the existing Recipe configuration.
- Returns -1 if service is not reachable.
- Returns 1 if successful.
- Returns 0 if the Group already exists or adding the Group failed.
- Group is the name of the Group to add.
- NetworkNode is the name of the network node of the OAS Service to connect to. Leave blank for localhost connection.
- Optional ErrorString will be set to Success when function is successful and an error message when in error.
C#
using System;
namespace OASDataSample
{
class Program
{
static OASConfig.Config oasc = new OASConfig.Config();
static void Main(string[] args)
{
string NetworkNode = "";
Int32 ResultInt32 = 0;
string ErrorString = "";
string group = "";
ResultInt32 = oasc.AddRecipeGroup(group, NetworkNode, ref ErrorString);
if (ResultInt32 == -1)
{
Console.WriteLine("OAS Service not reached.");
}
else if (ResultInt32 == 1)
{
Console.WriteLine("Group successfully added.");
}
else
{
Console.WriteLine(ErrorString);
}
}
}
}
VB
Imports System
Namespace OASDataSample
Class Program
Shared oasc As OASConfig.Config = New OASConfig.Config()
Public Shared Sub Main(ByVal args As String())
Dim NetworkNode As String = ""
Dim ResultInt32 As Int32 = 0
Dim ErrorString As String = ""
Dim group As String = ""
ResultInt32 = oasc.AddRecipeGroup(group, NetworkNode, ErrorString)
If ResultInt32 = -1 Then
Console.WriteLine("OAS Service not reached.")
ElseIf ResultInt32 = 1 Then
Console.WriteLine("Group successfully added.")
Else
Console.WriteLine(ErrorString)
End If
End Sub
End Class
End Namespace
- The RemoveRecipeGroup Function removes a Recipe Group from the existing Recipe configuration.
- Returns -1 if service is not reachable.
- Returns 1 if successful.
- Returns 0 if the Group does not exist or removing the Group failed.
- Group is the name of the Group to remove.
- NetworkNode is the name of the network node of the OAS Service to connect to. Leave blank for localhost connection.
- Optional ErrorString will be set to Success when function is successful and an error message when in error.
C#
using System;
namespace OASDataSample
{
class Program
{
static OASConfig.Config oasc = new OASConfig.Config();
static void Main(string[] args)
{
string NetworkNode = "";
Int32 ResultInt32 = 0;
string group = "";
string ErrorString = "";
ResultInt32 = oasc.RemoveRecipeGroup(group, NetworkNode, ref ErrorString);
if (ResultInt32 == -1)
{
Console.WriteLine("OAS Service not reached.");
}
else if (ResultInt32 == 1)
{
Console.WriteLine("Group successfully removed.");
}
else
{
Console.WriteLine(ErrorString);
}
}
}
}
VB
Imports System
Namespace OASDataSample
Class Program
Shared oasc As OASConfig.Config = New OASConfig.Config()
Public Shared Sub Main(ByVal args As String())
Dim NetworkNode As String = ""
Dim ResultInt32 As Int32 = 0
Dim group As String = ""
Dim ErrorString As String = ""
ResultInt32 = oasc.RemoveRecipeGroup(group, NetworkNode, ErrorString)
If ResultInt32 = -1 Then
Console.WriteLine("OAS Service not reached.")
ElseIf ResultInt32 = 1 Then
Console.WriteLine("Group successfully removed.")
Else
Console.WriteLine(ErrorString)
End If
End Sub
End Class
End Namespace
The GetRecipeParameterStrings Function returns an array of Strings containing all property types available for each Recipe Group.
Returns Empty String Array if service is not reachable.
Returns a String Array of property types for all possible Parameters for a Recipe Group.
NetworkNode is the name of the network node of the OAS Service to connect to. Leave blank for localhost connection.
C#
using System;
namespace OASDataSample
{
class Program
{
static OASConfig.Config oasc = new OASConfig.Config();
static void Main(string[] args)
{
string NetworkNode = "";
string[] Parameters = null;
Parameters = oasc.GetRecipeParameterStrings(NetworkNode);
foreach (string Parameter in Parameters)
{
Console.WriteLine(Parameter);
}
}
}
}
VB
Imports System
Namespace OASDataSample
Class Program
Shared oasc As OASConfig.Config = New OASConfig.Config()
Public Shared Sub Main(ByVal args As String())
Dim NetworkNode As String = ""
Dim Parameters As String() = Nothing
Parameters = oasc.GetRecipeParameterStrings(NetworkNode)
For Each Parameter As String In Parameters
Console.WriteLine(Parameter)
Next
End Sub
End Class
End Namespace
The GetRecipe_Parameter_Value Function returns an object value for the Recipe Group and Parameter specified.
Returns nothing if service is not reachable.
Parameter is a String of the Parameter Type desired of the Recipe Group.
Group is a String of the Recipe Group desired.
NetworkNode is the name of the network node of the OAS Service to connect to. Leave blank for localhost connection.
Optional ErrorString will be set to Success when function is successful and an error message when in error.
C#
using System;
namespace OASDataSample
{
class Program
{
static OASConfig.Config oasc = new OASConfig.Config();
static void Main(string[] args)
{
string NetworkNode = "";
object ResultObject = null;
string ErrorString = "";
string parameter = "";
string group = "";
ResultObject = oasc.GetRecipe_Parameter_Value(parameter, group, NetworkNode, ref ErrorString);
if (ErrorString == "Success")
{
try
{
Console.WriteLine(ResultObject.ToString());
}
catch (Exception ex)
{ }
}
else
{
Console.WriteLine(ErrorString);
}
}
}
}
VB
Imports System
Namespace OASDataSample
Class Program
Shared oasc As OASConfig.Config = New OASConfig.Config()
Public Shared Sub Main(ByVal args As String())
Dim NetworkNode As String = ""
Dim ResultObject As Object = Nothing
Dim ErrorString As String = ""
Dim parameter As String = ""
Dim group As String = ""
ResultObject = oasc.GetRecipe_Parameter_Value(parameter, group, NetworkNode, ErrorString)
If ErrorString = "Success" Then
Try
Console.WriteLine(ResultObject.ToString())
Catch ex As Exception
End Try
Else
Console.WriteLine(ErrorString)
End If
End Sub
End Class
End Namespace
- The GetRecipe_Parameter_Values Function returns an array of object values for the Recipe Group specified.
- The order of the array corresponds with the GetRecipeParameterStrings Function order.
- Returns empty array if service is not reachable.
- Group is a String of the Recipe Group desired.
- NetworkNode is the name of the network node of the OAS Service to connect to. Leave blank for localhost connection.
- Optional ErrorString will be set to Success when function is successful and an error message when in error.
C#
using System;
namespace OASDataSample
{
class Program
{
static OASConfig.Config oasc = new OASConfig.Config();
static void Main(string[] args)
{
string NetworkNode = "";
object[] ResultObjects = null;
string ResultString = null;
string ErrorString = "";
string group = "";
ResultObjects = oasc.GetRecipe_Parameter_Values(group, NetworkNode, ref ErrorString);
if (ErrorString == "Success")
{
foreach (object ResultObject in ResultObjects)
{
try
{
if (ResultObject == null)
{
ResultString = "";
}
else
{
ResultString = ResultObject.ToString();
}
Console.WriteLine(ResultString);
}
catch (Exception ex)
{
Console.WriteLine("Error Converting Object");
}
}
if (ResultObjects.Length == 0)
{
Console.WriteLine("None to show.");
}
}
else
{
Console.WriteLine(ErrorString);
}
}
}
}
VB
Imports System
Namespace OASDataSample
Class Program
Shared oasc As OASConfig.Config = New OASConfig.Config()
Public Shared Sub Main(ByVal args As String())
Dim NetworkNode As String = ""
Dim ResultObjects As Object() = Nothing
Dim ResultString As String = Nothing
Dim ErrorString As String = ""
Dim group As String = ""
ResultObjects = oasc.GetRecipe_Parameter_Values(group, NetworkNode, ErrorString)
If ErrorString = "Success" Then
For Each ResultObject As Object In ResultObjects
Try
If ResultObject Is Nothing Then
ResultString = ""
Else
ResultString = ResultObject.ToString()
End If
Console.WriteLine(ResultString)
Catch ex As Exception
Console.WriteLine("Error Converting Object")
End Try
Next
If ResultObjects.Length = 0 Then
Console.WriteLine("None to show.")
End If
Else
Console.WriteLine(ErrorString)
End If
End Sub
End Class
End Namespace
- The SetRecipe_Parameter_Value Function sets an object value for the Recipe Group and Parameter specified.
- Returns -1 if service is not reachable.
- Returns 0 if the Group does not exist or the value did not get set correctly.
- Returns 1 if the function was successful.
- Parameter is a String of the Parameter Type desired of the Recipe Group.
- Value is the desired value to set.
- Group is a String of the Recipe Group desired.
- NetworkNode is the name of the network node of the OAS Service to connect to. Leave blank for localhost connection.
- Optional ErrorString will be set to Success when function is successful and an error message when in error.
C#
using System;
namespace OASDataSample
{
class Program
{
static OASConfig.Config oasc = new OASConfig.Config();
static void Main(string[] args)
{
string NetworkNode = "";
Int32 ResultInt32 = 0;
string ErrorString = "";
string parameter = "";
string value = "";
string group = "";
ResultInt32 = oasc.SetRecipe_Parameter_Value(parameter, value, group, NetworkNode, ref ErrorString);
if (ResultInt32 == -1)
{
Console.WriteLine("OAS Service not reached.");
}
else if (ResultInt32 == 1)
{
Console.WriteLine("Parameter Successfully Updated.");
}
else
{
Console.WriteLine(ErrorString);
}
}
}
}
VB
Imports System
Namespace OASDataSample
Class Program
Shared oasc As OASConfig.Config = New OASConfig.Config()
Public Shared Sub Main(ByVal args As String())
Dim NetworkNode As String = ""
Dim ResultInt32 As Int32 = 0
Dim ErrorString As String = ""
Dim parameter As String = ""
Dim value As String = ""
Dim group As String = ""
ResultInt32 = oasc.SetRecipe_Parameter_Value(parameter, value, group, NetworkNode, ErrorString)
If ResultInt32 = -1 Then
Console.WriteLine("OAS Service not reached.")
ElseIf ResultInt32 = 1 Then
Console.WriteLine("Parameter Successfully Updated.")
Else
Console.WriteLine(ErrorString)
End If
End Sub
End Class
End Namespace
- The SaveRecipeConfiguration Subroutine saves the current Recipe configuration to the specified file path.
- NetworkNode is the name of the network node of the OAS Service to connect to. Leave blank for localhost connection.
- Optional ErrorString will be set to Success when function is successful and an error message when in error.
C#
using System;
namespace OASDataSample
{
class Program
{
static OASConfig.Config oasc = new OASConfig.Config();
static void Main(string[] args)
{
string NetworkNode = "";
string path = "";
string ErrorString = "";
oasc.SaveRecipeConfiguration(path, NetworkNode, ref ErrorString);
if (ErrorString != "Success")
{
Console.WriteLine(ErrorString);
}
}
}
}
VB
Imports System
Namespace OASDataSample
Class Program
Shared oasc As OASConfig.Config = New OASConfig.Config()
Public Shared Sub Main(ByVal args As String())
Dim NetworkNode As String = ""
Dim path As String = ""
Dim ErrorString As String = ""
oasc.SaveRecipeConfiguration(path, NetworkNode, ErrorString)
If ErrorString <> "Success" Then
Console.WriteLine(ErrorString)
End If
End Sub
End Class
End Namespace
- The LoadRecipeConfiguration Subroutine saves the current Recipe configuration to the specified file path.
- NetworkNode is the name of the network node of the OAS Service to connect to. Leave blank for localhost connection.
- Optional ErrorString will be set to Success when function is successful and an error message when in error.
C#
using System;
namespace OASDataSample
{
class Program
{
static OASConfig.Config oasc = new OASConfig.Config();
static void Main(string[] args)
{
string NetworkNode = "";
string path = "";
string ErrorString = "";
oasc.LoadRecipeConfiguration(path, NetworkNode, ref ErrorString);
if (ErrorString != "Success")
{
Console.WriteLine(ErrorString);
}
}
}
}
VB
Imports System
Namespace OASDataSample
Class Program
Shared oasc As OASConfig.Config = New OASConfig.Config()
Public Shared Sub Main(ByVal args As String())
Dim NetworkNode As String = ""
Dim path As String = ""
Dim ErrorString As String = ""
oasc.LoadRecipeConfiguration(path, NetworkNode, ErrorString)
If ErrorString <> "Success" Then
Console.WriteLine(ErrorString)
End If
End Sub
End Class
End Namespace