Added detailed station info.

This commit is contained in:
Kasper D. Fischer 2014-05-23 16:27:59 +00:00
parent 85eb830ef1
commit f467b77f48
Notes: subgit 2018-03-07 17:58:59 +01:00
r671 www/trunk

View File

@ -40,7 +40,7 @@ function loadStations(stime, etime) {
var request_data = {
endafter: sprintf("%d-%02d-%02d", stime.getFullYear(), stime.getMonth()+1, stime.getDate()),
startbefore: sprintf("%d-%02d-%02d", etime.getFullYear(), etime.getMonth()+1, etime.getDate()),
level: 'station',
level: 'channel',
minlat: S-config['map']['latlngDelta'],
maxlat: N+config['map']['latlngDelta'],
minlon: W-config['map']['latlngDelta'],
@ -57,8 +57,8 @@ function loadStations(stime, etime) {
if ( $.inArray(network, config['station']['networkBlacklist'])<0 ) {
$(this).find('Station').each(function () {
var station = $(this).attr('code'),
lat = $(this).find('Latitude').text(),
lng = $(this).find('Longitude').text(),
lat = $(this).find('Latitude:first').text(),
lng = $(this).find('Longitude:first').text(),
stationID = network+'_'+station,
stationText = network+'.'+station;
if ( !stationTable[stationID] ) {
@ -69,7 +69,9 @@ function loadStations(stime, etime) {
row += ( $.inArray(station, bochumStation)+1 ) ? '</br><em>Betreiber:</em> Ruhr-Universität Bochum</td></tr>' : '</td></tr>' ;
if ( network == 'RN' || network == 'X5' || $.inArray(station, bochumStation)+1 ) {
// setting up station details (3rd line)
row += '<tr class="tablesorter-childRow station-details"><td colspan="4">not implemented</td></tr>';
row += '<tr class="tablesorter-childRow station-details"><td colspan="4">';
row += stationDetails(station, network, lat, lng, stationID, stationText, $(this));
row += '</td></tr>';
// setting up download links (4th line)
var URL, fdsnxmlURL, fdsnxmlRespURL, sc3mlURL, sc3mlRespURL, dlsvURL;
URL = sprintf('%s?network=%s&station=%s', config['ajax']['stationURL'], network, station);
@ -116,6 +118,24 @@ function loadStations(stime, etime) {
$('#stations-csv-link').attr('href', config['ajax']['stationURL']+'?'+$.param(request_data));
};
/* format station Details */
function stationDetails(station, network, lat, lng, stationId, stationText, stationObject) {
var output;
var elevation = stationObject.find('Elevation:first').text();
var name = stationObject.find('Site > Name').text();
output = '<pre>'
+ name + '</br>'
+ 'Position: ' + lat + '°N ' + lng + '°E, Höhe: ' + elevation + ' m NN</br>';
stationObject.find('Channel').each(function() {
var code = $(this).attr('code');
var sensor = $(this).find('Sensor > Type').text().split(',')[0];
var sampleRate = $(this).find('SampleRate').text();
output += '</br>Kanal ' + code + ', Abtastrate ' + sampleRate + ' Hz, Sensor ' + sensor;
});
output += '</pre>';
return output;
};
/* initStationTable */
function initStationTable() {
// tablesorter for station list