kopia lustrzana https://github.com/dl9rdz/rdz_ttgo_sonde
lat,lon,alt improvements (#103)
Co-authored-by: Uskompuf <22492406+Uskompuf@users.noreply.github.com> Co-authored-by: dl9rdz <dl9rdz@darc.de>pull/113/head
rodzic
5987c92fab
commit
7555eda024
|
@ -417,13 +417,13 @@ const char *createSondeHubMap() {
|
||||||
HTMLBODY(ptr, "map.html");
|
HTMLBODY(ptr, "map.html");
|
||||||
if (!sonde.config.sondehub.active) {
|
if (!sonde.config.sondehub.active) {
|
||||||
strcat(ptr, "<div>NOTE: SondeHub uploading is not enabled, detected sonde will not be visable on map</div>");
|
strcat(ptr, "<div>NOTE: SondeHub uploading is not enabled, detected sonde will not be visable on map</div>");
|
||||||
if ((*s->ser == 0) && (strcmp(sonde.config.sondehub.lat,"null"))) {
|
if ((*s->ser == 0) && (sonde.config.sondehub.lat[0] != '\0')) {
|
||||||
sprintf(ptr + strlen(ptr), "<iframe src=\"https://sondehub.org/#!mc=%s,%s&mz=8\" style=\"border:1px solid #00A3D3;border-radius:20px;height:95vh\"></iframe>", sonde.config.sondehub.lat, sonde.config.sondehub.lon);
|
sprintf(ptr + strlen(ptr), "<iframe src=\"https://sondehub.org/#!mc=%s,%s&mz=8\" style=\"border:1px solid #00A3D3;border-radius:20px;height:95vh\"></iframe>", sonde.config.sondehub.lat, sonde.config.sondehub.lon);
|
||||||
} else {
|
} else {
|
||||||
sprintf(ptr + strlen(ptr), "<iframe src=\"https://sondehub.org/%s\" style=\"border:1px solid #00A3D3;border-radius:20px;height:95vh\"></iframe>", s-> ser);
|
sprintf(ptr + strlen(ptr), "<iframe src=\"https://sondehub.org/%s\" style=\"border:1px solid #00A3D3;border-radius:20px;height:95vh\"></iframe>", s-> ser);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ((*s->ser == 0) && (strcmp(sonde.config.sondehub.lat,"null"))) {
|
if ((*s->ser == 0) && (sonde.config.sondehub.lat[0] != '\0')) {
|
||||||
sprintf(ptr, "<iframe src=\"https://sondehub.org/#!mc=%s,%s&mz=8\" style=\"border:1px solid #00A3D3;border-radius:20px;height:98vh;width:100%%\"></iframe>", sonde.config.sondehub.lat, sonde.config.sondehub.lon);
|
sprintf(ptr, "<iframe src=\"https://sondehub.org/#!mc=%s,%s&mz=8\" style=\"border:1px solid #00A3D3;border-radius:20px;height:98vh;width:100%%\"></iframe>", sonde.config.sondehub.lat, sonde.config.sondehub.lon);
|
||||||
} else {
|
} else {
|
||||||
sprintf(ptr, "<iframe src=\"https://sondehub.org/%s\" style=\"border:1px solid #00A3D3;border-radius:20px;height:98vh;width:100%%\"></iframe>", s-> ser);
|
sprintf(ptr, "<iframe src=\"https://sondehub.org/%s\" style=\"border:1px solid #00A3D3;border-radius:20px;height:98vh;width:100%%\"></iframe>", s-> ser);
|
||||||
|
@ -3046,12 +3046,20 @@ void sondehub_station_update(WiFiClient *client, struct st_sondehub *conf) {
|
||||||
"\"uploader_contact_email\": \"%s\",",
|
"\"uploader_contact_email\": \"%s\",",
|
||||||
version_name, version_id, conf->callsign, conf->email);
|
version_name, version_id, conf->callsign, conf->email);
|
||||||
w += strlen(w);
|
w += strlen(w);
|
||||||
if (conf->chase == 0) {
|
if ((conf->chase == 0) && (conf->lat[0] != '\0') && (conf->lon[0] != '\0')){
|
||||||
|
if (conf->alt[0] != '\0') {
|
||||||
sprintf(w,
|
sprintf(w,
|
||||||
"\"uploader_position\": [%s,%s,%s],"
|
"\"uploader_position\": [%s,%s,%s],"
|
||||||
"\"uploader_antenna\": \"%s\""
|
"\"uploader_antenna\": \"%s\""
|
||||||
"}",
|
"}",
|
||||||
conf->lat, conf->lon, conf->alt, conf->antenna);
|
conf->lat, conf->lon, conf->alt, conf->antenna);
|
||||||
|
} else {
|
||||||
|
sprintf(w,
|
||||||
|
"\"uploader_position\": [%s,%s,null],"
|
||||||
|
"\"uploader_antenna\": \"%s\""
|
||||||
|
"}",
|
||||||
|
conf->lat, conf->lon, conf->antenna);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (gpsPos.valid && gpsPos.lat != 0 && gpsPos.lon != 0) {
|
else if (gpsPos.valid && gpsPos.lat != 0 && gpsPos.lon != 0) {
|
||||||
sprintf(w,
|
sprintf(w,
|
||||||
|
@ -3235,13 +3243,22 @@ void sondehub_send_data(WiFiClient *client, SondeInfo *s, struct st_sondehub *co
|
||||||
w += strlen(w);
|
w += strlen(w);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (conf->chase == 0) {
|
if ((conf->chase == 0) && (conf->lat[0] != '\0') && (conf->lon[0] != '\0')){
|
||||||
|
if (conf->alt[0] != '\0') {
|
||||||
sprintf(w,
|
sprintf(w,
|
||||||
"\"uploader_position\": [%s,%s,%s],"
|
"\"uploader_position\": [%s,%s,%s],"
|
||||||
"\"uploader_antenna\": \"%s\""
|
"\"uploader_antenna\": \"%s\""
|
||||||
"}]",
|
"}]",
|
||||||
conf->lat, conf->lon, conf->alt, conf->antenna
|
conf->lat, conf->lon, conf->alt, conf->antenna
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
|
sprintf(w,
|
||||||
|
"\"uploader_position\": [%s,%s,null],"
|
||||||
|
"\"uploader_antenna\": \"%s\""
|
||||||
|
"}]",
|
||||||
|
conf->lat, conf->lon, conf->antenna
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (gpsPos.valid && gpsPos.lat != 0 && gpsPos.lon != 0) {
|
else if (gpsPos.valid && gpsPos.lat != 0 && gpsPos.lon != 0) {
|
||||||
sprintf(w,
|
sprintf(w,
|
||||||
|
|
|
@ -126,9 +126,9 @@ sondehub.active=0
|
||||||
sondehub.chase=0
|
sondehub.chase=0
|
||||||
sondehub.host=api.v2.sondehub.org
|
sondehub.host=api.v2.sondehub.org
|
||||||
sondehub.callsign=CHANGEME_RDZTTGO
|
sondehub.callsign=CHANGEME_RDZTTGO
|
||||||
sondehub.lat=null
|
sondehub.lat=
|
||||||
sondehub.lon=null
|
sondehub.lon=
|
||||||
sondehub.alt=null
|
sondehub.alt=
|
||||||
sondehub.antenna=
|
sondehub.antenna=
|
||||||
sondehub.email=
|
sondehub.email=
|
||||||
#-------------------------------#
|
#-------------------------------#
|
||||||
|
|
Ładowanie…
Reference in New Issue