Hello everybody,
I want to write a little dashboard/application where you can change three variables A,B,C using sliders (continuous levels allowed) and a fourth variable Faktor using radio buttons (since only 4 levels are allowed).
The columns of my data table G1, G2, G3 are then multiplied by A,B,C as well as Faktor and plotted along with the sum of all three new columns using graph builder.
Clear Log();
Delete Symbols();
Names Default To Here( 1 );
// default parameter values.
A = 1;
B = 2;
C = 3;
Faktor = 2;
dt = Current Data Table();
dt << New Column( "G1scale", Numeric, Continuous, Formula( (:G1 * Here( 1 ):A) * Here( 1 ):Faktor ) );
dt << New Column( "G2scale", Numeric, Continuous, Formula( (:G2 * Here( 1 ):B) * Here( 1 ):Faktor ) );
dt << New Column( "G3scale", Numeric, Continuous, Formula( (:G1 * Here( 1 ):C) * Here( 1 ):Faktor ) );
dt << New Column( "SumColumn", Numeric, Continuous, Formula( :G1scale + :G2scale + :G3scale ) );
I got my script working so far that dragging a slider updates the formula columns in the data table, but I have trouble doing the same with my radio buttons.
update = Expr(
Here( 1 ):A = p;
Here( 1 ):B = r;
Here( 1 ):C = t;
Here( 1 ):Faktor = Choose( nw1["cat"], 1, 2, 3, 4 );
dt << rerun formulas;
Wait( 0 );
);
nw1 = New Window( "Faktor",
Outline Box( "Select Faktor", cat = Radio Box( {"1", "2", "3", "4"} ),update )
);
nw2=New Window( "Sliding",
Outline Box( "A",
Slider Box(
1,
10,
p,
update
)
),
Outline Box( "B",
Slider Box(
1,
10,
r,
update
)
),
Outline Box( "C",
Slider Box(
1,
10,
t,
update
)
)
);
g1=Graph Builder(
Size( 529, 456 ),
Show Control Panel( 0 ),
Variables(
X( :WL ),
Y( :G1scale ),
Y( :G2scale, Position( 1 ) ),
Y( :G3scale, Position( 1 ) ),
Y( :SumColumn, Position( 1 ) )
),
Elements( Points( X, Y( 1 ), Y( 2 ), Y( 3 ), Y( 4 ), Legend( 3 ) ) ),
SendToReport(
Dispatch( {}, "graph title", TextEditBox, {Set Text( "Simulated Plot" )} ),
Dispatch( {}, "Y title", TextEditBox, {Set Text( "Mygauss" )} )
)
);
I can't get the data table (and therefore the graph) to update when I select a radio button.
A second issue is that I want to unite the three current windows into one window (dashboard or application). I can select them all for Combine Windows, but when trying to send them to Dashboard builder, only the graph builder window appears, not the silders. How can I drag my silder/radio buttons into the Dashboard/Application builder?