Esempio n. 1
0
 def __init__(self,
              open_space_config_dir=OPEN_SPACE_CONFIG_DIR,
              building_config_dir=BUILDING_CONFIG_DIR):
     self.graph = None
     self.current_osm_id = 0
     self.osp_config_c = OpenSpaceConfigController(open_space_config_dir)
     building_cc = BuildingConfigController(config_dir=building_config_dir)
     self.indoor_map_c = GraphBuildingController(self,
                                                 building_cc=building_cc)
Esempio n. 2
0
 def get(self, request, file_name):
     open_space_cc = OpenSpaceConfigController()
     open_space = open_space_cc.get_open_space(file_name)
     if open_space:
         building_c = BuildingConfigController()
         open_space.set_buildings(building_c.buildings)
         return Response(open_space.get_minimal_dict(),
                         status=status.HTTP_200_OK,
                         headers={'access-control-allow-origin': '*'})
     return Response(status=status.HTTP_400_BAD_REQUEST,
                     headers={'access-control-allow-origin': '*'})
Esempio n. 3
0
 def test_building_config_no_props(self):
     config_controller = BuildingConfigController(
         config_dir=f'{TEST_DIR}/config_controller/without_props')
     building = config_controller.get_buildings()[0]
     self.assertEqual(building, expected_building_no_props)
Esempio n. 4
0
 def test_empty_config_file(self):
     config_controller = BuildingConfigController(
         config_dir=f'{TEST_DIR}/config_controller/empty')
     self.assertEqual(len(config_controller.get_buildings()), 0)
Esempio n. 5
0
 def test_building_config_with_blocked_entries(self):
     config_controller = BuildingConfigController(
         config_dir=f'{TEST_DIR}/config_controller/blocked_entry')
     building = config_controller.get_buildings()[0]
     self.assertEqual(building, expected_building_blocked_entries)
Esempio n. 6
0
 def test_building_config_with_wheelchair(self):
     config_controller = BuildingConfigController(
         config_dir=f'{TEST_DIR}/config_controller/wheelchair')
     building = config_controller.get_buildings()[0]
     self.assertEqual(building, expected_building_wheelchair)
Esempio n. 7
0
 def __init__(self):
     self.indoor_cc = BuildingConfigController()
Esempio n. 8
0
 def __init__(self, osmm, building_cc=BuildingConfigController()):
     self.building_cc = building_cc
     self.graph_buildings = None
     self.osmm = osmm