Exemple #1
0
        public FreqAssignDialog(FreqPlanSegment p_freqInfo)
        {
            InitializeComponent();
            List <FreqPlanSegment> list = new List <FreqPlanSegment>();

            list.Add(p_freqInfo);
            isInitOk   = _freqAssignList_Control.InitPage2(list);
            this.Title = "频率占用";
            _freqAssignList_Control.titleselectfreq.Visibility = Visibility.Hidden;
            _freqAssignList_Control.tbselectfreq.Visibility    = Visibility.Hidden;
            _freqAssignList_Control.ShowInterfere = false;
            BtnOK.Visibility  = Visibility.Hidden;
            BtnCancel.Content = "关闭";
        }
Exemple #2
0
        private static FreqPlanSegment LoadFreqPlanRow(System.Data.DataRow p_dataRow)
        {
            FreqPlanSegment freqplan = new FreqPlanSegment();

            double dbBegin, dbEnd;

            freqplan.FreqId       = p_dataRow["freq_planning_id"].ToString();
            freqplan.FreqPlanName = p_dataRow["name"].ToString();
            double.TryParse(p_dataRow["freqfrom"].ToString(), out dbBegin);
            double.TryParse(p_dataRow["freqto"].ToString(), out dbEnd);
            freqplan.FreqValue.Little = dbBegin;
            freqplan.FreqValue.Great  = dbEnd;
            freqplan.FreqBand         = p_dataRow["khzband"].ToString();

            return(freqplan);
        }
Exemple #3
0
        public static FreqPlanSegment GetFreqPlanSegment(ActivityEquipmentInfo EquInfo)
        {
            FreqPlanSegment segment = null;
            List <CO_IA.Data.FreqPlanSegment> segmentList = PT_BS_Service.Client.Framework.BeOperationInvoker.Invoke <I_CO_IA.FreqPlan.I_CO_IA_FreqPlan, List <CO_IA.Data.FreqPlanSegment> >(
                channel =>
            {
                return(channel.GetFreqPlanInfo());
            });

            foreach (FreqPlanSegment freqPlanSegment in segmentList)
            {
                //if (freqPlanSegment.FreqValue.Little / (double)1000000 <= EquInfo.SendFreqStart.Value
                //    && freqPlanSegment.FreqValue.Great / (double)1000000 >= EquInfo.SendFreqEnd.Value)
                if (freqPlanSegment.ClassCode == EquInfo.BusinessCode)
                {
                    segment = freqPlanSegment;
                    break;
                }
            }
            return(segment);
        }
