Refactor plcgen
In the previous plcgen patch, responsibilities of the various classes wasn't completely clear. Also, while we have been discussing splitting frontend code from the functionality, we haven't tried doing that at all yet. This issue aims to cover both goals, although with respect to splitting this patch will have a pragmatic approach for this application only rather than trying to cover the needs for all applications.
With respect to responsibilities, the following seems like a good idea:
-
The main application class is as small as possible (currently it does more).
-
The PLC target class covers the real functionality, although mostly by calling other code.
-
The PLC target class knows and decides everything about what and how to generate code (as before).
-
Actual processing and code generation etc is done in "generator" classes, in a new
generators
sub-package. For now this will contain a (quite empty)CifProcessor
that extracts information from the CIF file, and aPlcCodeStorage
class that collects and stores generated PLC code.In a next patch more code generators will be added. To get a hassle-free instantiation process of the generators, first they are all created, and then they are all connected to each other as a separate step.
Addresses #418 (closed) #472