diff options
author | Naoto Yamaguchi <naoto.yamaguchi@aisin.co.jp> | 2023-11-22 07:54:57 +0900 |
---|---|---|
committer | Naoto Yamaguchi <naoto.yamaguchi@aisin.co.jp> | 2023-11-26 20:12:00 +0900 |
commit | cbb63f0e45340f6dd2cc9f360ed4da15c745186f (patch) | |
tree | 471935b3ce3238f7bb402942ba8c530cf7892500 /GUIModel | |
parent | 5b7127cac34bf44a9d9e58c02b44939955d50890 (diff) |
Support for cluster api binding
Existing AGL Instrument Cluster is not implement cluster service
only a framework library. This task aim to support cluster service.
In 1st step, cluster-refgui will be controlled by cluster-service
demo signal.
This patch a part of this task.
Bug-AGL: SPEC-4991
Change-Id: I1dfdf3a6b9691f536bb96cd197feac89f4137540
Signed-off-by: Naoto Yamaguchi <naoto.yamaguchi@aisin.co.jp>
Diffstat (limited to 'GUIModel')
-rw-r--r-- | GUIModel/Header/Clock.qml | 12 | ||||
-rw-r--r-- | GUIModel/Header/Header.qml | 22 | ||||
-rw-r--r-- | GUIModel/Meter/Meter.qml | 66 | ||||
-rw-r--r-- | GUIModel/Meter/SpeedGuage.qml | 153 | ||||
-rw-r--r-- | GUIModel/main.qml | 227 |
5 files changed, 217 insertions, 263 deletions
diff --git a/GUIModel/Header/Clock.qml b/GUIModel/Header/Clock.qml index 9462049..a17205b 100644 --- a/GUIModel/Header/Clock.qml +++ b/GUIModel/Header/Clock.qml @@ -126,4 +126,16 @@ Item{ visible: false } } + + Timer { + interval: 500 + repeat: true + running: true + onTriggered: { + var date = new Date; + timeHour = date.getHours(); + timeMinute = date.getMinutes(); + } + } + } diff --git a/GUIModel/Header/Header.qml b/GUIModel/Header/Header.qml index 3c54765..e1ee62f 100644 --- a/GUIModel/Header/Header.qml +++ b/GUIModel/Header/Header.qml @@ -68,4 +68,26 @@ Item { visible: true } } + + function setTurnLOn() { + turn_l_on.visible = true; + turn_l_off.visible = false; + } + function setTurnLOff() { + turn_l_on.visible = false; + turn_l_off.visible = true; + } + + function setTurnROn() { + turn_r_on.visible = true; + turn_r_off.visible = false; + } + function setTurnROff() { + turn_r_on.visible = false; + turn_r_off.visible = true; + } + + function setTemp(temp_val) { + outsideTemperature.tempValue = temp_val; + } } diff --git a/GUIModel/Meter/Meter.qml b/GUIModel/Meter/Meter.qml index 1c7c0fe..7c2d5dd 100644 --- a/GUIModel/Meter/Meter.qml +++ b/GUIModel/Meter/Meter.qml @@ -40,9 +40,6 @@ Item { Item { id: meterParts property var easing: Easing.InOutQuad - Component.onCompleted: { - testAnim.start() - } Connections{ target: rootItem @@ -86,69 +83,6 @@ Item { DigitalSpeed { id: digitalSpeed } - - ParallelAnimation{ - id: testAnim - SequentialAnimation{ - id: testAnimSpeed - loops: Animation.Infinite - NumberAnimation { - target: meter - property: "speedValue" - duration: 1000 - easing.type: Easing.InOutQuad - to: 300 - } - NumberAnimation{ - duration: 5000 - } - - NumberAnimation { - target: meter - property: "speedValue" - duration: 5000 - easing.type: Easing.InOutQuad - to: 0 - } - } - - SequentialAnimation{ - id: testAnimTacho - loops: Animation.Infinite - NumberAnimation { - target: meter - property: "tachoValue" - duration: 500 - easing.type: Easing.InOutQuad - to: 8000 - } - NumberAnimation { - target: meter - property: "tachoValue" - duration: 2500 - easing.type: Easing.InOutQuad - to: 0 - } - } - SequentialAnimation{ - id: testAnimCharge - loops: Animation.Infinite - NumberAnimation { - target: meter - property: "chargeValue" - duration: 10000 - easing.type: Easing.Linear - to: 0 - } - NumberAnimation { - target: meter - property: "chargeValue" - duration: 10000 - easing.type: Easing.Linear - to: 100 - } - } - } } } diff --git a/GUIModel/Meter/SpeedGuage.qml b/GUIModel/Meter/SpeedGuage.qml index 056c00a..6667cad 100644 --- a/GUIModel/Meter/SpeedGuage.qml +++ b/GUIModel/Meter/SpeedGuage.qml @@ -114,157 +114,4 @@ Item { anchors.leftMargin: -11 anchors.verticalCenter: parent.verticalCenter } - - SequentialAnimation{ - id: normalToAdasAnimation - onStarted: rootItem.focus=false - ParallelAnimation{ - NumberAnimation{ - target: speedTxt - property: "opacity" - duration: 330 - easing.type: Easing.InOutSine - from:1.0 - to:0.5 - } - - SequentialAnimation{ - NumberAnimation{ - target: pwrGuageGroup - property: "opacity" - duration: 330 - easing.type: Easing.InOutSine - from:1.0 - to:0.0 - } - PropertyAnimation{ - target: pwrGuageGroup - property: "visible" - duration: 0 - easing.type: Easing.InOutSine - from:true - to:false - } - } - } - - ParallelAnimation{ - /* down size */ - NumberAnimation{ - target: speedGuage - property: "scale" - duration: 891 - easing.type: meterParts.easing - from:1 - to:0.75 - } - - /* translation */ - PathAnimation{ - target: speedGuage - anchorPoint: Qt.point(speedGuage.width/2, speedGuage.height/2) - orientation: PathAnimation.Fixed - duration: 891 - easing.type: meterParts.easing - - path: Path { - startX: 960; startY: 391 - PathLine { x: 540; y: 402 } - } - } - - SequentialAnimation{ - PauseAnimation { - duration: 891-330 - } - NumberAnimation{ - target: speedTxt - property: "opacity" - duration: 330 - easing.type: Easing.InOutSine - from:0.5 - to:1.0 - } - } - } - } - - SequentialAnimation{ - id: mapToNormalAnimation - onStarted: rootItem.focus=false - - PauseAnimation { - duration: 254 + 330 - } - - - ParallelAnimation{ - /* scaling */ - NumberAnimation{ - target: speedGuage - property: "scale" - duration: 891 - easing.type: meterParts.easing - from:0.75 - to:1.0 - } - - /* slide */ - PathAnimation{ - target: speedGuage - anchorPoint: Qt.point(speedGuage.width/2, speedGuage.height/2) - orientation: PathAnimation.Fixed - duration: 891 - easing.type: meterParts.easing - - path: Path { - startX: 540; startY: 402 - PathLine { x: 960; y: 391 } - } - } - - NumberAnimation{ - target: speedTxt - property: "opacity" - duration: 330 - easing.type: Easing.InOutSine - from:1.0 - to:0.5 - } - } - - ParallelAnimation{ - NumberAnimation{ - target: speedTxt - property: "opacity" - duration: 330 - easing.type: Easing.InOutSine - from:0.5 - to:1.0 - } - - SequentialAnimation{ - PropertyAnimation{ - target: pwrGuageGroup - property: "visible" - duration: 0 - easing.type: Easing.InOutSine - from:false - to:true - } - - NumberAnimation{ - target: pwrGuageGroup - property: "opacity" - duration: 330 - easing.type: Easing.InOutSine - from:0.0 - to:1.0 - } - } - } - PauseAnimation { - duration: 330 - } - } } diff --git a/GUIModel/main.qml b/GUIModel/main.qml index 5389797..8321bb3 100644 --- a/GUIModel/main.qml +++ b/GUIModel/main.qml @@ -133,7 +133,7 @@ Window { } CruisingRange { id: cruisingRange - cruisingRangeValue : 750 + cruisingRangeValue : 750.0 } Header{ @@ -251,9 +251,6 @@ Window { } } break - case(Qt.Key_4): - telltaleSwitching(); - break case(Qt.Key_Up): keyPressed_Up() @@ -281,11 +278,18 @@ Window { default: break - - } } + Timer { + property int num : 0 + interval: 10 + repeat: true + running: true + onTriggered: { + doUpdateClusterData() + } + } Timer { //test property int num : 0 @@ -315,44 +319,179 @@ Window { } } -// FpsItem{} - - function telltaleSwitching(){ - telltale.telltaleMasterWarn = !telltale.telltaleMasterWarn - telltale.telltaleGeneralWarn = !telltale.telltaleGeneralWarn - telltale.telltaleBrakeEnergyRecovOff = !telltale.telltaleBrakeEnergyRecovOff - telltale.telltaleBrakeEnergyRecovLv = !telltale.telltaleBrakeEnergyRecovLv - telltale.telltaleMotorWarn = !telltale.telltaleMotorWarn - telltale.telltalePopupHoodWarn = !telltale.telltalePopupHoodWarn - telltale.telltaleDecharge = !telltale.telltaleDecharge - telltale.telltaleEvSystemWarn = !telltale.telltaleEvSystemWarn - telltale.telltaleChargingPlugWarn = !telltale.telltaleChargingPlugWarn - telltale.telltaleLowBatt = !telltale.telltaleLowBatt - telltale.telltaleBattWarn = !telltale.telltaleBattWarn - telltale.telltaleBattTempWarn = !telltale.telltaleBattTempWarn - telltale.telltaleHighVoltBattCut = !telltale.telltaleHighVoltBattCut - telltale.telltaleAeb = !telltale.telltaleAeb - telltale.telltaleLdw = !telltale.telltaleLdw - telltale.telltaleBsd = !telltale.telltaleBsd - telltale.telltaleSrsAirbag = !telltale.telltaleSrsAirbag - telltale.telltaleEpsOff = !telltale.telltaleEpsOff - telltale.telltaleBrake = !telltale.telltaleBrake - telltale.telltaleAbsWarn = !telltale.telltaleAbsWarn - telltale.telltaleEspAct = !telltale.telltaleEspAct - telltale.telltaleHillDescent = !telltale.telltaleHillDescent - telltale.telltaleAutoParking = !telltale.telltaleAutoParking - telltale.telltaleTpmsInd = !telltale.telltaleTpmsInd - telltale.telltaleImmobi = !telltale.telltaleImmobi - telltale.telltaleDoor = !telltale.telltaleDoor - telltale.telltaleSeatbelt = !telltale.telltaleSeatbelt - telltale.telltaleSeatbelt2 = !telltale.telltaleSeatbelt2 - telltale.telltaleEpbWarn = !telltale.telltaleEpbWarn - telltale.telltaleEps= !telltale.telltaleEps - telltale.telltaleHighbeamAssist = !telltale.telltaleHighbeamAssist - telltale.telltaleHighbeam = !telltale.telltaleHighbeam - telltale.telltaleRearFog = !telltale.telltaleRearFog - telltale.telltaleLowbeam = !telltale.telltaleLowbeam - telltale.telltalePosition = !telltale.telltalePosition + //FpsItem{} + + function doUpdateClusterData(){ + // speed + var speed_val_capi = cluster_service.getSpAnalogVal(); + meter.speedValue = speed_val_capi / 100.0; + + // tacho + var tacho_val_capi = cluster_service.getTaAnalogVal(); + meter.tachoValue = tacho_val_capi; + + // temp + var temp_val_capi = cluster_service.getOTempVal(); + header.setTemp(temp_val_capi); + + // Gear + var gear_val_capi = cluster_service.getGearAtVal(); + if (gear_val_capi === "D") { + shiftPosition.shiftId = 1; + } else if (gear_val_capi === "B") { + shiftPosition.shiftId = 2; + } else if (gear_val_capi === "N") { + shiftPosition.shiftId = 3; + } else if (gear_val_capi === "R") { + shiftPosition.shiftId = 4; + } else if (gear_val_capi === "P") { + shiftPosition.shiftId = 5; + } else { + shiftPosition.shiftId = 0; + } + + // Trip + //var tripa_val_capi = cluster_service.getTrcomTripAVal(); + //cruisingRange.cruisingRangeValue = tripa_val_capi / 10; + + // Turn R + var turnr_val_capi = cluster_service.getTurnR(); + if (turnr_val_capi === true) { + header.setTurnROn(); + } else { + header.setTurnROff(); + } + + // Turn L + var turnl_val_capi = cluster_service.getTurnL(); + if (turnl_val_capi === true) { + header.setTurnLOn(); + } else { + header.setTurnLOff(); + } + + // Seetbelt + var sbeltr_val_capi = cluster_service.getFrontRightSeatbelt(); + if (sbeltr_val_capi === true) { + telltale.telltaleSeatbelt = true; + } else { + telltale.telltaleSeatbelt = false; + } + var sbeltl_val_capi = cluster_service.getFrontLeftSeatbelt(); + if (sbeltl_val_capi === true) { + telltale.telltaleSeatbelt2 = true; + } else { + telltale.telltaleSeatbelt2 = false; + } + + var genwarn_val_capi = cluster_service.getGeneralWarn(); + if (genwarn_val_capi === true) { + telltale.telltaleGeneralWarn = true; + } else { + telltale.telltaleGeneralWarn = false; + } + + var eng_val_capi = cluster_service.getEngine(); + if (eng_val_capi === true) { + telltale.telltaleMotorWarn = true; + } else { + telltale.telltaleMotorWarn = false; + } + + var lbatt_val_capi = cluster_service.getLowBattery(); + if (lbatt_val_capi === true) { + telltale.telltaleLowBatt = true; + } else { + telltale.telltaleLowBatt = false; + } + + var ldwoff_val_capi = cluster_service.getLdwOff(); + if (ldwoff_val_capi === true) { + telltale.telltaleLdw = true; + } else { + telltale.telltaleLdw = false; + } + + var srsair_val_capi = cluster_service.getSrsAirbag(); + if (srsair_val_capi === true) { + telltale.telltaleSrsAirbag = true; + } else { + telltale.telltaleSrsAirbag = false; + } + + var espoff_val_capi = cluster_service.getEspOff(); + if (espoff_val_capi === true) { + telltale.telltaleEpsOff = true; + } else { + telltale.telltaleEpsOff = false; + } + + var brake_val_capi = cluster_service.getBrake(); + if (brake_val_capi === true) { + telltale.telltaleBrake = true; + } else { + telltale.telltaleBrake = false; + } + + var abs_val_capi = cluster_service.getAbs(); + if (abs_val_capi === true) { + telltale.telltaleAbsWarn = true; + } else { + telltale.telltaleAbsWarn = false; + } + + var espact_val_capi = cluster_service.getEspAct(); + if (espact_val_capi === true) { + telltale.telltaleEspAct = true; + } else { + telltale.telltaleEspAct = false; + } + + var hill_val_capi = cluster_service.getHillDescent(); + if (hill_val_capi === true) { + telltale.telltaleHillDescent = true; + } else { + telltale.telltaleHillDescent = false; + } + + var immobi_val_capi = cluster_service.getImmobi(); + if (immobi_val_capi === true) { + telltale.telltaleImmobi = true; + } else { + telltale.telltaleImmobi = false; + } + + var door_val_capi = cluster_service.getDoor(); + if (door_val_capi === true) { + telltale.telltaleDoor = true; + } else { + telltale.telltaleDoor = false; + } + + var eps_val_capi = cluster_service.getEps(); + if (eps_val_capi === true) { + telltale.telltaleEps = true; + } else { + telltale.telltaleEps = false; + } + + var hibeamgreen_val_capi = cluster_service.getAutoHiBeamGreen(); + var hibeam_val_capi = cluster_service.getHighbeam(); + if (hibeamgreen_val_capi === true) { + telltale.telltaleHighbeamAssist = true; + + if (hibeam_val_capi === true) { + telltale.telltaleHighbeam = true; + telltale.telltaleLowbeam = false; + } else { + telltale.telltaleHighbeam = false; + telltale.telltaleLowbeam = true; + } + } else { + telltale.telltaleHighbeamAssist = false; + telltale.telltaleHighbeam = false; + telltale.telltaleLowbeam = false; + } } } |