new version
This commit is contained in:
parent
ae15cff014
commit
b11b8965bd
19 changed files with 508 additions and 151 deletions
22
README.md
Normal file
22
README.md
Normal file
|
@ -0,0 +1,22 @@
|
|||
|
||||
|
||||
## Related
|
||||
|
||||
- https://github.com/asplendidday/ACbus
|
||||
- https://github.com/feuerrot/aseag-python
|
||||
- https://github.com/RobertKrajewski/PyASEAG
|
||||
- https://github.com/RobinMeis/pyASEAG
|
||||
- https://github.com/lebu/ASEAG-Busabfahrten
|
||||
- https://git.rwth-aachen.de/markus.witt/aseag-cli
|
||||
- https://github.com/stklcode/juraclient
|
||||
- https://github.com/acmurmeltier69/Alexa-Busauskunft
|
||||
|
||||
|
||||
- http://content.tfl.gov.uk/tfl-live-bus-river-bus-arrivals-api-documentation.pdf
|
||||
|
||||
|
||||
# API Endpoints
|
||||
|
||||
http://countdown.api.tfl.gov.uk
|
||||
http://ivu.aseag.de/interfaces/
|
||||
http://opendata.avv.de/current_GTFS/AVV_GTFS_mit_SPNV.zip
|
2
connectiq/.settings/IQ_IDE.prefs
Normal file
2
connectiq/.settings/IQ_IDE.prefs
Normal file
|
@ -0,0 +1,2 @@
|
|||
eclipse.preferences.version=1
|
||||
project_manifest=manifest.xml
|
1
connectiq/bin/ura-busstops-settings.json
Normal file
1
connectiq/bin/ura-busstops-settings.json
Normal file
|
@ -0,0 +1 @@
|
|||
{"settings":[{"key":"api_url_index","valueType":"number","defaultValue":1,"configTitle":"ApiUrl","configPrompt":"ApiUrlPrompt","configHelpUrl":null,"configError":null,"configType":"list","configReadonly":false,"configRequired":false,"configOptions":[{"display":"ApiUrlLocalhost","value":0},{"display":"ApiUrlNulll","value":1}],"configMin":null,"configMax":null,"configMaxLength":null}],"languages":{"valyrian":{"ApiUrl":"API URL","ApiUrlNulll":"https://connectiq-ura.0l.de","ApiUrlLocalhost":"http://localhost:8080","AppName":"Bus Stops","ApiUrlPrompt":"API URL:"}}}
|
|
@ -1,16 +1,16 @@
|
|||
<!-- This is a generated file. It is highly recommended that you DO NOT edit this file. --><iq:manifest xmlns:iq="http://www.garmin.com/xml/connectiq" version="1">
|
||||
<iq:application entry="BusStopApp" id="1CFE9C7CA0D44751A1CE1DF93F59268A" launcherIcon="@Drawables.LauncherIcon" name="@Strings.AppName" type="widget">
|
||||
|
||||
<iq:application entry="BusStopApp" id="1c850645cb504a699e92fc1eeb6afe0e" launcherIcon="@Drawables.LauncherIcon" minSdkVersion="3.2.0" name="@Strings.AppName" type="widget">
|
||||
<iq:products>
|
||||
<iq:product id="square_watch"/>
|
||||
<iq:product id="tall_watch"/>
|
||||
<iq:product id="round_watch"/>
|
||||
<iq:product id="fr745"/>
|
||||
</iq:products>
|
||||
|
||||
<iq:permissions>
|
||||
<iq:uses-permission id="Communications"/>
|
||||
<iq:uses-permission id="Positioning"/>
|
||||
<iq:uses-permission id="Sensor"/>
|
||||
</iq:permissions>
|
||||
|
||||
<iq:languages/>
|
||||
|
||||
<iq:languages>
|
||||
<iq:language>deu</iq:language>
|
||||
<iq:language>eng</iq:language>
|
||||
</iq:languages>
|
||||
</iq:application>
|
||||
</iq:manifest>
|
||||
|
|
2
connectiq/monkey.jungle
Normal file
2
connectiq/monkey.jungle
Normal file
|
@ -0,0 +1,2 @@
|
|||
project.manifest = manifest.xml
|
||||
|
48
connectiq/resources/drawables/ASEAG.svg
Normal file
48
connectiq/resources/drawables/ASEAG.svg
Normal file
|
@ -0,0 +1,48 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Creator: CorelDRAW -->
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" width="3583px" height="395px" style="shape-rendering:geometricPrecision; text-rendering:geometricPrecision; image-rendering:optimizeQuality; fill-rule:evenodd; clip-rule:evenodd"
|
||||
viewBox="0 0 3673.14 404.499"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<defs>
|
||||
<style type="text/css">
|
||||
<![CDATA[
|
||||
.fil0 {fill:#1F1A17;fill-rule:nonzero}
|
||||
.fil1 {fill:#EF4023;fill-rule:nonzero}
|
||||
]]>
|
||||
</style>
|
||||
</defs>
|
||||
<symbol id="Fm19-61-0" viewBox="1791.5 38.9138 4.27169 4.27169">
|
||||
<path class="fil0" d="M1793.31 42.0631l-0.0012108 0c-0.0181619,0.223997 -0.0496426,0.314807 -0.0726478,0.314807 -0.0665938,0 -0.116236,-0.389876 -0.116236,-1.10546 0,-0.808812 0.0581182,-1.51107 0.150139,-1.51107 0.0641722,0 0.115026,0.265164 0.113815,0.885092l-0.0605398 0c0,-0.279694 -0.0193727,-0.423779 -0.0520642,-0.423779 -0.0629614,0 -0.0908097,0.570285 -0.0908097,1.04976 0,0.342655 0.0193727,0.644144 0.0605398,0.644144 0.0423779,0 0.065383,-0.220365 0.0750694,-0.538804l-0.0629614 0 0.00968637 -0.409249 0.116236 0 -0.0314807 1.34883 -0.0375347 0 0 -0.254267z"/>
|
||||
<polygon class="fil0" points="1792.7,39.8231 1792.91,39.8231 1792.9,40.2844 1792.75,40.2844 1792.74,40.7554 1792.88,40.7554 1792.87,41.1804 1792.73,41.1804 1792.72,41.856 1792.86,41.856 1792.85,42.3161 1792.64,42.3161 "/>
|
||||
<path class="fil0" d="M1792.27 41.3547l0.0484318 -0.872984 0.00726478 0.872984 -0.0556966 0zm0.0956529 -1.53045l-0.0641722 0 -0.154982 2.49303 0.0690154 0 0.0302699 -0.523064 0.0847557 -0.0012108 0.00484318 0.524275 0.059329 0 -0.0290591 -2.49303z"/>
|
||||
<path class="fil0" d="M1792.99 41.3547l0.0484318 -0.872984 0.00726478 0.872984 -0.0556966 0zm0.0956529 -1.53045l-0.0641722 0 -0.154982 2.49303 0.0690154 0 0.0302699 -0.523064 0.0847557 -0.0012108 0.00484318 0.524275 0.059329 0 -0.0290591 -2.49303z"/>
|
||||
<path class="fil1" d="M1793.54 42.0231l0.0254267 0c0.0859665,0 0.0920205,-1.0098 0.0920205,-1.14905 0,-0.293013 -0.0133188,-0.703473 -0.0556966,-0.703473l-0.0290591 0 -0.0326915 1.85252zm0.0665938 -2.14553c0.0835449,0 0.0944421,0.651408 0.0944421,0.968637 0,0.0484318 -0.00363239,1.4687 -0.140452,1.4687l-0.0678046 0 0.0435887 -2.43733 0.0702262 0z"/>
|
||||
<path class="fil1" d="M1793.81 40.9576c0.0012108,-0.111393 -0.00484318,-0.161036 -0.0145296,-0.161036 -0.0181619,0 -0.0363239,0.237316 -0.0460103,0.556966 0.0314807,-0.0266375 0.059329,-0.173144 0.0605398,-0.39593zm0.0157403 1.1551c-0.0254267,0.209468 -0.0520642,0.244581 -0.0702262,0.244581 -0.0302699,0 -0.0508534,-0.265164 -0.0508534,-0.682889 0,-0.487951 0.0363239,-1.14178 0.100496,-1.14178 0.0181619,0 0.0411671,0.111393 0.0411671,0.362028 0,0.452838 -0.0641722,0.688943 -0.0992853,0.703473 -0.00242159,0.139242 -0.0012108,0.441941 0.0266375,0.449205 0.0108972,0.00363239 0.0266375,-0.0460103 0.0411671,-0.163457l0.0108972 0.22884z"/>
|
||||
<path class="fil1" d="M1793.92 40.8741l0.0012108 0.00605398 0.00968637 -0.135609c0.00605398,-0.0726478 0.0169511,-0.211889 0.0290591,-0.211889 0.00847557,0 0.0169511,0.0556966 0.0217943,0.124712l-0.0205835 0.328126c-0.00363239,-0.0145296 -0.00726478,-0.0351131 -0.0145296,-0.0351131 -0.0145296,0 -0.0290591,0.128344 -0.0363239,0.504902l-0.0145296 0.859665 -0.0387455 0 0.0302699 -1.74112 0.0387455 0 -0.00605398 0.300277z"/>
|
||||
<path class="fil1" d="M1794.14 40.8111c-0.0169511,0 -0.0496426,0.250635 -0.0496426,0.863298 0,0.233684 0.00968637,0.378979 0.0254267,0.378979 0.0181619,0 0.0484318,-0.211889 0.0556966,-1.0994 -0.012108,-0.118658 -0.0157403,-0.142874 -0.0314807,-0.142874zm0.0496426 1.34762c-0.0145296,0.772488 -0.0569074,1.02676 -0.100496,1.02676 -0.0217943,0 -0.0435887,-0.059329 -0.059329,-0.163457l0.0133188 -0.285748c0.012108,0.104128 0.0278483,0.150139 0.0484318,0.150139 0.0254267,0 0.0496426,-0.188884 0.0569074,-0.592079l0.00484318 -0.237316 0 -0.00605398 -0.00847557 0.0968637c-0.00484318,0.0629614 -0.0242159,0.209468 -0.0496426,0.209468 -0.0290591,0 -0.047221,-0.272429 -0.047221,-0.647776 0,-0.556966 0.0399563,-1.17689 0.0908097,-1.17689 0.0133188,0 0.0290591,0.0556966 0.0363239,0.159825l0.00363239 -0.118658 0.0387455 0 -0.0278483 1.58493z"/>
|
||||
<path class="fil1" d="M1794.33 41.9674l-0.0012108 -0.00726478c-0.0217943,0.316018 -0.0411671,0.397141 -0.0617506,0.397141 -0.0145296,0 -0.0339023,-0.111393 -0.0339023,-0.400774 0,-0.100496 0.0012108,-0.226419 0.00363239,-0.38019l0.0193727 -1.00254 0.0387455 0 -0.0181619 1.00012c-0.00242159,0.100496 -0.00363239,0.176776 -0.00363239,0.239738 0,0.187673 0.0108972,0.24337 0.0157403,0.24337 0.0181619,0 0.0447995,-0.406827 0.053275,-0.900832l0.00968637 -0.582393 0.0387455 0 -0.0302699 1.74112 -0.0387455 0 0.00847557 -0.347498z"/>
|
||||
<path class="fil1" d="M1794.49 42.2459c-0.012108,0.0726478 -0.0278483,0.111393 -0.0399563,0.111393 -0.0290591,0 -0.0447995,-0.157403 -0.0351131,-0.62356l0.0169511 -0.922627 -0.0205835 0 0.00484318 -0.237316 0.0205835 0 0.00726478 -0.417725 0.0399563 -0.104128 -0.00847557 0.521853 0.0387455 0 -0.00484318 0.237316 -0.0387455 0 -0.0169511 0.86693c-0.00605398,0.358396 0.00605398,0.397141 0.0145296,0.397141 0.00847557,0 0.0133188,-0.0278483 0.0193727,-0.059329l0.00242159 0.230051z"/>
|
||||
<path class="fil1" d="M1794.61 40.9576c0,-0.111393 -0.00484318,-0.161036 -0.0157403,-0.161036 -0.0169511,0 -0.0363239,0.237316 -0.0447995,0.556966 0.0302699,-0.0266375 0.059329,-0.173144 0.0605398,-0.39593zm0.0157403 1.1551c-0.0266375,0.209468 -0.053275,0.244581 -0.071437,0.244581 -0.0302699,0 -0.0496426,-0.265164 -0.0496426,-0.682889 0,-0.487951 0.0363239,-1.14178 0.100496,-1.14178 0.0181619,0 0.0399563,0.111393 0.0399563,0.362028 0,0.452838 -0.0641722,0.688943 -0.0992853,0.703473 -0.00242159,0.139242 -0.0012108,0.441941 0.0278483,0.449205 0.00968637,0.00363239 0.0254267,-0.0460103 0.0411671,-0.163457l0.0108972 0.22884z"/>
|
||||
<polygon class="fil1" points="1794.87,40.1875 1794.8,40.1875 1794.79,40.8765 1794.86,40.8765 1794.85,41.1864 1794.78,41.1864 1794.77,42.0049 1794.85,42.0049 1794.85,42.3149 1794.72,42.3149 1794.77,39.8776 1794.88,39.8776 "/>
|
||||
<path class="fil1" d="M1794.91 40.0519c0.00242159,-0.131977 0.0145296,-0.267586 0.0278483,-0.267586 0.0133188,0 0.0217943,0.131977 0.0193727,0.267586 -0.00242159,0.150139 -0.0145296,0.291802 -0.0290591,0.291802 -0.0133188,0 -0.0205835,-0.141663 -0.0181619,-0.291802zm0.0339023 0.521853l-0.0302699 1.74112 -0.0387455 0 0.0302699 -1.74112 0.0387455 0z"/>
|
||||
<path class="fil1" d="M1795.02 40.9019l0.0012108 0.00605398c0.0242159,-0.291802 0.0447995,-0.375347 0.0665938,-0.375347 0.0230051,0 0.0351131,0.111393 0.0351131,0.399563 0,0.101707 -0.0012108,0.226419 -0.00363239,0.38019l-0.0193727 1.00254 -0.0387455 0 0.0181619 -0.998907c0.00242159,-0.101707 0.00363239,-0.177987 0.00363239,-0.240948 0.0012108,-0.187673 -0.00726478,-0.236105 -0.0181619,-0.236105 -0.0181619,0 -0.0484318,0.400774 -0.0569074,0.894778l-0.00968637 0.581182 -0.0399563 0 0.0314807 -1.74112 0.0375347 0 -0.00726478 0.328126z"/>
|
||||
<path class="fil1" d="M1795.24 40.8741c-0.00726478,-0.0496426 -0.0157403,-0.0835449 -0.0230051,-0.0835449 -0.00847557,0 -0.0205835,0.0726478 -0.0205835,0.22884 0,0.101707 0.00847557,0.192517 0.0205835,0.345077 0.012108,0.129555 0.0205835,0.317229 0.0205835,0.469789 0,0.337812 -0.0278483,0.523064 -0.0605398,0.523064 -0.0230051,0 -0.0363239,-0.0835449 -0.0484318,-0.181619l0.0157403 -0.236105c0.00847557,0.0690154 0.0193727,0.15256 0.0290591,0.15256 0.0157403,0 0.0254267,-0.111393 0.0254267,-0.263954 0,-0.118658 -0.00726478,-0.202203 -0.0217943,-0.369293 -0.0133188,-0.161036 -0.0193727,-0.293013 -0.0193727,-0.411671 0,-0.371714 0.0302699,-0.514588 0.0544858,-0.514588 0.0205835,0 0.0339023,0.0762802 0.0411671,0.15256l-0.0133188 0.188884z"/>
|
||||
<path class="fil1" d="M1795.35 42.2459c-0.0133188,0.0726478 -0.0278483,0.111393 -0.0411671,0.111393 -0.0278483,0 -0.0447995,-0.157403 -0.0351131,-0.62356l0.0181619 -0.922627 -0.0205835 0 0.00363239 -0.237316 0.0205835 0 0.00726478 -0.417725 0.0411671 -0.104128 -0.00968637 0.521853 0.0387455 0 -0.00363239 0.237316 -0.0387455 0 -0.0169511 0.86693c-0.00726478,0.358396 0.00484318,0.397141 0.0133188,0.397141 0.00847557,0 0.0133188,-0.0278483 0.0193727,-0.059329l0.00363239 0.230051z"/>
|
||||
<path class="fil1" d="M1795.41 40.0519c0.00242159,-0.131977 0.0145296,-0.267586 0.0278483,-0.267586 0.0133188,0 0.0217943,0.131977 0.0193727,0.267586 -0.00242159,0.150139 -0.0145296,0.291802 -0.0290591,0.291802 -0.0133188,0 -0.0205835,-0.141663 -0.0181619,-0.291802zm0.0339023 0.521853l-0.0302699 1.74112 -0.0387455 0 0.0302699 -1.74112 0.0387455 0z"/>
|
||||
<path class="fil1" d="M1795.55 40.9576c0,-0.111393 -0.00484318,-0.161036 -0.0157403,-0.161036 -0.0169511,0 -0.0363239,0.237316 -0.0447995,0.556966 0.0302699,-0.0266375 0.059329,-0.173144 0.0605398,-0.39593zm0.0157403 1.1551c-0.0266375,0.209468 -0.053275,0.244581 -0.0702262,0.244581 -0.0302699,0 -0.0508534,-0.265164 -0.0508534,-0.682889 0,-0.487951 0.0363239,-1.14178 0.100496,-1.14178 0.0181619,0 0.0411671,0.111393 0.0411671,0.362028 0,0.452838 -0.0641722,0.688943 -0.100496,0.703473 -0.00242159,0.139242 0,0.441941 0.0278483,0.449205 0.0108972,0.00363239 0.0254267,-0.0460103 0.0411671,-0.163457l0.0108972 0.22884z"/>
|
||||
<path class="fil1" d="M1795.69 40.8111c-0.0169511,0 -0.0496426,0.250635 -0.0496426,0.863298 0,0.233684 0.00968637,0.378979 0.0254267,0.378979 0.0181619,0 0.0484318,-0.211889 0.0556966,-1.0994 -0.012108,-0.118658 -0.0157403,-0.142874 -0.0314807,-0.142874zm0.0496426 1.34762c-0.0145296,0.772488 -0.0569074,1.02676 -0.100496,1.02676 -0.0217943,0 -0.0435887,-0.059329 -0.059329,-0.163457l0.0133188 -0.285748c0.012108,0.104128 0.0278483,0.150139 0.0484318,0.150139 0.0254267,0 0.0496426,-0.188884 0.0569074,-0.592079l0.00484318 -0.237316 0 -0.00605398 -0.00847557 0.0968637c-0.00484318,0.0629614 -0.0242159,0.209468 -0.0496426,0.209468 -0.0290591,0 -0.047221,-0.272429 -0.047221,-0.647776 0,-0.556966 0.0399563,-1.17689 0.0908097,-1.17689 0.0133188,0 0.0290591,0.0556966 0.0363239,0.159825l0.00242159 -0.118658 0.0399563 0 -0.0278483 1.58493z"/>
|
||||
<path class="fil1" d="M1791.76 39.1378c0.00968637,0.0678046 0.0762802,0.548491 0.0823341,0.590869 0.00847557,0.0605398 0.0181619,0.0968637 0.0302699,0.0956529 0.012108,0 0.165879,0 0.165879,0l0.0411671 0.466157c-0.0230051,0 -0.199781,0 -0.216733,0 -0.0169511,0 -0.0278483,-0.00484318 -0.0447995,-0.12229 -0.00605398,-0.0460103 -0.0678046,-0.48674 -0.0859665,-0.615084 -0.0266375,-0.19736 -0.0544858,-0.188884 -0.0847557,-0.187673l-0.107761 0 -0.0387455 -0.451627c0,0 0.100496,0 0.142874,0 0.0375347,0.00363239 0.0569074,0.00363239 0.0738586,0.0339023 0.0230051,0.0399563 0.0326915,0.125923 0.0423779,0.190095z"/>
|
||||
<path class="fil1" d="M1791.85 40.5036c0.0726478,0 0.245792,-0.0012108 0.245792,-0.0012108 0.0133188,0.159825 0.0266375,0.302699 0.0387455,0.449205l-0.301488 0c-0.0193727,0 -0.0302699,-0.0351131 -0.047221,-0.158614 -0.0230051,-0.163457 -0.0556966,-0.400774 -0.0738586,-0.529118 -0.0169511,-0.12229 -0.0290591,-0.217943 -0.0569074,-0.217943l-0.0605398 0 -0.0375347 -0.45647c0,0 0.0787017,0 0.118658,0 0.0157403,0 0.0339023,0.0799125 0.0569074,0.233684 0.0181619,0.117447 0.0556966,0.401984 0.0787017,0.559388 0.0157403,0.116236 0.0278483,0.12108 0.0387455,0.12108z"/>
|
||||
<path class="fil1" d="M1791.79 41.0629c0.0217943,0.157403 0.047221,0.116236 0.059329,0.12229l0.286959 0 -0.0363239 0.441941 -0.290591 0c-0.0205835,0 -0.0375347,-0.0920205 -0.053275,-0.2131 -0.0145296,-0.107761 -0.0484318,-0.336601 -0.0787017,-0.56302 -0.00968637,-0.0690154 -0.0254267,-0.147717 -0.0460103,-0.147717 -0.0242159,0 -0.0738586,0.0012108 -0.0738586,0.0012108l0.0411671 -0.483108c0,0 0.0254267,0 0.0484318,0 0.0193727,0 0.0302699,0.0411671 0.0447995,0.138031 0.0242159,0.180409 0.0762802,0.549701 0.0980745,0.703473z"/>
|
||||
<path class="fil1" d="M1791.76 41.6974c0.0133188,0.0920205 0.0351131,0.146506 0.053275,0.146506l0.271218 0 -0.0411671 0.469789 -0.25911 -0.0012108c-0.0254267,0.0012108 -0.0363239,-0.119869 -0.059329,-0.277272 -0.0133188,-0.101707 -0.0460103,-0.329337 -0.0641722,-0.467367 -0.0193727,-0.140452 -0.0363239,-0.199781 -0.0569074,-0.199781 -0.0387455,0 -0.100496,-0.0012108 -0.100496,-0.0012108 0.0133188,-0.157403 0.0266375,-0.308753 0.0399563,-0.469789 0,0 0.0242159,-0.0012108 0.0339023,-0.0012108 0.0266375,0 0.0690154,-0.0193727 0.0908097,0.13682 0.0399563,0.288169 0.0665938,0.475843 0.0920205,0.664727z"/>
|
||||
<path class="fil0" d="M1792.56 40.8341c-0.0460103,-0.15256 -0.0581182,-0.221576 -0.0581182,-0.352342 0,-0.190095 0.0266375,-0.288169 0.0484318,-0.288169 0.0230051,0 0.0520642,0.101707 0.0520642,0.420146l0.0617506 0c0,-0.661095 -0.0508534,-0.859665 -0.111393,-0.859665 -0.0569074,0 -0.116236,0.194938 -0.116236,0.777331 0,0.362028 0.0278483,0.543647 0.0738586,0.704683 0.047221,0.163457 0.0665938,0.22763 0.0665938,0.404406 0,0.194938 -0.0266375,0.297856 -0.0520642,0.297856 -0.0423779,0 -0.059329,-0.245792 -0.059329,-0.449205l-0.0617506 0c0,0.596922 0.0375347,0.903254 0.119869,0.903254 0.077491,0 0.118658,-0.341445 0.118658,-0.808812 0,-0.386244 -0.0290591,-0.570285 -0.0823341,-0.749483z"/>
|
||||
</symbol>
|
||||
<symbol id="Fm20-63-0" viewBox="1997.11 -74.7098 336.444 37.0504">
|
||||
<use transform="scale(78.7614 8.6735)" x="25.3565" y="-8.61358" width="4.27169" height="4.27169" xlink:href="#Fm19-61-0"/>
|
||||
</symbol>
|
||||
<g id="Ebene_x0020_1">
|
||||
<metadata id="CorelCorpID_0Corel-Layer"/>
|
||||
<use transform="scale(10.9175 10.9175)" y="7.72889e-005" width="336.444" height="37.0504" xlink:href="#Fm20-63-0"/>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 13 KiB |
BIN
connectiq/resources/drawables/bus_icon.png
Normal file
BIN
connectiq/resources/drawables/bus_icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
BIN
connectiq/resources/drawables/bus_stop_sign.png
Normal file
BIN
connectiq/resources/drawables/bus_stop_sign.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.2 KiB |
6
connectiq/resources/drawables/bus_stop_sign.svg
Normal file
6
connectiq/resources/drawables/bus_stop_sign.svg
Normal file
|
@ -0,0 +1,6 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200" viewBox="0 0 74 74">
|
||||
<circle fill="#F0CA00" cx="37" cy="37" r="37"/>
|
||||
<circle fill="#008754" cx="37" cy="37" r="35"/>
|
||||
<circle fill="#F0CA00" cx="37" cy="37" r="25"/>
|
||||
<path fill="#008754" d="m 44.5,34 -15,0 0,-16 -6,0 0,38 6,0 0,-17 15,0 0,17 6,0 0,-38 -6,0 z"/>
|
||||
</svg>
|
After Width: | Height: | Size: 340 B |
|
@ -1,3 +1,3 @@
|
|||
<drawables>
|
||||
<bitmap id="LauncherIcon" filename="launcher_icon.png" />
|
||||
<bitmap id="LauncherIcon" filename="bus_stop_sign.png" />
|
||||
</drawables>
|
Binary file not shown.
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.9 KiB |
15
connectiq/resources/porperties.xml
Normal file
15
connectiq/resources/porperties.xml
Normal file
|
@ -0,0 +1,15 @@
|
|||
<resources>
|
||||
|
||||
<properties>
|
||||
<property id="api_url_index" type="number">1</property>
|
||||
</properties>
|
||||
|
||||
<settings>
|
||||
<setting propertyKey="@Properties.api_url_index" title="@Strings.ApiUrl" prompt="@Strings.ApiUrlPrompt">
|
||||
<settingConfig type="list">
|
||||
<listEntry value="0">@Strings.ApiUrlLocalhost</listEntry>
|
||||
<listEntry value="1">@Strings.ApiUrlNulll</listEntry>
|
||||
</settingConfig>
|
||||
</setting>
|
||||
</settings>
|
||||
</resources>
|
|
@ -1,3 +1,7 @@
|
|||
<strings>
|
||||
<string id="AppName">ASEAG Fahrplan</string>
|
||||
<string id="AppName">Bus Stops</string>
|
||||
<string id="ApiUrl">API URL</string>
|
||||
<string id="ApiUrlPrompt">API URL:</string>
|
||||
<string id="ApiUrlLocalhost">http://localhost:8080</string>
|
||||
<string id="ApiUrlNulll">https://connectiq-ura.0l.de</string>
|
||||
</strings>
|
|
@ -1,54 +1,57 @@
|
|||
using Toybox.Application as App;
|
||||
using Toybox.Position as Position;
|
||||
using Toybox.Time as Time;
|
||||
using Toybox.Application;
|
||||
using Toybox.Position;
|
||||
using Toybox.Time;
|
||||
using Toybox.Sensor;
|
||||
using Toybox.System;
|
||||
|
||||
class BusStopApp extends App.AppBase {
|
||||
var mView;
|
||||
var mDelegate;
|
||||
class BusStopApp extends Application.AppBase {
|
||||
var view;
|
||||
var delegate;
|
||||
var position;
|
||||
var sensors;
|
||||
var api_url;
|
||||
|
||||
function intialize() {
|
||||
AppBase.initialize();
|
||||
}
|
||||
|
||||
//! onStart() is called on application start up
|
||||
function onStart() {
|
||||
Position.enableLocationEvents(Position.LOCATION_CONTINUOUS, method(:onPosition));
|
||||
}
|
||||
|
||||
//! onStop() is called when your application is exiting
|
||||
function onStop() {
|
||||
Position.enableLocationEvents(Position.LOCATION_DISABLE, method(:onPosition));
|
||||
var offset = 0;
|
||||
var stopId = 0;
|
||||
|
||||
function initialize() {
|
||||
Application.AppBase.initialize();
|
||||
|
||||
loadSettings();
|
||||
}
|
||||
|
||||
function fakePosition() {
|
||||
var pos = new Position.Info();
|
||||
|
||||
pos.accuracy = 0;
|
||||
pos.altitude = 0;
|
||||
pos.heading = 0;
|
||||
pos.speed = 0;
|
||||
pos.when = Time.now();
|
||||
pos.position = new Position.Location({
|
||||
:latitude => 50.7855,
|
||||
:longitude => 6.0541,
|
||||
:format => :degrees
|
||||
});
|
||||
|
||||
mView.setPosition(pos);
|
||||
function onSettingsChanged() {
|
||||
loadSettings();
|
||||
}
|
||||
|
||||
function loadSettings() {
|
||||
var api_url_index = 1; //getProperty("api_url_index");
|
||||
|
||||
switch (api_url_index) {
|
||||
case 0:
|
||||
api_url = "https://localhost:8080";
|
||||
break;
|
||||
|
||||
case 1:
|
||||
api_url = "https://connectiq-ura.0l.de";
|
||||
break;
|
||||
}
|
||||
|
||||
System.println(api_url);
|
||||
}
|
||||
|
||||
function onPosition(info) {
|
||||
positionView.setPosition(info);
|
||||
function onStart(state) {
|
||||
}
|
||||
|
||||
function onStop(state) {
|
||||
}
|
||||
|
||||
//! Return the initial view of your application here
|
||||
function getInitialView() {
|
||||
mView = new BusStopView();
|
||||
mDelegate = new BusStopDelegate();
|
||||
view = new BusStopView(self);
|
||||
delegate = new BusStopDelegate(self);
|
||||
|
||||
fakePosition();
|
||||
|
||||
return [ mView, mDelegate ];
|
||||
return [ view, delegate ];
|
||||
}
|
||||
|
||||
}
|
|
@ -1,10 +1,36 @@
|
|||
using Toybox.WatchUi as Ui;
|
||||
using Toybox.Graphics as Gfx;
|
||||
using Toybox.System as Sys;
|
||||
using Toybox.WatchUi;
|
||||
|
||||
var last_key = null;
|
||||
|
||||
class InputTestDelegate extends Ui.BehaviorDelegate {
|
||||
class BusStopDelegate extends WatchUi.BehaviorDelegate {
|
||||
var app;
|
||||
|
||||
function initialize(a) {
|
||||
WatchUi.BehaviorDelegate.initialize();
|
||||
|
||||
app = a;
|
||||
}
|
||||
|
||||
function onNextPage() {
|
||||
app.view.offset += 1;
|
||||
|
||||
WatchUi.requestUpdate();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function onPreviousPage() {
|
||||
if (app.view.offset > 0) {
|
||||
app.view.offset -= 1;
|
||||
|
||||
WatchUi.requestUpdate();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function onSelect() {
|
||||
app.offset = 0;
|
||||
WatchUi.pushView(new DepartureView(app), new DepartureDelegate(app), WatchUi.SLIDE_LEFT);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -1,105 +1,205 @@
|
|||
using Toybox.WatchUi as Ui;
|
||||
using Toybox.Graphics as Gfx;
|
||||
using Toybox.System as Sys;
|
||||
using Toybox.Lang as Lang;
|
||||
using Toybox.Communications as Comm;
|
||||
using Toybox.System as Sys;
|
||||
using Toybox.Time as Time;
|
||||
using Toybox.Timer as Timer;
|
||||
using Toybox.WatchUi;
|
||||
using Toybox.Graphics;
|
||||
using Toybox.System;
|
||||
using Toybox.Lang;
|
||||
using Toybox.Communications;
|
||||
using Toybox.System;
|
||||
|
||||
class BusStopView extends Ui.View {
|
||||
var schedule = null;
|
||||
var tmr;
|
||||
class CompassDrawable extends WatchUi.Drawable {
|
||||
|
||||
var bearing = 0;
|
||||
var aWidth = 2;
|
||||
var aLength = 6;
|
||||
var aColor = Graphics.COLOR_RED;
|
||||
|
||||
function initialize(settings) {
|
||||
WatchUi.Drawable.initialize(settings);
|
||||
|
||||
aWidth = settings[:aWidth];
|
||||
aLength = settings[:aLength];
|
||||
aColor = settings[:aColor];
|
||||
}
|
||||
|
||||
function setBearing(b) {
|
||||
bearing = Math.PI * (b - 90) / 180;
|
||||
}
|
||||
|
||||
function draw(dc) {
|
||||
var rPts = new[7];
|
||||
var aPts = [
|
||||
[-0.5*aLength, -0.5*aWidth],
|
||||
[ 0.0, -0.5*aWidth],
|
||||
[ 0.0, -1.0*aWidth],
|
||||
[ 0.5*aLength, 0],
|
||||
[ 0.0, 1.0*aWidth],
|
||||
[ 0.0, 0.5*aWidth],
|
||||
[-0.5*aLength, 0.5*aWidth]
|
||||
];
|
||||
|
||||
var s = Math.sin(bearing);
|
||||
var c = Math.cos(bearing);
|
||||
|
||||
for (var i = 0; i < 7; i++) {
|
||||
var p = aPts[i];
|
||||
rPts[i] = [
|
||||
locX + width * (p[0] * c - p[1] * s),
|
||||
locY + height * (p[0] * s + p[1] * c)
|
||||
];
|
||||
}
|
||||
|
||||
dc.setColor(aColor, Graphics.COLOR_TRANSPARENT);
|
||||
dc.fillPolygon(rPts);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class BusStopView extends WatchUi.View {
|
||||
var stops = null;
|
||||
var app;
|
||||
var compass;
|
||||
|
||||
var offset = 0;
|
||||
var sensors;
|
||||
var position;
|
||||
|
||||
function intialize() {
|
||||
View.initialize();
|
||||
}
|
||||
|
||||
//! Load your resources here
|
||||
function onLayout(dc) {
|
||||
}
|
||||
|
||||
//! Called when this View is brought to the foreground. Restore
|
||||
//! the state of this View and prepare it to be shown. This includes
|
||||
//! loading resources into memory.
|
||||
function onShow() {
|
||||
tmr = new Timer.Timer();
|
||||
tmr.start(method(:redraw), 1000, true);
|
||||
}
|
||||
|
||||
//! Called when this View is removed from the screen. Save the
|
||||
//! state of this View here. This includes freeing resources from
|
||||
//! memory.
|
||||
function onHide() {
|
||||
tmr.stop();
|
||||
}
|
||||
|
||||
//! Update the view
|
||||
function onUpdate(dc) {
|
||||
var string;
|
||||
|
||||
// Set background color
|
||||
dc.setColor( Gfx.COLOR_TRANSPARENT, Gfx.COLOR_BLACK );
|
||||
dc.clear();
|
||||
dc.setColor( Gfx.COLOR_WHITE, Gfx.COLOR_TRANSPARENT );
|
||||
|
||||
if( schedule != null ) {
|
||||
var ts = new Time.Moment(schedule[1][4] / 1000);
|
||||
var duration = Time.now().subtract(ts);
|
||||
var ts_greg = Time.Gregorian.info(ts, Time.FORMAT_MEDIUM);
|
||||
var dur_greg = Time.Gregorian.info(new Time.Moment(duration.value()), Time.FORMAT_SHORT);
|
||||
|
||||
/* Timezone offset */
|
||||
dur_greg.hour -= 2;
|
||||
|
||||
var arr = Lang.format("$1$:$2$:$3$", [
|
||||
(ts_greg.hour - 2),
|
||||
(ts_greg.min).format("%02u"),
|
||||
(ts_greg.sec).format("%02u")
|
||||
]);
|
||||
|
||||
var due = "";
|
||||
if (dur_greg.hour > 0) {
|
||||
due += dur_greg.hour + " h ";
|
||||
}
|
||||
if (dur_greg.min > 0) {
|
||||
due += dur_greg.min + " min ";
|
||||
}
|
||||
if (dur_greg.sec > 0) {
|
||||
due += dur_greg.sec + " sec ";
|
||||
}
|
||||
|
||||
dc.drawText( (dc.getWidth() / 2), (dc.getHeight() / 2) - 80, Gfx.FONT_LARGE, schedule[1][2], Gfx.TEXT_JUSTIFY_CENTER );
|
||||
dc.drawText( (dc.getWidth() / 2), (dc.getHeight() / 2) - 40, Gfx.FONT_SMALL, schedule[1][1], Gfx.TEXT_JUSTIFY_CENTER );
|
||||
dc.drawText( (dc.getWidth() / 2), (dc.getHeight() / 2) - 20, Gfx.FONT_SMALL, schedule[1][3], Gfx.TEXT_JUSTIFY_CENTER );
|
||||
dc.drawText( (dc.getWidth() / 2), (dc.getHeight() / 2) + 10, Gfx.FONT_SMALL, arr, Gfx.TEXT_JUSTIFY_CENTER );
|
||||
dc.drawText( (dc.getWidth() / 2), (dc.getHeight() / 2) + 40, Gfx.FONT_SMALL, due, Gfx.TEXT_JUSTIFY_CENTER );
|
||||
}
|
||||
else {
|
||||
dc.drawText( (dc.getWidth() / 2), (dc.getHeight() / 2), Gfx.FONT_SMALL, "No schedule avail", Gfx.TEXT_JUSTIFY_CENTER );
|
||||
}
|
||||
}
|
||||
|
||||
function setPosition(info) {
|
||||
var url = "http://web.0l.de:8080/";
|
||||
var parameters = { "Circle" => info.position.toDegrees()[0] + "," +
|
||||
info.position.toDegrees()[1] + ",150",
|
||||
"ReturnList" => "StopPointName,DestinationName,LineName,EstimatedTime" };
|
||||
var options = { :method => Comm.HTTP_REQUEST_METHOD_GET };
|
||||
function initialize(a) {
|
||||
WatchUi.View.initialize();
|
||||
|
||||
Comm.makeJsonRequest(url, parameters, options, method(:requestCompleted));
|
||||
app = a;
|
||||
}
|
||||
|
||||
function onLayout(dc) {
|
||||
var compassX = dc.getWidth() / 2;
|
||||
var compassY = dc.getHeight() / 2 - 60;
|
||||
|
||||
compass = new CompassDrawable({
|
||||
:locX => compassX,
|
||||
:locY => compassY,
|
||||
:width => 11,
|
||||
:height => 11,
|
||||
:aWidth => 2,
|
||||
:aLength => 6,
|
||||
:aColor => Graphics.COLOR_DK_RED
|
||||
});
|
||||
}
|
||||
|
||||
function onShow() {
|
||||
Position.enableLocationEvents(Position.LOCATION_CONTINUOUS, method(:onPosition));
|
||||
|
||||
Sensor.setEnabledSensors([Sensor.SENSOR_HEARTRATE]);
|
||||
Sensor.enableSensorEvents(method(:onSensor));
|
||||
}
|
||||
|
||||
function onHide() {
|
||||
Position.enableLocationEvents(Position.LOCATION_DISABLE, method(:updateStops));
|
||||
}
|
||||
|
||||
function onPosition(positionInfo) {
|
||||
System.println("Position: " + positionInfo.position.toDegrees());
|
||||
|
||||
position = positionInfo;
|
||||
updateStops();
|
||||
}
|
||||
|
||||
function onSensor(sensorInfo) {
|
||||
System.println("Heading: " + 180.0 * Math.PI / sensorInfo.heading);
|
||||
|
||||
sensors = sensorInfo;
|
||||
requestUpdate();
|
||||
}
|
||||
|
||||
function onUpdate(dc) {
|
||||
// Set background color
|
||||
dc.setColor(Graphics.COLOR_TRANSPARENT, Graphics.COLOR_BLACK);
|
||||
dc.clear();
|
||||
|
||||
var midW = dc.getWidth() / 2;
|
||||
var midH = dc.getHeight() / 2;
|
||||
var top = Graphics.getFontAscent(Graphics.FONT_SMALL);
|
||||
|
||||
if (stops != null) {
|
||||
if (stops.size() > 0) {
|
||||
if (offset >= stops.size()) {
|
||||
offset = stops.size() - 1;
|
||||
}
|
||||
|
||||
var stop = stops[offset];
|
||||
|
||||
var dist = stop["dist"] < 1000
|
||||
? stop["dist"].format("%.0f") + " m"
|
||||
: (stop["dist"] / 1000).format("%.1f") + " km";
|
||||
|
||||
var bearing = stop["bearing"].format("%.0f") + "° (" + stop["bearing_str"] + ")";
|
||||
|
||||
var y = midH;
|
||||
|
||||
var bDeg = stop["bearing"];
|
||||
var hDeg = 180.0 * sensors.heading / Math.PI;
|
||||
|
||||
dc.setColor(Graphics.COLOR_RED, Graphics.COLOR_TRANSPARENT);
|
||||
dc.setPenWidth(4);
|
||||
dc.drawArc(midW, midH, midW-2, Graphics.ARC_CLOCKWISE, -bDeg+5+90, -bDeg-5+90);
|
||||
|
||||
dc.setColor(Graphics.COLOR_YELLOW, Graphics.COLOR_TRANSPARENT);
|
||||
dc.setPenWidth(4);
|
||||
dc.drawArc(midW, midH, midW-2, Graphics.ARC_CLOCKWISE, -hDeg+5, -hDeg-5);
|
||||
|
||||
compass.setBearing(bDeg);
|
||||
compass.draw(dc);
|
||||
|
||||
dc.setColor(Graphics.COLOR_WHITE, Graphics.COLOR_TRANSPARENT);
|
||||
dc.drawText(midW, y, Graphics.FONT_MEDIUM, stop["name"], Graphics.TEXT_JUSTIFY_CENTER + Graphics.TEXT_JUSTIFY_VCENTER);
|
||||
|
||||
y += dc.getFontAscent(Graphics.FONT_SMALL) + dc.getFontDescent(Graphics.FONT_MEDIUM);
|
||||
|
||||
if (stop["indicator"].length() > 0) {
|
||||
dc.setColor(Graphics.COLOR_WHITE, Graphics.COLOR_TRANSPARENT);
|
||||
dc.drawText(midW, y, Graphics.FONT_SMALL, stop["indicator"], Graphics.TEXT_JUSTIFY_CENTER + Graphics.TEXT_JUSTIFY_VCENTER);
|
||||
}
|
||||
|
||||
y += dc.getFontAscent(Graphics.FONT_TINY) + dc.getFontDescent(Graphics.FONT_SMALL);
|
||||
|
||||
dc.setColor(Graphics.COLOR_LT_GRAY, Graphics.COLOR_TRANSPARENT);
|
||||
dc.drawText(midW, y, Graphics.FONT_TINY, dist, Graphics.TEXT_JUSTIFY_CENTER);
|
||||
|
||||
y += dc.getFontAscent(Graphics.FONT_TINY) + dc.getFontDescent(Graphics.FONT_TINY);
|
||||
|
||||
dc.drawText(midW, y, Graphics.FONT_TINY, bearing, Graphics.TEXT_JUSTIFY_CENTER);
|
||||
|
||||
app.stopId = stop["id"];
|
||||
}
|
||||
else {
|
||||
dc.drawText(midW, midH, Graphics.FONT_SMALL, "No stops found!", Graphics.TEXT_JUSTIFY_CENTER);
|
||||
}
|
||||
}
|
||||
else {
|
||||
dc.drawText(midW, midH, Graphics.FONT_SMALL, "Loading...", Graphics.TEXT_JUSTIFY_CENTER);
|
||||
}
|
||||
}
|
||||
|
||||
function updateStops() {
|
||||
var degs = position.position.toDegrees();
|
||||
var params = {
|
||||
"latitude" => degs[0],
|
||||
"longitude" => degs[1],
|
||||
"distance" => 10000,
|
||||
"limit" => 50
|
||||
};
|
||||
|
||||
var options = {
|
||||
:method => Communications.HTTP_REQUEST_METHOD_GET,
|
||||
:responseType => Communications.HTTP_RESPONSE_CONTENT_TYPE_JSON
|
||||
};
|
||||
|
||||
Communications.makeWebRequest(app.api_url + "/stops", params, options, method(:requestCompleted));
|
||||
}
|
||||
|
||||
function requestCompleted(responseCode, data) {
|
||||
Sys.println("Request completed: " + responseCode);
|
||||
System.println("Request completed: " + responseCode);
|
||||
|
||||
if (responseCode == 200) {
|
||||
schedule = data;
|
||||
redraw();
|
||||
stops = data;
|
||||
WatchUi.requestUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
function redraw() {
|
||||
WatchUi.requestUpdate();
|
||||
}
|
||||
}
|
||||
|
|
36
connectiq/source/DepartureDelegate.mc
Normal file
36
connectiq/source/DepartureDelegate.mc
Normal file
|
@ -0,0 +1,36 @@
|
|||
using Toybox.WatchUi;
|
||||
|
||||
class DepartureDelegate extends WatchUi.BehaviorDelegate {
|
||||
var app;
|
||||
|
||||
function initialize(a) {
|
||||
WatchUi.BehaviorDelegate.initialize();
|
||||
|
||||
app = a;
|
||||
}
|
||||
|
||||
function onNextPage() {
|
||||
app.offset += 1;
|
||||
|
||||
WatchUi.requestUpdate();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function onPreviousPage() {
|
||||
if (app.offset > 0) {
|
||||
app.offset -= 1;
|
||||
|
||||
WatchUi.requestUpdate();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function onBack() {
|
||||
app.offset = 0;
|
||||
WatchUi.popView(WatchUi.SLIDE_RIGHT);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
84
connectiq/source/DepartureView.mc
Normal file
84
connectiq/source/DepartureView.mc
Normal file
|
@ -0,0 +1,84 @@
|
|||
using Toybox.WatchUi;
|
||||
using Toybox.Graphics;
|
||||
using Toybox.System;
|
||||
using Toybox.Communications;
|
||||
using Toybox.Timer;
|
||||
|
||||
class DepartureView extends WatchUi.View {
|
||||
var departures = null;
|
||||
var tmr;
|
||||
var app;
|
||||
|
||||
function initialize(a) {
|
||||
WatchUi.View.initialize();
|
||||
|
||||
app = a;
|
||||
|
||||
updateDepartures();
|
||||
}
|
||||
|
||||
function onLayout(dc) {
|
||||
|
||||
}
|
||||
|
||||
function onShow() {
|
||||
tmr = new Timer.Timer();
|
||||
tmr.start(method(:updateDepartures), 10000, true);
|
||||
}
|
||||
|
||||
|
||||
function onHide() {
|
||||
tmr.stop();
|
||||
}
|
||||
|
||||
function onUpdate(dc) {
|
||||
dc.setColor(Graphics.COLOR_TRANSPARENT, Graphics.COLOR_BLACK);
|
||||
dc.clear();
|
||||
dc.setColor(Graphics.COLOR_WHITE, Graphics.COLOR_TRANSPARENT);
|
||||
|
||||
var mid = dc.getWidth() / 2;
|
||||
var top = Graphics.getFontAscent(Graphics.FONT_SMALL);
|
||||
|
||||
if (departures != null) {
|
||||
if (departures.size() > 0) {
|
||||
for (var i = app.offset; i < departures.size(); i++) {
|
||||
var dep = departures[i];
|
||||
|
||||
dc.drawText(mid, top, Graphics.FONT_SMALL, dep["line"] + " " + dep["dest"], Graphics.TEXT_JUSTIFY_CENTER);
|
||||
top += Graphics.getFontAscent(Graphics.FONT_TINY);
|
||||
dc.drawText(mid, top, Graphics.FONT_XTINY, dep["delta_str"], Graphics.TEXT_JUSTIFY_CENTER);
|
||||
|
||||
top += Graphics.getFontHeight(Graphics.FONT_SMALL);
|
||||
}
|
||||
}
|
||||
else {
|
||||
dc.drawText( (dc.getWidth() / 2), (dc.getHeight() / 2), Graphics.FONT_SMALL, "No departures!", Graphics.TEXT_JUSTIFY_CENTER );
|
||||
}
|
||||
}
|
||||
else {
|
||||
dc.drawText( (dc.getWidth() / 2), (dc.getHeight() / 2), Graphics.FONT_SMALL, "Loading...", Graphics.TEXT_JUSTIFY_CENTER );
|
||||
}
|
||||
}
|
||||
|
||||
function updateDepartures() {
|
||||
var parameters = {
|
||||
"id" => app.stopId,
|
||||
"limit" => 10
|
||||
};
|
||||
var options = {
|
||||
:method => Communications.HTTP_REQUEST_METHOD_GET,
|
||||
:responseType => Communications.HTTP_RESPONSE_CONTENT_TYPE_JSON
|
||||
};
|
||||
|
||||
Communications.makeWebRequest(app.api_url + "/departures", parameters, options, method(:requestCompleted));
|
||||
}
|
||||
|
||||
function requestCompleted(responseCode, data) {
|
||||
System.println("Request completed: " + responseCode);
|
||||
|
||||
if (responseCode == 200) {
|
||||
departures = data;
|
||||
WatchUi.requestUpdate();
|
||||
}
|
||||
}
|
||||
}
|
8
rev-eng/script.sh
Normal file
8
rev-eng/script.sh
Normal file
|
@ -0,0 +1,8 @@
|
|||
API_BASE="http://ivu.aseag.de/interfaces/ura"
|
||||
|
||||
LOC="50.7802655,6.0752138,400"
|
||||
RL="StopPointName,StopID,StopPointState,StopPointIndicator,Latitude,Longitude,VisitNumber,TripID,VehicleID,LineID,LineName,DirectionID,DestinationName,DestinationText,EstimatedTime,BaseVersion"
|
||||
|
||||
# curl "${API_BASE}/location?searchString=*&maxResults=10000" | jq .
|
||||
|
||||
curl "${API_BASE}/instant_V1?Circle=${LOC}&StopPointState=0&ReturnList=${RL}"
|
Loading…
Add table
Reference in a new issue