/// <summary>
        /// 导入
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BtnImport_Click(object sender, RoutedEventArgs e)
        {
            List <ActivityEquipmentInfo> aEquipList = new List <ActivityEquipmentInfo>();

            if (EquipmentItemsSource == null)
            {
                return;
            }
            foreach (EquipmentInfo info in EquipmentItemsSource)
            {
                if (info.IsChecked == true)
                {
                    ActivityEquipmentInfo tempEuipInfo = ConvertToActivityEquipmentInfo(info);

                    aEquipList.Add(tempEuipInfo);
                }
            }

            bool result = PT_BS_Service.Client.Framework.BeOperationInvoker.Invoke <I_CO_IA.FreqPlan.I_CO_IA_FreqPlan, bool>(channel =>
            {
                return(channel.SaveEquipmentList(aEquipList));
            });

            this.Close();

            if (RefreshEquipmentSource != null)
            {
                RefreshEquipmentSource();
            }
        }
Example #2
0
 /// <summary>
 /// 查询设备详细信息
 /// </summary>
 /// <param name="equipment"></param>
 /// <returns></returns>
 private ActivityEquipmentInfo GetEquipmentInfo(ActivityEquipmentInfo equipment)
 {
     return(PT_BS_Service.Client.Framework.BeOperationInvoker.Invoke <I_CO_IA.FreqPlan.I_CO_IA_FreqPlan, ActivityEquipmentInfo>(channel =>
     {
         return channel.GetEquipmentInfo(equipment);
     }));
 }
        public EquipmentDetailControl(ActivityEquipmentInfo equipInfo)
        {
            InitializeComponent();

            List <ActivityORGInfo> cmb_OrgList = PT_BS_Service.Client.Framework.BeOperationInvoker.Invoke <I_CO_IA.FreqPlan.I_CO_IA_FreqPlan, List <ActivityORGInfo> >(channel =>
            {
                return(channel.GetORGInfos(OriginalEquipment.ActivityGuid));
            });

            this.cmb_OrgList.ItemsSource = cmb_OrgList;

            List <EMCModulationEnum> modulation = new List <EMCModulationEnum>();

            foreach (string item in Enum.GetNames(typeof(EMCModulationEnum)))
            {
                EMCModulationEnum modulate = new EMCModulationEnum();
                if (Enum.TryParse(item, out modulate))
                {
                    modulation.Add(modulate);
                }
            }
            combModulate.ItemsSource = modulation;

            this.DataContextChanged += EquipmentDetailControl_DataContextChanged;
            this.DataContext         = equipInfo;
        }
 private void equdatagrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (this.dg_equiplist.SelectedItem != null)
     {
         SelectedEquipment = this.dg_equiplist.SelectedItem as ActivityEquipmentInfo;
     }
 }
        private object[,] SourceToObject(List <ActivityEquipmentInfo> equs)
        {
            object[,] obj = null;
            int rows = equs.Count;
            ObservableCollection <DataGridColumn> columns = dg_equiplist.Columns;
            int cols = columns.Count;

            obj = new object[rows + 1, cols];

            for (int c = 1; c < cols; c++)
            {
                DataGridColumn column = columns[c];
                obj[0, c - 1] = column.Header;
            }
            for (int r = 0; r < rows; r++)
            {
                ActivityEquipmentInfo equ = equs[r];
                obj[r + 1, 0] = equ.ORG.Name;                      //单位
                obj[r + 1, 1] = equ.Name;                          //设备名称
                obj[r + 1, 2] = GetBusinessName(equ.BusinessCode); //业务类型
                obj[r + 1, 3] = equ.EQUCount;                      //设备数量
                obj[r + 1, 4] = equ.SendFreq;                      //发射频率
                obj[r + 1, 5] = equ.ReceiveFreq;                   //接收频率
                obj[r + 1, 6] = equ.IsTunAble == true ? "是" : "否"; //频率可调
                obj[r + 1, 7] = equ.Band;                          //带宽
                obj[r + 1, 8] = equ.MaxPower;                      //最大功率
                //obj[r + 1, 9] = equ.BusinessCode;//技术体制
            }

            return(obj);
        }
Example #6
0
        public LicenseViewInfo(ActivityEquipmentInfo equInfo)
        {
            this._guid    = equInfo.GUID;
            this._equCode = equInfo.EquNo;
            this._equNum  = equInfo.EQUCount;
            this._equType = equInfo.EquModel;
            if (equInfo.SendFreq != null)
            {
                this._sendFreq = equInfo.SendFreq.Value;
            }
            else
            {
                this._sendFreq = 0;
            }

            if (equInfo.Band != null)
            {
                this._band = equInfo.Band.Value;
            }
            else
            {
                this._band = 0;
            }
            this._timeLimit = ((DateTime)equInfo.RunningFrom).ToString("yyyy年MM月dd日") + " - " + ((DateTime)equInfo.RunningTo).ToString("yyyy年MM月dd日");
            this._orgName   = equInfo.OrgInfo.Name;
            this._remark    = equInfo.Remark;
        }
Example #7
0
        private void DataGrid_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            if (e.ClickCount == 2)
            {
                DataGrid        datagrid  = sender as DataGrid;
                InterfereObject interfobj = datagrid.SelectedItem as InterfereObject;

                if (interfobj.Type == InterfereObjectEnum.设备)
                {
                    ActivityEquipmentInfo equ = new ActivityEquipmentInfo();
                    equ.GUID = interfobj.Guid;
                    PT_BS_Service.Client.Framework.BeOperationInvoker.Invoke <I_CO_IA.FreqPlan.I_CO_IA_FreqPlan>(channel =>
                    {
                        equ = channel.GetEquipmentInfo(equ);
                        if (equ != null)
                        {
                            EquipmentDetailDialog dialog = new EquipmentDetailDialog(equ);
                            dialog.IsEnabled             = false;
                            dialog.WindowTitle           = "设备-详细信息";
                            dialog.ShowDialog(this);
                        }
                    });
                }
                else if (interfobj.Type == InterfereObjectEnum.周围台站)
                {
                    StationDetailDialog dialog = new StationDetailDialog(interfobj.Guid);
                    dialog.ShowDialog(this);
                }
            }
        }
Example #8
0
        private ActivityEquipmentInfo CopyEqu(ActivityEquipmentInfo equ)
        {
            ActivityEquipmentInfo equInfo = new ActivityEquipmentInfo();

            equInfo.GUID              = equ.GUID;
            equInfo.OrgInfo           = equ.OrgInfo;
            equInfo.ORG               = equ.ORG;
            equInfo.IsChecked         = equ.IsChecked;
            equInfo.ORGGuid           = equ.ORGGuid;
            equInfo.ActivityGuid      = equ.ActivityGuid;
            equInfo.PlaceGuid         = equ.PlaceGuid;
            equInfo.Name              = equ.Name;
            equInfo.EQUCount          = equ.EQUCount;
            equInfo.Remark            = equ.Remark;
            equInfo.IsStation         = equ.IsStation;
            equInfo.StationName       = equ.StationName;
            equInfo.IsMobile          = equ.IsMobile;
            equInfo.SendFreq          = equ.SendFreq;
            equInfo.ReceiveFreq       = equ.ReceiveFreq;
            equInfo.IsTunAble         = equ.IsTunAble;
            equInfo.SendFreqStart     = equ.SendFreqStart;
            equInfo.SendFreqEnd       = equ.SendFreqEnd;
            equInfo.MaxPower          = equ.MaxPower;
            equInfo.Band              = equ.Band;
            equInfo.ChannelBand       = equ.ChannelBand;
            equInfo.Leakage           = equ.Leakage;
            equInfo.ModulateMode      = equ.ModulateMode;
            equInfo.RecvFreqStart     = equ.RecvFreqStart;
            equInfo.RecvFreqEnd       = equ.RecvFreqEnd;
            equInfo.Sensitivity       = equ.Sensitivity;
            equInfo.SensitivityUnit   = equ.SensitivityUnit;
            equInfo.ADJChannelInh     = equ.ADJChannelInh;
            equInfo.SignalNoise       = equ.SignalNoise;
            equInfo.CoChnPro          = equ.CoChnPro;
            equInfo.RunningFrom       = equ.RunningFrom;
            equInfo.RunningTo         = equ.RunningTo;
            equInfo.Origin            = equ.Origin;
            equInfo.EquModel          = equ.EquModel;
            equInfo.EquNo             = equ.EquNo;
            equInfo.AssignFreq        = equ.AssignFreq;
            equInfo.RecvAntModel      = equ.RecvAntModel;
            equInfo.RecvAntGain       = equ.RecvAntGain;
            equInfo.RecvAntElevation  = equ.RecvAntElevation;
            equInfo.RecvAntAzimuth    = equ.RecvAntAzimuth;
            equInfo.RecvAntPolar      = equ.RecvAntPolar;
            equInfo.RecvAntHeight     = equ.RecvAntHeight;
            equInfo.RecvAntFeedLength = equ.RecvAntFeedLength;
            equInfo.RecvAntFeedLoss   = equ.RecvAntFeedLoss;
            equInfo.SendAntModel      = equ.SendAntModel;
            equInfo.SendAntGain       = equ.SendAntGain;
            equInfo.SendAntElevation  = equ.SendAntElevation;
            equInfo.SendAntAzimuth    = equ.SendAntAzimuth;
            equInfo.SendAntPolar      = equ.SendAntPolar;
            equInfo.SendAntHeight     = equ.SendAntHeight;
            equInfo.SendAntFeedLength = equ.SendAntFeedLength;
            equInfo.SendAntFeedLoss   = equ.SendAntFeedLoss;
            equInfo.BusinessCode      = equ.BusinessCode;
            return(equInfo);
        }
        /// <summary>
        /// 手工录入
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ManualRegister_Click(object sender, RoutedEventArgs e)
        {
            ActivityEquipmentInfo equapply = new ActivityEquipmentInfo();
            EquipmentDetailDialog dialog   = new EquipmentDetailDialog(equapply);

            dialog.WindowTitle = "设备-手工登记";
            dialog.ShowDialog(this);
        }
