<?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[Best way to interchange state machines?]]></title><description><![CDATA[<p dir="auto">I have an interface that I want my back end to react differently based on the state machine.</p>
<p dir="auto">basically, state machine detects button presses, and transitions based on how it was configured. Is there an easy way to reset the transitions and remake them?</p>
<p dir="auto">My UI has 6 buttons and sets a device with up to 8 modes. I want the state machine to have three distinct operating modes:</p>
<p dir="auto">6 button on/off: device plays mode specific sound on loop until a different mode is selected or the same mode is selected, toggling the sound off.</p>
<p dir="auto">4 button on/off with volume buttons: device has 4 mode buttons, and two that raise or lower the volume.</p>
<p dir="auto">4 button on/off with volume buttons: device has 4 mode buttons which rotate between two modes and the off state, allowing the device to have 8 modes total, and two volume buttons.</p>
<p dir="auto">I understand the logic in the state machine behind implementing each of these, but I need a clean way to change between each of these separate state machines. Here are my options:</p>
<p dir="auto">Option 1: 1 state machine to rule them all: create a single giant state machine with 3 different parent states.</p>
<p dir="auto">Option 2: create three separate state machines objects, perhaps all inheriting from one parent which contains virtual methods.</p>
<p dir="auto">Option 3: create a single smaller object, with slots that allow it to set/reset the transitions between states when the mode changes.</p>
<p dir="auto">Is there a better idea from a design/architect standpoint or which would you recommend of the above?</p>
]]></description><link>https://forum.qt.io/topic/45774/best-way-to-interchange-state-machines</link><generator>RSS for Node</generator><lastBuildDate>Wed, 11 Nov 2026 21:49:09 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/45774.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 09 Sep 2014 18:10:09 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Best way to interchange state machines? on Wed, 10 Sep 2014 03:39:59 GMT]]></title><description><![CDATA[<p dir="auto">This isn't really a Qt question.</p>
<p dir="auto">I would personally go with Option 2 though.</p>
<p dir="auto">You would probably get better results on a C++ based message board, maybe "<a href="http://stackoverflow.com" target="_blank" rel="noopener noreferrer nofollow ugc">stackoverflow.com</a>":www.stackoverflow.com...</p>
]]></description><link>https://forum.qt.io/post/243199</link><guid isPermaLink="true">https://forum.qt.io/post/243199</guid><dc:creator><![CDATA[ambershark]]></dc:creator><pubDate>Wed, 10 Sep 2014 03:39:59 GMT</pubDate></item></channel></rss>