summaryrefslogtreecommitdiff
path: root/src/components/qt_hmi/qml_model_qt5/models
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/qt_hmi/qml_model_qt5/models')
-rw-r--r--src/components/qt_hmi/qml_model_qt5/models/DataStorage.qml3
-rw-r--r--src/components/qt_hmi/qml_model_qt5/models/MediaClockModel.qml37
2 files changed, 17 insertions, 23 deletions
diff --git a/src/components/qt_hmi/qml_model_qt5/models/DataStorage.qml b/src/components/qt_hmi/qml_model_qt5/models/DataStorage.qml
index 659a8eabd7..e3785bdf19 100644
--- a/src/components/qt_hmi/qml_model_qt5/models/DataStorage.qml
+++ b/src/components/qt_hmi/qml_model_qt5/models/DataStorage.qml
@@ -442,7 +442,8 @@ QtObject {
property ListModel deviceList: ListModel { }
property ListModel applicationList: ListModel { }
property ListModel stashedApplicationsList: ListModel { }
- property ListModel vrCommands: ListModel {}
+ property ListModel vrCommands: ListModel { }
+ property ListModel choicesVrCommands: ListModel { }
function reset () {
console.log("dataContainer reset enter");
diff --git a/src/components/qt_hmi/qml_model_qt5/models/MediaClockModel.qml b/src/components/qt_hmi/qml_model_qt5/models/MediaClockModel.qml
index cae82c36f1..3712ca4c31 100644
--- a/src/components/qt_hmi/qml_model_qt5/models/MediaClockModel.qml
+++ b/src/components/qt_hmi/qml_model_qt5/models/MediaClockModel.qml
@@ -73,28 +73,22 @@ QtObject {
function onTimer () {
switch (updateMode) {
case Internal.MediaClockUpdateMode.MCU_COUNTUP:
- if (endTime !== -1) {
- if (startTime < endTime) {
- startTime++
- } else {
- timer.stop()
- runningMode = Internal.MediaClockRunningMode.MCR_STOPPED
- console.debug("count Up timer stopped")
- }
+ console.debug("count up")
+ if (startTime < endTime) {
+ startTime++
} else {
- if (startTime < upperTimeLimit) {
- startTime++
- } else {
- startTime = 0
- }
+ timer.stop()
+ runningMode = Internal.MediaClockRunningMode.MCR_STOPPED
+ console.debug("count Up timer stopped")
}
break
case Internal.MediaClockUpdateMode.MCU_COUNTDOWN:
console.debug("count down")
- if (--startTime === 0) {
+ if (startTime > endTime) {
+ startTime--
+ } else {
timer.stop()
runningMode = Internal.MediaClockRunningMode.MCR_STOPPED
- startTime = endTime = -1
console.debug("count Down timer stopped")
}
break
@@ -112,13 +106,12 @@ QtObject {
function onProgress () {
if (startTime === -1) {
progress = 0
- } else {
- if (updateMode === Internal.MediaClockUpdateMode.MCU_COUNTUP) {
- progress = (endTime !== -1) ? (startTime / endTime) : (startTime / upperTimeLimit)
- } else {
- progress = (endTime !== -1) ? ( (startTime - endTime) / (startTimeForProgress - endTime) )
- : (startTime / startTimeForProgress)
- }
+ }
+ else if (endTime != -1 && endTime === startTimeForProgress) {
+ progress = 1
+ }
+ else {
+ progress = (startTime - startTimeForProgress) / (endTime - startTimeForProgress)
}
}
}