From 80f5780537c7ef2fbc64725320f0f25f400992dd Mon Sep 17 00:00:00 2001 From: franksn90 Date: Mon, 6 May 2024 14:27:32 +0200 Subject: [PATCH 1/5] Add specifying MTL Stimuli --- components/PSPWizard.vue | 15 ++++++++++++- components/ScenarioEditor.vue | 41 ++++++++++++++++++++++++++++++++++- components/Scenarios.vue | 41 +++++++++++++++++++++++++++++++++++ 3 files changed, 95 insertions(+), 2 deletions(-) diff --git a/components/PSPWizard.vue b/components/PSPWizard.vue index 527eacd..789ad5b 100644 --- a/components/PSPWizard.vue +++ b/components/PSPWizard.vue @@ -232,6 +232,7 @@ export default { } } **/], simID: this.$route.query.simID, + type: this.$route.query.type, customPredicateName: "", customPredicateLogic: "", customMeasurementSource: "", @@ -997,11 +998,23 @@ export default { }); responseObject.predicates_info = eventArray; + var type + switch(this.type) { + case 'response': + type = "responses" + break; + case 'stimulus': + type = "stimuli" + break; + default: + console.log("Unknown type: " + this.type) + } + const res = await fetch("/api/pushScenarioField", { method: "POST", body: JSON.stringify({ simulationID: this.simID, - fieldName: "responses", + fieldName: type, fieldValue: responseObject }) }) diff --git a/components/ScenarioEditor.vue b/components/ScenarioEditor.vue index ee68256..2c56022 100644 --- a/components/ScenarioEditor.vue +++ b/components/ScenarioEditor.vue @@ -76,7 +76,10 @@ export default { }, // create response with pspwizard openPSPResponse() { - this.$router.push('/pspwizardSite?simID=' + this.simID); + this.$router.push('/pspwizardSite?simID=' + this.simID + '&type=response'); + }, + openPSPStimulus() { + this.$router.push('/pspwizardSite?simID=' + this.simID + '&type=stimulus'); }, // remove stimulus removeStimulus(index) { @@ -423,7 +426,43 @@ const domain = "http://" + config.public.miSimDomain + ":" + config.public.miSim

Stimuli:

+
  • + {{ index + 1 }}. + + + + {{ stimulus.SEL }} + + + {{ stimulus.LTL }} + + + {{ stimulus.MTL }} + + + {{ stimulus.Prism }} + + + {{ stimulus.Quantitative_Prism }} + + + {{ stimulus.TBV_untimed }} + + + {{ stimulus.TBV_timed }} + + + +
    + SEL: {{ stimulus.SEL }}

    + +
  • + Add Stimulus
    diff --git a/components/Scenarios.vue b/components/Scenarios.vue index 0ddd83a..7ffad36 100644 --- a/components/Scenarios.vue +++ b/components/Scenarios.vue @@ -163,6 +163,9 @@ export default { scenario.responses.forEach(response => { response.target_logic = this.target; }) + scenario.stimuli.forEach(stimulus => { + stimulus.target_logic = this.target; + }) }); }, //Download a single scenario as json @@ -304,6 +307,44 @@ export default {

    Stimuli:

    + + +
  • + {{ index + 1 }}. + + + {{ stimulus.SEL }} + + + {{ stimulus.LTL }} + + + {{ stimulus.MTL }} + + + {{ stimulus.Prism }} + + + {{ stimulus.Quantitative_Prism }} + + + {{ stimulus.TBV_untimed }} + + + {{ stimulus.TBV_timed }} + + +
    + SEL: {{ stimulus.SEL }} +

    +
    +
  • +
    +
    From 1d97fe93c27556fee7977407fd2ac3e00d17c68d Mon Sep 17 00:00:00 2001 From: franksn90 Date: Wed, 8 May 2024 11:07:47 +0200 Subject: [PATCH 2/5] Add improvised command and listener fields to stimulus specification --- components/PSPWizard.vue | 1315 +++++++++++++++++++++++-------- server/api/allCommands.ts | 14 + server/api/allListeners.ts | 14 + server/api/changeCommand.ts | 21 + server/api/changeListener.ts | 21 + server/api/deleteCommand.ts | 19 + server/api/deleteListener.ts | 19 + server/api/saveCommand.ts | 19 + server/api/saveListener.ts | 19 + server/models/command.model.ts | 9 + server/models/listener.model.ts | 9 + 11 files changed, 1169 insertions(+), 310 deletions(-) create mode 100644 server/api/allCommands.ts create mode 100644 server/api/allListeners.ts create mode 100644 server/api/changeCommand.ts create mode 100644 server/api/changeListener.ts create mode 100644 server/api/deleteCommand.ts create mode 100644 server/api/deleteListener.ts create mode 100644 server/api/saveCommand.ts create mode 100644 server/api/saveListener.ts create mode 100644 server/models/command.model.ts create mode 100644 server/models/listener.model.ts diff --git a/components/PSPWizard.vue b/components/PSPWizard.vue index 789ad5b..11b1b57 100644 --- a/components/PSPWizard.vue +++ b/components/PSPWizard.vue @@ -1,199 +1,4 @@