64 double chargingPower,
double efficiency,
bool chargeInTransit,
const double chargeDelay,
bool friendlyPosition) :
66 myChargingPower(chargingPower),
67 myEfficiency(efficiency),
68 myChargeInTransit(chargeInTransit),
69 myChargeDelay(chargeDelay) {
112 if (
myName.empty() ==
false) {
151 if (chargingPower > 0) {
154 throw InvalidArgument(
"Value of charging Power must be greater than 0");
161 if (efficiency >= 0 && efficiency <= 1) {
177 if (chargeDelay < 0) {
209 if (s.
scale * exaggeration >= 10) {
233 if (s.
scale * exaggeration > 25) {
234 noPoints =
MIN2((
int)(9.0 + (s.
scale * exaggeration) / 10.0), 36);
238 glScaled(exaggeration, exaggeration, 1);
251 glTranslated(0, 0, .1);
263 if (s.
scale * exaggeration >= 4.5) {
359 if (canParse<double>(value)) {
366 if (canParse<double>(value)) {
375 return canParse<bool>(value);
377 return (canParse<double>(value) && parse<double>(value) >= 0);
379 return (canParse<double>(value) && parse<double>(value) >= 0 && parse<double>(value) <= 1);
381 return canParse<bool>(value);
383 return (canParse<double>(value) && parse<double>(value) >= 0);
385 return canParse<bool>(value);
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
void drawName(const Position &pos, const double scale, const GUIVisualizationTextSettings &settings, const double angle=0) const
draw name of item
double scale
information about a lane's width (temporary, used for a single view)
static void drawBoxLines(const PositionVector &geom, const std::vector< double > &rots, const std::vector< double > &lengths, double width, int cornerDetail=0, double offset=0)
Draws thick lines.
GUIVisualizationTextSettings addName
bool getChargeInTransit()
Returns the value of charge in transit of the chargingStation.
double getEfficiency()
Returns the charging efficiency of the chargingStation.
void refreshElement(GUIGlObject *o)
refreshes boundary information for o and update
bool isValidAdditionalID(const std::string &newID) const
check if a new additional ID is valid
double getAbsoluteStartPosition() const
get absolute start Position
double x() const
Returns the x-position.
Stores the information about how to visualize structures.
Allow/disallow charge in transit in Charging Stations.
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
bool isAdditionalSelected() const
static void drawText(const std::string &text, const Position &pos, const double layer, const double size, const RGBColor &col=RGBColor::BLACK, const double angle=0, int align=0, double width=-1)
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
bool myFriendlyPosition
Flag for friendly position.
void setEfficiency(double efficiency)
Set a new efficiency in the charging station.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
std::vector< double > myShapeRotations
static void drawFilledCircle(double width, int steps=8)
Draws a filled circle around (0,0)
GUIGlID getGlID() const
Returns the numerical id of the object.
void changeAdditionalID(const std::string &newID)
change ID of additional
double myEfficiency
efficiency of the charge
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
static OptionsCont & getOptions()
Retrieves the options.
void setChargeInTransit(bool chargeInTransit)
Enable or disable charge in transit in the charging station.
GNEViewNet * myViewNet
The GNEViewNet this additional element belongs.
void p_add(GNEChange_Attribute *cmd)
special method, avoid empty changes, always execute
GUIVisualizationSizeSettings addSize
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
static const RGBColor selectedAdditionalColor
color of selected additionals
double getExaggeration(const GUIVisualizationSettings &s, double factor=20) const
return the drawing size including exaggeration and constantSize values
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
const std::string & getAdditionalID() const
returns Additional ID
PositionVector myShape
The shape of the additional element.
A point in 2D or 3D with translation and scaling methods.
GNELane * myLane
The lane in which this lane is placed.
friend class GNEChange_Attribute
declare friend class
double y() const
Returns the y-position.
double getChargeDelay()
Returns the charge delay of the chargingStation.
double getChargingPower()
Returns the charging power of the chargingStation.
block movement of a graphic element
void updateGeometry()
update pre-computed geometry information
std::vector< double > myShapeLengths
The lengths of the shape parts.
~GNEChargingStation()
Destructor.
const std::string getID() const
function to support debugging
void setChargeDelay(double chargeDelay)
Set a new charge delay in the charging station.
void drawLockIcon(double size=0.5) const
draw lock icon
bool myChargeInTransit
enable or disable charge in transit
void move2side(double amount)
move position vector to side using certain ammount
double myChargingPower
Charging power pro timestep.
std::string myName
name of stoppingPlace
GNEChargingStation(const std::string &id, GNELane *lane, GNEViewNet *viewNet, double startPos, double endPos, const std::string &name, double chargingPower, double efficiency, bool chargeInTransit, const double chargeDelay, bool friendlyPosition)
Constructor of charging station.
void writeAdditional(OutputDevice &device) const
writte additional element into a xml file
bool myBlocked
boolean to check if additional element is blocked (i.e. cannot be moved with mouse) ...
std::string getAttribute(SumoXMLAttr key) const
This functions has to be implemented in all GNEAttributeCarriers.
GUIVisualizationTextSettings addFullName
double myEndPosRelative
The relative [0,1] end position this stopping place is located at.
double myStartPosRelative
The relative [0,1] start position this stopping place is located at.
void setBlockIconRotation(GNELane *additionalLane=NULL)
void setChargingPower(double chargingPower)
Set a new charging power in the charging station.
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
GNENet * getNet() const
get the net object
double myChargeDelay
delay in the starting of charge
Position getLineCenter() const
get line center
void setStoppingPlaceGeometry()
set geometry common to all stopping places
SumoXMLTag getTag() const
get XML Tag assigned to this object
Static storage of an output device and its base (abstract) implementation.
Eficiency of the charge in Charging Stations.
bool closeTag()
Closes the most recently opened tag.
static const RGBColor selectionColor
Delay in the charge of charging stations.
double getAbsoluteEndPosition() const
get absolute end Position
Position mySignPos
The position of the sign.
double getLaneParametricLength() const
returns the parameteric length of the lane
GNELane * retrieveLane(const std::string &id, bool failHard=true, bool checkVolatileChange=false)
get lane by id
double myBlockIconRotation
The rotation of the block icon.
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
GNELane * changeLane(GNELane *oldLane, const std::string &newLaneID)
change lane of additional
Position myBlockIconPosition
position of the block icon
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes ...