It is expected that each crate in the system will have its own CPU It is therefore sensible that there be one Local Controller running in each crate CPU to control the modules in that crate.
It is not clear if each crate CPU will have its own disk. If so,
the calibration and other data required to initialise each crate
should be kept local to that CPU. In most cases, the calibration
data will be generated locally. However the threshold settings etc
will need to be distributed to each crate from the central database.
Some of the various kinds of crates share the same kind of module.
So the Local Controllers in different crate will inevitably share
some code.
One approach may be to develop a single Local Controller program
containing the code relevant to all module types. This program
can read from the database which kind of crate it is operating
in and can handle the modules it finds there.
Apart from code specific to modules, there may well be other
ancillary code common to the Local Controller of different crates
which will also be useful to share. Also, in test setups, some
crates may contain combinations of modules which will always be
in separate crates in the final system.
However if it turns out that the commonalities are exceeded by
differences between the various crates, splitting into several
different programs may be more manageable.