x

ADONIS:
Version 3.90.9 (Released at 10/19/2024)
- Minor bugs in mesh generation module has been fixed.
- Gmsh is upgraded to version 4.13.1.

HYRCAN:
Version 2.0.18 (Released at 10/26/2024)
- Minor bug in translation has been fixed.
- Minor bug in geometry creation is fixed.


[req] create a pause() command(Read 16478 times)
[req] create a pause() command on: January 18, 2017, 02:04:22 am
i think it could be useful to have a "pause()" command available in adonis.

the idea came to me after executing the script you distributed because simply loading the script cause its execution from beginning to the end at high speed and the user cannot see how the command lines are executed.

the command "pause()" could be inserted in a specified point by the user creating the script by clicking a specific button or could be inserted by the user receiving the script editing the *.ajs file to stop execution at a specific command.

also, the command "pause()" could have optional "time" argument in seconds to automatically restart execution after "time" seconds.

to be more clear, i think to something like "pause(20)" that means "pause execution for 20 seconds" or, with no argument, something like "pause()" that means "pause execution until the user manually restart it".

i've imagined the position where to place the button "Pause" and the related box for inserting the duration of that. you can see it in the attached image, in which i used the button "Solve" just to show you what i mean.

also, the default action of adonis when pause button is clicked - or command pause() is done - is "to do nothing", because this simply means that the user is adding a row in the script. the default action of adonis when a pause() command is found in a script during its execution is "to pause for the specified time or indefinitely until a command to restart is done" and at the same time the pause button should change in "Start" to allow user restarting execution.



Re: [req] create a pause() command Reply #1 on: January 18, 2017, 07:32:39 am
currently if you press Esc button program will stop executing .. but your idea of pause() function is good and can be implemented in debugging package. for now you can use Esc button in the keyboard.
thanks reversi



Re: [req] create a pause() command Reply #2 on: January 18, 2017, 01:41:01 pm
currently if you press Esc button program will stop executing .. but your idea of pause() function is good and can be implemented in debugging package. for now you can use Esc button in the keyboard.
please, can you tell me how can i use the esc key while loading your cylindrical hole script? i have not the speed of superman!!

maybe you could implement in the program the command pause() as undocumented function, with no possibility at all to insert it from the interface. this way the program should only have the feature to read the pause() command and stop execution. the execution could be restarted pressing, say, the spacebar.

users who want to use the pause() command [remember also the optional "time" argument] must insert it manually editing the script.



Re: [req] create a pause() command Reply #3 on: January 18, 2017, 01:58:45 pm
yes if it's going too fast you have no chance of stopping it. for now you can use "//" double slash to comment the lines below and run the model up to the point you want.

I can add exist() function which is easy but pause/restart might need more programming since program need to memorize the rest of the lines that needed to be executed during restart. I need to think about it and find a smart way to do this cannot do it overnight unfortunately.



Re: [req] create a pause() command Reply #4 on: January 18, 2017, 02:15:24 pm
i imagine that the program has a counter increasing when a command line in a *.ajs script is executed.
so when a pause() command is encountered it just has to stop the counter, then restart with the next row.



Re: [req] create a pause() command Reply #5 on: January 18, 2017, 02:23:36 pm
correct, right now all the commands are given in one line but in ADONIS you can perform actual programming like this:

for (i=1;i<10;i++) {
 //do some stuff in here
}

or etc like any other programming languages (C++, java, python etc.) so if user decides to put pause() inside the loop memorizing the row number is useless because rest of the script has syntax error (for/while block is not complete). I need to think about all these possibilities before creating the action. later I'll will post a full script in which javascript programming has been used then you'll understand the concept. for now I cannot use pause until I can foresee all these possibilities.
but I'll add exit command which seems to be useful.  please let me know if you have any additional questions.



Re: [req] create a pause() command Reply #6 on: January 18, 2017, 02:49:46 pm
if user decides to put pause() inside the loop memorizing the row number is useless because rest of the script has syntax error (for/while block is not complete)
it's the same, because the program will restart again into the loop and complete it. clearly the main counter and the loop counter have to be different ones.

also an exit() command would be useful.