Revision 9c37d703
Added by Colin Fleming about 11 years ago
usr/local/www/services_ntpd_gps.php | ||
---|---|---|
157 | 157 |
set_default_gps(); |
158 | 158 |
} |
159 | 159 |
} |
160 |
$closehead = false; |
|
160 | 161 |
$pconfig = &$config['ntpd']['gps']; |
161 |
|
|
162 | 162 |
$pgtitle = array(gettext("Services"),gettext("NTP GPS")); |
163 | 163 |
$shortcut_section = "ntp"; |
164 | 164 |
include("head.inc"); |
165 | 165 |
?> |
166 | 166 |
|
167 | 167 |
<script type="text/javascript"> |
168 |
|
|
168 |
//<![CDATA[ |
|
169 | 169 |
function show_advanced(showboxID, configvalueID) { |
170 | 170 |
document.getElementById(showboxID).innerHTML=''; |
171 | 171 |
aodiv = document.getElementById(configvalueID); |
... | ... | |
351 | 351 |
// Display the result |
352 | 352 |
document.getElementById("nmeachecksum").innerHTML = hexsum; |
353 | 353 |
} |
354 |
|
|
354 |
//]]> |
|
355 | 355 |
</script> |
356 |
|
|
356 |
</head> |
|
357 | 357 |
<body link="#0000CC" vlink="#0000CC" alink="#0000CC"> |
358 | 358 |
<?php include("fbegin.inc"); ?> |
359 | 359 |
<form action="services_ntpd_gps.php" method="post" name="iform" id="iform" accept-charset="utf-8"> |
360 | 360 |
<?php if ($input_errors) print_input_errors($input_errors); ?> |
361 | 361 |
<?php if ($savemsg) print_info_box($savemsg); ?> |
362 | 362 |
|
363 |
<table width="100%" border="0" cellpadding="0" cellspacing="0"> |
|
363 |
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="ntpd gps">
|
|
364 | 364 |
<tr> |
365 | 365 |
<td> |
366 | 366 |
<?php |
... | ... | |
375 | 375 |
<tr> |
376 | 376 |
<td> |
377 | 377 |
<div id="mainarea"> |
378 |
<table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0"> |
|
378 |
<table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0" summary="main area">
|
|
379 | 379 |
<tr> |
380 | 380 |
<td colspan="2" valign="top" class="listtopic"><?=gettext("NTP Serial GPS Configuration"); ?></td> |
381 | 381 |
</tr> |
... | ... | |
392 | 392 |
<td width="78%" valign="top" class="vtable"> |
393 | 393 |
<?php /* Start with the original "Default", list a "Generic" and then specific configs alphabetically */ ?> |
394 | 394 |
<select id="gpstype" name="gpstype" class="formselect" onchange="set_gps_default(this.form)"> |
395 |
<option value="Default"<?php if($pconfig['type'] == 'Default') echo ' selected'; ?>>Default</option>
|
|
396 |
<option value="Generic" title="Generic"<?php if($pconfig['type'] == 'Generic') echo ' selected';?>>Generic</option>
|
|
397 |
<option value="Garmin" title="$PGRM... Most Garmin"<?php if($pconfig['type'] == 'Garmin') echo ' selected';?>>Garmin</option>
|
|
398 |
<option value="MediaTek" title="$PMTK... Adafruit, Fastrax, some Garmin and others"<?php if($pconfig['type'] == 'MediaTek') echo ' selected';?>>MediaTek</option>
|
|
399 |
<option value="SiRF" title="$PSRF... Used by many devices"<?php if($pconfig['type'] == 'sirf') echo ' selected';?>>SiRF</option>
|
|
400 |
<option value="U-Blox" title="$PUBX... U-Blox 5, 6 and probably 7"<?php if($pconfig['type'] == 'U-Blox') echo ' selected';?>>U-Blox</option>
|
|
401 |
<option value="SureGPS" title="$PMTK... Sure Electronics SKG16B"<?php if($pconfig['type'] == 'SureGPS') echo ' selected';?>>SureGPS</option>
|
|
395 |
<option value="Default"<?php if($pconfig['type'] == 'Default') echo " selected=\"selected\""; ?>>Default</option>
|
|
396 |
<option value="Generic" title="Generic"<?php if($pconfig['type'] == 'Generic') echo " selected=\"selected\"";?>>Generic</option>
|
|
397 |
<option value="Garmin" title="$PGRM... Most Garmin"<?php if($pconfig['type'] == 'Garmin') echo " selected=\"selected\"";?>>Garmin</option>
|
|
398 |
<option value="MediaTek" title="$PMTK... Adafruit, Fastrax, some Garmin and others"<?php if($pconfig['type'] == 'MediaTek') echo " selected=\"selected\"";?>>MediaTek</option>
|
|
399 |
<option value="SiRF" title="$PSRF... Used by many devices"<?php if($pconfig['type'] == 'sirf') echo " selected=\"selected\"";?>>SiRF</option>
|
|
400 |
<option value="U-Blox" title="$PUBX... U-Blox 5, 6 and probably 7"<?php if($pconfig['type'] == 'U-Blox') echo " selected=\"selected\"";?>>U-Blox</option>
|
|
401 |
<option value="SureGPS" title="$PMTK... Sure Electronics SKG16B"<?php if($pconfig['type'] == 'SureGPS') echo " selected=\"selected\"";?>>SureGPS</option>
|
|
402 | 402 |
</select> <?php echo gettext("This option allows you to select a predefined configuration.");?> |
403 | 403 |
<br /> |
404 | 404 |
<br /> |
... | ... | |
418 | 418 |
<option value="">none</option> |
419 | 419 |
<?php foreach ($serialports as $port): |
420 | 420 |
$shortport = substr($port,5); |
421 |
$selected = ($shortport == $pconfig['port']) ? " selected" : "";?> |
|
421 |
$selected = ($shortport == $pconfig['port']) ? " selected=\"selected\"" : "";?>
|
|
422 | 422 |
<option value="<?php echo $shortport;?>"<?php echo $selected;?>><?php echo $shortport;?></option> |
423 | 423 |
<?php endforeach; ?> |
424 | 424 |
</select> |
425 | 425 |
<?php echo gettext("All serial ports are listed, be sure to pick the port with the GPS attached."); ?> |
426 | 426 |
<br /><br /> |
427 | 427 |
<select id="gpsspeed" name="gpsspeed" class="formselect"> |
428 |
<option value="0"<?php if(!$pconfig['speed']) echo ' selected'; ?>>4800</option>
|
|
429 |
<option value="16"<?php if($pconfig['speed'] === '16') echo ' selected';?>>9600</option>
|
|
430 |
<option value="32"<?php if($pconfig['speed'] === '32') echo ' selected';?>>19200</option>
|
|
431 |
<option value="48"<?php if($pconfig['speed'] === '48') echo ' selected';?>>38400</option>
|
|
432 |
<option value="64"<?php if($pconfig['speed'] === '64') echo ' selected';?>>57600</option>
|
|
433 |
<option value="80"<?php if($pconfig['speed'] === '80') echo ' selected';?>>115200</option>
|
|
428 |
<option value="0"<?php if(!$pconfig['speed']) echo " selected=\"selected\""; ?>>4800</option>
|
|
429 |
<option value="16"<?php if($pconfig['speed'] === '16') echo " selected=\"selected\"";?>>9600</option>
|
|
430 |
<option value="32"<?php if($pconfig['speed'] === '32') echo " selected=\"selected\"";?>>19200</option>
|
|
431 |
<option value="48"<?php if($pconfig['speed'] === '48') echo " selected=\"selected\"";?>>38400</option>
|
|
432 |
<option value="64"<?php if($pconfig['speed'] === '64') echo " selected=\"selected\"";?>>57600</option>
|
|
433 |
<option value="80"<?php if($pconfig['speed'] === '80') echo " selected=\"selected\"";?>>115200</option>
|
|
434 | 434 |
</select> <?php echo gettext("Serial port baud rate."); ?> |
435 | 435 |
<br /> |
436 | 436 |
<br /> |
... | ... | |
442 | 442 |
<?php /* 1 = MRC, 2 = GGA, 4 = GLL, 8 = ZDA or ZDG */?> |
443 | 443 |
<td width="22%" valign="top" class="vncellreq">NMEA sentences</td> |
444 | 444 |
<td width="78%" class="vtable"> |
445 |
<select id="gpsnmea" name="gpsnmea[]" multiple="true" class="formselect">
|
|
446 |
<option value="0"<?php if(!$pconfig['nmea']) echo ' selected'; ?>>All</option>
|
|
447 |
<option value="1"<?php if($pconfig['nmea'] & 1) echo ' selected';?>>MRC</option>
|
|
448 |
<option value="2"<?php if($pconfig['nmea'] & 2) echo ' selected';?>>GGA</option>
|
|
449 |
<option value="4"<?php if($pconfig['nmea'] & 4) echo ' selected';?>>GLL</option>
|
|
450 |
<option value="8"<?php if($pconfig['nmea'] & 8) echo ' selected';?>>ZDA or ZDG</option>
|
|
445 |
<select id="gpsnmea" name="gpsnmea[]" multiple="multiple" class="formselect">
|
|
446 |
<option value="0"<?php if(!$pconfig['nmea']) echo " selected=\"selected\""; ?>>All</option>
|
|
447 |
<option value="1"<?php if($pconfig['nmea'] & 1) echo " selected=\"selected\"";?>>MRC</option>
|
|
448 |
<option value="2"<?php if($pconfig['nmea'] & 2) echo " selected=\"selected\"";?>>GGA</option>
|
|
449 |
<option value="4"<?php if($pconfig['nmea'] & 4) echo " selected=\"selected\"";?>>GLL</option>
|
|
450 |
<option value="8"<?php if($pconfig['nmea'] & 8) echo " selected=\"selected\"";?>>ZDA or ZDG</option>
|
|
451 | 451 |
</select><br /> |
452 | 452 |
<?php echo gettext("By default NTP will listen for all supported NMEA sentences. Here one or more sentences to listen for may be specified."); ?> |
453 | 453 |
</td> |
... | ... | |
455 | 455 |
<tr> |
456 | 456 |
<td width="22%" valign="top" class="vncellreq">Fudge time 1</td> |
457 | 457 |
<td width="78%" class="vtable"> |
458 |
<input name="gpsfudge1" type="text" class="formfld unknown" id="gpsfudge1" min="-1" max="1" size="20" value="<?=htmlspecialchars($pconfig['fudge1']);?>">(<?php echo gettext("seconds");?>)<br /> |
|
458 |
<input name="gpsfudge1" type="text" class="formfld unknown" id="gpsfudge1" min="-1" max="1" size="20" value="<?=htmlspecialchars($pconfig['fudge1']);?>" />(<?php echo gettext("seconds");?>)<br />
|
|
459 | 459 |
<?php echo gettext("Fudge time 1 is used to specify the GPS PPS signal offset");?> (<?php echo gettext("default");?>: 0.0).</td> |
460 | 460 |
</tr> |
461 | 461 |
<tr> |
462 | 462 |
<td width="22%" valign="top" class="vncellreq">Fudge time 2</td> |
463 | 463 |
<td width="78%" class="vtable"> |
464 |
<input name="gpsfudge2" type="text" class="formfld unknown" id="gpsfudge2" min="-1" max="1" size="20" value="<?=htmlspecialchars($pconfig['fudge2']);?>">(<?php echo gettext("seconds");?>)<br /> |
|
464 |
<input name="gpsfudge2" type="text" class="formfld unknown" id="gpsfudge2" min="-1" max="1" size="20" value="<?=htmlspecialchars($pconfig['fudge2']);?>" />(<?php echo gettext("seconds");?>)<br />
|
|
465 | 465 |
<?php echo gettext("Fudge time 2 is used to specify the GPS time offset");?> (<?php echo gettext("default");?>: 0.0).</td> |
466 | 466 |
</tr> |
467 | 467 |
<tr> |
468 | 468 |
<td width="22%" valign="top" class="vncellreq">Stratum</td> |
469 | 469 |
<td width="78%" class="vtable"> |
470 |
<input name="gpsstratum" type="text" class="formfld unknown" id="gpsstratum" max="16" size="20" value="<?=htmlspecialchars($pconfig['stratum']);?>"><?php echo gettext("(0-16)");?><br /> |
|
470 |
<input name="gpsstratum" type="text" class="formfld unknown" id="gpsstratum" max="16" size="20" value="<?=htmlspecialchars($pconfig['stratum']);?>" /><?php echo gettext("(0-16)");?><br />
|
|
471 | 471 |
<?php echo gettext("This may be used to change the GPS Clock stratum");?> (<?php echo gettext("default");?>: 0). <?php echo gettext("This may be useful if, for some reason, you want ntpd to prefer a different clock"); ?></td> |
472 | 472 |
</tr> |
473 | 473 |
<tr> |
... | ... | |
483 | 483 |
<table> |
484 | 484 |
<tr> |
485 | 485 |
<td> |
486 |
<input name="gpsprefer" type="checkbox" class="formcheckbox" id="gpsprefer" OnClick="ToggleOther('gpsprefer', 'gpsselect')"<?php if(!$pconfig['prefer']) echo ' checked'; ?>>
|
|
486 |
<input name="gpsprefer" type="checkbox" class="formcheckbox" id="gpsprefer" onclick="ToggleOther('gpsprefer', 'gpsselect')"<?php if(!$pconfig['prefer']) echo " checked=\"checked\""; ?> />
|
|
487 | 487 |
</td> |
488 | 488 |
<td> |
489 | 489 |
<span class="vexpl"><?php echo gettext("NTP should prefer this clock (default: enabled)."); ?></span> |
... | ... | |
491 | 491 |
</tr> |
492 | 492 |
<tr> |
493 | 493 |
<td> |
494 |
<input name="gpsselect" type="checkbox" class="formcheckbox" id="gpsselect" OnClick="ToggleOther('gpsselect', 'gpsprefer')"<?php if($pconfig['noselect']) echo ' checked'; ?>>
|
|
494 |
<input name="gpsselect" type="checkbox" class="formcheckbox" id="gpsselect" onclick="ToggleOther('gpsselect', 'gpsprefer')"<?php if($pconfig['noselect']) echo " checked=\"checked\""; ?> />
|
|
495 | 495 |
</td> |
496 | 496 |
<td> |
497 | 497 |
<span class="vexpl"><?php echo gettext("NTP should not use this clock, it will be displayed for reference only(default: disabled)."); ?></span> |
... | ... | |
499 | 499 |
</tr> |
500 | 500 |
<tr> |
501 | 501 |
<td> |
502 |
<input name="gpsflag1" type="checkbox" class="formcheckbox" id="gpsflag1"<?php if($pconfig['flag1']) echo ' checked'; ?>>
|
|
502 |
<input name="gpsflag1" type="checkbox" class="formcheckbox" id="gpsflag1"<?php if($pconfig['flag1']) echo " checked=\"checked\""; ?> />
|
|
503 | 503 |
</td> |
504 | 504 |
<td> |
505 | 505 |
<span class="vexpl"><?php echo gettext("Enable PPS signal processing (default: enabled)."); ?></span> |
... | ... | |
507 | 507 |
</tr> |
508 | 508 |
<tr> |
509 | 509 |
<td> |
510 |
<input name="gpsflag2" type="checkbox" class="formcheckbox" id="gpsflag2"<?php if($pconfig['flag2']) echo ' checked'; ?>>
|
|
510 |
<input name="gpsflag2" type="checkbox" class="formcheckbox" id="gpsflag2"<?php if($pconfig['flag2']) echo " checked=\"checked\""; ?> />
|
|
511 | 511 |
</td> |
512 | 512 |
<td> |
513 | 513 |
<span class="vexpl"><?php echo gettext("Enable falling edge PPS signal processing (default: rising edge)."); ?></span> |
... | ... | |
515 | 515 |
</tr> |
516 | 516 |
<tr> |
517 | 517 |
<td> |
518 |
<input name="gpsflag3" type="checkbox" class="formcheckbox" id="gpsflag3"<?php if($pconfig['flag3']) echo ' checked'; ?>>
|
|
518 |
<input name="gpsflag3" type="checkbox" class="formcheckbox" id="gpsflag3"<?php if($pconfig['flag3']) echo " checked=\"checked\""; ?> />
|
|
519 | 519 |
</td> |
520 | 520 |
<td> |
521 | 521 |
<span class="vexpl"><?php echo gettext("Enable kernel PPS clock discipline (default: enabled)."); ?></span> |
... | ... | |
523 | 523 |
</tr> |
524 | 524 |
<tr> |
525 | 525 |
<td> |
526 |
<input name="gpsflag4" type="checkbox" class="formcheckbox" id="gpsflag4"<?php if($pconfig['flag4']) echo ' checked'; ?>>
|
|
526 |
<input name="gpsflag4" type="checkbox" class="formcheckbox" id="gpsflag4"<?php if($pconfig['flag4']) echo " checked=\"checked\""; ?> />
|
|
527 | 527 |
</td> |
528 | 528 |
<td> |
529 | 529 |
<span class="vexpl"><?php echo gettext("Obscure location in timestamp (default: unobscured)."); ?></span> |
... | ... | |
531 | 531 |
</tr> |
532 | 532 |
<tr> |
533 | 533 |
<td> |
534 |
<input name="gpssubsec" type="checkbox" class="formcheckbox" id="gpssubsec"<?php if($pconfig['subsec']) echo ' checked'; ?>>
|
|
534 |
<input name="gpssubsec" type="checkbox" class="formcheckbox" id="gpssubsec"<?php if($pconfig['subsec']) echo " checked=\"checked\""; ?> />
|
|
535 | 535 |
</td> |
536 | 536 |
<td> |
537 | 537 |
<span class="vexpl"><?php echo gettext("Log the sub-second fraction of the received time stamp (default: Not logged).<br />Note: enabling this will rapidly fill the log, but is useful for tuning Fudge time 2."); ?></span> |
... | ... | |
543 | 543 |
<tr> |
544 | 544 |
<td width="22%" valign="top" class="vncellreq">Clock ID</td> |
545 | 545 |
<td width="78%" class="vtable"> |
546 |
<input name="gpsrefid" type="text" class="formfld unknown" id="gpsrefid" maxlength= "4" size="20" value="<?=htmlspecialchars($pconfig['refid']);?>"><?php echo gettext("(1 to 4 charactors)");?><br /> |
|
546 |
<input name="gpsrefid" type="text" class="formfld unknown" id="gpsrefid" maxlength= "4" size="20" value="<?=htmlspecialchars($pconfig['refid']);?>" /><?php echo gettext("(1 to 4 charactors)");?><br />
|
|
547 | 547 |
<?php echo gettext("This may be used to change the GPS Clock ID");?> (<?php echo gettext("default");?>: GPS).</td> |
548 | 548 |
</tr> |
549 | 549 |
<tr> |
550 | 550 |
<td width="22%" valign="top" class="vncellreq">GPS Initialization</td> |
551 | 551 |
<td width="78%" class="vtable"> |
552 | 552 |
<div id="showgpsinitbox"> |
553 |
<input type="button" onClick="show_advanced('showgpsinitbox', 'showgpsinit')" value="<?=gettext("Advanced");?>" /> - <?=gettext("Show GPS Initialization commands");?></a>
|
|
553 |
<input type="button" onclick="show_advanced('showgpsinitbox', 'showgpsinit')" value="<?=gettext("Advanced");?>" /> - <?=gettext("Show GPS Initialization commands");?>
|
|
554 | 554 |
</div> |
555 | 555 |
<div id="showgpsinit" style="display:none"> |
556 | 556 |
<p> |
... | ... | |
558 | 558 |
<?php echo gettext("Note: Commands entered here will be sent to the GPS during initialization. Please read and understand your GPS documentation before making any changes here.");?><br /><br /> |
559 | 559 |
<strong><?php echo gettext("NMEA checksum calculator");?>:</strong> |
560 | 560 |
<br /> |
561 |
<?php echo gettext("Enter the text between "$" and "*" of a NMEA command string:");?><br /> $<input name="nmeastring" type="text" class="formfld unknown" id="nmeastring" size="30" value="">*<span id="nmeachecksum"><?php echo gettext("checksum");?></span>   |
|
562 |
<input type="button" onClick="NMEAChecksum(nmeastring.value)" value="<?=gettext("Calculate NMEA checksum");?>" /><br />
|
|
561 |
<?php echo gettext("Enter the text between "$" and "*" of a NMEA command string:");?><br /> $<input name="nmeastring" type="text" class="formfld unknown" id="nmeastring" size="30" value="" />*<span id="nmeachecksum"><?php echo gettext("checksum");?></span>  
|
|
562 |
<input type="button" onclick="NMEAChecksum(nmeastring.value)" value="<?=gettext("Calculate NMEA checksum");?>" /><br /></p>
|
|
563 | 563 |
</div> |
564 | 564 |
</td> |
565 | 565 |
</tr> |
566 | 566 |
<tr> |
567 | 567 |
<td width="22%" valign="top"> </td> |
568 | 568 |
<td width="78%"> |
569 |
<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>"> |
|
569 |
<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" />
|
|
570 | 570 |
</td> |
571 | 571 |
</tr> |
572 | 572 |
</table> |
... | ... | |
574 | 574 |
</td> |
575 | 575 |
</tr> |
576 | 576 |
</table> |
577 |
<script type="text/javascript"><!-- set_gps_default(this.form); --></script> |
|
577 |
<script type="text/javascript"> |
|
578 |
//<![CDATA[ |
|
579 |
set_gps_default(this.form); |
|
580 |
//]]> |
|
581 |
</script> |
|
578 | 582 |
</form> |
579 | 583 |
<?php include("fend.inc"); ?> |
580 | 584 |
</body> |
Also available in: Unified diff
Tidy up "serviecs_ntp_gps" XHTML
Add "closehead" PHP variable and manually close HEAD
Add CDATA section to SCRIPTS
Add SUMMARY to tables
Update HTML Boolean operators
Close INPUT tags
Remove closing anchor tag from INPUT tags
Change "onclick" to lower case