import os
import sys

from lib.openscenario.class_defs.enumerations import *
from lib.openscenario.open_scenario_importer import OpenScenarioImporter
from lib.mgeo.class_defs.mgeo import MGeo

class OpenScenarioImporterWrapper():
    """ OpenScenario 파일 Import 클래스 """
    def __init__(self):
        self.scenario_importer = OpenScenarioImporter()
        self.scenario_data = None
        self.mgeo_folder_path = None

    def import_open_scenario(self, scenario_file_path):        
        self.scenario_importer.import_open_scenario(scenario_file_path)
        
        self.mgeo_folder_path = self.scenario_importer.get_mgeo_folder_path()
        self.mgeo_planner_map = MGeo.create_instance_from_json(self.mgeo_folder_path)

        self.scenario_importer.set_mgeo(self.mgeo_planner_map)
        self.scenario_importer.update_scenario_data()

    def clear(self):
        self.scenario_importer.clear()

