Page 1 of 2

MOD54415 Web Server

Posted: Wed Feb 20, 2013 12:05 pm
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!

Re: MOD54415 Web Server

Posted: Wed Feb 20, 2013 12:26 pm
by seulater
Have you taken a look here: C:\nburn\examples\Web

That tick tac toe example might shed some light.

Re: MOD54415 Web Server

Posted: Wed Feb 20, 2013 12:33 pm
by jediengineer
aahh. ok, I see, thanks!! I must have overlooked it.

Re: MOD54415 Web Server

Posted: Mon Feb 25, 2013 8:39 am
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!!

Re: MOD54415 Web Server

Posted: Mon Feb 25, 2013 8:53 am
by Forrest
You need to escape your quotes.

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

Re: MOD54415 Web Server

Posted: Mon Feb 25, 2013 10:12 am
by jediengineer
Awesome! Thanks Forrest! Any lead on making text flash?

Re: MOD54415 Web Server

Posted: Wed Feb 27, 2013 9:04 am
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

Re: MOD54415 Web Server

Posted: Wed Feb 27, 2013 9:54 am
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.

Re: MOD54415 Web Server

Posted: Wed Feb 27, 2013 4:59 pm
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.

Re: MOD54415 Web Server

Posted: Wed Feb 27, 2013 6:09 pm
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.