parent
9cb2f5a8f6
commit
cbe9e1f261
|
|
@ -26,3 +26,24 @@ void CIMExporter::add(const QPair<QString,QString>& fromTo,Transformer* tf)
|
||||||
tfStru.fromID=fromTo.first;
|
tfStru.fromID=fromTo.first;
|
||||||
tfStru.toID=fromTo.second;
|
tfStru.toID=fromTo.second;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void CIMExporter::exportTo(const QString& path)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
int CIMExporter::numberIt(const QString& id)
|
||||||
|
{
|
||||||
|
if(this->number.contains(id))
|
||||||
|
{
|
||||||
|
return this->number.value(id);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
int n=this->number.values().length()+1;
|
||||||
|
this->number[id]=n;
|
||||||
|
return n;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@
|
||||||
#include "element/switch.h"
|
#include "element/switch.h"
|
||||||
#include "element/transformer.h"
|
#include "element/transformer.h"
|
||||||
#include <QPair>
|
#include <QPair>
|
||||||
|
#include <QHash>
|
||||||
class CIMExporter
|
class CIMExporter
|
||||||
{
|
{
|
||||||
struct BranchStruc
|
struct BranchStruc
|
||||||
|
|
@ -34,10 +35,13 @@ public:
|
||||||
void add(const QPair<QString,QString>& fromTo,Line* line);
|
void add(const QPair<QString,QString>& fromTo,Line* line);
|
||||||
void add(const QPair<QString,QString>& fromTo,Switch* sw);
|
void add(const QPair<QString,QString>& fromTo,Switch* sw);
|
||||||
void add(const QPair<QString,QString>& fromTo,Transformer* tf);
|
void add(const QPair<QString,QString>& fromTo,Transformer* tf);
|
||||||
|
void exportTo(const QString& path);
|
||||||
private:
|
private:
|
||||||
QList<LineStru> line;
|
QList<LineStru> line;
|
||||||
QList<Switch> sw;
|
QList<Switch> sw;
|
||||||
QList<TransformerStru> tf;
|
QList<TransformerStru> tf;
|
||||||
|
QHash<QString,int> number;
|
||||||
|
int numberIt(const QString &id);//编号
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // CIMEXPORTER_H
|
#endif // CIMEXPORTER_H
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue