static UiMainForm() { DbScheme.Create(); var db = DbScheme.Connections["Main"]; int ccdCount = db.ExecuteScalar <int>("select data from UiParams where name = ?", "CcdCount"); int brandCount = db.ExecuteScalar <int>("select data from UiParams where name = ?", "BrandCount"); ScreenWidth = db.ExecuteScalar <int>("select data from UiParams where name = ?", "ScreenWidth"); ScreenHeight = db.ExecuteScalar <int>("select data from UiParams where name = ?", "ScreenHeight"); int[] partCounts = new int[ccdCount]; for (int i = 0; i < ccdCount; i++) { partCounts[i] = db.ExecuteScalar <int>("select data from UiParams where name = ?", string.Format("PartCountCcd{0}", i + 1)); } Project = new ProjectCcd(ccdCount, brandCount, partCounts); Panels = new Dictionary <string, Panel>(); WorkAreaPanel = new Panel(); }
public UiZoneInfo(ProjectCcd project, Panel panel) { Project = project; MainPanel = panel.Controls.OfType <Panel>().First(); MainPanel.Dock = DockStyle.Fill; int zoneCount = Project.CcdCount; Zones = new GroupBox[zoneCount]; Infos = new ZoneInfo[zoneCount]; ZoneBlocks = new ActionBlock <CcdCycle> [zoneCount]; StatusBlocks = new ActionBlock <bool> [zoneCount]; int width = panel.Width; int height = panel.Height; int height0 = height / zoneCount; int width0 = width; var db = DbScheme.GetConnection("Main"); string text = string.Empty; for (int i = 0; i < zoneCount; i++) { Zones[i] = new GroupBox(); Zones[i].Width = width0; Zones[i].Height = height0 - 5; Zones[i].Left = 0; Zones[i].Top = height0 * i; text = db.ExecuteScalar <string>("select nameCn from CcdInfo where ccdId = ?", i); Zones[i].Text = text; // string.Format("CCD{0}", i + 1); MainPanel.Controls.Add(Zones[i]); Infos[i] = new ZoneInfo(i, Project.BrandId); } for (int i = 0; i < zoneCount; i++) { AddZoneUi(i); } }
public UiTabControls(ProjectCcd project) { Project = project; }