|
@@ -1,5 +1,6 @@
|
|
|
#include "ObjectSignal.h"
|
|
|
|
|
|
+#include <iostream>
|
|
|
|
|
|
signal_positionRoad::signal_positionRoad(double s, double t, double zOffset, double hOffset, double pitch, double roll)
|
|
|
{
|
|
@@ -142,10 +143,36 @@ void signal_positionInertial::Setroll(double roll)
|
|
|
}
|
|
|
|
|
|
|
|
|
+signal_laneValidity::signal_laneValidity(int fromLane,int toLane)
|
|
|
+{
|
|
|
+ mfromLane = fromLane;
|
|
|
+ mtoLane = toLane;
|
|
|
+}
|
|
|
+
|
|
|
+int signal_laneValidity::GetfromLane()
|
|
|
+{
|
|
|
+ return mfromLane;
|
|
|
+}
|
|
|
+
|
|
|
+int signal_laneValidity::GettoLane()
|
|
|
+{
|
|
|
+ return mtoLane;
|
|
|
+}
|
|
|
+
|
|
|
+void signal_laneValidity::SetfromLane(int fromLane)
|
|
|
+{
|
|
|
+ mfromLane = fromLane;
|
|
|
+}
|
|
|
+
|
|
|
+void signal_laneValidity::SettoLane(int toLane)
|
|
|
+{
|
|
|
+ mtoLane = toLane;
|
|
|
+}
|
|
|
+
|
|
|
|
|
|
Signal::Signal(double s, double t, std::string id, std::string name, bool dynamic,string orientation,
|
|
|
- double zOffset, int type, std::string country, std::string countryRevision,
|
|
|
- int subtype, double hOffset, double pitch, double roll, double height, double width)
|
|
|
+ double zOffset, string type, std::string country, std::string countryRevision,
|
|
|
+ string subtype, double hOffset, double pitch, double roll, double height, double width)
|
|
|
{
|
|
|
ms = s;
|
|
|
mt = t;
|
|
@@ -163,45 +190,102 @@ Signal::Signal(double s, double t, std::string id, std::string name, bool dynami
|
|
|
mroll = roll;
|
|
|
mheight = height;
|
|
|
mwidth = width;
|
|
|
+ mpsignal_laneValidity = 0;
|
|
|
mpsignal_positionInertial = 0;
|
|
|
mpsignal_positionRoad = new signal_positionRoad(s,t,zOffset,hOffset,pitch,roll);
|
|
|
}
|
|
|
|
|
|
+Signal::Signal()
|
|
|
+{
|
|
|
+ mpsignal_positionInertial = 0;
|
|
|
+ mpsignal_positionRoad = 0;
|
|
|
+ mpsignal_laneValidity = 0;
|
|
|
+
|
|
|
+}
|
|
|
Signal::~Signal()
|
|
|
{
|
|
|
-// if(mpsignal_positionInertial != 0)delete mpsignal_positionInertial;
|
|
|
-// if(mpsignal_positionRoad != 0)delete mpsignal_positionRoad;
|
|
|
-}
|
|
|
-
|
|
|
-//Signal& Signal::operator=(const Signal& x)
|
|
|
-//{
|
|
|
-// if (this != &x)
|
|
|
-// {
|
|
|
-// this->Sets(x.Gets());
|
|
|
-// ms = x.Gets();
|
|
|
-// mt = x.Gett();
|
|
|
-// mid = x.Getid();
|
|
|
-// mname = x.Getname();
|
|
|
-// mdynamic = x.Getdynamic();
|
|
|
-// morientation = x.Getorientation();
|
|
|
-// mzOffset = x.GetzOffset();
|
|
|
-// mtype = x.Gettype();
|
|
|
-// mcountry = x.Getcountry();
|
|
|
-// mcountryRevision = x.GetcountryRevision();
|
|
|
-// msubtype = x.Getsubtype();
|
|
|
-// mhOffset = x.GethOffset();
|
|
|
-// mpitch = x.Getpitch();
|
|
|
-// mroll = x.Getroll();
|
|
|
-// mheight = x.Getheight();
|
|
|
-// mwidth = x.Getwidth();
|
|
|
-// mpsignal_positionInertial = 0;
|
|
|
-// signal_positionRoad * p = x.GetpositionRoad();
|
|
|
-// mpsignal_positionRoad = new signal_positionRoad(p->Gets(),p->Gett(),
|
|
|
-// p->GetzOffset(),p->GethOffset(),
|
|
|
-// p->Getpitch(),p->Getroll());
|
|
|
-// }
|
|
|
-// return *this;
|
|
|
-//}
|
|
|
+ if(mpsignal_laneValidity != 0)delete mpsignal_laneValidity;
|
|
|
+ if(mpsignal_positionInertial != 0)delete mpsignal_positionInertial;
|
|
|
+ if(mpsignal_positionRoad != 0)delete mpsignal_positionRoad;
|
|
|
+}
|
|
|
+
|
|
|
+Signal& Signal::operator=(const Signal& x)
|
|
|
+{
|
|
|
+ if (this != &x)
|
|
|
+ {
|
|
|
+ this->ms = x.ms;
|
|
|
+ this->mt = x.mt;
|
|
|
+ this->mid = x.mid;
|
|
|
+ this->mname = x.mname;
|
|
|
+ this->mdynamic = x.mdynamic;
|
|
|
+ this->morientation = x.morientation;
|
|
|
+ this->mzOffset = x.mzOffset;
|
|
|
+ this->mtype = x.mtype;
|
|
|
+ this->mcountry = x.mcountry;
|
|
|
+ this->mcountryRevision = x.mcountryRevision;
|
|
|
+ this->msubtype = x.msubtype;
|
|
|
+ this->mhOffset = x.mhOffset;
|
|
|
+ this->mpitch = x.mpitch;
|
|
|
+ this->mroll = x.mroll;
|
|
|
+ this->mheight = x.mheight;
|
|
|
+ this->mwidth = x.mwidth;
|
|
|
+ this->mpsignal_positionInertial = 0;
|
|
|
+ if(x.mpsignal_positionInertial != 0)
|
|
|
+ {
|
|
|
+ this->mpsignal_positionInertial = new signal_positionInertial(x.mpsignal_positionInertial->Getx(),
|
|
|
+ x.mpsignal_positionInertial->Gety(),
|
|
|
+ x.mpsignal_positionInertial->Getz(),
|
|
|
+ x.mpsignal_positionInertial->Gethdg(),
|
|
|
+ x.mpsignal_positionInertial->Getpitch(),
|
|
|
+ x.mpsignal_positionInertial->Getroll());
|
|
|
+ }
|
|
|
+ this->mpsignal_laneValidity = 0;
|
|
|
+ if(x.mpsignal_laneValidity != 0)
|
|
|
+ {
|
|
|
+ this->mpsignal_laneValidity = new signal_laneValidity(x.mpsignal_laneValidity->GetfromLane(),
|
|
|
+ x.mpsignal_laneValidity->GettoLane());
|
|
|
+ }
|
|
|
+ this->mpsignal_positionRoad = new signal_positionRoad(ms,mt,mzOffset,mhOffset,mpitch,mroll);
|
|
|
+ }
|
|
|
+ return *this;
|
|
|
+}
|
|
|
+
|
|
|
+Signal::Signal(const Signal &x)
|
|
|
+{
|
|
|
+ ms = x.ms;
|
|
|
+ mt = x.mt;
|
|
|
+ mid = x.mid;
|
|
|
+ mname = x.mname;
|
|
|
+ mdynamic = x.mdynamic;
|
|
|
+ morientation = x.morientation;
|
|
|
+ mzOffset = x.mzOffset;
|
|
|
+ mtype = x.mtype;
|
|
|
+ mcountry = x.mcountry;
|
|
|
+ mcountryRevision = x.mcountryRevision;
|
|
|
+ msubtype = x.msubtype;
|
|
|
+ mhOffset = x.mhOffset;
|
|
|
+ mpitch = x.mpitch;
|
|
|
+ mroll = x.mroll;
|
|
|
+ mheight = x.mheight;
|
|
|
+ mwidth = x.mwidth;
|
|
|
+ this->mpsignal_positionInertial = 0;
|
|
|
+ if(x.mpsignal_positionInertial != 0)
|
|
|
+ {
|
|
|
+ this->mpsignal_positionInertial = new signal_positionInertial(x.mpsignal_positionInertial->Getx(),
|
|
|
+ x.mpsignal_positionInertial->Gety(),
|
|
|
+ x.mpsignal_positionInertial->Getz(),
|
|
|
+ x.mpsignal_positionInertial->Gethdg(),
|
|
|
+ x.mpsignal_positionInertial->Getpitch(),
|
|
|
+ x.mpsignal_positionInertial->Getroll());
|
|
|
+ }
|
|
|
+ this->mpsignal_laneValidity = 0;
|
|
|
+ if(x.mpsignal_laneValidity != 0)
|
|
|
+ {
|
|
|
+ this->mpsignal_laneValidity = new signal_laneValidity(x.mpsignal_laneValidity->GetfromLane(),
|
|
|
+ x.mpsignal_laneValidity->GettoLane());
|
|
|
+ }
|
|
|
+ mpsignal_positionRoad = new signal_positionRoad(ms,mt,mzOffset,mhOffset,mpitch,mroll);
|
|
|
+}
|
|
|
|
|
|
double Signal::Gets()
|
|
|
{
|
|
@@ -238,7 +322,7 @@ double Signal::GetzOffset()
|
|
|
return mzOffset;
|
|
|
}
|
|
|
|
|
|
-int Signal::Gettype()
|
|
|
+string Signal::Gettype()
|
|
|
{
|
|
|
return mtype;
|
|
|
}
|
|
@@ -253,7 +337,7 @@ string Signal::GetcountryRevision()
|
|
|
return mcountryRevision;
|
|
|
}
|
|
|
|
|
|
-int Signal::Getsubtype()
|
|
|
+string Signal::Getsubtype()
|
|
|
{
|
|
|
return msubtype;
|
|
|
}
|
|
@@ -328,7 +412,7 @@ void Signal::SetzOffset(double zOffset)
|
|
|
mzOffset = zOffset;
|
|
|
}
|
|
|
|
|
|
-void Signal::Settype(int type)
|
|
|
+void Signal::Settype(string type)
|
|
|
{
|
|
|
mtype = type;
|
|
|
}
|
|
@@ -343,7 +427,7 @@ void Signal::SetcountryRevision(std::string countryRevision)
|
|
|
mcountryRevision = countryRevision;
|
|
|
}
|
|
|
|
|
|
-void Signal::Setsubtype(int subtype)
|
|
|
+void Signal::Setsubtype(string subtype)
|
|
|
{
|
|
|
msubtype = subtype;
|
|
|
}
|
|
@@ -373,6 +457,19 @@ void Signal::Setwidth(double width)
|
|
|
mwidth = width;
|
|
|
}
|
|
|
|
|
|
+void Signal::SetlaneValidity(int fromLane, int toLane)
|
|
|
+{
|
|
|
+ if(mpsignal_laneValidity == 0)
|
|
|
+ {
|
|
|
+ mpsignal_laneValidity = new signal_laneValidity(fromLane,toLane);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ mpsignal_laneValidity->SetfromLane(fromLane);
|
|
|
+ mpsignal_laneValidity->SettoLane(toLane);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
void Signal::SetpositionRoad(double s, double t, double zOffset, double hOffset, double pitch,double roll)
|
|
|
{
|
|
|
if(mpsignal_positionRoad == 0)
|
|
@@ -407,6 +504,11 @@ void Signal::SetpositionInertial(double x, double y, double z, double hdg, doubl
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+signal_laneValidity * Signal::GetlaneValidity()
|
|
|
+{
|
|
|
+ return mpsignal_laneValidity;
|
|
|
+}
|
|
|
+
|
|
|
|
|
|
|
|
|
|