Quantcast
Channel: DIAdem topics
Viewing all articles
Browse latest Browse all 3213

Assign channels to Calculation Set via dialog

$
0
0

Hello guys,

 

currently working on a dialog, which allows the user the selection of the data channels or values as input for calculation. The calculation itself should run via CalcSet, means the formula is not in the dialog script included, but loaded, and the inputs must be assigned depending on the user-inputs.

For values it seems to work, but the assignment of the data channels to the calc. input is a problem.

Here is the part of the corresponding code:

Call Dialog.RefreshAll
If Data.Root.ActiveChannelGroup.Channels.Exists("Func_result") Then Data.Root.ActiveChannelGroup.Channels.Remove("Func_result")

Call Calculationset.Load(MyFolders(0) & "2021-06-02 DAKAR test funcs.tca")
set formula = CalculationSet.CalculationGroups("DAKAR Funktionen").Calculations("Funktion #9")
' Diff. pressure
If CB1.Value = TRUE Then ' a channel as input selected
input(1) = Box1_CmB.Value
' Call msgbox("DP = " & input(1))
call formula.Inputs.Add("DP", eAdaptorTypeChannel)
formula.Inputs("DP").ReferenceType = eReferenceTypeChannel
formula.Inputs("DP").Reference.Channel = input(1) ' dp as Channel
ElseIf CB1.Value = FALSE Then
input(1) = VAL(Box1_EB.Text)
call formula.Inputs.Add("DP", eAdaptorTypeValue)
formula.Inputs("DP").Reference.ValueExpression = input(1) ' dp as value
End If

The purpose if the CheckBox is to identify the input: channel or value.

And depending on it, either the ComboBox or EditBox is used.

Any ideas what is missing here?

Or other proposals how to fix it?

 

Complete SUD and the TCA are attached in the ZIP file.

Working on DIadem 2015.


Viewing all articles
Browse latest Browse all 3213

Trending Articles