Suggestion sur la façon de créer un script pour une petite fenêtre de mise à jour/progression pour la modélisationChère communauté JMP,
Je souhaite créer un script pour une petite fenêtre qui apparaît lorsque j'exécute mon script de création de modèle pour me montrer à quelle étape (parmi des milliers) il est en cours d'exécution. Je pense faire quelque chose comme le script suivant, qui fonctionne, mais crée également une nouvelle fenêtre à chaque fois.
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>célibataire</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
Re : Suggestion sur la façon de créer un script pour une petite fenêtre de mise à jour/progression pour la modélisationMise à jour:
Après avoir modifié le JSL dans l'article auquel j'ai fait référence, j'ai pu créer cette fenêtre de test pour afficher la progression sous forme de barre (visuelle), ainsi que le nombre réel de pas X sur Y. C'était amusant !
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>
Re : Suggestion sur la façon de créer un script pour une petite fenêtre de mise à jour/progression pour la modélisationSalut @Mark_Bailey ,
Merci pour votre réponse rapide à ce sujet. Solution parfaite !
J'allais dans cette direction après avoir lu ce post : https://community.jmp.com/t5/Discussions/JMP-script-progress-indicator/mp/6057#M6056 . Mais j'étais encore à quelques pas. Pour le script de test, je devais ajouter un Wait() dans la boucle FOR car cela allait si vite. La modélisation prend plus de temps à chaque étape, donc cela ne m'inquiète pas.
Dans la future version de ceci, je pourrais le changer en "barre de progression" en modifiant ce qu'a fait l'autre utilisateur dans le message ci-dessus.
Merci encore!,
DS
Re : Suggestion sur la façon de créer un script pour une petite fenêtre de mise à jour/progression pour la modélisationOuvrez la fenêtre avec la mise à jour séparément et avant le début de l'itération. Enregistrez une référence à la zone de texte dans une variable. Envoyez le message << Set Text( "new text" ) à la référence à l'intérieur des itérations.
Names Default To Here( 1 );
imax = 5;
update_window = New Window( "Progress Update",
tb = Text Box( "Initial message", <<SET font="" size=""></SET>