コード例 #1
0
        private void ListenerWorker_ProgressChanged(object sender, ProgressChangedEventArgs e)
        {
            string stream = (string)e.UserState;

            string[] chunks = stream.Split(new string[] { "|" }, StringSplitOptions.None);
            ARFCN    arfcn;

            if (chunks[0] == "ARFCN")
            {
                arfcn           = new ARFCN();
                arfcn.ID        = Guid.NewGuid();
                arfcn.Chanel    = Convert.ToInt32(chunks[1]);
                arfcn.Frequency = chunks[2].Remove(chunks[2].Length - 1);
                arfcn.CI        = Convert.ToInt32(chunks[3]);
                arfcn.LAC       = Convert.ToInt32(chunks[4]);
                arfcn.MCC       = Convert.ToInt32(chunks[5]);
                arfcn.MNC       = Convert.ToInt32(chunks[6]);
                arfcn.Power     = Convert.ToInt32(chunks[7]);


                arfcn.Configuration  = chunks[8];
                arfcn.CellARFCNs     = chunks[9];
                arfcn.NeighbourCells = chunks[10];

                arfcn.System = "GSM";
                arfcn.Band   = band;

                ListARFCNs.Add(arfcn);
            }



            //int mcc = Convert.ToInt32(arfcn.MCC);
            //int mnc = Convert.ToInt32(arfcn.MNC);
            //Provider provider = ManagerDB.FindProvider(mcc, mnc);
            //if (provider != null)
            //{
            //    arfcn.ProviderID = provider.ID;
            //    arfcn.Country = provider.Country;
            //    arfcn.Network = provider.Network;
            //    arfcn.Operator = provider.Operator;
            //    arfcn.Logo = provider.Logo;
            //}
            //worker.ReportProgress(scannCount++, new ScannerStatus() { Title = null, ARFCN = arfcn });
        }
コード例 #2
0
        private async void OnLoad()
        {
            var res = await ShowMessageAsync("Load?", "Are you sure? Load current values to the DataBase", MessageDialogStyle.AffirmativeAndNegative, new MetroDialogSettings
            {
                AnimateShow = false
            });

            if (res == MessageDialogResult.Affirmative)
            {
                if (SelectedSession != null)
                {
                    DataDB.UpdateARFCNListBySession(SelectedSession);
                    ListARFCNs.Clear();
                    foreach (ARFCN arfcn in TransferDB.ARFCNs)
                    {
                        ListARFCNs.Add(arfcn);
                    }
                }
            }
        }
コード例 #3
0
        private void OnScan()
        {
            ListARFCNs.Clear();
            //TransferDB.ARFCNs.Clear();
            SelectedUnit = Units[0];
            UpdateBand();
            Computer cpu = Computers.FirstOrDefault(c => c.Unit_ID == SelectedUnit.ID);

            if (Scanner.Start(cpu, 1, BroadcastIP, ScannerListenerPort, band, Gain, Speed, sample_rate, 0))
            {
                IsScanVisible   = Visibility.Collapsed;
                IsCancelVisible = Visibility.Visible;
                Cancel.RaiseCanExecuteChanged();
                if (!listenerWorker.IsBusy)
                {
                    listenerWorker.RunWorkerAsync(ScannerListenerPort);
                }
                IsEnabled        = false;
                IsEnabledSession = false;
            }
        }
コード例 #4
0
 private void OnDelete()
 {
     MoreVisibility = Visibility.Collapsed;
     ListARFCNs.Remove(SelectedARFCN);
 }