Closed saulgreenberg closed 8 years ago
Todd wrote: Could you give me some context on this comment in ImageDatabase.PopulateDataLabelMaps()? // don't type map user defined controls as if there are multiple ones the key would not be unique Given the effort the editor goes to ensure data labels are unique the constraint is removable, no?
Todd
Saul replied...
DataLabelFromStandardControlType holds the DataLabel and Label names for the standard controls found in all timelapse templates (e.g., File, Folder, etc), where it serves as a lookup table to get the DataLabel name from a control type (e.g., given a file type, it will return File).
ControlTypeFromDataLabel does the opposite, but for all controls i.e., given a data label name, it returns the type of the control (e.g., note, counter, date, etc).
I can reconstruct why I added the comment “// We don't want to add these types to the hash, as there can be multiple ones, which means the key would not be unique”
But It think it works something like this. There is (for example) only one DataType called (say) Date, so getting its DataLabel is a one to one mapping.
However, if I added (say) all Counts to the list, there could be multiple items of the type Count. So if I asked for the DataLabel accompanying the type Count, there could be multiple matches (i.e., one to many). This is why those types are excluded. So I guess the real answer is that this.DataLabelFromStandardControlType is only useful for finding the datalabels that matches the standard control types.
I’m not sure if the constraint is removable … would have to walk through the new code to see what is going on.
[8a8c937]