关于如何编写用于建模的小型更新/进度窗口的脚本的建议亲爱的 JMP 社区:
我感兴趣的是编写一个小窗口的脚本,当我运行模型构建脚本时会弹出一个小窗口,以显示当前正在运行的步骤(数千步)。我正在考虑做类似下面的脚本的事情,它可以工作,但每次也会创建一个新窗口。
Names Default To Here( 1 );
imax = 5;
For( i = 1, i <= imax, i++,
update_window = New Window( "Progress Update",
Text Box( " Current step " || Char( i ) || " of " || Char( imax ), <<SET font="" size=""></SET>
Of course, my imax is much larger than 5, this is just a test script. I get an output at each iteration of the following (five windows in this case):
<SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Snap2.png" style="width: 400px;"><span class="lia-inline-image-display-wrapper" image-alt="Snap2.png" style="width: 254px;"><img src="https://us.v-cdn.net/6038925/uploads/images/22132iC6ED49231F83C2B5/Snap2.png" role="button" title="Snap2.png" alt="Snap2.png" /></span></SPAN>
But, as mentioned, this would make several thousand such windows, which I don't want. I'd like to update just the step "i" of the total.
The modeling script is built into a data table and has it's own FOR loop as it's running a giant tuning table one line at a time -- imax is the NRows() of this tuning table, and can be on the order of 24k+ rows. I want to insert into the main for loop a script that creates a <EM>单身的</EM> window that stays on the screen and tells the user what step "i" it's at out of NRows(). (Scrolling through the data table is tedious, and this seems like a reasonable solution.)
I don't need a progress bar, or anything like that, just a simple number that changes at each iteration of the main FOR loop. There is only one FOR loop, BTW.
Thanks for your suggestions!
DS
回复:关于如何编写用于建模的小型更新/进度窗口的脚本的建议更新:
修改我引用的帖子中的 JSL 后,我能够创建此测试窗口,以条形图(视觉)显示进度,以及 Y 的实际步数 X。这很有趣!
Names Default To Here( 1 );
i = 1;
imax = 100;
dlgStatus = New Window( "Overall Modeling Progress",
V List Box(
dlg_gb = Graph Box(
Title( "Overall Modeling Progress" ),
FrameSize( 150, 15 ),
X Scale( 0, 100 ),
Y Scale( 0, 1 ),
yaxis( show major ticks( 0 ), show minor ticks( 0 ) ),
xname( "% complete" ),
yname( "" )
),
tb = Text Box(
" Current step " || Char( i ) || " of " || Char( imax ),
<<SET font="" size=""></SET><SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Snap1.png" style="width: 400px;"><span class="lia-inline-image-display-wrapper" image-alt="Snap1.png" style="width: 218px;"><img src="https://us.v-cdn.net/6038925/uploads/images/22135iDC529E2F063EFA18/Snap1.png" role="button" title="Snap1.png" alt="Snap1.png" /></span></SPAN>
回复:关于如何编写用于建模的小型更新/进度窗口的脚本的建议嗨@Mark_Bailey ,
感谢您对此问题的快速回复。完美解决方案!
读完这篇文章后,我正朝着这个方向前进: https://community.jmp.com/t5/Discussions/JMP-script-progress-indicator/mp/6057#M6056 。但是,我还差几步。对于测试脚本,我需要在 FOR 循环中添加 Wait(),因为它运行得太快了。建模每一步都需要更长的时间,所以我并不担心这一点。
在未来的版本中,我可能会通过修改上面帖子中其他用户的操作来将其更改为“进度条”。
再次感谢!,
DS
回复:关于如何编写用于建模的小型更新/进度窗口的脚本的建议在迭代开始之前单独打开包含更新的窗口。将文本框的引用保存在变量中。将 << Set Text( "new text" ) 消息发送到迭代内的引用。
Names Default To Here( 1 );
imax = 5;
update_window = New Window( "Progress Update",
tb = Text Box( "Initial message", <<SET font="" size=""></SET>