<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[programming model]]></title><description><![CDATA[<p dir="auto">what is the model being used for both module and helper?</p>
<p dir="auto">where and how do I declare variables?  either global or instance?  (not method variables)</p>
<p dir="auto">in a helper if I declare outside the NodeHelper.create(…), they are truely global, and other helpers will overwrite my variables if the names collide.</p>
]]></description><link>https://forum.magicmirror.builders/topic/7185/programming-model</link><generator>RSS for Node</generator><lastBuildDate>Tue, 09 Jun 2026 21:46:11 GMT</lastBuildDate><atom:link href="https://forum.magicmirror.builders/topic/7185.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 17 May 2018 19:32:04 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to programming model on Fri, 18 May 2018 22:11:21 GMT]]></title><description><![CDATA[<p dir="auto">thanks… the image is not shown in the dom, it is shown in a separate ‘browserwindow’, floating over the dom.   i just loadUrl the image into the window, after creating and positioning it.<br />
the mirror code doesn’t know the images are there</p>
<p dir="auto">pictorial calendar reminders.</p>
<p dir="auto">I have tested that the helper needs to do all this window mgmt</p>
<p dir="auto">The scheduler module does scheduling (compare db data to calendar entries), start/stop viewer(s), and provide indirect services to load images depending on their source (file, dropbox, google drive, one drive).</p>
<p dir="auto">The viewer module just walks thru a list of urls (getNext()) and opens a window hidden, loads image, hides old window, shows new window, deletes old window. (avoid dead window during load and, minimize screen flash)</p>
]]></description><link>https://forum.magicmirror.builders/post/39627</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/39627</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Fri, 18 May 2018 22:11:21 GMT</pubDate></item><item><title><![CDATA[Reply to programming model on Fri, 18 May 2018 21:32:34 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sdetweil" aria-label="Profile: sdetweil">@<bdi>sdetweil</bdi></a> I don’t think that. The helper is running on your Raspberry Pi, the module is running in every browser instance you open.</p>
<p dir="auto">You need to coordinate your “show image event” from the helper and send out a notification to the module what image to show.</p>
<p dir="auto">The ViewManagement must be in the module, the image downloading, handling must be in the helper.</p>
<p dir="auto">Note: You only have one helper, but you can have multiple modules!</p>
]]></description><link>https://forum.magicmirror.builders/post/39626</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/39626</guid><dc:creator><![CDATA[idoodler]]></dc:creator><pubDate>Fri, 18 May 2018 21:32:34 GMT</pubDate></item><item><title><![CDATA[Reply to programming model on Fri, 18 May 2018 21:25:29 GMT]]></title><description><![CDATA[<p dir="auto">yeh, but all this notification event handling really messes up the code i have which is all angular promise based.</p>
<p dir="auto">I want to open my own browserwindow (show image), but u can’t do that in a module, only in a helper,<br />
but then the window handle object needs to be stored inside the object which is managing the list of images for this ‘viewer’. that object is stored in the module…  so, how do I transport the window handle object to the module…  is the object valid in the other context (helper vs module).</p>
<p dir="auto">see the topic ‘what can i do in a module’.  (which u already have)</p>
]]></description><link>https://forum.magicmirror.builders/post/39624</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/39624</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Fri, 18 May 2018 21:25:29 GMT</pubDate></item><item><title><![CDATA[Reply to programming model on Fri, 18 May 2018 21:18:59 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sdetweil" aria-label="Profile: sdetweil">@<bdi>sdetweil</bdi></a> I solved this problem by using <code>this.sendSocketNotification</code> This allows me to communicate with the modules interface.</p>
]]></description><link>https://forum.magicmirror.builders/post/39622</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/39622</guid><dc:creator><![CDATA[idoodler]]></dc:creator><pubDate>Fri, 18 May 2018 21:18:59 GMT</pubDate></item><item><title><![CDATA[Reply to programming model on Fri, 18 May 2018 20:00:54 GMT]]></title><description><![CDATA[<p dir="auto">not class variable (I got that now), but shared would solve a ton of problems.</p>
]]></description><link>https://forum.magicmirror.builders/post/39620</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/39620</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Fri, 18 May 2018 20:00:54 GMT</pubDate></item><item><title><![CDATA[Reply to programming model on Fri, 18 May 2018 19:57:20 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sdetweil" aria-label="Profile: sdetweil">@<bdi>sdetweil</bdi></a> Wait, I think I misunderstoodyour question.</p>
<p dir="auto">Do you want to have a class variable just in your <code>node_helper.js</code>, or do you want to share a variable between <code>node_helper.js</code> and your <code>MMM-ModuleName.js</code> file?</p>
]]></description><link>https://forum.magicmirror.builders/post/39618</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/39618</guid><dc:creator><![CDATA[idoodler]]></dc:creator><pubDate>Fri, 18 May 2018 19:57:20 GMT</pubDate></item><item><title><![CDATA[Reply to programming model on Fri, 18 May 2018 19:54:37 GMT]]></title><description><![CDATA[<p dir="auto">i have a lot of code running in another node/angular mirror app and have never seen this syntax…</p>
]]></description><link>https://forum.magicmirror.builders/post/39617</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/39617</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Fri, 18 May 2018 19:54:37 GMT</pubDate></item><item><title><![CDATA[Reply to programming model on Fri, 18 May 2018 19:53:34 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sdetweil" aria-label="Profile: sdetweil">@<bdi>sdetweil</bdi></a> Thats simply how to define a variable inside an object in node.js :grinning_face_with_smiling_eyes:</p>
]]></description><link>https://forum.magicmirror.builders/post/39616</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/39616</guid><dc:creator><![CDATA[idoodler]]></dc:creator><pubDate>Fri, 18 May 2018 19:53:34 GMT</pubDate></item><item><title><![CDATA[Reply to programming model on Fri, 18 May 2018 19:52:10 GMT]]></title><description><![CDATA[<p dir="auto">thanks…</p>
<p dir="auto">strange syntax tho…</p>
]]></description><link>https://forum.magicmirror.builders/post/39615</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/39615</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Fri, 18 May 2018 19:52:10 GMT</pubDate></item><item><title><![CDATA[Reply to programming model on Fri, 18 May 2018 19:45:28 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sdetweil" aria-label="Profile: sdetweil">@<bdi>sdetweil</bdi></a> If you want class variables you can do the following:</p>
<pre><code>module.exports = NodeHelper.create({

    variable1: true,          // This is one way

    start: function() {
        this.variable2 = true // This is another way

       // Both variables can be accessed via this.VARIABLE_NAME
    }
 });
</code></pre>
]]></description><link>https://forum.magicmirror.builders/post/39613</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/39613</guid><dc:creator><![CDATA[idoodler]]></dc:creator><pubDate>Fri, 18 May 2018 19:45:28 GMT</pubDate></item></channel></rss>