/// <summary> /// 通过用户填的值来更新一个Board类 /// </summary> /// <param name="board"></param> private void RefreshBoard(Board board) { BoardNodeName = _typeTB.Text; board.Name = _typeTB.Text; board.Type = _typeTB.Text; board.Version = _versionTB.Text; IEnumerable <ListViewItem> coreLVItems = ChipLV.Items.Cast <ListViewItem>(); //添加板卡的PPC集合 var ppcs = from p in coreLVItems where p.SubItems[1].Text == "PPC" select p.SubItems[2].Text; foreach (var ppcName in ppcs) { board.PPCList.Add(ModelFactory <PPC> .CreateByName(ppcName)); } //添加板卡的FPGA集合 var fpgas = from f in coreLVItems where f.SubItems[1].Text == "FPGA" select f.SubItems[2].Text; foreach (var fpgaName in fpgas) { board.FPGAList.Add(ModelFactory <FPGA> .CreateByName(fpgaName)); } //添加板卡的ZYNQ集合 var zynqs = from z in coreLVItems where z.SubItems[1].Text == "ZYNQ" select z.SubItems[2].Text; foreach (var zynqName in zynqs) { board.ZYNQList.Add(ModelFactory <ZYNQ> .CreateByName(zynqName)); } //添加板卡的Sw集合 IEnumerable <ListViewItem> swLVItems = SWLV.Items.Cast <ListViewItem>(); foreach (var item in swLVItems) { SwitchCategory catogory = item.SubItems[1].Text == "EtherSW" ? SwitchCategory.EtherNetSw : SwitchCategory.RioSw; board.SwitchList.Add(new SwitchDevice(catogory, item.SubItems[2].Text)); } //添加板卡的Link集合 AddLinkToList(board, EtherLV, LinkType.EtherNet); //以太网 AddLinkToList(board, RioLV, LinkType.RapidIO); //RapidIO AddLinkToList(board, GtxLV, LinkType.GTX); //GTX AddLinkToList(board, LvdsLV, LinkType.LVDS); //LVDS }
int IComparable <LifeCardGameCardInformation> .CompareTo(LifeCardGameCardInformation other) { if (Category != other.Category) { return(Category.CompareTo(other.Category)); } if (SpecialCategory != other.SpecialCategory) { return(SpecialCategory.CompareTo(other.SpecialCategory)); } if (SwitchCategory != other.SwitchCategory) { return(SwitchCategory.CompareTo(other.SwitchCategory)); } if (Requirement != other.Requirement) { return(Requirement.CompareTo(other.Requirement)); } return(Points.CompareTo(other.Points)); }
} //交换机的型号 public SwitchDevice(SwitchCategory category, string type) : base(new Rectangle()) { Category = category; Type = type; }