diff --git a/testHasttable/loadinfo.cpp b/testHasttable/loadinfo.cpp index 13ed179..ec0a71f 100644 --- a/testHasttable/loadinfo.cpp +++ b/testHasttable/loadinfo.cpp @@ -3,6 +3,11 @@ LoadInfo::LoadInfo(double powerFactor):powerFactor(powerFactor) { + this->pqA=QPair(0,0); + this->pqB=QPair(0,0); + this->pqC=QPair(0,0); + this->ph3P=0; + this->ph3Q=0; } LoadInfo::~LoadInfo() @@ -30,6 +35,18 @@ QPair LoadInfo::getPQ(double current) return QPair(p,q); } +double LoadInfo::get3PhP() +{ +// std::cout<<"get p "<ph3P<ph3P; +} + +double LoadInfo::get3PhQ() +{ +// std::cout<<"get q "<ph3Q<ph3Q; +} + double LoadInfo::getPA() { return this->pqA.first; @@ -128,6 +145,22 @@ bool LoadInfo::updateByTime(const QTime& time) this->pqA=pqA; this->pqB=pqB; this->pqC=pqC; + bool ok3PhP; + bool ok3PhQ; + this->ph3P=this->trimDoubleQuotation(sep.at(5)).toDouble(&ok3PhP); + if(!ok3PhP) + { + this->ph3P=0; + } +// std::cout<<"nb "<ph3P<ph3Q=this->trimDoubleQuotation(sep.at(6)).toDouble(&ok3PhQ); + if(!ok3PhQ) + { + this->ph3Q=0; + } +// std::cout<<"nb "<ph3Q< pqA; QPair pqB; QPair pqC; + double ph3P; + double ph3Q; QPair getPQ(double current); }; diff --git a/testHasttable/main.cpp b/testHasttable/main.cpp index e02a73a..0fc9191 100644 --- a/testHasttable/main.cpp +++ b/testHasttable/main.cpp @@ -149,7 +149,7 @@ int main(int argc, char *argv[]) Task task; task.doAgainstTaskFile(eleReader); LoadExporter loadExporter; - loadExporter.toSingleFile("D:/MyPro/cimforreduceloss/testHasttable/output/pan/load/singlefile.txt"); + loadExporter.toSingleFile("D:/MyPro/cimforreduceloss/testHasttable/output/pan/load/singlefile.csv"); std::cout<<"Finished."< p=this->ht.get(key); - double P=p->getPA()+p->getPB()+p->getPC(); - double Q=p->getQA()+p->getQB()+p->getQC(); + double P=p->get3PhP();//p->getPA()+p->getPB()+p->getPC(); + double Q=p->get3PhQ();//p->getQA()+p->getQB()+p->getQC(); loadSequence[key].push_back(QPair(P,Q) ); } } @@ -52,7 +52,7 @@ void LoadExporter::toSingleFile(const QString& filePath) int seq=0; for(QList >::iterator ite=loadList.begin();ite!=loadList.end();ite++) { - stream<<"["<first<<"&&"<second<<")"<<","; + stream<<"["<first<<","<second<<","; } stream<<"\t\n"; }