private void AddToSearchListButton_Click(object sender, EventArgs e)
        {
            foreach (var info in CellSearchAndMonitorUnions.OPCellSearchInfoDic[CSAMForm.OPComboBox.Text])
            {
                string freq   = info.Freq;
                string earfcn = info.Earfcn;
                string pci    = CSAMForm.PCIText.Text.Trim();

                if (String.IsNullOrWhiteSpace(freq) ||
                    String.IsNullOrWhiteSpace(pci))
                {
                    return;
                }
                if (!CellSearchAndMonitorUnions.IsIntOrDoubleString(freq) ||
                    !CellSearchAndMonitorUnions.IsDigitalString(pci))
                {
                    return;
                }

                ListViewItem LVItem = new ListViewItem(new string[10]);

                int index = CSAMForm.CellSearchListView.Items.Count;

                LVItem.SubItems[0].Text = (index + 1).ToString();
                LVItem.SubItems[1].Text = freq;
                LVItem.SubItems[2].Text = earfcn;
                LVItem.SubItems[3].Text = pci;
                LVItem.SubItems[9].Text = CSAMForm.OPComboBox.Text;
                LVItem.Tag = info.Band;

                CSAMForm.CellSearchListView.Items.Add(LVItem);
            }
            CSAMForm.CellMonitorButton.Enabled = true;
        }
        private void SendRxAnt(object sender, string dev)
        {
            CustomDataEvtArg EvtArg = CellSearchAndMonitorUnions.RxAntMsg(1);

            EvtArg.deivceName = dev;
            Global.tempClass.SendDataToDevice(sender, EvtArg);
            DeviceManger.FindDevice(EvtArg.deivceName).SendRexAnt = true;
        }
        private void LoadData()
        {
            string FilePath = System.Windows.Forms.Application.StartupPath + "\\CellSearchData.bin";

            CellSearchAndMonitorUnions.DataLoad(CSAMForm.CellSearchListView, FilePath);
            FilePath = System.Windows.Forms.Application.StartupPath + "\\CellMonitorData.bin";
            CellSearchAndMonitorUnions.DataLoad(CSAMForm.CellMonitorListView, FilePath);
        }
        //private bool sendRexAnt = false;
        private void CellSearchStart()
        {
            string freq   = CSAMForm.CellSearchListView.Items[CellSearchItemIndex].SubItems[1].Text.Trim();
            string earfcn = CSAMForm.CellSearchListView.Items[CellSearchItemIndex].SubItems[2].Text.Trim();
            string pci    = CSAMForm.CellSearchListView.Items[CellSearchItemIndex].SubItems[3].Text.Trim();

            CustomDataEvtArg CDEArgMes = CellSearchAndMonitorUnions.GenerateMessage(earfcn, pci, 2);
            //Global.GCurrentDevice = DeviceManger.deviceList[0].DeviceName;
            string lteMode = Global.EARFCNToLteMode(Convert.ToInt32(earfcn));

            DeviceManger.flashDeviceConnect();
            foreach (Device dev in DeviceManger.deviceConnect)
            {
                if (dev.LteMode == lteMode)
                {
                    Global.GCurrentDevice = dev.DeviceName;
                    CDEArgMes.deivceName  = dev.DeviceName;
                    if (dev.SendRexAnt == false)
                    {
                        SendRxAnt(CellSearchSender, dev.DeviceName);
                    }
                    break;
                }
            }
            if (String.IsNullOrEmpty(CDEArgMes.deivceName))
            {
                MessageBox.Show("没有" + lteMode + "板卡!");
                foreach (Device dev in DeviceManger.deviceList)
                {
                    if (dev.SendRexAnt)
                    {
                        dev.SendRexAnt = false;
                    }
                }
                CSAMForm.CellMonitorButton.Enabled = true;
                CSAMForm.CellStopBtn.Enabled       = false;
                isStop = true;
                Global.tempClass.CSAMStop();
                return;
            }
            Global.CurrentSender = CSAMForm.Name;
            //Global.tempClass.Start(CellSearchSender, CDEArgMes);
            if (CellSearchSender != null)
            {
                Global.tempClass.SendDataToDevice(CellSearchSender, CDEArgMes);
                CSAMRunning = true;
                //IsWitingForRelAck = false;
                CSAMForm.CellMonitorButton.Enabled = false;
                CSAMForm.CellStopBtn.Enabled       = true;
                Global.tempClass.CSAMStart();
                //CSAMForm.StopMonitorButton.Enabled = true;
                mutexRrace = 0;
                //CustomDataEvtArg getAGTStatus = new CustomDataEvtArg();
                //getAGTStatus.deivceName = Global.GCurrentDevice;
                //getAGTStatus.data = new byte[] { 0, 0, 0, 0, 0, 0, 0x01, 0x40, 0, 0, 0, 0 };
                //Global.tempClass.SendDataToDevice(CellSearchSender, getAGTStatus);
            }
        }
Exemple #5
0
 private void SaveDataButton_Click(object sender, EventArgs e)
 {
     if (!CellSearchAndMonitorUnions.IsPhoneNum(SysConfig.CenterCodeText.Text))
     {
         MessageBox.Show("请填入正确的短信中心号码!");
         return;
     }
     SysConfig.Close();
     SysConfig.Dispose();
 }
Exemple #6
0
        private void earfcnBox_KeyUp(object sender, KeyEventArgs e)
        {
            String Earfcn = earfcnBox.Text.Trim();

            if (CellSearchAndMonitorUnions.IsDigitalString(Earfcn))
            {
                int    earfcn = Convert.ToInt32(Earfcn);
                double freq   = Global.EARFCNToFreq(earfcn);
                int    band   = Global.EARFCNToBand(earfcn);
                freqBox.Text     = freq.ToString();
                BandTextBox.Text = band.ToString();
            }
        }
Exemple #7
0
        private void freqBox_KeyUp(object sender, KeyEventArgs e)
        {
            String Freq = freqBox.Text.Trim();
            String Band = BandTextBox.Text.Trim();

            if (CellSearchAndMonitorUnions.IsIntOrDoubleString(Freq) && CellSearchAndMonitorUnions.IsDigitalString(Band))
            {
                int    band   = Convert.ToUInt16(Band);
                double freq   = Convert.ToDouble(Freq);
                int    earfcn = Global.FreqToEARFCN(band, freq);
                earfcnBox.Text = earfcn.ToString();
            }
        }