Real time

Discussion in 'ASP .Net' started by Ted Burhan, May 20, 2004.

  1. Ted Burhan

    Ted Burhan Guest

    Hi all,

    I'm trying to display a real-time data in one form or another (i.e.
    animation/graphic file, or just a text) in asp.net.
    The data for the images/text is retrieved from a SQL Server database.

    I have a few plans in mind:
    - I could have an aspx page that would use GDI+ classes to generate the
    graphics and let the page refreshes the images at a regular interval. The
    drawback is though, there may be a dozen of images in a single page, which
    means that there would be a dozen or so postbacks at every iteration, hence,
    demanding a lot of CPU time at the server as well as the client machine.
    - I could have a single aspx page that would refresh at a regular interval.
    Obviously I will have to have a pre-made images for each possible states.
    - Another alternative is to use Flash as it could talk to SQL Server
    directly using the Xml objects. Setting up flash movies in an aspx page is
    quite tedious job though. While browsing through the net I found several
    libaries that could actually let me generate SWF file in .NET, but most of
    them are still in Alpha stages, so I'm not very comfortable of using them.

    Can anyone please give me a suggestion on what the most efficient way of
    doing this is? Maybe somebody has even done this before.

    Many thanks
    Ted
     
    Ted Burhan, May 20, 2004
    #1
    1. Advertising

  2. Hi

    Maybe I don't understand you but for images its not complex
    getting only the image not the whole page....

    function doIt(newSrc){
    var img = new Image();
    img.src = newSrc;
    img.onload = doDisplay;
    img.onerror = errHandler;
    }

    function doDisplay(){
    document.images["imgName"].src = this.src; // imgName is the target img
    }

    function errHandler(){
    // Handle error
    }

    Obliviously a very basic example...

    Preloading images...
    function preLoad(){
    var a = new Array();
    for( i = 0; i < preload.arguments.length; i++ )
    {
    a[ i ] = new Image();
    a[ i ].src = "PATH/" + iPreload.arguments;
    }
    }

    preLoad("img1.gif","img2.gif","img3.jpg");


    For text you could use webservices or a hidden iframe to load the data
    http://msdn.microsoft.com/downloads...rnet/behaviors/library/webservice/default.asp
    DHTML sdk
    http://msdn.microsoft.com/library/d...hor/dhtml/reference/dhtml_reference_entry.asp

    --
    Best Regards
    Vidar Petursson
    ==============================
    Microsoft Scripting MVP
    http://www.microsoft.com/technet/scriptcenter
    ==============================
    "Ted Burhan" <> wrote in message
    news:...
    > Hi all,
    >
    > I'm trying to display a real-time data in one form or another (i.e.
    > animation/graphic file, or just a text) in asp.net.
    > The data for the images/text is retrieved from a SQL Server database.
    >
    > I have a few plans in mind:
    > - I could have an aspx page that would use GDI+ classes to generate the
    > graphics and let the page refreshes the images at a regular interval. The
    > drawback is though, there may be a dozen of images in a single page, which
    > means that there would be a dozen or so postbacks at every iteration,
    > hence,
    > demanding a lot of CPU time at the server as well as the client machine.
    > - I could have a single aspx page that would refresh at a regular
    > interval.
    > Obviously I will have to have a pre-made images for each possible states.
    > - Another alternative is to use Flash as it could talk to SQL Server
    > directly using the Xml objects. Setting up flash movies in an aspx page is
    > quite tedious job though. While browsing through the net I found several
    > libaries that could actually let me generate SWF file in .NET, but most of
    > them are still in Alpha stages, so I'm not very comfortable of using them.
    >
    > Can anyone please give me a suggestion on what the most efficient way of
    > doing this is? Maybe somebody has even done this before.
    >
    > Many thanks
    > Ted
    >
    >
     
    Vidar Petursson, May 20, 2004
    #2
    1. Advertising

  3. Ted Burhan

    Ted Burhan Guest

    Hi Vidar,

    Thank you for replying.
    It might help if I explain briefly what I'm trying to achieve.
    I have a Windows 2000 server connected to a mining device via some sort of
    serial port communication.
    The server listens to the port and decypher the incoming data stream from
    that serial port and store them in
    the appropriate places in the Database (SQL Server 2000). Data frame
    generally comes in at around 100ms intervals.
    One of the tables in the database is used to represent the current values of
    the device attributes
    I.e.
    tblTagValues
    ==========
    TagID int
    Value real

    The asp.net application is responsible for reading those "current" tag
    values and display them in one form or another
    (semaphores/flags, gauges, etc..). I understand that because of the nature
    of web brower and internet latency, I may
    not be able to achieve real-time presentation of the data, but we can
    accomodate sub 5 seconds delay (near real time).
    Can you suggest what the best method to achieve this is?

    Ted


    "Vidar Petursson" <> wrote in
    message news:...
    > Hi
    >
    > Maybe I don't understand you but for images its not complex
    > getting only the image not the whole page....
    >
    > function doIt(newSrc){
    > var img = new Image();
    > img.src = newSrc;
    > img.onload = doDisplay;
    > img.onerror = errHandler;
    > }
    >
    > function doDisplay(){
    > document.images["imgName"].src = this.src; // imgName is the target img
    > }
    >
    > function errHandler(){
    > // Handle error
    > }
    >
    > Obliviously a very basic example...
    >
    > Preloading images...
    > function preLoad(){
    > var a = new Array();
    > for( i = 0; i < preload.arguments.length; i++ )
    > {
    > a[ i ] = new Image();
    > a[ i ].src = "PATH/" + iPreload.arguments;
    > }
    > }
    >
    > preLoad("img1.gif","img2.gif","img3.jpg");
    >
    >
    > For text you could use webservices or a hidden iframe to load the data
    >

    http://msdn.microsoft.com/downloads...rnet/behaviors/library/webservice/default.asp
    > DHTML sdk
    >

    http://msdn.microsoft.com/library/d...hor/dhtml/reference/dhtml_reference_entry.asp
    >
    > --
    > Best Regards
    > Vidar Petursson
    > ==============================
    > Microsoft Scripting MVP
    > http://www.microsoft.com/technet/scriptcenter
    > ==============================
    > "Ted Burhan" <> wrote in message
    > news:...
    > > Hi all,
    > >
    > > I'm trying to display a real-time data in one form or another (i.e.
    > > animation/graphic file, or just a text) in asp.net.
    > > The data for the images/text is retrieved from a SQL Server database.
    > >
    > > I have a few plans in mind:
    > > - I could have an aspx page that would use GDI+ classes to generate the
    > > graphics and let the page refreshes the images at a regular interval.

    The
    > > drawback is though, there may be a dozen of images in a single page,

    which
    > > means that there would be a dozen or so postbacks at every iteration,
    > > hence,
    > > demanding a lot of CPU time at the server as well as the client machine.
    > > - I could have a single aspx page that would refresh at a regular
    > > interval.
    > > Obviously I will have to have a pre-made images for each possible

    states.
    > > - Another alternative is to use Flash as it could talk to SQL Server
    > > directly using the Xml objects. Setting up flash movies in an aspx page

    is
    > > quite tedious job though. While browsing through the net I found several
    > > libaries that could actually let me generate SWF file in .NET, but most

    of
    > > them are still in Alpha stages, so I'm not very comfortable of using

    them.
    > >
    > > Can anyone please give me a suggestion on what the most efficient way of
    > > doing this is? Maybe somebody has even done this before.
    > >
    > > Many thanks
    > > Ted
    > >
    > >

    >
    >
     
    Ted Burhan, May 20, 2004
    #3
  4. Last year we went with the SWF solution. The SWF posted an HTTP Request to
    an ASPX page on the server which generated an image, based upon the
    parameters sent by the SWF, stored it in a temp folder, and returned the URL
    of the image file to the SWF, which then requested the image file. It was
    not necessary to dynamically-create the SWF. We simply built a SWF that
    behaved as I've described. The only thing dynamically-generated was the
    image file.

    --
    HTH,
    Kevin Spencer
    ..Net Developer
    Microsoft MVP
    Big things are made up
    of lots of little things.

    "Ted Burhan" <> wrote in message
    news:...
    > Hi all,
    >
    > I'm trying to display a real-time data in one form or another (i.e.
    > animation/graphic file, or just a text) in asp.net.
    > The data for the images/text is retrieved from a SQL Server database.
    >
    > I have a few plans in mind:
    > - I could have an aspx page that would use GDI+ classes to generate the
    > graphics and let the page refreshes the images at a regular interval. The
    > drawback is though, there may be a dozen of images in a single page, which
    > means that there would be a dozen or so postbacks at every iteration,

    hence,
    > demanding a lot of CPU time at the server as well as the client machine.
    > - I could have a single aspx page that would refresh at a regular

    interval.
    > Obviously I will have to have a pre-made images for each possible states.
    > - Another alternative is to use Flash as it could talk to SQL Server
    > directly using the Xml objects. Setting up flash movies in an aspx page is
    > quite tedious job though. While browsing through the net I found several
    > libaries that could actually let me generate SWF file in .NET, but most of
    > them are still in Alpha stages, so I'm not very comfortable of using them.
    >
    > Can anyone please give me a suggestion on what the most efficient way of
    > doing this is? Maybe somebody has even done this before.
    >
    > Many thanks
    > Ted
    >
    >
     
    Kevin Spencer, May 20, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. senthil
    Replies:
    5
    Views:
    1,410
    senthil
    Jan 24, 2004
  2. engsol
    Replies:
    2
    Views:
    964
    Dan Bishop
    Jan 26, 2004
  3. Curious Trigger
    Replies:
    2
    Views:
    1,832
    Curious Trigger
    Sep 9, 2006
  4. flamesrock
    Replies:
    8
    Views:
    502
    Hendrik van Rooyen
    Nov 24, 2006
  5. Brian

    Real time converted to Unix time

    Brian, Aug 29, 2003, in forum: Perl Misc
    Replies:
    1
    Views:
    394
    James Willmore
    Aug 29, 2003
Loading...

Share This Page