Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"url": "git+https://github.com/opencor/webapp.git"
},
"type": "module",
"version": "0.20260110.1",
"version": "0.20260112.0",
"scripts": {
"archive:web": "bun src/renderer/scripts/archive.web.js",
"build": "electron-vite build",
Expand Down Expand Up @@ -55,7 +55,7 @@
"primeicons": "^7.0.0",
"primevue": "4.2.5",
"quill": "^2.0.3",
"systeminformation": "^5.30.2",
"systeminformation": "^5.30.3",
"ua-parser-js": "^2.0.7",
"vue": "3.4.21"
},
Expand All @@ -66,7 +66,7 @@
"@tailwindcss/postcss": "^4.1.18",
"@tailwindcss/vite": "^4.1.18",
"@types/crypto-js": "^4.2.2",
"@types/node": "^24.10.6",
"@types/node": "^24.10.7",
"@types/plotly.js": "3.0.3",
"@vitejs/plugin-vue": "^6.0.3",
"@vue/tsconfig": "^0.8.1",
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/renderer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
},
"./style.css": "./dist/opencor.css"
},
"version": "0.20260110.1",
"version": "0.20260112.0",
"scripts": {
"build": "vite build",
"build:lib": "vite build --config vite.lib.config.ts && cp index.d.ts dist/index.d.ts",
Expand Down Expand Up @@ -72,7 +72,7 @@
"@tailwindcss/postcss": "^4.1.18",
"@tailwindcss/vite": "^4.1.18",
"@types/crypto-js": "^4.2.2",
"@types/node": "^24.10.6",
"@types/node": "^24.10.7",
"@types/plotly.js": "3.0.6",
"@vitejs/plugin-vue": "^6.0.3",
"@vue/tsconfig": "^0.8.1",
Expand Down
22 changes: 16 additions & 6 deletions src/renderer/src/components/views/SimulationExperimentView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,15 @@
<ScrollPanel class="h-full">
<Fieldset legend="Input parameters">
<InputWidget
v-for="(input, index) in (uiJson as any).input"
v-for="(input, index) in uiJson.input"
v-model="interactiveInputValues[index]!"
v-show="interactiveShowInput[index]"
:key="`input_${index}`"
:name="input.name"
:maximumValue="input.maximumValue"
:minimumValue="input.minimumValue"
:possibleValues="input.possibleValues"
:stepValue="input.stepValue"
:maximumValue="isScalarInput(input) ? input.maximumValue : undefined"
:minimumValue="isScalarInput(input) ? input.minimumValue : undefined"
:possibleValues="isDiscreteInput(input) ? input.possibleValues : undefined"
:stepValue="isScalarInput(input) ? input.stepValue : undefined"
:class="index !== 0 ? 'mt-6' : ''"
@change="updateInteractiveSimulation"
/>
Expand All @@ -88,7 +88,7 @@
<div class="flex flex-col grow gap-2 h-full min-h-0">
<IssuesView v-show="interactiveInstanceIssues.length !== 0" :leftMargin="false" :width="width" :height="actualHeight" :issues="interactiveInstanceIssues" />
<GraphPanelWidget v-show="interactiveInstanceIssues.length === 0"
v-for="(_plot, index) in (uiJson as any).output.plots"
v-for="(_plot, index) in uiJson.output.plots"
:key="`plot_${index}`"
class="flex-1 w-full min-h-0"
:margins="interactiveCompMargins"
Expand Down Expand Up @@ -175,6 +175,16 @@ function populateParameters(parameters: vue.Ref<string[]>, instanceTask: locSedA
parameters.value.sort((parameter1: string, parameter2: string) => parameter1.localeCompare(parameter2));
}

// Type guards.

function isScalarInput(input: locApi.IUiJsonInput): input is locApi.IUiJsonScalarInput {
return 'maximumValue' in input && 'minimumValue' in input;
}

function isDiscreteInput(input: locApi.IUiJsonInput): input is locApi.IUiJsonDiscreteInput {
return 'possibleValues' in input;
}

// Standard mode.

const standardDocument = props.file.document();
Expand Down
2 changes: 2 additions & 0 deletions src/renderer/src/libopencor/locApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,15 @@ export {

export {
type IUiJson,
type IUiJsonDiscreteInput,
type IUiJsonDiscreteInputPossibleValue,
type IUiJsonInput,
type IUiJsonOutput,
type IUiJsonOutputData,
type IUiJsonOutputPlot,
type IUiJsonOutputPlotAdditionalTrace,
type IUiJsonParameter,
type IUiJsonScalarInput,
uiJsonIssues
} from './locUiJsonApi.ts';

Expand Down
4 changes: 2 additions & 2 deletions src/renderer/src/libopencor/locUiJsonApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export interface IUiJson {

export type IUiJsonInput = IUiJsonDiscreteInput | IUiJsonScalarInput;

interface IUiJsonDiscreteInput {
export interface IUiJsonDiscreteInput {
defaultValue: number;
id: string;
name: string;
Expand All @@ -25,7 +25,7 @@ export interface IUiJsonDiscreteInputPossibleValue {
value: number;
}

interface IUiJsonScalarInput {
export interface IUiJsonScalarInput {
defaultValue: number;
id: string;
maximumValue: number;
Expand Down