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 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); } }
public new void Load() { if (deviceManger == null || deviceManger.IsDisposed) { deviceManger = new DeviceManger(); } deviceManger.newLoad(); if (systemConfig == null || systemConfig.IsDisposed) { systemConfig = new SystemConfig(); } systemConfig.newLoad(); if (CSAMForm == null || CSAMForm.IsDisposed) { CSAMForm = new CellSearchAndMonitor(); CSAMForm.ShowHint = DockState.Document; CSAMForm.Show(GloabeControl.cellSearchDockPanel); CSAMForm.DockState = DockState.Document; } else { CSAMForm.ShowHint = DockState.Document; CSAMForm.Show(GloabeControl.cellSearchDockPanel); CSAMForm.DockState = DockState.Document; //debugDisplay.DockAreas = DockAreas.Document; } //sTmsiGraph.ShowDialog(); if (EventLoad == false) { Global.tempClass.SendDataToProTrackEvent += this.DataReceived; Global.tempClass.SendACKToCellScanEvent += new Class1.DeviceSendACKToCellScan(ACKHandler); Global.tempClass.StartEvent += new Class1.StartHandler(StartEvent); Global.tempClass.CloseDisplayFormEvent += new Class1.CloseDisplayFormHander(CloseForm); EventLoad = true; } //Control.CheckForIllegalCrossThreadCalls = false; LoadData(); if (CSAMForm.CellSearchListView.Items.Count == 0) { CSAMForm.CellMonitorButton.Enabled = false; } CSAMForm.CellStopBtn.Enabled = false; CellSearchAndMonitorUnions.CellMonitorLV = CSAMForm.CellMonitorListView; //CSAMForm.StopMonitorButton.Enabled = false; CSAMForm.OPComboBox.Items.Add("中国移动"); CSAMForm.OPComboBox.Items.Add("中国联通"); CSAMForm.OPComboBox.Items.Add("中国电信"); CSAMForm.OPComboBox.SelectedIndex = 0; PingDevice(); }
private void ConBtn_Click(object sender, EventArgs e) { foreach (Device connDevice in DeviceManger.deviceList) { if (connDevice.ConnectionState == (byte)Global.DeviceStateValue.Disconnection) { connDevice.ConnectionState = (byte)Global.DeviceStateValue.connState; connDevice.NewMessageConn(); } else { //MessageBox.Show("This instrument is connected!"); } } DeviceManger.flashDeviceConnect(); }
private void CellMonitorButton_Click(object sender, EventArgs e) { isStop = false; isSecond = false; CellSearchItemIndex = 0; CellSearchSender = sender; if (DeviceManger.deviceList.Count == 0) { MessageBox.Show("没有可用板卡!"); return; } Global.GCurrentDevice = ""; DeviceManger.flashDeviceConnect(); if (DeviceManger.deviceConnect.Count == 0) { MessageBox.Show("没有可用板卡!"); return; } //else if (deviceConnect.Count == 1) //{ // Global.GCurrentDevice = deviceConnect[0].DeviceName; //} //else if (deviceConnect.Count == 2) //{ // string device0 = deviceConnect[0].IpAddress.Replace(".", ""); // string device1 = deviceConnect[1].IpAddress.Replace(".", ""); // if (Convert.ToInt32(device0) < Convert.ToInt32(device1)) // Global.GCurrentDevice = deviceConnect[0].DeviceName; // else // Global.GCurrentDevice = deviceConnect[1].DeviceName; //} CSAMForm.CellSearchStart(); foreach (ListViewItem item in CSAMForm.CellMonitorListView.Items) { CSAMForm.CellMonitorListView.Items.Remove(item); } }
private void DisconBtn_Click(object sender, EventArgs e) { if (CSAMRunning || FindTargetSTMSI.FTSTMSIRunning1 || OrientationFinding.OrtRunning1) { MessageBox.Show("断开连接前请先停止当前工作!"); return; } foreach (Device connDevice in DeviceManger.deviceList) { if (connDevice.ConnectionState == (byte)Global.DeviceStateValue.Connecting) { connDevice.CloseDeviceConn(); connDevice.timer.Enabled = false; connDevice.HeartCheckStart = false; } else { //MessageBox.Show("This instrument is disconnected!"); } } DeviceManger.flashDeviceConnect(); }
private void CellSearchListView_MouseDoubleClick(object sender, MouseEventArgs e) { //联机时用 if (DeviceManger.deviceList.Count == 0) { MessageBox.Show("无可用监控板卡!"); return; } DeviceManger.flashDeviceConnect(); if (DeviceManger.deviceConnect.Count == 0) { MessageBox.Show("监控板卡未连接!"); return; } tddDevice.Clear(); fddDevice.Clear(); foreach (Device d in DeviceManger.deviceConnect) { if (d.LteMode == "TDD") { tddDevice.Add(d); } else if (d.LteMode == "FDD") { fddDevice.Add(d); } } tdd = 0; fdd = 0; foreach (ListViewItem item in CSAMForm.CellMonitorListView.Items) { string earfcn = item.SubItems[2].Text; string lteMode = Global.EARFCNToLteMode(Convert.ToInt32(earfcn)); if (lteMode == "TDD") { tdd++; } else if (lteMode == "FDD") { fdd++; } } if (e.Button == MouseButtons.Left && CSAMForm.CellSearchListView.FocusedItem != null) { ListViewItem LVItem = new ListViewItem(new string[8]); int index = CSAMForm.CellMonitorListView.Items.Count; LVItem.SubItems[0].Text = (index + 1).ToString(); int i = 1; for (; i < 4; i++) { LVItem.SubItems[i].Text = CSAMForm.CellSearchListView.FocusedItem.SubItems[i].Text; } LVItem.SubItems[5].Text = CSAMForm.CellSearchListView.FocusedItem.SubItems[7].Text; LVItem.SubItems[6].Text = CSAMForm.CellSearchListView.FocusedItem.SubItems[8].Text; LVItem.SubItems[7].Text = CSAMForm.CellSearchListView.FocusedItem.SubItems[9].Text; string earfcn = CSAMForm.CellSearchListView.FocusedItem.SubItems[2].Text; string lteMode = Global.EARFCNToLteMode(Convert.ToInt32(earfcn)); if (lteMode == "TDD") { if (tdd >= tddDevice.Count) { MessageBox.Show("TDD监控板卡不足,请检查配置!"); return; } else { LVItem.SubItems[4].Text = tddDevice[tdd].DeviceName; } } else if (lteMode == "FDD") { if (fdd >= fddDevice.Count) { MessageBox.Show("FDD监控板卡不足,请检查配置!"); return; } else { LVItem.SubItems[4].Text = fddDevice[fdd].DeviceName; } } LVItem.Tag = CSAMForm.CellSearchListView.FocusedItem.Tag; CSAMForm.CellMonitorListView.Items.Add(LVItem); //CSAMForm.CellMonitorButton.Enabled = true; isStop = true; CellSearchAndMonitorUnions.CellMonitorLV = CSAMForm.CellMonitorListView; } }