diff --git a/ffnw-config-mode-geo-location/Makefile b/ffnw-config-mode-geo-location/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..28d347643e54bb9a3fc94e8d340b3a3043c0bd50 --- /dev/null +++ b/ffnw-config-mode-geo-location/Makefile @@ -0,0 +1,36 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=gluon-config-mode-geo-location +PKG_VERSION:=1 + +PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) + +include $(GLUONDIR)/include/package.mk + +PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG) + + +define Package/gluon-config-mode-geo-location + SECTION:=gluon + CATEGORY:=Gluon + TITLE:=Set geographic location of a node + DEPENDS:=gluon-config-mode-core-virtual +gluon-node-info +endef + +define Build/Prepare + mkdir -p $(PKG_BUILD_DIR) +endef + +define Build/Configure +endef + +define Build/Compile + $(call GluonBuildI18N,gluon-config-mode-geo-location,i18n) +endef + +define Package/gluon-config-mode-geo-location/install + $(CP) ./files/* $(1)/ + $(call GluonInstallI18N,gluon-config-mode-geo-location,$(1)) +endef + +$(eval $(call BuildPackage,gluon-config-mode-geo-location)) diff --git a/ffnw-config-mode-geo-location/files/lib/gluon/config-mode/wizard/0400-geo-location.lua b/ffnw-config-mode-geo-location/files/lib/gluon/config-mode/wizard/0400-geo-location.lua new file mode 100644 index 0000000000000000000000000000000000000000..48e5132d1b47b88e5318171e0d2d240ec2e9ce57 --- /dev/null +++ b/ffnw-config-mode-geo-location/files/lib/gluon/config-mode/wizard/0400-geo-location.lua @@ -0,0 +1,85 @@ +local cbi = require "luci.cbi" +local i18n = require "luci.i18n" +local uci = luci.model.uci.cursor() + +local M = {} + +function M.section(form) + local s = form:section(cbi.SimpleSection, nil, i18n.translate( + 'If you want the location of your node to be displayed on the map, ' + .. 'you can sed a automatically localization of your router or enter its coordinates here. Specifying the altitude ' + .. 'is optional and should only be done if a proper value is known.')) + + local o + + o = s:option(cbi.Flag, "_auto_location", i18n.translate("Show node on the map via automatic localization")) + o.default = uci:get_first("gluon-node-info", "location", "share_location", o.disabled) + o.rmempty = true + + o = s:option(cbi.Value, "_interval", i18n.translate("Interval in minutes")) + o.value = uci:get_first("gluon-node-info", "location", "refresh_interval") + o:depends("_auto_location", "1") + o.rmempty = false + o.datatype = "integer" + o.description = i18n.translatef("sed refresh interval the default is ons a day") + + o = s:option(cbi.Flag, "_static_location", i18n.translate("Set location manualy")) + o.default = uci:get_first("gluon-node-info", "location", "static_location", o.disabled) + o:depends("_auto_location", "1") + o.rmempty = true + o.description = i18n.translatef("the wifi locator will be still running in the backround but not overwriting the location") + + o = s:option(cbi.Value, "_latitude", i18n.translate("Latitude")) + o.default = uci:get_first("gluon-node-info", "location", "latitude") + o:depends("_static_location", "1") + o.rmempty = false + o.datatype = "float" + o.description = i18n.translatef("e.g. %s", "53.873621") + + o = s:option(cbi.Value, "_longitude", i18n.translate("Longitude")) + o.default = uci:get_first("gluon-node-info", "location", "longitude") + o:depends("_static_location", "1") + o.rmempty = false + o.datatype = "float" + o.description = i18n.translatef("e.g. %s", "10.689901") + + o = s:option(cbi.Value, "_altitude", i18n.translate("Altitude")) + o.default = uci:get_first("gluon-node-info", "location", "altitude") + o:depends("_static_location", "1") + o.rmempty = true + o.datatype = "float" + o.description = i18n.translatef("e.g. %s", "11.51") + +end + +function M.handle(data) + local sname = uci:get_first("gluon-node-info", "location") +-- _auto_location +-- _interval +-- _static_location +-- _latitude +-- _longitude +-- _altitude + +-- uci:set("gluon-node-info", sname, "share_location", data._auto_location) +-- uci:set("gluon-node-info", sname, "static_location", data._static_location) + if data._auto_location then + if data._interval ~= nil and data._interval >= 2 and data._interval <= 43200 then + uci:set("gluon-node-info", sname, "refresh_interval", data._interval) + end + if data._static_location and data._latitude ~= nil and data._longitude ~= nil then + uci:set("gluon-node-info", sname, "static_location", data._static_location) + uci:set("gluon-node-info", sname, "latitude", data._latitude) + uci:set("gluon-node-info", sname, "longitude", data._longitude) + if data._altitude ~= nil then + uci:set("gluon-node-info", sname, "altitude", data._altitude) + else + uci:delete("gluon-node-info", sname, "altitude") + end + end + end + uci:save("gluon-node-info") + uci:commit("gluon-node-info") +end + +return M diff --git a/ffnw-config-mode-geo-location/i18n/de.po b/ffnw-config-mode-geo-location/i18n/de.po new file mode 100644 index 0000000000000000000000000000000000000000..e83443dd0b5299549f1a557bcc0138120858a9d7 --- /dev/null +++ b/ffnw-config-mode-geo-location/i18n/de.po @@ -0,0 +1,36 @@ +msgid "" +msgstr "" +"Project-Id-Version: gluon-config-mode-geo-location\n" +"PO-Revision-Date: 2015-03-23 02:18+0100\n" +"Last-Translator: Martin Weinelt <martin@darmstadt.freifunk.net>\n" +"Language-Team: German\n" +"Language: de\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +msgid "" +"If you want the location of your node to be displayed on the map, you can " +"enter its coordinates here. Specifying the altitude is optional and should " +"only be done if a proper value is known." +msgstr "" +"Um deinen Knoten auf der Karte anzeigen zu können, benötigen wir seine " +"Koordinaten. Hier hast du die Möglichkeit, diese zu hinterlegen. Die " +"Höhenangabe ist optional und sollte nur gesetzt werden, wenn ein exakter " +"Wert bekannt ist." + +msgid "Latitude" +msgstr "Breitengrad" + +msgid "Longitude" +msgstr "Längengrad" + +msgid "Altitude" +msgstr "Höhenmeter über Normalnull" + +msgid "Show node on the map" +msgstr "Knoten auf der Karte anzeigen" + +msgid "e.g. %s" +msgstr "z.B. %s" diff --git a/ffnw-config-mode-geo-location/i18n/gluon-config-mode-geo-location.pot b/ffnw-config-mode-geo-location/i18n/gluon-config-mode-geo-location.pot new file mode 100644 index 0000000000000000000000000000000000000000..a2be4fdf776708f28064bc8bf450ffb6a7c5b6d0 --- /dev/null +++ b/ffnw-config-mode-geo-location/i18n/gluon-config-mode-geo-location.pot @@ -0,0 +1,23 @@ +msgid "" +msgstr "Content-Type: text/plain; charset=UTF-8" + +msgid "" +"If you want the location of your node to be displayed on the map, you can " +"enter its coordinates here. Specifying the altitude is optional and should " +"only be done if a proper value is known." +msgstr "" + +msgid "Latitude" +msgstr "" + +msgid "Longitude" +msgstr "" + +msgid "Altitude" +msgstr "" + +msgid "Show node on the map" +msgstr "" + +msgid "e.g. %s" +msgstr "" diff --git a/ffnw-geolocator/Makefile b/ffnw-node-info/Makefile similarity index 100% rename from ffnw-geolocator/Makefile rename to ffnw-node-info/Makefile diff --git a/ffnw-geolocator/check_site.lua b/ffnw-node-info/check_site.lua similarity index 100% rename from ffnw-geolocator/check_site.lua rename to ffnw-node-info/check_site.lua diff --git a/ffnw-node-info/documents/Orthodrome.sm b/ffnw-node-info/documents/Orthodrome.sm new file mode 100644 index 0000000000000000000000000000000000000000..2ec3a8b236906e8b58f25a6118801955dad88c94 --- /dev/null +++ b/ffnw-node-info/documents/Orthodrome.sm @@ -0,0 +1,525 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<?application progid="SMath Studio Desktop" version="0.97.5346.24640"?> +<regions> + <settings> + <identity> + <id>e666cd61-e657-482b-b3a5-e1531436d4d3</id> + <revision>4</revision> + </identity> + <calculation> + <precision>4</precision> + <exponentialThreshold>5</exponentialThreshold> + <fractions>decimal</fractions> + </calculation> + <pageModel active="true" printAreas="true" simpleEqualsOnly="false" printBackgroundImages="true"> + <paper id="1" orientation="Portrait" width="850" height="1100" /> + <margins left="39" right="39" top="39" bottom="39" /> + <header alignment="Center" color="#a9a9a9">&[DATE] &[TIME] - &[FILENAME]</header> + <footer alignment="Center" color="#a9a9a9">&[PAGENUM] / &[COUNT]</footer> + <backgrounds /> + </pageModel> + <dependences> + <assembly name="SMath Studio Desktop" version="0.97.5346.24640" guid="a37cba83-b69c-4c71-9992-55ff666763bd" /> + <assembly name="Text Region" version="1.10.5346.31409" guid="485d28c5-349a-48b6-93be-12a35a1c1e39" /> + <assembly name="Math Region" version="0.97.5346.24640" guid="02f1ab51-215b-466e-a74d-5d8b1cf85e8d" /> + </dependences> + </settings> + <region id="0" left="72" top="9" width="464" height="23" color="#000000" bgColor="#ffff00" fontSize="10"> + <text lang="eng"> + <p>Einfache berechnung der strecke zwischen zwei koordinaten</p> + </text> + </region> + <region id="1" left="63" top="54" width="80" height="23" color="#000000" bgColor="#ffffff" fontSize="10"> + <math> + <input> + <e type="operand">Latditude</e> + </input> + </math> + </region> + <region id="2" left="153" top="54" width="101" height="23" color="#000000" bgColor="#ffffff" fontSize="10"> + <math> + <input> + <e type="operand">Φa</e> + <e type="operand">52.5167</e> + <e type="operand" style="unit">°</e> + <e type="operator" args="2">*</e> + <e type="operator" args="2">:</e> + </input> + </math> + </region> + <region id="3" left="324" top="54" width="80" height="23" color="#000000" bgColor="#ffffff" fontSize="10"> + <math> + <input> + <e type="operand">Latditude</e> + </input> + </math> + </region> + <region id="4" left="414" top="54" width="101" height="23" color="#000000" bgColor="#ffffff" fontSize="10"> + <math> + <input> + <e type="operand">Φb</e> + <e type="operand">35.7000</e> + <e type="operand" style="unit">°</e> + <e type="operator" args="2">*</e> + <e type="operator" args="2">:</e> + </input> + </math> + </region> + <region id="5" left="63" top="72" width="88" height="23" color="#000000" bgColor="#ffffff" fontSize="10"> + <math> + <input> + <e type="operand">Longditude</e> + </input> + </math> + </region> + <region id="6" left="153" top="72" width="101" height="23" color="#000000" bgColor="#ffffff" fontSize="10"> + <math> + <input> + <e type="operand">λa</e> + <e type="operand">13.4000</e> + <e type="operand" style="unit">°</e> + <e type="operator" args="2">*</e> + <e type="operator" args="2">:</e> + </input> + </math> + </region> + <region id="7" left="324" top="72" width="88" height="23" color="#000000" bgColor="#ffffff" fontSize="10"> + <math> + <input> + <e type="operand">Longditude</e> + </input> + </math> + </region> + <region id="8" left="414" top="72" width="109" height="23" color="#000000" bgColor="#ffffff" fontSize="10"> + <math> + <input> + <e type="operand">λb</e> + <e type="operand">139.7667</e> + <e type="operand" style="unit">°</e> + <e type="operator" args="2">*</e> + <e type="operator" args="2">:</e> + </input> + </math> + </region> + <region id="9" left="72" top="126" width="136" height="23" color="#000000" bgColor="#ff8040" fontSize="10"> + <math> + <input> + <e type="operand">Winkelberechnung</e> + </input> + </math> + </region> + <region id="10" left="72" top="153" width="350" height="27" color="#000000" bgColor="#ffffff" fontSize="10"> + <math> + <input> + <e type="operand">ζ</e> + <e type="operand">Φa</e> + <e type="function" preserve="true" args="1">sin</e> + <e type="operand">Φb</e> + <e type="function" preserve="true" args="1">sin</e> + <e type="operator" args="2">*</e> + <e type="operand">Φa</e> + <e type="function" preserve="true" args="1">cos</e> + <e type="operand">Φb</e> + <e type="function" preserve="true" args="1">cos</e> + <e type="operator" args="2">*</e> + <e type="operand">λb</e> + <e type="operand">λa</e> + <e type="operator" args="2">-</e> + <e type="function" preserve="true" args="1">cos</e> + <e type="operator" args="2">*</e> + <e type="operator" args="2">+</e> + <e type="function" preserve="true" args="1">acos</e> + <e type="operator" args="2">:</e> + </input> + </math> + </region> + <region id="11" left="72" top="198" width="152" height="23" color="#000000" bgColor="#ff8040" fontSize="10"> + <math> + <input> + <e type="operand">Streckenberechnung</e> + </input> + </math> + </region> + <region id="12" left="72" top="225" width="134" height="41" color="#000000" bgColor="#ffffff" fontSize="10"> + <math> + <input> + <e type="operand">L</e> + <e type="operand">ζ</e> + <e type="operand">360</e> + <e type="operand" style="unit">°</e> + <e type="operator" args="2">*</e> + <e type="operator" args="2">/</e> + <e type="operand">40075</e> + <e type="operator" args="2">*</e> + <e type="operand" style="unit">km</e> + <e type="operator" args="2">*</e> + <e type="bracket">(</e> + <e type="operator" args="2">:</e> + </input> + </math> + </region> + <region id="13" left="351" top="243" width="264" height="23" color="#000000" bgColor="#80ffff" fontSize="10"> + <text lang="eng"> + <p>Distanz zwischen den Koordinaten</p> + </text> + </region> + <region id="14" left="432" top="261" width="115" height="23" color="#000000" bgColor="#ffffff" fontSize="10"> + <math> + <input> + <e type="operand">L</e> + </input> + <contract> + <e type="operand" style="unit">km</e> + </contract> + <result action="numeric"> + <e type="operand">8928.9491</e> + </result> + </math> + </region> + <region id="15" left="63" top="306" width="464" height="23" color="#000000" bgColor="#ffff00" fontSize="10"> + <text lang="eng"> + <p>Komplexe berechnung der strecke zwischen zwei koordinaten</p> + </text> + </region> + <region id="16" left="63" top="360" width="160" height="23" color="#000000" bgColor="#00ff00" fontSize="10"> + <text lang="eng"> + <p>Abplattung der Erde</p> + </text> + </region> + <region id="17" left="306" top="360" width="232" height="23" color="#000000" bgColor="#00ff00" fontSize="10"> + <text lang="eng"> + <p>Äquatorradius der Erde in Km</p> + </text> + </region> + <region id="18" left="351" top="378" width="91" height="23" color="#000000" bgColor="#ffffff" fontSize="10"> + <math> + <input> + <e type="operand">a</e> + <e type="operand">6378.137</e> + <e type="operator" args="2">:</e> + </input> + </math> + </region> + <region id="19" left="63" top="387" width="135" height="39" color="#000000" bgColor="#ffffff" fontSize="10"> + <math> + <input> + <e type="operand">f</e> + <e type="operand">1</e> + <e type="operand">298.257223563</e> + <e type="operator" args="2">/</e> + <e type="operator" args="2">:</e> + </input> + </math> + </region> + <region id="20" left="72" top="441" width="104" height="39" color="#000000" bgColor="#ffffff" fontSize="10"> + <math> + <input> + <e type="operand">Fgrad</e> + <e type="operand">Φa</e> + <e type="operand">Φb</e> + <e type="operator" args="2">+</e> + <e type="operand">2</e> + <e type="operator" args="2">/</e> + <e type="operator" args="2">:</e> + </input> + </math> + </region> + <region id="21" left="189" top="441" width="104" height="39" color="#000000" bgColor="#ffffff" fontSize="10"> + <math> + <input> + <e type="operand">Ggrad</e> + <e type="operand">Φa</e> + <e type="operand">Φb</e> + <e type="operator" args="2">-</e> + <e type="operand">2</e> + <e type="operator" args="2">/</e> + <e type="operator" args="2">:</e> + </input> + </math> + </region> + <region id="22" left="306" top="441" width="104" height="39" color="#000000" bgColor="#ffffff" fontSize="10"> + <math> + <input> + <e type="operand">lgrad</e> + <e type="operand">λa</e> + <e type="operand">λb</e> + <e type="operator" args="2">-</e> + <e type="operand">2</e> + <e type="operator" args="2">/</e> + <e type="operator" args="2">:</e> + </input> + </math> + </region> + <region id="23" left="81" top="486" width="184" height="23" color="#000000" bgColor="#ff8040" fontSize="10"> + <text lang="eng"> + <p>Das Bogenmaß errechnen</p> + </text> + </region> + <region id="24" left="81" top="513" width="122" height="39" color="#000000" bgColor="#ffffff" fontSize="10"> + <math> + <input> + <e type="operand">Frad</e> + <e type="operand">π</e> + <e type="operand">180</e> + <e type="operator" args="2">/</e> + <e type="operand">Fgrad</e> + <e type="operator" args="2">*</e> + <e type="operator" args="2">:</e> + </input> + </math> + </region> + <region id="25" left="216" top="513" width="122" height="39" color="#000000" bgColor="#ffffff" fontSize="10"> + <math> + <input> + <e type="operand">Grad</e> + <e type="operand">π</e> + <e type="operand">180</e> + <e type="operator" args="2">/</e> + <e type="operand">Ggrad</e> + <e type="operator" args="2">*</e> + <e type="operator" args="2">:</e> + </input> + </math> + </region> + <region id="26" left="351" top="513" width="122" height="39" color="#000000" bgColor="#ffffff" fontSize="10"> + <math> + <input> + <e type="operand">lrad</e> + <e type="operand">π</e> + <e type="operand">180</e> + <e type="operator" args="2">/</e> + <e type="operand">lgrad</e> + <e type="operator" args="2">*</e> + <e type="operator" args="2">:</e> + </input> + </math> + </region> + <region id="27" left="81" top="558" width="216" height="23" color="#000000" bgColor="#ff8040" fontSize="10"> + <text lang="eng"> + <p>grober Abstand D ermitteln</p> + </text> + </region> + <region id="28" left="81" top="585" width="370" height="37" color="#000000" bgColor="#ffffff" fontSize="10"> + <math> + <input> + <e type="operand">S</e> + <e type="operand">Grad</e> + <e type="function" preserve="true" args="1">sin</e> + <e type="bracket">(</e> + <e type="operand">2</e> + <e type="operator" args="2">^</e> + <e type="operand">lrad</e> + <e type="function" preserve="true" args="1">cos</e> + <e type="bracket">(</e> + <e type="operand">2</e> + <e type="operator" args="2">^</e> + <e type="operator" args="2">*</e> + <e type="operand">Frad</e> + <e type="function" preserve="true" args="1">cos</e> + <e type="bracket">(</e> + <e type="operand">2</e> + <e type="operator" args="2">^</e> + <e type="operand">lrad</e> + <e type="function" preserve="true" args="1">sin</e> + <e type="bracket">(</e> + <e type="operand">2</e> + <e type="operator" args="2">^</e> + <e type="operator" args="2">*</e> + <e type="operator" args="2">+</e> + <e type="bracket">(</e> + <e type="operator" args="2">:</e> + </input> + </math> + </region> + <region id="29" left="81" top="621" width="362" height="35" color="#000000" bgColor="#ffffff" fontSize="10"> + <math> + <input> + <e type="operand">C</e> + <e type="operand">Grad</e> + <e type="function" preserve="true" args="1">cos</e> + <e type="bracket">(</e> + <e type="operand">2</e> + <e type="operator" args="2">^</e> + <e type="operand">lrad</e> + <e type="function" preserve="true" args="1">cos</e> + <e type="bracket">(</e> + <e type="operand">2</e> + <e type="operator" args="2">^</e> + <e type="operator" args="2">*</e> + <e type="operand">Frad</e> + <e type="function" preserve="true" args="1">sin</e> + <e type="bracket">(</e> + <e type="operand">2</e> + <e type="operator" args="2">^</e> + <e type="operand">lrad</e> + <e type="function" preserve="true" args="1">sin</e> + <e type="bracket">(</e> + <e type="operand">2</e> + <e type="operator" args="2">^</e> + <e type="operator" args="2">*</e> + <e type="operator" args="2">+</e> + <e type="operator" args="2">:</e> + </input> + </math> + </region> + <region id="30" left="90" top="666" width="93" height="43" color="#000000" bgColor="#ffffff" fontSize="10"> + <math> + <input> + <e type="operand">ω</e> + <e type="operand">S</e> + <e type="operand">C</e> + <e type="operator" args="2">/</e> + <e type="function" preserve="true" args="1">sqrt</e> + <e type="function" preserve="true" args="1">atan</e> + <e type="operator" args="2">:</e> + </input> + </math> + </region> + <region id="31" left="423" top="702" width="104" height="23" color="#000000" bgColor="#80ffff" fontSize="10"> + <text lang="eng"> + <p>D ist gleich</p> + </text> + </region> + <region id="32" left="90" top="720" width="57" height="23" color="#000000" bgColor="#ffffff" fontSize="10"> + <math> + <input> + <e type="operand">D</e> + <e type="operand">2</e> + <e type="operand">ω</e> + <e type="operator" args="2">*</e> + <e type="operand">a</e> + <e type="operator" args="2">*</e> + <e type="operator" args="2">:</e> + </input> + </math> + </region> + <region id="33" left="423" top="720" width="97" height="23" color="#000000" bgColor="#ffffff" fontSize="10"> + <math> + <input> + <e type="operand">D</e> + </input> + <result action="numeric"> + <e type="operand">247.6591</e> + </result> + </math> + </region> + <region id="34" left="81" top="774" width="576" height="23" color="#000000" bgColor="#ff8040" fontSize="10"> + <text lang="eng"> + <p>Der Abstand D muss nun durch die Faktoren H_1 und H_2 korrigiert werden</p> + </text> + </region> + <region id="35" left="81" top="801" width="64" height="41" color="#000000" bgColor="#ffffff" fontSize="10"> + <math> + <input> + <e type="operand">R</e> + <e type="operand">S</e> + <e type="operand">C</e> + <e type="operator" args="2">*</e> + <e type="function" preserve="true" args="1">sqrt</e> + <e type="operand">ω</e> + <e type="operator" args="2">/</e> + <e type="operator" args="2">:</e> + </input> + </math> + </region> + <region id="36" left="81" top="837" width="75" height="39" color="#000000" bgColor="#ffffff" fontSize="10"> + <math> + <input> + <e type="operand">H1</e> + <e type="operand">3</e> + <e type="operand">R</e> + <e type="operator" args="2">*</e> + <e type="operand">1</e> + <e type="operator" args="2">-</e> + <e type="operand">2</e> + <e type="operand">C</e> + <e type="operator" args="2">*</e> + <e type="operator" args="2">/</e> + <e type="operator" args="2">:</e> + </input> + </math> + </region> + <region id="37" left="81" top="873" width="75" height="39" color="#000000" bgColor="#ffffff" fontSize="10"> + <math> + <input> + <e type="operand">H2</e> + <e type="operand">3</e> + <e type="operand">R</e> + <e type="operator" args="2">*</e> + <e type="operand">1</e> + <e type="operator" args="2">+</e> + <e type="operand">2</e> + <e type="operand">S</e> + <e type="operator" args="2">*</e> + <e type="operator" args="2">/</e> + <e type="operator" args="2">:</e> + </input> + </math> + </region> + <region id="38" left="81" top="909" width="458" height="37" color="#000000" bgColor="#ffffff" fontSize="10"> + <math> + <input> + <e type="operand">s</e> + <e type="operand">D</e> + <e type="operand">1</e> + <e type="operand">f</e> + <e type="operand">H1</e> + <e type="operator" args="2">*</e> + <e type="operand">Frad</e> + <e type="function" preserve="true" args="1">sin</e> + <e type="bracket">(</e> + <e type="operand">2</e> + <e type="operator" args="2">^</e> + <e type="operator" args="2">*</e> + <e type="operand">Grad</e> + <e type="function" preserve="true" args="1">cos</e> + <e type="bracket">(</e> + <e type="operand">2</e> + <e type="operator" args="2">^</e> + <e type="operator" args="2">*</e> + <e type="operator" args="2">+</e> + <e type="operand">f</e> + <e type="operand">H2</e> + <e type="operator" args="2">*</e> + <e type="operand">Frad</e> + <e type="function" preserve="true" args="1">cos</e> + <e type="bracket">(</e> + <e type="operand">2</e> + <e type="operator" args="2">^</e> + <e type="operator" args="2">*</e> + <e type="operand">Grad</e> + <e type="function" preserve="true" args="1">sin</e> + <e type="bracket">(</e> + <e type="operand">2</e> + <e type="operator" args="2">^</e> + <e type="operator" args="2">*</e> + <e type="operator" args="2">-</e> + <e type="bracket">(</e> + <e type="operator" args="2">*</e> + <e type="operator" args="2">:</e> + </input> + </math> + </region> + <region id="39" left="414" top="963" width="264" height="23" color="#000000" bgColor="#80ffff" fontSize="10"> + <text lang="eng"> + <p>Distanz zwischen den Koordinaten</p> + </text> + </region> + <region id="40" left="495" top="981" width="108" height="39" color="#000000" bgColor="#ffffff" fontSize="10"> + <math> + <input> + <e type="operand">s</e> + </input> + <contract> + <e type="operand" style="unit">km</e> + </contract> + <result action="numeric"> + <e type="operand">0.2476</e> + <e type="operand">1</e> + <e type="operand" style="unit">m</e> + <e type="operator" args="2">/</e> + <e type="operator" args="2">*</e> + </result> + </math> + </region> +</regions> \ No newline at end of file diff --git a/ffnw-node-info/documents/README b/ffnw-node-info/documents/README new file mode 100644 index 0000000000000000000000000000000000000000..93b0e9e45bace0794381a707abd4c01286c20a4e --- /dev/null +++ b/ffnw-node-info/documents/README @@ -0,0 +1,15 @@ +=== Geolocator === + +The package Geolocator is a combination of some programs and tools. The main function of this package is to get or sed geocoordinations (latditude and longditude) This Package has also an another major feature its is able to triangulate the router location via wifi. + +=== Install introduction: === + +Arch: + +{ sh | yaourt -S smath } + +smath is a program to worke with mathematical functions. + +=== Parameters discription === + + diff --git a/ffnw-geolocator/files/etc/config/gluon-node-info b/ffnw-node-info/files/etc/config/gluon-node-info similarity index 100% rename from ffnw-geolocator/files/etc/config/gluon-node-info rename to ffnw-node-info/files/etc/config/gluon-node-info diff --git a/ffnw-geolocator/files/lib/ffnw/geolocator/geolocator.sh b/ffnw-node-info/files/lib/ffnw/geolocator/geolocator.sh similarity index 100% rename from ffnw-geolocator/files/lib/ffnw/geolocator/geolocator.sh rename to ffnw-node-info/files/lib/ffnw/geolocator/geolocator.sh diff --git a/ffnw-geolocator/files/lib/gluon/announce/nodeinfo.d/location b/ffnw-node-info/files/lib/gluon/announce/nodeinfo.d/location similarity index 100% rename from ffnw-geolocator/files/lib/gluon/announce/nodeinfo.d/location rename to ffnw-node-info/files/lib/gluon/announce/nodeinfo.d/location diff --git a/ffnw-node-info/files/lib/gluon/announce/nodeinfo.d/owner b/ffnw-node-info/files/lib/gluon/announce/nodeinfo.d/owner new file mode 100644 index 0000000000000000000000000000000000000000..8a2a611d52544a423a2174260d7067711b160537 --- /dev/null +++ b/ffnw-node-info/files/lib/gluon/announce/nodeinfo.d/owner @@ -0,0 +1,4 @@ +local contact = uci:get_first('gluon-node-info', 'owner', 'contact', '') +if contact ~= '' then + return { contact = contact } +end diff --git a/ffnw-node-info/files/lib/gluon/announce/nodeinfo.d/system/role b/ffnw-node-info/files/lib/gluon/announce/nodeinfo.d/system/role new file mode 100644 index 0000000000000000000000000000000000000000..38de47d796d132917eb0c734fc9a002ad95a39eb --- /dev/null +++ b/ffnw-node-info/files/lib/gluon/announce/nodeinfo.d/system/role @@ -0,0 +1,4 @@ +local role = uci:get_first('gluon-node-info', 'system', 'role', '') +if role ~= '' then + return role +end diff --git a/ffnw-geolocator/files/lib/gluon/cron/geolocator b/ffnw-node-info/files/lib/gluon/cron/geolocator similarity index 100% rename from ffnw-geolocator/files/lib/gluon/cron/geolocator rename to ffnw-node-info/files/lib/gluon/cron/geolocator diff --git a/ffnw-node-info/files/lib/gluon/upgrade/500-node-info-system b/ffnw-node-info/files/lib/gluon/upgrade/500-node-info-system new file mode 100755 index 0000000000000000000000000000000000000000..a17b94617b45c78028720a35b50484b8de87340d --- /dev/null +++ b/ffnw-node-info/files/lib/gluon/upgrade/500-node-info-system @@ -0,0 +1,11 @@ +#!/usr/bin/lua + +local uci = require('luci.model.uci').cursor() + +local config = 'gluon-node-info' + +if not uci:get_first(config, 'system') then + uci:section(config, 'system') + uci:save(config) + uci:commit(config) +end diff --git a/ffnw-node-info/files/lib/gluon/upgrade/510-node-info-role b/ffnw-node-info/files/lib/gluon/upgrade/510-node-info-role new file mode 100755 index 0000000000000000000000000000000000000000..6e54a23463627dd173b6932e243aeaa94c7f64b8 --- /dev/null +++ b/ffnw-node-info/files/lib/gluon/upgrade/510-node-info-role @@ -0,0 +1,19 @@ +#!/usr/bin/lua + +local site = require 'gluon.site_config' +local uci = require('luci.model.uci').cursor() + +local config = 'gluon-node-info' +local role = uci:get(config, uci:get_first(config, 'system'), 'role') + +if site.roles then + default_role = site.roles.default +else + default_role = '' +end + +if not role then + uci:set(config, uci:get_first(config, 'system'), 'role', default_role) + uci:save(config) + uci:commit(config) +end diff --git a/geolocator/Makefile b/geolocator/Makefile deleted file mode 100644 index d9f9817122194274dce83818a726807174c50eea..0000000000000000000000000000000000000000 --- a/geolocator/Makefile +++ /dev/null @@ -1,40 +0,0 @@ -include $(TOPDIR)/rules.mk - -PKG_NAME:=ffnw-geolocator -PKG_VERSION:=1 -PKG_RELEASE:=1 - -PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) - -include $(INCLUDE_DIR)/package.mk - -define Package/ffnw-geolocator - SECTION:=daemon - CATEGORY:=Freifunk Nordwest - TITLE:=Sed geoposition for alfred -endef - -define Package/ffnw-geolocator/description - Sed geoposition for alfred -endef - -define Build/Prepare - mkdir -p $(PKG_BUILD_DIR) -endef - -define Build/Configure -endef - -define Build/Compile -endef - -define Package/ffnw-geolocator/install - $(INSTALL_DIR) $(1)/lib/gluon/cron/ - $(INSTALL_DATA) files/lib/gluon/cron/geolocator $(1)/lib/gluon/cron/geolocator - $(INSTALL_DIR) $(1)/lib/ffnw/geolocator/ - $(INSTALL_BIN) files/lib/ffnw/geolocator/geolocator.sh $(1)/lib/ffnw/geolocator/ - $(INSTALL_DIR) $(1)/etc/config/ - $(INSTALL_CONF) files/geolocator.config $(1)/etc/config/geolocator -endef - -$(eval $(call BuildPackage,ffnw-geolocator)) diff --git a/geolocator/files/lib/ffnw/geolocator/geolocator.sh b/geolocator/files/lib/ffnw/geolocator/geolocator.sh deleted file mode 100644 index 6df34509c5875b8c13ffc7193f6456f3ae3eb1d6..0000000000000000000000000000000000000000 --- a/geolocator/files/lib/ffnw/geolocator/geolocator.sh +++ /dev/null @@ -1,110 +0,0 @@ -#!/bin/sh - -#Get the configuration from the uci configuration file -#If it does not exists, then get it from a normal bash file with variables. -if [ -f /etc/config/geolocator ];then - SCRIPT_NIN_QUALITY=`uci get geolocator.@script[0].min_quality` - SCRIPT_NUM_LENGTH=`uci get geolocator.@script[0].geo_num_length` - SCRIPT_IMPROBABILITY=`uci get geolocator.@script[0].improbability` - SCRIPT_MOBILE=`uci get geolocator.@script[0].mobile` - SCRIPT_PIDPART=`uci get geolocator.@script[0].pidpart` -else - . `dirname $0`/geolocator_config -fi - -if [ -f $SCRIPT_PIDPART ]; then - echo "The geolocator is still running" - exit 0 -else - touch $SCRIPT_PIDPART -fi - -Clean_pid() { - if [ -f $SCRIPT_PIDPART ]; then - rm $SCRIPT_PIDPART - fi - exit 0 -} - -Get_geolocation_info() { - LWTRACE=`lwtrace -t 2> /dev/null` - echo $LWTRACE | grep "Scan completed : Your location:" >> /dev/null - if [ $? -eq "0" ]; then - last_arr_val=""; - for x in $LWTRACE - do - if [ $x == '(lat)' ]; then - LAT=$last_arr_val; - fi - if [ $x == '(lon)' ]; then - LON=$last_arr_val; - fi - if [ $x == '%' ]; then - QUALITY=$last_arr_val; - fi - last_arr_val=$x; - done - return 0 - else - return 1 - fi -} - -#Ceck_geocoordinate() { -# if echo $1 | grep -E "^[+-]?[0-9]+(\.[0-9]+)?$" >> /dev/null -# then -# if echo $1 | grep -v -E "^[0-9]+(\.[0-9]*(0{3}|1{3}|2{3}|3{3}|4{3}|5{3}|6{3}|7{3}|8{3}|9{3})[0-9]*)?$" >> /dev/null -# then -# return 1 -# fi -# else -# return 1 -# fi -# return 0 -#} - -Get_gluon_share_location() { - # 1 holt sich eine neue Position 0 nicht - SHARE_LOCATION=`uci get gluon-node-info.@location[0].share_location` - if [ $SHARE_LOCATION -eq 1 ]; then - echo "Schare location 1" - GLUON_LAT=`uci get gluon-node-info.@location[0].latitude` - GLUON_LON=`uci get gluon-node-info.@location[0].longitude` - # 1. Prüfe auf reine zahlen && die zahlenlänge - if echo $GLUON_LAT | grep -E "^[0-9]+(\.[0-9]+)?$" >> /dev/null - then - echo "Es sind nur zahlen" - if ! [ ${#GLUON_LAT} < $SCRIPT_NUM_LENGTH ]; then - echo "geo ist größer als mindes geo" - # 2. Prüfe warscheinlichkeit - if echo $GLUON_LAT | grep -E "^[0-9]+(\.[0-9]*(0{${SCRIPT_IMPROBABILITY}}|1{${SCRIPT_IMPROBABILITY}}|2{${SCRIPT_IMPROBABILITY}}|3{${SCRIPT_IMPROBABILITY}}|4{${SCRIPT_IMPROBABILITY}}|5{${SCRIPT_IMPROBABILITY}}|6{${SCRIPT_IMPROBABILITY}}|7{${SCRIPT_IMPROBABILITY}}|8{${SCRIPT_IMPROBABILITY}}|9{${SCRIPT_IMPROBABILITY}})[0-9]*)?$" >> /dev/null - then - echo "es sind keine x gleichen zahlen beinhaltend" - return 0 - fi - fi - fi -# Ceck_geocoordinate $GLUON_LAT - fi - return 1 -} - -# Hol sich die geo position durch die Triangulation -#Get_geolocation_info -#if [ $? -eq 0 ]; then - Get_gluon_share_location - echo $? -# if [ $? -eq 1 ]; then -# echo "location wird geändert" -# else -# echo "location wird nich geändert" -# fi -# echo $LAT -# echo $LON -# echo $QUALITY -# echo "----------" -#else -# echo "lwtrace doesn't gif a location"; -#fi; -#echo $SCRIPT_NIN_QUALITY -Clean_pid diff --git a/geolocator/files/lib/gluon/cron/geolocator b/geolocator/files/lib/gluon/cron/geolocator deleted file mode 100644 index dadc793f149b6a0fdcbca072c374073362813098..0000000000000000000000000000000000000000 --- a/geolocator/files/lib/gluon/cron/geolocator +++ /dev/null @@ -1 +0,0 @@ -*/5 * * * * sh /lib/ffnw/geolocator/geolocator.sh;