Topic
  • 9 replies
  • Latest Post - ‏2017-08-09T18:25:24Z by anotherDaniel
strathglass
strathglass
171 Posts

Pinned topic Progress Bar progressStart() - can I show it without underlying DB?

‏2009-07-06T15:09:44Z |
Hoping to get some help with this issue:

The progressStart() function requires a DB argument:
but my script has no GUI of its own, it just runs (invoked from module menu)
and puts up a terminal dialog box when all done.

I want an interim progress bar without any other window,
so what would I use as the DB argument in the progressBar() call?

Regards,
Strathglass.
Updated on 2010-08-27T15:22:26Z at 2010-08-27T15:22:26Z by meherts
  • rslerl
    rslerl
    37 Posts

    Re: Progress Bar progressStart() - can I show it without underlying DB?

    ‏2009-07-06T19:35:58Z  

    This may be what you want:
     

    void progCB(DB x ) { 
        Object o 
        int nos = 0 
        for o in current Module do nos++ 
        progressStart(x, "Experiment", "Something", nos) 
        nos = 0 
        for o in current Module do {
            string h = o."Object Heading"
            progressStep ++nos
            if (null h) h = "null heading"
            progressMessage h 
            if (progressCancelled) {
                if (confirm("Exit loop?")) {
                    progressStop
                    halt
                }
            }
        } 
        progressStop 
    }
    DB progressDB = create "Progress test" 
    realize progressDB 
    progCB(progressDB)
    hide progressDB
    
    Updated on 2013-12-18T19:22:58Z at 2013-12-18T19:22:58Z by JAntley
  • strathglass
    strathglass
    171 Posts

    Re: Progress Bar progressStart() - can I show it without underlying DB?

    ‏2009-07-06T20:02:43Z  
    • rslerl
    • ‏2009-07-06T19:35:58Z

    This may be what you want:
     

    <pre class="javascript dw" data-editor-lang="js" data-pbcklang="javascript" dir="ltr">void progCB(DB x ) { Object o int nos = 0 for o in current Module do nos++ progressStart(x, "Experiment", "Something", nos) nos = 0 for o in current Module do { string h = o."Object Heading" progressStep ++nos if (null h) h = "null heading" progressMessage h if (progressCancelled) { if (confirm("Exit loop?")) { progressStop halt } } } progressStop } DB progressDB = create "Progress test" realize progressDB progCB(progressDB) hide progressDB </pre>
    Thanks.
    That looks like the example program in DOORS:
    The problem is it puts up a "Progress test" DB (on which the Progress Bar dialog can be put): if you cancel out of the progress bar instead of letting it complete, you have to manually close the "Progress test" DB.

    I want to put up the progress bar without any other underlying DB like "Progress test".

    I was thinking maybe there is a way to have DB take on the value associated with the module I am running the script from. Maybe?

    Regards, Strathglass.
  • rslerl
    rslerl
    37 Posts

    Re: Progress Bar progressStart() - can I show it without underlying DB?

    ‏2009-07-06T20:41:01Z  
    Thanks.
    That looks like the example program in DOORS:
    The problem is it puts up a "Progress test" DB (on which the Progress Bar dialog can be put): if you cancel out of the progress bar instead of letting it complete, you have to manually close the "Progress test" DB.

    I want to put up the progress bar without any other underlying DB like "Progress test".

    I was thinking maybe there is a way to have DB take on the value associated with the module I am running the script from. Maybe?

    Regards, Strathglass.
    It never hurts to dream big.
  • djakad
    djakad
    49 Posts

    Re: Progress Bar progressStart() - can I show it without underlying DB?

    ‏2009-07-07T21:02:46Z  
    • rslerl
    • ‏2009-07-06T19:35:58Z

    This may be what you want:
     

    <pre class="javascript dw" data-editor-lang="js" data-pbcklang="javascript" dir="ltr">void progCB(DB x ) { Object o int nos = 0 for o in current Module do nos++ progressStart(x, "Experiment", "Something", nos) nos = 0 for o in current Module do { string h = o."Object Heading" progressStep ++nos if (null h) h = "null heading" progressMessage h if (progressCancelled) { if (confirm("Exit loop?")) { progressStop halt } } } progressStop } DB progressDB = create "Progress test" realize progressDB progCB(progressDB) hide progressDB </pre>
    Use "dbExplorer", which is the global variable for the main DOORS window, in place of progressDB.

    So, in the code above, eliminate the last 4 lines of code, and add:
    progCB(dbExplorer)

    .... should work
  • strathglass
    strathglass
    171 Posts

    Re: Progress Bar progressStart() - can I show it without underlying DB?

    ‏2009-07-08T12:16:17Z  
    • djakad
    • ‏2009-07-07T21:02:46Z
    Use "dbExplorer", which is the global variable for the main DOORS window, in place of progressDB.

    So, in the code above, eliminate the last 4 lines of code, and add:
    progCB(dbExplorer)

    .... should work

    Exactly what I was looking for djakad, dbExplorer works perfectly, thanks!

    Here is a sample that uses dbExplorer without any explicit new DB for the progress bar to run on:
     

    pragma runLim,0
    int nos=0
    Object o
    for o in current Module do nos++
    progressStart(dbExplorer, "Experiment", "Something", nos) 
    nos = 0 
    for o in current Module do 
    {
        string h=o."Object Heading"
        progressStep ++nos
        if (null h) h = "null heading"
        progressMessage h 
        //add delay so we have time to see progress bar:
        int j,k;for (j=0;j<1000;j++) k=j*2-3
        if (progressCancelled) {
            if (confirm("Exit loop?")) {
                progressStop
                halt
            }
        }
    } 
    progressStop
    

     


    Regards, Strathglass

     

    Updated on 2013-12-18T19:23:32Z at 2013-12-18T19:23:32Z by JAntley
  • meherts
    meherts
    54 Posts

    Re: Progress Bar progressStart() - can I show it without underlying DB?

    ‏2010-08-27T15:22:26Z  

    Exactly what I was looking for djakad, dbExplorer works perfectly, thanks!

    Here is a sample that uses dbExplorer without any explicit new DB for the progress bar to run on:
     

    <pre class="javascript dw" data-editor-lang="js" data-pbcklang="javascript" dir="ltr">pragma runLim,0 int nos=0 Object o for o in current Module do nos++ progressStart(dbExplorer, "Experiment", "Something", nos) nos = 0 for o in current Module do { string h=o."Object Heading" progressStep ++nos if (null h) h = "null heading" progressMessage h //add delay so we have time to see progress bar: int j,k;for (j=0;j<1000;j++) k=j*2-3 if (progressCancelled) { if (confirm("Exit loop?")) { progressStop halt } } } progressStop </pre>

     


    Regards, Strathglass

     

    Thanks, Strathglass.

    Regards,
    meherts
  • Martin_Hunter
    Martin_Hunter
    46 Posts

    Re: Progress Bar progressStart() - can I show it without underlying DB?

    ‏2014-03-11T16:00:32Z  
    • meherts
    • ‏2010-08-27T15:22:26Z
    Thanks, Strathglass.

    Regards,
    meherts

    If the user has the DOORS Explorer minimised then the progress bar does not appear.

    Any ideas how I can ensure the progress bar is always visible?

    Martin

  • llandale
    llandale
    3035 Posts

    Re: Progress Bar progressStart() - can I show it without underlying DB?

    ‏2014-03-11T17:01:33Z  

    If the user has the DOORS Explorer minimised then the progress bar does not appear.

    Any ideas how I can ensure the progress bar is always visible?

    Martin

    Try "bringToFront(dbExplorer)" before definging the progress bar.

  • anotherDaniel
    anotherDaniel
    6 Posts

    Re: Progress Bar progressStart() - can I show it without underlying DB?

    ‏2017-08-09T18:25:24Z  
    • llandale
    • ‏2014-03-11T17:01:33Z

    Try "bringToFront(dbExplorer)" before definging the progress bar.

    I needed to do this, so was very happy for this thread. I'll add some more for the next person who consults it. llandale's suggestion didn't work because bringToFront works on modules but dbExplorer is a dialog box. I got this to work: setPos(dbExplorer, 70,10).