OpalLinkConfigurationWindow.cc 979 Bytes
Newer Older
1 2 3
#include "OpalLinkConfigurationWindow.h"

OpalLinkConfigurationWindow::OpalLinkConfigurationWindow(OpalLink* link,
4 5
        QWidget *parent,
        Qt::WindowFlags flags) :
6 7 8 9 10 11 12 13 14 15 16
    QWidget(parent, flags),
    link(link)

{


    ui.setupUi(this);

    ui.opalInstIDSpinBox->setValue(this->link->getOpalInstID());

    connect(ui.opalInstIDSpinBox, SIGNAL(valueChanged(int)), link, SLOT(setOpalInstID(int)));
17
    connect(link, &LinkInterface::connected, this, OpalLinkConfigurationWindow::_linkConnected);
18
    connect(link, &LinkInterface::disconnected, this, OpalLinkConfigurationWindow::_linkDisconnected);
19 20 21
    this->show();
}

22 23 24 25 26 27 28 29 30 31 32
void OpalLinkConfigurationWindow::_linkConnected(void)
{
    _allowSettingsAccess(true);
}

void OpalLinkConfigurationWindow::_linkConnected(void)
{
    _allowSettingsAccess(false);
}

void OpalLinkConfigurationWindow::_allowSettingsAccess(bool enabled)
33 34 35 36
{
    ui.paramFileButton->setEnabled(enabled);
    ui.servoConfigFileButton->setEnabled(enabled);
}