MOD54415 Web Server

Discussion to talk about software related topics only.
jediengineer
Posts: 192
Joined: Mon Dec 17, 2012 6:24 am

MOD54415 Web Server

Post by jediengineer »

Hi all, I have a webpage running on the 54415 and it has function calls. I want the program to return text back to the page as either flashing bold red, or green bold text. I'm having trouble figuring out how to do that. This is a sample if my code that returns the values, and it works. How do I embed the html into it? Anything I've tried so far has not worked too well, and I can't get color changes from this end:
case 7:
if (J1[5])
{
siprintf(buffer, "ON");
writestring(fd, buffer);
break;
}
else
{
siprintf(buffer, "OFF");
writestring(fd, buffer);
break;
}
I want "ON" to flash red bold text and if it sends "OFF" then it needs to be green bold text. Thanks all!
seulater
Posts: 445
Joined: Fri Apr 25, 2008 5:26 am

Re: MOD54415 Web Server

Post by seulater »

Have you taken a look here: C:\nburn\examples\Web

That tick tac toe example might shed some light.
jediengineer
Posts: 192
Joined: Mon Dec 17, 2012 6:24 am

Re: MOD54415 Web Server

Post by jediengineer »

aahh. ok, I see, thanks!! I must have overlooked it.
jediengineer
Posts: 192
Joined: Mon Dec 17, 2012 6:24 am

Re: MOD54415 Web Server

Post by jediengineer »

Hmm, that still didn't seem to help much. Here's a line I'm trying to send out, but I think there's something wrong with the quotation marks - can someone look it over?

siprintf (buffer, "<td style = "background-color:lightblue; color:black;">READY</td>");

Also, what's the proper way to make text flash? If I want text to flash when this line returns data to the browser, how would I make that happen? I'm not very good with CSS, and <flash></flash> doesn't seem to work with ie, or firefox. Must be an older HTML variant...

Thanks!!
User avatar
Forrest
Posts: 288
Joined: Wed Apr 23, 2008 10:05 am

Re: MOD54415 Web Server

Post by Forrest »

You need to escape your quotes.

siprintf (buffer, "<td style = \"background-color:lightblue; color:black;\">READY</td>");
Forrest Stanley
Project Engineer
NetBurner, Inc

NetBurner Learn Articles: http://www.netburner.com/learn
jediengineer
Posts: 192
Joined: Mon Dec 17, 2012 6:24 am

Re: MOD54415 Web Server

Post by jediengineer »

Awesome! Thanks Forrest! Any lead on making text flash?
User avatar
Forrest
Posts: 288
Joined: Wed Apr 23, 2008 10:05 am

Re: MOD54415 Web Server

Post by Forrest »

jediengineer wrote:Awesome! Thanks Forrest! Any lead on making text flash?

I think the web needs some men in black to come around and hit developers with the red flash that erases the blink html tag from everyone's memory. ;) http://www.mcli.dist.maricopa.edu/tut/tut17.html
Forrest Stanley
Project Engineer
NetBurner, Inc

NetBurner Learn Articles: http://www.netburner.com/learn
User avatar
dciliske
Posts: 624
Joined: Mon Feb 06, 2012 9:37 am
Location: San Diego, CA
Contact:

Re: MOD54415 Web Server

Post by dciliske »

The real question is why do you want the text to flash? If it's the case where, "HEY, IDIOT! THE PLANT'S ABOUT TO EXPLODE!!!", then perhaps it's allowable (though I would argue there's better ways of passing urgent information...). If it's a case of "Hey! You need to fix [insert item here].", then a nicely set out error box in red with bold red text disrupting the normal structure is equally effective, without the annoyance of information disappearing every half second. If you really want to blink something to get the attention of the user, use an arrow and blink that.
Dan Ciliske
Project Engineer
Netburner, Inc
User avatar
tod
Posts: 587
Joined: Sat Apr 26, 2008 8:27 am
Location: Southern California
Contact:

Re: MOD54415 Web Server

Post by tod »

Flashing text has nothing to do with the NetBurner. It's just HTML or CSS or Javascript. You can Google or search StackOverflow and find many examples.

I had a requirement to blink images for warnings (once/second) or errors (twice/second) so I used Javascript and an interval timer. Turns out even with small images it's REALLY ANNOYING unless you coordinate the blinking by storing everything that has to blink in arrays and synchronizing the effect. Then it's just mildly annoying which was sort of the goal since it meant the instrument was in some type of error state that needed to be corrected.
User avatar
tony
Posts: 49
Joined: Thu Apr 24, 2008 6:05 pm

Re: MOD54415 Web Server

Post by tony »

I'm actually a fan of blinking items. It's very common for lights to blink in an industrial setting. Rather than do an on off blink, I prefer an animated approach. Since I use jquery in most of my web project I typically use the Pulsate effect. This provides a calm way to get someones attention. See http://docs.jquery.com/UI/Effects/Pulsate for an example.
Post Reply