I am considering buying one of these Nexton displays for an alarm system I am building. I am mocking up my design prior to building it in the Editor, but I had a question regarding a specific element.
My display needs to show a list of events that will be pushed from my MCU (so devices that have triggered the fire alarm, or faults from detection/alarm devices etc). Please see attached the picture of what I am trying to achieve.
The entire background and buttons are one image, but the list elements are built of the translucent row background and a photo of the device that has triggered the event, as well as the text describing it.
My questions are:
Can I store the text from the MCU in the display and build an array with the device image? Can I cycle through this array (with the up and down arrows in my above image) to cycle through the list of events? If so, would it involve me clearing the specific items and re-adding the new ones to the screen?
I am brand new to these displays. Currently this control panel is in development but I have trialled out cycling through my RAM where the events are stored and updating the entire display when physical buttons are pressed.
If this is possible, I will be able to buy!
Formatting was removed from the questions. To be clearer, here they are again:
It would be best to consider the limited compute capabilities of the Nextion Display mcu, and the greater likelihood that your project mcu has much better data processing capabilities. If I were trying to accomplish your task, I would remove the "scroll-look" as the Nextion isn't an endless virtual page. I might take the following approach.
1) Five Text Elements at the top, have your mcu send a command to update t0.txt="4 Fires" as the occur
2) Four Static "Event Panels" regions each containing a pic element for the icon and 4 text elements for what, where, event, time. Text Elements are t0.txt="Message" icons are changed with p0.pic=0 where 0 is the picture number preloaded into your HMI file.
3) A Text Element for your page title "Active Events"
4) Bottom row 2 Buttons and Two Text Elements for Account, Print, Time, and Back
5) Two variables to NumberofEvents and FirstEventinList. ??
6) Two scroll indicators made up of a picture element (Up arrow, down arrow). Again, since your mcu program knows that there are 4 event positions on the screen, then your mcu knows if the number of events exceeds 4 and should activate the lower scroll indicator. When pressed, retrieve the down request to your mcu, and update.
So to start, you are showing events 1 to 4. On a Down press, update to show events 2 to 5. On down again, update to show 3 to 6. On an up press, show events 2 to 5, and up again to show 1 to 4.
If first shown event is one, show disabled up, if first shown event is > 1 then show an enabled up.
If total events > (first shown event +3) then show and enabled down, otherwise show a disabled down.
Your list of locations, possible events, etc would be stored inside your mcu, and your mcu updates the Nextion Display. Besides, the sensor data that is triggering your event is being captured by your mcu and not the Nextion Display.
Last .. I tossed a mock fire.hmi together to spark ideas, but really ... spend quality time on your graphics.
Patrick, thank you so much for taking the time to provide such detailed help! I really appreciate that, and your comments make sense regarding removing the "scroll" look, and instead to just shift the data using my MCU.
Really great, I will post once I get the display and the scenario functioning correctly, with high quality graphics!