Beispiel #1
0
 public GViewController(
     IApiWorkContext workContext,
     IStationService stationService,
     IRoomService roomService,
     IFsuService fsuService,
     IDeviceService deviceService,
     IPointService pointService,
     ISignalService signalService,
     IAMeasureService ameasureService,
     IGImageService gimageService,
     IGPageService gpageService,
     IGTemplateService gtemplateService,
     IGroupService groupService,
     IPackMgr packMgr)
 {
     this._workContext      = workContext;
     this._stationService   = stationService;
     this._roomService      = roomService;
     this._fsuService       = fsuService;
     this._deviceService    = deviceService;
     this._pointService     = pointService;
     this._signalService    = signalService;
     this._ameasureService  = ameasureService;
     this._gimageService    = gimageService;
     this._gpageService     = gpageService;
     this._gtemplateService = gtemplateService;
     this._groupService     = groupService;
     this._packMgr          = packMgr;
 }
Beispiel #2
0
 public StationController(IStationService stationService, IStationGroupService stationGroupService, ICompanyUserService companyUserService, IStationUserService stationUserService)
 {
     this.stationService      = stationService;
     this.stationGroupService = stationGroupService;
     this.companyUserService  = companyUserService;
     this.stationUserService  = stationUserService;
 }
Beispiel #3
0
        public PlannerViewModel(ILastStationService lastStationService, IStationService stationService, ISettingService settingService)
        {
            LastStationService = lastStationService;
            StationService     = stationService;
            SettingService     = settingService;

            Type = "vertrek";



            Messenger.Default.Register <Station>(this, "SetGpsStation", SetGpsStation);


            SearchCommand        = new RelayCommand(() => DoSearch());
            NoHslMessageCommand  = new RelayCommand(() => NoHslMessageAction());
            YesHslMessageCommand = new RelayCommand(() => YesHslMessageAction());
            UpgradeCommand       = new RelayCommand(() => UpgradeAction());

            LoadAllStations();

            ShowHslMessage = settingService.GetShowHslMessage();

            this.FromStationProvider = new WebServiceTextSearchProvider();
            this.FromStationProvider.InputChanged += stationProvider_InputChanged;

            this.ToStationProvider = new WebServiceTextSearchProvider();
            this.ToStationProvider.InputChanged += stationProvider_InputChanged;

            this.ViaStationProvider = new WebServiceTextSearchProvider();
            this.ViaStationProvider.InputChanged += stationProvider_InputChanged;

            this.SearchStationProvider = new WebServiceTextSearchProvider();
            this.SearchStationProvider.InputChanged += stationProvider_InputChanged;
        }
Beispiel #4
0
 public IndexModel(IStationService stationService, IWeatherService weatherService, ILogger <IndexModel> logger)
 {
     _stationService       = stationService;
     _weatherService       = weatherService;
     _logger               = logger;
     WeatherServiceEnabled = _weatherService.FeatureEnabled;
 }
    // Constructor
    public StationActor(IStationService stationService)
    {
        _stationService = stationService;

        Console.WriteLine($"Creating a station actor");
        Unconfigured();
    }
        public HomeViewModel(IStationService stationService = null)
        {
            UrlPathSegment = "RadioApp";
            _stationSource = new SourceList <StationModel>();

            _stationService = stationService ?? Locator.Current.GetService <IStationService>();
            _mediaManager   = new ReactiveMediaManager();

            PlayCommand = ReactiveCommand.CreateFromTask <string>(async playlistUrl =>
            {
                var streamUrl = await _stationService.GetStreamUrl(playlistUrl);
                await _mediaManager.Play(streamUrl);
            });

            _stationSource
            .Connect()
            .Filter(this.WhenValueChanged(x => x.SearchTerm)
                    .Throttle(TimeSpan.FromMilliseconds(500))
                    .Select(StationNamePredicate))
            .Sort(SortExpressionComparer <StationModel> .Ascending(t => t.Name))
            .ObserveOn(RxApp.MainThreadScheduler)     // Make sure this is only right before the Bind()
            .Bind(out BindingData)
            .Subscribe();

            this.WhenAnyObservable(x => x._mediaManager.PlaybackState)
            .Select(x => x == MediaPlayerStatus.Buffering)
            .ToProperty(this, x => x.IsBusy, out _isBusy);

            this.WhenAnyObservable(x => x._mediaManager.PlaybackState)
            .ToProperty(this, x => x.PlaybackStatus, out _playbackStatus);

            InitializeDataAsync();
        }
 public WorkProcessDetailsController(IStationService stationService, IWorkProcessService workProcessService, IWorkProcessDetailService workProcessDetailService, IUnitOfWorkAsync unitOfWork)
 {
     _workProcessDetailService = workProcessDetailService;
     _unitOfWork         = unitOfWork;
     _workProcessService = workProcessService;
     _stationService     = stationService;
 }
