Open adudzik opened 5 years ago
First the simples soulution is to add this "bisnes logic" to generated file. Also we need more information how this shoudl work. @grzanka
First of all most of these parameters are never changed by users, hence most probably RDD model parameters can be reduced to a single number (or no parameter at all). It can be achieved by either hardcoding the unneeded parameter with default value in C code of libamtrack or by adding manually some Javascript wrapper code.
This would be the most user-friendly solutions : for users required to type multiple parameters it will be hard to figure out what to put where.
The question is where to make the parameter hiding - can you provide some example Javascript code which takes a single number from web UI, then packs it with some other number into a vector and passes it into libamtrack JS ?
In my opption the most scalable solution is to harcode this login in files that were generated from c signature. For this example it would be AT_D_RDD_Gy.js. In this file we already created 4-element array
`
let rdd_parameter = [];
rdd_parameter.push(parameters.rdd_parameter);
rdd_parameter.push(0);
rdd_parameter.push(0);
rdd_parameter.push(0);`
Because C function expect 4-element array. The second reason to keep this logic in this file is that we should keep code that concerns function in one place. Create one more layer of abstraction will be missleading. I also keep in mind that we want it to be usable by not JS programers.
We need to find a solution to problem with functions that have parameters which are dependent each other.
For example: RDD Model defines number of allowed RDD Model Parameters