Skip to content

Commit

Permalink
Merge pull request #34 from Cambio-Project/allow-monitoring-refinements
Browse files Browse the repository at this point in the history
Allow monitoring refinements
  • Loading branch information
franksn90 authored May 29, 2024
2 parents 4e16493 + 3801f67 commit 0cbc113
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 15 deletions.
6 changes: 4 additions & 2 deletions components/Scenario.vue
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,8 @@ export default {
<li v-for="(response, index) in scenario.responses" :key="response" class="left container-row">
<div>
<UTooltip text="Please verify before Refinement!">
<button @click="toRefinement(scenario.simulationID, index)" class="refine-button">Refine
<button @click="toRefinement(scenario.simulationID, index, '_combined.csv', true)"
class="refine-button">Refine
Response
</button>
</UTooltip>
Expand Down Expand Up @@ -352,7 +353,8 @@ export default {
<li v-for="(response, index) in scenario.responses" :key="response" class="left container-row">
<div>
<UTooltip text="Please verify before Refinement!">
<button @click="toRefinement(scenario.simulationID, index)" class="refine-button">Refine
<button @click="toRefinement(scenario.simulationID, index, resultName, false)"
class="refine-button">Refine
Response
</button>
</UTooltip>
Expand Down
8 changes: 4 additions & 4 deletions composables/navigation.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export function toScenarioEditor(simulationID, router = this.$router ) {
export function toScenarioEditor(simulationID, router = this.$router) {
router.push('/scenarioEditorSite?simID=' + simulationID);
}

Expand All @@ -10,12 +10,12 @@ export function toPSPWizardStimulus(simulationID, router = this.$router) {
router.push('/pspwizardSite?simID=' + simulationID + '&type=stimulus');
}

export function toScenariosOverview(router = this.$router){
export function toScenariosOverview(router = this.$router) {
router.push('/scenariosSite');
}

export function toRefinement(simID, responseIndex, router = this.$router) {
router.push('/tqPropRefinerSiteDynamic?sim_id=' + simID + '&response_index=' + responseIndex);
export function toRefinement(simID, responseIndex, file, isSimulation, router = this.$router) {
router.push('/tqPropRefinerSiteDynamic?sim_id=' + simID + '&response_index=' + responseIndex + '&file=' + file + '&isSimulation=' + isSimulation);
}

export async function toScenarioDetails(simulationID, router = this.$router) {
Expand Down
5 changes: 3 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ services:
pull_policy: always

tqproprefiner:
image: ghcr.io/cambio-project/transient-behavior-requirement-refiner:1.0.0
image: ghcr.io/cambio-project/transient-behavior-requirement-refiner:1.0.1
container_name: tqproprefiner
ports:
- 8082:80
Expand All @@ -34,6 +34,7 @@ services:
pull_policy: always
volumes:
- ./data/simulations_results:/usr/share/nginx/html/assets/simulations_results
- ./data/search_results:/usr/share/nginx/html/assets/search_results

tbverifier:
image: ghcr.io/cambio-project/transient-behavior-verifier:1.0.2
Expand All @@ -59,7 +60,7 @@ services:
- ./data/simulations_results:/simulations_results

mosim:
image: ghcr.io/cambio-project/mosim:0.3.1
image: ghcr.io/cambio-project/mosim:0.3.2
container_name: mosim
ports:
- 8087:8080
Expand Down
26 changes: 19 additions & 7 deletions pages/tqPropRefinerSiteDynamic.vue
Original file line number Diff line number Diff line change
@@ -1,15 +1,27 @@
<script setup lang="ts">
const simulationDirectoryName = "simulations_results"
const searchDirectoryName = "search_results"
const config = useRuntimeConfig()
const route = useRoute();
const simId = route.query.sim_id;
const isSimulation = route.query.isSimulation;
const file = route.query.file;
let srcDirectory: string
if (isSimulation === "true") {
srcDirectory = simulationDirectoryName
} else {
srcDirectory = searchDirectoryName
}
const res = await fetch("/api/getScenario", {
method: "POST",
body: JSON.stringify({
simulationID: simId
})
method: "POST",
body: JSON.stringify({
simulationID: simId
})
})
const body = await res.json()
const scenario = body.Scenario;
Expand All @@ -21,13 +33,13 @@ const sel = response.SEL;
const tbvTimed = response.TBV_timed;
const predicates = JSON.stringify(response.predicates_info);
const src = computed(() => "http://"+config.public.tqPropRefinerDomain+":"+config.public.tqPropRefinerPort+"/requirement-refinement/dynamic?file-address=assets/simulations_results&sim_id="+simId+"&response_index="+responseIndex+"&sel="+sel+"&tbv_timed="+tbvTimed+"&predicates="+predicates)
const src = computed(() => "http://" + config.public.tqPropRefinerDomain + ":" + config.public.tqPropRefinerPort + "/requirement-refinement/dynamic?file-address=assets/" + srcDirectory + "/" + simId + "&file=" + file + "&sim_id=" + simId + "&response_index=" + responseIndex + "&sel=" + sel + "&tbv_timed=" + tbvTimed + "&predicates=" + predicates)
</script>

<template>

<!-- TODO add button style -->
<!-- TODO add button style -->
<h1 class="text-3xl">Refinement</h1>
<br>

Expand All @@ -44,7 +56,7 @@ const src = computed(() => "http://"+config.public.tqPropRefinerDomain+":"+confi
</template>

<style scoped>
.mainFrame{
.mainFrame {
width: 80%;
height: 80vh;
border: #3f51b5 3px solid;
Expand Down

0 comments on commit 0cbc113

Please sign in to comment.