public PositionPage(Position position) { InitializeComponent(); var serviceProvider = Startup.ServiceProvider; this.wifiConnector = serviceProvider.GetService <IWifiConnector>(); this.bluetoothConnector = serviceProvider.GetService <IBluetoothConnector>(); this.magneticFieldSensor = serviceProvider.GetService <MagneticFieldSensor>(); this.calibrationsService = serviceProvider.GetService <ICalibrationService>(); this.positionSignalDataService = serviceProvider.GetService <IPositionSignalDataService>(); this.positionEstimationService = serviceProvider.GetService <IPositionEstimationService>(); this.localeProvider = serviceProvider.GetService <LocaleProvider>(); this.configuration = serviceProvider.GetService <Configuration>(); this.Position = position; PositionSignalDataCollection.RefreshCommand = RefreshData_Command; PositionSignalDataCollection.ItemsSource = PositionSignalData; Position.PositionSignalData? .OrderBy(data => data.SignalType) .ThenByDescending(data => data.Strength) .ToList() .ForEach(data => PositionSignalData.Add(new PositionSignalDataView(data))); BindingContext = this; timer = new Timer(configuration !.DataAquisitionInterval * 1000); timer.Elapsed += UpdateMonitoringState; timer.Start(); countLabel.Text = count.ToString(); }
public async Task <ActionResult <bool> > RecalculatePositionSignalData( [FromServices] IPositionSignalDataService positionSignalDataService, [FromRoute] PositionSignalDataQuery positionSignalDataQuery) { return(await positionSignalDataService.RecalculatePositionSignalData(positionSignalDataQuery)); }
public async Task <ActionResult <List <PositionSignalData> > > GetPositionSignalDatas( [FromServices] IPositionSignalDataService positionSignalDataService, [FromQuery] PositionSignalDataQuery query) { return(await positionSignalDataService.GetPositionSignalDatas(query)); }