Exemple #4
0
        /// <summary>
        /// 台站信息转周围台站信息
        /// </summary>
        /// <param name="pStationInfos"></param>
        /// <param name="pFreqPlans"></param>
        /// <param name="pStatFreqDic"></param>
        /// <returns></returns>
        private List <RoundStationInfo> StationInfoConvert(List <StationInfo> pStationInfos, List <FreqPlanActivity> pFreqPlans, Dictionary <string, FreqPlanSegment> pStatFreqDic)
        {
            List <RoundStationInfo> roundStations = new List <RoundStationInfo>(pStationInfos.Count);

            for (int i = 0; i < pStationInfos.Count; i++)
            {
                StationInfo stationInfo = new RoundStationInfo();
                StructClone.ClassClone(pStationInfos[i], ref stationInfo);
                ((RoundStationInfo)stationInfo).ActivityId       = CO_IA.Client.RiasPortal.ModuleContainer.Activity.Guid;
                ((RoundStationInfo)stationInfo).PlaceId          = _activityPlaceId;
                ((RoundStationInfo)stationInfo).FreqActivityGuid = _activityPlaceId;
                //获取台站发射信息
                List <FreqEmitInfo> emitInfos = GetStationSystemEmitInfo(pStationInfos[i].STATGUID, pStationInfos[i].STAT_APP_TYPE);
                if (emitInfos != null && emitInfos.Count > 0)
                {
                    foreach (var emit in emitInfos)
                    {
                        emit.StationGuid = pStationInfos[i].STATGUID;
                        emit.PlaceGuid   = _activityPlaceId;
                        emit.NeedClear   = NeedClearEunm.NotNeedClear;
                        emit.ClearResult = ClearResultEnum.NotClear;
                    }
                }
                ((RoundStationInfo)stationInfo).EmitInfos = emitInfos;
                FreqPlanSegment freqSegment = null;
                if (pStatFreqDic.TryGetValue(((RoundStationInfo)stationInfo).STATGUID, out freqSegment))
                {
                    if (freqSegment is FreqPlanActivity)
                    {
                        ((RoundStationInfo)stationInfo).FreqActivityGuid = (freqSegment as FreqPlanActivity).Guid;
                    }
                    ((RoundStationInfo)stationInfo).FreqPart = freqSegment;
                }
                roundStations.Add((RoundStationInfo)stationInfo);
            }
            return(roundStations);
        }
        /// <summary>
        /// 导入频率规划
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btn_ImportFreq_Click(object sender, RoutedEventArgs e)
        {
            //List<FreqPlanSegment> freqPlanList = GetFreqPartPlan();
            //List<FreqPlanActivity> freqPlanList = GetActivityFreqPlanInfoSource(LoginService.CurrentActivityPlace.Guid);

            List <FreqPlanSegment> freqPlanList = SQLiteDataService.QueryFreqPlanByPlaceID(LoginService.CurrentActivityPlace.Guid); //add by michael 17.07.20

            if (freqPlanList != null && freqPlanList.Count > 0)
            {
                navBar.Groups.Clear();//add by michael
                for (int i = 0; i < freqPlanList.Count; i++)
                {
                    FreqPlanSegment           fps       = freqPlanList[i];
                    NavBarGroup               nbg       = new NavBarGroup();
                    AT_BC.Data.Range <double> freqValue = fps.FreqValue;
                    //nbg.Header = fps.FreqPlanName + "    " + freqValue.Little / 1000000 + "--" + freqValue.Great / 1000000 + "MHz";
                    nbg.Header = fps.FreqPlanName + "    " + freqValue.Little + "--" + freqValue.Great + "MHz";
                    FreqNavBar fnb = new FreqNavBar();
                    //fnb.FreqStart = (freqValue.Little / 1000000).ToString();
                    //fnb.FreqStop = (freqValue.Great / 1000000).ToString();
                    fnb.FreqStart = (freqValue.Little).ToString();
                    fnb.FreqStop  = (freqValue.Great).ToString();
                    fnb.reAnalysisFreqRange.Click += new RoutedEventHandler(FreqNavBarButtonClick);
                    //fnb.BandWidth = (Convert.ToDouble(fps.FreqBand.Split('/')[0]) / 1000).ToString();
                    fnb.BandWidth = (Convert.ToDouble(fps.FreqBand)).ToString();
                    fnb.FreqGuid  = fps.FreqId;
                    nbg.Items.Add(fnb);
                    nbg.Click     += new EventHandler(NavBarGroup_Click);
                    nbg.IsExpanded = false;
                    navBar.Groups.Add(nbg);
                }
            }
            else
            {
                MessageBox.Show("该活动区域没有频率规划!");
            }
        }
Exemple #6
0
 public RoundStationInfo()
 {
     FreqPart  = new FreqPlanSegment();
     EmitInfos = new List <FreqEmitInfo>();
 }
