PL.Net
These classes enable InterDynamics' Planimate® platform to be integrated in dotNET projects. Code is written in C# and VS2013 projects are provided.
|
This implements communication with Planimate using callbacks and works both with Planimate being a called DLL or Planimate being the caller to dotNET. More...
Public Member Functions | |
delegate ePLRESULT | tPL_BroadcastCallback (IntPtr broadcast, int no_params, [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStr, SizeParamIndex=1)] string[] tuple_names, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex=1)] double[] tuple_values, IntPtr user_data) |
Planimate® broadcast callback function definition More... | |
delegate ePLRESULT | tPL_PauseCallback (double the_time, ePLPauseReason stop_reason, IntPtr userdata) |
Planimate has paused callback function More... | |
PLEngineCore () | |
Engine constructor More... | |
ePLRESULT | InitPLEngine (String dll_pathname, string cmdline, IntPtr window_handle) |
Initialise the Planimate® engine for use when embedding PL in a dotNET application More... | |
void | InitPLEngine (IntPtr[] pl_proctable) |
Initialise this for use with an existing Planimate which is calling C# using the PLCLR bridge DLL. PLCLR attempts to call the instantiated class which should call this if the engine is required. More... | |
void | TermPLEngine () |
Clean up gracefully. This is only required if Planimate is being embedded and the caller wants to gracefully shut it down without closing themselves. More... | |
ePLRESULT | RunCommand (ePLRunCMD cmd) |
Send a run command to the Planimate® engine. More... | |
void | SuspendThread () |
Suspend the engine thread. More... | |
void | ResumeThread () |
Resume the engine thread. More... | |
string | PlanimateVersion () |
Returns the Planimate® version powering the engine. More... | |
double | GetSystemInfo (ePLSysInfo sysinfo_id) |
Gets Planimate® System info. Times are in seconds with 0 = the run start date More... | |
ePLRESULT | SetSystemInfo (ePLSysInfo sysinfo_id, double value) |
Sets writable Planimate® System info. Times are in seconds with 0 = the run start date More... | |
IntPtr | FindDataObjectName (string DO_name) |
Finds a Planimate® data object by name More... | |
eDOTypes | DataObjectType (IntPtr data_object) |
Returns the data object type More... | |
int | Rows (IntPtr data_object) |
Returns the number of rows in a table data object More... | |
int | Columns (IntPtr data_object) |
Returns the number of columns in a table data object More... | |
string | ColumnName (IntPtr data_object, int column) |
Returns the column name of the specified column More... | |
eTFUnit | GetColumnFormat (IntPtr data_object, int column) |
Returns Planimate® value format of the specified column More... | |
IntPtr | GetColumnLabelList (IntPtr data_object, int column) |
Returns Planimate® label list that the specified column is formatted to. More... | |
int | FindColumn (IntPtr data_object, string col_name) |
Finds the column index based on the string name of the column More... | |
double | GetCell (IntPtr data_object, int row, int col) |
Gets the value from a cell More... | |
ePLRESULT | SetCell (IntPtr data_object, int row, int col, double data) |
Sets the value of a cell More... | |
ePLRESULT | SetCell (IntPtr data_object, int row, int col, string data) |
Sets the value of a Free Text cell More... | |
string | GetCellText (IntPtr data_object, int row, int col) |
Gets the text from a Free Text cell More... | |
IntPtr | GetNamedLabelList (string list_name) |
Returns a label list object based on a string label list name More... | |
string | LookUpLabelLValue (IntPtr data_object, Int32 index) |
Returns the label string based on a long(Int32) label index More... | |
string | LookUpLabelDValue (IntPtr data_object, double index) |
Returns the label string based on a double label index More... | |
Int32 | LookUpLabelIndex (IntPtr data_object, string label) |
Returns the label index based on a label string More... | |
ePLRESULT | GetColumn (IntPtr data_object, int column, int rows, double[] into) |
Returns a column as an array More... | |
ePLRESULT | SetColumn (IntPtr data_object, int column, int rows, double[] to) |
Sets an array to a column More... | |
ePLRESULT | UpdateDataTable (ref DataTable pl_table, IntPtr data_object, Boolean formatted) |
Updates a DataTable object with data from a Planimate® data object table and returns it as a DataTable. If the DataTable is specified to be formatted, all columns will be correct .NET data formats. Unformatted data is formatted as type Double More... | |
ePLRESULT | UpdateDataTable (ref DataTable rTable, string DO_name, Boolean formatted) |
Finds a Planimate® data object by name and updates the supplied DataTable. If the DataTable is specified to be formatted, all columns will be correct .NET data formats. Unformatted data is formatted as type Double More... | |
DataTable | GetDataTable (IntPtr data_object, Boolean formatted) |
Gets a Planimate® data object table and returns it as a DataTable. If the DataTable is specified to be formatted, all columns will be correct .NET data formats. Unformatted data is formatted as type Double More... | |
DataTable | GetDataTable (string DO_name, Boolean formatted) |
Finds a Planimate® data object by name and returns it as a DataTable. If the DataTable is specified to be formatted, all columns will be correct .NET data formats. Unformatted data is formatted as type Double More... | |
ePLRESULT | SetDataTable (ref DataTable data_table, IntPtr data_object) |
Sets a Planimate® data object table and from a DataTable. More... | |
IntPtr | FindBroadcastName (string BC_name) |
Returns a broadcast object based on a string broadcast name More... | |
ePLRESULT | SendBroadcast (IntPtr broadcast) |
Sends a broadcast into the engine based on broadcast object More... | |
ePLRESULT | SendBroadcast (string BC_name) |
Sends a broadcast into the engine based on broadcast name More... | |
ePLRESULT | SendBroadcast (IntPtr broadcast, int no_params, string[] tuple_names, double[] tuple_values) |
Sends a broadcast into the engine based on broadcast object and include tuple data for the item More... | |
ePLRESULT | SendBroadcast (string BC_name, int no_params, string[] tuple_names, double[] tuple_values) |
Sends a broadcast into the engine based on broadcast name and include tuple data for the item More... | |
ePLRESULT | RegisterBroadcastCallback (IntPtr broadcast, tPL_BroadcastCallback callback_func) |
Broadcast callback enables a user provided function to be called every time Planimate sends a defined broadcast. Thread Notes: More... | |
ePLRESULT | RegisterBroadcastCallback (string BC_name, tPL_BroadcastCallback callback_func) |
Register broadcast callback using broadcast name. More... | |
ePLRESULT | RegisterPauseCallback (tPL_PauseCallback callback_func, IntPtr userdata) |
Pause callback enables a user provided function to be called every time Planimate becomes paused. This function is called in PL's thread context so do as little as possible and message to your main thread as required. More... | |
ePLRESULT | ConvertStringToPLValue (string str, IntPtr val, eTFUnit format) |
Converts a string to a Planimate® value based on the specified Planimate® format More... | |
DateTime | ConvertFromPLTimestamp (double timestamp) |
Converts a Planimate® timestamp (seconds) into a DateTime structure. More... | |
double | ConvertToPLTimestamp (DateTime date) |
Converts a DateTime structure into a Planimate® timestamp (seconds). More... | |
This implements communication with Planimate using callbacks and works both with Planimate being a called DLL or Planimate being the caller to dotNET.
|
inline |
Engine constructor
|
inline |
Returns the column name of the specified column
data_object | Pointer to Planimate® data object |
column | Index of the column |
|
inline |
Returns the number of columns in a table data object
data_object | Pointer to Planimate® data object |
|
inline |
Converts a Planimate® timestamp (seconds) into a DateTime structure.
timestamp | Planimate® timestamp (seconds from offset) |
|
inline |
Converts a string to a Planimate® value based on the specified Planimate® format
str | String to convert |
val | Pointer to value that will be returned (as double) |
format | Planimate® format of the string 'str' |
|
inline |
Converts a DateTime structure into a Planimate® timestamp (seconds).
date | DateTime structure to convert |
|
inline |
Returns the data object type
data_object | Pointer to Planimate® data object |
|
inline |
Returns a broadcast object based on a string broadcast name
BC_name | Name of broadcast (string) |
|
inline |
Finds the column index based on the string name of the column
data_object | Pointer to Planimate® data object |
col_name | String column name of the target column |
|
inline |
Finds a Planimate® data object by name
DO_name | String name of the Planimate® data object |
|
inline |
Gets the value from a cell
data_object | Pointer to Planimate® data object (table) |
row | Cell row index |
col | Cell column index |
|
inline |
Gets the text from a Free Text cell
data_object | Pointer to Planimate® data object (table) |
row | Cell row index |
col | Cell column index |
|
inline |
Returns a column as an array
data_object | Pointer to Planimate® data object (table) |
column | Index of column in DataTable |
rows | The number of rows to return in the array |
into | Array of double to place column in |
|
inline |
Returns Planimate® value format of the specified column
data_object | Pointer to Planimate® data object |
column | Index of the column |
|
inline |
Returns Planimate® label list that the specified column is formatted to.
data_object | Pointer to Planimate® data object |
column | Index of the column |
|
inline |
Gets a Planimate® data object table and returns it as a DataTable. If the DataTable is specified to be formatted, all columns will be correct .NET data formats. Unformatted data is formatted as type Double
data_object | Pointer to Planimate® data object (table) |
formatted | Specifies if the returned DataTable should be formatted. True = format |
|
inline |
Finds a Planimate® data object by name and returns it as a DataTable. If the DataTable is specified to be formatted, all columns will be correct .NET data formats. Unformatted data is formatted as type Double
DO_name | String name of the Planimate® table data object |
formatted | Specifies if the returned DataTable should be formatted. True = format |
|
inline |
Returns a label list object based on a string label list name
list_name | Label list name |
|
inline |
Gets Planimate® System info. Times are in seconds with 0 = the run start date
sysinfo_id | System info id from ePLSysInfo. |
|
inline |
Initialise the Planimate® engine for use when embedding PL in a dotNET application
|
inline |
Initialise this for use with an existing Planimate which is calling C# using the PLCLR bridge DLL. PLCLR attempts to call the instantiated class which should call this if the engine is required.
|
inline |
Returns the label string based on a double label index
data_object | Pointer to Planimate® data object (label list) |
index | Label index as double |
|
inline |
Returns the label index based on a label string
data_object | Pointer to Planimate® data object (label list) |
label | Label string |
|
inline |
Returns the label string based on a long(Int32) label index
data_object | Pointer to Planimate® data object (label list) |
index | Label index as integer |
|
inline |
Returns the Planimate® version powering the engine.
|
inline |
Broadcast callback enables a user provided function to be called every time Planimate sends a defined broadcast. Thread Notes:
The callback will be called in the context of PL's thread. The PLBroadcast handle is unique per broadcast per thread. The userdata will be returned and is useful for passing a pointer to the class/instance.
Data must be processed/copied before returning from this function. All pointers are invalid after the callback returns.
broadcast | Pointer to broadcast object |
callback_func | Function to register as callback |
|
inline |
Register broadcast callback using broadcast name.
BC_name | Pointer to broadcast object |
callback_func | Function to register as callback |
|
inline |
Pause callback enables a user provided function to be called every time Planimate becomes paused. This function is called in PL's thread context so do as little as possible and message to your main thread as required.
callback_func | Function to register as callback |
userdata | User data |
|
inline |
Resume the engine thread.
|
inline |
Returns the number of rows in a table data object
data_object | Pointer to Planimate® data object |
Send a run command to the Planimate® engine.
cmd | Run command from ePLRunCMD. |
|
inline |
Sends a broadcast into the engine based on broadcast object
broadcast | Pointer to broadcast object |
|
inline |
Sends a broadcast into the engine based on broadcast name
BC_name | Name of broadcast (string) |
|
inline |
Sends a broadcast into the engine based on broadcast object and include tuple data for the item
broadcast | Pointer to broadcast object |
no_params | Number of tuple parameters to include |
tuple_names | Array of tuple names (length = no_params) |
tuple_values | Array of tuple values (length = no_params) |
|
inline |
Sends a broadcast into the engine based on broadcast name and include tuple data for the item
BC_name | Name of broadcast (string) |
no_params | Number of tuple parameters to include |
tuple_names | Array of tuple names (length = no_params) |
tuple_values | Array of tuple values (length = no_params) |
|
inline |
Sets the value of a cell
data_object | Pointer to Planimate® data object (table) |
row | Cell row index |
col | Cell column index |
data | Data to write to the cell |
|
inline |
Sets the value of a Free Text cell
data_object | Pointer to Planimate® data object (table) |
row | Cell row index |
col | Cell column index |
data | Data to write to the cell (string) |
|
inline |
Sets an array to a column
data_object | Pointer to Planimate® data object (table) |
column | Index of column in DataTable |
rows | The number of rows to set from the array |
to | Array of doubles to place into the column |
|
inline |
Sets a Planimate® data object table and from a DataTable.
data_table | Reference to the DataTable to be written to Planimate® |
data_object | Pointer to Planimate® data object (table) |
|
inline |
Sets writable Planimate® System info. Times are in seconds with 0 = the run start date
sysinfo_id | System info id from ePLSysInfo. |
value | Value to write. |
|
inline |
Suspend the engine thread.
|
inline |
Clean up gracefully. This is only required if Planimate is being embedded and the caller wants to gracefully shut it down without closing themselves.
delegate ePLRESULT Planimate.Engine.PLEngineCore.tPL_BroadcastCallback | ( | IntPtr | broadcast, |
int | no_params, | ||
[MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStr, SizeParamIndex=1)] string[] | tuple_names, | ||
[MarshalAs(UnmanagedType.LPArray, SizeParamIndex=1)] double[] | tuple_values, | ||
IntPtr | user_data | ||
) |
Planimate® broadcast callback function definition
delegate ePLRESULT Planimate.Engine.PLEngineCore.tPL_PauseCallback | ( | double | the_time, |
ePLPauseReason | stop_reason, | ||
IntPtr | userdata | ||
) |
Planimate has paused callback function
|
inline |
Updates a DataTable object with data from a Planimate® data object table and returns it as a DataTable. If the DataTable is specified to be formatted, all columns will be correct .NET data formats. Unformatted data is formatted as type Double
pl_table | DataTable that will be updated |
data_object | Pointer to Planimate® data object (table) |
formatted | Specifies if the returned DataTable should be formatted. True = format |
|
inline |
Finds a Planimate® data object by name and updates the supplied DataTable. If the DataTable is specified to be formatted, all columns will be correct .NET data formats. Unformatted data is formatted as type Double
rTable | DataTable that will be updated. |
DO_name | String name of the Planimate® table data object |
formatted | Specifies if the returned DataTable should be formatted. True = format |