Implement steps 2 and 4 of escet plcgen
Steps 2 and 4 deal with CIF types and variables.
Step 3 is skipped for now because constants cannot be shown for PLC targets that don't support constant definitions, until plcgen
has support for using constants in some context.
From #397 (closed):
- Handle type declarations or simple types. Needs
- finding type declaration in CIF model,
- notion of types in the transformation,
- target-specific mapping of CIF data types to PLC data types, for the basic types (bool, int, real)
- notion of types in the PLC code,
- type equality and ordering
- Extract discrete variables from the CIF model, organize them by automaton, and generate variable tables and initialization of the variables for each supported PLC system. Needs
- processing CIF model and storing found information by model (there should be previous art),
- converting CIF discrete variables to PLC while keeping the connection between both (CIF reading or writing a variable must eventually generate access to its PLC equivalent),
- constructing and writing tables of variables for each support PLC system (global variables?), and
- constructing an initialization step in the generated PLC.
The "type equality and ordering" item in step 2 doesn't seem very needed at this point, and may be skipped as well.