The sheet "Experts" contains options for the XUI interface and KernelScripting.
With these options the behavior of a component implemented in Ebsilon can be replaced by self-programmed code.
This option is used by us when developing new components, but can also be used by the user himself. The user is then responsible for, among other things, formulating and setting down the equations, the convergence behavior and calculating the result values of the component and the connected (output) lines. (Attention: For this the license option EbsScript/EbsOpen is necessary).
Using the XUI interface or KernelScripting allows replacing the actual internal calculation code for Ebsilon components by user-defined code (KernelScripting or code in Dll respectively). In these cases the component behaves like a macro object for which, however, the line interface and the amount of the specification/result values, characteristic lines, etc. are fixed.
Component Calculation Mode (user defined):
The calculation of each component (esp. also of a macro) can be overwritten by a user-defined calculation.
The following settings are possible:
calculation mode: 0: Default: Ebsilon-Internal-Calculation (This is the default setting, component behaviour as described here).
calculation mode: 1: User defined KernelScript:
Component calculates by means of a kernel script (like component 93); access to default/result values by the functions: ksGetSPEC, ksGetRES, ksSetSPEC, ksSetRES
is not possible, but instead these values can be accessed directly by name using the EbsScript syntax.
calculation mode: 2: User defined XUI-DLL:The calculation interface of the XUI-DLL is identical to that for component 65, described in "/Data/Examples/Programmable/ebsuser.h". Access to default/result values, (result) characteristics, (result) macros, is only possible through the IDispatch interface of the component by means of the EbsOpen interface (possible programming languages are e.g. C++, C#).
For macros, an override by a user-defined calculation means that the components within the macro are not calculated by Ebsilon, but exclusively via the kernel script or the XUI DLL.
An example of this can be found under “Data\Examples\xui_dll_macro.ebs“.
The interface defined in ebsuser.h is constantly being developed or extended. The changes are described in ebsuser.h.
In October 2021 version 10 of this interface was implemented. This Version 10 (in the namespace "v10", only available for C++) contains a callback function for calculating substance properties. This makes linking to wdt.lib and mixture.lib obsolete.
The IFluidAnalysis interface has two methods "GetAllFractions" and "SetAllFractions" with which all substances can be read or written simultaneously.
Interface IComp: The properties "Shape:long" and read-only "ShapeCount:long" are used to read and set the current representation shape or to read the number of different representation shapes.
The CoClasses ApplicationBuilder and DllBuilder make it possible to specify an EbsOpen instance (Dll-Inproc or Exe-OutofProcess) step by step and create it by calling "Finalise". Licence options can also be specified here.
Like the CoClasses, the "EbsOpen.Factory .Create(InitParams init_params)" method also supports the additional licence options. To do this, please use the "builder_params" field (of type "BuilderParams") in the "InitParams" structure.
A user-defined toolbar command can be executed at application or model level using the "RunExtendedCommand" method.
From Release 16, the values of result values/fields/families and matrices always come from the active profile, i.e. there is no search in the parent profiles (values linked to special profiles with "Fix..." are of course not affected by this).
Click here >> xui_dll_macro.ebs << to open the example in Ebsilon.
Click here >> xui_v10_dll_macro.ebs << to open the example in Ebsilon (uses version 10, available since release 15 patch 5).
eXtensible User-Interface (XUI-DLL)
In addition to the self-defined calculation of a component or macro, the XUI-DLL can also be used to extend the properties dialog by one or more sheets.
The path to this DLL must be specified on the "Experts" sheet of the corresponding component or macro.
In the case of macros, the XUI DLL can also be used to take into account dependencies between values: among other things, specification values can be hidden depending on the value of another specification value.
The file "/Data/Examples/xui_dll/xui.h" describes the interface to be implemented. There are two different header files: for calculation "EbsUser.h" and for GUI extensions "xui.h".
Furthermore the folder contains an example project. The Ebsilon sample "/Data/Examples/xui_dll_macro.ebs" (link see above) uses the dll generated from this project.