// Constructor ChoosePortDialog::ChoosePortDialog(QWidget *parent) : QDialog(parent) { setupUi(this); // Set up the refresh button connect(ui_refreshButton, SIGNAL(clicked()), this, SLOT(refreshPortList())); }
eaps8000UsbWindow::eaps8000UsbWindow( QWidget *parent ) : mLabWindow( parent ), _ui( new Ui::eaps8000UsbWindow ), _setPowerDirectly( false ) { _ui->setupUi( this ); connectPortFunctions(); connectUiElements(); addItems(); refreshPortList(); visibilitySelectionChanged(); }
SerialWaiterDialog::SerialWaiterDialog(QWidget* parent) : QDialog(parent, Qt::WindowTitleHint | Qt::WindowCloseButtonHint), form(new Ui::Dialog), selected(false) { form->setupUi(this); connect(form->refresh_button,&QPushButton::clicked,this, &SerialWaiterDialog::refreshPortList); connect(form->port_list,SIGNAL(activated(int)), this, SLOT(selectPort(int))); connect(form->confirm_button,&QPushButton::clicked,this,[=](){this->accept();}); refreshPortList(); }
elFlowWindow::elFlowWindow( QWidget *parent ) : mLabWindow( parent ), _ui( new Ui::elFlowWindow ) { _ui->setupUi( this ); _ui->frame_pressure->setVisible( false ); _ui->frame_temperature->setVisible( false ); connectPortFunctions(); connectUiElements(); addItems(); refreshPortList(); visibilitySelectionChanged(); }
eaps8000UsbUICharWindow::eaps8000UsbUICharWindow( QWidget *parent ) : mLabWindow( parent ), _ui( new Ui::eaps8000UsbUICharWindow ), _tickCounter( 0 ), _loopCounter( 0 ), _running( false ), _increasing( true ), _setUiValue( 0.0 ), _lastMeasuredValue( 0.0 ) { _ui->setupUi( this ); connectPortFunctions(); connectUiElements(); addItems(); refreshPortList(); calculateRemainingTicks(); _port.setEmitVoltage( true ); _port.setEmitCurrent( true ); _port.setEmitPower( true ); }
KeytrackSerial::KeytrackSerial(QWidget *parent) : QWidget(parent), ui(new Ui::KeytrackSerial) { ui->setupUi(this); _serial_port = new QSerialPort(this); refreshPortList(); //Populate baudRate combo box with baud rate options ui->baudRate->addItem(QString::number(QSerialPort::Baud1200)); ui->baudRate->addItem(QString::number(QSerialPort::Baud2400)); ui->baudRate->addItem(QString::number(QSerialPort::Baud4800)); ui->baudRate->addItem(QString::number(QSerialPort::Baud9600)); ui->baudRate->addItem(QString::number(QSerialPort::Baud19200)); ui->baudRate->addItem(QString::number(QSerialPort::Baud38400)); ui->baudRate->addItem(QString::number(QSerialPort::Baud57600)); ui->baudRate->addItem(QString::number(QSerialPort::Baud115200)); //Preset baud rate selection to 9600 ui->baudRate->setCurrentText(QString::number(QSerialPort::Baud9600)); //Populate parity combo box with parity options ui->parity->addItem("No Parity"); ui->parity->addItem("Even Parity"); ui->parity->addItem("Odd Parity"); ui->parity->addItem("Space Parity"); ui->parity->addItem("Mark Parity"); updatePortSettings(); connect(ui->connectButton,SIGNAL(clicked()),SLOT(connectPort())); connect(ui->disconnectButton, SIGNAL(clicked()),SLOT(disconnectPort())); connect(ui->baudRate,SIGNAL(currentTextChanged(QString)),SLOT(updatePortSettings())); connect(ui->parity,SIGNAL(currentTextChanged(QString)), SLOT(updatePortSettings())); connect(ui->dataBits,SIGNAL(currentTextChanged(QString)),SLOT(updatePortSettings())); connect(ui->stopBits,SIGNAL(currentTextChanged(QString)),SLOT(updatePortSettings())); connect(_serial_port, SIGNAL(readyRead()),SLOT(handleReadyRead())); connect(ui->sendButton,SIGNAL(clicked()),SLOT(sendTextFromBox())); connect(ui->sendBox,SIGNAL(returnPressed()),SLOT(sendTextFromBox())); connect(this,SIGNAL(destroyed()),SLOT(disconnectPort())); }
void eaps8000UsbUICharWindow::resetInfo() { _port.clearPortErrors(); if( _port.isRunning() ) { _ui->lbl_info->setText( _port.idString() ); _ui->lbl_info->setStyleSheet( "" ); _ui->btn_connect->setText( DISCONNECT_PORT ); _ui->btn_connect->setEnabled( true ); emit changeWindowState( this->windowTitle(), true ); } else { _ui->lbl_info->setText( "-" ); _ui->lbl_info->setStyleSheet( "" ); _ui->btn_connect->setText( CONNECT_PORT ); refreshPortList(); } }
//Show the dialog, refresh the port list, and run the dialog int ChoosePortDialog::exec() { show(); refreshPortList(); return QDialog::exec(); }
Detail() : inProbe(new RtMidiIn()) , outProbe(new RtMidiOut()) { refreshPortList(); }