Beispiel #8
0
        public EditStationViewModel(
            INavigationService navigationService,
            IStationService stationService,
            ILocationPicker locationPicker,
            IDialogService dialogService,
            string communityId,
            string?stationId = null)
        {
            _navigationService = navigationService;
            _stationService    = stationService;
            _locationPicker    = locationPicker;
            _dialogService     = dialogService;
            CommunityId        = communityId;
            StationId          = stationId;

            PickLocationCommand = CreateCommand(PickLocation);
            ConfirmCommand      = CreateCommand(Confirm);
            CancelCommand       = CreateCommand(Cancel);
            DeleteCommand       = CreateCommand(Delete);

            PropertyChanged += (_, args) =>
            {
                if (args.PropertyName == nameof(Station))
                {
                    OnPropertyChanged(nameof(Name));
                    OnPropertyChanged(nameof(Description));
                    OnPropertyChanged(nameof(Location));
                }
            };
        }
 public WorkProcessDetailsController(IStationService stationService,IWorkProcessService workProcessService,IWorkProcessDetailService workProcessDetailService, IUnitOfWorkAsync unitOfWork)
 {
     _workProcessDetailService = workProcessDetailService;
     _unitOfWork = unitOfWork;
     _workProcessService = workProcessService;
     _stationService = stationService;
 }
 public HomeController(IStationService IStationService, IPathSearchService IPathSearchService, IRouteService IRouteService, IConnectionService IConnectionService)
 {
     _IStationService    = IStationService;
     _IPathSearchService = IPathSearchService;
     _IRouteService      = IRouteService;
     _IConnectionService = IConnectionService;
 }
        /// <summary>
        /// Initializes a new instance of the MainViewModel class.
        /// </summary>
        public MainViewModel(IStationNameService stationService, IStationService favStationService, IMyTrajectService ts, IPlannerService sh)
        {
            _stationService       = stationService;
            _favStationService    = favStationService;
            _trajectService       = ts;
            _searchHistoryService = sh;

            if (ViewModelBase.IsInDesignModeStatic)
            {
                List <Station> stationDesignList = new List <Station>();
                stationDesignList.Add(new Station()
                {
                    Name = "Amsterdam Centraal"
                });
                stationDesignList.Add(new Station()
                {
                    Name = "Delft"
                });

                //FavStations = stationDesignList;
            }

            //Messenger.Default.Register<string>(this, "FavChanged", FavChangedReceived);

            LoadFavStations();

            //Task.Run(() =>
            // {
            this.Gps.Initialize();
            // });
        }
Beispiel #12
0
        /// <summary>
        /// Initializes a new instance of the viewmodel class.
        /// </summary>
        public DepartureTimesViewModel(IStationNameService stationService, INSApiService vertrektijdenService, IStationService favStationService)
        {
            _stationService       = stationService;
            _vertrektijdenService = vertrektijdenService;
            _favStationService    = favStationService;

            DataLoader = new DataLoader();

            if (ViewModelBase.IsInDesignModeStatic)
            {
                // Code runs in Blend --> create design time data.
                CurrentStation = new Station()
                {
                    Name = "Leeuwarden"
                };

                _tijdList.Add(new Vertrektijd()
                {
                    Tijd                    = DateTime.Now,
                    Eindbestemming          = "Amsterdam",
                    IsVertrekspoorWijziging = false,
                    Ritnummer               = 123,
                    Route                   = "Delft, Den Haag",
                    TreinSoort              = "Sprinter",
                    Vertrekspoor            = "2"
                });

                _tijdList.Add(new Vertrektijd()
                {
                    Tijd                    = DateTime.Now,
                    Eindbestemming          = "Delft",
                    IsVertrekspoorWijziging = false,
                    Ritnummer               = 123,
                    Route                   = "Delft, Den Haag",
                    TreinSoort              = "Intercity",
                    Vertrekspoor            = "2b"
                });


                _tijdList.Add(new Vertrektijd()
                {
                    Tijd                    = DateTime.Now,
                    Eindbestemming          = "Groningen",
                    IsVertrekspoorWijziging = true,
                    Ritnummer               = 123,
                    Route                   = "Amsterdam, Den Haag",
                    TreinSoort              = "Intercity",
                    Vertrekspoor            = "2b",
                    VertragingTekst         = "+5 min"
                });
            }

            FavCommand       = new RelayCommand(DoFavCommand);
            DeleteFavCommand = new RelayCommand(DoDeleteFavCommand);
            UpdateCommand    = new RelayCommand(DoUpdate);

            _refreshTimer.Interval = new TimeSpan(0, 2, 0);
            _refreshTimer.Tick    += _refreshTimer_Tick;
            _refreshTimer.Start();
        }