Example #10
0
 public InterferedDetailInfoDialog(ActivityEquipmentInfo p_activityEquipmentInfo, Dictionary <ActivityEquipmentInfo, List <InterfereResult> > p_dicInterfereResult, Dictionary <ActivityEquipmentInfo, List <IMInterfereResult> > p_dicIMInterfereResult)
 {
     InitializeComponent();
     this._activityEquipmentInfo          = p_activityEquipmentInfo;
     this._dicInterfereResult             = p_dicInterfereResult;
     this._dicIMInterfereResult           = p_dicIMInterfereResult;
     _interfereStatisticsGrid.DataContext = LoadAnalysisResult();
 }
Example #11
0
 public FreqAssignDialog(ActivityEquipmentInfo equ, List <RoundStationInfo> aroundstations, string placeGuid)
 //public FreqAssignDialog(ActivityEquipmentInfo equ, List<ActivityEquipmentInfo> aroundstations)
 {
     InitializeComponent();
     _freqAssignList_Control.EquInfo        = equ;
     _freqAssignList_Control.AroundStations = aroundstations;
     _freqAssignList_Control.PlaceGuid      = placeGuid;
     _freqAssignList_Control.BusinessCode   = equ.BusinessCode;
     isInitOk = _freqAssignList_Control.InitPage();
 }
Example #12
0
        private void DataGridRow_MouseDoubleClick(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            DataGridRow dgr = DataGridRow.GetRowContainingElement(e.OriginalSource as FrameworkElement);

            if (dgr != null)
            {
                ActivityEquipmentInfo      equip  = dgr.DataContext as ActivityEquipmentInfo;
                InterferedDetailInfoDialog dialog = new InterferedDetailInfoDialog(equip, dicInterfereResult, dicIMInterfereResult);
                dialog.Show();
            }
        }
 private void equdatagrid_MouseDoubleClick(object sender, MouseButtonEventArgs e)
 {
     if (dg_equiplist.SelectedItem != null)
     {
         ActivityEquipmentInfo SelectedEquipment = dg_equiplist.SelectedItem as ActivityEquipmentInfo;
         EquipmentDetailDialog dialog            = new EquipmentDetailDialog(SelectedEquipment);
         dialog.IsEnabled   = false;
         dialog.WindowTitle = "设备-详细信息";
         dialog.ShowDialog(this);
     }
 }
        /// <summary>
        /// 取设备干扰信息
        /// </summary>
        /// <param name="Interfequ"></param>
        /// <returns></returns>
        private InterfereObject CreateInterfObjectFromEqu(ActivityEquipmentInfo Interfequ)
        {
            InterfereObject intobject = new InterfereObject();

            intobject.Guid = Interfequ.GUID;
            intobject.Name = Interfequ.Name;
            intobject.Type = InterfereObjectEnum.设备;
            intobject.Freq = Interfequ.SendFreq;
            intobject.Band = Interfequ.Band;

            return(intobject);
        }
Example #15
0
        /// <summary>
        /// 预览许可证
        /// </summary>
        private void viewLicense()
        {
            ActivityEquipmentInfo equTemp = getTempEquInfo();
            Canvas _viewCanvas            = LicenseViewFactory.CreateLicenseViewCanvas(equTemp, _licenseTempleteInfo, true);

            grpView.Content = _viewCanvas;
            //borderView.Child = _viewCanvas;
            //borderView.Height = _licenseTemplete.Height + 2;
            //borderView.Width = _licenseTemplete.Width + 2;
            //grpView.Width = _licenseTemplete.Width + 20;
            //borderView.Visibility = Visibility.Visible;
        }
Example #16
0
        //public delegate void DeleFunc();
        //public void Func()
        //{
        //    CO_IA.UI.Collection.RealTimeMonitor realTimeMonitor = new CO_IA.UI.Collection.RealTimeMonitor(_freqPlanActivitys, _roundStationInfos);
        //    realTimeMonitor.AfterMonitor += realTimeMonitor_AfterMonitor;
        //    grid_monitor.Children.Add(realTimeMonitor);
        //}
        //public void TestMethod(object data)
        //{
        //    System.Windows.Application.Current.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal,
        //    new DeleFunc(Func));
        //}

        /// <summary>
        /// 监测扫描后,执行计算干扰方法
        /// </summary>
        /// <param name="matchSignals">发送中的匹配信号</param>
        /// <param name="unMatchSignals">未发送的匹配信号</param>
        /// <param name="unknowSignals">未匹配上的信号</param>
        void realTimeMonitor_AfterMonitor(List <AnalysisResult> matchSignals, List <AnalysisResult> unMatchSignals, List <AnalysisResult> unknowSignals)
        {
            if (_isPause == false)
            {
                //_freqPlanActivitys
                //_roundStationInfos
                List <ActivityEquipmentInfo> equipList = new List <ActivityEquipmentInfo>();
                List <RoundStationInfo>      statList  = new List <RoundStationInfo>();
                //扫描每隔5秒返回一次
                //匹配的
                foreach (AnalysisResult analysisResult in matchSignals)
                {
                    ActivityEquipmentInfo equip = GetEquipment(analysisResult.FreqGuid);
                    if (equip != null)
                    {
                        equipList.Add(equip);
                    }
                    RoundStationInfo stat = GetRoundStation(analysisResult.FreqGuid);
                    if (stat != null)
                    {
                        statList.Add(stat);
                    }
                }
                //未匹配的计算
                foreach (AnalysisResult analysisResult in unMatchSignals)
                {
                    ActivityEquipmentInfo equip = GetEquipment(analysisResult.FreqGuid);
                    if (equip != null)
                    {
                        equipList.Add(equip);
                    }
                    RoundStationInfo stat = GetRoundStation(analysisResult.FreqGuid);
                    if (stat != null)
                    {
                        statList.Add(stat);
                    }
                }
                //未知信号
                //foreach (AnalysisResult analysisResult in unknowSignals)
                //{

                //}

                CalculateRealize(statList, equipList, unknowSignals);
            }
        }
        /// <summary>
        /// 手工录入
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btn_ManualRegister_Click(object sender, RoutedEventArgs e)
        {
            if (activityPlaceInfo != null && string.IsNullOrEmpty(activityPlaceInfo.Guid) == false)
            {
                ActivityEquipmentInfo equapply = new ActivityEquipmentInfo();
                equapply.PlaceGuid = activityPlaceInfo.Guid;
                EquipmentDetailDialog dialog = new EquipmentDetailDialog(equapply);
                dialog.WindowTitle             = "设备-手工登记";
                dialog.RefreshEquipmentSource += Dialog_RefreshEquipmentSource;

                dialog.ShowDialog(this);
            }
            else
            {
                MessageBox.Show("请选择设备使用地点!", "提示", MessageBoxButton.OK);
            }
        }
Example #18
0
        /// <summary>
        /// 获取设备信息(例子)
        /// </summary>
        /// <returns></returns>
        private ActivityEquipmentInfo getTempEquInfo()
        {
            ActivityEquipmentInfo equTemp = new ActivityEquipmentInfo();

            equTemp.GUID         = "";
            equTemp.EquNo        = "设备1";
            equTemp.EquModel     = "型号1";
            equTemp.EQUCount     = 2;
            equTemp.SendFreq     = 50.1234;
            equTemp.Band         = 60;
            equTemp.ORGGuid      = "orgguid";
            equTemp.RunningFrom  = DateTime.Now;
            equTemp.RunningTo    = DateTime.Now;
            equTemp.OrgInfo.Name = "西安市消防总队";
            equTemp.Remark       = "备注";
            return(equTemp);
        }
Example #19
0
        private void GetInterfereInfo()
        {
            ActivityEquipmentInfo equInfo = CopyEqu(this.EquInfo);

            if (this.SelectedFreq != null)
            {
                equInfo.AssignFreq = this.SelectedFreq.Freq;
            }
            else
            {
                MessageBox.Show("请先选定频率再进行干扰分析。", "提示", MessageBoxButton.OK);
                return;
            }
            if (equInfo.BusinessCode.Substring(0, 4) == "LY01")
            {
                MessageBox.Show("公众移动通信系统的设备不进行干扰计算。", "提示", MessageBoxButton.OK);
                chkIterfere.IsChecked    = false;
                gridInterfere.Visibility = Visibility.Collapsed;
                return;
            }

            //ComparableFreq CalcFreq = new ComparableFreq((double)EquInfo.AssignFreq, (double)EquInfo.Band, EquInfo.GUID);
            //ComparableFreq[] CalcFreqs = { CalcFreq };
            //ComparableFreq[] CompFreq = ConverterToComparableFreq(this.AroundStations);
            List <RoundStationInfo>      aroundStations = new List <RoundStationInfo>(this.AroundStations.ToArray());
            List <ActivityEquipmentInfo> equs           = new List <ActivityEquipmentInfo>();

            equs.Add(equInfo);
            //Transmitter[] Transmitters = ConverterToTransmitter(equs, aroundStations);
            //Receiver[] Receivers = ConverterToReceiver(equs, aroundStations);
            try
            {
                AnalysisType type = AnalysisType.SameFreq | AnalysisType.ADJFreq | AnalysisType.IM;
                InterferenceAnalysisResult InterfResult = InterfAnalysis.Calculator(equs, aroundStations, type);
                //InterferenceAnalysisResult InterfAnalysisResult = InterfAnalysis.Calculator(type, CalcFreqs, CompFreq,calctransmitters,calcreceivers, Transmitters, Receivers);
                gridInterfereResult.DataContext = InterfResult;
                int total = InterfResult.Total;
            }
            catch (Exception ex)
            {
                MessageBox.Show("干扰分析出错,请检查设备频率。", "提示", MessageBoxButton.OK);
                return;
            }
        }
Example #20
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);
        }
        /// <summary>
        /// 创建ActivityEquipmentInfo对象
        /// </summary>
        /// <param name="dt"></param>
        /// <param name="orginfo"></param>
        /// <param name="businesscode"></param>
        /// <returns></returns>
        private List <ActivityEquipmentInfo> CreateActivityEquipments(DataTable dt, ActivityORGInfo orginfo, string businesscode)
        {
            List <ActivityEquipmentInfo> equs = new List <ActivityEquipmentInfo>();

            if (dt != null && dt.Rows.Count > 0)
            {
                StringBuilder errorMsg = new StringBuilder();

                #region

                for (int i = 1; i < dt.Rows.Count; i++)
                {
                    DataRow dr = dt.Rows[i];
                    if (string.IsNullOrEmpty(dr[0].ToString()))
                    {
                        continue;
                    }

                    ActivityEquipmentInfo equ = new ActivityEquipmentInfo();
                    equ.GUID         = System.Guid.NewGuid().ToString();
                    equ.ActivityGuid = Client.RiasPortal.ModuleContainer.Activity.Guid;
                    equ.PlaceGuid    = activityPlaceInfo.Guid;;
                    equ.ORGGuid      = orginfo.Guid;
                    equ.Origin       = 3;
                    IdentifiableData <string> org = new IdentifiableData <string>();
                    org.Guid         = orginfo.Guid;
                    org.Name         = orginfo.Name;
                    equ.ORG          = org;
                    equ.Name         = dr[0].ToString();
                    equ.BusinessCode = businesscode;
                    equ.EQUCount     = Int32.Parse(dr[1].ToString()); //设备数量
                    equ.EquModel     = dr[2].ToString();              //设备型号
                    equ.EquNo        = dr[3].ToString();              //设备编号
                    equ.Remark       = dr[4].ToString();              //备注
                    equ.IsStation    = false;
                    equ.StationName  = string.Empty;
                    equ.IsMobile     = false;

                    equ.SendFreq      = string.IsNullOrEmpty(dr[5].ToString()) ? double.NaN : double.Parse(dr[5].ToString());
                    equ.ReceiveFreq   = string.IsNullOrEmpty(dr[6].ToString()) ? double.NaN : double.Parse(dr[6].ToString());   //接收频率
                    equ.IsTunAble     = dr[7].ToString() == "是" ? true : false;                                                 //频率可调
                    equ.SendFreqStart = string.IsNullOrEmpty(dr[8].ToString()) ? double.NaN : double.Parse(dr[8].ToString());   //发射频率范围起始
                    equ.SendFreqEnd   = string.IsNullOrEmpty(dr[9].ToString()) ? double.NaN : double.Parse(dr[9].ToString());   //发射频率范围终止
                    equ.Band          = string.IsNullOrEmpty(dr[10].ToString()) ? double.NaN : double.Parse(dr[10].ToString()); //带宽
                    equ.MaxPower      = string.IsNullOrEmpty(dr[11].ToString()) ? double.NaN : double.Parse(dr[11].ToString()); //发射功率

                    EMCS.Types.EMCModulationEnum modulat;
                    if (Enum.TryParse(dr[12].ToString(), out modulat))
                    {
                        equ.ModulateMode = modulat;
                    }

                    //发射天线
                    //equ.SendPara.Ant.Guid = System.Guid.NewGuid().ToString();

                    //equ.SendPara.Ant.AntType = dr[13].ToString();//天线类型
                    equ.SendAntModel = dr[14].ToString();                                                                      //天线型号
                    equ.SendAntGain  = string.IsNullOrEmpty(dr[15].ToString()) ? double.NaN : double.Parse(dr[15].ToString()); //天线增益
                    EMCS.Types.EMCPolarisationEnum sendpolar;
                    if (Enum.TryParse(dr[16].ToString(), out sendpolar))                                                       //极化方式
                    {
                        equ.SendAntPolar = sendpolar;
                    }
                    equ.SendAntHeight   = double.Parse(dr[17].ToString()); //天线高度
                    equ.SendAntFeedLoss = double.Parse(dr[18].ToString()); //馈线损耗


                    //接收
                    equ.RecvFreqStart = string.IsNullOrEmpty(dr[19].ToString()) ? double.NaN : double.Parse(dr[19].ToString()); //接收频率范围起始
                    equ.RecvFreqEnd   = string.IsNullOrEmpty(dr[20].ToString()) ? double.NaN : double.Parse(dr[20].ToString()); //接收频率范围终止
                    //equ.RecivePara.Ant.Guid = System.Guid.NewGuid().ToString();
                    //equ.RecivePara.Ant.AntType = dr[21].ToString();//天线类型
                    equ.RecvAntModel = dr[22].ToString();                                                                      //天线型号
                    equ.RecvAntGain  = string.IsNullOrEmpty(dr[23].ToString()) ? double.NaN : double.Parse(dr[23].ToString()); //天线增益
                    EMCS.Types.EMCPolarisationEnum recpolar;
                    if (Enum.TryParse(dr[24].ToString(), out recpolar))                                                        //极化方式
                    {
                        equ.RecvAntPolar = recpolar;
                    }
                    equ.RecvAntHeight   = string.IsNullOrEmpty(dr[25].ToString()) ? double.NaN : double.Parse(dr[25].ToString()); //天线高度
                    equ.RecvAntFeedLoss = string.IsNullOrEmpty(dr[26].ToString()) ? double.NaN : double.Parse(dr[26].ToString()); //馈线损耗

                    equs.Add(equ);
                }

                #endregion
            }
            return(equs);
        }
