41 std::string warning =
"";
67 libsumo::POI::setColor(
id,
StoHelp::readTypedColor(inputStorage,
"The color must be given using the according type."));
72 libsumo::POI::setPosition(
id, pos.
x, pos.
y);
92 const int parameterCount =
StoHelp::readCompound(inputStorage, -1,
"A compound object is needed for highlighting an object.");
93 if (parameterCount > 5) {
97 if (parameterCount > 0) {
98 col =
StoHelp::readTypedColor(inputStorage,
"The first parameter for highlighting must be the highlight color.");
101 if (parameterCount > 1) {
105 if (parameterCount > 2) {
108 double duration = -1;
109 if (parameterCount > 3) {
110 duration =
StoHelp::readTypedDouble(inputStorage,
"The fourth parameter for highlighting must be the highlight duration.");
113 if (parameterCount > 4) {
116 libsumo::POI::highlight(
id, col, size, alphaMax, duration, type);
120 const int parameterCount =
StoHelp::readCompound(inputStorage, -1,
"A compound object is needed for adding a new PoI.");
121 const std::string type =
StoHelp::readTypedString(inputStorage,
"The first PoI parameter must be the type encoded as a string.");
123 const int layer =
StoHelp::readTypedInt(inputStorage,
"The third PoI parameter must be the layer encoded as int.");
125 if (parameterCount == 4) {
126 if (!libsumo::POI::add(
id, pos.
x, pos.
y, col, type, layer)) {
129 }
else if (parameterCount >= 8) {
130 const std::string imgFile =
StoHelp::readTypedString(inputStorage,
"The fifth PoI parameter must be the imgFile encoded as a string.");
131 const double width =
StoHelp::readTypedDouble(inputStorage,
"The sixth PoI parameter must be the width encoded as a double.");
132 const double height =
StoHelp::readTypedDouble(inputStorage,
"The seventh PoI parameter must be the height encoded as a double.");
133 const double angle =
StoHelp::readTypedDouble(inputStorage,
"The eighth PoI parameter must be the angle encoded as a double.");
135 if (parameterCount == 9) {
138 if (!libsumo::POI::add(
id, pos.
x, pos.
y, col, type, layer, imgFile, width, height, angle, icon)) {
143 "Adding a PoI requires either only type, color, layer and position parameters or these and icon, imageFile, width, height and angle parameters.",
150 if (!libsumo::POI::remove(
id, layer)) {
156 StoHelp::readCompound(inputStorage, 2,
"A compound object of size 2 is needed for setting a parameter.");
157 const std::string name =
StoHelp::readTypedString(inputStorage,
"The name of the parameter must be given as a string.");
159 libsumo::POI::setParameter(
id, name,
value);
const std::string invalid_return< std::string >::value
std::string toHex(const T i, std::streamsize numDigits=0)
static bool processSet(TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage)
Processes a set value command (Command 0xc7: Change PoI State).
TraCI server used to control sumo by a remote TraCI client.
void writeStatusCmd(int commandId, int status, const std::string &description, tcpip::Storage &outputStorage)
Writes a status command to the given storage.
bool writeErrorStatusCmd(int commandId, const std::string &description, tcpip::Storage &outputStorage)
Writes a status command to the given storage with status = RTYPE_ERR.
static int readTypedUnsignedByte(tcpip::Storage &ret, const std::string &error="")
static int readCompound(tcpip::Storage &ret, int expectedSize=-1, const std::string &error="")
static int readTypedInt(tcpip::Storage &ret, const std::string &error="")
static std::string readTypedString(tcpip::Storage &ret, const std::string &error="")
static const libsumo::TraCIPosition readTypedPosition2D(tcpip::Storage &ret, const std::string &error="")
static const libsumo::TraCIColor readTypedColor(tcpip::Storage &ret, const std::string &error="")
static double readTypedDouble(tcpip::Storage &ret, const std::string &error="")
An error which allows to continue.
virtual std::string readString()
virtual int readUnsignedByte()
TRACI_CONST int VAR_IMAGEFILE
TRACI_CONST int VAR_ANGLE
TRACI_CONST int VAR_HIGHLIGHT
TRACI_CONST int CMD_SET_POI_VARIABLE
TRACI_CONST int VAR_COLOR
TRACI_CONST int VAR_POSITION
TRACI_CONST int VAR_WIDTH
TRACI_CONST int VAR_PARAMETER
TRACI_CONST int VAR_HEIGHT
A 2D or 3D-position, for 2D positions z == INVALID_DOUBLE_VALUE.