MOD54415 Web Server
-
- Posts: 192
- Joined: Mon Dec 17, 2012 6:24 am
MOD54415 Web Server
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!
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
Have you taken a look here: C:\nburn\examples\Web
That tick tac toe example might shed some light.
That tick tac toe example might shed some light.
-
- Posts: 192
- Joined: Mon Dec 17, 2012 6:24 am
Re: MOD54415 Web Server
aahh. ok, I see, thanks!! I must have overlooked it.
-
- Posts: 192
- Joined: Mon Dec 17, 2012 6:24 am
Re: MOD54415 Web Server
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!!
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
You need to escape your quotes.
siprintf (buffer, "<td style = \"background-color:lightblue; color:black;\">READY</td>");
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
Project Engineer
NetBurner, Inc
NetBurner Learn Articles: http://www.netburner.com/learn
-
- Posts: 192
- Joined: Mon Dec 17, 2012 6:24 am
Re: MOD54415 Web Server
Awesome! Thanks Forrest! Any lead on making text flash?
Re: MOD54415 Web Server
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
Project Engineer
NetBurner, Inc
NetBurner Learn Articles: http://www.netburner.com/learn
Re: MOD54415 Web Server
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
Project Engineer
Netburner, Inc
Re: MOD54415 Web Server
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.
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
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.