100% CPU when changing from one popup panel to another

Have an idea for a new feature? Voice your opinion here.
Post Reply
dlmorgan999
HouseBot Special Member
Posts: 409
Joined: Tue Jul 13, 2004 9:13 am
Location: Tigard, OR

100% CPU when changing from one popup panel to another

Post by dlmorgan999 »

I have what appears to be a reproducible 100% CPU issue. It's a bit complicated to explain but I'll do my best. Panel A is a primary panel. It contains a button to change to panel B which is a popup panel. Panel B contains another button to change to panel C which is also a popup panel. This last button is where the problem lies.



If I check the "Close source Popup when switching" checkbox then I see 100% CPU as soon as I press the button to go to panel C. As soon as I close panel C (which returns me to panel A) the CPU usage returns to normal.



If I clear the "Close source Popup when switching" checkbox then everything works fine. I don't know if this has anything to do with it but panel B has an action in the "Exit List" which changes the state of a script to running.



EDIT: I should clarify that the 100% CPU usage is on the computer running the software remote and not on the HouseBot server.



-- Dave
ScottBot
Site Admin
Posts: 2787
Joined: Thu Feb 13, 2003 6:46 pm
Location: Georgia (USA)
Contact:

Post by ScottBot »

Dave,



I've created a Theme just as you described, but was not able to duplicate the problem. I've also looked at the code to see if there was some way that the 'close source popup...' button could get itself into a loop, but it looked OK.



I'm thinking that maybe it's a timing related issued that involves the actions caused by the script in the Exit List and .... something else. For a clue, try removing the item from the Exit list and see if you have the same results.
Scott
dlmorgan999
HouseBot Special Member
Posts: 409
Joined: Tue Jul 13, 2004 9:13 am
Location: Tigard, OR

Post by dlmorgan999 »

I had actually already tried this but it made no difference. I just did another test which I find interesting although not necessarily useful. I added a button on panel A to open panel C and then another button on panel C to open panel B. Opening panel C worked fine and then opening B produced the same results.



None of the other panels have anything on their enter or exit lists. I've also tried this with several different themes that I have and they all seem to exhibit this problem. The way I build my themes is that I have a "master" theme which contains all my panels. I copy each panel from the master to the zone-specific theme and then change whatever is necessary for that zone.



I wonder if there could be something corrupted in the XML for this panel? It doesn't seem likely since clearing the close checkbox stops the problem from happening but I'm stumped right now so I'm just throwing out ideas.



-- Dave
ScottBot
Site Admin
Posts: 2787
Joined: Thu Feb 13, 2003 6:46 pm
Location: Georgia (USA)
Contact:

Post by ScottBot »

dlmorgan999 wrote:Opening panel C worked fine and then opening B produced the same results.
When you say "same results" do you mean the same successful results, or the 100% CPU results?



I doubt that a corrupt XML would cause this, particularly since it seems isolated to that one check box. You never know though. Maybe if you could create a new Theme with the same setup from scratch like I did and see if you get the same results. Don't use your templates for creating the test.



The only real difference that the check box makes is that it deactivates the calling Panel... just as you would think. The act of deactivating a Panel includes:
  • Playing the panel close sound.
  • Running the Exit list.
  • Hiding all controls (windows).
  • Unsubscribing all Property Value notifications associated with controls on the Panel from the server.
  • Hiding the pop-up window.
  • Unregistering any hard-buttons associated with the Panel.
Scott
dlmorgan999
HouseBot Special Member
Posts: 409
Joined: Tue Jul 13, 2004 9:13 am
Location: Tigard, OR

Post by dlmorgan999 »

When you say "same results" do you mean the same successful results, or the 100% CPU results?
I meant the 100% CPU results. I tried creating a new theme from scratch and was unable to reproduce the error. I took a "test" theme that I had created when I first got HouseBot and set it up the same way and was able to reproduce the problem. I took the test theme and pared it down to a bare minimum and the problem still exists. I sent you the XML file in case you want to have a look. While I was working on this I noticed that there was a bunch of "orphaned" XML code for controls that either don't exist or don't show as the coordinates are negative numbers. This is very strange!



-- Dave
ScottBot
Site Admin
Posts: 2787
Joined: Thu Feb 13, 2003 6:46 pm
Location: Georgia (USA)
Contact:

Post by ScottBot »

Dave,



I was able to find and fix the problem with your sample. The problem stemmed from the slider control, and it was a very peculiar problem. It will be fixed in the next update.
Scott
dlmorgan999
HouseBot Special Member
Posts: 409
Joined: Tue Jul 13, 2004 9:13 am
Location: Tigard, OR

Post by dlmorgan999 »

Scott,



That's great news! :D Until the next build comes out I'll just clear the close source... checkbox. Thanks for finding and fixing this!



-- Dave
Post Reply