/*! * \brief sets the sensor configuration and connects the sensor if specified. */ void StationInfoDialog::on_toolButton_ok_clicked() { if(ui->checkBox_connectionChanged->isChecked()){ if(OiFeatureState::getActiveFeature()->getStation()->sensorPad->instrument->getConnectionState()){ emit disconnectSensor(); } //OiFeatureState::getActiveFeature()->getStation()->startDisconnect(); initSensorConfiguration(); OiFeatureState::getActiveFeature()->getStation()->setInstrumentConfig(this->sensorConfig); QMessageBox msgBox; msgBox.setText("Sensor disconnected, because connection config changed."); msgBox.setInformativeText("Want to reconnect?"); msgBox.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel); msgBox.setDefaultButton(QMessageBox::Ok); int ret = msgBox.exec(); switch (ret) { case QMessageBox::Ok: emit connectSensor(); break; case QMessageBox::Cancel: break; default: break; } //OiFeatureState::getActiveFeature()->getStation()->startConnect(OiFeatureState::getActiveFeature()->getStation()->getInstrumentConfig()->connConfig); }else{ initSensorConfiguration(); OiFeatureState::getActiveFeature()->getStation()->setInstrumentConfig(this->sensorConfig); } this->close(); }
void Bubble::reconnectSensor() { disconnectSensor(); connectSensor(); }