Commit 173a653c authored by Yann Garcia's avatar Yann Garcia
Browse files

Add missing external functions

parent d84331c4
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
{
	"folders": [
		{
			"path": "."
		}
	]
}
 No newline at end of file
+36 −0
Original line number Diff line number Diff line
@@ -10,6 +10,8 @@
#define earthRadius 6378137.0L
#define rbis = ((double)(earthRadius * M_PI / 180))

#define epsilon ((double)0.000001)

namespace LibItsCommon__Functions {

  /**
@@ -128,4 +130,38 @@ namespace LibItsCommon__Functions {
  */
  FLOAT fx__computeRadiusFromCircularArea(const FLOAT &p__squareMeters) { return FLOAT(sqrt(p__squareMeters / M_PI)); }

  // Verifiy 'euclidian distance (P1, P2) > minReferencePointPositonChangeThreshold'
  BOOLEAN fx__verify__euclidian__distance(const INTEGER& p__p1__lat, const INTEGER& p__p1__lon, const INTEGER& p__p2__lat, const INTEGER& p__p2__lon, const FLOAT& p__threshold, const INTEGER& p__comparison) {

    double v = sqrt(
                      (
                        (double)static_cast<const int>(p__p2__lat) * (double)static_cast<const int>(p__p2__lat) - (double)static_cast<const int>(p__p1__lat) * (double)static_cast<const int>(p__p1__lat)
                      ) + 
                      (
                        (double)static_cast<const int>(p__p2__lon) * (double)static_cast<const int>(p__p2__lon) - (double)static_cast<const int>(p__p1__lon) * (double)static_cast<const int>(p__p1__lon)
                      )
                    );

    if (p__comparison == 0) {
      return abs(v - (double)static_cast<const float>(p__threshold)) < epsilon;
    } else if (p__comparison == -1) {
      return ((double)static_cast<const float>(p__threshold) - v) < -epsilon;
    } else {
      return ((double)static_cast<const float>(p__threshold) - v) > epsilon;
    }
  }

  BOOLEAN fx__verify__delta(const INTEGER& p__v1, const INTEGER& p__v2, const FLOAT& p__threshold, const INTEGER& p__comparison) {

    double v = (double)static_cast<const int>(p__v2) - (double)static_cast<const int>(p__v1);

    if (p__comparison == 0) {
      return abs(v - (double)static_cast<const float>(p__threshold)) < epsilon;
    } else if (p__comparison == -1) {
      return ((double)static_cast<const float>(p__threshold) - v) < -epsilon;
    } else {
      return ((double)static_cast<const float>(p__threshold) - v) > epsilon;
    }
  }

} // namespace LibItsCommon__Functions
+1 −1
Original line number Diff line number Diff line
TTCN3_COMPILER_OPTIONS := -d -e -f -g -H -j -l -L -R -U none -x -X
TTCN3_DIR      := $(HOME)/frameworks/titan/titan.core/Install
ASN1C_PATH     := $(HOME)/frameworks/asn1c.denis
ASN1C_PATH     := $(HOME)/frameworks/asn1c
#WPCAP_DLL_PATH := /cygdrive/c/windows/system32/npcap/wpcap.dll
#NPCAP_INCLUDE  := /cygdrive/c/PROGRA~1/Npcap/sdk/include
#T3Q_PATH=./tools/t3q-v2.0.0b30
Original line number Diff line number Diff line
Subproject commit a8db2aefc860cdfec0b76ae767f5c91fe7ec042f
Subproject commit ed00235c4469eba2d33bbff9f96aaad8a641e84c
Compare 2e6d1a86 to 3a49ddad
Original line number Diff line number Diff line
Subproject commit 2e6d1a86b54ec3eb11fc5b7f6e70f80b06834a50
Subproject commit 3a49ddad6cc59694b4936d43dca49038325a01e7
Loading