Skip to content

#815 PLCgen: add more detailed comments to generated PLC code

Albert Hofkamp requested to merge 815-improve-variable-documentation-3 into develop

Patch is readable by commit.

Inserts comment lines above the code that output the affected CIF variable when:

  • Initializes a state variable.
  • Updates the remaining time of a continuous variable.
  • Changes a state variable in an update.
  • Changes a state variable by reading PLC input.
  • Writes a state variable to PLC output.

In addition, it inserts information about the model structure before the program. Currently for each complex component (for as far as useful):

  • Variables of the automaton.
  • Uncontrollable events it participates in.
  • Controllable events it participates in.
  • The PLC edge selection variable of the automaton component if it has one.

I briefly looked into the edge numbers, and concluded they are not trivial, and need constants or enumerations at least. Similarly, we have magic location numbers or enumerations. These look like a good idea to add to the model view too, but probably better at a different time.

Closes #815 (closed) Addresses #679

Merge request reports