Esempio n. 1
0
        public async Task <ITripDetector> Create()
        {
            var configuration = await this.configurationRepository.GetTripDetectionConfigurationAsync(nameof(TripDetectorFactory));

            if (configuration == null)
            {
                configuration = await this.configurationRepository.AddAsync(
                    new Configuration(
                        ConfigurationExtensions.GetAssemblyNamespace(),
                        nameof(TripDetectorFactory),
                        "Determines which Trip detector will be used for trip detection",
                        TripDetectorType.SimpleHeuristic));
            }

            var type = configuration.GetValue <TripDetectorType>();

            return(await Create(type));
        }
        public IEnumerable <IModuleLoader> GetModuleLoaders()
        {
            var manager = new ModuleConfigurationManager(
                configurationRepository,
                ConfigurationExtensions.GetAssemblyNamespace(),
                nameof(TimeBasedTripDetector));

            return(new List <IModuleLoader>
            {
                manager.LoadModuleAsync <PointLoaderModule>(this.trackingPointRepository),
                manager.LoadModuleAsync <NoiseRemovalModule>(),
                manager.LoadModuleAsync <ClusteredStopDetectorModule>(),
                manager.LoadModuleAsync <EdgeStopDetectorModule>(),
                manager.LoadModuleAsync <BlackoutStopDetectorModule>(),
                manager.LoadModuleAsync <StopToLocationMapperModule>(this.locationRepository),
                manager.LoadModuleAsync <LegCandidateExtractorModule>(),
                manager.LoadModuleAsync <TimeBasedTripExtractorModule>(),
                manager.LoadModuleAsync <PersistenceModule>(this.trackingPointRepository, this.tripRepository, this.locationRepository, this.bingMapsKey)
            });
        }