|
|
@@ -89,7 +89,7 @@ namespace OTSIncAReportGrids
|
|
|
|
|
|
frmReportConditionChoose m_condition;
|
|
|
FieldData fieldData;
|
|
|
- DataTable particlesAll;
|
|
|
+ DataTable particlesAll;
|
|
|
DataTable particles;
|
|
|
ParticleData Particledata;
|
|
|
UserLibraryData userLibrary;
|
|
|
@@ -185,7 +185,8 @@ namespace OTSIncAReportGrids
|
|
|
if (sou.Contains("+"))
|
|
|
{
|
|
|
result = m_ReportApp.m_rstDataMgr.ResultFilesList[0];
|
|
|
- } else
|
|
|
+ }
|
|
|
+ else
|
|
|
{
|
|
|
for (int i = 0; i < m_ReportApp.m_rstDataMgr.ResultFilesList.Count; i++)
|
|
|
{
|
|
|
@@ -230,16 +231,16 @@ namespace OTSIncAReportGrids
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- string str_libraryName = ((Dictionary<string, object>)((Dictionary<string, object>)((Dictionary<string, object>)result.ResultInfo["Sample"])["Members"])["MsrParams"])["STDName"].ToString();
|
|
|
- userLibrary = new UserLibraryData(str_libraryName);
|
|
|
+ string str_libraryName = ((Dictionary<string, object>)((Dictionary<string, object>)((Dictionary<string, object>)result.ResultInfo["Sample"])["Members"])["MsrParams"])["STDName"].ToString();
|
|
|
+ userLibrary = new UserLibraryData(str_libraryName);
|
|
|
if (userLibrary.GetSqlHelper() != null)
|
|
|
- {
|
|
|
- userLibraryData = userLibrary.GetSubAttributeFromDatabase();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- userLibraryData = null;
|
|
|
- }
|
|
|
+ {
|
|
|
+ userLibraryData = userLibrary.GetSubAttributeFromDatabase();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ userLibraryData = null;
|
|
|
+ }
|
|
|
}
|
|
|
//初始化底层操作类
|
|
|
m_OTSIncAReportGridsFun = new OTSReportGridsFun(m_ReportApp, this);
|
|
|
@@ -276,7 +277,7 @@ namespace OTSIncAReportGrids
|
|
|
}
|
|
|
|
|
|
#region 自定义方法
|
|
|
-
|
|
|
+
|
|
|
bool UpdateTable()
|
|
|
{
|
|
|
int sel = m_ReportApp.m_conditionChoose.m_SourceGridData.GetComboDownListIndexByItemName(OTSIncAReportApp.OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE);
|
|
|
@@ -319,7 +320,7 @@ namespace OTSIncAReportGrids
|
|
|
for (int i = 0; i < selectParticles.Count; i++)
|
|
|
{
|
|
|
dtUelect.Rows.Add(selectParticles[i].FieldId, selectParticles[i].ParticleId, selectParticles[i].AveGray, selectParticles[i].RectLeft, selectParticles[i].RectTop, selectParticles[i].RectWidth, selectParticles[i].RectHeight, selectParticles[i].Area, selectParticles[i].PosX, selectParticles[i].PosX, selectParticles[i].TypeId, /*selectParticles[i].ElementNum,*/ selectParticles[i].SegmentNum, selectParticles[i].SEMPosX, selectParticles[i].SEMPosY, selectParticles[i].ParticleId, selectParticles[i].DMAX, selectParticles[i].DMIN, selectParticles[i].DPERP, selectParticles[i].PERIMETER, selectParticles[i].ORIENTATION, selectParticles[i].DINSCR, selectParticles[i].DMEAN, selectParticles[i].DELONG, selectParticles[i].DFERET, selectParticles[i].TypeName, selectParticles[i].TypeColor, "", "", "", "", "");
|
|
|
- }
|
|
|
+ }
|
|
|
if (userLibraryData != null)
|
|
|
{
|
|
|
for (int i = 0; i < dtUelect.Rows.Count; i++)
|
|
|
@@ -845,7 +846,7 @@ namespace OTSIncAReportGrids
|
|
|
|
|
|
Rectangle rectangle = new Rectangle() { X = Convert.ToInt32(particles.Rows[i]["RectLeft"]), Y = Convert.ToInt32(particles.Rows[i]["RectTop"]), Width = Convert.ToInt32(particles.Rows[i]["RectWidth"]), Height = Convert.ToInt32(particles.Rows[i]["RectHeight"]) };
|
|
|
Bitmap bmap = Particledata.GetBitmapByParticle(FieldImage.Value, rectangle);
|
|
|
- bmap.Tag = new List<string>() { particles.Rows[i]["FieldId"].ToString(), particles.Rows[i]["ParticleId"].ToString(), particles.Rows[i]["TypeId"].ToString() };
|
|
|
+ bmap.Tag = new List<string>() { particles.Rows[i]["FieldId"].ToString(), particles.Rows[i]["ParticleId"].ToString(), particles.Rows[i]["TypeId"].ToString(), particles.Rows[i]["XrayId"].ToString() };
|
|
|
dgV_ParticlesDevidePage.Rows[add_rowindex].Cells[k].Value = bmap;
|
|
|
dgV_ParticlesDevidePage.Rows[add_rowindex].Height = bmap.Height + 20;
|
|
|
}
|
|
|
@@ -905,7 +906,7 @@ namespace OTSIncAReportGrids
|
|
|
{
|
|
|
string str = ChangeHardnessColor(particles.Rows[i]["Hardness"].ToString());
|
|
|
{
|
|
|
- if(str== "#FF0000")
|
|
|
+ if (str == "#FF0000")
|
|
|
{
|
|
|
dgV_ParticlesDevidePage.Rows[add_rowindex].Cells[k].Style.ForeColor = Color.Red;
|
|
|
}
|
|
|
@@ -1833,7 +1834,7 @@ namespace OTSIncAReportGrids
|
|
|
fs.Close();
|
|
|
|
|
|
sheet = workbook.CreateSheet("Particles");//创建工作表
|
|
|
-
|
|
|
+
|
|
|
|
|
|
//创建表格边框样式风格
|
|
|
ICellStyle cellStyle = workbook.CreateCellStyle();
|
|
|
@@ -1933,8 +1934,8 @@ namespace OTSIncAReportGrids
|
|
|
|
|
|
for (int i_cell = 1; i_cell < 2001; i_cell++)
|
|
|
{
|
|
|
- cell = row.CreateCell(i_cell);
|
|
|
- cell.CellStyle = cellStyle;
|
|
|
+ cell = row.CreateCell(i_cell);
|
|
|
+ cell.CellStyle = cellStyle;
|
|
|
if (i_cell == 1)
|
|
|
{
|
|
|
cell.SetCellValue("PeakSpectrumData");
|
|
|
@@ -2022,14 +2023,14 @@ namespace OTSIncAReportGrids
|
|
|
void CreateChart(IDrawing drawing, ISheet sheet, IClientAnchor anchor, int rowid)
|
|
|
{
|
|
|
var chart = drawing.CreateChart(anchor) as XSSFChart;
|
|
|
-
|
|
|
+
|
|
|
//图表
|
|
|
var data = chart.ChartDataFactory.CreateLineChartData<double, double>(); //折线图
|
|
|
|
|
|
IChartAxis bottomAxis = chart.ChartAxisFactory.CreateCategoryAxis(AxisPosition.Bottom);
|
|
|
-
|
|
|
+
|
|
|
IValueAxis leftAxis = chart.ChartAxisFactory.CreateValueAxis(AxisPosition.Left);
|
|
|
- leftAxis.Crosses=AxisCrosses.AutoZero;
|
|
|
+ leftAxis.Crosses = AxisCrosses.AutoZero;
|
|
|
leftAxis.IsVisible = true;
|
|
|
bottomAxis.IsVisible = true;
|
|
|
//数据源
|
|
|
@@ -2041,7 +2042,7 @@ namespace OTSIncAReportGrids
|
|
|
doubles[i] = i;
|
|
|
}
|
|
|
IChartDataSource<double> xs = DataSources.FromArray(doubles);
|
|
|
-
|
|
|
+
|
|
|
//数据系列
|
|
|
var s1 = data.AddSeries(xs, ys);
|
|
|
|
|
|
@@ -2376,10 +2377,73 @@ namespace OTSIncAReportGrids
|
|
|
GC.Collect();
|
|
|
GC.WaitForPendingFinalizers();
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
|
|
|
+ private void ImportSTDDb_Click(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ Dictionary<string, object> sampleMembers = ((Dictionary<string, object>)((Dictionary<string, object>)resultFile.ResultInfo["Sample"])["Members"]);
|
|
|
+ string STDName = ((Dictionary<string, object>)sampleMembers["MsrParams"])["STDName"].ToString();
|
|
|
+ string ResultDbPath = resultFile.FilePath + "\\FIELD_FILES\\Inclusion.db";
|
|
|
+ if (STDName.ToLower().Split('.')[0] == "nostddb")
|
|
|
+ {
|
|
|
+ OpenFileDialog openFileDialog = new OpenFileDialog();
|
|
|
+ openFileDialog.Filter = "(*.db)|*.db";
|
|
|
+ openFileDialog.RestoreDirectory = true;
|
|
|
+ openFileDialog.FilterIndex = 1;
|
|
|
+ openFileDialog.Title = "Please choose a STD to add the rule!";
|
|
|
+ if (openFileDialog.ShowDialog() == DialogResult.OK)
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ string arguments = openFileDialog.FileName;
|
|
|
+ var SelectRows= dgV_ParticlesDevidePage.SelectedRows;
|
|
|
+ DataGridViewRow dgvr = SelectRows[0];
|
|
|
+ Bitmap ls_bp = (Bitmap)dgvr.Cells[2].Value;
|
|
|
+ List<string> list_str = (List<string>)ls_bp.Tag;
|
|
|
+ arguments += " " + ResultDbPath + " " + list_str[0].ToString() + " " + list_str[1].ToString() + " " + list_str[3].ToString();
|
|
|
+ System.Diagnostics.Process p = System.Diagnostics.Process.Start(".\\OTSPartA_STDEditor.exe", arguments);
|
|
|
+ p.WaitForExit();
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ log.Error("OTSPartA_STDEditor:" + ex.ToString());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ string arguments = ".\\Config\\SysData\\" + STDName.Split('.')[0] + ".db";
|
|
|
+ var selectRow = dgV_ParticlesDevidePage.SelectedRows[0];
|
|
|
+ Bitmap ls_bp = (Bitmap)selectRow.Cells[2].Value;
|
|
|
+ List<string> list_str = (List<string>)ls_bp.Tag;
|
|
|
+ arguments += " " + ResultDbPath + " " + list_str[0].ToString() + " " + list_str[1].ToString() + " " + list_str[3].ToString();
|
|
|
+ System.Diagnostics.Process p = System.Diagnostics.Process.Start(".\\OTSPartA_STDEditor.exe", arguments);
|
|
|
+ p.WaitForExit();
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
+ private void dgV_ParticlesDevidePage_MouseDown(object sender, MouseEventArgs e)
|
|
|
+ {
|
|
|
|
|
|
+ var SelectRows = dgV_ParticlesDevidePage.SelectedRows;
|
|
|
+ if (SelectRows != null && SelectRows.Count == 1)
|
|
|
+ {
|
|
|
+ DataGridViewRow dgvr = SelectRows[0];
|
|
|
+ Bitmap ls_bp = (Bitmap)dgvr.Cells[2].Value;
|
|
|
+ List<string> list_str = (List<string>)ls_bp.Tag;
|
|
|
+ //if (list_str[2].ToString() == "9")
|
|
|
+ //{
|
|
|
+ contextMenuStrip1.Items[11].Visible = true;
|
|
|
+ //}
|
|
|
+ //else
|
|
|
+ //{
|
|
|
+ // contextMenuStrip1.Items[11].Visible = false;
|
|
|
+ //}
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ contextMenuStrip1.Items[11].Visible = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|