LibMec_ExternalFunctions.cc 1.22 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include "LibMec_Functions.hh"
#include <math.h>

#include "base_time.hh"
#include "loggers.hh"

#ifndef M_PI
#define M_PI	3.14159265358979323846
#endif
#define earthRadius 6378137.0L
#define rbis = ((double)(earthRadius * M_PI / 180))

namespace LibMec__Functions {

  /**
   * @desc    This external function gets the current time
   * @return  Timestamp - current time since 01/01/2004 in milliseconds
   * @see     fx_getCurrentTime() return TimestampIts
   */
20
  INTEGER fx__getCurrentTime() {
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
    INTEGER i;
    i.set_long_long_val(base_time::get_instance().get_its_current_time_ms());
    loggers::get_instance().log_msg("<<< fx__getCurrentTime: ", i);
    return i;
  }
  /**
   * @desc    This external function gets the current time since 01/01/1970 in UTC format
   * @return  The current time since 01/01/1970 in UTC format
   * @see     fx_getCurrentTimeUtc() return UInt64
   */
  INTEGER fx__get__current__time__utc() {
    INTEGER i;
    i.set_long_long_val(base_time::get_instance().get_current_time_ms());
    return i;
  }

37
38
39
40
41
42
43
44
  /**
   * @desc    Convert a float value into a string
   * @return  The string formated value
   */
  CHARSTRING fx__float2str(const FLOAT& p_value) {
    return float2str(p_value);
  }

45
} // end of Namespace