示例#1
0
/*!
 * \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();
}
示例#2
0
void
Bubble::reconnectSensor()
{
    disconnectSensor();
    connectSensor();
}