private C_Shelf CreateShelf(SortingLineBox sortingLineBox) { C_Shelf c_Shelf = new C_Shelf(sortingLineBox); //c_Shelf.SetTooltip(); c_Shelf.Name = sortingLineBox.LineBoxCode; return(c_Shelf); }
private void InitLineBoxControl(C_Shelf cshelve, FlowLayoutPanel mainflowLayoutPanel) { FlowLayoutPanel flowLayoutPanel = new FlowLayoutPanel(); if (Convert.ToInt32(cshelve.Lineboxcode) % 2 == 0) { flowLayoutPanel.BackColor = System.Drawing.Color.Silver; } else { flowLayoutPanel.BackColor = System.Drawing.Color.Gainsboro; } flowLayoutPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; flowLayoutPanel.Dock = System.Windows.Forms.DockStyle.None; flowLayoutPanel.Margin = new System.Windows.Forms.Padding(0, 0, 0, 0); flowLayoutPanel.Size = new System.Drawing.Size(cshelve.Width + 1, f1.Height); flowLayoutPanel.WrapContents = false; mainflowLayoutPanel.Controls.Add(flowLayoutPanel); flowLayoutPanel.Controls.Add(cshelve); }
/// <summary> /// 加载烟仓控件 /// </summary> public void LoadLinBox() { //建立空的烟仓控件 SortingLineBoxList sortingLineBoxList = SortingLineBoxList.GetLineBoxList(); c_Cubes = new List <C_Cube>(); cShelves = new Dictionary <string, C_Shelf>(); //cbefortUpShelves = new List<C_Shelf>(); //cbefortDownShelves = new List<C_Shelf>(); //cafterUpShelves = new List<C_Shelf>(); //cafterDownShelves = new List<C_Shelf>(); f1.Controls.Clear(); f2.Controls.Clear(); f3.Controls.Clear(); f4.Controls.Clear(); f5.Controls.Clear(); f6.Controls.Clear(); f7.Controls.Clear(); f8.Controls.Clear(); SortingSubLineList sortingSubLineList = SortingSubLineList.GetSubSortingLineList(); if (sortingSubLineList.Count == 1) { f1.Width += f2.Width; top.SetColumnSpan(f1, 3); panel1.Visible = false; top.SetColumnSpan(f3, 3); panel2.Visible = false; bottom.SetColumnSpan(f5, 3); panel4.Visible = false; bottom.SetColumnSpan(f7, 3); panel5.Visible = false; f2.Visible = false; f4.Visible = false; f6.Visible = false; f8.Visible = false; } if (sortingLineBoxList.Count > 0) { foreach (SortingLineBox sortingLineBox in sortingLineBoxList) { if (sortingLineBox.PARENTLINEBOX == "1" && sortingLineBox.ABANDONPARENT == "2" && sortingLineBox.SublineSeq == 1) { C_Shelf cShelf = CreateShelf(sortingLineBox); cShelves.Add(cShelf.Name, cShelf); cShelf.Margin = new Padding(0, 0, 1, 0); InitLineBoxControl(cShelf, f1); } else if (sortingLineBox.PARENTLINEBOX == "1" && sortingLineBox.ABANDONPARENT == "2" && sortingLineBox.SublineSeq == 2) { C_Shelf cShelf = CreateShelf(sortingLineBox); cShelves.Add(cShelf.Name, cShelf); cShelf.Margin = new Padding(0, 0, 1, 0); InitLineBoxControl(cShelf, f1); } else if (sortingLineBox.PARENTLINEBOX == "1" && sortingLineBox.ABANDONPARENT == "1" && sortingLineBox.SublineSeq == 1) { C_Shelf cShelf = CreateShelf(sortingLineBox); cShelves.Add(cShelf.Name, cShelf); cShelf.Margin = new Padding(0, 0, 1, 0); InitLineBoxControl(cShelf, f3); } else if (sortingLineBox.PARENTLINEBOX == "1" && sortingLineBox.ABANDONPARENT == "1" && sortingLineBox.SublineSeq == 2) { C_Shelf cShelf = CreateShelf(sortingLineBox); cShelves.Add(cShelf.Name, cShelf); cShelf.Margin = new Padding(0, 0, 1, 0); InitLineBoxControl(cShelf, f3); } else if (sortingLineBox.PARENTLINEBOX == "2" && sortingLineBox.ABANDONPARENT == "2" && sortingLineBox.SublineSeq == 1) { C_Shelf cShelf = CreateShelf(sortingLineBox); cShelves.Add(cShelf.Name, cShelf); cShelf.Margin = new Padding(0, 0, 1, 0); InitLineBoxControl(cShelf, f5); } else if (sortingLineBox.PARENTLINEBOX == "2" && sortingLineBox.ABANDONPARENT == "2" && sortingLineBox.SublineSeq == 2) { C_Shelf cShelf = CreateShelf(sortingLineBox); cShelves.Add(cShelf.Name, cShelf); cShelf.Margin = new Padding(0, 0, 1, 0); InitLineBoxControl(cShelf, f5); } else if (sortingLineBox.PARENTLINEBOX == "2" && sortingLineBox.ABANDONPARENT == "1" && sortingLineBox.SublineSeq == 1) { C_Shelf cShelf = CreateShelf(sortingLineBox); cShelves.Add(cShelf.Name, cShelf); cShelf.Margin = new Padding(0, 0, 1, 0); InitLineBoxControl(cShelf, f7); } else if (sortingLineBox.PARENTLINEBOX == "2" && sortingLineBox.ABANDONPARENT == "1" && sortingLineBox.SublineSeq == 2) { C_Shelf cShelf = CreateShelf(sortingLineBox); if (sortingLineBox.LineBoxCode == "123") { cShelf = CreateShelf(sortingLineBox); } else { cShelf = CreateShelf(sortingLineBox); } cShelves.Add(cShelf.Name, cShelf); cShelf.Margin = new Padding(0, 0, 1, 0); InitLineBoxControl(cShelf, f7); } } } //如果不能下达任务根据老的列表,给数码管发信号 SortingTaskIssued sortingTaskIssued = SortingTaskIssued.GetSortingTaskIssued("0"); if (sortingTaskIssued.PLCFLAG == 1) { ATOPTagSdk.instance.SetOrderNixielight(SortingLineTaskQueue.GetInstance().SortingLineTasks); UpdateLineboxNum(); } //是否显示烟仓容量 if (chkshowqty.Checked) { chkshowqty_CheckedChanged(null, null); } }