bugpyFormex - Bugs: bug #38408, pause() does not always work

 
 

bug #38408: pause() does not always work

Submitted by:  gianluca de santis <gianlucadesi>
Submitted on:  Mon 25 Feb 2013 02:52:30 PM UTC  
 
Category: CoreSeverity: 4 - Important
Item Group: Functionality errorStatus: Fixed
Privacy: PublicAssigned to: Benedict Verhegghe <bverheg>
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sun 17 Mar 2013 03:05:57 PM UTC, comment #5:

I suppose this is fixed. If not, please reopen the bug.

Benedict Verhegghe <bverheg>
Project AdministratorIn charge of this item.
Mon 25 Feb 2013 05:28:25 PM UTC, comment #4:

It does work for me!
Have you pulled the latest changes succesfully?
Including commit 47a9b5?

If so, try running
pyformex --debug=script
and you should see a whole slew of messages like

DEBUG(64): Loop Exitcode False, Count: 30

appearing during the pause.

Benedict Verhegghe <bverheg>
Project AdministratorIn charge of this item.
Mon 25 Feb 2013 04:47:18 PM UTC, comment #3:

I think combining
pause();wait()
is a good thing, becuase it will works in any case.

For example, the undraw() function does not respect the pause():

clear()
c=circle()
C=draw(c)
pause()
undraw(C)

*****************
but with the wait() it works:

clear()
c=circle()
C=draw(c)
pause();wait()
undraw(C)

gianluca de santis <gianlucadesi>
Project Member
Mon 25 Feb 2013 04:40:35 PM UTC, comment #2:

There was a bug in the pause function, making it not work at all.
It just set the drawlock and immediately returned.
Fixed in commit 47a9b5c.

Benedict Verhegghe <bverheg>
Project AdministratorIn charge of this item.
Mon 25 Feb 2013 03:59:36 PM UTC, comment #1:

The pause only works when you are at an instruction that draws something, or at least changes the view. This is intentional: the pause is normally there to see something on the screen. There is no point in waiting with computations that can not be affected by the wait anyhow.

The drawlock mechanism was designed for this purpose, and it is also used in the pause funtion. Currently, the functions waiting for the drawlock are draw, view, clear and wait. Maybe also some other ones. The wait function does nothing but wait for the drawlock to be freed. Thus you can put that after the pause on any place where you want the script to actually pause.
Thus:
pause();wait()
will have the effect you intended.

If you find it useful to have a pause on any place, maybe we can combine both into a single function.

Benedict Verhegghe <bverheg>
Project AdministratorIn charge of this item.
Mon 25 Feb 2013 02:52:30 PM UTC, original submission:

In this script pause() does not wait for the user to push the button key:

print (1)
pause()
print (2)
exit()

******************
but if I put a clear() then it does work properly:

print (1)
pause(), clear()
print (2)
exit()

gianluca de santis <gianlucadesi>
Project Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by bverheg (Posted a comment)
  • -unavailable- added by gianlucadesi (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 13 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 17 Mar 2013 03:05:57 PM UTCbverhegStatusWorks For Me=>Fixed
      Open/ClosedOpen=>Closed
    Mon 25 Feb 2013 05:28:25 PM UTCbverhegStatusFixed=>Works For Me
    Mon 25 Feb 2013 04:49:11 PM UTCgianlucadesiOpen/ClosedClosed=>Open
    Mon 25 Feb 2013 04:40:35 PM UTCbverhegSeverity2 - Minor=>4 - Important
      Item GroupFeature request=>Functionality error
      StatusNeed Info=>Fixed
      Open/ClosedOpen=>Closed
    Mon 25 Feb 2013 03:59:36 PM UTCbverhegCategoryNone=>Core
      Severity3 - Normal=>2 - Minor
      Item GroupNone=>Feature request
      StatusNone=>Need Info
      Assigned toNone=>bverheg

    Back to the top


    Powered by Savane 3.1-cleanup1