Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
MSTransportableDevice_FCD.cpp
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2013-2024 German Aerospace Center (DLR) and others.
4// This program and the accompanying materials are made available under the
5// terms of the Eclipse Public License 2.0 which is available at
6// https://www.eclipse.org/legal/epl-2.0/
7// This Source Code may also be made available under the following Secondary
8// Licenses when the conditions for such availability set forth in the Eclipse
9// Public License 2.0 are satisfied: GNU General Public License, version 2
10// or later which is available at
11// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13/****************************************************************************/
20// A device which stands as an implementation FCD and which outputs movereminder calls
21/****************************************************************************/
22#include <config.h>
23
27#include <microsim/MSNet.h>
28#include <microsim/MSLane.h>
29#include <microsim/MSEdge.h>
31#include "MSDevice_FCD.h"
33
34// ===========================================================================
35// static members
36// ===========================================================================
37
38// ===========================================================================
39// method definitions
40// ===========================================================================
41// ---------------------------------------------------------------------------
42// static initialisation methods
43// ---------------------------------------------------------------------------
44void
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", TL("Recording period for FCD-data"));
50}
51
52
53void
54MSTransportableDevice_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);
60 }
61}
62
63
64// ---------------------------------------------------------------------------
65// MSTransportableDevice_FCD-methods
66// ---------------------------------------------------------------------------
70
71
74
75
76void
79
80
81/****************************************************************************/
#define TL(string)
Definition MsgHandler.h:315
static void initOnce()
initialize edge filter and attribute mask (once)
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:155
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:195
A device which collects info on the vehicle trip (mainly on departure and arrival)
static void cleanup()
resets the edge filter
static void insertOptions(OptionsCont &oc)
Inserts MSTransportableDevice_FCD-options.
MSTransportableDevice_FCD(MSTransportable &holder, const std::string &id)
Constructor.
static void buildDevices(MSTransportable &t, std::vector< MSTransportableDevice * > &into)
Build devices for the given vehicle, if needed.
Abstract in-person device.
const std::string & getID() const
Returns the id.
Definition Named.h:74
A storage for options typed value containers)
Definition OptionsCont.h:89
void addDescription(const std::string &name, const std::string &subtopic, const std::string &description)
Adds a description for an option.
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
void doRegister(const std::string &name, Option *o)
Adds an option under the given name.
static OptionsCont & getOptions()
Retrieves the options.