Skip to content

Commit

Permalink
Merge pull request #29 from Cambio-Project/mosim-0.3.0-integration
Browse files Browse the repository at this point in the history
MoSIM 0.3 Integration
  • Loading branch information
franksn90 authored May 11, 2024
2 parents 289d512 + 3b64900 commit ad6bc48
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 2 deletions.
17 changes: 17 additions & 0 deletions components/ScenarioEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export default {
environmentLoad: null,
environmentMonitoringData: null,
responses: null,
searchWindowSize: null,
importErrorMessage: null,
componentKey: 0,
Expand Down Expand Up @@ -66,6 +67,9 @@ export default {
if (typeof body.Scenario.environment.monitoringData !== "undefined") {
this.environmentMonitoringData = body.Scenario.environment.monitoringData
}
if (typeof body.Scenario.searchWindowSize !== "undefined"){
this.searchWindowSize = body.Scenario.searchWindowSize
}
if (typeof body.Scenario.responses !== "undefined") {
this.responses = body.Scenario.responses
}
Expand Down Expand Up @@ -227,6 +231,12 @@ export default {
this.setValue("description", this.description)
}
// search window size
if (jsonData.searchWindowSize != null) {
this.searchWindowSize = jsonData.searchWindowSize;
this.setValue("searchWindowSize", this.searchWindowSize)
}
// stimuli
this.stimuli = []
if (jsonData.stimuli != null) {
Expand Down Expand Up @@ -312,6 +322,7 @@ export default {
this.environmentExperiment = null
this.environmentLoad = null
this.environmentMonitoringData = null
this.searchWindowSize = null
this.responses = null
this.showTooltip = false
},
Expand Down Expand Up @@ -357,6 +368,9 @@ export default {
description(newDescription) {
this.addValue("description", newDescription)
},
searchWindowSize(newSearchWindowSize){
this.addValue("searchWindowSize", newSearchWindowSize)
}
},
}
Expand Down Expand Up @@ -503,6 +517,9 @@ const domain = "http://" + config.public.miSimDomain + ":" + config.public.miSim
</li>
</ul>

<textarea v-model="searchWindowSize" type="text" placeholder="Enter Search Window Size"
class="larger-text-field p-1 border-2 rounded-xl"/>

</div>

<div class="message-container">
Expand Down
4 changes: 4 additions & 0 deletions components/Scenarios.vue
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,10 @@ export default {
- Monitoring Data: <i>{{ Object.keys(monitoringData)[0] }}</i>
</li>
</ul>
<div class="left mb-8">
- Search Window Size: {{ scenario.searchWindowSize }}
</div>

</div>

<h4 class="left text-mb font-bold mb-1">
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ services:
- ./data/simulations_results:/simulations_results

mosim:
image: ghcr.io/cambio-project/mosim:0.2.0
image: ghcr.io/cambio-project/mosim:0.3.0
container_name: mosim
ports:
- 8087:8080
Expand Down
1 change: 1 addition & 0 deletions server/api/startSearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export default defineEventHandler(async (event) => {
await exportStimuli(formData, "mtls", scenario)

formData.append("simulation_id", simulationID)
formData.append("search_window_size", scenario!.searchWindowSize!)
const config = useRuntimeConfig(event)
const moSimResponse = await fetch("http://" + config.public.moSimDomain + ":" + config.public.moSimPort + "/search/upload", {
method: "POST",
Expand Down
3 changes: 2 additions & 1 deletion server/models/scenario.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ const ScenarioSchema = new Schema({
architecture: [{}],
experiment: [{}],
load: [{}],
monitoringData: [{}]
monitoringData: [{}],
},
searchWindowSize: String,
stimuli: [{}],
responses: [{}],
specification: {
Expand Down

0 comments on commit ad6bc48

Please sign in to comment.