Beispiel #13
0
 public StationCommandHandler(IOptions <AwsSettings> config, ILogger <StationCommandHandler> logger, IAmazonSQS sqs, IStationService stationService)
 {
     _logger         = logger;
     _config         = config.Value;
     _sqs            = sqs;
     _stationService = stationService;
 }
 public FileUploadController(IStationService stationservice,IProcessStepService setpservice,ISKUService sKUService, IBOMComponentService iBOMComponentService, IUnitOfWorkAsync unitOfWork)
 {
     _iBOMComponentService = iBOMComponentService;
     _sKUService  = sKUService;
     _unitOfWork = unitOfWork;
     _setpservice = setpservice;
     _stationservice = stationservice;
 }
Beispiel #15
0
 public AdminController(IStationService stationservice, IRouteService routeService, ITrainService trainservice, ICarriageService carriageservice, IRouteStationService routeStationService)
 {
     _stationService      = stationservice;
     _trainService        = trainservice;
     _carriageService     = carriageservice;
     _routeService        = routeService;
     _routeStationService = routeStationService;
 }
 /// <summary>
 /// Re-initializes test.
 /// </summary>
 public StationServiceTests()
 {
     _visitorLogContext = Substitute.For <VisitorLogContext>();
     _stationRepository = new StationRepositoryFake(_visitorLogContext);
     _unitOfWork        = Substitute.For <IUnitOfWork>();
     _unitOfWork.StationRepository.Returns(_stationRepository);
     _stationService = new StationService(_unitOfWork);
 }
Beispiel #17
0
 public HomeController(IStationService stationService,
     ITicketService ticketService,
     IOrderService orderService)
 {
     this.stationService = stationService;
     this.ticketService = ticketService;
     this.orderService = orderService;
 }
 public RoutesController(ICompanyRouteService routes, ITownService towns, UserManager <User> userManager, ICompanyService companies, IStationService stations)
     : base(towns)
 {
     this.routes      = routes;
     this.userManager = userManager;
     this.companies   = companies;
     this.stations    = stations;
 }
 public FileUploadController(IStationService stationservice, IProcessStepService setpservice, ISKUService sKUService, IBOMComponentService iBOMComponentService, IUnitOfWorkAsync unitOfWork)
 {
     _iBOMComponentService = iBOMComponentService;
     _sKUService           = sKUService;
     _unitOfWork           = unitOfWork;
     _setpservice          = setpservice;
     _stationservice       = stationservice;
 }
Beispiel #20
0
 public StationsController(
     ILogger <StationsController> logger,
     IStationService stationService
     )
 {
     _logger         = logger;
     _stationService = stationService;
 }
