示例#1
0
void ZDvidBufferReader::handleError(QNetworkReply::NetworkError /*error*/)
{
  if (m_networkReply != NULL) {
    qDebug() << m_networkReply->errorString();
  }
  endReading(READ_FAILED);
}
示例#2
0
文件: connection.cpp 项目: PZSAS/serv
void Connection::readData()
{
    QByteArray data;
    lastRead.start();
    if(newRequest)
    {
        buffer += port->readAll();
        // czeka na wczytanie calego naglowka
        if(buffer.size() < 18) return;

        // zapisuje naglowek i przechodzi dalej
        header = buffer.mid(0, 18);
        checkHeader();
        samplesRead = buffer.size();
        buffer = buffer.mid(18);
        newRequest = false;
    }
    else
    {
        data = port->readAll();
        samplesRead += data.size();
        buffer += data;
        if(buffer.size() >= INTERVAL && samplesRead < (chunkSize+18))
        {
            rawSamples = Container::data8ToInt8Vec(buffer.mid(0, INTERVAL));
            buffer = buffer.mid(INTERVAL);
            handleWithSamples();
        }
    }
    if(samplesRead >= (chunkSize+22))
    {
        endReading();
    }

}
示例#3
0
文件: connection.cpp 项目: PZSAS/serv
void Connection::stopAndSave()
{
    endReading(false);
    stop();


    Container::getCurrent()->saveToFile();
}
示例#4
0
void MainWindow::createProject()
{
    project = new Project(groups, this);
    {
        connect(ui->actionReloadProject,    SIGNAL(triggered()), SLOT(tryReloadProject()));
        connect(ui->actionClose,            SIGNAL(triggered()), SLOT(tryCloseProject()));
    }
    {
        connect(ui->actionLoadProject,      SIGNAL(triggered()), project, SLOT(load()));
        connect(ui->actionSaveProject,      SIGNAL(triggered()), project, SLOT(save()));
        connect(ui->actionSaveAs,           SIGNAL(triggered()), project, SLOT(saveAs()));
        connect(ui->actionCopyProFileTo,    SIGNAL(triggered()), project, SLOT(forKojnevAlexandrNikolayevich()));
        connect(ui->actionLoadVersionThree, SIGNAL(triggered()), project, SLOT(forDeminValeriyNikolayevich()));
    }
    {
        connect(project, SIGNAL(wasReplaced(QString)), SLOT(setWindowTitle(QString)));
        connect(project, SIGNAL(wasClosed()),          SLOT(restoreWindowTitle()));
        connect(project, SIGNAL(beginReading()),       SLOT(beginWaiting()));
        connect(project, SIGNAL(endReading()),         SLOT(endWaiting()));
    }
    {
        connect(project, SIGNAL(wasReplaced(QString)), groups, SLOT(setInitialLoadingPath(QString)));
    }
}
示例#5
0
void ZDvidBufferReader::cancelReading()
{
  endReading(READ_CANCELED);
}
示例#6
0
void ZDvidBufferReader::handleTimeout()
{
  endReading(READ_TIMEOUT);
}
示例#7
0
void ZDvidBufferReader::finishReading()
{
  endReading(m_status);
}