void BedienelementController::initMachine()
{
_machine = new QStateMachine(this);
initState();
}
void BedienelementController::initState()
{
_stateList.append(new QState());
_stateList.append(new QState());
_stateList.append(new QState());
_stateList.at(0)->addTransition(this, SIGNAL(jsRechts()), _stateList.at(1));
_stateList.at(1)->addTransition(this, SIGNAL(jsRechts()), _stateList.at(2));
_stateList.at(2)->addTransition(this, SIGNAL(jsRechts()), _stateList.at(0));
_machine->addState(_stateList.at(0));
_machine->addState(_stateList.at(1));
_machine->addState(_stateList.at(2));
_machine->setInitialState(_stateList.at(0));
_machine->start();
_stateList.at(0)->assignProperty(_textFelderH.at(0), "pos", *_punkteListe.at(0));
_stateList.at(0)->assignProperty(_textFelderH.at(1), "pos", *_punkteListe.at(1));
_stateList.at(0)->assignProperty(_textFelderH.at(2), "pos", *_punkteListe.at(2));
_stateList.at(1)->assignProperty(_textFelderH.at(0), "pos", *_punkteListe.at(1));
_stateList.at(1)->assignProperty(_textFelderH.at(1), "pos", *_punkteListe.at(2));
_stateList.at(1)->assignProperty(_textFelderH.at(2), "pos", *_punkteListe.at(0));
_stateList.at(2)->assignProperty(_textFelderH.at(0), "pos", *_punkteListe.at(2));
_stateList.at(2)->assignProperty(_textFelderH.at(1), "pos", *_punkteListe.at(0));
_stateList.at(2)->assignProperty(_textFelderH.at(2), "pos", *_punkteListe.at(1));
qDebug() << _machine->isRunning();
}
void BedienelementController::initMachine()
{
_machine = new QStateMachine(this);
initState();
}
void BedienelementController::initState()
{
_stateList.append(new QState());
_stateList.append(new QState());
_stateList.append(new QState());
_stateList.at(0)->addTransition(this, SIGNAL(jsRechts()), _stateList.at(1));
_stateList.at(1)->addTransition(this, SIGNAL(jsRechts()), _stateList.at(2));
_stateList.at(2)->addTransition(this, SIGNAL(jsRechts()), _stateList.at(0));
_machine->addState(_stateList.at(0));
_machine->addState(_stateList.at(1));
_machine->addState(_stateList.at(2));
_machine->setInitialState(_stateList.at(0));
_machine->start();
_stateList.at(0)->assignProperty(_textFelderH.at(0), "pos", *_punkteListe.at(0));
_stateList.at(0)->assignProperty(_textFelderH.at(1), "pos", *_punkteListe.at(1));
_stateList.at(0)->assignProperty(_textFelderH.at(2), "pos", *_punkteListe.at(2));
_stateList.at(1)->assignProperty(_textFelderH.at(0), "pos", *_punkteListe.at(1));
_stateList.at(1)->assignProperty(_textFelderH.at(1), "pos", *_punkteListe.at(2));
_stateList.at(1)->assignProperty(_textFelderH.at(2), "pos", *_punkteListe.at(0));
_stateList.at(2)->assignProperty(_textFelderH.at(0), "pos", *_punkteListe.at(2));
_stateList.at(2)->assignProperty(_textFelderH.at(1), "pos", *_punkteListe.at(0));
_stateList.at(2)->assignProperty(_textFelderH.at(2), "pos", *_punkteListe.at(1));
qDebug() << _machine->isRunning();
}
To copy to clipboard, switch view to plain text mode
Bookmarks