用QTextStream来输出Container的信息。

Signed-off-by: dmy@lab <dmy@lab.lab>
This commit is contained in:
dmy@lab
2015-01-07 21:57:50 +08:00
parent cd22eecbca
commit 1e3ad32bfa
4 changed files with 66 additions and 35 deletions

View File

@@ -1,7 +1,7 @@
#include "elementhashtable.h"
#include <iostream>
ElementHashtable::ElementHashtable(QObject *parent) :
QObject(parent),currentHT(NULL)
QObject(parent),currentHT(NULL),tpRecorder(NULL)
{
}
@@ -96,9 +96,14 @@ bool ElementHashtable::GoPath()
continue;//有些Terminal是没有Node的
}
std::cout<<node.toStdString()<<std::endl;
TopologyRecorder tpRecorder(this->eleHT,this->FDSet);
tpRecorder.startWithNode(node);
tpRecorder.exportTo("");
if(this->tpRecorder!=NULL)
{
delete this->tpRecorder;
this->tpRecorder=NULL;
}
this->tpRecorder=new TopologyRecorder(this->eleHT,this->FDSet);
this->tpRecorder->startWithNode(node);
this->tpRecorder->exportTo("");
break;
}
}
@@ -155,6 +160,8 @@ bool ElementHashtable::Parse(const QString& xmlPWPath,const QString& xmlZWPath){
return true;
}
void ElementHashtable::SetACLineID(const QString &id)//寻找的线路ID
{
this->lineID=id;
@@ -163,3 +170,15 @@ void ElementHashtable::SetFDSet(const QVector<QString> &FDSet)//FeeDer集合
{
this->FDSet=FDSet;
}
void ElementHashtable::ShowContainerInfo(const QString& fileName)
{
QString relPath="./../output/";
QFile file(relPath+fileName+".txt");
if(file.open(QFile::ReadOnly))
{
QTextStream stream(&file);
this->tpRecorder->showContainerInfo(stream);
file.close();
}
}