This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Keeping attribute table and model in sync

I think this is a rather common problem: I want to expose a couple of variables from my model code (members of structs) as characteristics. Is there a simple and elegant way to bind such variables directly to the characteristics so that I do not have to write code for each characteristic to update the characteristic value based on the model value and vice versa for each variable?

I am essentially looking for something like an observer implementation / reactive programming similar to what you use in MVC / MVVM nowadays.

Parents
  • Oh and another thing: How do I make sure that the SoftDevice does not interrupt my code doing calculations with inconsistent data because if e.g. my model code first uses the value of an attribute at timestep 1 and then the softdevice interrupts that code, changing the attribute value and the rest of the interrupted function now uses the attribute value at time step 2.

Reply
  • Oh and another thing: How do I make sure that the SoftDevice does not interrupt my code doing calculations with inconsistent data because if e.g. my model code first uses the value of an attribute at timestep 1 and then the softdevice interrupts that code, changing the attribute value and the rest of the interrupted function now uses the attribute value at time step 2.

Children
No Data
Related