關於如何編寫用於建模的小型更新/進度視窗的腳本的建議親愛的 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>