MCPcopy Create free account
hub / github.com/comaps/comaps / OnPowerFacilityChanged

Method OnPowerFacilityChanged

libs/map/framework.cpp:3337–3359  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3335}
3336
3337void Framework::OnPowerFacilityChanged(power_management::Facility const facility, bool enabled)
3338{
3339 if (facility == power_management::Facility::PerspectiveView || facility == power_management::Facility::Buildings3d)
3340 {
3341 bool allow3d = true, allow3dBuildings = true;
3342 Load3dMode(allow3d, allow3dBuildings);
3343
3344 if (facility == power_management::Facility::PerspectiveView)
3345 allow3d = allow3d && enabled;
3346 else
3347 allow3dBuildings = allow3dBuildings && enabled;
3348
3349 Allow3dMode(allow3d, allow3dBuildings);
3350 }
3351 else if (facility == power_management::Facility::TrafficJams)
3352 {
3353 auto trafficState = enabled && LoadTrafficEnabled();
3354 if (trafficState == GetTrafficManager().IsEnabled())
3355 return;
3356
3357 GetTrafficManager().SetEnabled(trafficState);
3358 }
3359}
3360
3361void Framework::OnPowerSchemeChanged(power_management::Scheme const actualScheme)
3362{

Callers

nothing calls this directly

Calls 2

IsEnabledMethod · 0.45
SetEnabledMethod · 0.45

Tested by

no test coverage detected