From 5152029a53706ef41749615fafedc1409d18365d Mon Sep 17 00:00:00 2001 From: Fridtjof Petersen Date: Wed, 8 Nov 2023 21:30:50 +0100 Subject: [PATCH] fixed bug with reopening JASP files - previously the selected prediction models disappeared in-between saves and reopening of the jasp file - by calculating the available/possible models in an invisible availableVariableList, and then using this as a source for another variable list, the models stay selected - i also added months to the periodical prediction --- inst/qml/predictiveAnalytics.qml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/inst/qml/predictiveAnalytics.qml b/inst/qml/predictiveAnalytics.qml index 17f1c87..48f6c23 100644 --- a/inst/qml/predictiveAnalytics.qml +++ b/inst/qml/predictiveAnalytics.qml @@ -378,9 +378,14 @@ Form VariablesForm { + // this function dynamically selects the available models based on users input + // due to some bug however, the values can't be directly selected as they dissapear in between saves + // instead the values are computed, hidden and then used as input for another AvailableVariables List + visible: false AvailableVariablesList { - name:"availableModels" + name:"availableModelsHidden" + // at the current moment, the user can choose models from a variety of predefined models // some of these models contain a regressive component or lagged values // but they only work if the user provided covariates or created some in the feature engineering section @@ -426,6 +431,18 @@ Form } source: getAvailableModels() } + } + + VariablesForm + { + // this function dynamically selects the available models based on users input + // due to some bug however, the values can't be directly selected as they dissapear in between saves + // instead the values are computed, hidden and then used as input for another AvailableVariables List + AvailableVariablesList + { + name: "availableModels" + source: "availableModelsHidden" + } AssignedVariablesList { name: "selectedModels" @@ -672,6 +689,7 @@ Form { label: qsTr("Hours"), value: "hours" }, { label: qsTr("Days"), value: "days" }, { label: qsTr("Weeks"), value: "weeks" }, + { label: qsTr("Months"), value: "months" }, { label: qsTr("Years"), value: "years" } ] }