NMPB08 Shared Libraries
Defines | Functions | Variables
RailwayEmission.cpp File Reference
#include "RailwayEmission.h"
#include "stdlib.h"
#include <math.h>

Go to the source code of this file.

Defines

#define TRACE_DEBUG   GetOptions(OPTION_TRACE_DEBUG)

Functions

char * my_strdup (const char *s)
template<class T >
MIN (T const &x, T const &y)
template<class T >
MAX (T const &x, T const &y)
std::string getID (const char *s)
void * NMPB08_CreateRailwayTraffic (double nb_hours)
 create a context for converting railway traffic into an equivalent source model
int NMPB08_ClearRailwayTraffic (void *id)
 empties the traffic associated with the source model
int NMPB08_AddRailwayTraffic (void *id, const char *unit_or_train, double number, double speed)
 adds a traffic component to the source model
RailwayEmission const * NMPB08_GetRailwayEmission (void *id, ScreenBodyInteraction *screenBodyInteraction)
 returns the equivalent source model for the current traffic state
int NMPB08_DeleteRailwayTraffic (void *id)
 destroys the internal data structure used for converting railway traffic data into an equivalent source model.
unsigned int NMPB08_SetRailwayOptions (void *id, unsigned int option, bool on_off)
 enables or disables selected options
unsigned int NMPB08_GetRailwayOptions (void *id, unsigned int option)
 return the currently selected options
int NMPB08_SetRailwayEmissionAngles (void *id, double sin_h, double sin_v)
 sets de emission angles for the equivalent source model
unsigned int NMPB08_SetRailCorrection (void *id, NMPB_RailCorrectionType corr)
 set the rail correction
NMPB_RailCorrectionType NMPB08_GetRailwayOptions (void *id)

Variables

const double PI = 3.1415926

Define Documentation

#define TRACE_DEBUG   GetOptions(OPTION_TRACE_DEBUG)

Definition at line 26 of file RailwayEmission.cpp.


Function Documentation

std::string getID ( const char *  s)

Definition at line 64 of file RailwayDatabase.cpp.

template<class T >
T MAX ( T const &  x,
T const &  y 
) [inline]

Definition at line 52 of file RailwayEmission.cpp.

template<class T >
T MIN ( T const &  x,
T const &  y 
) [inline]

Definition at line 47 of file RailwayEmission.cpp.

char* my_strdup ( const char *  s)

Definition at line 28 of file RailwayEmission.cpp.

int NMPB08_AddRailwayTraffic ( void *  id,
const char *  unit_or_train,
double  number,
double  speed 
)

adds a traffic component to the source model

Parameters:
idhandle to the internal structure used by the traffic model
unit_or_trainidentification of the type of unit or train
numbernumber of units or trains passing during the reference period
speedspeed in km/h
Returns:
O if sucessful, an error code otherwise

Definition at line 681 of file RailwayEmission.cpp.

int NMPB08_ClearRailwayTraffic ( void *  id)

empties the traffic associated with the source model

Parameters:
idhandle to the internal structure used by the traffic model
Returns:
O if sucessful, an error code otherwise

Definition at line 670 of file RailwayEmission.cpp.

void* NMPB08_CreateRailwayTraffic ( double  nb_hours)

create a context for converting railway traffic into an equivalent source model

Parameters:
nb_hoursduration of the period of reference in hours
Returns:
a handle to an internal structure to be uses in consecutive calls to other function inside the library, a NULL pointer if error occured

Definition at line 659 of file RailwayEmission.cpp.

int NMPB08_DeleteRailwayTraffic ( void *  id)

destroys the internal data structure used for converting railway traffic data into an equivalent source model.

Parameters:
idhandle to an internal data structure as returned by /ref NMPB08_CreateRailwayTraffic.
Returns:
0 if successful, an error code otherwise.

Definition at line 703 of file RailwayEmission.cpp.

RailwayEmission const* NMPB08_GetRailwayEmission ( void *  id,
ScreenBodyInteraction screenBodyInteraction = 0 
)

returns the equivalent source model for the current traffic state

Parameters:
idhandle to the internal structure used by the traffic model
screenBodyInteractionconfiguration of interaction between the train body and a nearby screen One interaction corresponds to a double reflection, once on the barrier, once on the car body. The equivalent reflection coefficient of the car bodies is encoded in the database and will modify the equivalent sound power of the image sources created through reflection. Absorption on the inner side of the barrier is also taken into account (see NF S 31-133, section 7.4.6).
Returns:
a pointer to the equivalent source model, a null pointer in case an invalid source height has been detected in the selected trains and units
Note:
if OPTION_H_INTERPOLATE is set, sources heights defined in the database will be automatically adapted to the 3 sources heights defined in the NMPB model. This is achieved by distributing the acoustical power over the predefined source heights proportional to the difference in height

Definition at line 692 of file RailwayEmission.cpp.

unsigned int NMPB08_GetRailwayOptions ( void *  id,
unsigned int  option 
)

return the currently selected options

Parameters:
idhandle to the internal structure used by the traffic model
optionoptions to be reported
Returns:
the selected set of options

Definition at line 726 of file RailwayEmission.cpp.

NMPB_RailCorrectionType NMPB08_GetRailwayOptions ( void *  id)

Definition at line 759 of file RailwayEmission.cpp.

unsigned int NMPB08_SetRailCorrection ( void *  id,
NMPB_RailCorrectionType  corr 
)

set the rail correction

Parameters:
idhandle to the internal structure used by the traffic model
corrnew correction for the rail / mounting condition
Returns:
O if sucessful, an error code otherwise

Definition at line 748 of file RailwayEmission.cpp.

int NMPB08_SetRailwayEmissionAngles ( void *  id,
double  sin_h,
double  sin_v 
)

sets de emission angles for the equivalent source model

Parameters:
idhandle to the internal structure used by the traffic model
sin_hsinus of the angle of the propagation direction with the vertical plane perpendicular to the track
sin_vsinus of the angle of the propagation direction with the horizontal plane containing the track
Returns:
0 if successful, an error code otherwise
Note:
if the OPTION_NO_DIRECIVITY is set, this function has no effect on the reported equivalent source model

Definition at line 737 of file RailwayEmission.cpp.

unsigned int NMPB08_SetRailwayOptions ( void *  id,
unsigned int  option,
bool  on_off 
)

enables or disables selected options

Parameters:
idhandle to the internal structure used by the traffic model
optionoptions to be set or cleared
on_offif true, options will be set, otherwise options will be cleared
Returns:
the modified set of options

Definition at line 715 of file RailwayEmission.cpp.


Variable Documentation

const double PI = 3.1415926

Definition at line 476 of file RailwayEmission.cpp.

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines