Simulator and DataField

Hi,

I'm currently converting a SimpleDataField into a DataField but I really don't understand how I should work with the simulator. It is as if everyone that do a non SimpleDataField expects a 1 field layout. How can I simulate my field at a specific place (for instance top centered in a 7 field layout on a F6)? Hopefully I just missed something :-)

Best regards,
Tobias

  • You've to select a 1 field layout for the simulator. In the datafield app you've to create your own dc with the look and feel that you want. Subsequently you can display your dc in the simulator.

  • In the sim, you can select the layout using Data Fields>Layout, where the available layouts are based on the target device.  In the sim, your DF will run in all the fields, so if you use a 4 field layout, your DF will run in all 4.

  • Thanks Jim,

    I do see that the DF displays on all fields but what I don't understand is how that affects onLayout and DataField.getObscurityFlags()? Do the simulator run as many instances of the DF that is required for the layout selected?

    I put some debug code that prints to the console just so that I can check the result of getObscurityFlags() but I can only see one result and that is for one of the fields but the others should return a different value.

  • The way it should work is compute() is called once a second, and onLayout/onUpdate is called once a second per visible field, but I think there's a bug in the current sim where onLayout is only called once and not for each field

  • Thanks, that clarifies. But since all three are members of the same class and share all variables within the class I guess that the simulator run one instance for every field?

    I've never worked with something else than SimpleDataField, and with SDK1x,  so my questions are very basic and might sound stupid but I really appreciate your support.

    Best regards,
    Tobias

  • Nope, only one instance total.  Like I said, compute runs once per second and onUpdate, once per visible field.

  • Thanks, I think that I start to understand how it works :-)