Many changes in DBHandler

new general processing structure
just before splitting off the projects folder from this repo
This commit is contained in:
Silas Oettinghaus
2025-05-13 10:24:09 +02:00
parent 727c3d9364
commit 9ce23c4a10
38 changed files with 2440 additions and 1103 deletions

View File

@@ -0,0 +1,68 @@
classdef Equalizerstruct
% Equalizerstruct - Class to store and manage equalizer structure data
properties
eq_id (1,1) double {mustBeNumeric} = NaN
equalizer_structure equalizer_structure = equalizer_structure.ffe
eq
mlse
comment char = string.empty() % Changed to string with proper empty initialization
hash char = string.empty() % Changed to string with proper empty initialization
end
methods
function obj = Equalizerstruct(varargin)
% Constructor method for Equalizerstruct
% Can be called empty or with name-value pairs
if nargin > 0
for i = 1:2:nargin
if isprop(obj, varargin{i})
obj.(varargin{i}) = varargin{i+1};
else
error('Property %s does not exist in Equalizerstruct', varargin{i});
end
end
end
end
function s = toStruct(obj)
% Convert the object to a struct
s = struct();
props = properties(obj);
for i = 1:length(props)
s.(props{i}) = obj.(props{i});
end
end
function str = toString(obj)
% Convert the object to a formatted string
s = obj.toStruct();
str = sprintf('Equalizerstruct:\n');
fields = fieldnames(s);
for i = 1:length(fields)
val = s.(fields{i});
if isempty(val)
str = sprintf('%s%s: []\n', str, fields{i});
elseif isnumeric(val) && length(val) > 1
str = sprintf('%s%s: [%s]\n', str, fields{i}, num2str(val'));
else
str = sprintf('%s%s: %s\n', str, fields{i}, string(val));
end
end
end
end
methods (Static)
function obj = fromStruct(s)
% Create an Equalizerstruct object from a struct
obj = Equalizerstruct();
fields = fieldnames(s);
for i = 1:length(fields)
if isprop(obj, fields{i})
obj.(fields{i}) = s.(fields{i});
end
end
end
end
end