예제 #1
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow),
    vcom(false)
{
    ui->setupUi(this);

    stReader = new StReader(this);
    bootloader = new BootLoader(this);
    clk10msTimer = new QTimer(this);
    getReaderChannels();

    connect(stReader, SIGNAL(connection(bool)), this, SLOT(setConnectingControl(bool)));
    connect(stReader, SIGNAL(raiseErrorMessage(QString)), ui->statusBar, SLOT(showMessage(QString)));
    connect(stReader, SIGNAL(raiseStatusMessage(QString)), ui->statusBar, SLOT(showMessage(QString)));
    connect(stReader, SIGNAL(dataReceived(QByteArray)), this, SLOT(onReaderPacketIn(QByteArray)));

    connect(clk10msTimer, SIGNAL(timeout()), this, SLOT(on10msTimer()));
    clk10msTimer->start(10);
    clk10msCounter = 0;

    ui->statusBar->showMessage(tr("Started!"));
}
예제 #2
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow),
    vcom(false),
    attenuation_tout(200),
    m_attn(-1),
    m_db(new EpcDb())
{
  ui->setupUi(this);
  createLogTable();

  stReader = new StReader(this);
  clk10msTimer = new QTimer(this);
  getReaderChannels();

  connect(stReader, SIGNAL(connection(bool)), this, SLOT(setConnectingControl(bool)));
  connect(stReader, SIGNAL(raiseErrorMessage(QString)), ui->statusBar, SLOT(showMessage(QString)));
  connect(stReader, SIGNAL(raiseStatusMessage(QString)), ui->statusBar, SLOT(showMessage(QString)));
  connect(stReader, SIGNAL(dataReceived(QByteArray)), this, SLOT(onReaderPacketIn(QByteArray)));
  connect(stReader, SIGNAL(readingEpc(QByteArray)), this, SLOT(onEpc(QByteArray)));
  connect(stReader, SIGNAL(attenuation(int)), this, SLOT(onAttenuation(int)));
  connect(ui->action_Info, SIGNAL(triggered()), this, SLOT(onInfo()));
  connect(ui->actionE_xit, SIGNAL(triggered()), this, SLOT(close()));
  connect(ui->actionE_xport, SIGNAL(triggered()), this, SLOT(onExportDatabase()));
  connect(ui->action_Delete, SIGNAL(triggered()), this, SLOT(onDeleteDatabase()));

  connect(clk10msTimer, SIGNAL(timeout()), this, SLOT(on10msTimer()));
  clk10msTimer->start(10);

  channel = ui->comboBoxPort->currentText();
  stReader->connectReader(channel);
  if (ui->comboBoxPort->count() > 0)
    ui->checkBoxConnect->setChecked(true);
  ui->statusBar->showMessage(tr("Started!"));
  this->setWindowTitle(this->windowTitle() + k_version);
}
예제 #3
0
void MainWindow::on_pushButtonRefresh_clicked()
{
    getReaderChannels();
}