void HockeyGame::connectWithSerialSimulator(CGSimulator *console) { connect(console, SIGNAL(serialConnected()), this->getGameClock(), SLOT(usingSerialClock())); connect(console, SIGNAL(serialConnected()), this, SIGNAL(usingAllSport())); connect(console, SIGNAL(serialConnected()), &sb, SLOT(usingAllSport())); connect(console, SIGNAL(dataReceived(QByteArray)), this, SLOT(parseAllSportCG(QByteArray))); }
void HockeyGame::connectWithSerialHandler(SerialConsole *console) { connect(console, SIGNAL(serialConnected()), this->getGameClock(), SLOT(usingSerialClock())); connect(console, SIGNAL(serialConnected()), this, SIGNAL(usingAllSport())); connect(console, SIGNAL(serialConnected()), &sb, SLOT(usingAllSport())); connect(console, SIGNAL(dataReceived(QByteArray)), this, SLOT(parseAllSportCG(QByteArray))); connect(console, SIGNAL(serialDisconnected()), this->getGameClock(), SLOT(noLongerUsingSerialClock())); connect(console, SIGNAL(serialDisconnected()), this, SIGNAL(usingInternalClock())); connect(console, SIGNAL(serialDisconnected()), &sb, SLOT(usingInternalClocks())); connect(console, SIGNAL(serialDisconnected()), &cgTimer, SLOT(stop())); serialConsole = console; }
msl::msl(QWidget *parent) : QWidget(parent), serialConnection("","","",""/*Manufacturer String*/,""/*Product String*/) { ui.setupUi(this); //Create QColorDialog this->colorDialog = new QColorDialog(this); this->colorDialog->setWindowFlags(Qt::Widget); //Remove buttons and dialog this->colorDialog->setOptions( QColorDialog::DontUseNativeDialog | QColorDialog::NoButtons); //SetColor this->colorDialog->setCurrentColor(QColor(Qt::black)); this->ui.LayoutForColorSelector->addWidget(colorDialog); //Connect the colorChanged signal connect(this->colorDialog, SIGNAL(currentColorChanged(QColor)), this, SLOT(colorChanged(QColor))); //Hide the EEProm settings-box this->ui.groupBox_EEProm->hide(); //Disable the GUI as long as there is no connection to the serial this->setDisabled(1); //Connect the signals connect(&this->serialConnection, SIGNAL(serialAbortedConnect(int)), this, SLOT(serialConnectionAbort(int))); connect(&this->serialConnection, SIGNAL(waitingForRetry()), this, SLOT(serialWaitingForRetry())); connect(&this->serialConnection, SIGNAL(serialConnected()), this, SLOT(serialConnected())); connect(this, SIGNAL(retry()), &this->serialConnection, SLOT(retryConnect())); connect(this, SIGNAL(sendArray(QByteArray)),&this->serialConnection,SLOT(sendArray(QByteArray))); //Start serial connection thread serialConnection.start(); serialConnection.setStopBits(qUSBSerial::StopBits_2); //Connect to Microscope Light serialConnection.serialConnect(); }