Page 1 of 2
Lost sensor contact webtag
Posted: Wed 03 Nov 2010 9:34 pm
by werribee_au
<#sensorcontactlost> webtag is listed as all lower case in the help file and the "webtag" page, but in the wiki "realtime.txt" page it is listed as <#SensorContactLost> (Note the upper case S, C & L).
The Wiki realtime.txt page lists the description as;
"If the station has lost contact with its remote sensors "Fine Offset only", a Flag number is given (1 = Yes, 0 = No)"
So i would expect a "1" for ok or "0" for lost.
In the help file:
"1 if the station has lost contact with its remote sensors (Fine Offset only)"
And the Wiki webtags page:
"1 if the station has lost contact with its remote sensors "Fine Offset only" 0 if contact has been established"
I can't get<#sensorcontactlost> to work where as <#SensorContactLost> does work and produces zero normally.
Are there 2 webtags or is there only the one, which I suspect as being <#SensorContactLost>
Re: Lost sensor contact webtag
Posted: Wed 03 Nov 2010 9:44 pm
by Synewave
The correct tag is <#SensorContactLost>.
Read it as a question, i.e. Sensor Contact Lost? 1=yes, 0=no.
So normal conditions it will be 0.
Re: Lost sensor contact webtag
Posted: Wed 03 Nov 2010 9:50 pm
by werribee_au
Thanks Paul,
I thought that was the case just needed some confirmation.
Re: Lost sensor contact webtag
Posted: Wed 03 Nov 2010 10:10 pm
by Synewave
You're welcome. I like your site by the way.
I see you've used some Javascript to translate the Sensor Contact Lost status into words. You could always replace that with an image, for example a green dot for OK and a red dot for not OK.
Just name two images sensor_1.jpg (a red one) and sensor_0.jpg (a green one) or whatever pic format you want to use. Then upload them to your images folder.
Then replace the Javascript with this:
Code: Select all
<script type="text/javascript">
var sensor = <#SensorContactLost>;
if (sensor==0){
var imagen = "sensor_0.jpg";
}
if (sensor==1){
var imagen = "sensor_1.jpg";
}
document.write('<img src="images/'+imagen+'"/>');
</script>
But you probably know all this anyway.

Re: Lost sensor contact webtag
Posted: Wed 03 Nov 2010 10:36 pm
by steve
To be honest, I wasn't actually sure whether the web tags were case sensitive or not; in general, Delphi is not a case-sensitive language. As a result I've been inconsistent in my naming of the tags; some are all lower case, and some are PascalCase. I can confirm, that this particular one is "SensorContactLost" in the code. I'll see if I can easily make them all case insensitive.
Re: Lost sensor contact webtag
Posted: Wed 03 Nov 2010 11:16 pm
by beteljuice
Codingwise ... as an aside.
1/ a simple non-JavaScript option is available.
2/ There is (in this case) no need to declare a variable to a variable.
Code: Select all
<!-- sensor_0.jpg = Station On-Line -->
<!-- sensor_1.jpg = External Sensors lost -->
<!-- Non JavaScript -->
<img src = "images/sensor_<#SensorContactLost>.jpg" />
<!-- JavaScript with mouseOver -->
<script type="text/javascript">
if (<#SensorContactLost> == 1){
var imagen = "sensor_1.jpg";
var msg = "External Sensors NOT responding !";
} else {
var imagen = "sensor_0.jpg";
var msg = "Station functioning OK";
}
document.write('<img src=\"images/' +imagen+ ' title=\"' +msg+ '\" alt= \"' +msg+ '\" />');
</script>
Of course there are several ways the JavaScript could be written

and in both cases it would be better to state <img ..... height=xx width=xx />
Re: Lost sensor contact webtag
Posted: Thu 04 Nov 2010 8:53 am
by werribee_au
Thanks for the replies,
Ah, the same webtag but case sensitive, No wonder I was not getting a result.
As for the coding suggestions, you know I'm going to pick your brains until they hurt.

Don't you
I'll look at doing something after the weekend (got a wing ding (combined 69th & 50th) to set up for Sunday so I'm busy doing things)
Thanks
Gerard
Re: Lost sensor contact webtag
Posted: Thu 04 Nov 2010 9:28 pm
by werribee_au
Got it done, thanks for your suggestions and advice.
Re: Lost sensor contact webtag
Posted: Thu 04 Nov 2010 9:40 pm
by Synewave
Looks good. We all have different ways of achieving an end result. Beteljuice has much more experience than me and always provides the easiest solution. My solution was logical but maybe not the tidyest.
Don't worry about picking our brains, that's what this wonderful forum is for.
Re: Lost sensor contact webtag
Posted: Thu 04 Nov 2010 9:59 pm
by werribee_au
Tidy html? I wouldn't know it if it fell on me.
I sort of get by, self taught from the C64 days:
10 PRINT "Hello"
20 GOTO 10
Actually it took me a while to get the beteljuice document.write to work, finally worked it out.
document.write('<img src=\"images/' +imagen+ ' title=\"' +msg+ '\" alt= \"' +msg+ '\" />');
________________________________________^__________________________________
Missing close quote, took me 1/2 an hour to notice it

Worked a treat after that.
Maybe beteljuice was testing me

Re: Lost sensor contact webtag
Posted: Sat 06 Nov 2010 7:46 pm
by neil
Nice site
I noticed you are having problems with the guestbook
try looking up the following
http://www.dbscripts.net/guestbook/
I use it on my site & so far I have had no problems
Neil
Re: Lost sensor contact webtag
Posted: Sat 06 Nov 2010 8:21 pm
by werribee_au
Thanks Neil,
I'll have a look at the url.

Re: Lost sensor contact webtag
Posted: Sun 07 Nov 2010 9:34 am
by scoobs
Duno if its just me or maybe you have missed something in html.
If i look at your page with ff i get 20.6 °C  -1.5/hr shown on the temp.
If i use IE it shows ok but when i move the mouse over everything gets underlined.
Only on the index.html
Re: Lost sensor contact webtag
Posted: Sun 07 Nov 2010 6:28 pm
by werribee_au
I also noticed this yesterday when I used FF. I forgot the ";" at the end of "nbsp"

, it is there now.
Thanks for the reminder scoobs
Isn't it interesting that GC knew what I meant but FF showed exactly as it should have.
Re: Lost sensor contact webtag
Posted: Sun 07 Nov 2010 8:17 pm
by scoobs
seems ok in FF now still getting everything underlined in IE
