コード例 #1
0
void RenderComponent::FillXML(pugi::xml_node &node)
{
	AppendDataNode(node, "Sprite name", sprite.getName());
	AppendDataNode(node, "Rectangle X", animationRect.left);
	AppendDataNode(node, "Rectangle Y", animationRect.top);
	AppendDataNode(node, "Rectangle Width", animationRect.width);
	AppendDataNode(node, "Rectangle Height", animationRect.height);
}
コード例 #2
0
ファイル: mainwindow.cpp プロジェクト: helloqt/xiong_and_wang
void MainWindow::on_BrowseModeSelected(int mode)
{
    if (mode == 0)//从文件中浏览
    {
        QString fileName = QFileDialog::getOpenFileName(this, "打开文件","",
            "uds文件 (*.uds)");
        if (fileName.isEmpty())
        {
            return;
        }
        this->fileLoad->LoadDataFromFile(fileName);
        MyDataNode node;
        dataNodeHeigth.clear();
        dataNodeListPro.clear();
        dataNodeListRaw.clear();

        while (this->fileLoad->GetNextDataNode(node))
        {
            AppendDataNode(node);
        }

        this->fileLoad->Close();
    }
    else//从当前数据中浏览:
    {

    }

    //将数据对象的指针传个finishhow对象。
    finishShow->grayShow->loadData(&dataNodeHeigth, &dataNodeListPro);
    finishShow->InitData(&dataNodeListRaw, &dataNodeHeigth);

    finishShow->ShowMode(infoShow->GetShowMode());
}
コード例 #3
0
ファイル: mainwindow.cpp プロジェクト: helloqt/xiong_and_wang
void MainWindow::FinishDataRecv(MyDataNode &node)
{
    //将原始数据存入listRow中;
        QList<qint16> listRow;

        for(int i = 0; i < SECTIONCOUNT; i++)
        {
            for(int j = 0; j < POINTCOUNT; j++)
                listRow.append(node.data[i][j]);
        }

        AppendDataNode(listRow, node.height);
        currentHeight = node.height;
        recvDataCount++;
        infoShow->SetPointCount(QString::number(recvDataCount));
        infoShow->SetHeight(currentHeight);

        if (testShow->isVisible())
        {
            testShow->updataData(listRow);
        }
        if (waveShow->isVisible())
        {
            waveShow->waveWidget->appendData(listRow, currentHeight);
            //将数据存入filedata中:
            this->fileData->WriteData(node);
            //更新当前高度:
            infoShow->SetHeight(node.height);
            //更新当前采集点数:
            infoShow->SetPointCount(QString::number(recvDataCount));
        }
}
コード例 #4
0
ファイル: mainwindow.cpp プロジェクト: helloqt/xiong_and_wang
void MainWindow::on_btnLoadFile_clicked()
{
    QString fileName = QFileDialog::getOpenFileName(this, "打开文件","",
        "uds文件 (*.uds)");
    if (fileName.isEmpty())
    {
        return;
    }
    this->fileLoad->LoadDataFromFile(fileName);
    MyDataNode node;
    dataNodeHeigth.clear();
    dataNodeListPro.clear();
    dataNodeListRaw.clear();

    while (this->fileLoad->GetNextDataNode(node))
    {
        AppendDataNode(node);
    }

    this->fileLoad->Close();

    this->fileLoad->Open(TEMPFILENAME);
//    //将原始数据存入listRow中;
//    QList<qint16> listRow;
//    int heihgtindex = 0;
//    while (this->file->GetNextDataNode(node))
//    {
//        for(int i=0;i<4;i++)
//        {
//            for(int j=0;j<400;j++)
//                listRow.append(node.data[i][j]);
//        }

//        dataNodeListRaw.append(listRow);
//        dataNodeHeigth.append(heihgtindex++);
//        listRow.clear();
//    }
//    this->file->SeekToNodeIndexBegin(340);
//    while (this->file->GetNextDataNode(node))
//    {
//        for(int i=0;i<4;i++)
//        {
//            for(int j=0;j<400;j++)
//                listRow.append(node.data[i][j]);
//        }
//        dataNodeListRaw.append(listRow);
//        dataNodeHeigth.append(heihgtindex++);
//        listRow.clear();
//    }
//    this->file->SeekToNodeIndexBegin(440);
//    while (this->file->GetNextDataNode(node))
//    {
//        for(int i=0;i<4;i++)
//        {
//            for(int j=0;j<400;j++)
//                listRow.append(node.data[i][j]);
//        }
//        dataNodeListRaw.append(listRow);
//        dataNodeHeigth.append(heihgtindex++);
//        listRow.clear();
//    }
//    this->file->SeekToNodeIndexBegin(540);
//    while (this->file->GetNextDataNode(node))
//    {
//        for(int i=0;i<4;i++)
//        {
//            for(int j=0;j<400;j++)
//                listRow.append(node.data[i][j]);
//        }
//        dataNodeListRaw.append(listRow);
//        dataNodeHeigth.append(heihgtindex++);
//        listRow.clear();
//    }

//    this->file->SaveDataToFile(QString("test2.uds"), dataNodeListRaw, dataNodeHeigth);




}