connectionMachine = new QStateMachine(this);
disconnected_SM = new QState();
connecting_SM = new QState();
connected_SM = new QState();
statusCheck_SM = new QState();
commsReady_SM = new QState();
disconnected_SM->addTransition(this, SIGNAL(connectToHost_SM()), connecting_SM);
connecting_SM->addTransition(&commandSequencer, SIGNAL(connected()), connected_SM);
connected_SM->addTransition(this, SIGNAL(updatingStatus_SM()), statusCheck_SM);
connectionMachine->addState(disconnected_SM);
connectionMachine->addState(connecting_SM);
connectionMachine->addState(connected_SM);
connectionMachine->addState(statusCheck_SM);
connect(connecting_SM, SIGNAL(entered()), this, SLOT(debugConnecting()));
connect(connected_SM, SIGNAL(entered()), this, SLOT(updateStatus()));
connectionMachine->setInitialState(disconnected_SM);
connectionMachine->start();
connectionMachine = new QStateMachine(this);
disconnected_SM = new QState();
connecting_SM = new QState();
connected_SM = new QState();
statusCheck_SM = new QState();
commsReady_SM = new QState();
disconnected_SM->addTransition(this, SIGNAL(connectToHost_SM()), connecting_SM);
connecting_SM->addTransition(&commandSequencer, SIGNAL(connected()), connected_SM);
connected_SM->addTransition(this, SIGNAL(updatingStatus_SM()), statusCheck_SM);
connectionMachine->addState(disconnected_SM);
connectionMachine->addState(connecting_SM);
connectionMachine->addState(connected_SM);
connectionMachine->addState(statusCheck_SM);
connect(connecting_SM, SIGNAL(entered()), this, SLOT(debugConnecting()));
connect(connected_SM, SIGNAL(entered()), this, SLOT(updateStatus()));
connectionMachine->setInitialState(disconnected_SM);
connectionMachine->start();
To copy to clipboard, switch view to plain text mode
Bookmarks