Ejemplo n.º 1
0
 /// <summary>
 /// 分析读取文件之后的string集合
 /// </summary>
 /// <param name="strSet"></param>
 public void ReadFile_SameDevBaseAddrTable(string[] strSet)
 {
     devBaseAddrNameSet.Clear();
     devBaseAddrNumSet.Clear();
     for (int i = 0; i < sameDevBaseAddrTableSet.Count; i++)
     {
         sameDevBaseAddrTableSet[i].Hide();
         sameDevBaseAddrTableSet[i].Dispose();
     }
     sameDevBaseAddrTableSet.Clear();
     for (int i = 3; i < strSet.Length; i++)
     {
         DevInfCollectUnit newTable = new DevInfCollectUnit();
         if (sameDevBaseAddrTableSet.Count == 0)
         {
             newTable.Location = new Point(3, 3);
         }
         else
         {
             newTable.Location = new Point(3, sameDevBaseAddrTableSet[sameDevBaseAddrTableSet.Count - 1].Location.Y + sameDevBaseAddrTableSet[sameDevBaseAddrTableSet.Count - 1].Size.Height + 1);
         }
         sameDevBaseAddrTableSet.Add(newTable);
         sameDevInfPanel.Controls.Add(newTable);
         newTable.SetBaseAddrName((GetValueInFileString(strSet[i]) == "%" ? "" : GetValueInFileString(strSet[i])));
         i++;
         newTable.SetBaseAddrNum((GetValueInFileString(strSet[i]) == "%" ? "" : GetValueInFileString(strSet[i])));
     }
     for (int i = 0; i < sameDevBaseAddrTableSet.Count; i++)  //影子寄存器的映射更新
     {
         devBaseAddrNameSet.Add(sameDevBaseAddrTableSet[i].GetBaseAddrName());
         devBaseAddrNumSet.Add(sameDevBaseAddrTableSet[i].GetBaseAddrNum());
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// 删除按钮点击事件,这样是删除最后一个
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void deleteButton_Click(object sender, EventArgs e)
        {
            DevInfCollectUnit lastDev = sameDevBaseAddrTableSet[sameDevBaseAddrTableSet.Count - 1];

            sameDevBaseAddrTableSet.RemoveAt(sameDevBaseAddrTableSet.Count - 1);
            lastDev.Hide();
            lastDev.Dispose();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 添加按钮点击事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void addButton_Click(object sender, EventArgs e)
        {
            DevInfCollectUnit newTable = new DevInfCollectUnit();

            if (sameDevBaseAddrTableSet.Count == 0)
            {
                newTable.Location = new Point(3, 3);
            }
            else
            {
                newTable.Location = new Point(3, sameDevBaseAddrTableSet[sameDevBaseAddrTableSet.Count - 1].Location.Y + sameDevBaseAddrTableSet[sameDevBaseAddrTableSet.Count - 1].Size.Height + 1);
            }
            sameDevBaseAddrTableSet.Add(newTable);
            sameDevInfPanel.Controls.Add(newTable);
        }