public FctRule(Cabinet cabinet, RxMsgQueue rxMsgQueue) { this.cabinet = cabinet; this.rxMsgQueue = rxMsgQueue; //错误计数全部置零 foreach (var r in cabinet.Racks) { foreach (var b in r.Boards) { foreach (var ct in b.ComponentTypes) { foreach (var c in ct.Components) { componentErrorPackageTimes.Add(c, 0); componentLostPackageTimes.Add(c, 0); componentInterruptTimes.Add(c, 0); c.AllTestTimes = 0; c.ErrorPackageTimes = 0; c.LostPackageTimes = 0; c.InterruptTimes = 0; } } } } }
public void DisplayFCTTree(Cabinet cabinet) { Rack sysRack = cabinet.Racks[0]; Board cpuBoard = sysRack.Boards[0]; Board vcomBoard = sysRack.Boards[3]; fctCheckBoxTree.Nodes.Clear(); TreeNode baseroot = new TreeNode(); baseroot.Tag = sysRack; baseroot.Text = sysRack.EqName; TreeNode cpuBoardNode = new TreeNode(); cpuBoardNode.Tag = cpuBoard; cpuBoardNode.Text = cpuBoard.EqName; baseroot.Nodes.Add(cpuBoardNode); foreach (var ct in cpuBoard.ComponentTypes) { TreeNode node = new TreeNode(); node.Tag = ct; node.Text = ct.EqName; if (ct.IsFctTestTested) { node.Checked = true; } cpuBoardNode.Nodes.Add(node); } TreeNode vcomBoardNode = new TreeNode(); vcomBoardNode.Tag = vcomBoard; vcomBoardNode.Text = vcomBoard.EqName; baseroot.Nodes.Add(vcomBoardNode); foreach (var ct in vcomBoard.ComponentTypes) { TreeNode node = new TreeNode(); node.Tag = ct; node.Text = ct.EqName; if (ct.IsFctTestTested) { node.Checked = true; } vcomBoardNode.Nodes.Add(node); } baseroot.ExpandAll(); fctCheckBoxTree.Nodes.Add(baseroot); foreach (TreeNode cNode in fctCheckBoxTree.Nodes) { fctCheckBoxTree.HideCheckBox(cNode); foreach (TreeNode rNode in cNode.Nodes) { fctCheckBoxTree.HideCheckBox(rNode); } } fctCheckBoxTree.HideCheckBox(baseroot); fctCheckBoxTree.Refresh(); }
public void Init() { if (this.Columns.Count > 0) return; cabinet = SpringHelper.GetObject<Cabinet>("cabinet"); judgeMatrix = SpringHelper.GetObject<Dictionary<Board, Board[]>>("judgeMatrix"); testSemaphore = SpringHelper.GetObject<TestSemaphore>("testSemaphore"); this.Columns.Add("", 80); foreach (var r in cabinet.Racks) { foreach (var b in r.Boards) { foreach (var bk in judgeMatrix.Keys) { if (bk.EqName == b.EqName) { ColumnHeader ch = new ColumnHeader(); ch.Text = bk.EqName; ch.Width = 75; ch.Tag = bk; this.Columns.Add(ch); break; } } } } foreach (var r in cabinet.Racks) { foreach (var b in r.Boards) { Items.Add(CreateItem(b)); } } Reset(); }
public GeneralRule(Cabinet cabinet, RxMsgQueue rxMsgQueue, Dictionary<Board, Board[]> matrix) : base(cabinet, rxMsgQueue) { this.matrix = matrix; }
//初始化左边板卡选择树 public void DisplaySelfTree(Cabinet cabinet) { cabinetTreeView.Nodes.Clear(); TreeNode baseroot = new TreeNode(); baseroot.Tag = cabinet; baseroot.Text = cabinet.EqName; foreach (var r in cabinet.Racks) { TreeNode rackNode = new TreeNode(); rackNode.Tag = r; rackNode.Text = r.EqName; baseroot.Nodes.Add(rackNode); foreach (var b in r.Boards) { TreeNode boardNode = new TreeNode(); boardNode.Tag = b; boardNode.Text = b.EqName; rackNode.Nodes.Add(boardNode); } } baseroot.ExpandAll(); cabinetTreeView.Nodes.Add(baseroot); cabinetTreeView.Refresh(); }
public void DisplayGenralTree(Cabinet cabinet) { generalCheckBoxTree.Nodes.Clear(); TreeNode baseroot = new TreeNode(); baseroot.Tag = cabinet; baseroot.Text = cabinet.EqName; foreach (var r in cabinet.Racks) { TreeNode rackNode = new TreeNode(); rackNode.Tag = r; rackNode.Text = r.EqName; baseroot.Nodes.Add(rackNode); foreach (var b in r.Boards) { TreeNode boardNode = new TreeNode(); boardNode.Tag = b; boardNode.Text = b.EqName; if (b.IsGeneralTestTested) { boardNode.Checked = true; } rackNode.Nodes.Add(boardNode); } } baseroot.ExpandAll(); generalCheckBoxTree.Nodes.Add(baseroot); foreach (TreeNode cNode in generalCheckBoxTree.Nodes) { generalCheckBoxTree.HideCheckBox(cNode); foreach (TreeNode rNode in cNode.Nodes) { generalCheckBoxTree.HideCheckBox(rNode); foreach (TreeNode bNode in rNode.Nodes) { Board b = bNode.Tag as Board; if (!b.CanGeneralTest) { generalCheckBoxTree.HideCheckBox(bNode); } } } } generalCheckBoxTree.HideCheckBox(baseroot); generalCheckBoxTree.Refresh(); }