Ejemplo n.º 1
0
        public MainUserControlViewModel(Core.Configuration config, IDataSourcesManager dsMgr)
        {
            _rtspPort       = config.RtspPort;
            _httpPort       = config.HttpPort;
            _scaleFactor    = config.ScaleFactor;
            _minNeighbors   = config.MinimumNeighbors;
            _serenityIp     = config.SerenityAddress;
            _serenityUser   = config.SerenityUser;
            _serenityPass   = config.SerenityPassword;
            _serializer     = new ConfigurationFileSerializer();
            _datasourcesMgr = dsMgr;

            SelectedDataSources      = new ObservableCollection <DataSource>();
            AvailableDataSources     = new ObservableCollection <DataSource>();
            SaveCommand              = new DelegateCommand(Save);
            AddDataSourcesCommand    = new DelegateCommand <IList>(selected => AddDataSources(selected));
            RemoveDataSourcesCommand = new DelegateCommand <IList>(selected => RemoveDataSources(selected));

            InitDatasources(config.SelectedDatasources);
        }
Ejemplo n.º 2
0
        public override bool Run()
        {
            LOG.Info("Starting facial detection agent");

            try
            {
                _rtspServer         = _bootstrapper.Container.Resolve <RtspServer>();
                _httpServer         = _bootstrapper.Container.Resolve <HttpServer>();
                _dataSourcesManager = _bootstrapper.Container.Resolve <IDataSourcesManager>();
                _sourcesManager     = _bootstrapper.Container.Resolve <IDetectionSourceManager>();

                _rtspServer.Start();
                _httpServer.Start();

                InitializeSources();
            }
            catch (Exception e)
            {
                LOG.Error($"Caught exception starting facial detection agent, msg={e.Message}");
                return(false);
            }

            return(true);
        }