delete cpp files
This commit is contained in:
parent
eedfcbb72a
commit
3412cd97b8
@ -1,5 +0,0 @@
|
||||
.cpp:
|
||||
$(CXX) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(VFLAG) -o $@ $<
|
||||
|
||||
all: i18ndefaultgen i18ndegen i18nfrgen wizardgen checkgen
|
||||
|
@ -1,20 +0,0 @@
|
||||
#include <sstream>
|
||||
#include<string>
|
||||
#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main() {
|
||||
stringstream s;
|
||||
|
||||
s << "if need_table('config_mode', nil, false) and need_table('config_mode.geo_location', nil, false) then" << endl;
|
||||
s << "\tneed_boolean('config_mode.geo_location.show_altitude', false)" << endl;
|
||||
#ifdef WITHMAP
|
||||
s << "\tneed_string('config_mode.geo_location.olurl', false)" << endl;
|
||||
s << "\tneed_number('config_mode.geo_location.map_lon', false)" << endl;
|
||||
s << "\tneed_number('config_mode.geo_location.map_lat', false)" << endl;
|
||||
#endif
|
||||
s << "end" << endl;
|
||||
cout << s.str();
|
||||
return 0;
|
||||
}
|
@ -1,53 +0,0 @@
|
||||
#include <sstream>
|
||||
#include<string>
|
||||
#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main() {
|
||||
stringstream s;
|
||||
|
||||
s << "msgid \"\"" << endl;
|
||||
s << "msgstr \"Content-Type: text/plain; charset=UTF-8\"" << endl << endl;
|
||||
s << "msgid \"\"" << endl;
|
||||
s << "\"If you want the location of your node to be displayed on the map, you can \"" << endl;
|
||||
#ifdef WITHGELOC
|
||||
s << "\"set an automatically localization of your router or \"" << endl;
|
||||
#endif
|
||||
s << "\"enter its coordinates here. \"" << endl;
|
||||
#ifdef WITHMAP
|
||||
s << "\"If your PC is connected to the internet you can also click on the map displayed below. \"" << endl;
|
||||
#endif
|
||||
s << "\"Please keep in mind setting a location can also enhance the network quality.\"" << endl;
|
||||
s << "msgstr \"\"" << endl << endl;
|
||||
s << "msgid \"Geo-Location\"" << endl;
|
||||
s << "msgstr \"\"" << endl << endl;
|
||||
#ifdef WITHGELOC
|
||||
s << "msgid \"Automatic (geolocator)\"" << endl;
|
||||
s << "msgstr \"\"" << endl << endl;
|
||||
#endif
|
||||
s << "msgid \"Static location\"" << endl;
|
||||
s << "msgstr \"\"" << endl << endl;
|
||||
#ifdef WITHGELOC
|
||||
s << "msgid \"Automatic & Static\"" << endl;
|
||||
s << "msgstr \"\"" << endl << endl;
|
||||
#endif
|
||||
s << "msgid \"Disabled\"" << endl;
|
||||
s << "msgstr \"\"" << endl << endl;
|
||||
s << "msgid \"Share your location to see your router on the map\"" << endl;
|
||||
s << "msgstr \"\"" << endl << endl;
|
||||
#ifdef WITHGELOC
|
||||
s << "msgid \"Interval in minutes\"" << endl;
|
||||
s << "msgstr \"\"" << endl << endl;
|
||||
s << "msgid \"Set refresh interval, the default is once per day\"" << endl;
|
||||
s << "msgstr \"\"" << endl << endl;
|
||||
#endif
|
||||
s << "msgid \"Latitude\"" << endl;
|
||||
s << "msgstr \"\"" << endl << endl;
|
||||
s << "msgid \"Longitude\"" << endl;
|
||||
s << "msgstr \"\"" << endl << endl;
|
||||
s << "msgid \"e.g. %s\"" << endl;
|
||||
s << "msgstr \"\"" << endl;
|
||||
cout << s.str();
|
||||
return 0;
|
||||
}
|
@ -1,99 +0,0 @@
|
||||
#include <sstream>
|
||||
#include<string>
|
||||
#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main() {
|
||||
stringstream s;
|
||||
|
||||
s << "msgid \"\"" << endl;
|
||||
s << "msgstr \"\"" << endl;
|
||||
#ifdef WITHMAP
|
||||
#ifdef WITHGELOC
|
||||
s << "\"Project-Id-Version: gluon-config-mode-geo-location-with-geloc-map\\n\"" << endl;
|
||||
#else
|
||||
s << "\"Project-Id-Version: gluon-config-mode-geo-location-with-map\\n\"" << endl;
|
||||
#endif
|
||||
#else
|
||||
#ifdef WITHGELOC
|
||||
s << "\"Project-Id-Version: gluon-config-mode-geo-location-with-geloc\\n\"" << endl;
|
||||
#else
|
||||
s << "\"Project-Id-Version: gluon-config-mode-geo-location\\n\"" << endl;
|
||||
#endif
|
||||
#endif
|
||||
s << "\"PO-Revision-Date: 2017-08-22 12:14+0100\\n\"" << endl;
|
||||
s << "\"Last-Translator: Jan-Tarek Butt <tarek@ring0.de>\\n\"" << endl;
|
||||
s << "\"Language-Team: German\\n\"" << endl;
|
||||
s << "\"Language: de\\n\"" << endl;
|
||||
s << "\"MIME-Version: 1.0\\n\"" << endl;
|
||||
s << "\"Content-Type: text/plain; charset=UTF-8\\n\"" << endl;
|
||||
s << "\"Content-Transfer-Encoding: 8bit\\n\"" << endl;
|
||||
s << "\"Plural-Forms: nplurals=2; plural=(n != 1);\\n\"" << endl << endl;
|
||||
|
||||
s << "msgid \"\"" << endl;
|
||||
s << "\"If you want the location of your node to be displayed on the map, you can \"" << endl;
|
||||
#ifdef WITHGELOC
|
||||
s << "\"set an automatically localization of your router or \"" << endl;
|
||||
#endif
|
||||
s << "\"enter its coordinates here. \"" << endl;
|
||||
#ifdef WITHMAP
|
||||
s << "\"If your PC is connected to the internet you can also click on the map displayed below. \"" << endl;
|
||||
#endif
|
||||
s << "\"Please keep in mind setting a location can also enhance the network quality.\"" << endl;
|
||||
s << "msgstr \"\"" << endl;
|
||||
s << "\"Um Deinen Router auf der Karte anzeigen zu können, benötigen wir seine \"" << endl;
|
||||
s << "\"Koordinaten. Hier hast Du die Möglichkeit, ";
|
||||
#ifdef WITHGELOC
|
||||
s << "das der Router seine Position automatisch \"" << endl;
|
||||
s << "\"bestimmt. Eine andere Option ist, ";
|
||||
#endif
|
||||
s << "die Koordinaten händisch zu hinterlegen.\"" << endl;
|
||||
#ifdef WITHMAP
|
||||
s << "\"Wenn dein Computer mit dem du den Router einrichtes am Internet angeschlossen ist, \"" << endl;
|
||||
s << "\"hast du die Möglichkeit auf der unten angezeigten Karte an die stelle zu klicken wo \"" << endl;
|
||||
s << "\"der Router Stehen wird.\"" << endl;
|
||||
#endif
|
||||
s << "\"Bitte berücksichtige das, das setzen einer Position die Netzwerk Qualität verbessern kann.\"" << endl << endl;
|
||||
|
||||
s << "msgid \"Geo-Location\"" << endl;
|
||||
s << "msgstr \"Geo-Position\"" << endl << endl;
|
||||
|
||||
#ifdef WITHGELOC
|
||||
s << "msgid \"Automatic (geolocator)\"" << endl;
|
||||
s << "msgstr \"Automatisch (geolocator)\"" << endl << endl;
|
||||
#endif
|
||||
|
||||
s << "msgid \"Static location\"" << endl;
|
||||
s << "msgstr \"Manuelle Position\"" << endl << endl;
|
||||
|
||||
#ifdef WITHGELOC
|
||||
s << "msgid \"Automatic & Static\"" << endl;
|
||||
s << "msgstr \"Automatisch & Manuell\"" << endl << endl;
|
||||
#endif
|
||||
|
||||
s << "msgid \"Disabled\"" << endl;
|
||||
s << "msgstr \"Deaktiviert\"" << endl << endl;
|
||||
|
||||
s << "msgid \"Share your location to see your router on the map\"" << endl;
|
||||
s << "msgstr \"Position für die Karte freigeben\"" << endl << endl;
|
||||
|
||||
#ifdef WITHGELOC
|
||||
s << "msgid \"Interval in minutes\"" << endl;
|
||||
s << "msgstr \"Intervall in Minuten\"" << endl << endl;
|
||||
s << "msgid \"Set refresh interval, the default is once per day\"" << endl;
|
||||
s << "msgstr \"Setze aktuallisierungs Intervall, der Standard Intervall ist einmal pro Tag\"" << endl << endl;
|
||||
#endif
|
||||
|
||||
s << "msgid \"Latitude\"" << endl;
|
||||
s << "msgstr \"Breitengrad\"" << endl << endl;
|
||||
|
||||
s << "msgid \"Longitude\"" << endl;
|
||||
s << "msgstr \"Längengrad\"" << endl << endl;
|
||||
|
||||
s << "msgid \"e.g. %s\"" << endl;
|
||||
s << "msgstr \"z.B. %s\"" << endl;
|
||||
|
||||
cout << s.str();
|
||||
return 0;
|
||||
}
|
@ -1,83 +0,0 @@
|
||||
#include <sstream>
|
||||
#include<string>
|
||||
#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main() {
|
||||
stringstream s;
|
||||
|
||||
s << "msgid \"\"" << endl;
|
||||
s << "msgstr \"\"" << endl;
|
||||
s << "\"Project-Id-Version: PACKAGE VERSION\\n\"" << endl;
|
||||
s << "\"PO-Revision-Date: 2017-08-22 12:14+0100\\n\"" << endl;
|
||||
s << "\"Last-Translator: Jan-Tarek Butt <tarek@ring0.de>\\n\"" << endl;
|
||||
s << "\"Language-Team: French\\n\"" << endl;
|
||||
s << "\"Language: fr\\n\"" << endl;
|
||||
s << "\"MIME-Version: 1.0\\n\"" << endl;
|
||||
s << "\"Content-Type: text/plain; charset=UTF-8\\n\"" << endl;
|
||||
s << "\"Content-Transfer-Encoding: 8bit\\n\"" << endl;
|
||||
s << "\"Plural-Forms: nplurals=2; plural=(n != 1);\\n\"" << endl << endl;
|
||||
|
||||
s << "msgid \"\"" << endl;
|
||||
s << "\"If you want the location of your node to be displayed on the map, you can \"" << endl;
|
||||
#ifdef WITHGELOC
|
||||
s << "\"set an automatically localization of your router or \"" << endl;
|
||||
#endif
|
||||
s << "\"enter its coordinates here. \"" << endl;
|
||||
#ifdef WITHMAP
|
||||
s << "\"If your PC is connected to the internet you can also click on the map displayed below. \"" << endl;
|
||||
#endif
|
||||
s << "\"Please keep in mind setting a location can also enhance the network quality.\"" << endl;
|
||||
s << "msgstr \"\"" << endl;
|
||||
s << "\"Si vous souhaitez que l'emplacement de votre nœud soit affiché sur la carte, vous pouvez \"" << endl;
|
||||
#ifdef WITHGELOC
|
||||
s << "\"définir une localisation automatique de votre routeur ou \"" << endl;
|
||||
#endif
|
||||
s << "entrer ses coordonnées ici.\"" << endl;
|
||||
#ifdef WITHMAP
|
||||
s << "\"Si votre PC est connecté à Internet, vous pouvez également cliquer sur la carte ci-dessous.\"" << endl;
|
||||
#endif
|
||||
s << "\"Gardez à l'esprit que la définition d'un emplacement peut également améliorer la qualité du réseau.\"" << endl << endl;
|
||||
|
||||
s << "msgid \"Geo-Location\"" << endl;
|
||||
s << "msgstr \"Géolocalisation\"" << endl << endl;
|
||||
|
||||
#ifdef WITHGELOC
|
||||
s << "msgid \"Automatic (geolocator)\"" << endl;
|
||||
s << "msgstr \"Automatique (geolocator)\"" << endl << endl;
|
||||
#endif
|
||||
|
||||
s << "msgid \"Static location\"" << endl;
|
||||
s << "msgstr \"position manuelle\"" << endl << endl;
|
||||
|
||||
#ifdef WITHGELOC
|
||||
s << "msgid \"Automatic & Static\"" << endl;
|
||||
s << "msgstr \"Automatique et manuel\"" << endl << endl;
|
||||
#endif
|
||||
|
||||
s << "msgid \"Disabled\"" << endl;
|
||||
s << "msgstr \"Désactivé\"" << endl << endl;
|
||||
|
||||
s << "msgid \"Share your location to see your router on the map\"" << endl;
|
||||
s << "msgstr \"Partagez votre emplacement pour voir votre routeur sur la carte\"" << endl << endl;
|
||||
|
||||
#ifdef WITHGELOC
|
||||
s << "msgid \"Interval in minutes\"" << endl;
|
||||
s << "msgstr \"Intervalle en minutes\"" << endl << endl;
|
||||
s << "msgid \"Set refresh interval, the default is once per day\"" << endl;
|
||||
s << "msgstr \"Définir l'intervalle de rafraîchissement, la valeur par défaut est une fois par jour\"" << endl << endl;
|
||||
#endif
|
||||
|
||||
s << "msgid \"Latitude\"" << endl;
|
||||
s << "msgstr \"Latitude\"" << endl << endl;
|
||||
|
||||
s << "msgid \"Longitude\"" << endl;
|
||||
s << "msgstr \"Longitude\"" << endl << endl;
|
||||
|
||||
s << "msgid \"e.g. %s\"" << endl;
|
||||
s << "msgstr \"Ex: %s\"" << endl;
|
||||
|
||||
cout << s.str();
|
||||
return 0;
|
||||
}
|
@ -1,223 +0,0 @@
|
||||
#include <sstream>
|
||||
#include<string>
|
||||
#include <iostream>
|
||||
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main() {
|
||||
stringstream s;
|
||||
|
||||
s << "return function(form, uci)" << endl;
|
||||
s << "\tlocal site = require 'gluon.site'" << endl;
|
||||
s << "" << endl;
|
||||
s << "\tlocal location = uci:get_first(\"gluon-node-info\", \"location\")" << endl;
|
||||
s << "" << endl;
|
||||
#ifdef WITHMAP
|
||||
s << "\tlocal function show_lon()" << endl;
|
||||
s << "\t\tif site.config_mode.geo_location.map_lon(true) then" << endl;
|
||||
s << "\t\t\treturn site.config_mode.geo_location.map_lon" << endl;
|
||||
s << "\t\tend" << endl;
|
||||
s << "\t\treturn 0.0 -- check ob pos reboot fest" << endl;
|
||||
s << "\tend" << endl;
|
||||
s << "" << endl;
|
||||
s << "\tlocal function show_lat()" << endl;
|
||||
s << "\t\tif site.config_mode.geo_location.map_lat(true) then" << endl;
|
||||
s << "\t\t\treturn site.config_mode.geo_location.map_lat" << endl;
|
||||
s << "\t\tend" << endl;
|
||||
s << "\t\treturn 0.0 -- check ob pos reboot fest" << endl;
|
||||
s << "\tend" << endl;
|
||||
s << "" << endl;
|
||||
#endif
|
||||
s << "\tlocal function show_altitude()" << endl;
|
||||
s << "\t\tif site.config_mode.geo_location.show_altitude(true) then" << endl;
|
||||
s << "\t\t\treturn true" << endl;
|
||||
s << "\t\tend" << endl;
|
||||
s << "\t\treturn uci:get_bool(\"gluon-node-info\", location, \"altitude\")" << endl;
|
||||
s << "\tend" << endl;
|
||||
s << "" << endl;
|
||||
#ifdef WITHMAP
|
||||
s << "\tlocal function show_olurl()" << endl;
|
||||
s << "\t\tif site.config_mode.geo_location.olurl(true) then" << endl;
|
||||
s << "\t\t\treturn site.config_mode.geo_location.olurl" << endl;
|
||||
s << "\t\tend" << endl;
|
||||
s << "\t\treturn 'http://dev.openlayers.org/OpenLayers.js'" << endl;
|
||||
s << "\tend" << endl;
|
||||
s << "" << endl;
|
||||
#endif
|
||||
s << "\tlocal text = translate(" << endl;
|
||||
s << "\t\t'If you want the location of your node to be displayed on the map, you can ' .." << endl;
|
||||
#ifdef WITHGELOC
|
||||
s << "\t\t'set an automatically localization of your router or ' .." << endl;
|
||||
#endif
|
||||
s << "\t\t'enter its coordinates here. ' .." << endl;
|
||||
#ifdef WITHMAP
|
||||
s << "\t\t'If your PC is connected to the internet you can also click on the map displayed below. ' .." << endl;
|
||||
#endif
|
||||
s << "\t\t'Please keep in mind setting a location can also enhance the network quality.'" << endl;
|
||||
s << "\t)" << endl;
|
||||
s << "\tif show_altitude() then" << endl;
|
||||
s << "\t\ttext = text .. ' ' .. translate(\"gluon-config-mode:altitude-help\")" << endl;
|
||||
s << "\tend" << endl;
|
||||
s << "" << endl;
|
||||
#ifdef WITHMAP
|
||||
s << "\ttext = text .. [[" << endl;
|
||||
s << "\t\t<div id=\"locationPickerMap\" style=\"width:100%; height:300px; display: none;\"></div>" << endl;
|
||||
s << "\t\t<script src=\"]] .. show_olurl() .. [[\"></script>" << endl;
|
||||
s << "\t\t<script src=\"/static/gluon/osm.js\"></script>" << endl;
|
||||
s << "\t\t<script>" << endl;
|
||||
s << "\t\t\tvar latitude=]] .. show_lon() .. \",longitude=\" .. show_lat() .. [[;" << endl;
|
||||
s << "\t\t\tdocument.addEventListener(\"DOMContentLoaded\", showMap, false);" << endl;
|
||||
s << "\t\t\tsetInterval(function() {" << endl;
|
||||
s << "\t\t\t\tif(false !== findObj(\"longitude\")) {" << endl;
|
||||
s << "\t\t\t\t\tdocument.getElementById(\"locationPickerMap\").style.display=\"block\";" << endl;
|
||||
s << "\t\t\t\t}else{" << endl;
|
||||
s << "\t\t\t\t\tdocument.getElementById(\"locationPickerMap\").style.display=\"none\";" << endl;
|
||||
s << "\t\t\t\t}" << endl;
|
||||
s << "\t\t\t}, 1000);" << endl;
|
||||
s << "\t\t</script>" << endl;
|
||||
s << "\t]]" << endl;
|
||||
s << "" << endl;
|
||||
#endif
|
||||
s << "\tlocal s = form:section(Section, nil, text)" << endl;
|
||||
s << "" << endl;
|
||||
s << "" << endl;
|
||||
s << "\tlocal geolocation = s:option(ListValue, \"geolocation\", translate(\"Geo-Location\"))" << endl;
|
||||
#ifdef WITHGELOC
|
||||
s << "\tgeolocation:value(\"automatic\", translate(\"Automatic (geolocator)\"))" << endl;
|
||||
#endif
|
||||
s << "\tgeolocation:value(\"static\", translate(\"Static location\"))" << endl;
|
||||
#ifdef WITHGELOC
|
||||
s << "\tgeolocation:value(\"auto_static\", translate(\"Automatic & Static\"))" << endl;
|
||||
#endif
|
||||
s << "\tgeolocation:value(\"none\", translate(\"Disabled\"))" << endl;
|
||||
#ifdef WITHGELOC
|
||||
s << "\tlocal auto_location = uci:get_bool(\"geolocator\", \"stettings\", \"auto_location\")" << endl;
|
||||
s << "\tlocal static_location = uci:get_bool(\"geolocator\", \"stettings\", \"static_location\")" << endl;
|
||||
s << "\tif auto_location == false and static_location == true then" << endl;
|
||||
#else
|
||||
s << "\tlocal lat = uci:get(\"geolocator\", \"stettings\", \"latitude\")" << endl;
|
||||
s << "\tlocal lon = uci:get(\"geolocator\", \"stettings\", \"longitude\")" << endl;
|
||||
s << "\tif lat ~= nil and lon ~= nil then" << endl;
|
||||
#endif
|
||||
s << "\t\tgeolocation.default = \"static\"" << endl;
|
||||
#ifndef WITHGELOC
|
||||
s << "\telse" << endl;
|
||||
s << "\t\tgeolocation.default = \"none\"" << endl;
|
||||
#endif
|
||||
s << "\tend" << endl;
|
||||
#ifdef WITHGELOC
|
||||
s << "\tif auto_location == true and static_location == true then" << endl;
|
||||
s << "\t\tgeolocation.default = \"auto_static\"" << endl;
|
||||
s << "\tend" << endl;
|
||||
s << "\tif auto_location == false and static_location == false then" << endl;
|
||||
s << "\t\tgeolocation.default = \"none\"" << endl;
|
||||
s << "\tend" << endl;
|
||||
#endif
|
||||
s << "" << endl;
|
||||
s << "\tlocal share_location = s:option(Flag, \"sharelocation\", translate(\"Share your location to see your router on the map\"))" << endl;
|
||||
s << "\tshare_location.default = uci:get_bool(\"gluon-node-info\", location, \"share_location\")" << endl;
|
||||
#ifdef WITHGELOC
|
||||
s << "\tshare_location:depends(geolocation, \"automatic\")" << endl;
|
||||
#endif
|
||||
s << "\tshare_location:depends(geolocation, \"static\")" << endl;
|
||||
#ifdef WITHGELOC
|
||||
s << "\tshare_location:depends(geolocation, \"auto_static\")" << endl;
|
||||
#endif
|
||||
s << "" << endl;
|
||||
#ifdef WITHGELOC
|
||||
s << "\t--[[ -- Aktuell nicht verfügbar" << endl;
|
||||
s << "\to = s:option(DummyValue, \"automatic_disc\", \" \", translatef(\"Automaticaly location service over wifi.\"))" << endl;
|
||||
s << "\to:depends(geolocation, \"automatic\")" << endl;
|
||||
s << "\to.description = translatef(\"Automaticaly location service over wifi.\")" << endl;
|
||||
s << "\t--]]" << endl;
|
||||
s << "" << endl;
|
||||
s << "\tlocal interval = s:option(Value, \"interval\", translate(\"Interval in minutes\"), translatef(\"Set refresh interval, the default is once per day\"))" << endl;
|
||||
s << "\tinterval.default = uci:get_first(\"geolocator\", \"stettings\", \"refresh_interval\")" << endl;
|
||||
s << "\tinterval:depends(geolocation, \"automatic\")" << endl;
|
||||
s << "\tinterval:depends(geolocation, \"auto_static\")" << endl;
|
||||
s << "\tinterval.datatype = \"uinteger\"" << endl;
|
||||
s << "" << endl;
|
||||
#endif
|
||||
s << "\tlocal latitude = s:option(Value, \"latitude\", translate(\"Latitude\"), translatef(\"e.g. %s\", \"50.364931\"))" << endl;
|
||||
s << "\tlatitude.default = uci:get(\"gluon-node-info\", location, \"latitude\")" << endl;
|
||||
s << "\tlatitude:depends(geolocation, \"static\")" << endl;
|
||||
#ifdef WITHGELOC
|
||||
s << "\tlatitude:depends(geolocation, \"auto_static\")" << endl;
|
||||
#endif
|
||||
s << "\tlatitude.datatype = \"float\"" << endl;
|
||||
s << "" << endl;
|
||||
s << "\tlocal longitude = s:option(Value, \"longitude\", translate(\"Longitude\"), translatef(\"e.g. %s\", \"7.606417\"))" << endl;
|
||||
s << "\tlongitude.default = uci:get(\"gluon-node-info\", location, \"longitude\")" << endl;
|
||||
s << "\tlongitude:depends(geolocation, \"static\")" << endl;
|
||||
#ifdef WITHGELOC
|
||||
s << "\tlongitude:depends(geolocation, \"auto_static\")" << endl;
|
||||
#endif
|
||||
s << "\tlongitude.datatype = \"float\"" << endl;
|
||||
s << "" << endl;
|
||||
s << "\tlocal altitude;" << endl;
|
||||
s << "\tif show_altitude() then" << endl;
|
||||
s << "\t\taltitude = s:option(Value, \"altitude\", translate(\"gluon-config-mode:altitude-label\"), translatef(\"e.g. %s\", \"11.51\"))" << endl;
|
||||
s << "\t\taltitude.default = uci:get(\"gluon-node-info\", location, \"altitude\")" << endl;
|
||||
s << "\t\taltitude:depends(geolocation, \"static\")" << endl;
|
||||
#ifdef WITHGELOC
|
||||
s << "\t\taltitude:depends(geolocation, \"auto_static\")" << endl;
|
||||
#endif
|
||||
s << "\t\taltitude.datatype = \"float\"" << endl;
|
||||
s << "\t\taltitude.optional = true" << endl;
|
||||
s << "\tend" << endl;
|
||||
s << "\tfunction geolocation:write(data)" << endl;
|
||||
#ifdef WITHGELOC
|
||||
s << "\t\tif data == \"automatic\" or data == \"auto_static\" then" << endl;
|
||||
s << "\t\t\tuci:set(\"geolocator\", \"stettings\", \"auto_location\", 1)" << endl;
|
||||
s << "\t\t\tif interval.data ~= nil and tonumber(interval.data) >= 1 and tonumber(interval.data) <= 43200 then" << endl;
|
||||
s << "\t\t\t\tuci:set(\"geolocator\", \"stettings\", \"refresh_interval\", interval.data)" << endl;
|
||||
s << "\t\t\telseif tonumber(interval.data) > 43200 then" << endl;
|
||||
s << "\t\t\t\tuci:set(\"geolocator\", \"stettings\", \"refresh_interval\", 43200)" << endl;
|
||||
s << "\t\t\tend" << endl;
|
||||
s << "\t\telse" << endl;
|
||||
s << "\t\t\tuci:set(\"geolocator\", \"stettings\", \"auto_location\", 0)" << endl;
|
||||
s << "\t\tend" << endl;
|
||||
s << "\t\tif data == \"static\" or data == \"auto_static\" then" << endl;
|
||||
s << "\t\t\tuci:set(\"geolocator\", \"stettings\", \"static_location\", 1)" << endl;
|
||||
#else
|
||||
s << "\t\tif data == \"static\" then" << endl;
|
||||
#endif
|
||||
s << "\t\t\tuci:set(\"gluon-node-info\", location, \"latitude\", latitude.data)" << endl;
|
||||
s << "\t\t\tuci:set(\"gluon-node-info\", location, \"longitude\", longitude.data)" << endl;
|
||||
s << "\t\t\tif show_altitude() then" << endl;
|
||||
s << "\t\t\t\tif altitude.data then" << endl;
|
||||
s << "\t\t\t\t\tuci:set(\"gluon-node-info\", location, \"altitude\", altitude.data)" << endl;
|
||||
s << "\t\t\t\telse" << endl;
|
||||
s << "\t\t\t\t\tuci:delete(\"gluon-node-info\", location, \"altitude\")" << endl;
|
||||
s << "\t\t\t\tend" << endl;
|
||||
s << "\t\t\tend" << endl;
|
||||
#ifdef WITHGELOC
|
||||
s << "\t\telse" << endl;
|
||||
s << "\t\t\tuci:set(\"geolocator\", \"stettings\", \"static_location\", 0)" << endl;
|
||||
#endif
|
||||
s << "\t\tend" << endl;
|
||||
s << "\t\tif data == \"none\" then" << endl;
|
||||
s << "\t\t\tuci:delete(\"gluon-node-info\", location, \"altitude\")" << endl;
|
||||
s << "\t\t\tuci:delete(\"gluon-node-info\", location, \"latitude\")" << endl;
|
||||
s << "\t\t\tuci:delete(\"gluon-node-info\", location, \"longitude\")" << endl;
|
||||
s << "\t\t\tuci:set(\"gluon-node-info\", location, \"share_location\", 0)" << endl;
|
||||
#ifdef WITHGELOC
|
||||
s << "\t\t\tuci:set(\"geolocator\", \"stettings\", \"auto_location\", 0)" << endl;
|
||||
#endif
|
||||
s << "\t\telse" << endl;
|
||||
s << "\t\t\tuci:set(\"gluon-node-info\", location, \"share_location\", share_location.data)" << endl;
|
||||
s << "\t\tend" << endl;
|
||||
s << "\tend" << endl;
|
||||
s << "" << endl;
|
||||
s << "\treturn {'gluon-node-info'";
|
||||
#ifdef WITHGELOC
|
||||
s << ", 'geolocator'}" << endl;
|
||||
#else
|
||||
s << "}" << endl;
|
||||
#endif
|
||||
s << "end" << endl;
|
||||
|
||||
cout << s.str();
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user