MetaModel as a Base Class¶
MetaModel is the abstract base class for all analysis tab models in Poriscope. It handles the logic, processing, and backend operations that power your tab — things like running calculations, managing worker threads, and storing cached data.
This class does a lot of the heavy lifting behind the scenes, so you can focus on implementing just the part that makes your model unique.
What You Get by Inheriting MetaModel¶
Thread and worker management
You don’t have to manually manage threads or signals. MetaModel handles:
Spawning and tracking worker threads (
WorkerThread)Connecting signals for progress updates
Running generators in parallel or serial mode per channel
Signals and communication
Built-in signals allow your model to communicate with the view, controller, or even other plugins:
Global Signal and Data Plugin Controller Signal for inter-plugin communication
update_progressbarto visually track long computationsadd_text_to_displayto send log output or feedback to the interface
Caching and reporting
Store intermediate data with
cache_plot_data()Format and return a cached
DataFramewithformat_cache_data()Automatically generate final reports after threads finish
Helper functions you don’t need to write yourself
stop_workers()to gracefully terminate long-running tasksreset_lock()to clean up when threads completeset_generator()andrun_generators()to queue and execute background operations
What You Need to Implement¶
Only one method is abstract, and that’s _init(). This is where you set up any plugin-specific logic or configuration. It’s automatically called at the end of the base class constructor.
Note
Want the technical breakdown? Check the MetaModel section of this manual — it walks through each method’s purpose and parameters.