Multi-Projector
|
This class is used to store shared data between different classes. More...
Public Member Functions | |
__init__ (self) | |
Initializes the SharedData instance. | |
write_to_config (self, filename='config.ini') | |
Saves current settings to a configuration file. | |
read_from_config (self, filename='config.ini') | |
Loads settings from a configuration file. | |
Public Attributes | |
left_image = None | |
right_image = None | |
int | overlap_region = 200 |
bool | leftSide = True |
This class is used to store shared data between different classes.
The SharedData class maintains information such as images, overlap region width, and a flag for which side (left or right) is active. This data is accessible to other classes, allowing them to read and modify these shared attributes. The class also includes methods for saving and loading the settings to and from a configuration file.
Multi-Projector.SharedData.SharedData.__init__ | ( | self | ) |
Initializes the SharedData instance.
The constructor sets up initial values for shared data attributes.
Multi-Projector.SharedData.SharedData.read_from_config | ( | self, | |
filename = 'config.ini' ) |
Loads settings from a configuration file.
This method reads overlap_region
and leftSide
values from a specified configuration file (default name: config.ini
). If the file is not found, default values are retained.
filename | The name of the configuration file to read from, defaulting to 'config.ini'. |
Multi-Projector.SharedData.SharedData.write_to_config | ( | self, | |
filename = 'config.ini' ) |
Saves current settings to a configuration file.
This method writes the current values of overlap_region
and leftSide
to a configuration file (default name: config.ini
) in the [DEFAULT] section. This allows the settings to be persisted across sessions and loaded later.
filename | The name of the configuration file to write to, defaulting to 'config.ini'. |
self | the object pointer |