Eclipse SUMO - Simulation of Urban MObility
MSTransportableDevice_FCD.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2013-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
17 // A device which stands as an implementation FCD and which outputs movereminder calls
18 /****************************************************************************/
19 
20 // ===========================================================================
21 // included modules
22 // ===========================================================================
23 #include <config.h>
24 
28 #include <microsim/MSNet.h>
29 #include <microsim/MSLane.h>
30 #include <microsim/MSEdge.h>
33 
34 // ===========================================================================
35 // static members
36 // ===========================================================================
37 
38 // ===========================================================================
39 // method definitions
40 // ===========================================================================
41 // ---------------------------------------------------------------------------
42 // static initialisation methods
43 // ---------------------------------------------------------------------------
44 void
46  insertDefaultAssignmentOptions("fcd", "FCD Device", oc, true);
47 
48  oc.doRegister("person-device.fcd.period", new Option_String("0"));
49  oc.addDescription("person-device.fcd.period", "FCD Device", "Recording period for FCD-data");
50 }
51 
52 
53 void
54 MSTransportableDevice_FCD::buildDevices(MSTransportable& t, std::vector<MSTransportableDevice*>& into) {
56  if (equippedByDefaultAssignmentOptions(oc, "fcd", t, oc.isSet("fcd-output"), true)) {
57  MSTransportableDevice_FCD* device = new MSTransportableDevice_FCD(t, "fcd_" + t.getID());
58  into.push_back(device);
59  }
60 }
61 
62 
63 // ---------------------------------------------------------------------------
64 // MSTransportableDevice_FCD-methods
65 // ---------------------------------------------------------------------------
67  MSTransportableDevice(holder, id) {
68 }
69 
70 
72 }
73 
74 
75 void
77 }
78 
79 /****************************************************************************/
80 
void doRegister(const std::string &name, Option *v)
Adds an option under the given name.
Definition: OptionsCont.cpp:75
static void cleanup()
resets the edge filter
static OptionsCont & getOptions()
Retrieves the options.
Definition: OptionsCont.cpp:58
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
A device which collects info on the vehicle trip (mainly on departure and arrival) ...
Abstract in-person device.
const std::string & getID() const
returns the id of the transportable
static void insertDefaultAssignmentOptions(const std::string &deviceName, const std::string &optionsTopic, OptionsCont &oc, const bool isPerson=false)
Adds common command options that allow to assign devices to vehicles.
Definition: MSDevice.cpp:126
static bool equippedByDefaultAssignmentOptions(const OptionsCont &oc, const std::string &deviceName, DEVICEHOLDER &v, bool outputOptionSet, const bool isPerson=false)
Determines whether a vehicle should get a certain device.
Definition: MSDevice.h:204
static void insertOptions(OptionsCont &oc)
Inserts MSTransportableDevice_FCD-options.
A storage for options typed value containers)
Definition: OptionsCont.h:90
MSTransportableDevice_FCD(MSTransportable &holder, const std::string &id)
Constructor.
void addDescription(const std::string &name, const std::string &subtopic, const std::string &description)
Adds a description for an option.
static void buildDevices(MSTransportable &t, std::vector< MSTransportableDevice *> &into)
Build devices for the given vehicle, if needed.