Exemple #7
0
        private List <RoundStationInfo> GetRemoteRoundStations(List <FreqPlanActivity> obj, List <RoundStationInfo> pOldRoundStations)
        {
            List <RoundStationInfo> roundStations            = new List <RoundStationInfo>();
            Dictionary <string, FreqPlanSegment> statFreqDic = new Dictionary <string, FreqPlanSegment>();
            List <StationInfo> stationInfos = new List <StationInfo>();

            for (int i = 0; i < obj.Count; i++)
            {
//#warning 以下注释信息为实际代码,当前用的是测试代码
                Point[] points = new Point[obj[i].Points.Length];
                for (int j = 0; j < obj[i].Points.Length; j++)
                {
                    points[j]   = new Point();
                    points[j].X = obj[i].Points[j].X;
                    points[j].Y = obj[i].Points[j].Y;
                }
                Point startPoint = new Point();
                startPoint.X = obj[i].StartPoint.X;
                startPoint.Y = obj[i].StartPoint.Y;
                Point endPoint = new Point();
                endPoint.X = obj[i].EndPoint.X;
                endPoint.Y = obj[i].EndPoint.Y;
                //stationInfos.AddRange(xStationQueryControl.QueryStationData(points, startPoint, endPoint, obj[i].ClassCode.Length >= 4 ? obj[i].ClassCode.Substring(0, 4) : ""));
                ////测试数据
                //Point[] points = new Point[10];
                //points[0] = new Point();
                //points[0].X = 114.4401000;
                //points[0].Y = 36.6189000;

                //points[1] = new Point();
                //points[1].X = 114.4401100;
                //points[1].Y = 36.6189100;

                //points[2] = new Point();
                //points[2].X = 114.4402778;
                //points[2].Y = 36.6105556;

                //points[3] = new Point();
                //points[3].X = 114.4402778;
                //points[3].Y = 36.6283333;

                //points[4] = new Point();
                //points[4].X = 114.4403700;
                //points[4].Y = 36.6283800;

                //points[5] = new Point();
                //points[5].X = 114.4404240;
                //points[5].Y = 36.6283800;

                //points[6] = new Point();
                //points[6].X = 114.4404560;
                //points[6].Y = 336.6283800;

                //points[7] = new Point();
                //points[7].X = 114.4405100;
                //points[7].Y = 36.6283800;

                //points[8] = new Point();
                //points[8].X = 114.4407300;
                //points[8].Y = 36.6283800;

                //points[9] = new Point();
                //points[9].X = 114.4408;
                //points[9].Y = 36.63;

                //Point startPoint = new Point();
                //startPoint.X = 114.4398;
                //startPoint.Y = 36.61;
                //Point endPoint = new Point();
                //endPoint.X = 114.4408;
                //endPoint.Y = 36.63;
                string freqRange = (obj[i].FreqValue.Little / 1000000).ToString() + ";" + (obj[i].FreqValue.Great / 1000000).ToString();
                //string freqRange = "";
                List <StationInfo> tempStatInfos = QueryStationData(points, startPoint, endPoint, freqRange);
                if (tempStatInfos != null && tempStatInfos.Count > 0)
                {
                    for (int j = 0; j < tempStatInfos.Count; j++)
                    {
                        if (!statFreqDic.Keys.Contains(tempStatInfos[j].STATGUID) && (string.IsNullOrEmpty(tempStatInfos[j].NET_SVN) ||
                                                                                      (tempStatInfos[j].NET_SVN.Length >= 4 && obj[i].ClassCode.Length >= 4 &&
                                                                                       tempStatInfos[j].NET_SVN.Substring(0, 4) == obj[i].ClassCode.Substring(0, 4))))
                        {
                            FreqPlanSegment freqSegment = obj[i];
                            statFreqDic.Add(tempStatInfos[j].STATGUID, freqSegment);
                            stationInfos.Add(tempStatInfos[j]);
                        }
                    }
                }
            }
            //过滤台站,并赋数据源
            List <StationInfo> statlist = stationInfos.Where((x, i) => stationInfos.FindIndex(z => z.STATGUID == x.STATGUID) == i).ToList();

            //数据结构赋值
            List <RoundStationInfo> tempRoundStats = pOldRoundStations == null ? new List <RoundStationInfo>() : pOldRoundStations;

            if (statlist != null && statlist.Count > 0)
            {
                tempRoundStats.AddRange(StationInfoConvert(statlist, obj, statFreqDic));
            }
            //更新数据源
            roundStations = tempRoundStats.Where((x, i) => tempRoundStats.FindIndex(z => z.STATGUID == x.STATGUID) == i).ToList();
            return(roundStations);
        }