MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow)
{    
    qRegisterMetaType<Packet>();

    ui->setupUi(this);

    _packetsReceivedCount = 0;
    _crcErrorCount = 0;
    _bytesSkippedCount = 0;

    _ioDevice = NULL;
    _logParser = NULL;
    _parserThread = new QThread();

    initToolbar();
    initStatusbar();

    _timestampMin = QDateTime::currentDateTime().toTime_t();
    _timestampMax = QDateTime::currentDateTime().toTime_t();

    ui->plotWidget->xAxis->setLabel("timestamp");
    ui->plotWidget->yAxis->setLabel("RSS [dBm]");
    ui->plotWidget->yAxis->setRange(-120, 0);
    ui->plotWidget->xAxis->setTickLabelType(QCPAxis::ltDateTime);
    ui->plotWidget->xAxis->setDateTimeFormat("hh:mm:ss:zzz");
    ui->plotWidget->xAxis->setTickLabelFont(QFont(QFont().family(), 8));
    ui->plotWidget->yAxis->setTickLabelFont(QFont(QFont().family(), 8));
    ui->plotWidget->legend->setVisible(true);
    ui->plotWidget->legend->setFont(QFont(QFont().family(), 8));
    ui->plotWidget->legend->setPositionStyle(QCPLegend::psBottomLeft);
}
Beispiel #2
0
void QWSMainWindow::init()
{
	initMenu();
	initToolbar();
	initStatusbar();
	createWidget();
}
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow)
{    
    qRegisterMetaType<Packet>();

    ui->setupUi(this);

    _packetsReceivedCount = 0;
    _crcErrorCount = 0;
    _bytesSkippedCount = 0;

    _serialPortComboBox = new QComboBox(this);
    connect(_serialPortComboBox, SIGNAL(currentIndexChanged(int)), SLOT(onSerialPortSelected(int)));

    _serialPort = new SerialPort(this);
    _logParser = new LogParser(_serialPort);
    connect(_logParser, SIGNAL(logMessageReceived(QString)), SLOT(onLogMessageReceived(QString)));
    connect(_logParser, SIGNAL(packetParsed(Packet)), SLOT(onPacketParsed(Packet)));

    initToolbar();
    initStatusbar();

    QThread readerThread;
    _logParser->setParent(0);
    _logParser->moveToThread(&readerThread);
    readerThread.start();

    detectSerialPorts();

    ui->plotWidget->addGraph();
    ui->plotWidget->graph(0)->setScatterStyle(QCP::ssDisc);
    ui->plotWidget->graph(0)->setScatterSize(5);
    ui->plotWidget->xAxis->setLabel("timestamp");
    ui->plotWidget->yAxis->setLabel("RSS [dBm]");
    ui->plotWidget->yAxis->setRange(-120, 0);
    ui->plotWidget->xAxis->setTickLabelType(QCPAxis::ltDateTime);
    ui->plotWidget->xAxis->setDateTimeFormat("hh:mm:ss:zzz");
    ui->plotWidget->xAxis->setTickLabelFont(QFont(QFont().family(), 8));
    ui->plotWidget->yAxis->setTickLabelFont(QFont(QFont().family(), 8));
}
Beispiel #4
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow),
    m_bEdit(false)
{
    ui->setupUi(this);
    ui->splitter->setStretchFactor(0, 15);
    ui->splitter->setStretchFactor(1, 65);
    ui->splitter->setStretchFactor(2, 20);
    ui->grouplistWidget->setCurrentRow(1);
    ui->findWidget->hide();

    initStatusbar();
    /*connect all signals and slots*/
    setActions();

    updateMenuStatus();
    int r = Global::g_preferences->m_rgbFontColor.at(0).toInt();
    int g = Global::g_preferences->m_rgbFontColor.at(1).toInt();
    int b = Global::g_preferences->m_rgbFontColor.at(2).toInt();
    updateFontColor(r, g, b);
}