Example #22
0
        private void ShowDetail(DataSet ds)
        {
            if (ds == null)
            {
                MessageBox.Show("获取不到台站概要信息,请确认数据源是否改变!");
                return;
            }
            else
            {
                #region 弹出对话框
                if (ds.Tables.Count > 0)
                {
                    //申请表
                    //ApplyControl = new ApplyInfoControl(ds);
                    //this.lg_Apply.Children.Add(ApplyControl);

                    ActivityORGInfo orginfo = new ActivityORGInfo();
                    #region  单位信息

                    orginfo.Activity_Guid = Client.RiasPortal.ModuleContainer.Activity.Guid;
                    if (ds.Tables["RSBT_ORG"] != null && ds.Tables["RSBT_ORG"].Rows.Count > 0)
                    {
                        DataTable orgTable = ds.Tables["RSBT_ORG"];
                        if (orgTable.Columns.Contains("ORG_NAME"))
                        {
                            orginfo.Name = orgTable.Rows[0]["ORG_NAME"].ToString();//单位名称
                        }
                        else
                        {
                            orginfo.Name = "";
                        }
                        //if (orgTable.Columns.Contains("ORG_CODE"))
                        //{
                        //    this.tb_UnitCode.Text = orgTable.Rows[0]["ORG_CODE"].ToString();//组织机构代码
                        //}
                        //else
                        //{
                        //    this.tb_UnitCode.Text = "";
                        //}
                        if (orgTable.Columns.Contains("ORG_ADDR"))
                        {
                            orginfo.Address = orgTable.Rows[0]["ORG_ADDR"].ToString();//单位地址
                        }
                        if (orgTable.Columns.Contains("ORG_LINK_PERSON"))
                        {
                            orginfo.Contact = orgTable.Rows[0]["ORG_LINK_PERSON"].ToString();//单位联系人
                        }

                        if (orgTable.Columns.Contains("ORG_PHONE"))
                        {
                            orginfo.Phone = orgTable.Rows[0]["ORG_PHONE"].ToString();//联系电话
                        }
                    }


                    #endregion

                    List <CO_IA.UI.StationManage.EquInfo> equList = new List <CO_IA.UI.StationManage.EquInfo>();

                    List <CO_IA.UI.StationManage.FreqInfo> freqList = new List <CO_IA.UI.StationManage.FreqInfo>();
                    string STAT_NAME = string.Empty;
                    string NET_TS    = string.Empty;


                    #region  详细信息

                    List <ActivityEquipmentInfo> equipList = new List <ActivityEquipmentInfo>();


                    //网表
                    if (ds.Tables["RSBT_NET"] != null && ds.Tables["RSBT_NET"].Rows.Count > 0)
                    {
                        if (ds.Tables["RSBT_NET"].Columns.Contains("NET_TS"))
                        {
                            NET_TS = ds.Tables["RSBT_NET"].Rows[0]["NET_TS"].ToString();//技术体制
                        }
                    }



                    //台站资料表
                    if (ds.Tables["RSBT_STATION"] != null && ds.Tables["RSBT_STATION"].Rows.Count > 0)
                    {
                        if (ds.Tables["RSBT_STATION"].Columns.Contains("STAT_NAME"))
                        {
                            STAT_NAME = ds.Tables["RSBT_STATION"].Rows[0]["STAT_NAME"].ToString();//台站名称
                        }
                    }

                    //设备表
                    if (ds.Tables["RSBT_EQU"] != null && ds.Tables["RSBT_EQU"].Rows.Count > 0)
                    {
                        //EquControl = new EquInfoControl(ds.Tables["RSBT_EQU"], ds.Tables["RSBT_EQU_T"]);
                        //this.lg_Equinfo.Children.Add(EquControl);

                        DataTable dataTable = ds.Tables["RSBT_EQU"];
                        DataTable eDT       = ds.Tables["RSBT_EQU_T"];

                        #region  设备表

                        foreach (DataRow dr in dataTable.Rows)
                        {
                            try
                            {
                                CO_IA.UI.StationManage.EquInfo equInfo = new CO_IA.UI.StationManage.EquInfo();
                                if (dataTable.Columns.Contains("EQU_MODEL"))
                                {
                                    equInfo.EQU_MODEL = dr["EQU_MODEL"].ToString();
                                }
                                else
                                {
                                    equInfo.EQU_MODEL = "";
                                }
                                if (dataTable.Columns.Contains("EQU_AUTH"))
                                {
                                    equInfo.EQU_AUTH = dr["EQU_AUTH"].ToString();
                                }
                                else
                                {
                                    equInfo.EQU_AUTH = "";
                                }
                                if (dataTable.Columns.Contains("EQU_CODE"))
                                {
                                    equInfo.EQU_CODE = dr["EQU_CODE"].ToString();
                                }
                                else
                                {
                                    equInfo.EQU_CODE = "";
                                }
                                if (dataTable.Columns.Contains("EQU_MENU"))
                                {
                                    equInfo.EQU_MENU = dr["EQU_MENU"].ToString();
                                }
                                else
                                {
                                    equInfo.EQU_MENU = "";
                                }
                                if (dataTable.Columns.Contains("EQU_POW"))
                                {
                                    equInfo.EQU_POW = dr["EQU_POW"].ToString();
                                }
                                else
                                {
                                    equInfo.EQU_POW = "";
                                }

                                try
                                {
                                    if (string.IsNullOrEmpty(dr["EQU_POW"].ToString()) == true && dr["GUID"].ToString() != null)
                                    {
                                        foreach (DataRow edr in eDT.Rows)
                                        {
                                            if (edr["GUID"] == dr["GUID"])
                                            {
                                                if (dataTable.Columns.Contains("ET_EQU_SENU"))
                                                {
                                                    equInfo.ET_EQU_SENU = dr["ET_EQU_SENU"].ToString();
                                                }
                                                else
                                                {
                                                    equInfo.ET_EQU_SENU = "";
                                                }
                                                if (dataTable.Columns.Contains("ET_EQU_SEN"))
                                                {
                                                    equInfo.ET_EQU_SEN = dr["ET_EQU_SEN"].ToString();
                                                }
                                                else
                                                {
                                                    equInfo.ET_EQU_SEN = "";
                                                }

                                                break;
                                            }
                                        }
                                    }
                                }
                                catch
                                {
                                }
                                equList.Add(equInfo);
                            }
                            catch
                            {
                            }
                        }

                        #endregion
                    }

                    //频率表
                    if (ds.Tables["RSBT_FREQ"] != null && ds.Tables["RSBT_FREQ"].Rows.Count > 0)
                    {
                        //FreqControl = new FreqInfoControl(ds.Tables["RSBT_FREQ"]);
                        //this.lg_Freq.Children.Add(FreqControl);

                        DataTable dataTable = ds.Tables["RSBT_FREQ"];
                        #region 频率表
                        foreach (DataRow dr in dataTable.Rows)
                        {
                            try
                            {
                                CO_IA.UI.StationManage.FreqInfo freqInfo = new CO_IA.UI.StationManage.FreqInfo();


                                //freqInfo.FREQ_EFB = dr["FREQ_EFB"];
                                //freqInfo.FREQ_EFE = dr["FREQ_EFE"];
                                //freqInfo.FREQ_RFB = dr["FREQ_RFB"];
                                //freqInfo.FREQ_RFE = dr["FREQ_RFE"];
                                //freqInfo.FREQ_UC = dr["FREQ_UC"];

                                if (dataTable.Columns.Contains("GUID"))
                                {
                                    freqInfo.GUID = dr["GUID"].ToString();
                                }
                                else
                                {
                                    freqInfo.GUID = Guid.NewGuid().ToString();
                                }

                                if (dataTable.Columns.Contains("FREQ_TYPE"))
                                {
                                    freqInfo.FREQ_TYPE = dr["FREQ_TYPE"].ToString();
                                }
                                else
                                {
                                    freqInfo.FREQ_TYPE = "";
                                }
                                double dbUC = 0;
                                if (dataTable.Columns.Contains("FREQ_UC"))
                                {
                                    if (dr["FREQ_UC"].ToString() != null && dr["FREQ_UC"].ToString() != string.Empty && double.TryParse(dr["FREQ_UC"].ToString(), out dbUC) == true)
                                    {
                                        freqInfo.FREQ_UC = dbUC.ToString();

                                        //if (dbUC >= 3)
                                        //{
                                        //    freqInfo.FREQ_UC = dbUC + " M";
                                        //}
                                        //else
                                        //{
                                        //    freqInfo.FREQ_UC = dbUC * 1000 + " kHz";

                                        //}
                                    }
                                    else
                                    {
                                        freqInfo.FREQ_UC = dr["FREQ_UC"].ToString();
                                    }
                                }
                                else
                                {
                                    freqInfo.FREQ_UC = "";
                                }


                                double dbLC = 0;
                                if (dataTable.Columns.Contains("FREQ_LC"))
                                {
                                    if (dr["FREQ_LC"].ToString() != null && dr["FREQ_LC"].ToString() != string.Empty && double.TryParse(dr["FREQ_LC"].ToString(), out dbLC) == true)
                                    {
                                        freqInfo.FREQ_LC = dbLC.ToString();

                                        //if (dbUC >= 3)
                                        //{
                                        //    freqInfo.FREQ_UC = dbUC + " M";
                                        //}
                                        //else
                                        //{
                                        //    freqInfo.FREQ_UC = dbUC * 1000 + " kHz";

                                        //}
                                    }
                                    else
                                    {
                                        freqInfo.FREQ_LC = dr["FREQ_LC"].ToString();
                                    }
                                }
                                else
                                {
                                    freqInfo.FREQ_LC = "";
                                }



                                double dbEFB = 0;
                                if (dataTable.Columns.Contains("FREQ_EFB"))
                                {
                                    if (dr["FREQ_EFB"].ToString() != null && dr["FREQ_EFB"].ToString() != string.Empty && double.TryParse(dr["FREQ_EFB"].ToString(), out dbEFB) == true)
                                    {
                                        freqInfo.FREQ_EFB = dbEFB.ToString();
                                        //if (dbEFB >= 3)
                                        //{
                                        //    freqInfo.FREQ_EFB = dbEFB + " M";
                                        //}
                                        //else
                                        //{
                                        //    freqInfo.FREQ_EFB = dbEFB * 1000 + " kHz";

                                        //}
                                    }
                                    else
                                    {
                                        freqInfo.FREQ_EFB = dr["FREQ_EFB"].ToString();
                                    }
                                }
                                else
                                {
                                    freqInfo.FREQ_EFB = "";
                                }



                                double dbEFE = 0;
                                if (dataTable.Columns.Contains("FREQ_EFE"))
                                {
                                    if (dr["FREQ_EFE"].ToString() != null && dr["FREQ_EFE"].ToString() != string.Empty && double.TryParse(dr["FREQ_EFE"].ToString(), out dbEFE) == true)
                                    {
                                        freqInfo.FREQ_EFE = dbEFE.ToString();
                                        //if (dbEFE >= 3)
                                        //{
                                        //    freqInfo.FREQ_EFE = dbEFE + " M";
                                        //}
                                        //else
                                        //{
                                        //    freqInfo.FREQ_EFE = dbEFE * 1000 + " kHz";

                                        //}
                                    }
                                    else
                                    {
                                        freqInfo.FREQ_EFE = dr["FREQ_EFE"].ToString();
                                    }
                                }
                                else
                                {
                                    freqInfo.FREQ_EFE = "";
                                }

                                double dbRFB = 0;
                                if (dataTable.Columns.Contains("FREQ_RFB"))
                                {
                                    if (dr["FREQ_RFB"].ToString() != null && dr["FREQ_RFB"].ToString() != string.Empty && double.TryParse(dr["FREQ_RFB"].ToString(), out dbRFB) == true)
                                    {
                                        freqInfo.FREQ_RFB = dbRFB.ToString();
                                        //if (dbRFB >= 3)
                                        //{
                                        //    freqInfo.FREQ_RFB = dbRFB + " M";
                                        //}
                                        //else
                                        //{
                                        //    freqInfo.FREQ_RFB = dbRFB * 1000 + " kHz";

                                        //}
                                    }
                                    else
                                    {
                                        freqInfo.FREQ_RFB = dr["FREQ_RFB"].ToString();
                                    }
                                }
                                else
                                {
                                    freqInfo.FREQ_RFB = "";
                                }

                                double dbRFE = 0;
                                if (dataTable.Columns.Contains("FREQ_RFE"))
                                {
                                    if (dr["FREQ_RFE"].ToString() != null && dr["FREQ_RFE"].ToString() != string.Empty && double.TryParse(dr["FREQ_RFE"].ToString(), out dbRFE) == true)
                                    {
                                        freqInfo.FREQ_RFE = dbRFE.ToString();
                                        //if (dbRFE >= 3)
                                        //{
                                        //    freqInfo.FREQ_RFE = dbRFE + " M";
                                        //}
                                        //else
                                        //{
                                        //    freqInfo.FREQ_RFE = dbRFE * 1000 + " kHz";

                                        //}
                                    }
                                    else
                                    {
                                        freqInfo.FREQ_RFE = dr["FREQ_RFE"].ToString();
                                    }
                                }
                                else
                                {
                                    freqInfo.FREQ_RFE = "";
                                }
                                //freqInfo.FREQ_E_BAND = dr["FREQ_E_BAND"];
                                //freqInfo.FREQ_R_BAND = dr["FREQ_R_BAND"];

                                double db_E_BAND = 0;
                                if (dataTable.Columns.Contains("FREQ_E_BAND"))
                                {
                                    if (dr["FREQ_E_BAND"].ToString() != null && dr["FREQ_E_BAND"].ToString() != string.Empty && double.TryParse(dr["FREQ_E_BAND"].ToString(), out db_E_BAND) == true)
                                    {
                                        freqInfo.FREQ_E_BAND = db_E_BAND.ToString();

                                        //if (db_E_BAND >= 3)
                                        //{
                                        //    freqInfo.FREQ_E_BAND = db_E_BAND + " M";
                                        //}
                                        //else
                                        //{
                                        //    freqInfo.FREQ_E_BAND = db_E_BAND * 1000 + " kHz";

                                        //}
                                    }
                                    else
                                    {
                                        freqInfo.FREQ_E_BAND = dr["FREQ_E_BAND"].ToString();
                                    }
                                }
                                else
                                {
                                    freqInfo.FREQ_E_BAND = "";
                                }


                                double db_R_BAND = 0;
                                if (dataTable.Columns.Contains("FREQ_R_BAND"))
                                {
                                    if (dr["FREQ_R_BAND"].ToString() != null && dr["FREQ_R_BAND"].ToString() != string.Empty && double.TryParse(dr["FREQ_R_BAND"].ToString(), out db_R_BAND) == true)
                                    {
                                        freqInfo.FREQ_R_BAND = db_R_BAND.ToString();


                                        //if (db_R_BAND >= 3)
                                        //{
                                        //    freqInfo.FREQ_R_BAND = db_R_BAND + " M";
                                        //}
                                        //else
                                        //{
                                        //    freqInfo.FREQ_R_BAND = db_R_BAND * 1000 + " kHz";

                                        //}
                                    }
                                    else
                                    {
                                        freqInfo.FREQ_R_BAND = dr["FREQ_R_BAND"].ToString();
                                    }
                                }
                                else
                                {
                                    freqInfo.FREQ_R_BAND = "";
                                }
                                //freqInfo.FT_FREQ_TimeB = dr["FT_FREQ_TimeB"];
                                //freqInfo.FT_FREQ_TimeE = dr["FT_FREQ_TimeE"];

                                //freqInfo.FT_FREQ_INFO_Type = dr["FT_FREQ_INFO_Type"];
                                if (dataTable.Columns.Contains("FREQ_MOD"))
                                {
                                    freqInfo.FREQ_MOD = dr["FREQ_MOD"].ToString();
                                }
                                else
                                {
                                    freqInfo.FREQ_MOD = "";
                                }
                                //freqInfo.FT_FREQ_HCL = dr["FT_FREQ_HCL"];

                                #region  频率冗余表


                                if (dr["GUID"].ToString() != null && ds.Tables["RSBT_FREQ_T"] != null && ds.Tables["RSBT_FREQ_T"].Rows.Count > 0)
                                {
                                    DataTable eDT = ds.Tables["RSBT_FREQ_T"];

                                    foreach (DataRow edr in eDT.Rows)
                                    {
                                        if (edr["GUID"] == dr["GUID"])
                                        {
                                            if (dataTable.Columns.Contains("FT_FREQ_POW_MAX"))
                                            {
                                                freqInfo.FT_FREQ_POW_MAX = dr["FT_FREQ_POW_MAX"].ToString();
                                            }
                                            else
                                            {
                                                freqInfo.FT_FREQ_POW_MAX = "";
                                            }

                                            break;
                                        }
                                    }
                                    #endregion
                                }
                                freqList.Add(freqInfo);
                                //break;
                            }
                            catch
                            {
                            }
                        }
                        #endregion
                    }

                    #endregion 细节

                    #region  保存组织信息
                    if (freqList.Count == 0)
                    {
                        return;
                    }


                    ActivityORGInfo tempOrginfo = PT_BS_Service.Client.Framework.BeOperationInvoker.Invoke <I_CO_IA.FreqPlan.I_CO_IA_FreqPlan, ActivityORGInfo>(channel =>
                    {
                        return(channel.GetORGInfoByActivityORGInfo(orginfo));
                    });


                    if (tempOrginfo != null && string.IsNullOrEmpty(tempOrginfo.Activity_Guid) == false)
                    {
                        orginfo = tempOrginfo;
                    }

                    PT_BS_Service.Client.Framework.BeOperationInvoker.Invoke <I_CO_IA.FreqPlan.I_CO_IA_FreqPlan>(channel =>
                    {
                        channel.SaveORGInfo(orginfo);
                    });
                    #endregion


                    foreach (CO_IA.UI.StationManage.FreqInfo freqInfo in freqList)
                    {
                        ActivityEquipmentInfo equipinfo = new ActivityEquipmentInfo();
                        equipinfo.GUID    = freqInfo.GUID;
                        equipinfo.OrgInfo = orginfo;
                        equipinfo.ORGGuid = orginfo.Guid;
                        //equipinfo.ORG.Guid = orginfo.Guid;
                        //equipinfo.ORG.Value = orginfo.Name;
                        equipinfo.ActivityGuid = orginfo.Activity_Guid;
                        equipinfo.PlaceGuid    = activityPlaceInfo.Guid;
                        equipinfo.StationName  = STAT_NAME;
                        equipinfo.EQUCount     = equList.Count;
                        equipinfo.IsStation    = true;
                        equipinfo.BusinessCode = NET_TS;
                        equipinfo.Origin       = 1;


                        if (equList.Count > 0)
                        {
                            CO_IA.UI.StationManage.EquInfo tempInfo = equList[0];
                            equipinfo.IsMobile        = false;
                            equipinfo.Name            = tempInfo.EQU_MODEL;
                            equipinfo.EquModel        = tempInfo.EQU_MODEL;
                            equipinfo.EquNo           = tempInfo.EQU_CODE;
                            equipinfo.Sensitivity     = tempInfo.ET_EQU_SEN.GetNullableDouble();
                            equipinfo.SensitivityUnit = tempInfo.ET_EQU_SEN.GetNullableInt();
                        }

                        //equipinfo.ADJChannelInh = 1;

                        equipinfo.RecvFreqEnd   = freqInfo.FREQ_RFB.GetNullableDouble();
                        equipinfo.RecvFreqStart = freqInfo.FREQ_RFE.GetNullableDouble();
                        equipinfo.SendFreqEnd   = freqInfo.FREQ_EFB.GetNullableDouble();
                        equipinfo.SendFreqStart = freqInfo.FREQ_EFB.GetNullableDouble();
                        equipinfo.MaxPower      = freqInfo.FT_FREQ_POW_MAX.GetNullableDouble();

                        equipinfo.ReceiveFreq = freqInfo.FREQ_UC.GetNullableDouble();  //接收频率
                        equipinfo.SendFreq    = freqInfo.FREQ_LC.GetNullableDouble();  //发射频率

                        //equipinfo.Band = 1;
                        //equipinfo.ChannelBand = 1;

                        //equipinfo.SignalNoise = 1;
                        //equipinfo.Remark = "1";
                        //equipinfo.RunningFrom = DateTime.Now;
                        //equipinfo.RunningTo = DateTime.Now;

                        equipinfo.IsTunAble = true;
                        //equipinfo.Leakage = 1;


                        try
                        {
                            EMCS.Types.EMCModulationEnum ModulateModeEnum = (EMCS.Types.EMCModulationEnum)freqInfo.FREQ_MOD.GetNullableInt();

                            if (Enum.IsDefined(typeof(EMCS.Types.EMCModulationEnum), ModulateModeEnum))
                            {
                                equipinfo.ModulateMode = ModulateModeEnum;
                            }
                        }
                        catch
                        { }
                        //天线表
                        if (ds.Tables["RSBT_ANTFEED"] != null && ds.Tables["RSBT_ANTFEED"].Rows.Count > 0)
                        {
                            DataTable dataTable = ds.Tables["RSBT_ANTFEED"];
                            #region  天线表

                            try
                            {
                                if (dataTable.Columns.Contains("ANT_MODEL"))
                                {
                                    equipinfo.SendAntModel = equipinfo.RecvAntModel = dataTable.Rows[0]["ANT_MODEL"].ToString();
                                }


                                if (dataTable.Columns.Contains("ANT_GAIN"))
                                {
                                    equipinfo.SendAntGain = equipinfo.RecvAntGain = dataTable.Rows[0]["ANT_GAIN"].ToString().GetNullableDouble();
                                }

                                if (dataTable.Columns.Contains("FEED_LENGTH"))
                                {
                                    equipinfo.RecvAntFeedLength = equipinfo.SendAntFeedLength = dataTable.Rows[0]["FEED_LENGTH"].ToString().GetNullableDouble();    //馈线长度
                                }
                                if (dataTable.Columns.Contains("FEED_LOSE"))
                                {
                                    equipinfo.RecvAntFeedLoss = equipinfo.SendAntFeedLoss = dataTable.Rows[0]["FEED_LOSE"].ToString().GetNullableDouble();    //馈线系统总损耗
                                }


                                if (dataTable.Columns.Contains("ANT_HIGHT"))
                                {
                                    equipinfo.RecvAntHeight = equipinfo.SendAntHeight = dataTable.Rows[0]["ANT_HIGHT"].ToString().GetNullableDouble();    //馈线系统总损耗
                                }
                            }
                            catch
                            { }

                            #endregion
                        }
                        //天线表冗余表
                        if (ds.Tables["RSBT_ANTFEED_T"] != null && ds.Tables["RSBT_ANTFEED_T"].Rows.Count > 0)
                        {
                            DataTable dataTable = ds.Tables["RSBT_ANTFEED_T"];
                            #region  天线冗余表

                            try
                            {
                                if (dataTable.Columns.Contains("AT_ANT_UPANG"))
                                {
                                    equipinfo.RecvAntElevation = equipinfo.SendAntElevation = dataTable.Rows[0]["AT_ANT_UPANG"].ToString().GetNullableDouble();
                                }


                                if (dataTable.Columns.Contains("ANT_POLE"))
                                {
                                    //ANT_POLE = dataTable.Rows[0]["ANT_POLE"].ToString();//极化方式

                                    try
                                    {
                                        EMCS.Types.EMCPolarisationEnum EMCPolarisationEnum = (EMCS.Types.EMCPolarisationEnum)freqInfo.FREQ_MOD.GetIntOrDefault();

                                        if (Enum.IsDefined(typeof(EMCS.Types.EMCPolarisationEnum), EMCPolarisationEnum))
                                        {
                                            equipinfo.RecvAntPolar = equipinfo.SendAntPolar = EMCPolarisationEnum;
                                        }
                                    }
                                    catch
                                    { }
                                }


                                if (dataTable.Columns.Contains("ANT_ANGLE"))
                                {
                                    equipinfo.RecvAntAzimuth = equipinfo.SendAntAzimuth = dataTable.Rows[0]["ANT_ANGLE"].ToString().GetNullableDouble();    //最大辐射方位角
                                }

                                if (dataTable.Columns.Contains("FEED_LENGTH"))
                                {
                                    equipinfo.RecvAntFeedLength = equipinfo.SendAntFeedLength = dataTable.Rows[0]["FEED_LENGTH"].ToString().GetNullableDouble();   //馈线长度
                                }
                                if (dataTable.Columns.Contains("FEED_LOSE"))
                                {
                                    equipinfo.RecvAntFeedLoss = equipinfo.SendAntFeedLoss = dataTable.Rows[0]["FEED_LOSE"].ToString().GetNullableDouble();    //馈线系统总损耗
                                }


                                if (dataTable.Columns.Contains("ANT_HIGHT"))
                                {
                                    equipinfo.RecvAntHeight = equipinfo.SendAntHeight = dataTable.Rows[0]["ANT_HIGHT"].ToString().GetNullableDouble();    //馈线系统总损耗
                                }
                            }
                            catch
                            { }

                            #endregion
                        }


                        equipList.Add(equipinfo);
                    }



                    PT_BS_Service.Client.Framework.BeOperationInvoker.Invoke <I_CO_IA.FreqPlan.I_CO_IA_FreqPlan, bool>(channel =>
                    {
                        return(channel.SaveEquipmentList(equipList));
                    });
                }
                #endregion
            }
        }
 private void EquipmentDetailControl_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
 {
     OriginalEquipment    = e.NewValue as ActivityEquipmentInfo;
     CurrentEquipmentInfo = SettingHelper.Clone <ActivityEquipmentInfo>(OriginalEquipment);
 }
        /// <summary>
        /// 转换相关设备类
        /// </summary>
        /// <param name="result"></param>
        /// <returns></returns>
        private ActivityEquipmentInfo ConvertToActivityEquipmentInfo(EquipmentInfo tempInfo)
        {
            #region  保存组织信息
            ORGInfo orginfo = new ORGInfo();
            //PT_BS_Service.Client.Framework.BeOperationInvoker.Invoke<I_CO_IA.Setting.I_CO_IA_Setting>(channel =>
            //{
            //    orginfo = channel.GetORGInfoByGuid(tempInfo.ORG.Guid);
            //});

            ActivityORGInfo activityOrginfo = ConvertToActivityORGInfo(orginfo);


            ActivityORGInfo tempOrginfo = PT_BS_Service.Client.Framework.BeOperationInvoker.Invoke <I_CO_IA.FreqPlan.I_CO_IA_FreqPlan, ActivityORGInfo>(channel =>
            {
                return(channel.GetORGInfoByActivityORGInfo(activityOrginfo));
            });


            if (tempOrginfo != null && string.IsNullOrEmpty(tempOrginfo.Activity_Guid) == false)
            {
                activityOrginfo = tempOrginfo;
            }

            bool result = PT_BS_Service.Client.Framework.BeOperationInvoker.Invoke <I_CO_IA.FreqPlan.I_CO_IA_FreqPlan, bool>(channel =>
            {
                return(channel.SaveORGInfo(activityOrginfo));
            });
            #endregion


            ActivityEquipmentInfo aeuip = new ActivityEquipmentInfo();
            aeuip.GUID         = CO_IA.Client.Utility.NewGuid();
            aeuip.ActivityGuid = Client.RiasPortal.ModuleContainer.Activity.Guid;
            aeuip.PlaceGuid    = activityPlaceInfo.Guid;
            aeuip.ORGGuid      = tempInfo.ORG.Guid;


            aeuip.ADJChannelInh = tempInfo.RecivePara.ADJChannelInh;
            //aeuip.AssignFreq = tempInfo.RecivePara.Ant.AssignFreq;
            aeuip.Band        = tempInfo.SendPara.Band;
            aeuip.ChannelBand = tempInfo.SendPara.ChannelBand;
            aeuip.CoChnPro    = tempInfo.RecivePara.CoChnPro;
            aeuip.EQUCount    = tempInfo.EQUCount;
            aeuip.EquModel    = tempInfo.EquModel;
            aeuip.EquNo       = tempInfo.EquNo;
            //aeuip.IsChecked = tempInfo.RecivePara.ADJChannelInh;
            aeuip.IsMobile  = tempInfo.IsMobile;
            aeuip.IsStation = tempInfo.IsStation;
            aeuip.IsTunAble = tempInfo.SendPara.IsTunAble;
            aeuip.Leakage   = tempInfo.RecivePara.ADJChannelInh;
            aeuip.MaxPower  = tempInfo.SendPara.MaxPower;

#warning 需要处理调制方式为空情况
            if (tempInfo.SendPara.ModulateMode.HasValue)
            {
                aeuip.ModulateMode = tempInfo.SendPara.ModulateMode.Value;
            }
            aeuip.Name              = tempInfo.Name;
            aeuip.Origin            = 1;//设备库录入
            aeuip.ReceiveFreq       = tempInfo.RecivePara.ReceiveFreq;
            aeuip.RecvAntAzimuth    = tempInfo.RecivePara.Ant.AntAzimuth;
            aeuip.RecvAntElevation  = tempInfo.RecivePara.Ant.AntElevation;
            aeuip.RecvAntFeedLength = tempInfo.RecivePara.Ant.FeedLength;
            aeuip.RecvAntFeedLoss   = tempInfo.RecivePara.Ant.FeedLose;
            aeuip.RecvAntGain       = tempInfo.RecivePara.Ant.AntGain;
            aeuip.RecvAntHeight     = tempInfo.RecivePara.Ant.AntHight;
            aeuip.RecvAntModel      = tempInfo.RecivePara.Ant.AntModel;
            aeuip.RecvAntPolar      = tempInfo.RecivePara.Ant.AntPolar;
            aeuip.RecvFreqEnd       = tempInfo.RecivePara.FreqEnd;
            aeuip.RecvFreqStart     = tempInfo.RecivePara.FreqStart;
            aeuip.Remark            = tempInfo.Remark;
            //aeuip.RunningFrom = tempInfo.RecivePara.ADJChannelInh;
            //aeuip.RunningTo = tempInfo.RecivePara.ADJChannelInh;
            aeuip.SendAntAzimuth    = tempInfo.SendPara.Ant.AntAzimuth;
            aeuip.SendAntElevation  = tempInfo.SendPara.Ant.AntElevation;
            aeuip.SendAntFeedLength = tempInfo.SendPara.Ant.FeedLength;
            aeuip.SendAntFeedLoss   = tempInfo.SendPara.Ant.FeedLose;
            aeuip.SendAntGain       = tempInfo.SendPara.Ant.AntGain;
            aeuip.SendAntHeight     = tempInfo.SendPara.Ant.AntHight;
            aeuip.SendAntModel      = tempInfo.SendPara.Ant.AntModel;
            aeuip.SendAntPolar      = tempInfo.SendPara.Ant.AntPolar;
            aeuip.SendFreq          = tempInfo.SendPara.SendFreq;
            aeuip.SendFreqEnd       = tempInfo.SendPara.FreqEnd;
            aeuip.SendFreqStart     = tempInfo.SendPara.FreqStart;
            aeuip.Sensitivity       = tempInfo.RecivePara.Sensitivity.GetNullableDouble();
            aeuip.SensitivityUnit   = tempInfo.RecivePara.SensitivityUnit.GetNullableInt();
            aeuip.SignalNoise       = tempInfo.RecivePara.SignalNoise;
            aeuip.StationName       = tempInfo.StationName;
            aeuip.BusinessCode      = tempInfo.StClassCode;


            return(aeuip);
        }
        /// <summary>
        /// 获取同频干扰结果
        /// </summary>
        /// <param name="result"></param>
        /// <returns></returns>
        private List <InterfereResult> GetSameFreqInterfResult(SameFreqCompareResult[] result)
        {
            List <InterfereResult> interfresultlst = new List <InterfereResult>();;

            foreach (SameFreqCompareResult item in result)
            {
                ActivityEquipmentInfo equ = new ActivityEquipmentInfo();
                equ = _equipments.FirstOrDefault(r => r.GUID == item.Keys[0].FreqID);

                bool isnewInterfere = true; //新的干扰,不存在dicInterfereResult字典中
                if (this.dicInterfereResult.TryGetValue(equ, out interfresultlst))
                {
                    isnewInterfere = false;
                }
                else
                {
                    isnewInterfere  = true;
                    interfresultlst = new List <InterfereResult>();
                }
                InterfereResult sameinterfInfo = new InterfereResult();
                sameinterfInfo.InterfType   = InterfereTypeEnum.频干扰;
                sameinterfInfo.InterfOrder  = InterfereOrderEnum.频;
                sameinterfInfo.InterfObject = new List <InterfereObject>();

                #region 遍历干扰列表,取干扰设备或者干扰物

                foreach (ComparableFreq freq in item.Values)
                {
                    //先在设备列表中查找,如果有,则认为干扰物为设备
                    ActivityEquipmentInfo Interfequ    = _equipments.FirstOrDefault(r => r.GUID == freq.FreqID);
                    InterfereObject       interfobject = null;
                    if (Interfequ != null)
                    {
                        interfobject = CreateInterfObjectFromEqu(Interfequ);
                    }
                    else
                    {
                        //如设备列表中没有,则在周围台站列表中查找,如果有,则认为干扰物为设备
                        RoundStationInfo Interfstation = _aroundStation.FirstOrDefault(r => r.STATGUID == freq.FreqID);
                        if (Interfstation != null)
                        {
                            interfobject = CreateInterfObjectFromStation(Interfstation, freq);
                        }
                        else
                        {
                            AnalysisResult interfsignal = _illegalSignal.FirstOrDefault(r => r.Id == freq.FreqID);
                            if (interfsignal != null)
                            {
                                interfobject = CreateInterfObjectFromSignal(interfsignal, freq);
                            }
                            else
                            {
                                //如设备列表和周围台站列表中都没有此干扰物,则认为干扰物为其他(这种情况应该不会出现??)
                                interfobject = CreateInterfObjectFromOther(freq);
                            }
                        }
                    }
                    sameinterfInfo.InterfObject.Add(interfobject);
                }

                #endregion

                interfresultlst.Add(sameinterfInfo);
                //将新的干扰结果加到字典中
                if (isnewInterfere)
                {
                    this.dicInterfereResult.Add(equ, interfresultlst);
                }
            }
            return(interfresultlst);
        }
