summaryrefslogtreecommitdiffstats
path: root/app/Shift.qml
diff options
context:
space:
mode:
authorzheng_wenlong <wenlong_zheng@nexty-ele.com>2019-02-06 13:51:09 +0900
committerzheng_wenlong <wenlong_zheng@nexty-ele.com>2019-02-06 13:53:35 +0900
commit95b45c40f7db39d4a9a0ceb2995b976b0f2792e4 (patch)
tree6d3684d394b5cc74898ccfa811f6434f639d101c /app/Shift.qml
parenta35b3631420ac051a1b50a00806ee29900f03250 (diff)
Change als-meter-demo by using low-can data. For m3ulcb/h3ulcb board, the usb camera device id is over 10, Detect the camera device from 0 to 19. Change-Id: Icbd0b4327c9c356f40cea320420d149d850e4347 Signed-off-by: zheng_wenlong <wenlong_zheng@nexty-ele.com>
Diffstat (limited to 'app/Shift.qml')
-rw-r--r--app/Shift.qml9
1 files changed, 5 insertions, 4 deletions
diff --git a/app/Shift.qml b/app/Shift.qml
index 60a0f0f..7d2d017 100644
--- a/app/Shift.qml
+++ b/app/Shift.qml
@@ -21,7 +21,8 @@ import QtWebSockets 1.0
Row {
property real percent: 1
property var carshift: [
- "images/meters/tacho_shift_N.svg", "images/meters/tacho_shift_D.svg"
+ "images/meters/tacho_shift_N.svg", "images/meters/tacho_shift_D.svg",
+ "images/meters/tacho_shift_P.svg", "images/meters/tacho_shift_R.svg"
]
property var wheelshift: [
@@ -36,16 +37,16 @@ Row {
fillMode: Image.PreserveAspectFit
smooth: true
asynchronous: true
- source: wshift === 0 ? carshift[0] : carshift[1]
+ source: wshift == "N" ? carshift[0] : ( wshift == "P" ? carshift[2] : ( wshift == "R" ? carshift[3] : carshift[1]))
}
Image {
- visible: wshift > 0
+ visible: (wshift == "D1" || wshift == "D2"||wshift == "D3"||wshift == "D4"||wshift == "D5"||wshift == "D6")
width: percent*sourceSize.width
height: percent*sourceSize.height
fillMode: Image.PreserveAspectFit
smooth: true
asynchronous: true
- source: (wshift > 0 && wshift <= wheelshift.length) ? wheelshift[wshift-1] : wheelshift[0]
+ source: (wshift == "D1") ? wheelshift[0] : ((wshift == "D2") ? wheelshift[1] : ((wshift == "D3") ? wheelshift[2] : ((wshift == "D4") ? wheelshift[3] : ((wshift == "D5") ? wheelshift[4] : wheelshift[5] ))))
}
}