Repository navigation
[OMEdit] Calibrate SSP models against reference data - #17360
Merged
Merged
Conversation
OMSimulator fits the parameters of an SSP model to reference data with `OMSimulator --calibrate`, from the Calibration activity of the UQ layered standard file in the SSP (OpenModelica/OMSimulator#1674). OMEdit had no way to run it. The context menu of a top level SSP model gets "Calibrate...", which opens OMSCalibrationDialog: the activity id (empty for the only one), the UQ file inside the SSP (empty for the referenced one) and the SSP to write the calibrated model to. Calibrate exports the model like Simulate does and runs OMSimulator on it the same way as OMSSimulationOutputWidget, streaming its output into the dialog. Closing the dialog stops a running calibration. The web OMEdit has no QProcess, so the dialog is not built there. Assisted-by: Claude Opus 5.5
adeas31
approved these changes
Oct 20, 2026
| connect(mpCalibrationProcess, SIGNAL(readyReadStandardOutput()), SLOT(readStandardOutput())); | ||
| connect(mpCalibrationProcess, SIGNAL(readyReadStandardError()), SLOT(readStandardError())); | ||
| connect(mpCalibrationProcess, SIGNAL(errorOccurred(QProcess::ProcessError)), SLOT(calibrationProcessError(QProcess::ProcessError))); | ||
| connect(mpCalibrationProcess, SIGNAL(finished(int,QProcess::ExitStatus)), SLOT(calibrationProcessFinished(int,QProcess::ExitStatus))); |
Member
There was a problem hiding this comment.
It’s better to use the new syntax for connect(), as it checks signal-slot compatibility at compile time. With the old syntax, connection issues may go unnoticed until runtime, when the connection fails or the slot is never invoked.
Member
Author
There was a problem hiding this comment.
Done in abfef88: all connections of the dialog, and its menu action in LibraryTreeView, now use the new syntax (QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished) like OMSProxy).
🤖 Generated with Claude Code
Brings OMSimulator#1675: OMSimulator --calibrate, used by the Calibrate... dialog of SSP models. Assisted-by: Claude Opus 5.5
Compile-time checked signal/slot connections in the SSP calibration dialog and its menu action, as asked in the review. Assisted-by: Claude Opus 5.5
HOST_SHORT, used on Windows only, is in omedit_config.h. Assisted-by: Claude Opus 5.5
adrpo
added a commit
to adrpo/OpenModelica
that referenced
this pull request
Oct 21, 2026
Documents the Calibrate... dialog OMEdit got in OpenModelica#17360 (OpenModelica#17359) in a new "Calibrating an SSP Model" section of the OMEdit chapter (OpenModelica#17408). It links to the Parameter Calibration section of OMSimulator's documentation, which the guide didn't show: omsimulator.rst still included OMSimulatorLua.rst, OMSimulatorPython.rst and SSP.rst, which OMSimulator no longer has, so the page lost its Python API (with the calibration) and gave three include errors. It now includes the pages OMSimulator's own guide has: OMSimulatorPython3.rst instead of the three, plus OMSimulatorGui.rst. Assisted-by: Claude Opus 5.5
This was referenced Oct 21, 2026
adrpo
added a commit
that referenced
this pull request
Oct 21, 2026
…de (#17408) (#17409) * [Doc] Diagrams and property probes in the guide Documents in the User's Guide what #16954, #16965, #17188 and #17339 added (#17408): - umldiagrams.rst: getClassDiagram and getInstanceDiagram, their formats and options, with Mermaid examples omc generates while the guide is built, and PlantUML renders of a redeclared medium, the PID block and the instance diagram of ChuaCircuit. - propertyprobes.rst: the probe tree, the properties evaluateProbe computes and how CodeProber uses them, with examples on ProbeCircuit.mo and CodeProber screenshots. - omedit.rst: the Class Diagram window. Assisted-by: Claude Opus 5.5 * [Doc] Calibration of SSP models in the guide Documents the Calibrate... dialog OMEdit got in #17360 (#17359) in a new "Calibrating an SSP Model" section of the OMEdit chapter (#17408). It links to the Parameter Calibration section of OMSimulator's documentation, which the guide didn't show: omsimulator.rst still included OMSimulatorLua.rst, OMSimulatorPython.rst and SSP.rst, which OMSimulator no longer has, so the page lost its Python API (with the calibration) and gave three include errors. It now includes the pages OMSimulator's own guide has: OMSimulatorPython3.rst instead of the three, plus OMSimulatorGui.rst. Assisted-by: Claude Opus 5.5 * [Doc] Screenshots of the OMEdit calibration The Calibrate... entry of the Libraries Browser menu and the dialog after calibrating the dc_motor SSP of the UQ layered standard use cases (#17408). Assisted-by: Claude Opus 5.5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related Issues
Fixes #17359.
Uses OpenModelica/OMSimulator#1675 (
OMSimulator --calibrate, OpenModelica/OMSimulator#1674), now merged: this PR bumps the OMSimulator submodule to its merge commit (398baadc).Purpose
OMSimulator can fit the parameters of an SSP model to reference data, from the Calibration activity of the UQ layered standard file stored in the SSP. OMEdit had no way to run it.
Approach
OMSCalibrationDialogasks for:ssc:MetaDataof typeapplication/x-uncertainty-quantification)<working directory>/<model>.calibrated.ssp)OMSimulator --calibrate=<activity> [--uqFile=<file>] --calibrationOutput=<out.ssp> <exported.ssp>,started the same way as
OMSSimulationOutputWidget(the launcher on Linux/macOS,python -m OMSimulatoron Windows). Its output streams into the dialog. The Calibrate button is disabled while it runs, and closing the dialog stops it.connect()syntax.QProcess, so the dialog is excluded from the wasm build and the menu entry is compiled out there.Testing
Tested locally on Linux. OMEdit was built from this branch, with OMSimulator's Python package taken from the OpenModelica/OMSimulator#1675 branch. The model was the
dc_motoruse case of the UQ layered standard: an SSP with 3 model-exchange FMUs, a Calibration activitycal_01with 6 targets and a CSV of noisy measurements.cal_01, and again with the field empty: both converge in 485 evaluations to the same values as the command line (R = 0.0999684, cost 104041). The written SSP contains theResultSetwith the RMSE values andcal_01_calibrated.ssv.nosuch: one rederror: No Calibration activity with id 'nosuch' ...line, "The calibration failed with exit code 1.", and the button is enabled again.Not tested locally: the Windows
python -m OMSimulatorpath (copied fromOMSSimulationOutputWidget) and the wasm build. The Windows CI label is set.This PR was written with an AI coding agent (Claude Code); all of the testing above was done locally by the agent.
🤖 Generated with Claude Code