Version 3.0.6 |
Here you will find breaking changes in version 3.0.6 of the SDK.
The following SDK classes are affected by this change
RelaxISPlugin_CircuitElement
RelaxISPlugin_MultifitModel
RelaxISPlugin_TransferFunction
RelaxISPlugin_AxisValue
ImpedanceConversion
Using the Complex structure makes the code easier to read and maintain, and has the additional benefit that the Complex objects are created on the stack, making this allocation faster than allocating Tuples.
How to change your code
It is recommended to include the RelaxIS_SDK.libMath namespace, which contains the Complex structure. This is done with Imports RelaxIS_SDK.libMath (VB.NET) or using RelaxIS_SDK.libMath; (C#).
Next, the following functions need to return Complex instead of Tuple(Of Double, Double) (VB.NET), Tuple<double, double> (C#):
RelaxISPlugin_CircuitElement.CalculateImpedance
RelaxISPlugin_MultifitModel.FitFunction
RelaxISPlugin_TransferFunction.ConvertValue
RelaxISPlugin_TransferFunction.NormalizeValue
To instantiate a Complex object, please use e.g.
double RealPart=123.0; double ImagPart=-212.5; Complex value = new Complex(RealPart, ImagPart);
RelaxISPlugin_AxisValue.GetValue often uses the RelaxISPlugin_TransferFunction.ConvertValue function and should now use the Real and Imaginary properties of the Complex structure instead of Tuple.Item1 and Tuple.Item2. The same applies to functions that use the ImpedanceConversion functions.
Another important aspect is the fact, that structures are value types instead of reference types. An effect of this is, that Complex objects cannot be null. Checks for this will fail.