mainwindowui.cpp
57 lines
| 2.4 KiB
| text/x-c
|
CppLexer
/ spwtimegenerator / mainwindowui.cpp
r14 | #include "mainwindowui.h" | |||
mainwindowui::mainwindowui(QWidget *parent) : | ||||
QWidget(parent) | ||||
{ | ||||
starDundeeStatusQueryDialog = new QDialog; | ||||
connection_LAYOUT = new QGridLayout; | ||||
usbDeviceNumber_LABEL = new QLabel(tr("USB device number: ")); | ||||
linkNumber_LABEL = new QLabel(tr("SpaceWire link number: ")); | ||||
starDundeeStatusQueryDialogLabel = new QLabel(tr("SpaceWire link not running")); | ||||
//*** QPUSHBUTTON ***// | ||||
starDundeeStatusQueryRetryButton = new QPushButton(tr("Retry")); | ||||
starDundeeStatusQueryAbortButton = new QPushButton(tr("Abort")); | ||||
startTimeButton = new QPushButton(tr("start sending time packets and timecodes periodically")); | ||||
sendTimecodeButton = new QPushButton(tr("send one timecode")); | ||||
sendPacketAndTimecodeButton = new QPushButton(tr("send time packet and timecode")); | ||||
usbDeviceNumber_SPINBOX = new QSpinBox; | ||||
usbDeviceNumber_SPINBOX->setRange(0,32); | ||||
usbDeviceNumber_SPINBOX->setValue(0); | ||||
linkNumber_SPINBOX = new QSpinBox; | ||||
linkNumber_SPINBOX->setRange(1,2); | ||||
linkNumber_SPINBOX->setValue(1); | ||||
console = new QTextEdit; | ||||
// STAR DUNDEE STATUS QUERY DIALOG | ||||
starDundeeStatusQueryDialogLayout = new QGridLayout; | ||||
starDundeeStatusQueryDialogLayout->addWidget(starDundeeStatusQueryDialogLabel, 0, 0, 1, 2); | ||||
starDundeeStatusQueryDialogLayout->addWidget(starDundeeStatusQueryRetryButton, 1, 0, 0); | ||||
starDundeeStatusQueryDialogLayout->addWidget(starDundeeStatusQueryAbortButton, 1, 1, 0); | ||||
starDundeeStatusQueryDialog->setLayout(starDundeeStatusQueryDialogLayout); | ||||
connection_LAYOUT->addWidget(usbDeviceNumber_LABEL, 0, 0, 1, 1); | ||||
connection_LAYOUT->addWidget(usbDeviceNumber_SPINBOX, 0, 1, 1, 1); | ||||
connection_LAYOUT->addWidget(linkNumber_LABEL, 1, 0, 1, 1); | ||||
connection_LAYOUT->addWidget(linkNumber_SPINBOX, 1, 1, 1, 1); | ||||
connection_LAYOUT->addWidget(sendTimecodeButton, 2, 0, 1, 2); | ||||
connection_LAYOUT->addWidget(sendPacketAndTimecodeButton, 3, 0, 1, 2); | ||||
connection_LAYOUT->addWidget(startTimeButton, 4, 0, 1, 2); | ||||
connection_LAYOUT->addWidget(console, 5, 0, 3, 3); | ||||
//connection_LAYOUT->setRowStretch(6, 1); | ||||
connection_LAYOUT->setColumnStretch(2, 1); | ||||
this->setLayout(connection_LAYOUT); | ||||
connect(starDundeeStatusQueryAbortButton, SIGNAL(clicked()), starDundeeStatusQueryDialog, SLOT(reject())); | ||||
} | ||||
void mainwindowui::displayMessage(QString message) | ||||
{ | ||||
this->console->append(message); | ||||
} | ||||