37 std::string warning =
"";
55 StoHelp::readCompound(inputStorage, 2,
"A compound object of size 2 is needed for setting a parameter.");
56 const std::string name =
StoHelp::readTypedString(inputStorage,
"The name of the parameter must be given as a string.");
58 libsumo::ChargingStation::setParameter(
id, name,
value);
62 libsumo::ChargingStation::setChargingPower(
id,
StoHelp::readTypedDouble(inputStorage,
"Setting chargingPower requires a double."));
66 libsumo::ChargingStation::setEfficiency(
id,
StoHelp::readTypedDouble(inputStorage,
"Setting efficiency requires a double."));
70 libsumo::ChargingStation::setChargeDelay(
id,
StoHelp::readTypedDouble(inputStorage,
"Setting charge delay requires a double."));
74 libsumo::ChargingStation::setChargeInTransit(
id,
StoHelp::readTypedInt(inputStorage,
"Setting charge in transit requires an integer.") != 0);
78 libsumo::ChargingStation::setTotalPower(
id,
StoHelp::readTypedDouble(inputStorage,
"Setting totalPower requires a double."));
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 0xc6: Change ChargingStation 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 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 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_CS_POWER
TRACI_CONST int VAR_CS_TOTAL_POWER
TRACI_CONST int VAR_CS_CHARGE_DELAY
TRACI_CONST int VAR_CS_EFFICIENCY
TRACI_CONST int VAR_CS_CHARGE_IN_TRANSIT
TRACI_CONST int VAR_PARAMETER
TRACI_CONST int CMD_SET_CHARGINGSTATION_VARIABLE