diff --git a/testHasttable/cimexporter.cpp b/testHasttable/cimexporter.cpp index c9c0f15..4ad2552 100644 --- a/testHasttable/cimexporter.cpp +++ b/testHasttable/cimexporter.cpp @@ -6,7 +6,7 @@ CIMExporter::CIMExporter(const QHash &eleHT, const void CIMExporter::add(const QPair& fromTo,Line* line) { - CIMExporter::LineStru lineStru; + LineStru lineStru; lineStru.line=line; lineStru.fromID=fromTo.first; lineStru.toID=fromTo.second; @@ -15,7 +15,7 @@ void CIMExporter::add(const QPair& fromTo,Line* line) } void CIMExporter::add(const QPair& fromTo,Switch* sw) { - CIMExporter::SwitchStru switchStru; + SwitchStru switchStru; switchStru.sw=sw; switchStru.fromID=fromTo.first; switchStru.toID=fromTo.second; @@ -23,7 +23,7 @@ void CIMExporter::add(const QPair& fromTo,Switch* sw) } void CIMExporter::add(const QPair& fromTo,Transformer* tf) { - CIMExporter::TransformerStru tfStru; + TransformerStru tfStru; tfStru.tf=tf; tfStru.fromID=fromTo.first; tfStru.toID=fromTo.second; @@ -48,7 +48,7 @@ void CIMExporter::exportTo(const QString& path) QTextStream writer(&fd); writer<::iterator ite=this->line.begin(); + for(QList::iterator ite=this->line.begin(); ite!=this->line.end(); ite++) { @@ -59,7 +59,7 @@ void CIMExporter::exportTo(const QString& path) writer<length<<"\r\n"; } //输出刀闸 - for(QList::iterator ite=this->sw.begin(); + for(QList::iterator ite=this->sw.begin(); ite!=this->sw.end(); ite++) { @@ -83,7 +83,7 @@ void CIMExporter::exportTo(const QString& path) writer<::iterator ite=this->tf.begin(); + for(QList::iterator ite=this->tf.begin(); ite!=this->tf.end(); ite++) { @@ -168,19 +168,19 @@ bool CIMExporter::topologyTest() { //检查一下拓扑关系 QList > linkage; - for(QList::iterator ite=this->line.begin(); + for(QList::iterator ite=this->line.begin(); ite!=this->line.end(); ite++) { linkage.push_back(QPair(ite->fromNum,ite->toNum)); } - for(QList::iterator ite=this->sw.begin(); + for(QList::iterator ite=this->sw.begin(); ite!=this->sw.end(); ite++) { linkage.push_back(QPair(ite->fromNum,ite->toNum)); } - for(QList::iterator ite=this->tf.begin(); + for(QList::iterator ite=this->tf.begin(); ite!=this->tf.end(); ite++) { diff --git a/testHasttable/cimexporter.h b/testHasttable/cimexporter.h index 4fc89f7..08f6ea8 100644 --- a/testHasttable/cimexporter.h +++ b/testHasttable/cimexporter.h @@ -4,6 +4,7 @@ #include "element/line.h" #include "element/switch.h" #include "element/transformer.h" +#include "element/commontype.h" #include #include #include @@ -19,31 +20,10 @@ #include #include "topologytest.h" //#include "elementhashtable.h" -class Substation; +//class Substation; class CIMExporter { - struct BranchStruc - { - QString fromID; - QString toID; - int fromNum; - int toNum; - }; - struct LineStru:public BranchStruc - { - Line *line; - }; - struct SwitchStru:public BranchStruc - { - Switch *sw; - - }; - struct TransformerStru:public BranchStruc - { - Transformer *tf; - - }; public: explicit CIMExporter(const QHash& eleHT,const QString& loadDir); void add(const QPair& fromTo,Line* line); diff --git a/testHasttable/element/commontype.h b/testHasttable/element/commontype.h new file mode 100644 index 0000000..53382dc --- /dev/null +++ b/testHasttable/element/commontype.h @@ -0,0 +1,29 @@ +#ifndef COMMONTYPE +#define COMMONTYPE + +struct BranchStruc +{ + QString fromID; + QString toID; + int fromNum; + int toNum; +}; +struct LineStru:public BranchStruc +{ + Line *line; + +}; +struct SwitchStru:public BranchStruc +{ + Switch *sw; + +}; +struct TransformerStru:public BranchStruc +{ + Transformer *tf; + +}; + + +#endif // COMMONTYPE + diff --git a/testHasttable/elementreduction.cpp b/testHasttable/elementreduction.cpp new file mode 100644 index 0000000..28ec3ee --- /dev/null +++ b/testHasttable/elementreduction.cpp @@ -0,0 +1,12 @@ +#include "elementreduction.h" + +ElementReduction::ElementReduction() +{ + +} + +ElementReduction::~ElementReduction() +{ + +} + diff --git a/testHasttable/elementreduction.h b/testHasttable/elementreduction.h new file mode 100644 index 0000000..3c38c72 --- /dev/null +++ b/testHasttable/elementreduction.h @@ -0,0 +1,12 @@ +#ifndef ELEMENTREDUCTION_H +#define ELEMENTREDUCTION_H + +//把电阻等于0的元件都去掉 +class ElementReduction +{ +public: + ElementReduction(); + ~ElementReduction(); +}; + +#endif // ELEMENTREDUCTION_H diff --git a/testHasttable/testHasttable.pro b/testHasttable/testHasttable.pro index 6eab77b..f5b945d 100644 --- a/testHasttable/testHasttable.pro +++ b/testHasttable/testHasttable.pro @@ -44,7 +44,8 @@ SOURCES += main.cpp \ loadmatchexception.cpp \ dgmapping.cpp \ dginfo.cpp \ - topologytest.cpp + topologytest.cpp \ + elementreduction.cpp HEADERS += \ elementhashtable.h \ @@ -75,7 +76,9 @@ HEADERS += \ loadmatchexception.h \ dgmapping.h \ dginfo.h \ - topologytest.h + topologytest.h \ + elementreduction.h \ + element/commontype.h #release{ DEFINES += QT_NO_DEBUG_OUTPUT diff --git a/testHasttable/topologytest.cpp b/testHasttable/topologytest.cpp index d8b1758..9e81053 100644 --- a/testHasttable/topologytest.cpp +++ b/testHasttable/topologytest.cpp @@ -20,9 +20,9 @@ bool TopologyTest::start(const QList >& linkage) ite++ ) { - int f=(*ite).first-1; - int s=(*ite).second-1; - std::cout<