Пример #1
0
        public List<AntennaEntity> import(string path)
        {
            List<AntennaEntity> antennaEntityList = new List<AntennaEntity>();
            //SmartAntenna sa = new SmartAntenna();
            SmartAntenna SA = new SmartAntenna();
            SA = BinarySerialize.GetSmartAnt();
            FixedAntenna antFixed = new FixedAntenna();
            FixedAntenna pattern = new FixedAntenna() ;
            int nameStart = path.LastIndexOf("_");
            int nameEnd = path.LastIndexOf(".");
            string pattMainAngle = path.Substring((nameStart + 1), (nameEnd - nameStart - 1));
            if (pattMainAngle.Contains("BCH"))
            {
                antennaEntityList.Add(SA.BCH_SmartAntenna.Antenna);
                return antennaEntityList;
            }
            else
            {
                pattMainAngle = pattMainAngle.Substring(0, (pattMainAngle.Length - 1));
                int mainAngle = int.Parse(pattMainAngle);
                if (mainAngle < 0)
                {
                    mainAngle = 360 + mainAngle;
                }

                SA.DicPAngleWithAntenna.TryGetValue(mainAngle, out pattern);
                antennaEntityList.Add(pattern.Antenna);
                return antennaEntityList ;
            }
        }
        private void ViewSmartAntPatternProperty(SmartAntenna sa)
        {
            AddBCHAndPatts(sa);

            AddComBox(sa);

            InputSAName_textBox.Text = sa.Name;
        }
 private void AddComBox(SmartAntenna sa)
 {
     BCHPatcomboBox.Items.Add(sa.BCH_SmartAntenna.Name);
     BCHPatcomboBox.SelectedIndex = 0;
     foreach (var kvp in sa.DicPAngleWithAntenna)
     {
         BCHPatcomboBox.Items.Add(kvp.Value.Name);
     }
 }
Пример #4
0
        /// <summary>
        /// 显示并可以修改智能天线属性
        /// </summary>
        public InputMainAngle_for_import(SmartAntenna sa, ISmartAntMgr iants)
        {
            //当前窗体的工作模式是查看Properties
            m_FormMode = FormMode.Properties;

            InitializeComponent();
            m_SA = sa;
            iantennas = iants;
            ViewSmartAntProperty(sa);

        }
        /// <summary>
        /// 显示并可以修改智能天线属性
        /// </summary>
        public ImportPatternsForm(SmartAntenna sa, ISmartAntMgr iants)
        {
            //当前窗体的工作模式是查看Properties
            m_FormMode = FormMode.Properties;

            InitializeComponent();
            m_SA = sa;
            iantennas = iants;
            ViewSmartAntPatternProperty(sa);

        }
        private void AddBCHAndPatts(SmartAntenna sa)
        {
            //先添加BCH,再添加普通的赋形图
            int i = InputMainAngle_dataGridView.Rows.Add(sa.BCH_SmartAntenna.Name, null);
            InputMainAngle_dataGridView.Rows[i].Tag = sa.BCH_SmartAntenna;

            foreach (var kvp in sa.DicPAngleWithAntenna)
            {
                i = InputMainAngle_dataGridView.Rows.Add(kvp.Value.Name, (int)kvp.Key);
                InputMainAngle_dataGridView.Rows[i].Tag = kvp.Value;
            }
        }
Пример #7
0
        private void ViewSmartAntProperty(SmartAntenna sa)
        {
            //先添加BCH,再添加普通的赋形图
            int i = InputMainAngle_dataGridView.Rows.Add(sa.BCH_SmartAntenna.Name, null);
            InputMainAngle_dataGridView.Rows[i].Tag = sa.BCH_SmartAntenna;

            foreach (var kvp in sa.DicPAngleWithAntenna)
            {
                i = InputMainAngle_dataGridView.Rows.Add(kvp.Value.Name, (int)kvp.Key);
                InputMainAngle_dataGridView.Rows[i].Tag = kvp.Value;
            }

            //先添加BCH,再添加普通的赋形图
            BCHPatcomboBox.Items.Add(sa.BCH_SmartAntenna.Name);
            BCHPatcomboBox.SelectedIndex = 0;
            foreach (var kvp in sa.DicPAngleWithAntenna)
            {
                BCHPatcomboBox.Items.Add(kvp.Value.Name);
            }

            InputSAName_textBox.Text = sa.Name;
        }