Start a new topic

validate event for variables

It possible, that you create a "Validate Event" for variables? 

One can with a TimerEvent a cyclical refresh causing e.g. to recognize

whether a variable has changed, but that is quite expensive and creates unnecessary overhead.

The page timers (see my previous post) would then be unnecessary.



1 person likes this idea

You are good at programming (demonstrated in WaveForm code) So, when you have taken the time to dig into the internals of the code, you might agree why I object to bloating the size of every component by increasing required space to fit this new event in an already space staved restraint of the onboard STM32.


This can be accomplished from the connected host MCU.

Perhaps check out the click command, which can be used to store your code for your personal variable validation and issue a click command when your event occurs that needs validation.


Placing a hotspot m0 with dimensions of 5x5 will be out of site and not interfere with display.

you could further turn off this hotspot visibility

Then you have the space for two personal routines

The Hotspot Pressed Event by calling click m0,0

The Hotspot Release Event by calling click m0,1


When your DHT22 has new value and changes are required at the same point you are sending the new value to the Nextion Display, you can EASILY make a second call to initiate the routine in your personal click command.


// DHT22 Value NE old_value

IF new_value <> old_value {

nextSendCommand('Page0.temp.val='+new_value);

nextSendCommand('click m0,1);

old_value=new_value;

}


This uses existing commands and does not require bloating the firmware.


>>So, when you have taken the time to dig into the internals of the code, 

>>you might agree why I object to bloating the size of every component by increasing 

>>required space to fit this new event in an already space staved restraint of the onboard STM32.


Now I think that the stm32 is a very powerful cpu;-)

The big benefits, why i use the NEXTION display (for me) 

 

 - on board functionality

 - on board functionality;-)

 

I use a 32k PSoC 4 M0 CPU. The flash is not big enough for big GLibs and big images. And i found 

the NEXITION Display seems ideal as Display for my applications. 

Sure, i can program the complete display functionality on the MCU, but i think, in most applications its not necessary. 

I think, the scripting language is better than nothing. For most problems i can find a workaround.

And you're right, certainly i understand not all commands correct - yet. I work for only a few days with the display.

But i have found several nice to have.

And i think, a trigger, who fires if a value changed, is very helpful. (for me and perhaps for other)

And this is only a feature request, not a bug report;-)


>>This uses existing commands and does not require bloating the firmware.  

In most cases, you're right. In your example anyway.

But if you have many values that you need to observe and respond to need...


And thanks for your suggestions. I think that can be very useful in some cases.

I agree the Nextion is a powerful MCU, especially when coupled as was done with the Nextion Display.


>And i think, a trigger, who fires if a value changed, is very helpful. (for me and perhaps for other)


I just find that your Trigger was created when the DHT22 data was sent to your MCU, and becomes easiest to respond at that point rather than attempting to create many points and conditions to check for on another MCU.


We are running the same conversation across several threads my friend. =)

There are several ways to actually accomplish any programming task.  I was suggesting some that preserve space, save time and fewer introductions to having to locate bugs.  Ultimately, it is your choice for how you wish to do it.  A generic trigger to encapsulate user written function has been created. 


Each component is already now 180 bytes in Flash just to define +++ a varied amount for functionality.  I am still opposed to that being increased. 


I am now reviewing all of the Feature Requests, this will take some time, patience please.

New Event request - carried forward.

Login or Signup to post a comment