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
6 changes: 3 additions & 3 deletions 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 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": "1.20261005.0",
"version": "1.20261005.1",
"engines": {
"bun": ">=1.2.0"
},
Expand Down Expand Up @@ -86,7 +86,7 @@
"electron-vite": "^5.0.0",
"esbuild": "^0.28.2",
"node-addon-api": "^8.9.2",
"postcss": "^8.5.28",
"postcss": "^8.5.29",
"rollup-plugin-visualizer": "^7.1.1",
"stylelint": "^17.16.0",
"stylelint-config-standard": "^40.0.0",
Expand Down
6 changes: 3 additions & 3 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 @@ -42,7 +42,7 @@
},
"./style.css": "./dist/opencor.css"
},
"version": "1.20261005.0",
"version": "1.20261005.1",
"libopencorVersion": "1.20260803.0",
"scripts": {
"build": "vite build && bun scripts/generate.version.ts",
Expand Down Expand Up @@ -87,7 +87,7 @@
"@vue/tsconfig": "^0.9.1",
"autoprefixer": "^10.6.1",
"esbuild": "^0.28.2",
"postcss": "^8.5.28",
"postcss": "^8.5.29",
"rollup-plugin-visualizer": "^7.1.1",
"stylelint": "^17.16.0",
"stylelint-config-standard": "^40.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ const uiJsonEmpty = vue.computed<boolean>(() => {
});

const mathEval = new math.Float64ArrayMath();
const model = document.model(0);
const model = isDocumentValid ? document.model(0) : null;
const isSimulating = vue.ref<boolean>(false);
const liveData = vue.ref<IGraphPanelData[]>([]);
let margins: Record<string, IGraphPanelMargins> = {};
Expand Down Expand Up @@ -1049,9 +1049,9 @@ const reinstantiateInstance = (): locApi.SedInstance => {
// Run the interactive simulation.

const updateSimulation = async (): Promise<void> => {
// Make sure that the view is usable, i.e. that we have an instance.
// Make sure that the view is usable, i.e. that we have a model and an instance.

if (!instance) {
if (!model || !instance) {
return;
}

Expand Down Expand Up @@ -1649,7 +1649,7 @@ const onToggleRunColorPopover = (index: number, event: MouseEvent): void => {
const onDownloadCombineArchive = (): void => {
const jsZip = new dependencies._jsZip();
const baseFileName = common.fileName(props.file.path()).replace(/\.[^/.]+$/, '');
const modelFile = model.file();
const modelFile = model?.file();

if (!modelFile) {
emit('error', 'Cannot create COMBINE archive: no model file available.');
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/libopencor/locFileApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export class File {
}

document(): SedDocument {
return new SedDocument(this._path, this._wasmFile);
return new SedDocument(this._path, this._wasmFile, this._issues);
}

uiJson(): IUiJson | undefined {
Expand Down
17 changes: 16 additions & 1 deletion src/renderer/src/libopencor/locSedApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,16 @@ export class SedDocument {
private _wasmSedDocument: IWasmSedDocument = {} as IWasmSedDocument;
private _issues: IIssue[] = [];

constructor(filePath: string, wasmFile: IWasmFile) {
constructor(filePath: string, wasmFile: IWasmFile, fileIssues: IIssue[]) {
// If the file has some errors (e.g., an invalid CellML file), then report its issues rather than those of the
// SED-ML document (since those are likely to be a consequence of the file's errors).

if (fileIssues.some((issue: IIssue) => issue.type === EIssueType.ERROR)) {
this._issues = [...fileIssues];

return;
}

// Create the SED-ML document.

if (cppVersion()) {
Expand All @@ -53,6 +62,12 @@ export class SedDocument {
? _cppLocApi.sedDocumentIssues(this._cppDocumentId)
: wasmIssuesToIssues(this._wasmSedDocument.issues);

// Don't check anything else if the SED-ML document already has some errors.

if (this._issues.some((issue: IIssue) => issue.type === EIssueType.ERROR)) {
return;
}

// TODO: we only support a limited subset of SED-ML for now, so we need to check a few more things. Might wnat to
// check https://github.com/opencor/opencor/blob/master/src/plugins/support/SEDMLSupport/src/sedmlfile.cpp#L579-L1492.

Expand Down
Loading