@@ -1,5 +1,5 @@
|
||||
#include "branch.h"
|
||||
|
||||
Branch::Branch(const QString& from, const QString& to, QObject *parent):from(from),to(to)
|
||||
Branch::Branch(const QString& from, const QString& to, QObject *parent):from(from),to(to),QObject(parent)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1,12 +1,17 @@
|
||||
#ifndef COMMONTYPE
|
||||
#define COMMONTYPE
|
||||
|
||||
#include <QString>
|
||||
#include "line.h"
|
||||
#include "switch.h"
|
||||
#include "transformer.h"
|
||||
struct BranchStruc
|
||||
{
|
||||
QString fromID;
|
||||
QString toID;
|
||||
int fromNum;
|
||||
int toNum;
|
||||
QString id;//后面有用的
|
||||
};
|
||||
struct LineStru:public BranchStruc
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "line.h"
|
||||
|
||||
Line::Line(const QPair<QString,QString>& fromTo, ACLineSegment* ac, QObject *parent):Branch(fromTo.first,fromTo.second)
|
||||
Line::Line(const QPair<QString,QString>& fromTo, ACLineSegment* ac, QObject *parent):Branch(fromTo.first,fromTo.second,parent)
|
||||
{
|
||||
this->ratio=1;
|
||||
this->ac=ac;
|
||||
|
||||
@@ -9,10 +9,11 @@ class Line:public Branch
|
||||
public:
|
||||
Line(const QPair<QString, QString> &fromTo, ACLineSegment* ac,QObject* parent=0);
|
||||
double length;
|
||||
ACLineSegment *ac;
|
||||
protected:
|
||||
virtual void extract();
|
||||
private:
|
||||
ACLineSegment *ac;
|
||||
|
||||
};
|
||||
|
||||
#endif // LINE_H
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "switch.h"
|
||||
|
||||
Switch::Switch(const QPair<QString,QString>& fromTo, QObject *parent):Branch(fromTo.first,fromTo.second)
|
||||
Switch::Switch(const QPair<QString,QString>& fromTo, const QString &id, QObject *parent):Branch(fromTo.first,fromTo.second,parent),id(id)
|
||||
{
|
||||
this->extract();
|
||||
}
|
||||
|
||||
@@ -6,10 +6,12 @@
|
||||
class Switch:public Branch
|
||||
{
|
||||
public:
|
||||
Switch(const QPair<QString, QString> &fromTo,QObject *parent=0);
|
||||
Switch(const QPair<QString, QString> &fromTo,const QString& id,QObject *parent=0);
|
||||
QString id;
|
||||
protected:
|
||||
virtual void extract();
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif // SWITCH_H
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "transformer.h"
|
||||
|
||||
|
||||
Transformer::Transformer(const QPair<QString,QString>& fromTo, PowerTransformer* tf, QObject *parent):Branch(fromTo.first,fromTo.second)
|
||||
Transformer::Transformer(const QPair<QString,QString>& fromTo, PowerTransformer* tf, QObject *parent):Branch(fromTo.first,fromTo.second,parent)
|
||||
{
|
||||
this->ratio=1;
|
||||
this->tf=tf;
|
||||
|
||||
Reference in New Issue
Block a user