<?xml-stylesheet type="text/xsl" href="https://community.element14.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>STM32H7B3I - TouchGFX Application Framework: Model, View, Presentation, Message Queue</title><link>/technologies/embedded/b/blog/posts/stm32h7b3i---touchgfx-application-framework-model-view-presentation-message-queue</link><description>I&amp;#39;m selected for the STM32H7B3I-DK - DISCOVERY KIT road test.I&amp;#39;m working on a touch screen GUI for my electronic load. In this part of the review, I explore the application layer:request data from the business layerdisplay that datau...</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: STM32H7B3I - TouchGFX Application Framework: Model, View, Presentation, Message Queue</title><link>https://community.element14.com/technologies/embedded/b/blog/posts/stm32h7b3i---touchgfx-application-framework-model-view-presentation-message-queue</link><pubDate>Thu, 13 Aug 2020 13:52:45 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:7123b5b1-1059-4d7a-bb74-d5f2199819ba</guid><dc:creator>Jan Cumps</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Simulator info:&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;The TouchGFX Designer has a simulator. It&amp;#39;s an essential part of the design flow.&lt;/p&gt;&lt;p&gt;When you&amp;#39;ve built a part of the GUI, you can simulate the look-and-feel on your PC.&lt;/p&gt;&lt;p&gt;To do that, the simulator actually compiles your TouchGFX code and then executes it. It&amp;#39;s more than just simulating - it&amp;#39;s e real run but on a virtual display.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Now, when you add calls to the backend systems, things may become more complex. Because the TouchGFX designer doesn&amp;#39;t have the knowledge of all dependencies you need in your project.&lt;/p&gt;&lt;p&gt;They have provided a solution that&amp;#39;s as elegant and simple as you can get: a define.&lt;/p&gt;&lt;p&gt;[embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:3ef06e6b-9b7d-4651-b12d-db8be7f5e991:type=c_cpp&amp;amp;text=%23ifndef+SIMULATOR%0A....%0A%23endif]&lt;/p&gt;&lt;div&gt;&lt;/div&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;If you place all logic that&amp;#39;s outside the graphical biosphere, but that&amp;#39;s natural part of the model, view or presentation logic, between these defines, the simulator will compile and run just fine.&lt;/p&gt;&lt;p&gt;How impacting this is actually depends on how well you adhere to the Model - View - Presenter pattern. If you do it right, you only need this in your model.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;In my case that was the case:&lt;/p&gt;&lt;p&gt;[embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:3ef06e6b-9b7d-4651-b12d-db8be7f5e991:type=c_cpp&amp;amp;text=%23include+%3Cgui%2Fmodel%2FModel.hpp%3E%0A%23include+%3Cgui%2Fmodel%2FModelListener.hpp%3E%0A%0A%23ifndef+SIMULATOR%0A%23include+%22FreeRTOS.h%22%0A%23include+%22queue.h%22%0A%23include+%22scpi_msg.h%22%0A%23include+%22ScpiMgr.h%22%0Aextern+%22C%22%0A%7B%0AxQueueHandle+gui_msg_q%3B%0A%7D%0A%0A%23endif%0A%0AModel%3A%3AModel%28%29+%3A+modelListener%280%29%0A%7B%0A%23ifndef+SIMULATOR%0A++++gui_msg_q+%3D+xQueueGenericCreate%281%2C+1%2C+0%29%3B%0A%23endif%0A%7D%0A%0Avoid+Model%3A%3Atick%28%29%0A%7B%0A%23ifndef+SIMULATOR%0A++++%2F%2F+Check+for+messages+from+backend%2C+with+zero+timeout%0A++++uint8_t+msg+%3D+0%3B%0A++++if+%28xQueueReceive%28gui_msg_q%2C+%26msg%2C+0%29+%3D%3D+pdTRUE%29%0A++++%7B%0A++++++++if+%28msg+%3D%3D+SCPI_IDN%29%0A++++++++%7B%0A++++++++++++%2F%2F+Notify+current+presenter+that+IDN+is+received%2Cand+hand+over+payload%0A++++++++++++modelListener-%3Escpi_idn%28%28const+char*%29ScpiMgr%3A%3AgetReply%28%29%29%3B%0A++++++++%7D%0A++++%7D%0A%23endif%0A%7D%0A%0Avoid+Model%3A%3Arequest_scpi_idn%28%29+%7B%0A%23ifndef+SIMULATOR%0A++ScpiMgr%3A%3Aidn%28%29%3B%0A%23endif%0A%7D]&lt;/p&gt;&lt;div&gt;&lt;/div&gt;&lt;img src="https://community.element14.com/aggbug?PostID=21841&amp;AppID=7&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: STM32H7B3I - TouchGFX Application Framework: Model, View, Presentation, Message Queue</title><link>https://community.element14.com/technologies/embedded/b/blog/posts/stm32h7b3i---touchgfx-application-framework-model-view-presentation-message-queue</link><pubDate>Mon, 10 Aug 2020 18:04:24 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:7123b5b1-1059-4d7a-bb74-d5f2199819ba</guid><dc:creator>balearicdynamics</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Nice update.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Enrico&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=21841&amp;AppID=7&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: STM32H7B3I - TouchGFX Application Framework: Model, View, Presentation, Message Queue</title><link>https://community.element14.com/technologies/embedded/b/blog/posts/stm32h7b3i---touchgfx-application-framework-model-view-presentation-message-queue</link><pubDate>Mon, 10 Aug 2020 17:59:57 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:7123b5b1-1059-4d7a-bb74-d5f2199819ba</guid><dc:creator>DAB</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Nice update Jan.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;DAB&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=21841&amp;AppID=7&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: STM32H7B3I - TouchGFX Application Framework: Model, View, Presentation, Message Queue</title><link>https://community.element14.com/technologies/embedded/b/blog/posts/stm32h7b3i---touchgfx-application-framework-model-view-presentation-message-queue</link><pubDate>Mon, 10 Aug 2020 13:14:40 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:7123b5b1-1059-4d7a-bb74-d5f2199819ba</guid><dc:creator>Jan Cumps</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;The SCPI ID for the load mentiones The Breadboard. That&amp;#39;s a tribute to our &lt;span&gt;[mention:6e474abc33b64a82aa78c9813503c962:e9ed411860ed4f2ba0265705b8793d05]&lt;/span&gt; , the father of the electronic load:&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span id="6ea7883b_164a_448c_a832_7ccbb97543e2"&gt;&lt;span&gt;[View:https://www.youtube.com/watch?v=7M7NAFHZacE:740:466]&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;If you reached this blog series while searching for STMicro TouchGFX tips and tricks: go view the video above to check out &lt;a class="jive-link-wiki-small" href="/technologies/test-and-measurement/w/documents/1896/programmable-electronic-load"&gt;the genesis of hardware that&amp;#39;s being controlled&lt;/a&gt;.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=21841&amp;AppID=7&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: STM32H7B3I - TouchGFX Application Framework: Model, View, Presentation, Message Queue</title><link>https://community.element14.com/technologies/embedded/b/blog/posts/stm32h7b3i---touchgfx-application-framework-model-view-presentation-message-queue</link><pubDate>Mon, 10 Aug 2020 11:44:19 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:7123b5b1-1059-4d7a-bb74-d5f2199819ba</guid><dc:creator>balearicdynamics</dc:creator><slash:comments>0</slash:comments><description>&lt;blockquote class="jive-quote"&gt;&lt;p&gt;&lt;span&gt;Because this class is full static (&lt;/span&gt;&lt;span&gt;[mention:2136c4649d3b47f78653b7e97ac61f69:e9ed411860ed4f2ba0265705b8793d05]&lt;/span&gt;&lt;span&gt;, I use this instead of a Singleton)&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Well done mate!&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Enrico&lt;/span&gt;&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=21841&amp;AppID=7&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item></channel></rss>