diff options
Diffstat (limited to 'scc/examples/algotest')
-rw-r--r-- | scc/examples/algotest/algotest.pro | 6 | ||||
-rw-r--r-- | scc/examples/algotest/main.cpp | 56 | ||||
-rw-r--r-- | scc/examples/algotest/test.scxml | 145 |
3 files changed, 0 insertions, 207 deletions
diff --git a/scc/examples/algotest/algotest.pro b/scc/examples/algotest/algotest.pro deleted file mode 100644 index e5a1eba..0000000 --- a/scc/examples/algotest/algotest.pro +++ /dev/null @@ -1,6 +0,0 @@ -TEMPLATE = app -SOURCES += main.cpp -OTHER_FILES += test.scxml -STATECHARTS += test.scxml -CONFIG += scc console -QT -= gui diff --git a/scc/examples/algotest/main.cpp b/scc/examples/algotest/main.cpp deleted file mode 100644 index c8b74e1..0000000 --- a/scc/examples/algotest/main.cpp +++ /dev/null @@ -1,56 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtCore module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://www.qtsoftware.com/contact. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "sc_test.h" -#include <QCoreApplication> -#include <QTimer> -int main(int argc, char *argv[]) -{ - QCoreApplication a(argc, argv); - SMClass_test stateMachine; - stateMachine.setupStateMachine(); - stateMachine.start(); - QObject::connect(stateMachine.state_Test2Sub1,SIGNAL(entered()),&stateMachine,SIGNAL(event_Event2())); - QObject::connect(&stateMachine,SIGNAL(finished()),&a,SLOT(quit())); - QTimer::singleShot(100,&stateMachine,SIGNAL(event_Event1())); - return a.exec(); -} - diff --git a/scc/examples/algotest/test.scxml b/scc/examples/algotest/test.scxml deleted file mode 100644 index e17f9bf..0000000 --- a/scc/examples/algotest/test.scxml +++ /dev/null @@ -1,145 +0,0 @@ -<?xml version="1.0" encoding="UTF8"?> -<!-- A wrapper state that contains all other states in this file -- it represents the complete state machine --> <scxml xmlns="http://www.w3.org/2005/07/scxml" - version="1.0" - initial="Main"> - <state id="Main"> - <!-- its initial state is Test1 --> - <initial> - <transition target="Test1"/> - </initial> - - <!-- Really simple state showing the basic syntax. --> - <state id="Test1"> - <initial> - <transition target="Test1Sub1"/> - </initial> - <!-- Runs before we go into the substate --> - <onentry> - <log expr=""Inside Test1""/> - </onentry> - - <!-- Here is our first substate --> - <state id="Test1Sub1"> - <onentry> - <log expr=""Inside Test1Sub1.""/> - </onentry> - <onexit> - <log expr=""Leaving Test1Sub1""/> - </onexit> - <!-- Go to Sub2 on Event1 --> - <transition event="Event1" target="Test1Sub2"/> - </state> - - <!-- Here is the second substate - It is final, so Test1 is done when we get here --> - <final id="Test1Sub2"/> - - <!-- We get this event when we reach Test1Sub2. --> - <transition event="done.state.Test1" target="Test2"/> - - <!-- We run this on the way out of Test1 --> - <onexit> - <log expr=""Leaving Test1...""/> - </onexit> - </state> - - <state id="Test2"> - <initial> - <transition target="Test2Sub1"/> - </initial> - - <!-- This time we reference a state - defined in an external file. Note that we could have - loaded the entire file by leaving off the #Test2Sub1, - but in that case we would need to rename one of the - Test2Sub1 states (here or in the external file) to - avoid the name collision --> - <state id="Test2Sub1"> - <onentry> - <log expr=""Inside Test2Sub1""/> - </onentry> - <transition event="Event2" target="Test2Sub2"/> - </state> - <final id="Test2Sub2"/> - - <!-- Test2Sub2 is defined as final, so this - event is generated when we reach it --> - <transition event="done.state.Test2" target="Test3"/> - </state> - - <state id="Test3"> - <initial> - <transition target="Test3Sub1"/> - </initial> - - <state id="Test3Sub1"> - <onentry> - <log expr=""Inside Test3Sub1...""/> - <!-- Send our self an event in 5s --> - <send event="Timer" delay="1500"/> - </onentry> - <!-- Transition on to Test4. - This will exit both us and our parent. --> - <transition event="Timer" target="Test4"/> - <onexit> - <log expr=""Leaving Test3Sub1...""/> - </onexit> - </state> - - <onexit> - <log expr=""Leaving Test3...""/> - </onexit> - </state> - - <state id="Test4"> - <onentry> - <log expr=""Inside Test4...""/> - </onentry> - <initial> - <transition target="Test4Sub1"/> - </initial> - - <state id="Test4Sub1"> - <onexit> - <log expr=""Leaving Test4Sub1...""/> - </onexit> - <!-- This transition causes the state to exit immediately - after entering Test4Sub1. The transition has no event - or guard so it is always active --> - <transition target="Test5"/> - </state> - </state> - - <state id="Test5"> - <onentry> - <log expr=""Inside Test5...""/> - </onentry> - <initial> - <transition target="Test5P"/> - </initial> - - <!-- Fire off our parallel states --> - <parallel id="Test5P"> - <final id="Test5PSub1"/> - <final id="Test5PSub2"/> - <onexit> - <log expr=""all parallel states done""/> - </onexit> - </parallel> - - <!-- The parallel states are all final, so this - event is generated immediately. Although not shown, - compound states (i.e., <state>s with content) - are permitted within <parallel> as well. --> - <transition event="done.state.Test5P" target="Done"/> - </state> - - <!-- This final state is an immediate child of Main - - when we get here, done.state.Main is generated. --> - <final id="Done"/> - <!-- End of Main > --> - <transition event="done.state.Main" target="final" /> - </state> - <final id="final"/> -</scxml> |