private void GetApertureUse() { DataRow row = null; DataTable apertureUseTable = new DataTable(); apertureUseTable.Columns.Add("D Code", typeof(String)); apertureUseTable.Columns.Add("Count", typeof(Int32)); apUseLabel.Text = "File: " + project.FileInfo[fileIndex].FileName; GerberFileInformation fileInfo = project.FileInfo[fileIndex]; foreach (GerberApertureInfo apertureInfo in fileInfo.Image.GerberStats.DCodeList) { // D codes can be defined but not used, so diplaying only used apertures. if (apertureInfo.Count > 0) { row = apertureUseTable.NewRow(); row["D Code"] = "D" + apertureInfo.Number.ToString(); row["Count"] = apertureInfo.Count; apertureUseTable.Rows.Add(row); } } apertureUseDataGridView.DataSource = apertureUseTable; apertureUseDataGridView.AutoGenerateColumns = true; apertureUseDataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect; apertureUseDataGridView.RowHeadersVisible = false; apertureUseDataGridView.RowTemplate.Resizable = DataGridViewTriState.False; apertureUseDataGridView.Columns["D Code"].Width = 75; apertureUseDataGridView.Columns["D Code"].DefaultCellStyle.BackColor = Color.LightGreen; apertureUseDataGridView.Columns["Count"].Width = 395; apertureUseDataGridView.Columns["Count"].SortMode = DataGridViewColumnSortMode.NotSortable; }
private void GetApertureDefinitions() { DataTable apertureTable = new DataTable(); apertureTable.Columns.Add("D Code", typeof(string)); apertureTable.Columns.Add("Aperture", typeof(String)); apertureTable.Columns.Add("Param[0]", typeof(String)); apertureTable.Columns.Add("Param[1]", typeof(String)); apertureTable.Columns.Add("Param[2]", typeof(String)); apertureTable.Columns.Add("Param[3]", typeof(String)); int count = 0; apDefLabel.Text = "File: " + project.FileInfo[fileIndex].FileName; DataRow row = null; GerberFileInformation fileInfo = project.FileInfo[fileIndex]; count = fileInfo.Image.GerberStats.ApertureList.Count; for (int i = 0; i < count; i++) { row = apertureTable.NewRow(); row["D Code"] = "D" + fileInfo.Image.GerberStats.ApertureList[i].Number.ToString(); row["Aperture"] = fileInfo.Image.GerberStats.ApertureList[i].ApertureType; row["Param[0]"] = String.Format("{0:0.000000}", fileInfo.Image.GerberStats.ApertureList[i].Parameters[0]); row["Param[1]"] = String.Format("{0:0.000000}", fileInfo.Image.GerberStats.ApertureList[i].Parameters[1]); row["Param[2]"] = String.Format("{0:0.000000}", fileInfo.Image.GerberStats.ApertureList[i].Parameters[2]); row["Param[3]"] = String.Format("{0:0.000000}", fileInfo.Image.GerberStats.ApertureList[i].Parameters[3]); apertureTable.Rows.Add(row); } apertureDefinitionGridView.DataSource = apertureTable; apertureDefinitionGridView.AutoGenerateColumns = true; apertureDefinitionGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect; apertureDefinitionGridView.RowHeadersVisible = false; apertureDefinitionGridView.RowTemplate.Resizable = DataGridViewTriState.False; apertureDefinitionGridView.Columns["D Code"].Width = 75; apertureDefinitionGridView.Columns["D Code"].SortMode = DataGridViewColumnSortMode.NotSortable; apertureDefinitionGridView.Columns["Aperture"].Width = 82; apertureDefinitionGridView.Columns["Aperture"].SortMode = DataGridViewColumnSortMode.NotSortable; apertureDefinitionGridView.Columns["Param[0]"].Width = 75; apertureDefinitionGridView.Columns["Param[0]"].SortMode = DataGridViewColumnSortMode.NotSortable; apertureDefinitionGridView.Columns["Param[1]"].Width = 75; apertureDefinitionGridView.Columns["Param[1]"].SortMode = DataGridViewColumnSortMode.NotSortable; apertureDefinitionGridView.Columns["Param[2]"].Width = 75; apertureDefinitionGridView.Columns["Param[2]"].SortMode = DataGridViewColumnSortMode.NotSortable; apertureDefinitionGridView.Columns["Param[3]"].Width = 75; apertureDefinitionGridView.Columns["Param[3]"].SortMode = DataGridViewColumnSortMode.NotSortable; }
private void GetDrillUse() { DataRow row = null; DataTable drillUseTable = new DataTable(); drillUseTable.Columns.Add("Drill Number", typeof(Int32)); drillUseTable.Columns.Add("Diameter", typeof(String)); drillUseTable.Columns.Add("Units", typeof(String)); drillUseTable.Columns.Add("Count", typeof(Int32)); drillUseLabel.Text = "File: " + project.FileInfo[fileIndex].FileName; GerberFileInformation fileInfo = project.FileInfo[fileIndex]; foreach (DrillInfo drillInfo in fileInfo.Image.DrillStats.DrillInfoList) { if (drillInfo.drillCount > 0) { row = drillUseTable.NewRow(); row["Drill Number"] = drillInfo.drillNumber; row["Diameter"] = String.Format("{0:0.000000}", (float)drillInfo.drillSize); row["Units"] = drillInfo.drillUnit; row["Count"] = drillInfo.drillCount; drillUseTable.Rows.Add(row); } } drillUseDataGridView.DataSource = drillUseTable; drillUseDataGridView.AutoGenerateColumns = true; drillUseDataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect; drillUseDataGridView.RowHeadersVisible = false; drillUseDataGridView.RowTemplate.Resizable = DataGridViewTriState.False; drillUseDataGridView.Columns["Drill Number"].Width = 75; drillUseDataGridView.Columns["Drill Number"].DefaultCellStyle.BackColor = Color.LightGreen; drillUseDataGridView.Columns["Diameter"].Width = 75; drillUseDataGridView.Columns["Diameter"].SortMode = DataGridViewColumnSortMode.NotSortable; drillUseDataGridView.Columns["Units"].Width = 75; drillUseDataGridView.Columns["Units"].SortMode = DataGridViewColumnSortMode.NotSortable; drillUseDataGridView.Columns["Count"].Width = 145; drillUseDataGridView.Columns["Count"].SortMode = DataGridViewColumnSortMode.NotSortable; }