You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
May I please ask for few clarifications (1.5.2) if possible. Apologies, I'm changing the text as I learn or discover more. Would appreciate a feedback - especially on #3, there is slight chance it may be an issue.
I assume it is (currently) impossible to register a source (system.registerSource) that would be enabled instantly, user must always the go to Model->Lua and set it to be on manually?
Is there a way to ensure that the sources are initialized before widget create and 1st read are called? I.e. if I call getSource("My Source") in widget.create it currently returns nil, while if I do it in say wakeup handler id does return valid source. Traces show that widget init and create are always called before source init, at least on the sim.
I am/was having trouble ensuring that my widget data (persistent = true) survive widget being deleted from the screen and then added back (same or new screen), using storage.read and storage.write. At 1st I thought the data is being wiped out when the widget is deleted from the screen. Then I discover somewhat different issue (or perhaps this is by design) with the sequence of calls. Lets take flight count as an example, I want the number to be persistent, even if I delete the widget and then re-add it to the screen (same model).
Normal operation (when the widget is set and working),
create is called when flight count is set to default (0)
read is called that read flight count from storage (storage.read) - lets say current value is 9
flight count is increased to 10, I either call model,dirty directly which triggers write handler or if I exit the sim/model
write is called saving new value (10) to the storage.
The above is as expected.
Now, when I delete widget (set to ----) and add it back (same model):
model .bin file gets written (looks like that data is erased at this point)
create is called when flight count is set to default (0)
write is called.
read is never called
When I restart the sim or the model after widget is added it goes back no "normal" read/write pair, but the values are already gone.
Note: Under X10Express simulator Model->Lua tile icon seems missing, it is there in X20S simulator.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
May I please ask for few clarifications (1.5.2) if possible. Apologies, I'm changing the text as I learn or discover more. Would appreciate a feedback - especially on #3, there is slight chance it may be an issue.
I assume it is (currently) impossible to register a source (system.registerSource) that would be enabled instantly, user must always the go to Model->Lua and set it to be on manually?
Is there a way to ensure that the sources are initialized before widget create and 1st read are called? I.e. if I call getSource("My Source") in widget.create it currently returns nil, while if I do it in say wakeup handler id does return valid source. Traces show that widget init and create are always called before source init, at least on the sim.
I am/was having trouble ensuring that my widget data (persistent = true) survive widget being deleted from the screen and then added back (same or new screen), using storage.read and storage.write. At 1st I thought the data is being wiped out when the widget is deleted from the screen. Then I discover somewhat different issue (or perhaps this is by design) with the sequence of calls. Lets take flight count as an example, I want the number to be persistent, even if I delete the widget and then re-add it to the screen (same model).
Normal operation (when the widget is set and working),
The above is as expected.
Now, when I delete widget (set to ----) and add it back (same model):
model .bin file gets written (looks like that data is erased at this point)
When I restart the sim or the model after widget is added it goes back no "normal" read/write pair, but the values are already gone.
Note: Under X10Express simulator Model->Lua tile icon seems missing, it is there in X20S simulator.
Many thanks
Beta Was this translation helpful? Give feedback.
All reactions