NetTalk Central

Author Topic: Insight Graph procedure executes twice on start up  (Read 3123 times)

Keith

  • Sr. Member
  • ****
  • Posts: 306
    • View Profile
    • Email
Insight Graph procedure executes twice on start up
« on: November 05, 2013, 01:37:36 AM »
Hi, Am running C8 Bld 9759, NetTalk 7.28, StringTheory 1.92 and Insight Graphing 2

I have an IG procedure attached to a Form in which I have coded the commands to populate the Plotting Queue after the 'Open the Window' embed point.  This seemed to work fine.  When the Form was first displayed the graph appeared ok.

I was adding functionality and wanting to redraw the graph after a button was pressed on the Form and while trying to get that to work I happened to notice that the IG window procedure was executed twice when the Form was first displayed.  This was before any of my other drawing code was executed and I was surprised.  I certainly don't want it to execute twice because the process runs for about 6 secs.

Any ideas?

Thanks

Keith
Clarion 10.0.0 build 12799
NetTalk 9.31
StringTheory 2.65
InsightGraphing 2.27

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11193
    • View Profile
Re: Insight Graph procedure executes twice on start up
« Reply #1 on: November 05, 2013, 02:29:05 AM »
I'm guessing you've embedded it on the form wrong. But I'd need a small example to be more explicit.

cheers
Bruce

Keith

  • Sr. Member
  • ****
  • Posts: 306
    • View Profile
    • Email
Re: Insight Graph procedure executes twice on start up
« Reply #2 on: November 06, 2013, 01:52:34 AM »
Thanks Bruce. Can you spot what I have done wrong here?  See the attached document.

Cheers

Keith

[attachment deleted by admin]
Clarion 10.0.0 build 12799
NetTalk 9.31
StringTheory 2.65
InsightGraphing 2.27

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11193
    • View Profile
Re: Insight Graph procedure executes twice on start up
« Reply #3 on: November 06, 2013, 02:12:31 AM »
the problem is not in the AccelerationCurve procedure. It is in the PlayPen procedure.
I recommend you turn on the "Send Stage to Debugview" template option in PlayPen so that you can see how many times the form is called.
(hint - a LOT of times.)

You are almost certainly embedding your call to AccelerationCurve there in the wrong place.

cheers
Bruce

Keith

  • Sr. Member
  • ****
  • Posts: 306
    • View Profile
    • Email
Re: Insight Graph procedure executes twice on start up
« Reply #4 on: November 06, 2013, 02:59:17 PM »
I am working through this in the Debugger to verify exactly what happens so this is an interim reply.

Have a look at the attached document which describes what is currently happening.  I don't think the procedure executes a LOT of times <g>, just two times and only on the first display and since I have no code associated with the display (apart from the procedure itself) I am perplexed.  Have I hooked up 'AccelerationCurve' improperly to 'Playpen'?

Anyway, there is more in the doc.  Looking forward to pearls of wisdom (as always).

Cheers

Keith


[attachment deleted by admin]
Clarion 10.0.0 build 12799
NetTalk 9.31
StringTheory 2.65
InsightGraphing 2.27

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11193
    • View Profile
Re: Insight Graph procedure executes twice on start up
« Reply #5 on: November 07, 2013, 10:17:15 PM »
Hi Keith,

unfortunately the doc doesn't add much to the problem. The key is in knowing what you've embedded into the PlayPen procedure.

cheers
Bruce

Keith

  • Sr. Member
  • ****
  • Posts: 306
    • View Profile
    • Email
Re: Insight Graph procedure executes twice on start up
« Reply #6 on: November 08, 2013, 07:47:58 PM »
Hi Bruce

I have created a stub app which contains just a truncated 'Playpen' Form on which there is my graph window.  I have removed all embed code from 'Playpen' and all that the app does is to display the 'Playpen' form including the graph.

In this format the graph procedure 'Acceleration Curve' gets executed twice on start up.  This is the behaviour I want to understand because in the real app the code to draw the graph includes opening a spread sheet, reading 200 numbers and closing which takes a few seconds and twice is too much.

As I have noted in a previous post when I redraw the graph it only executes once.

Thanks for your help.

Keith

[attachment deleted by admin]
Clarion 10.0.0 build 12799
NetTalk 9.31
StringTheory 2.65
InsightGraphing 2.27

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11193
    • View Profile
Re: Insight Graph procedure executes twice on start up
« Reply #7 on: November 11, 2013, 10:12:36 PM »
Hi Keith,
cool -the example helped.
I've tweaked the code in the 7.29 to prevent the graph from being drawn when the Graph procedure is just getting a CallPopups event (which is what the second call is all about.)

In the example you sent me your call to 
do setaccelerationqueue
was done very early in the INIT method (before the files are opened) so I'm guessing it's just because it's a demo. If you did need to do "pre-processing" of data, you would want to do it after the code;

    If not p_Web &= NULL
      Case p_web.event
      Of 'callpopups'
        Return(Level:Notify)
      End
    End 


(which is the bit of code I added in 7.29 - so you won't see it there yet.)

Cheers
Bruce

Keith

  • Sr. Member
  • ****
  • Posts: 306
    • View Profile
    • Email
Re: Insight Graph procedure executes twice on start up
« Reply #8 on: November 25, 2013, 01:20:23 AM »
Thanks Bruce, confirmed that executing the graph procedure after your new code has fixed the 'two executes' problem.

Keith
Clarion 10.0.0 build 12799
NetTalk 9.31
StringTheory 2.65
InsightGraphing 2.27

Keith

  • Sr. Member
  • ****
  • Posts: 306
    • View Profile
    • Email
Re: Insight Graph procedure executes twice on start up
« Reply #9 on: November 28, 2013, 01:31:27 AM »
Hi Bruce

The Triangles returned!!  Here's what happened:

1. C8 refused to load my GoCars app and kept crashing.
2.  In desperation I copied a backup of the app and dct to GoCars2 and opened as a new solution.
3. This version had my style override in force with Shape set to 'None'
4. Recompile was ok (note there were no files associated with the GoCars app in the folder)
5. Ran the app and the Triangles came back.
6.  I made one change - Properties/Scatter/Shape=Insight:None
7.  The Triangles went away!

I had an absolutely clean app with Shape overridden to None but I got the default Shape. ]In the code the line ThisGraph2.Shape=Insight:Auto was generated. This was followed by my override ThisGraph2.Shape=Insight:None ]I can't see how my override did not change the setting unless the 'AddItem' of 'If' in between did something.

I then did another experiment.  I set everything back so that Triangles defaulted - ok.  I then just set up my Style override (I did not change 'Properties' and that also worked (no Triangles).

I will now keep these setups and see if Triangles ever reappears.  If they do then I will add the change to 'Properties' and monitor again to see if the problem is really fixed.

Is there a deeper problem?  When only Insight:Auto is stated you must be looking somewhere else to find out what the 'Auto' means.
Clarion 10.0.0 build 12799
NetTalk 9.31
StringTheory 2.65
InsightGraphing 2.27

Keith

  • Sr. Member
  • ****
  • Posts: 306
    • View Profile
    • Email
Re: Insight Graph procedure executes twice on start up
« Reply #10 on: November 28, 2013, 01:33:21 AM »
Sorry I posted my last reply about the 'Triangles' on the wrong topic.

Keith
Clarion 10.0.0 build 12799
NetTalk 9.31
StringTheory 2.65
InsightGraphing 2.27