Example #26
0
        /// <summary>
        /// 初始化事件
        /// </summary>
        /// <param name="equipment"></param>
        public EquipmentDetailDialog(ActivityEquipmentInfo equipment)
        {
            InitializeComponent();
            this.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;

            activity = CO_IA.Client.RiasPortal.ModuleContainer.Activity;;

            CurrentEquipment = GetEquipmentInfo(equipment);
            if (CurrentEquipment == null)
            {
                CurrentEquipment = new ActivityEquipmentInfo();

                CurrentEquipment.ActivityGuid          = activity.Guid;
                CurrentEquipment.OrgInfo.Activity_Guid = activity.Guid;
                if (equipment != null && string.IsNullOrEmpty(equipment.PlaceGuid) == false)
                {
                    CurrentEquipment.PlaceGuid = equipment.PlaceGuid;
                }
                else
                {
                    CurrentEquipment.PlaceGuid = CO_IA.Client.Utility.NewGuid();
                }
                CurrentEquipment.ORGGuid = CurrentEquipment.OrgInfo.Guid = Guid.NewGuid().ToString();
                CurrentEquipment.Origin  = 0;
                #region  初始化测试数据

                //CurrentEquipment.EQUCount = 1;
                //CurrentEquipment.IsMobile = true;
                //CurrentEquipment.IsStation = true;
                //CurrentEquipment.Name = "test";

                //CurrentEquipment.ADJChannelInh = 1;
                //CurrentEquipment.RecvAntAzimuth = 1;
                //CurrentEquipment.RecvAntElevation = 1;
                //CurrentEquipment.RecvAntGain = 1;
                //CurrentEquipment.RecvAntHeight = 1;
                //CurrentEquipment.RecvAntModel = "1";
                //CurrentEquipment.RecvAntPolar = EMCS.Types.EMCPolarisationEnum.CR;

                //CurrentEquipment.RecvAntFeedLength = 1;
                //CurrentEquipment.RecvAntFeedLoss = 1;

                //CurrentEquipment.RecvFreqEnd = 1;
                //CurrentEquipment.RecvFreqStart = 1;
                //CurrentEquipment.ReceiveFreq = 1;
                //CurrentEquipment.Sensitivity = 1;
                //CurrentEquipment.SensitivityUnit = 1;
                //CurrentEquipment.SignalNoise = 1;
                //CurrentEquipment.Remark = "1";
                //CurrentEquipment.RunningFrom = DateTime.Now;
                //CurrentEquipment.RunningTo = DateTime.Now;

                //CurrentEquipment.Band = 1;
                //CurrentEquipment.SendAntAzimuth = 1;
                //CurrentEquipment.SendAntElevation = 1;
                //CurrentEquipment.SendAntGain = 1;
                //CurrentEquipment.SendAntHeight = 1;
                //CurrentEquipment.SendAntModel = "1";
                //CurrentEquipment.SendAntPolar = EMCS.Types.EMCPolarisationEnum.CR;

                //CurrentEquipment.SendAntFeedLength = 1;
                //CurrentEquipment.SendAntFeedLoss = 1;

                //CurrentEquipment.SendFreqEnd = 1;
                //CurrentEquipment.SendFreqStart = 1;
                //CurrentEquipment.ChannelBand = 1;
                //CurrentEquipment.IsTunAble = true;
                //CurrentEquipment.Leakage = 1;
                //CurrentEquipment.MaxPower = 1;
                //CurrentEquipment.ModulateMode = EMCS.Types.EMCModulationEnum.ASK;
                //CurrentEquipment.SendFreq = 1;
                //CurrentEquipment.StationName = "StationName";

                #endregion
            }
            this.DataContext = this;

            #region  填充combobox
            List <ActivityORGInfo> cmb_OrgList = PT_BS_Service.Client.Framework.BeOperationInvoker.Invoke <I_CO_IA.FreqPlan.I_CO_IA_FreqPlan, List <ActivityORGInfo> >(channel =>
            {
                return(channel.GetORGInfos(CO_IA.Client.RiasPortal.ModuleContainer.Activity.Guid));
            });

            this.cmb_OrgList.ItemsSource = cmb_OrgList;
            List <EMCModulationEnum> modulation = new List <EMCModulationEnum>();
            foreach (string item in Enum.GetNames(typeof(EMCModulationEnum)))
            {
                EMCModulationEnum modulate = new EMCModulationEnum();
                if (Enum.TryParse(item, out modulate))
                {
                    modulation.Add(modulate);
                }
            }
            combModulate.ItemsSource = modulation;


            List <EMCPolarisationEnum> Polars = new List <EMCPolarisationEnum>();
            foreach (string item in Enum.GetNames(typeof(EMCPolarisationEnum)))
            {
                EMCPolarisationEnum polar;
                if (Enum.TryParse(item, out polar))
                {
                    Polars.Add(polar);
                }
            }
            combAntPolar.ItemsSource     = Polars;
            combRecvAntPolar.ItemsSource = Polars;

            combClass.ItemsSource = CO_IA.Client.Utility.GetSecurityClasses();
            combGB.ItemsSource    = CO_IA.Client.Utility.BusinessTypes;

            #endregion
        }
Example #27
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        private bool Validate(ActivityEquipmentInfo equipment)
        {
            bool          isSuccess = true;
            StringBuilder errormsg  = new StringBuilder();


            if (combClass.SelectedValue == null)
            {
                errormsg.Append("单位的业务类别不能为空 \r");
                isSuccess = false;
            }


            if (string.IsNullOrEmpty(equipment.Name))
            {
                errormsg.Append("名称不能为空 \r");
                isSuccess = false;
            }


            if (string.IsNullOrEmpty(equipment.EQUCount.ToString()))
            {
                errormsg.Append("数量不能为空 \r");
                isSuccess = false;
            }
            else if (equipment.EQUCount == 0)
            {
                errormsg.Append("数量需要大于0 \r");
                isSuccess = false;
            }
            if (string.IsNullOrEmpty(equipment.SendFreq.ToString()))
            {
                errormsg.Append("发射频率不能为空 \r");

                isSuccess = false;
            }
            if (string.IsNullOrEmpty(equipment.SendFreqStart.ToString()))
            {
                errormsg.Append("发射频率开始不能为空 \r");
                isSuccess = false;
            }
            if (string.IsNullOrEmpty(equipment.SendFreqEnd.ToString()))
            {
                errormsg.Append("发射频率结束不能为空 \r");
                isSuccess = false;
            }
            if (string.IsNullOrEmpty(equipment.Band.ToString()))
            {
                errormsg.Append("带宽不能为空 \r");
                isSuccess = false;
            }
            if (string.IsNullOrEmpty(equipment.MaxPower.ToString()))
            {
                errormsg.Append("最大功率不能为空 \r");
                isSuccess = false;
            }
            if (string.IsNullOrEmpty(equipment.ModulateMode.ToString()))
            {
                errormsg.Append("调制方式不能为空 \r");
                isSuccess = false;
            }

            if (string.IsNullOrEmpty(equipment.SendAntGain.ToString()))
            {
                errormsg.Append("发射天线增益不能为空 \r");
                isSuccess = false;
            }
            if (string.IsNullOrEmpty(equipment.SendAntPolar.ToString()))
            {
                errormsg.Append("发射天线极化方式不能为空 \r");
                isSuccess = false;
            }
            if (string.IsNullOrEmpty(equipment.SendAntHeight.ToString()))
            {
                errormsg.Append("发射天线高度不能为空 \r");
                isSuccess = false;
            }
            if (string.IsNullOrEmpty(equipment.SendAntFeedLoss.ToString()))
            {
                errormsg.Append("发射天线馈线损耗不能为空 \r");
                isSuccess = false;
            }

            //接收频率为空。不需要判断接收天线信息
            if (equipment.ReceiveFreq != null)
            {
                if (string.IsNullOrEmpty(equipment.RecvAntGain.ToString()))
                {
                    errormsg.Append("接收天线增益不能为空 \r");
                    isSuccess = false;
                }
                if (string.IsNullOrEmpty(equipment.RecvAntPolar.ToString()))
                {
                    errormsg.Append("接收天线极化方式不能为空 \r");
                    isSuccess = false;
                }
                if (string.IsNullOrEmpty(equipment.RecvAntHeight.ToString()))
                {
                    errormsg.Append("接收天线高度不能为空 \r");
                    isSuccess = false;
                }
                if (string.IsNullOrEmpty(equipment.RecvAntFeedLoss.ToString()))
                {
                    errormsg.Append("接收天线馈线损耗不能为空 \r");
                    isSuccess = false;
                }
            }

            if (!isSuccess)
            {
                MessageBox.Show(errormsg.ToString(), "提示", MessageBoxButton.OK);
            }

            return(isSuccess);
        }
        /// <summary>
        /// 获取邻频干扰结果
        /// </summary>
        /// <param name="result"></param>
        /// <returns></returns>
        private List <InterfereResult> GetADJFreqInterfResult(AdjFreqCompareResult[] result)
        {
            List <InterfereResult> adjinterfresultlst = new List <InterfereResult>();

            //干扰结果
            foreach (AdjFreqCompareResult item in result)
            {
                ActivityEquipmentInfo equ = new ActivityEquipmentInfo();
                equ = _equipments.FirstOrDefault(r => r.GUID == item.Keys[0].FreqID); //获取干扰设备

                bool isnewInterfere = true;                                           //新的干扰,不存在dicInterfereResult字典中
                if (this.dicInterfereResult.TryGetValue(equ, out adjinterfresultlst))
                {
                    isnewInterfere = false;
                }
                else
                {
                    isnewInterfere     = true;
                    adjinterfresultlst = new List <InterfereResult>();
                }

                #region  邻频干扰

                if (item.UpperAdjFreqs != null && item.UpperAdjFreqs.Length > 0)
                {
                    InterfereResult uadinterfInfo = new InterfereResult();
                    uadinterfInfo.InterfType   = InterfereTypeEnum.邻频干扰;
                    uadinterfInfo.InterfOrder  = InterfereOrderEnum.邻频;
                    uadinterfInfo.InterfObject = new List <InterfereObject>();
                    foreach (ComparableFreq uadjfreq in item.UpperAdjFreqs)
                    {
                        //先在设备列表中查找,如果有,则认为干扰物为设备
                        ActivityEquipmentInfo Interfequ    = _equipments.FirstOrDefault(r => r.GUID == uadjfreq.FreqID);
                        InterfereObject       interfobject = null;
                        if (Interfequ != null)
                        {
                            interfobject = CreateInterfObjectFromEqu(Interfequ);
                        }
                        else
                        {
                            //如设备列表中没有,则在周围台站列表中查找,如果有,则认为干扰物为设备
                            RoundStationInfo Interfstation = _aroundStation.FirstOrDefault(r => r.STATGUID == uadjfreq.FreqID);
                            if (Interfstation != null)
                            {
                                interfobject = CreateInterfObjectFromStation(Interfstation, uadjfreq);
                            }
                            else
                            {
                                AnalysisResult interfsignal = _illegalSignal.FirstOrDefault(r => r.Id == uadjfreq.FreqID);
                                if (interfsignal != null)
                                {
                                    interfobject = CreateInterfObjectFromSignal(interfsignal, uadjfreq);
                                }
                                else
                                {
                                    //如设备列表和周围台站列表中都没有此干扰物,则认为干扰物为其他(这种情况应该不会出现??)
                                    interfobject = CreateInterfObjectFromOther(uadjfreq);
                                }
                            }
                        }
                        uadinterfInfo.InterfObject.Add(interfobject);
                    }
                    adjinterfresultlst.Add(uadinterfInfo);
                }

                #endregion

                #region  邻频干扰

                if (item.LowerAdjFreqs != null && item.LowerAdjFreqs.Length > 0)
                {
                    InterfereResult ladjinterfInfo = new InterfereResult();
                    ladjinterfInfo.InterfType   = InterfereTypeEnum.邻频干扰;
                    ladjinterfInfo.InterfOrder  = InterfereOrderEnum.邻频;
                    ladjinterfInfo.InterfObject = new List <InterfereObject>();

                    foreach (ComparableFreq ladjfreq in item.LowerAdjFreqs)
                    {
                        //先在设备列表中查找,如果有,则认为干扰物为设备
                        ActivityEquipmentInfo Interfequ    = _equipments.FirstOrDefault(r => r.GUID == ladjfreq.FreqID);
                        InterfereObject       interfobject = null;
                        if (Interfequ != null)
                        {
                            interfobject = CreateInterfObjectFromEqu(Interfequ);
                        }
                        else
                        {
                            //如设备列表中没有,则在周围台站列表中查找,如果有,则认为干扰物为设备
                            RoundStationInfo Interfstation = _aroundStation.FirstOrDefault(r => r.STATGUID == ladjfreq.FreqID);
                            if (Interfstation != null)
                            {
                                interfobject = CreateInterfObjectFromStation(Interfstation, ladjfreq);
                            }
                            else
                            {
                                AnalysisResult interfsignal = _illegalSignal.FirstOrDefault(r => r.Id == ladjfreq.FreqID);
                                if (interfsignal != null)
                                {
                                    interfobject = CreateInterfObjectFromSignal(interfsignal, ladjfreq);
                                }
                                else
                                {
                                    //如设备列表和周围台站列表中都没有此干扰物,则认为干扰物为其他(这种情况应该不会出现??)
                                    interfobject = CreateInterfObjectFromOther(ladjfreq);
                                }
                            }
                        }
                        ladjinterfInfo.InterfObject.Add(interfobject);
                    }
                    adjinterfresultlst.Add(ladjinterfInfo);
                }
                #endregion

                if (isnewInterfere)
                {
                    this.dicInterfereResult.Add(equ, adjinterfresultlst);
                }
            }
            return(adjinterfresultlst);
        }
        /// <summary>
        /// 获取发射机互调
        /// </summary>
        /// <param name="transmResult"></param>
        /// <returns></returns>
        private List <IMInterfereResult> GetTransmitterImResult(IMCompareResult transmResult)
        {
            List <IMInterfereResult> imInterfresultlst = new List <IMInterfereResult>();

            if (transmResult != null)
            {
                #region 获取干扰结果

                IMItemBase imBase = null;
                for (int i = 0; i < transmResult.Values.Length; i++)
                {
                    imBase = transmResult.Values[i];
                    ActivityEquipmentInfo equ = new ActivityEquipmentInfo();

                    ComparableFreq imfreq = imBase.IMFreqs[0];//发射互调的干扰频率存在IMFreqs中
                    equ = _equipments.FirstOrDefault(r => r.GUID == imfreq.FreqID);

                    bool isnewInterfere = true; //新的干扰,不存在dicIMInterfereResult字典中
                    if (equ != null)
                    {
                        if (this.dicIMInterfereResult.TryGetValue(equ, out imInterfresultlst))
                        {
                            isnewInterfere = false;
                        }
                        else
                        {
                            isnewInterfere    = true;
                            imInterfresultlst = new List <IMInterfereResult>();
                        }

                        IMInterfereResult iminterfinfo = new IMInterfereResult();
                        iminterfinfo.InterfType   = InterfereTypeEnum.发射机互调干扰;
                        iminterfinfo.InterfOrder  = GetIMInterfOrder(imBase.Order);
                        iminterfinfo.Formual      = imBase.Formula;
                        iminterfinfo.InterfObject = new List <InterfereObject>();


                        #region  获取干扰台站


                        ComparableFreq disfreq = imBase.DisturbedFreqs[0];

                        //先在设备列表中查找,如果有,则认为干扰物为设备
                        ActivityEquipmentInfo Interfequ1    = _equipments.FirstOrDefault(r => r.GUID == disfreq.FreqID);
                        InterfereObject       interfobject1 = null;
                        if (Interfequ1 != null)
                        {
                            interfobject1 = CreateInterfObjectFromEqu(Interfequ1);
                        }
                        else
                        {
                            //如设备列表中没有,则在周围台站列表中查找,如果有,则认为干扰物为设备
                            RoundStationInfo Interfstation = _aroundStation.FirstOrDefault(r => r.STATGUID == disfreq.FreqID);
                            if (Interfstation != null)
                            {
                                interfobject1 = CreateInterfObjectFromStation(Interfstation, disfreq);
                            }
                            else
                            {
                                //如设备列表和周围台站列表中都没有此干扰物,则认为干扰物为其他(这种情况应该不会出现??)
                                interfobject1 = CreateInterfObjectFromOther(imBase.DisturbedFreqs[0]);
                            }
                        }
                        iminterfinfo.InterfObject.Add(interfobject1);

                        //先在设备列表中查找,如果有,则认为干扰物为设备
                        ActivityEquipmentInfo Interfequ2    = _equipments.FirstOrDefault(r => r.GUID == imBase.IMFreqs[1].FreqID);
                        InterfereObject       interfobject2 = null;
                        if (Interfequ2 != null)
                        {
                            interfobject2 = CreateInterfObjectFromEqu(Interfequ2);
                        }
                        else
                        {
                            //如设备列表中没有,则在周围台站列表中查找,如果有,则认为干扰物为设备
                            RoundStationInfo Interfstation = _aroundStation.FirstOrDefault(r => r.STATGUID == imBase.IMFreqs[1].FreqID);
                            if (Interfstation != null)
                            {
                                interfobject2 = CreateInterfObjectFromStation(Interfstation, imBase.IMFreqs[1]);
                            }
                            else
                            {
                                //如设备列表和周围台站列表中都没有此干扰物,则认为干扰物为其他(这种情况应该不会出现??)
                                interfobject2 = CreateInterfObjectFromOther(imBase.IMFreqs[1]);
                            }
                        }
                        iminterfinfo.InterfObject.Add(interfobject2);

                        #endregion

                        imInterfresultlst.Add(iminterfinfo);

                        if (isnewInterfere)
                        {
                            this.dicIMInterfereResult.Add(equ, imInterfresultlst);
                        }
                    }
                }
                #endregion
            }
            return(imInterfresultlst);
        }
