Update script-analysis and graphs based on inputs from "New Window"
Dec 13, 2016 2:22 AM(1750 views)
I am triying to write a script that interactively is re-run based on varying values provided by a "New window".
Here is the scheme:
1/ I open a window that has a button ("Select Master File").
2/ When I click on this button, a "pick File" is launched, and I select a file
3/ based on the content of the selected file, I should run a script and generate graphs
Here are my questions:
1/ How to make sur each time I select a new file, the whole script is re-run and graphs are updated ?
2/ How to get the graphs embedded in the "New window" where I select the file ?
3/ The script I have to run is rather long and several graphs have to be generated. Is there a way to call this script without putting all the code in the "New window" code ? (like calling a function or so,...)
Thanks a lot.
Find below a simplified version of the code (with 2 files attached to test the code):
// Collect location of the Master file and the data...
New Window( "Window Controls",
Lineup Box( N Col( 1 ), Spacing( 3 ),
Panel Box( "1/ Select location of Data...", Button Box( "Select Data", Folder = Pick Directory( "Please pick a folder", ShowFiles ) ) ),
Panel Box( "2/ Select Data Master File...", g1=Button Box( "Select Master File", MasterFile = Pick File()
Col List Box( all ); //g1 << updateWindow;
MasterTable = Open( MasterFile );
Lots = Column( MasterTable, "Lot" ) << GetAsMatrix;
Factors = Column( MasterTable, "Factor" ) << GetAsMatrix;
x = Factors * [10, 50, 90];
y = Factors * [10, 90, 10];
New Window( "Poly Seg Example", g = Graph Box( Poly Seg( x, y ) ) );