Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Real time

Reply
Thread Tools

Real time

 
 
Ted Burhan
Guest
Posts: n/a
 
      05-19-2004
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


 
Reply With Quote
 
 
 
 
Vidar Petursson
Guest
Posts: n/a
 
      05-20-2004
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[i];
}
}

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/...ce/default.asp
DHTML sdk
http://msdn.microsoft.com/library/de...ence_entry.asp

--
Best Regards
Vidar Petursson
==============================
Microsoft Scripting MVP
http://www.microsoft.com/technet/scriptcenter
==============================
"Ted Burhan" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
 
 
 
Ted Burhan
Guest
Posts: n/a
 
      05-20-2004
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" <(E-Mail Removed)> wrote in
message news:(E-Mail Removed)...
> 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[i];
> }
> }
>
> 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/...ce/default.asp
> DHTML sdk
>

http://msdn.microsoft.com/library/de...ence_entry.asp
>
> --
> Best Regards
> Vidar Petursson
> ==============================
> Microsoft Scripting MVP
> http://www.microsoft.com/technet/scriptcenter
> ==============================
> "Ted Burhan" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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
> >
> >

>
>



 
Reply With Quote
 
Kevin Spencer
Guest
Posts: n/a
 
      05-20-2004
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ok time to do a partition (system) back up, for real this time.suggestions please squirlchatr@yahoo.com Computer Support 2 04-22-2009 10:42 AM
Is time.time() < time.time() always true? flamesrock Python 8 11-24-2006 06:51 AM
OT: The Interview - Real, Funny...Real Funny The Rev [MCT] MCSE 42 05-31-2005 10:42 PM
product of real and (integer)(after converted to real one) value - vhdl found fatal error senthil VHDL 5 01-24-2004 04:37 AM
Real time converted to Unix time Brian Perl Misc 1 08-29-2003 04:36 AM



Advertisments