sumo icon indicating copy to clipboard operation
sumo copied to clipboard

show vClass-specific speeds in lane parameter dialog

Open namdre opened this issue 3 years ago • 8 comments

namdre avatar Jul 01 '22 12:07 namdre

Can I please work on this?

To my understanding, we should add new mkItem calls in GUILane::getParameterWindow() of the src/guisim/GUILane.cpp file. Is this correct?

vijay-jaisankar avatar Jul 12 '22 09:07 vijay-jaisankar

Yes and yes. The new items should only be shown if the lane has vClass-specific speeds. The attribute name should be something like:

maxspeed [m/s]         |  27.78
    maxspeed (truck)   |  16.67

with a slight indent to make it from a group with the default maxspeed [m/s] item

namdre avatar Jul 12 '22 10:07 namdre

Awesome, thanks! Will work on it and make a PR soon.

vijay-jaisankar avatar Jul 12 '22 10:07 vijay-jaisankar

and can we please rename the line to "allowed speed"?

behrisch avatar Jul 12 '22 13:07 behrisch

Sure thing! Will do

vijay-jaisankar avatar Jul 12 '22 17:07 vijay-jaisankar

Hello, while working on this, I faced an issue. This is the code so far:

if(MSNet::getInstance()->getRestrictions(myEdge->getEdgeType()) != nullptr){
        auto map = MSNet::getInstance()->getRestrictions(myEdge->getEdgeType());
        for (auto item = map->begin(); item != map->end(); item++) {
            SUMOVehicleClass svc = item->first;
            double speed = item->second;
            // Convert svc into a string 
            // mkItem call
    }

Can you please let me know if

  • I'm on the right track
  • If yes, how do you convert the svc object into a string for the mkItem call? I tried c_str() but it didn't work.
  • If not, which other function call I should focus on instead.

Thanks, Vijay

vijay-jaisankar avatar Jul 20 '22 20:07 vijay-jaisankar

You can simply use toString(svc) to convert it into a string

behrisch avatar Jul 22 '22 09:07 behrisch

Thanks a lot, https://github.com/eclipse/sumo/pull/11243 contains the changes mentioned, please check.

vijay-jaisankar avatar Jul 22 '22 13:07 vijay-jaisankar

Thanks!

namdre avatar Aug 26 '22 06:08 namdre