@@ -159,6 +159,36 @@ For Qt SCXML applications you may include [scxmlexternmonitor2.h](../Include/scx
159159
160160![ CalculatorDebug] ( ../Images/CalculatorDebug.gif )
161161
162+ #### Option to pass event or custom data to CallStack View
163+ If you need to pass event or custom data to CallStack view, you can override monitor class.
164+
165+ ![ Debug_ProcessEventData] ( ../Images/Debug_ProcessEventData.png )
166+
167+ ``` cpp
168+ class MyMonitor : public Scxmlmonitor ::UDPScxmlExternMonitor {
169+ public:
170+ inline explicit MyMonitor(QObject * parent = nullptr): Scxmlmonitor::UDPScxmlExternMonitor(parent) {}
171+ protected:
172+ inline virtual void processEventMessage(QScxmlStateMachine * machine, const QString &id, const QScxmlEvent &event) {
173+ const QString sEventData = event.data().toString();
174+ processMonitorMessage(machine->name(),
175+ id,
176+ sEventData.isEmpty() ? event.name() : (event.name() + ": [ " + sEventData + "] "),
177+ Scxmlmonitor::smttBeforeTakingTransition);
178+ // ---> example: add custom info to all events, that starts with 'in.'
179+ if (event.name().startsWith("in.")) {
180+ processMonitorMessage(machine->name(),
181+ id,
182+ "my custom data: " + sEventData,
183+ Scxmlmonitor::smttBeforeProcessingEvent);
184+ }
185+ }
186+ };
187+ ```
188+
189+ You should enable custom data types in ScxmlEditor settings if you want to receive it in CallStack View
190+ 
191+
162192## Custom testing application setup
163193Since version 2.1.8 there is an option to communicate with testing applications via pipes.
164194#### Example: how to setup [The SCION command-line tool](https://gitlab.com/scion-scxml/cli) as custom testing application
0 commit comments