Exemplo n.º 1
0
        private async Task OnGetAntennaMatchingStatusAsync
        (
            AntennaMatchingStatus status,
            bool isNewForApp,
            int totalMatcherPositions,
            int currentMatcherPosition,
            float currentAntennaVoltage,
            int currentBestMatchPosition,
            float currentBestMatchVoltage
        )
        {
            _statusToLoad.AntennaMatchingStatus.Status                   = status;
            _statusToLoad.AntennaMatchingStatus.IsNewForApp              = isNewForApp;
            _statusToLoad.AntennaMatchingStatus.TotalMatcherPositions    = totalMatcherPositions;
            _statusToLoad.AntennaMatchingStatus.CurrentMatcherPosition   = currentMatcherPosition;
            _statusToLoad.AntennaMatchingStatus.CurrentVoltage           = currentAntennaVoltage;
            _statusToLoad.AntennaMatchingStatus.CurrentBestMatchPosition = currentBestMatchPosition;
            _statusToLoad.AntennaMatchingStatus.CurrentBestMatchVoltage  = currentBestMatchVoltage;

            _isFoxArmedCommand.SetResponseDelegate(async(ia) => await OnIsFoxArmedResponseAsync(ia));
            _isFoxArmedCommand.SendIsFoxArmedCommand();
        }
Exemplo n.º 2
0
 private void OnGetAntennaMatchingStatus
 (
     AntennaMatchingStatus status,
     bool isNewForApp,
     int totalMatcherPositions,
     int currentMatcherPosition,
     float currentAntennaVoltage,
     int currentBestMatchPosition,
     float currentBestMatchVoltage
 )
 {
     _onGetAntennaMatchingStatus
     (
         status,
         isNewForApp,
         totalMatcherPositions,
         currentMatcherPosition,
         currentAntennaVoltage,
         currentBestMatchPosition,
         currentBestMatchVoltage
     );
 }
Exemplo n.º 3
0
        public async Task OnMatchingStatusChangedAsync()
        {
            OnPropertyChanged(nameof(MatchingStatusFormatted));
            OnPropertyChanged(nameof(CurrentMatcherPositionFormatted));
            OnPropertyChanged(nameof(CurrentVoltageFormatted));
            OnPropertyChanged(nameof(MaximalVoltageFormatted));

            var newMatchingStatus = MainModel.DynamicFoxStatus.AntennaMatchingStatus.Status;
            var isNewForApp       = MainModel.DynamicFoxStatus.AntennaMatchingStatus.IsNewForApp;

            if (_previousMatchingStatus != AntennaMatchingStatus.InProgress
                &&
                newMatchingStatus == AntennaMatchingStatus.InProgress
                &&
                MainModel.AppDisplays.Peek() == ActiveDisplay.MatchingDisplay)
            {
                // Matching just initiated
                await OnMatchingInitiated();
            }

            if ((_previousMatchingStatus == AntennaMatchingStatus.NotSet || _previousMatchingStatus == AntennaMatchingStatus.InProgress)
                &&
                newMatchingStatus == AntennaMatchingStatus.Completed
                &&
                MainModel.AppDisplays.Peek() == ActiveDisplay.MatchingDisplay
                ||
                ForceReloadMatchingData)
            {
                ForceReloadMatchingData = false;

                // We just completed antenna matching
                await OnAntennaMatchingCompleted();
            }

            _previousMatchingStatus = newMatchingStatus;
        }