parent
9cb2f5a8f6
commit
cbe9e1f261
|
|
@ -26,3 +26,24 @@ void CIMExporter::add(const QPair<QString,QString>& fromTo,Transformer* tf)
|
|||
tfStru.fromID=fromTo.first;
|
||||
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/transformer.h"
|
||||
#include <QPair>
|
||||
#include <QHash>
|
||||
class CIMExporter
|
||||
{
|
||||
struct BranchStruc
|
||||
|
|
@ -34,10 +35,13 @@ public:
|
|||
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,Transformer* tf);
|
||||
void exportTo(const QString& path);
|
||||
private:
|
||||
QList<LineStru> line;
|
||||
QList<Switch> sw;
|
||||
QList<TransformerStru> tf;
|
||||
QHash<QString,int> number;
|
||||
int numberIt(const QString &id);//编号
|
||||
};
|
||||
|
||||
#endif // CIMEXPORTER_H
|
||||
|
|
|
|||
Loading…
Reference in New Issue