Results 1 to 6 of 6

Thread: [screen] issues

  1. #1
    Variable Bitrate
    Join Date
    Jul 2010
    Posts
    321

    [screen] issues

    http://www.mediafire.com/?laj52as2ffeb9lh

    There is the link to the code, I just copy/pasted the code into a notepad file. Mediafire didn't like trying to upload whole folders or I couldn't be bothered figuring it out...

    Here is what it should like normally:


    Here is what it looks like when 2 different screens run it at the same time:

  2. #2
    Maximum Bitrate Borte's Avatar
    Join Date
    Jan 2006
    Location
    Norway
    Posts
    450
    I'll try your code as soon as I have some free time (probably some time tomorrow).
    Failure is not an option...
    __________________________________________________ ______________________________
    The only full multizone / multiscreen cross platform open source Front End -> OpenMobile

  3. #3
    Maximum Bitrate Borte's Avatar
    Join Date
    Jan 2006
    Location
    Norway
    Posts
    450
    Do you want each screen to be able to update at different times or do you want each screen to update at the same time?
    Failure is not an option...
    __________________________________________________ ______________________________
    The only full multizone / multiscreen cross platform open source Front End -> OpenMobile

  4. #4
    Maximum Bitrate Borte's Avatar
    Join Date
    Jan 2006
    Location
    Norway
    Posts
    450
    Your problem is caused by code that is not thread safe.
    Each button press spawns a new thread in where you grab the data and format it for the screen.

    In you're code you're using global variables for some controls as well as some other data like nflgamecount. This is not safe in a multithread enviroment as your global data can be (and is) changed by one thread while the other thread is using the data in another location. In certain situations this can lead to some funny results. So try to stay away from global data when possible. A good rule to follow is that you can only trust data that's declared in the same method or passed along as a parameter into the method.

    If you change your code in nflbutton_click to the following code it should work:
    Code:
                removemiddlecontrols(screen);
                int GameCount = getdatafromnflsite("http://www.nfl.com/scores", screen);
                if (GameCount != 0)
                    resizeallnflgamepicboxs(screen, GameCount);
                nflgamecount = GameCount;   // Now the data can no longer affect our handling, pass data to global reference
    You also have to change your getdatafromnflsite method to return int where the number is the gamecount.

    Your webrequest code was also unstable and would in certain cases return null or incomplete code, you need to add error checks for this in your code so that you're not prosessing any code that will lead to crashing your plugin (as it currently does).
    If you use the following code to get the url instead of the webrequest then it will be more stable:
    Code:
    string nflgames = OpenMobile.Net.Network.getFile(nflurl);
    Also instead of using the code "manager[screen]" every time you want to access something on a panel use a variable in your method as this saves code and makes it all faster:
    Code:
    OMPanel p = manager[screen];
    // Use p for access to the panel after this line
    I've edited your code so that it can run on my 4 monitor setup without graphical problems. If you want to I can upload this complete code.

    PS! The above code does not fix all problems related to multi threading and global data, you still have a problem with your code related to nflweekslist_click as clicking the weeklist crashes the code but it should get you going in the correct direction.
    Failure is not an option...
    __________________________________________________ ______________________________
    The only full multizone / multiscreen cross platform open source Front End -> OpenMobile

  5. #5
    Variable Bitrate
    Join Date
    Jul 2010
    Posts
    321
    I knew there would be errors, as I just had to a working state as long as there were no active games at the time being run. I know about the error checking, but figured that the screen issues were not caused by error trapping. The global variables didn't even cross my mind, but now that it's mentioned, I think it creates a duh moment for me.

    I got rid of all my global variables except for the ScreenManager and IPluginHost and what a difference. I will keep testing it to make sure, but thanks so much for the help.

    Btw, I took out all the code that scrolllist I had for the weeks (no click events, no array to hold data according to click events, etc) and the list is scrolling abnormally slow. Is this because the list is so small in size? The list just adds 20ish text strings so I figured it couldn't be the item being added... All the other lists scroll fast from other plugins (settings, media, etc).

  6. #6
    Maximum Bitrate Borte's Avatar
    Join Date
    Jan 2006
    Location
    Norway
    Posts
    450
    Quote Originally Posted by detlion1643 View Post
    Btw, I took out all the code that scrolllist I had for the weeks (no click events, no array to hold data according to click events, etc) and the list is scrolling abnormally slow. Is this because the list is so small in size? The list just adds 20ish text strings so I figured it couldn't be the item being added... All the other lists scroll fast from other plugins (settings, media, etc).
    The list that was in the code you posted works just fine here, no slow scrolling or lagging. But it is quite short so you dont get a lot of speed up for the actual "throwing" motion. But it still works just fine.
    Failure is not an option...
    __________________________________________________ ______________________________
    The only full multizone / multiscreen cross platform open source Front End -> OpenMobile

Similar Threads

  1. Combatting Cable Distance Issues
    By supaneko in forum Newbie
    Replies: 12
    Last Post: 01-31-2007, 03:19 PM
  2. Booting Issues
    By camaro of solar in forum General Hardware Discussion
    Replies: 8
    Last Post: 01-08-2007, 05:05 AM
  3. Touchscreen Issues w/Hibernation & CNX-P1290
    By jmciver in forum Power Supplies
    Replies: 0
    Last Post: 12-20-2006, 08:48 PM
  4. Replies: 32
    Last Post: 07-29-2006, 02:29 AM
  5. Legality issues
    By cadence117 in forum General MP3Car Discussion
    Replies: 5
    Last Post: 04-26-2004, 06:19 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •