Skip to content

Add libSBML importer and optional GTK4 GUI; refactor build and introduce progress callback; fix delay-structure bugs#5

Draft
rafaelstjf wants to merge 5 commits into
masterfrom
codex/avalie-o-codigo
Draft

Add libSBML importer and optional GTK4 GUI; refactor build and introduce progress callback; fix delay-structure bugs#5
rafaelstjf wants to merge 5 commits into
masterfrom
codex/avalie-o-codigo

Conversation

@rafaelstjf

Copy link
Copy Markdown
Owner

Motivation

  • Enable importing SBML/XML models and provide a GNOME/GTK frontend while keeping the simulation core reusable.
  • Expose runtime progress so a GUI can plot simulation state as it runs.
  • Improve robustness and memory handling in delay structure implementations and in the rejection method.
  • Modernize the CMake layout to produce a reusable stocbionet_core library and conditionally enable libSBML and GTK/libadwaita support.

Description

  • Refactor build system in CMakeLists.txt to create stocbionet_core, link Threads::Threads, and optionally detect and link libSBML and GTK/libadwaita to build StocbionetGui, with informative configure messages.
  • Add SBML importer (src/sbml/SBMLImporter.hpp and src/sbml/SBMLImporter.cpp) that conditionally uses libSBML to translate SBML models to the internal STOCBIONET format and add Model integration via SBMLImporter::canLoad/load.
  • Add a GTK4/libadwaita GUI (src/gui/main_gui.cpp) that uses a background thread to run simulations and receives runtime updates via a new progress callback.
  • Introduce a progress callback API: add setProgressCallback to Log and SSA, store a function<void(long double,const double*,int)> progressCallback, and call it from Log::insertNode so external code (GUI) can receive streaming data.
  • Fix and harden delay-structure code and rejection method: add RejectionMethod constructor and destructor handling, defensively free arrays with delete[], ensure default chooseStructure case, and fix bugs/edge cases and resizing logic in CircularList, DelayList, DelayHeap, and DelayHash.
  • Update README.md with documentation for SBML import support and the optional GTK GUI.

Testing

  • Performed a CMake configure and full build (producing stocbionet_core and Stocbionet) on a Linux development environment with libSBML and GTK4/libadwaita available and the build completed successfully.
  • Verified that SBML files are detected by SBMLImporter::canLoad and that Model::loadModel uses the importer path when applicable, with basic translation of parameters, species and reactions.
  • No automated unit tests are present in the repository; no automated test suite was executed as part of this change.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant