public KyoshinMonitorWatchService( LoggerService logger, TrTimeTableService trTimeTableService, ConfigurationService configService, TimerService timeService, IEventAggregator aggregator) { Logger = logger; ConfigService = configService; TrTimeTableService = trTimeTableService; TimerService = timeService; RealtimeDataUpdatedEvent = aggregator.GetEvent <RealtimeDataUpdated>(); RealtimeDataParseProcessStartedEvent = aggregator.GetEvent <RealtimeDataParseProcessStarted>(); EewUpdatedEvent = aggregator.GetEvent <EewUpdated>(); // asyncによる待機を行うのでEventAggregatorは使用できない TimerService.MainTimerElapsed += TimerElapsed; }
public async void Start() { Logger.OnWarningMessageUpdated("初期化中..."); Logger.Info("観測点情報を読み込んでいます。"); var points = MessagePackSerializer.Deserialize <ObservationPoint[]>(Properties.Resources.ShindoObsPoints, MessagePackSerializerOptions.Standard.WithCompression(MessagePackCompression.Lz4BlockArray)); WebApi = new WebApi() { Timeout = TimeSpan.FromSeconds(2) }; AppApi = new AppApi(points) { Timeout = TimeSpan.FromSeconds(2) }; Points = points; Logger.Info("走時表を準備しています。"); TrTimeTableService.Initalize(); await TimerService.StartMainTimerAsync(); Logger.OnWarningMessageUpdated($"初回のデータ取得中です。しばらくお待ち下さい。"); }