示例#1
0
        public MapViewModel()
        {
            model          = new CamerasModel();
            LandmarkLayers = new ObservableCollection <MapLayer>();

            this.AddCamerasLayer();
        }
        public void Initialize(CamerasModel cameras, List <ITrackerService> trackerServices)
        {
            _cameras        = cameras;
            TrackerServices = trackerServices;

            foreach (CameraModel cameraModel in _cameras.Cameras)
            {
                //TrackerServices[_cameras.Cameras.IndexOf(cameraModel)].OnImageReady += TrackerService_OnImageReady;
            }
            _positionHistory = new Vector3[5];
        }
 /// <summary>
 /// Initializes a new instance of the CameraPositioningCalibrationViewModel class.
 /// </summary>
 public CameraPositioningCalibrationViewModel(CamerasModel camerasModel)
 {
     if (IsInDesignMode)
     {
         CamerasModel    = camerasModel;
         SettingsService = new JsonSettingsService();
     }
     else
     {
         CamerasModel       = camerasModel;
         PositioningService = new CameraPositioningCalibrationService(camerasModel.Cameras);
         SettingsService    = SimpleIoc.Default.GetInstance <ISettingsService>();
     }
 }
示例#4
0
        public async Task AddCamera(NewCameraViewModel newCamera)
        {
            double latitude, longitude;

            if (newCamera == null)
            {
                throw new ArgumentNullException(nameof(newCamera));
            }

            var camera = new Camera()
            {
                City        = newCamera.CameraCity,
                Country     = newCamera.CameraCountry,
                RtspAddress = newCamera.RtspAddress
            };

            if (!string.IsNullOrWhiteSpace(newCamera.Latitude) && double.TryParse(newCamera.Latitude, out latitude))
            {
                camera.Latitude = latitude;
            }
            else
            {
                await CamerasModel.GetLatitude(camera);
            }

            if (!string.IsNullOrWhiteSpace(newCamera.Longitude) && double.TryParse(newCamera.Longitude, out longitude))
            {
                camera.Longitude = longitude;
            }
            else
            {
                await CamerasModel.GetLongitude(camera);
            }

            model.AddCamera(camera);
            cameras.Add(new CameraViewModel(camera));
        }
示例#5
0
 public CamerasViewModel()
 {
     model        = new CamerasModel();
     this.cameras = new ObservableCollection <CameraViewModel>();
 }
示例#6
0
 public void Initialize(IConsoleService consoleService, ServerModel server, CamerasModel cameras)
 {
     base.Initialize(consoleService, server);
     _cameras = cameras;
 }
示例#7
0
 public ServerService(IConsoleService consoleService, ServerModel server, CamerasModel cameras)
 {
     Initialize(consoleService, server, cameras);
 }
 public MultipleViewsService(CamerasModel cameras, List <ITrackerService> trackerServices)
 {
     Initialize(cameras, trackerServices);
 }
示例#9
0
 public NewCameraViewModel()
 {
     model = new CamerasModel();
 }
示例#10
0
 public UnknownCameraViewModel()
 {
     model = new CamerasModel();
 }