SUMO - Simulation of Urban MObility
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
MSDevice_BTsender.cpp
Go to the documentation of this file.
1
/****************************************************************************/
7
// A BT sender
8
/****************************************************************************/
9
// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
10
// Copyright (C) 2001-2013 DLR (http://www.dlr.de/) and contributors
11
/****************************************************************************/
12
//
13
// This file is part of SUMO.
14
// SUMO is free software: you can redistribute it and/or modify
15
// it under the terms of the GNU General Public License as published by
16
// the Free Software Foundation, either version 3 of the License, or
17
// (at your option) any later version.
18
//
19
/****************************************************************************/
20
21
// ===========================================================================
22
// included modules
23
// ===========================================================================
24
#ifdef _MSC_VER
25
#include <
windows_config.h
>
26
#else
27
#include <
config.h
>
28
#endif
29
30
#include <
utils/common/TplConvert.h
>
31
#include <
utils/options/OptionsCont.h
>
32
#include <
utils/iodevices/OutputDevice.h
>
33
#include <
utils/common/SUMOVehicle.h
>
34
#include <
microsim/MSNet.h
>
35
#include <
microsim/MSLane.h
>
36
#include <
microsim/MSEdge.h
>
37
#include <
microsim/MSVehicle.h
>
38
#include "
MSDevice_Tripinfo.h
"
39
#include "
MSDevice_BTsender.h
"
40
41
#ifdef CHECK_MEMORY_LEAKS
42
#include <
foreign/nvwa/debug_new.h
>
43
#endif // CHECK_MEMORY_LEAKS
44
45
46
// ===========================================================================
47
// method definitions
48
// ===========================================================================
49
// ---------------------------------------------------------------------------
50
// static initialisation methods
51
// ---------------------------------------------------------------------------
52
void
53
MSDevice_BTsender::insertOptions
(
OptionsCont
& oc) {
54
oc.
addOptionSubTopic
(
"Communication"
);
55
insertDefaultAssignmentOptions
(
"btsender"
,
"Communication"
, oc);
56
}
57
58
59
void
60
MSDevice_BTsender::buildVehicleDevices
(
SUMOVehicle
& v, std::vector<MSDevice*>& into) {
61
OptionsCont
& oc =
OptionsCont::getOptions
();
62
if
(
equippedByDefaultAssignmentOptions
(oc,
"btsender"
, v)) {
63
MSDevice_BTsender
* device =
new
MSDevice_BTsender
(v,
"btsender_"
+ v.
getID
());
64
into.push_back(device);
65
}
66
}
67
68
69
// ---------------------------------------------------------------------------
70
// MSDevice_BTsender-methods
71
// ---------------------------------------------------------------------------
72
MSDevice_BTsender::MSDevice_BTsender
(
SUMOVehicle
& holder,
const
std::string&
id
)
73
:
MSDevice
(holder, id), myReportRoute(false) {
74
}
75
76
77
MSDevice_BTsender::~MSDevice_BTsender
() {
78
}
79
80
81
void
82
MSDevice_BTsender::generateOutput
()
const
{
83
if
(
myReportRoute
) {
84
OutputDevice
& os =
OutputDevice::getDeviceByOption
(
"bt-output"
);
85
os.
openTag
(
"found"
);
86
os.
writeAttr
(
"id"
,
myHolder
.
getID
());
87
os.
writeAttr
(
"route"
,
myHolder
.
getRoute
().
getEdges
());
88
os.
closeTag
();
89
}
90
}
91
92
93
94
/****************************************************************************/
95
build
buildd
sumo-0.18~dfsg
src
microsim
devices
MSDevice_BTsender.cpp
Generated on Wed Oct 23 2013 01:15:09 for SUMO - Simulation of Urban MObility by
1.8.4