Browse Source

first checkin of Code

git-svn-id: svn://svn.siningsoft.de/myCar@1 4258477e-9397-4ceb-bd8a-6305f6291781
devnull 7 years ago
commit
9944842785

+ 10 - 0
doc/Install.txt

@@ -0,0 +1,10 @@
+myCar OS:
+
+python3
+virtualenv
+sudo apt-get install python-gi python3-dbus libdbus-1-dev libdbus-glib-1-dev
+
+myCar virtualenv:
+
+Flask
+bluew

BIN
doc/favicon.ico


BIN
doc/icons.jpeg


BIN
doc/parking.png


BIN
doc/parking.xcf


+ 26 - 0
myCar.py

@@ -0,0 +1,26 @@
+#!/usr/bin/python3
+
+from flask import Flask
+from flask import url_for
+from flask import render_template
+app = Flask(__name__)
+
+
+@app.route('/')
+def myCar_root():
+    return 'myCar project Page'
+
+@app.route('/bluetooth/controller')
+def myCar_bluetooth_controller():
+    # this method will return available bluetooth devices as a list for the web template output
+    import bluew
+    #return len(bluew.controllers())
+    return render_template('bluetooth/controller.html', bt_ctrl=bluew.controllers())
+
+@app.route('/bluetooth/devices')
+def myCar_bluetooth_devices():
+    # this method will return available bluetooth devices as a list for the web template output
+    import bluew
+    #return len(bluew.controllers())
+    return render_template('bluetooth/devices.html', bt_dev=bluew.devices())
+

BIN
static/favicon.ico


BIN
static/nok.png


BIN
static/ok.png


BIN
static/wireless.png


+ 22 - 0
templates/base.html

@@ -0,0 +1,22 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    <title>myCar</title>
+    <link rel="shortcut icon" href="{{ url_for('static', filename='favicon.ico') }}"/>  
+  </head>
+  <body>
+    <h1> myCar Basis Template </h1>
+    <hr><br>
+
+    <div id="content">{% block content %}{% endblock %}</div>
+    <div id="footer">
+        <br>
+        {% block footer %}
+             <a href="https://wiki.siningsoft.de/id=mycar:intro">wiki.siningsoft.de</a>.
+        {% endblock %}
+    </div>
+  </body>
+</html>

+ 13 - 0
templates/bluetooth/controller.html

@@ -0,0 +1,13 @@
+{% extends 'base.html' %}
+{% block content %}
+    <table>
+    <tr>
+        <th>ID</th><th>powered</th><th>Alias</th><th>MAC Address</th>
+    </tr>
+    {% for ctrl in bt_ctrl %}
+        <tr>
+            <td>{{ loop.index }}</td><td>{{ ctrl.Powered }}</td><td>{{ ctrl.Alias }}</td><td>{{ ctrl.Address }}</td>
+        </tr>
+    {% endfor %}
+    </table>
+{% endblock %}

+ 17 - 0
templates/bluetooth/devices.html

@@ -0,0 +1,17 @@
+{% extends 'base.html' %}
+{% block content %}
+    <table>
+    <tr>
+        <th>ID</th><th>Alias</th><th>MAC Address</th><th>RSSI</th>
+    </tr>
+    {% for dev in bt_dev %}
+        <tr>
+            <td>{{ loop.index }}</td><td>{{ dev.Alias }}</td><td>{{ dev.Address }}</td><td>{{dev.RSSI}}</td><td>{% if dev.RSSI == None %}
+                    <img src='{{ url_for('static', filename='nok.png') }}' width='30px' height='30px'>
+                {% else %}
+                    <img src='{{ url_for('static', filename='wireless.png') }}' width='30px' height='30px'>
+                {% endif %}</td>
+        </tr>
+    {% endfor %}
+    </table>
+{% endblock %}

+ 2 - 0
templates/foot.html

@@ -0,0 +1,2 @@
+    </body>
+</html>