Beispiel #21
0
        public async void Configure(
            IApplicationBuilder app,
            IWebHostEnvironment env,
            ILogger <Startup> logger,
            ICrsService crsService,
            IStationService stationService,
            IUpdateCheckService updateCheckService)
        {
            logger.LogInformation("Configuring Huxley 2 web API application");

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            app.UseHttpsRedirection();
            app.UseStaticFiles();
            app.UseRouting();
            // UseResponseCaching doesn't appear to be necessary to enable the ResponseCache attribute
            // but it is required to use VaryByQueryKeys in the future so enable middleware to be safe
            app.UseResponseCaching();

            // CORS must be called after UseRouting and before UseEndpoints to function correctly
            // The `Access-Control-Allow-Origin` header will not be added to normal GET responses
            // An `Origin` header must be on the request (for a different domain) for CORS to run
            // https://docs.microsoft.com/en-us/aspnet/core/security/cors
            app.UseCors(config => config.AllowAnyOrigin());

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllers();
                endpoints.MapRazorPages();
            });

            logger.LogInformation("Huxley 2 web API application configured");

            try
            {
                logger.LogInformation("Loading CRS station codes from remote source");
                await crsService.LoadCrsCodes();

                await stationService.LoadStations();

                if (_enableUpdateCheck)
                {
                    logger.LogInformation("Checking for any available updates to Huxley");
                    await updateCheckService.CheckForUpdates();
                }
            }
            catch (Exception e) when(
                e is CrsServiceException ||
                e is UpdateCheckServiceException
                )
            {
                logger.LogError(e, "Non-fatal startup failure");
            }

            logger.LogInformation("Huxley 2 web API application ready");
        }
Beispiel #22
0
 public DataController(
     ILogger <DataController> logger,
     IStationService stationService,
     IPublicService publicService)
 {
     _logger         = logger;
     _stationService = stationService;
     _publicService  = publicService;
 }
Beispiel #23
0
 public HomeController(IStationService stationservice, IRouteService routeService, ITrainService trainservice, IRouteDateService routedateservice, ICarriageService carriageservice, IRouteStationService routestationservice)
 {
     _routeDateService    = routedateservice;
     _stationService      = stationservice;
     _trainService        = trainservice;
     _carriageService     = carriageservice;
     _routeService        = routeService;
     _routeStationService = routestationservice;
 }
Beispiel #24
0
        public RoadInputWindow(User user, IRailwayServiceProxyCreationFacade facade, Road predicate, ILogging logger, IPrimaryEntityCommandManagement manager)
        {
            IRoadService       roadService    = facade.GetRoadServiceProxy(user.UserName, user.Password);
            IStationService    stationService = facade.GetStationServiceProxy(user.UserName, user.Password);
            RoadInputViewModel viewModel      = new RoadInputViewModel(roadService, stationService, predicate, logger, this, manager);

            DataContext = viewModel;
            InitializeComponent();
        }
Beispiel #25
0
 public StationViewModel()
 {
     stationService          = new StationService();
     trainService            = new TrainService();
     vanService              = new VanService();
     seatService             = new SeatService();
     passangerService        = new PassangerService();
     classProperetiesService = new ClassProperetiesService();
     ticketService           = new TicketService();
 }
Beispiel #26
0
        public StationInputWindow(User principal, IRailwayServiceProxyCreationFacade facade, Station predicate, ILogging logger)
        {
            IPlaceService         placeService   = facade.GetPlaceServiceProxy(principal.UserName, principal.Password);
            ITrackService         trackService   = facade.GetTrackServiceProxy(principal.UserName, principal.Password);
            IStationService       stationService = facade.GetStationServiceProxy(principal.UserName, principal.Password);
            StationInputViewModel viewModel      = new StationInputViewModel(predicate, stationService, trackService, placeService, logger, this);

            DataContext = viewModel;
            InitializeComponent();
        }
Beispiel #27
0
        public OverviewViewModel(
            IBikeService bikeService,
            ILocationService locationService,
            IStationService stationService,
            INavigationService navigationService,
            IDialogService dialogService)
        {
            _locationService   = locationService;
            _navigationService = navigationService;
            _dialogService     = dialogService;
            _locationService   = locationService;

            ShowBikeOnMapCommand       = CreateCommand <Bike>(ShowBikeOnMap, CanShowBikeOnMap);
            RefreshUserLocationCommand = CreateCommand(RefreshUserLocation);
            ToggleMapCommand           = CreateCommand(ToggleMap);

            ShowMap = Preferences.Get("ShowMap", false);

            PropertyChanged += (_, args) =>
            {
                switch (args.PropertyName)
                {
                case nameof(ShowMap):
                    OnPropertyChanged(nameof(ToggleMapText));
                    Preferences.Set("ShowMap", ShowMap);
                    break;

                case nameof(UserLocation):
                    OnPropertyChanged(nameof(GroupedItems));
                    break;

                case nameof(AllBikes) or nameof(AllStations):
                    OnPropertyChanged(nameof(MapItems));

                    OnPropertyChanged(nameof(GroupedItems));
                    break;
                }
            };

            var bikes = bikeService.GetAvailableBikes();

            bikes.CollectionChanged += (_, _) =>
            {
                AllBikes.ReplaceRange(bikes);
                OnPropertyChanged(nameof(AllBikes));
            };

            var stations = stationService.GetAvailableStations();

            stations.CollectionChanged += (_, _) =>
            {
                AllStations.ReplaceRange(stations);
                OnPropertyChanged(nameof(AllStations));
            };
        }
