OpenCores
URL https://opencores.org/ocsvn/bw_tiff_compression/bw_tiff_compression/trunk

Subversion Repositories bw_tiff_compression

[/] [bw_tiff_compression/] [trunk/] [client_application/] [src/] [GUI/] [PortSelectionDialog.cpp] - Blame information for rev 16

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 16 amulder
/*
2
 * @file     PortSelectionDialog.cpp
3
 * @date     May 14, 2012
4
 * @author   Aart Mulder
5
 */
6
 
7
#include "PortSelectionDialog.h"
8
#include "ui_PortSelectionDialog.h"
9
 
10
CPortSelectionDialog::CPortSelectionDialog(QWidget *parent) :
11
    QDialog(parent),
12
    ui(new Ui::CPortSelectionDialog)
13
{
14
    ui->setupUi(this);
15
 
16
    ui->BaudrateComboBox->addItem("9600", QVariant(9600));
17
    ui->BaudrateComboBox->addItem("19200", QVariant(19200));
18
    ui->BaudrateComboBox->addItem("38400", QVariant(38400));
19
    ui->BaudrateComboBox->addItem("57600", QVariant(57600));
20
    ui->BaudrateComboBox->addItem("115200", QVariant(115200));
21
    ui->BaudrateComboBox->addItem("230400", QVariant(230400));
22
    ui->BaudrateComboBox->setCurrentIndex(0);
23
}
24
 
25
CPortSelectionDialog::~CPortSelectionDialog()
26
{
27
    delete ui;
28
}
29
 
30
void CPortSelectionDialog::UpdateList(QList<QString> sPortNames)
31
{
32
        ui->PortsComboBox->clear();
33
        ui->PortsComboBox->addItems(QStringList(sPortNames));
34
        if(ui->PortsComboBox->count() > 0)
35
                ui->PortsComboBox->setCurrentIndex(0);
36
}
37
 
38
QString CPortSelectionDialog::GetPortname()
39
{
40
        return this->ui->PortsComboBox->currentText();
41
}
42
 
43
quint32 CPortSelectionDialog::GetBaudrate()
44
{
45
    return (quint32)ui->BaudrateComboBox->itemData(ui->BaudrateComboBox->currentIndex()).toInt();
46
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.