Radar Object ServiceΒΆ
Service for accessing radar object. Obstacle objects can be loaded and its content modified and sent back to windPRO. A small example can be found below.
import time
import os
from windproapi.utils import get_windpro_sample_path
from windproapi import WindProApi
from windproapi import nan_to_skipvalue
# Opening windPRO
_windproapi = WindProApi()
working_dir = os.path.join(get_windpro_sample_path('3.6'), 'ObjRadarService')
os.makedirs(working_dir, exist_ok=True)
_windproapi.start_windpro_random_port()
# Project service for making a new project
project_service = _windproapi.get_service('ProjectService')
objects_service = _windproapi.get_service('ObjectsService')
obj_radar_service = _windproapi.get_service('ObjRadarService')
# Project path and location
project_path = os.path.join(working_dir, 'ObjRadarService.w36p')
lng = 10.
lat = 55.
# Making a new empty project and saving it
project_service.NewProject(lng=lng, lat=lat, filename=project_path)
# Making new radar object and getting its parameters
obj = objects_service.AddObject(apiObjType='RadarObject',
lat=54.93,
lng=9.95,
userDesc='new radar object')
radar_object = obj_radar_service.GetRadarObject(obj.Handle)
# Setting some parameter
radar_object.RadarHeight = 25
radar_object.Angle = 90
nan_to_skipvalue(radar_object)
obj_radar_service.SetRadarObject(radar_object)