Sync repository
[mardrone] / mardrone / gauges / GenericGauge.qml
diff --git a/mardrone/gauges/GenericGauge.qml b/mardrone/gauges/GenericGauge.qml
new file mode 100644 (file)
index 0000000..8a8c74e
--- /dev/null
@@ -0,0 +1,34 @@
+
+import QtQuick 1.0
+
+Item {
+    id: root
+    property real value : 0
+    property real startAngle:0
+    property real endAngle:300
+    property maxValue:100
+    property url gaugeBackground:"joybox.png"
+    property url gaugeForeground:"joybox.png"
+    property url gaugeNeedle:"needle1.png"
+    property url bezel:""
+
+    Image {
+        anchors.fill:parent
+        source: gaugeBackground
+    }
+
+    Image {
+        id: needle
+        x: (root.width/2)-(width/2); y:(root.width/2)
+        transformOrigin: Item.Top
+        scale: root.width / 300
+        rotation: startAngle+root.value*0.36
+        smooth: true
+        source: gaugeNeedle
+
+    Image {
+        anchors.fill:parent
+        source: gaugeForeground
+    }
+
+}