|
@@ -0,0 +1,514 @@
|
|
|
+#include "ObjectSignal.h"
|
|
|
+
|
|
|
+#include <iostream>
|
|
|
+
|
|
|
+signal_positionRoad::signal_positionRoad(double s, double t, double zOffset, double hOffset, double pitch, double roll)
|
|
|
+{
|
|
|
+ ms = s;
|
|
|
+ mt = t;
|
|
|
+ mzOffset = zOffset;
|
|
|
+ mhOffset = hOffset;
|
|
|
+ mpitch = pitch;
|
|
|
+ mroll = roll;
|
|
|
+}
|
|
|
+
|
|
|
+double signal_positionRoad::Gets()
|
|
|
+{
|
|
|
+ return ms;
|
|
|
+}
|
|
|
+
|
|
|
+double signal_positionRoad::Gett()
|
|
|
+{
|
|
|
+ return mt;
|
|
|
+}
|
|
|
+
|
|
|
+double signal_positionRoad::GetzOffset()
|
|
|
+{
|
|
|
+ return mzOffset;
|
|
|
+}
|
|
|
+
|
|
|
+double signal_positionRoad::GethOffset()
|
|
|
+{
|
|
|
+ return mhOffset;
|
|
|
+}
|
|
|
+
|
|
|
+double signal_positionRoad::Getpitch()
|
|
|
+{
|
|
|
+ return mpitch;
|
|
|
+}
|
|
|
+
|
|
|
+double signal_positionRoad::Getroll()
|
|
|
+{
|
|
|
+ return mroll;
|
|
|
+}
|
|
|
+
|
|
|
+void signal_positionRoad::Sets(double s)
|
|
|
+{
|
|
|
+ ms = s;
|
|
|
+}
|
|
|
+
|
|
|
+void signal_positionRoad::Sett(double t)
|
|
|
+{
|
|
|
+ mt = t;
|
|
|
+}
|
|
|
+
|
|
|
+void signal_positionRoad::SetzOffset(double zOffset)
|
|
|
+{
|
|
|
+ mzOffset = zOffset;
|
|
|
+}
|
|
|
+
|
|
|
+void signal_positionRoad::SethOffset(double hOffset)
|
|
|
+{
|
|
|
+ mhOffset = hOffset;
|
|
|
+}
|
|
|
+
|
|
|
+void signal_positionRoad::Setpitch(double pitch)
|
|
|
+{
|
|
|
+ mpitch = pitch;
|
|
|
+}
|
|
|
+
|
|
|
+void signal_positionRoad::Setroll(double roll)
|
|
|
+{
|
|
|
+ mroll = roll;
|
|
|
+}
|
|
|
+
|
|
|
+signal_positionInertial::signal_positionInertial(double x, double y,double z, double hdg, double pitch, double roll)
|
|
|
+{
|
|
|
+ mx = x;
|
|
|
+ my = y;
|
|
|
+ mz = z;
|
|
|
+ mhdg = hdg;
|
|
|
+ mpitch = pitch;
|
|
|
+ mroll = roll;
|
|
|
+}
|
|
|
+
|
|
|
+double signal_positionInertial::Getx()
|
|
|
+{
|
|
|
+ return mx;
|
|
|
+}
|
|
|
+
|
|
|
+double signal_positionInertial::Gety()
|
|
|
+{
|
|
|
+ return my;
|
|
|
+}
|
|
|
+
|
|
|
+double signal_positionInertial::Getz()
|
|
|
+{
|
|
|
+ return mz;
|
|
|
+}
|
|
|
+
|
|
|
+double signal_positionInertial::Gethdg()
|
|
|
+{
|
|
|
+ return mhdg;
|
|
|
+}
|
|
|
+
|
|
|
+double signal_positionInertial::Getpitch()
|
|
|
+{
|
|
|
+ return mpitch;
|
|
|
+}
|
|
|
+
|
|
|
+double signal_positionInertial::Getroll()
|
|
|
+{
|
|
|
+ return mroll;
|
|
|
+}
|
|
|
+
|
|
|
+void signal_positionInertial::Setx(double x)
|
|
|
+{
|
|
|
+ mx = x;
|
|
|
+}
|
|
|
+
|
|
|
+void signal_positionInertial::Sety(double y)
|
|
|
+{
|
|
|
+ my = y;
|
|
|
+}
|
|
|
+
|
|
|
+void signal_positionInertial::Setz(double z)
|
|
|
+{
|
|
|
+ mz = z;
|
|
|
+}
|
|
|
+
|
|
|
+void signal_positionInertial::Sethdg(double hdg)
|
|
|
+{
|
|
|
+ mhdg = hdg;
|
|
|
+}
|
|
|
+
|
|
|
+void signal_positionInertial::Setpitch(double pitch)
|
|
|
+{
|
|
|
+ mpitch = pitch;
|
|
|
+}
|
|
|
+
|
|
|
+void signal_positionInertial::Setroll(double roll)
|
|
|
+{
|
|
|
+ mroll = 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, string type, std::string country, std::string countryRevision,
|
|
|
+ string subtype, double hOffset, double pitch, double roll, double height, double width)
|
|
|
+{
|
|
|
+ ms = s;
|
|
|
+ mt = t;
|
|
|
+ mid = id;
|
|
|
+ mname = name;
|
|
|
+ mdynamic = dynamic;
|
|
|
+ morientation = orientation;
|
|
|
+ mzOffset = zOffset;
|
|
|
+ mtype = type;
|
|
|
+ mcountry = country;
|
|
|
+ mcountryRevision = countryRevision;
|
|
|
+ msubtype = subtype;
|
|
|
+ mhOffset = hOffset;
|
|
|
+ mpitch = pitch;
|
|
|
+ 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_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()
|
|
|
+{
|
|
|
+ return ms;
|
|
|
+}
|
|
|
+
|
|
|
+double Signal::Gett()
|
|
|
+{
|
|
|
+ return mt;
|
|
|
+}
|
|
|
+
|
|
|
+string Signal::Getid()
|
|
|
+{
|
|
|
+ return mid;
|
|
|
+}
|
|
|
+
|
|
|
+string Signal::Getname()
|
|
|
+{
|
|
|
+ return mname;
|
|
|
+}
|
|
|
+
|
|
|
+bool Signal::Getdynamic()
|
|
|
+{
|
|
|
+ return mdynamic;
|
|
|
+}
|
|
|
+
|
|
|
+string Signal::Getorientation()
|
|
|
+{
|
|
|
+ return morientation;
|
|
|
+}
|
|
|
+
|
|
|
+double Signal::GetzOffset()
|
|
|
+{
|
|
|
+ return mzOffset;
|
|
|
+}
|
|
|
+
|
|
|
+string Signal::Gettype()
|
|
|
+{
|
|
|
+ return mtype;
|
|
|
+}
|
|
|
+
|
|
|
+string Signal::Getcountry()
|
|
|
+{
|
|
|
+ return mcountry;
|
|
|
+}
|
|
|
+
|
|
|
+string Signal::GetcountryRevision()
|
|
|
+{
|
|
|
+ return mcountryRevision;
|
|
|
+}
|
|
|
+
|
|
|
+string Signal::Getsubtype()
|
|
|
+{
|
|
|
+ return msubtype;
|
|
|
+}
|
|
|
+
|
|
|
+double Signal::GethOffset()
|
|
|
+{
|
|
|
+ return mhOffset;
|
|
|
+}
|
|
|
+
|
|
|
+double Signal::Getpitch()
|
|
|
+{
|
|
|
+ return mpitch;
|
|
|
+}
|
|
|
+
|
|
|
+double Signal::Getroll()
|
|
|
+{
|
|
|
+ return mroll;
|
|
|
+}
|
|
|
+
|
|
|
+double Signal::Getheight()
|
|
|
+{
|
|
|
+ return mheight;
|
|
|
+}
|
|
|
+
|
|
|
+double Signal::Getwidth()
|
|
|
+{
|
|
|
+ return mwidth;
|
|
|
+}
|
|
|
+
|
|
|
+signal_positionRoad * Signal::GetpositionRoad()
|
|
|
+{
|
|
|
+ return mpsignal_positionRoad;
|
|
|
+}
|
|
|
+
|
|
|
+signal_positionInertial * Signal::GetpositionInertial()
|
|
|
+{
|
|
|
+ return mpsignal_positionInertial;
|
|
|
+}
|
|
|
+
|
|
|
+void Signal::Sets(double s)
|
|
|
+{
|
|
|
+ ms = s;
|
|
|
+}
|
|
|
+
|
|
|
+void Signal::Sett(double t)
|
|
|
+{
|
|
|
+ mt = t;
|
|
|
+}
|
|
|
+
|
|
|
+void Signal::Setid(std::string id)
|
|
|
+{
|
|
|
+ mid = id;
|
|
|
+}
|
|
|
+
|
|
|
+void Signal::Setname(std::string name)
|
|
|
+{
|
|
|
+ mname = name;
|
|
|
+}
|
|
|
+
|
|
|
+void Signal::Setdynamic(bool dynamic)
|
|
|
+{
|
|
|
+ mdynamic = dynamic;
|
|
|
+}
|
|
|
+
|
|
|
+void Signal::Setorientation(std::string orientation)
|
|
|
+{
|
|
|
+ morientation = orientation;
|
|
|
+}
|
|
|
+
|
|
|
+void Signal::SetzOffset(double zOffset)
|
|
|
+{
|
|
|
+ mzOffset = zOffset;
|
|
|
+}
|
|
|
+
|
|
|
+void Signal::Settype(string type)
|
|
|
+{
|
|
|
+ mtype = type;
|
|
|
+}
|
|
|
+
|
|
|
+void Signal::Setcountry(std::string country)
|
|
|
+{
|
|
|
+ mcountry = country;
|
|
|
+}
|
|
|
+
|
|
|
+void Signal::SetcountryRevision(std::string countryRevision)
|
|
|
+{
|
|
|
+ mcountryRevision = countryRevision;
|
|
|
+}
|
|
|
+
|
|
|
+void Signal::Setsubtype(string subtype)
|
|
|
+{
|
|
|
+ msubtype = subtype;
|
|
|
+}
|
|
|
+
|
|
|
+void Signal::SethOffset(double hOffset)
|
|
|
+{
|
|
|
+ mhOffset = hOffset;
|
|
|
+}
|
|
|
+
|
|
|
+void Signal::Setpitch(double pitch)
|
|
|
+{
|
|
|
+ mpitch = pitch;
|
|
|
+}
|
|
|
+
|
|
|
+void Signal::Setroll(double roll)
|
|
|
+{
|
|
|
+ mroll = roll;
|
|
|
+}
|
|
|
+
|
|
|
+void Signal::Setheight(double height)
|
|
|
+{
|
|
|
+ mheight = height;
|
|
|
+}
|
|
|
+
|
|
|
+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)
|
|
|
+ {
|
|
|
+ mpsignal_positionRoad = new signal_positionRoad(s,t,zOffset,hOffset,pitch,roll);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ mpsignal_positionRoad->Sets(s);
|
|
|
+ mpsignal_positionRoad->Sett(t);
|
|
|
+ mpsignal_positionRoad->SetzOffset(zOffset);
|
|
|
+ mpsignal_positionRoad->SethOffset(hOffset);
|
|
|
+ mpsignal_positionRoad->Setpitch(pitch);
|
|
|
+ mpsignal_positionRoad->Setroll(roll);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+void Signal::SetpositionInertial(double x, double y, double z, double hdg, double pitch, double roll)
|
|
|
+{
|
|
|
+ if(mpsignal_positionInertial == 0)
|
|
|
+ {
|
|
|
+ mpsignal_positionInertial = new signal_positionInertial(x,y,z,hdg,pitch,roll);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ mpsignal_positionInertial->Setx(x);
|
|
|
+ mpsignal_positionInertial->Sety(y);
|
|
|
+ mpsignal_positionInertial->Setz(z);
|
|
|
+ mpsignal_positionInertial->Sethdg(hdg);
|
|
|
+ mpsignal_positionInertial->Setpitch(pitch);
|
|
|
+ mpsignal_positionInertial->Setroll(roll);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+signal_laneValidity * Signal::GetlaneValidity()
|
|
|
+{
|
|
|
+ return mpsignal_laneValidity;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|