Central Parameter/Settings Database implementation - Observer Pattern
Open, Needs TriagePublic

Description

I would like to have a Central Database object that acts as a central API to the actual camera and to all the GUI elements that visualize said parameters.

I want to have Setters and Getters for an arbitrary number of parameters (and types: integer, float, Strings, etc.) which could be identified with a unique string name.

CentralDB->GetParameter("ExposureTime");

menuItems or Screens should be able to subscribe/attach to any parameter and with a handler(functionpointer) that is called when the value changes update their desired GUI elements.
E.g in pseudo C++ code:

MyGUI()
{
    CentralDB->subscribe("ExposureTime", &UpdateMyGUI);
}

void UpdateMyGUI(sender*)
{
    _expTime = sender->GetParameter();
}

CDC Messages received by the Remote from the camera should trigger such a value change as well.

https://sourcemaking.com/design_patterns/observer

sebastian updated the task description. (Show Details)
sebastian updated the task description. (Show Details)May 19 2020, 3:26 PM
panintended added subscribers: BAndiT1983, panintended.

After a discussion with @sebastian I'm claiming this :)

I'm watching you! ;) Lame observer pattern joke, i know.

Looked at code, memory usage report and disassembly, seems like CentralDB and related classes are pretty heavy here and there, could also be the cause for the crashes on stack and heap collision.

Great progress and discovery!