Skip to content

Commit

Permalink
fix #16076
Browse files Browse the repository at this point in the history
  • Loading branch information
namdre committed Jan 24, 2025
1 parent d70e39b commit 90ecf74
Show file tree
Hide file tree
Showing 4 changed files with 175 additions and 87 deletions.
8 changes: 7 additions & 1 deletion src/netedit/GNEApplicationWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1416,6 +1416,7 @@ GNEApplicationWindow::fillMenuBar() {
myLocateMenuCommands.buildLocateMenuCommands(myLocatorMenu);
// build tools menu
myToolsMenu = new FXMenuPane(this);
myToolsAssignMenu = new FXMenuPane(this);
myToolsDetectorMenu = new FXMenuPane(this);
myToolsDistrictMenu = new FXMenuPane(this);
myToolsDRTMenu = new FXMenuPane(this);
Expand All @@ -1430,11 +1431,13 @@ GNEApplicationWindow::fillMenuBar() {
myToolsOutputMenu = new FXMenuPane(this);
myToolsShapes = new FXMenuPane(this);
myToolsTLS = new FXMenuPane(this);
myToolsTriggerMenu = new FXMenuPane(this);
myToolsTurnDefs = new FXMenuPane(this);
myToolsVisualizationMenu = new FXMenuPane(this);
myToolsXML = new FXMenuPane(this);
GUIDesigns::buildFXMenuTitle(myToolbarsGrip.menu, TL("&Tools"), nullptr, myToolsMenu);
// build tools menu cascasde
new FXMenuCascade(myToolsMenu, TL("Assign"), nullptr, myToolsAssignMenu);
new FXMenuCascade(myToolsMenu, TL("Detectors"), GUIIconSubSys::getIcon(GUIIcon::E1), myToolsDetectorMenu);
new FXMenuCascade(myToolsMenu, TL("Districts"), GUIIconSubSys::getIcon(GUIIcon::TAZ), myToolsDistrictMenu);
new FXMenuCascade(myToolsMenu, TL("DRT"), GUIIconSubSys::getIcon(GUIIcon::VCLASS_SMALL_TAXI), myToolsDRTMenu);
Expand All @@ -1445,17 +1448,19 @@ GNEApplicationWindow::fillMenuBar() {
new FXMenuCascade(myToolsImportMenu, TL("Visum"), GUIIconSubSys::getIcon(GUIIcon::TOOL_VISUM), myToolsImportVisum);
new FXMenuCascade(myToolsMenu, TL("Import"), GUIIconSubSys::getIcon(GUIIcon::TOOL_IMPORT), myToolsImportMenu);
new FXMenuCascade(myToolsMenu, TL("Net"), GUIIconSubSys::getIcon(GUIIcon::MODECREATEEDGE), myToolsNetMenu);
new FXMenuCascade(myToolsMenu, TL("Route"), GUIIconSubSys::getIcon(GUIIcon::MODEADDITIONAL), myToolsRouteMenu);
new FXMenuCascade(myToolsMenu, TL("Output"), GUIIconSubSys::getIcon(GUIIcon::TOOL_OUTPUT), myToolsOutputMenu);
new FXMenuCascade(myToolsMenu, TL("Route"), GUIIconSubSys::getIcon(GUIIcon::MODEADDITIONAL), myToolsRouteMenu);
//new FXMenuCascade(myToolsMenu, TL("Shapes"), GUIIconSubSys::getIcon(GUIIcon::MODESHAPE), myToolsShapes);
new FXMenuCascade(myToolsMenu, TL("TLS"), GUIIconSubSys::getIcon(GUIIcon::MODETLS), myToolsTLS);
new FXMenuCascade(myToolsMenu, TL("Trigger"), nullptr, myToolsTriggerMenu);
new FXMenuCascade(myToolsMenu, TL("Turn-defs"), GUIIconSubSys::getIcon(GUIIcon::TOOL_TURNDEFS), myToolsTurnDefs);
new FXMenuCascade(myToolsMenu, TL("Visualization"), GUIIconSubSys::getIcon(GUIIcon::COLORWHEEL), myToolsVisualizationMenu);
new FXMenuCascade(myToolsMenu, TL("XML"), GUIIconSubSys::getIcon(GUIIcon::TOOL_XML), myToolsXML);
// add separators between folders
new FXMenuSeparator(myToolsMenu);
new FXMenuSeparator(myToolsImportMenu);
// create map with tool Menu panes and their associated folder
myMenuPaneToolMaps["assign"] = myToolsAssignMenu;
myMenuPaneToolMaps["detector"] = myToolsDetectorMenu;
myMenuPaneToolMaps["district"] = myToolsDistrictMenu;
myMenuPaneToolMaps["drt"] = myToolsDRTMenu;
Expand All @@ -1470,6 +1475,7 @@ GNEApplicationWindow::fillMenuBar() {
myMenuPaneToolMaps["output"] = myToolsOutputMenu;
myMenuPaneToolMaps["shapes"] = myToolsShapes;
myMenuPaneToolMaps["tls"] = myToolsTLS;
myMenuPaneToolMaps["trigger"] = myToolsTriggerMenu;
myMenuPaneToolMaps["turn-defs"] = myToolsTurnDefs;
myMenuPaneToolMaps["visualization"] = myToolsVisualizationMenu;
myMenuPaneToolMaps["xml"] = myToolsXML;
Expand Down
74 changes: 38 additions & 36 deletions src/netedit/GNEApplicationWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -631,42 +631,44 @@ class GNEApplicationWindow : public GUIMainWindow, public MFXInterThreadEventCli
bool myAmLoading = false;

/// @brief the submenus
FXMenuPane* myFileMenu = nullptr,
*myFileMenuNeteditConfig = nullptr,
*myFileMenuSumoConfig = nullptr,
*myFileMenuTLS = nullptr,
*myFileMenuEdgeTypes = nullptr,
*myFileMenuAdditionals = nullptr,
*myFileMenuDemandElements = nullptr,
*myFileMenuDataElements = nullptr,
*myFileMenuMeanDataElements = nullptr,
*myFileMenuRecentNetworks = nullptr,
*myFileMenuRecentConfigs = nullptr,
*myModesMenu = nullptr,
*myEditMenu = nullptr,
*myLockMenu = nullptr,
*myProcessingMenu = nullptr,
*myLocatorMenu = nullptr,
*myToolsMenu = nullptr,
*myToolsDetectorMenu = nullptr,
*myToolsDistrictMenu = nullptr,
*myToolsDRTMenu = nullptr,
*myToolsEmissionsMenu = nullptr,
*myToolsImportMenu = nullptr,
*myToolsImportCityBrainMenu = nullptr,
*myToolsImportGTFSMenu = nullptr,
*myToolsImportVissim = nullptr,
*myToolsImportVisum = nullptr,
*myToolsNetMenu = nullptr,
*myToolsRouteMenu = nullptr,
*myToolsOutputMenu = nullptr,
*myToolsShapes = nullptr,
*myToolsTLS = nullptr,
*myToolsTurnDefs = nullptr,
*myToolsVisualizationMenu = nullptr,
*myToolsXML = nullptr,
*myWindowMenu = nullptr,
*myHelpMenu = nullptr;
FXMenuPane* myFileMenu = nullptr;
FXMenuPane* myFileMenuNeteditConfig = nullptr;
FXMenuPane* myFileMenuSumoConfig = nullptr;
FXMenuPane* myFileMenuTLS = nullptr;
FXMenuPane* myFileMenuEdgeTypes = nullptr;
FXMenuPane* myFileMenuAdditionals = nullptr;
FXMenuPane* myFileMenuDemandElements = nullptr;
FXMenuPane* myFileMenuDataElements = nullptr;
FXMenuPane* myFileMenuMeanDataElements = nullptr;
FXMenuPane* myFileMenuRecentNetworks = nullptr;
FXMenuPane* myFileMenuRecentConfigs = nullptr;
FXMenuPane* myModesMenu = nullptr;
FXMenuPane* myEditMenu = nullptr;
FXMenuPane* myLockMenu = nullptr;
FXMenuPane* myProcessingMenu = nullptr;
FXMenuPane* myLocatorMenu = nullptr;
FXMenuPane* myToolsMenu = nullptr;
FXMenuPane* myToolsAssignMenu = nullptr;
FXMenuPane* myToolsDetectorMenu = nullptr;
FXMenuPane* myToolsDistrictMenu = nullptr;
FXMenuPane* myToolsDRTMenu = nullptr;
FXMenuPane* myToolsEmissionsMenu = nullptr;
FXMenuPane* myToolsImportMenu = nullptr;
FXMenuPane* myToolsImportCityBrainMenu = nullptr;
FXMenuPane* myToolsImportGTFSMenu = nullptr;
FXMenuPane* myToolsImportVissim = nullptr;
FXMenuPane* myToolsImportVisum = nullptr;
FXMenuPane* myToolsNetMenu = nullptr;
FXMenuPane* myToolsRouteMenu = nullptr;
FXMenuPane* myToolsOutputMenu = nullptr;
FXMenuPane* myToolsShapes = nullptr;
FXMenuPane* myToolsTLS = nullptr;
FXMenuPane* myToolsTriggerMenu = nullptr;
FXMenuPane* myToolsTurnDefs = nullptr;
FXMenuPane* myToolsVisualizationMenu = nullptr;
FXMenuPane* myToolsXML = nullptr;
FXMenuPane* myWindowMenu = nullptr;
FXMenuPane* myHelpMenu = nullptr;

/// @brief map with menu pane tools and strings
std::map<std::string, FXMenuPane*> myMenuPaneToolMaps;
Expand Down
125 changes: 75 additions & 50 deletions tools/build_config/templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,29 +36,17 @@
TOOLS = [

# detector
# "detector/aggregateFlows.py", NO CONFIG
# "detector/detector.py", NO CONFIG
"detector/edgeDataFromFlow.py",
# "detector/filterFlows.py", NO CONFIG
"detector/flowFromEdgeData.py",
# "detector/flowFromRoutes.py", NO CONFIG
# "detector/flowrouter.py", NO CONFIG
"detector/mapDetectors.py",
# "detector/plotFlows.py", NO CONFIG
# "detector/routeUsage.py", NO CONFIG
# "detector/validate.py", NO CONFIG

# district
# "district/aggregateAndSplitMatrices.py", NO CONFIG
# "district/countConnectionsInDistricts.py", NO CONFIG
# "district/districtMapper.py", NO CONFIG
"district/filterDistricts.py",
"district/gridDistricts.py",
"district/stationDistricts.py",

# drt
# "drt/darpSolvers.py", NO CONFIG
# "drt/drtOnline.py", NO CONFIG
"drt/drtOrtools.py",
# "drt/ortools_pdp.py", NO CONFIG

Expand All @@ -74,19 +62,8 @@
"import/gtfs/gtfs2fcd.py",
# "import/gtfs/gtfs2osm.py", NO CONFIG
"import/gtfs/gtfs2pt.py",
# "import/vissim/convert_detectors2SUMO.py", NO CONFIG
# "import/vissim/convert_vissimXML_flows_statRoutes.py", NO CONFIG
# "import/vissim/tls_vissimXML2SUMOnet_update.py", NO CONFIG
# "import/vissim/vissim_parseBusStops.py", NO CONFIG
"import/vissim/vissim_parseRoutes.py",
# "import/vissim/vissim2poly.py", NO CONFIG
"import/visum/visum_convertEdgeTypes.py",
# "import/visum/visum_convertRoutes.py", NO CONFIG
# "import/visum/visum_convertTurnPercentages.py", NO CONFIG
# "import/visum/visum_parseZaehlstelle.py", NO CONFIG
# "import/matsim_importPlans.py", NO CONFIG
# "import/signal_POIs_from_xodr.py", NO CONFIG
# "import/osmTaxiStop.py", NO CONFIG

# net
"net/abstractRail.py",
Expand All @@ -111,19 +88,11 @@
# "net/xmlnodes_applyOffset.py", NO CONFIG

# route
# "route/addParkingAreaStops2Routes.py", NO CONFIG
# "route/addParkingAreaStops2Trips.py", NO CONFIG
"route/addStopDelay.py",
"route/addStops2Routes.py",
"route/addTAZ.py",
# "route/analyzePersonPlans.py", NO CONFIG
"route/checkStopOrder.py",
# "route/cutRoutes.py", NO CONFIG
# "route/cutTrips.py",
"route/implausibleRoutes.py",
# "route/route_1htoDay.py", NO CONFIG
# "route/route_departOffset.py", NO CONFIG
# "route/route2alts.py", NO CONFIG
"route/route2OD.py",
# "route/route2poly.py", NO CONFIG
# "route/route2sel.py", NO CONFIG
Expand Down Expand Up @@ -154,7 +123,6 @@
"output/fcdDiff.py",
# "output/generateITetrisIntersectionMetrics.py", NO CONFIG
# "output/generateITetrisNetworkMetrics.py", NO CONFIG
# "output/generateMeanDataDefinitions.py", NO CONFIG
# "output/generateTLSE1Detectors.py", NO CONFIG
"output/generateTLSE2Detectors.py",
# "output/generateTLSE3Detectors.py", NO CONFIG
Expand All @@ -166,12 +134,9 @@
"output/stopOrder.py",
# "output/tables.py", NO CONFIG
# "output/timingStats.py", NO CONFIG
# "output/tripinfoByTAZ.py", NO CONFIG
"output/tripinfoByType.py",
# "output/tripinfoDiff.py", NO CONFIG
# "output/tripStatistics.py", NO CONFIG
"output/vehLanes.py",
# "output/vehroute2amitranOD.py", NO CONFIG
"output/vehrouteCountValidation.py",
"output/vehrouteDiff.py",
"output/walkFactor.py",
Expand All @@ -187,7 +152,6 @@
# "tls/buildTransitions.py", NO CONFIG
"tls/createTlsCsv.py",
# "tls/tls_check.py", NO CONFIG
# "tls/tls_csv2SUMO.py", NO CONFIG
"tls/tls_csvSignalGroups.py",

# turn-defs
Expand All @@ -200,7 +164,6 @@
"turn-defs/turnFile2EdgeRelations.py",

# visualization
# "visualization/macrOutput.py", NO CONFIG
# "visualization/mpl_dump_onNet.py", NO CONFIG
# "visualization/mpl_dump_timeline.py", NO CONFIG
# "visualization/mpl_dump_twoAgainst.py", NO CONFIG
Expand All @@ -222,30 +185,22 @@
"xml/xml2csv.py",
"xml/changeAttribute.py",
"xml/filterElements.py",
# "xml/protobuf2xml.py", NO CONFIG
# "xml/xml2protobuf.py", NO CONFIG
# "xml/xsd.py", NO CONFIG

# other
# "averageTripStatistics.py", NO CONFIG
"countEdgeUsage.py",
"createVehTypeDistribution.py",
"edgesInDistricts.py",
# "evacuateAreas.py", NOT_SUITABLE
"extractTest.py",
#"extractTest.py", NOT_SUITABLE
"fcdReplay.py",
"findAllRoutes.py",
"generateBidiDistricts.py",
"generateContinuousRerouters.py",
"generateParkingAreaRerouters.py",
"generateParkingAreas.py",
# "generateParkingLots.py", NO CONFIG
"generateRailSignalConstraints.py",
"generateRerouters.py",
# "jtcrouter.py", NO CONFIG
# "osmBuild.py", NOT_SUITABLE
"osmGet.py",
# "osmWebWizard.py", NOT_WORKING_YET
"plot_trajectories.py",
"ptlines2flows.py",
"randomTrips.py",
Expand All @@ -255,12 +210,80 @@
"tileGet.py",
"tlsCoordinator.py",
"tlsCycleAdaptation.py",
# "traceExporter.py", NO CONFIG


"jtcrouter.py",
"distributeChargingStations.py",
"traceExporter.py",
"createScreenshotSequence.py",
"averageTripStatistics.py",
"generateLandmarks.py",
# "osmWebWizard.py", NOT_WORKING
"assign/duaIterateMix.py",
"assign/duaIterate_analysis.py",
"assign/duaIterate_reroutingAnalysis.py",
"assign/one-shot.py",
"assign/cadytsIterate.py",
"assign/costFunctionChecker.py",
"assign/duaIterate.py",
"detector/aggregateFlows.py",
"detector/filterFlows.py",
"detector/flowFromRoutes.py",
"detector/flowrouter.py",
"detector/routeUsage.py",
"detector/validate.py",
"detector/plotFlows.py",
"drt/drtOnline.py",
"import/matsim/matsim_importPlans.py",
"import/osm/osmTaxiStop.py",
"import/vissim/convert_detectors2SUMO.py",
"import/vissim/convert_vissimXML_flows_statRoutes.py",
"import/vissim/tls_vissimXML2SUMOnet_update.py",
"import/vissim/vissim2poly.py",
"import/vissim/vissim_parseBusStops.py",
"import/visum/visum_convertRoutes.py",
"import/visum/visum_convertTurnPercentages.py",
"import/visum/visum_parseZaehlstelle.py",
"import/opendrive/signal_POIs_from_xodr.py",
"output/generateMeanDataDefinitions.py",
"output/edgeDepartDelay.py",
"output/vehroute2amitranOD.py",
"output/tripinfoByTAZ.py",
"output/tripinfoDiff.py",
"route/route_departOffset.py",
"route/cutTrips.py",
"route/driveways2poly.py",
"route/addParkingAreaStops2Trips.py",
"route/analyzePersonPlans.py",
"route/addParkingAreaStops2Routes.py",
"route/cutRoutes.py",
"route/route2alts.py",
"route/route_1htoDay.py",
"route/geoTrip2POI.py",
"visualization/macrOutput.py",
"visualization/plotWKT.py",
"xml/protobuf2xml.py",
"xml/xml2protobuf.py",
"district/aggregateAndSplitMatrices.py",
"district/countConnectionsInDistricts.py",
"district/districtMapper.py",
"emissions/hbefa2sumo.py",
"net/buildFullGraph.py",
"net/generateStationEdges.py",
"net/patchVClasses.py",
"shapes/poly2edgedata.py",
"tls/buildTransitions.py",
"tls/tls_csv2SUMO.py",
"trigger/csv2vss.py",
"trigger/meandata2vss.py",
]


PATH_MAPPING = {
"import/dxf": "import"
"import/dxf": "import",
"import/osm": "import",
"import/matsim": "import",
"import/opendrive": "import",
}


Expand Down Expand Up @@ -351,7 +374,7 @@ def generateTemplate(app, appBin):
return u'const std::string %sTemplate = "%s";\n' % (app, template)


def generateToolTemplates(toolDir, toolPaths, verbose):
def generateToolTemplates(toolDir, toolPaths, verbose, testFailure=False):
"""
@brief generate tool template
"""
Expand All @@ -372,13 +395,15 @@ def generateToolTemplates(toolDir, toolPaths, verbose):
result += 'TemplateTool("%s", "tools/%s", "%s",\n' % (toolName, toolPath, PATH_MAPPING.get(d, d))
stdout, stderr = p.communicate()
if p.returncode:
failed.append(toolName)
failed.append(toolPath if testFailure else toolName)
if verbose:
print("Cannot generate tool template for %s: '%s'." % (toolName, stderr), file=sys.stderr)
result += '""'
else:
result += formatToolTemplate(stdout)
result += '),\n'
if testFailure:
return failed
if failed:
print("Could not generate tool templates for %s." % (", ".join(failed)), file=sys.stderr)
return result
Expand Down
Loading

0 comments on commit 90ecf74

Please sign in to comment.