def get_road_segment_with_road_condition_id(
        road_condition_id: int) -> RoadSegment:
    if has_road_segment_with_road_condition_id(road_condition_id):
        return RoadSegmentToRoadCondition.objects.get(
            road_condition=road_condition_id).road_segment
    raise ObjectNotFoundException("RoadSegment", "road_condition_id",
                                  road_condition_id)
def get_instrument_action_with_id(
        instrument_action_id: int) -> InstrumentAction:
    if has_instrument_action_with_id(instrument_action_id):
        return InstrumentAction.objects.get(id=instrument_action_id)

    raise ObjectNotFoundException("InstrumentAction", "id",
                                  instrument_action_id)
def get_road_condition_action_goal_by_id(
        road_condition_action_goal_id: int) -> RoadConditionActionGoal:
    if has_road_condition_action_goal_with_id(road_condition_action_goal_id):
        return RoadConditionActionGoal.objects.get(
            id=road_condition_action_goal_id)
    raise ObjectNotFoundException('RoadConditionActionGoal', 'id',
                                  road_condition_action_goal_id)
Exemplo n.º 4
0
def get_constraint_type(type_id: int) -> RoadConditionActionConstraintType:
    if has_constraint_type(type_id):
        return RoadConditionActionConstraintType.objects.get(id=type_id)
    raise ObjectNotFoundException('RoadConditionActionConstraintType', 'id',
                                  type_id)
Exemplo n.º 5
0
def get_instrument_type(instrument_type_id: int) -> InstrumentType:
    if has_instrument_type_with_id(instrument_type_id):
        return InstrumentType.objects.get(id=instrument_type_id)

    raise ObjectNotFoundException('InstrumentType', 'id', instrument_type_id)
Exemplo n.º 6
0
def get_instrument_system_with_id(system_id: int) -> InstrumentSystem:
    if has_instrument_system_with_id(system_id):
        return InstrumentSystem.objects.get(id=system_id)

    raise ObjectNotFoundException('InstrumentSystem', 'id', system_id)
Exemplo n.º 7
0
def get_instrument_type_with_name(instrument_name: str) -> InstrumentType:
    if has_instrument_type_with_name(instrument_name):
        return InstrumentType.objects.get(name=instrument_name)

    raise ObjectNotFoundException('InstrumentType', 'name', instrument_name)
def get_response_plan_with_id(response_plan_id: int) -> ResponsePlan:
    if has_response_plan_with_id(response_plan_id):
        return ResponsePlan.objects.get(id=response_plan_id)

    raise ObjectNotFoundException("Response Plan", "id", response_plan_id)
Exemplo n.º 9
0
def get_simulation_with_id(simulation_id: int) -> Simulation:
    if has_simulation_with_id(simulation_id):
        return Simulation.objects.get(id=simulation_id)
    raise ObjectNotFoundException('Simulation', 'id', simulation_id)
Exemplo n.º 10
0
def get_simulation_scene_event_with_id(
        simulation_scene_event_id: int) -> SimulationSceneEvent:
    if has_simulation_scene_event_with_id(simulation_scene_event_id):
        return SimulationSceneEvent.objects.get(id=simulation_scene_event_id)
    raise ObjectNotFoundException('SimulationSceneEvent', 'id',
                                  simulation_scene_event_id)
def get_folder_with_id(folder_id: int) -> Folder:
    if has_folder_with_id(folder_id):
        return Folder.objects.get(id=folder_id)

    raise ObjectNotFoundException("Folder", "id", folder_id)
def get_road_condition_with_id(road_condition_id: int) -> RoadCondition:
    if has_road_condition_with_id(road_condition_id):
        return RoadCondition.objects.get(id=road_condition_id)
    raise ObjectNotFoundException('RoadCondition', 'id', road_condition_id)
def get_road_condition_type_with_name(name: str) -> RoadCondition:
    if has_road_condition_type_with_name(name):
        return RoadConditionType.objects.get(name=name)
    raise ObjectNotFoundException('RoadConditionType', 'name', name)
def get_road_segment_with_id(road_segment_id: int) -> RoadSegment:
    if has_road_segment_with_id(road_segment_id):
        return RoadSegment.objects.get(id=road_segment_id)
    raise ObjectNotFoundException("RoadSegment", "id", road_segment_id)
Exemplo n.º 15
0
def get_scenario_with_id(scenario_id: int) -> Scenario:
    if has_scenario_with_id(scenario_id):
        return Scenario.objects.get(id=scenario_id)
    raise ObjectNotFoundException('Scenario', 'id', scenario_id)