EdgeTX / edgetx

EdgeTX is the cutting edge open source firmware for your R/C radio
https://edgetx.org
GNU General Public License v2.0
1.61k stars 339 forks source link

YAML Mixer script inputs #1270

Open raphaelcoeffic opened 2 years ago

raphaelcoeffic commented 2 years ago

While checking how to import/export the mixer script definitions in Companion, I found that the mixer script data stored in the model lack something very important.

The inputs (either a source or a fixed value) are stored this way in memory:

union ScriptDataInput {
  int16_t value;
  source_t source;
};

The issue here is that the information deciding on whether it is a value or source depends on the mixer script itself. It is stored nowhere else. This is an issue as we don't have this information when converting the data from the binary model, and thus cannot map the source properly to a symbolic name. So what happens at the moment is that we only output value, and hope for the best (which necessarily breaks once the some sources are remapped).

raphaelcoeffic commented 2 years ago

In Companion, I found this:

  //  TODO needs lua incorporated into Companion as script needs to be parsed
  //  to determine if input field is source or value