Example #1
0
Bluetooth::Bluetooth(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Bluetooth)
{
    ui->setupUi(this);

    system("echo 1 > /dev/swzb");

    currentAddr = NULL;
    sensorType = 0;
    myCom = new Communiate(this);

    pollTimer = new QTimer(this);

    ui->scanBtn->setEnabled(false);
    ui->connectBtn->setEnabled(false);
    ui->groupBox->setEnabled(false);
    ui->groupBox_2->setEnabled(false);
    ui->groupBox_3->setEnabled(false);

    connect(pollTimer, SIGNAL(timeout()), this, SLOT(onPollTimerTimeout()));

    connect(myCom, SIGNAL(recvRspInfo(unsigned char*)), this, SLOT(onRecvRspInfo(unsigned char *)));
    connect(ui->switchBtn, SIGNAL(clicked()), this, SLOT(onSwitchClicked()));
    connect(ui->scanBtn, SIGNAL(clicked()), this, SLOT(onSanClicked()));
    connect(ui->addrList, SIGNAL(currentRowChanged(int)), this, SLOT(onAddrChanged(int)));
    connect(ui->connectBtn, SIGNAL(clicked()), this, SLOT(onConnectClicked()));
    connect(ui->openBtn, SIGNAL(clicked()), this, SLOT(onOpenClicked()));
    connect(ui->closeBtn, SIGNAL(clicked()), this, SLOT(onCloseClicked()));
}
void CdoSampleAppWindow::setupBindings()
{
    QObject::connect(ui->playTestSndBtn, SIGNAL(clicked()),
                     &_appController,  SLOT(playTestSndClicked()));
    QObject::connect(ui->disconnectBtn, SIGNAL(clicked()),
                     &_appController,  SLOT(disconnectBtnClicked()));

    QObject::connect(ui->camCombo, SIGNAL(currentIndexChanged(int)),
                     this, SLOT(onVideoDeviceSelected(int)));
    QObject::connect(ui->micCombo, SIGNAL(currentIndexChanged(int)),
                     this, SLOT(onMicSelected(int)));
    QObject::connect(ui->spkCombo, SIGNAL(currentIndexChanged(int)),
                     this, SLOT(onSpeakerSelected(int)));

    QObject::connect(&_appController, SIGNAL(cdoReady(void*, QString)),
                     this, SLOT(onADLPlatformReady(void*, QString)));

    QObject::connect(&_appController,
                     SIGNAL(mediaDevicesListChanged(int, QVariantMap)),
                     this, SLOT(onMediaDevicesListChanged(int, QVariantMap)));

    QObject::connect(&_appController, SIGNAL(connected()),
                     this, SLOT(onConnected()));
    QObject::connect(&_appController, SIGNAL(disconnected()),
                     this, SLOT(onDisconnected()));

    QObject::connect(&_appController, SIGNAL(localVideoSinkChanged(QString)),
                     this, SLOT(onLocalPreviewSinkChanged(QString)));
    QObject::connect(&_appController, SIGNAL(remoteVideoSinkChanged(QString)),
                     this, SLOT(onRemotePreviewSinkChanged(QString)));
    QObject::connect(&_appController, SIGNAL(remoteScreenSinkChanged(QString)),
                     this, SLOT(onRemoteScreenSinkChanged(QString)));

    QObject::connect(ui->connectBtn, SIGNAL(clicked()),
                     this, SLOT(onConnectClicked()));

    QObject::connect(ui->publishAudioChck, SIGNAL(clicked(bool)),
                     &_appController, SLOT(audioPublishStateChanged(bool)));
    QObject::connect(ui->publishVideoChck, SIGNAL(clicked(bool)),
                     &_appController, SLOT(videoPublishStateChanged(bool)));
    QObject::connect(ui->publishScreenChck, SIGNAL(clicked(bool)),
                     this, SLOT(onScreenPublishStateChanged(bool)));

    QObject::connect(ui->sendMessageBtn, SIGNAL(clicked()),
                     &_appController, SLOT(sendMessageClicked()));
    QObject::connect(&_appController, SIGNAL(messageReceived(QString)),
                     this, SLOT(onMessageReceived(QString)));
}
Example #3
0
ConnectionManager::ConnectionManager(Internal::MainWindow *mainWindow, QTabWidget *modeStack) :
    QWidget(mainWindow),
    m_availableDevList(0),
    m_connectBtn(0),
    m_ioDev(NULL),
    polling(true),
    m_mainWindow(mainWindow)
{
    QHBoxLayout *layout = new QHBoxLayout;
    layout->setSpacing(5);
    layout->setContentsMargins(0,0,0,0);

    m_monitorWidget = new TelemetryMonitorWidget(this);
    AlarmsMonitorWidget::getInstance().init(m_monitorWidget->getRenderer(),m_monitorWidget->getBackgroundItem());
    layout->addWidget(m_monitorWidget, Qt::AlignHCenter);

    layout->addWidget(new QLabel(tr("Connections:")));

    m_availableDevList = new QComboBox;
    m_availableDevList->setMinimumWidth(100);
    m_availableDevList->setMaximumWidth(150);
    m_availableDevList->setContextMenuPolicy(Qt::CustomContextMenu);
    layout->addWidget(m_availableDevList);

    m_connectBtn = new QPushButton(tr("Connect"));
    m_connectBtn->setEnabled(false);
    layout->addWidget(m_connectBtn);

    setLayout(layout);

    modeStack->setCornerWidget(this, Qt::TopRightCorner);

    QObject::connect(m_connectBtn, SIGNAL(clicked()), this, SLOT(onConnectClicked()));

    // setup our reconnect timers
    reconnect = new QTimer(this);
    reconnectCheck = new QTimer(this);
    connect(reconnect,SIGNAL(timeout()),this,SLOT(reconnectSlot()));
    connect(reconnectCheck,SIGNAL(timeout()),this,SLOT(reconnectCheckSlot()));

    connect(this, SIGNAL(connectDeviceFailed(DevListItem*)), this, SLOT(onConnectDeviceFailed(DevListItem*)));
}