Skip to content

Commit dee0e0d

Browse files
authored
Cleaning up.
2 parents f36848d + a66100a commit dee0e0d

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"url": "git+https://github.com/opencor/webapp.git"
2424
},
2525
"type": "module",
26-
"version": "0.20251211.1",
26+
"version": "0.20251211.2",
2727
"scripts": {
2828
"archive:web": "bun src/renderer/scripts/archive.web.js",
2929
"build": "electron-vite build",

src/renderer/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
},
4040
"./style.css": "./dist/opencor.css"
4141
},
42-
"version": "0.20251211.1",
42+
"version": "0.20251211.2",
4343
"scripts": {
4444
"build": "vite build",
4545
"build:lib": "vite build --config vite.lib.config.ts && cp index.d.ts dist/index.d.ts",

src/renderer/src/components/views/SimulationExperimentView.vue

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,22 @@ const interactiveUiJsonIssues = vue.ref<locApi.IIssue[]>(
223223
);
224224
const interactiveInstanceIssues = vue.ref<locApi.IIssue[]>([]);
225225
const interactiveInputValues = vue.ref<number[]>(
226-
interactiveModeAvailable.value ? props.uiJson.input.map((input: locApi.IUiJsonInput) => input.defaultValue) : []
226+
interactiveModeAvailable.value
227+
? props.uiJson.input.map((input: locApi.IUiJsonInput) => {
228+
// If the input has some possible values then we want to return the index of the possible value that matches the
229+
// default value otherwise we just return the default value.
230+
231+
if (input.possibleValues !== undefined) {
232+
for (let i = 0; i < input.possibleValues.length; ++i) {
233+
if (input.possibleValues[i].value === input.defaultValue) {
234+
return i;
235+
}
236+
}
237+
}
238+
239+
return input.defaultValue;
240+
})
241+
: []
227242
);
228243
const interactiveShowInput = vue.ref<string[]>(
229244
interactiveModeAvailable.value ? props.uiJson.input.map((input: locApi.IUiJsonInput) => input.visible ?? 'true') : []
@@ -271,6 +286,7 @@ interactiveMath.import(
271286
},
272287
{ override: true }
273288
);
289+
274290
function evaluateValue(value: string): mathjs.MathType {
275291
const parser = interactiveMath.parser();
276292
let index = -1;

0 commit comments

Comments
 (0)