Example #30
0
        /// <summary>
        /// 创建许可证预览的Canvas
        /// </summary>
        /// <param name="equInfo">设备信息</param>
        /// <param name="tempInfo">许可证模板信息</param>
        /// <param name="isPrintBgImg">是否打印背景图片</param>
        /// <returns></returns>
        public static Canvas CreateLicenseViewCanvas(ActivityEquipmentInfo equInfo, LicenseTempleteInfo tempInfo, bool isPrintBgImg)
        {
            LicenseTemplete temp        = BarCodeFactory.CreateBarCodesFromXml(tempInfo.TempXML);
            LicenseViewInfo license     = new LicenseViewInfo(equInfo);
            Canvas          _viewCanvas = new Canvas();

            _viewCanvas.Height = temp.Height;
            _viewCanvas.Width  = temp.Width;
            if (isPrintBgImg)
            {
                ImageBrush image = new ImageBrush();
                if (tempInfo.BGImage != null)
                {
                    MemoryStream stream = new MemoryStream(tempInfo.BGImage);
                    BitmapImage  bmp    = new BitmapImage();
                    bmp.BeginInit();           //初始化
                    bmp.StreamSource = stream; //设置源
                    bmp.EndInit();             //初始化结束
                    image.ImageSource = bmp;   //设置图像Source
                }
                _viewCanvas.Background = image;
            }
            LicenseViewInfo viewInfo = new LicenseViewInfo(equInfo);

            _viewCanvas.DataContext = viewInfo;
            foreach (var item in temp.Items)
            {
                switch (item.Type)
                {
                case "Title":
                    TextBlock textBlock = new TextBlock();
                    textBlock.Text     = item.Content + ":";
                    textBlock.FontSize = item.FontSize;
                    _viewCanvas.Children.Add(textBlock);
                    Canvas.SetTop(textBlock, item.Left);
                    Canvas.SetLeft(textBlock, item.Top);
                    break;

                case "Value":
                    TextBlock textBlockValue = new TextBlock();
                    textBlockValue.FontSize     = item.FontSize;
                    textBlockValue.Width        = temp.Width - item.Top - 10;
                    textBlockValue.TextWrapping = TextWrapping.Wrap;
                    _viewCanvas.Children.Add(textBlockValue);
                    Canvas.SetTop(textBlockValue, item.Left);
                    Canvas.SetLeft(textBlockValue, item.Top);
                    textBlockValue.SetBinding(TextBlock.TextProperty, new Binding(item.Column));
                    break;

                case "BarCode":
                    //初始化条码图片
                    //private Image _barCodeImage = CreateImage();
                    //_viewCanvas.Children.Add(_barCodeImage);
                    //Canvas.SetTop(_barCodeImage, item.Left);
                    //Canvas.SetLeft(_barCodeImage, item.Top);
                    break;
                }
            }

            return(_viewCanvas);
        }