Beispiel #28
0
 public DataController(
     ILogger <DataController> logger,
     IStationService stationService,
     IStationDataService stationDataService,
     IPublicService publicService,
     IVariableService variableService)
 {
     _logger             = logger;
     _stationService     = stationService;
     _stationDataService = stationDataService;
     _publicService      = publicService;
     _variableService    = variableService;
 }
        public void ConnectExistingFlightsToStations(IEnumerable <FlightHistory> flights)
        {
            WasInitialized = true;
            foreach (FlightHistory fh in flights)
            {
                IStationService stationService = stationServices.FirstOrDefault(ss => ss.Station.Id == fh.StationId);

                if (stationService is null)
                {
                    logger.LogError($"Flight {fh.FlightId} is connected to a non existing station!");
                    throw new KeyNotFoundException("Invlid Flight!");
                }
                ILogger <IFlightService> flLogger      = loggerFactory.CreateLogger <IFlightService>();
                IFlightService           flightService = new FlightService(fh.Flight, flLogger);
                stationService.FlightArrived(flightService);
            }
        }
        public StationScenariosSteps()
        {
            var options = new DbContextOptionsBuilder <Context>()
                          .UseInMemoryDatabase(Guid.NewGuid().ToString())
                          .Options;

            this.stationContext = new Context(options);

            var cacheProvider = new InMemoryCachingProvider();

            var repository        = new StationRepository(this.stationContext);
            var cachingRepository = new StationRepositoryCachingDecorator(repository, cacheProvider);
            var service           = new StationService.StationService(cachingRepository);
            var cachingService    = new StationServiceCachingDecorator(service, cacheProvider);

            this.stationService = cachingService;
        }
Beispiel #31
0
        private void InitializeServices()
        {
            try
            {
                logger.LogNewMessage($"Initializing service providers.", LogType.INFO);

                countryService = new CountryServiceProvider(ServerLogger.GetOrCreate(), GetDatabaseContextFactory());
                placeService   = new PlaceServiceProvider(ServerLogger.GetOrCreate(), GetDatabaseContextFactory());
                roadService    = new RoadServiceProvider(ServerLogger.GetOrCreate(), GetDatabaseContextFactory());
                stationService = new StationServiceProvider(ServerLogger.GetOrCreate(), GetDatabaseContextFactory());
                trackService   = new TrackServiceProvider(ServerLogger.GetOrCreate(), GetDatabaseContextFactory());
                userService    = new UserServiceProvider(ServerLogger.GetOrCreate(), GetDatabaseContextFactory());
            }catch (Exception ex)
            {
                logger.LogNewMessage($"Error occured initializing service providers. ERROR {ex.Message}", LogType.ERROR);
            }
        }
