Hi Martin,
Answers in reverse order
.ods is a LibreOffice file (equivalent to Microsoft .xls or .xlsx)
I just used LibreOffice to knock up a spreadsheet containing 3 sheets, 1 for each table.
I am not proposing that we use this in the Templot5+ world.
Where would the table be? An XML file perhaps? Or possibly a text file on GitHub which anyone could edit and post pull requests for?
The tables could be held in a proper relational database, but I am still researching these, and the phrase "relational database" might scare some people.
Each table could be held in a separate file. Possible file formats are .XML or a CSV type of .txt file.
Indeed in
https://www.freepascal.org/~michael/articles/startlaz7/startlaz7.pdf there is an example of a CSV type of text file in:-
10 Adding some structure: CSV data
There is also a description of the TMemDataset in :-
9 The simplest dataset: an In-Memory dataset
I envisage that we could provide a set of
CSV files with Templot5+.
At the startup of Templot5+ (or do I mean Trackpad5+) we could read in the
CSV files and for each one create a
TMemDataset (for speed of access).
Templot5+ would have a new sub-menu entry on Trackpad
utils menu, perhaps called
Chair Themes
This would invoke the chair_themes unit, which would provide a process of maintaining any tables (files) related to chair themes.
The chair_themes form could perhaps contain a TpageControl with separate tabs for ;-
Chair Family, Chair Type, Prototype Chair
On exit from
Chair Themes (or in lazarus speak OnClose?) confirmation would be sought to
save changes.
If affirmative, then the
CSV files would be updated, and the relevant
TMemDataset table would be refreshed.
Think of the
CSV files as the stored environment, whereas the
TMemdataset tables are the encoded environment.
At present you have a lot of what are in essence repeated copies of the same set of field names but with different prefixes.
eg S1_, L1_, etc
The idea is that these are replaced with just one set prefixed
pc_
Then for a particular
family and
code (chair code) the relevant record could be retrieved speedily from the
pc_prototype_chair TMemdataset and read into the fields prefixed
pc_
Then instead of having code that is repeated for each type of chair, you can have a common bit of code such as in math_unit:-
inbolt_1x:=pc_inbolt_1x*inscale;
inbolt_2x:=pc_inbolt_2x*inscale;
This means that when you add yet more chair parameters (for instance for 8 sided chairs), you only have to add the parameter to the file definition, and only once in math_unit, rather than once for every chair type that needs it.
Steve