Home AMX User Forum AMX Design Tools

MVP-8400 Dyanamic Imaging Refresh / Update

Ok, here's the scenario - Like everyone else - I'm pulling in a doppler radar, and animating it. The problem is, that some of the dynamic images do not upate in time, or aren't refreshed fast enough. Is there a way for the panel to tell me that all the dynamic images are ready and have been loaded? With a series of 7 or 8 images and it's always looping, having 3 or 4 of the images loaded makes it appear to flicker or flash to the user.

It's usually not a terrible issue, but I try to practice the art of CYA.

Comments

  • viningvining Posts: 4,368
    Have you had any luck yet!

    I've been trying the same thing and can't get anything close to what I want. I thought I had it when I changed to refresh rate in the resource manager to 0 and check the box to refresh only at start up. I would then force a refresh when page tracking (tp buffer) saw PAGE-Weather I would send the command to refresh the 8 dynamic images so by time a user got around to pushing the view radar button the images would be fresh.

    It didn't take long to realize that trying to animate with dynamic images that would have to refresh when called would just take to long so I figured the above work around would basically make it a plain file image and not need to go to the url and pull a fresh image.

    Still didn't work right. Still a blank time in between images. I then loaded the images into icon slots thinking maybe pulling from the dynamic library is just slow but that didn't work (used code to change icon).

    I'm now thinking the file is to large to be drawn quickly, the images are 50kb each and I have perfectly running animations but they are 15.5kb each, so maybe the radar images are to big.

    But why and how does picture frame load a new image witht out a blank space in between?

    There's got to be way but I tried animation from the TP, from code usinf ^ani commands, through code changing icons slot, even tried multi state levels and got no where.

    If any ones got this or any medium size animation working smootly I'd like to hear how.
  • can you send an example of your panel file?
  • jjamesjjames Posts: 2,908
    I've heard that in order to do a very nice smooth animation when pulling dynamic images, you need to upgrad the memory on the panel. We haven't done this yet, but when we do I'll update you on that.
  • viningvining Posts: 4,368
    jjames- My thoughts are that regardless of memory animating dynamic images and trying to pull the fresh images from the URL during the animation should be next to impossible. Which is why I opted to set my dynamic images refresh rate to 0 and checked the box to refresh only at panel start up in order to control when it would refresh. Obviously the radar images have to be current but by forcing a refresh using the '"^RFR-DynamicImageFile'" as shown below I can have it refreshed before the animation is invoked.

    SEND_COMMAND dvTPCV7,"'^RFR-RadarUptonNY_7'"

    joeyjoejo- I've included the applicable TPD4 files which is as I left after my last failed attempt. This version uses multi-bar graph range low = 1 and high = 8 macthing number of images and I was changing images via code and also in theis version I tried just pulling in from icon slot to see if that made a difference. I original did the standard multi state general with various up and down time, etc, etc. but they didn't work. In the VAV pop up I have one animatioin and in the MediaBG page I have two animations (paddle fan and stick figure) which work fine. In the MediaBG I also have animated lighting but I use changes in opacity values to match existing lighing level which works pretty good. So I tried to match existing known working methods but to no avail.

    The radar images are I believe 600 x 480 and 50kbps, so are they to big? I don't know but I wouldn't think so.

    If you could make an animation work with the URL listed in the resource manager RadarUptonNY_0 - 7 I'd be very curious to find out how. I'm a newbie and I quite often miss the obvious but I tried everything everything I could think of.

    Thanks for your inputs!
  • viningvining Posts: 4,368
    I might add that the animated pop up in question is Weather3Large. Weather2Large was an original attempt with 80 states which I intended to change states every 1/10th second. 1-10 are the same 11-20 a the same, so on. Thinking, if it worked it would make a smooth image and keep the time between frames to the minimum while in a sense maintaining the show time I wanted per frame (image as every group of ten are the same). But I gave up on that idea too.
  • jjamesjjames Posts: 2,908
    Just a thought. Would perhaps going out to the world wide web of amazing internet traffic be part of the culprit? What if we were able to download the images onto the FTP of the master and then use those in the animation? I don't even know if that's possible or would even help, but I'm just thinking that a local copy might be faster to update than a remote copy - such as one at weather.com.

    Again, just a thought and I'm welcoming anyone to shoot it down. :)
  • viningvining Posts: 4,368
    I don't think that's possible. I was looking into that prospect somewhat but couldn't find a way to add pics the the resource manager and don't know if the write_file or open_file commands would be able to handle jpegs or png's.

    I would love to know if that's something worth attempting before trying cuz my gut instinct says no way. But what do I know.

    The point you made regarding the action on dynamic image being dynamic which means (I believe) when invoked it has to go to it's url and download an up to date image. Then refresh at what ever rate you set for it. Which is why (I believe) if you take the approach I tried and set refresh to 0 and only refresh at start up means (I believe) that it will just pull the image on file and not attemp to go to the URL and refresh,, there by eliminating all the IP/downloading stuff. Which if true is cool then we can dictate when to refresh using the '^RFR-dynamic_image' command to force a refresh at our convenience which would be slightly before invoking the animation. In theory I think it sounds good but I could be off my rocker.

    Maybe joeyjoejo or some one else could shed some light on whether these assumptions are true or not.

    But regardless of the downloading/refresh thing I've also tried using static images just to eliminate all that crap and still couldn't pull if off, which is why I'm thinking what my wife says is true, size does matter!

    Right now I'm hoping joeyjoejo will give some insight to help me to determine whether or not to take this idea off the shelf and try some more.
  • Joe HebertJoe Hebert Posts: 2,159
    Memory
    vining wrote:
    The radar images are I believe 600 x 480 and 50kbps, so are they to big? I don't know but I wouldn't think so.
    I agree with Jeremiah that a memory upgrade may be in order. I was told by a reliable source that once you try to animate anything (multi-state buttons or other animations including sliding popups and such) over 100,000 pixels you won?t get the smooth results you expect. At 600x480 you are almost 3x over the 100K limit (if that is indeed the actual limit, I can?t confirm that number as fact ? but there is a limit which is dependent on the memory in the panel)
    vining wrote:
    I don't think that's possible. I was looking into that prospect somewhat but couldn't find a way to add pics the the resource manager and don't know if the write_file or open_file commands would be able to handle jpegs or png's.
    You can write whatever you want to write to the flash drive as long as space is available. I had an app where I needed to display pictures from the web that were only available in .gif format (daily cartoons). So I wrote a module that passed the URL of each pic to a php scipt on my server and the scipt retrieved the .gif, converted it to a .png, and returned it back to the module which then in turn stored it on the flash drive. When the user wanted to view the pics I did a refresh on a dynamic image which retrieved the pics from the flash drive.

    And yes, a refresh rate of 0 means that the resource is only downloaded once.
  • viningvining Posts: 4,368
    Joe- Thanks for the info. I did feel it was a file size problem I just didn't expect RAM be the culprit.

    I like the fact that I can ead and write whatever to RAM which gives me something else to learn as I have not yet played with read_file, writ_file, etc, commands.

    A while ago I did want to attempt using AMX with PHP as I have source code in PHP scipt that can interface with winamp, another SourceForge 'GetID3' script that I modified to work with MySQL so I been very interrested in that possibility.

    Do you have an example of how your PHP interface worked so I can get an idea how to begin the process. I don't need your whole script but just a little direction.

    Thanks
  • Joe HebertJoe Hebert Posts: 2,159
    vining wrote:
    Do you have an example of how your PHP interface worked so I can get an idea how to begin the process. I don't need your whole script but just a little direction.
    I call a PHP script the same way I call for an HTML page or retrieve an RSS feed. In my case there really isn?t any interface between AMX and PHP other than opening a socket and doing a GET just like any other web page. Instead of asking for a file with an .HTML or .XML extension, I ask for a file with a .PHP extension (and pass the necessary parameters in the URL).

    The work that PHP does is on the server side and is totally transparent to AMX. To find out everything you ever wanted to know about PHP visit:

    http://www.php.net/

    For my money, PHP is the most powerful scripting language for the web.
  • viningvining Posts: 4,368
    OK. I know the link well and did alot scipting in PHP about a year ago. I was working on a script that would read a directory of cd's using a "GETID3" function from Sourcforge that would load a MYSQL database with all the meta data which I had running on an Apache server. And was displayed via PHP/HTML using the database search function by radio and check boxes.

    It was alot of fun but I got hung up on trying to make sticky check boxes with javascript and cookies, Session IDs and then resolving ip addresses to city and state. And none of it had any purpose other than my own amusement and curiosity. There's alot that can be done with PHP, but as I'm not a real programmer or at least not a full time programmer with years of experience, doing my programming at nights and on weekends, I just don't have time to do everything I'd like to and play with all this stuff. But when I get a chance I think I'd like to play with PHP some more.
Sign In or Register to comment.