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/main.qml | |
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/main.qml')
-rw-r--r-- | GUIModel/main.qml | 227 |
1 files changed, 183 insertions, 44 deletions
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; + } } } |