Beispiel #32
0
 public ApiWorkContext(
     ICacheManager cacheManager,
     IAreaService areaService,
     IStationService stationService,
     IStationTypeService stationTypeService,
     IRoomService roomService,
     IRoomTypeService roomTypeService,
     IDeviceService deviceService,
     IDeviceTypeService deviceTypeService,
     IFsuService fsuService,
     IPointService pointService,
     ILogicTypeService logicTypeService,
     ISCVendorService vendorService,
     ISignalService signalService,
     IAAlarmService aalarmService,
     IHAlarmService halarmService,
     IAMeasureService ameasureService,
     IHMeasureService hmeasureService,
     IRoleService roleService,
     IEntitiesInRoleService authService,
     IUserService userService,
     IGroupService groupService)
 {
     this._cacheManager       = cacheManager;
     this._areaService        = areaService;
     this._stationService     = stationService;
     this._stationTypeService = stationTypeService;
     this._roomService        = roomService;
     this._roomTypeService    = roomTypeService;
     this._deviceService      = deviceService;
     this._deviceTypeService  = deviceTypeService;
     this._fsuService         = fsuService;
     this._pointService       = pointService;
     this._logicTypeService   = logicTypeService;
     this._vendorService      = vendorService;
     this._signalService      = signalService;
     this._aalarmService      = aalarmService;
     this._halarmService      = halarmService;
     this._ameasureService    = ameasureService;
     this._hmeasureService    = hmeasureService;
     this._roleService        = roleService;
     this._authService        = authService;
     this._userService        = userService;
     this._groupService       = groupService;
 }
Beispiel #33
0
        private static void StationServiceTest()
        {
            Console.WriteLine("Testing station service");
            stationService = Container.Resolve <IStationService>();
            stationService.CreateStation(new StationDTO
            {
                Name = "Ceska",
                Town = "Brno"
            });

            var brnoStations = stationService.GetAllStationsByTown("Brno");

            if (brnoStations == null || !brnoStations.Any())
            {
                Console.WriteLine("NOK: Not found any station in Brno");
            }
            else if (brnoStations.Where(station => station.Name == "Ceska") == null || !brnoStations.Any())
            {
                Console.WriteLine("NOK: Station Ceska in Brno not created");
            }
            else
            {
                Console.WriteLine("OK");
            }
            var stationCeska = stationService.GetStationById(brnoStations.First().ID);

            if (stationCeska.Name != "Ceska" || stationCeska.Town != "Brno")
            {
                Console.WriteLine("NOK: Not found station Ceska in Brno by Id");
            }
            else
            {
                Console.WriteLine("OK");
            }
            stationService.DeleteStation(stationCeska.ID);
            if (stationService.GetStationById(stationCeska.ID) != null)
            {
                Console.WriteLine("NOK: Station not deleted");
            }
            else
            {
                Console.WriteLine("OK");
            }
        }
Beispiel #34
0
 public RoadInputViewModel(IRoadService roadsService, IStationService stationService, Road newRoad, ILogging logger, Window window, IPrimaryEntityCommandManagement manager)
 {
     RoadsService   = roadsService;
     StationService = stationService;
     NewRoad        = newRoad;
     Logger         = logger;
     Window         = window;
     if (newRoad.IsValid())
     {
         SaveRoadCommand = new UpdateRoadCommand(this, manager);
     }
     else
     {
         SaveRoadCommand = new AddRoadCommand(this, manager);
     }
     AttachStationsToRoadCommand   = new AttachStationsToRoadCommand(this);
     RemoveAttachedStationsCommand = new RemoveAttachedStationsCommand(this);
     InitBindingLists();
 }
Beispiel #35
0
 /// <summary>
 /// 获取岗位列表
 /// </summary>
 /// <param name="MenuService"></param>
 /// <param name="key">移除当前键,当为""或null不移除</param>
 /// <returns></returns>
 public static List<ChooseDictionary> ListAllStationInfo(IStationService StationService, string key)
 {
     NameValueCollection nvc = new NameValueCollection();
     nvc.Add("isvalid", "1");
     NameValueCollection orderby = new NameValueCollection();
     orderby.Add("menuname", "asc");
     List<StationInfo> datalist = StationService.ListAllByCondition(nvc, orderby);
     if (!string.IsNullOrEmpty(key))
     {
         datalist.Remove(datalist.Where(x => x.Id.Equals(key)).SingleOrDefault());
     }
     var dicMenu = (from slist in datalist
                    select new ChooseDictionary { Text = slist.StationName, Value = slist.Id, ParentId = slist.ParentId }).ToList();
     return dicMenu;
 }
Beispiel #36
0
 public StationsController(IStationService stationService)
 {
     _stationService = stationService;
 }
 public StationsController (IStationService  stationService, IUnitOfWorkAsync unitOfWork)
 {
     _stationService  = stationService;
     _unitOfWork = unitOfWork;
 }
Beispiel #38
0
 public HomeController(IStationService stationService)
 {
     _stationService = stationService;
 }