|
|
@@ -102,8 +102,8 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
|
|
|
|
|
|
string sqlp = @"select *,
|
|
|
(select group_concat(name||'-'||Percentage,';')
|
|
|
- from ElementChemistry where XRayId =MergedParticleInfo.XRayId and fieldid=MergedParticleInfo.fieldid ) as Element
|
|
|
- from MergedParticleInfo where FieldId=" + fieldid.ToString() + " and ParticleId="+ particleid.ToString();
|
|
|
+ from ElementChemistry where XRayId =IncAData.XRayId and fieldid=IncAData.fieldid ) as Element
|
|
|
+ from IncAData where FieldId=" + fieldid.ToString() + " and ParticleId="+ particleid.ToString();
|
|
|
|
|
|
DataTable DT = dbHelper.ExecuteDataTable(sqlp, null);
|
|
|
List<Particle> listp = dbHelper.TableToList<Particle>(DT);
|
|
|
@@ -316,7 +316,7 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
|
|
|
|
|
|
public DataTable GetParticleAllforparticlelist(string fieldAndPartic)
|
|
|
{
|
|
|
- string sqlp = @"select * from INcAData where typeid !=-1";
|
|
|
+ string sqlp = @"select * from INcAData where typeid !=-1 and SubParticles is not 'IsSubParticle' ";
|
|
|
if (fieldAndPartic != "")
|
|
|
{
|
|
|
sqlp = sqlp + " and '" + fieldAndPartic + "' like ('%,'||fieldid||'-'||particleid||',%')";
|
|
|
@@ -326,7 +326,7 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
|
|
|
}
|
|
|
public DataTable GetMergedParticle(string fieldAndPartic)
|
|
|
{
|
|
|
- string sqlp = @"select * from MergedParticleInfo where typeid !=-1";
|
|
|
+ string sqlp = @"select * from INcAData where typeid !=-1 and SubParticles is not 'IsSubParticle' and SubParticles is not null ";
|
|
|
if (fieldAndPartic != "")
|
|
|
{
|
|
|
sqlp = sqlp + " and '" + fieldAndPartic + "' like ('%,'||fieldid||'-'||particleid||',%')";
|
|
|
@@ -778,7 +778,7 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
|
|
|
|
|
|
public DataTable GetInfoForPartucleDevidePage_otherParticle(string condition)
|
|
|
{
|
|
|
- string sqliteString = "select fieldid,particleid,AveGray,RectLeft,RectTop,RectWidth,RectHeight,Area,PosX,PosY,TypeId,SegmentNum,SEMPosX,SEMPosY,XrayId,DMAX,DMIN,DPERP,PERIMETER,ORIENTATION,DINSCR,DMEAN,DELONG,DFERET,SubParticle,TypeName,TypeColor,'' as Element from INcAData where (xrayid > -1 and SubParticles is not 'IsSubParticle' and (typeid =9 or typeid =0 or typeid =-1 or typeid =4)) " +
|
|
|
+ string sqliteString = "select fieldid,particleid,AveGray,RectLeft,RectTop,RectWidth,RectHeight,Area,PosX,PosY,TypeId,SegmentNum,SEMPosX,SEMPosY,XrayId,DMAX,DMIN,DPERP,PERIMETER,ORIENTATION,DINSCR,DMEAN,DELONG,DFERET,SubParticles,TypeName,TypeColor,'' as Element from INcAData where (xrayid > -1 and SubParticles is not 'IsSubParticle' and (typeid =9 or typeid =-1 or typeid =4)) " +
|
|
|
condition;
|
|
|
DataTable DT = new DataTable();
|
|
|
DT = dbHelper.ExecuteQuery(sqliteString);
|
|
|
@@ -791,7 +791,7 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
|
|
|
/// <returns></returns>
|
|
|
public DataTable GetInfoForPartucleDevidePage_mergeParticles(string condition)
|
|
|
{
|
|
|
- string sqliteString = "select fieldid,particleid,AveGray,RectLeft,RectTop,RectWidth,RectHeight,Area,PosX,PosY,TypeId,SegmentNum,SEMPosX,SEMPosY,XrayId,DMAX,DMIN,DPERP,PERIMETER,ORIENTATION,DINSCR,DMEAN,DELONG,DFERET,SubParticle,TypeName,TypeColor,'' as Element from INcAData where (SubParticles Is not null and SubParticles is not 'IsSubParticle' )" + condition;
|
|
|
+ string sqliteString = "select fieldid,particleid,AveGray,RectLeft,RectTop,RectWidth,RectHeight,Area,PosX,PosY,TypeId,SegmentNum,SEMPosX,SEMPosY,XrayId,DMAX,DMIN,DPERP,PERIMETER,ORIENTATION,DINSCR,DMEAN,DELONG,DFERET,SubParticles,TypeName,TypeColor,'' as Element from INcAData where (SubParticles Is not null and SubParticles is not 'IsSubParticle' )" + condition;
|
|
|
DataTable DT1 = new DataTable();
|
|
|
try
|
|
|
{
|
|
|
@@ -806,7 +806,7 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
|
|
|
|
|
|
public DataTable GetInfoForPartucleDevidePage_allParticles(string condition)
|
|
|
{
|
|
|
- string sqliteString = "select fieldid,particleid,AveGray,RectLeft,RectTop,RectWidth,RectHeight,Area,PosX,PosY,TypeId,SegmentNum,SEMPosX,SEMPosY,XrayId,DMAX,DMIN,DPERP,PERIMETER,ORIENTATION,DINSCR,DMEAN,DELONG,DFERET,SubParticle,TypeName,TypeColor,'' as Element from INcAData where xrayid > -1 and SubParticles is not 'IsSubParticle' " +
|
|
|
+ string sqliteString = "select fieldid,particleid,AveGray,RectLeft,RectTop,RectWidth,RectHeight,Area,PosX,PosY,TypeId,SegmentNum,SEMPosX,SEMPosY,XrayId,DMAX,DMIN,DPERP,PERIMETER,ORIENTATION,DINSCR,DMEAN,DELONG,DFERET,SubParticles,TypeName,TypeColor,'' as Element from INcAData where xrayid > -1 and SubParticles is not 'IsSubParticle' " +
|
|
|
condition;
|
|
|
DataTable DT = new DataTable();
|
|
|
DT = dbHelper.ExecuteQuery(sqliteString);
|
|
|
@@ -823,7 +823,7 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
|
|
|
|
|
|
public DataTable GetInfoForPartucleDevidePage_NotIdentifyParticle(string condition)
|
|
|
{
|
|
|
- string sqliteString = "select fieldid,particleid,AveGray,RectLeft,RectTop,RectWidth,RectHeight,Area,PosX,PosY,TypeId,SegmentNum,SEMPosX,SEMPosY,XrayId,DMAX,DMIN,DPERP,PERIMETER,ORIENTATION,DINSCR,DMEAN,DELONG,DFERET,SubParticle,TypeName,TypeColor,'' as Element from INcAData where xrayid > -1 and typeid =9 " +
|
|
|
+ string sqliteString = "select fieldid,particleid,AveGray,RectLeft,RectTop,RectWidth,RectHeight,Area,PosX,PosY,TypeId,SegmentNum,SEMPosX,SEMPosY,XrayId,DMAX,DMIN,DPERP,PERIMETER,ORIENTATION,DINSCR,DMEAN,DELONG,DFERET,SubParticles,TypeName,TypeColor,'' as Element from INcAData where xrayid > -1 and typeid =9 " +
|
|
|
condition;
|
|
|
DataTable DT = new DataTable();
|
|
|
DT = dbHelper.ExecuteQuery(sqliteString);
|
|
|
@@ -831,7 +831,7 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
|
|
|
}
|
|
|
public DataTable GetInfoForPartucleDevidePage_InvalidParticle(string condition)
|
|
|
{
|
|
|
- string sqliteString = "select fieldid,particleid,AveGray,RectLeft,RectTop,RectWidth,RectHeight,Area,PosX,PosY,TypeId,SegmentNum,SEMPosX,SEMPosY,XrayId,DMAX,DMIN,DPERP,PERIMETER,ORIENTATION,DINSCR,DMEAN,DELONG,DFERET,SubParticle,TypeName,TypeColor,'' as Element from INcAData where xrayid > -1 and typeid =-1 " +
|
|
|
+ string sqliteString = "select fieldid,particleid,AveGray,RectLeft,RectTop,RectWidth,RectHeight,Area,PosX,PosY,TypeId,SegmentNum,SEMPosX,SEMPosY,XrayId,DMAX,DMIN,DPERP,PERIMETER,ORIENTATION,DINSCR,DMEAN,DELONG,DFERET,SubParticles,TypeName,TypeColor,'' as Element from INcAData where xrayid > -1 and typeid =-1 " +
|
|
|
condition;
|
|
|
DataTable DT = new DataTable();
|
|
|
DT = dbHelper.ExecuteQuery(sqliteString);
|
|
|
@@ -839,7 +839,7 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
|
|
|
}
|
|
|
public DataTable GetInfoForPartucleDevidePage_LowCountsParticle(string condition)
|
|
|
{
|
|
|
- string sqliteString = "select fieldid,particleid,AveGray,RectLeft,RectTop,RectWidth,RectHeight,Area,PosX,PosY,TypeId,SegmentNum,SEMPosX,SEMPosY,XrayId,DMAX,DMIN,DPERP,PERIMETER,ORIENTATION,DINSCR,DMEAN,DELONG,DFERET,SubParticle,TypeName,TypeColor,'' as Element from INcAData where xrayid > -1 typeid =4 " +
|
|
|
+ string sqliteString = "select fieldid,particleid,AveGray,RectLeft,RectTop,RectWidth,RectHeight,Area,PosX,PosY,TypeId,SegmentNum,SEMPosX,SEMPosY,XrayId,DMAX,DMIN,DPERP,PERIMETER,ORIENTATION,DINSCR,DMEAN,DELONG,DFERET,SubParticles,TypeName,TypeColor,'' as Element from INcAData where xrayid > -1 typeid =4 " +
|
|
|
condition;
|
|
|
DataTable DT = new DataTable();
|
|
|
DT = dbHelper.ExecuteQuery(sqliteString);
|
|
|
@@ -929,18 +929,7 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
|
|
|
/// <returns></returns>
|
|
|
public DataTable GetAllParticleWithMergeParticlesWithoutEle(string condition)
|
|
|
{
|
|
|
- DataTable particlesAll = new DataTable();
|
|
|
- DataTable particlesAll1 = GetParticleAllforparticlelist(condition);
|
|
|
- DataTable mergeParticles = GetMergedParticle(condition);
|
|
|
- if (mergeParticles != null && mergeParticles.Rows.Count > 0)
|
|
|
- {
|
|
|
- RemoveMergeParticles(ref particlesAll1, mergeParticles);
|
|
|
- }
|
|
|
- particlesAll = particlesAll1.Copy();
|
|
|
- foreach (DataRow item in mergeParticles.Rows)
|
|
|
- {
|
|
|
- particlesAll.ImportRow(item);
|
|
|
- }
|
|
|
+ DataTable particlesAll = GetParticleAllforparticlelist(condition);
|
|
|
return particlesAll;
|
|
|
}
|
|
|
|
|
|
@@ -1410,45 +1399,44 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
|
|
|
return list_showelementinfo;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- public Bitmap GetParticlescreenshot(string subt, ResultFile result)
|
|
|
- {
|
|
|
- Bitmap bmap = null;
|
|
|
- KeyValuePair<string, Bitmap> FieldImage = new KeyValuePair<string, Bitmap>();
|
|
|
- if (subt != null && subt != "" && subt != "IsSubParticle")
|
|
|
- {
|
|
|
- double ScanFieldSize = result.GetScanFieldSizeX();
|
|
|
- string filePatht = result.FilePath + "\\FIELD_FILES\\";
|
|
|
- string imagePatht = filePatht + "Field" + subt.Split(',')[0].Split(':')[0].ToString() + ".bmp";
|
|
|
- Bitmap tempbit = ReadImageFile(imagePatht);
|
|
|
- int pixw = tempbit.Width;
|
|
|
- double xs = pixw / ScanFieldSize;
|
|
|
- OTS_X_AXIS_DIRECTION X_AXIS_DIRECTION = result.GetXAxisDirEnum();
|
|
|
- OTS_Y_AXIS_DIRECTION Y_AXIS_DIRECTION = result.GetYAxisDirEnum();
|
|
|
+ //public Bitmap GetParticlescreenshot(string subt, ResultFile result)
|
|
|
+ //{
|
|
|
+ // Bitmap bmap = null;
|
|
|
+ // KeyValuePair<string, Bitmap> FieldImage = new KeyValuePair<string, Bitmap>();
|
|
|
+ // if (subt != null && subt != "" && subt != "IsSubParticle")
|
|
|
+ // {
|
|
|
+ // double ScanFieldSize = result.GetScanFieldSizeX();
|
|
|
+ // string filePatht = result.FilePath + "\\FIELD_FILES\\";
|
|
|
+ // string imagePatht = filePatht + "Field" + subt.Split(',')[0].Split(':')[0].ToString() + ".bmp";
|
|
|
+ // Bitmap tempbit = ReadImageFile(imagePatht);
|
|
|
+ // int pixw = tempbit.Width;
|
|
|
+ // double xs = pixw / ScanFieldSize;
|
|
|
+ // OTS_X_AXIS_DIRECTION X_AXIS_DIRECTION = result.GetXAxisDirEnum();
|
|
|
+ // OTS_Y_AXIS_DIRECTION Y_AXIS_DIRECTION = result.GetYAxisDirEnum();
|
|
|
|
|
|
|
|
|
- bmap = GetBitmapForBig(subt, xs, result.FilePath, tempbit.Height, tempbit.Width, X_AXIS_DIRECTION, Y_AXIS_DIRECTION);
|
|
|
- if (bmap != null)
|
|
|
- {
|
|
|
- string[] str = subt.Split(',');
|
|
|
- //bmap.Tag = new List<string>() { str[0].Split(':')[0], str[0].Split(':')[1], particles.Rows[i]["TypeId"].ToString() };
|
|
|
- }
|
|
|
- }
|
|
|
- else if (subt != "IsSubParticle")
|
|
|
- {
|
|
|
- //if (FieldImage.Key != particles.Rows[i]["fieldid"].ToString() || FieldImage.Value == null)
|
|
|
- //{
|
|
|
- // string imagePath = filePath + "Field" + particles.Rows[i]["fieldid"].ToString() + ".bmp";
|
|
|
- // FieldImage = new KeyValuePair<string, Bitmap>(particles.Rows[i]["fieldid"].ToString(), Particledata.ReadImageFile(imagePath));
|
|
|
- //}
|
|
|
- //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 = GetBitmapByParticle(FieldImage.Value, rectangle);
|
|
|
- //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;
|
|
|
- }
|
|
|
- return bmap;
|
|
|
- }
|
|
|
+ // bmap = GetBitmapForBig(subt, xs, result.FilePath, tempbit.Height, tempbit.Width, X_AXIS_DIRECTION, Y_AXIS_DIRECTION);
|
|
|
+ // if (bmap != null)
|
|
|
+ // {
|
|
|
+ // string[] str = subt.Split(',');
|
|
|
+ // bmap.Tag = new List<string>() { str[0].Split(':')[0], str[0].Split(':')[1]};
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // else if (subt != "IsSubParticle")
|
|
|
+ // {
|
|
|
+ // if (FieldImage.Key != particles.Rows[i]["fieldid"].ToString() || FieldImage.Value == null)
|
|
|
+ // {
|
|
|
+ // string imagePath = filePath + "Field" + particles.Rows[i]["fieldid"].ToString() + ".bmp";
|
|
|
+ // FieldImage = new KeyValuePair<string, Bitmap>(particles.Rows[i]["fieldid"].ToString(), Particledata.ReadImageFile(imagePath));
|
|
|
+ // }
|
|
|
+ // 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 = GetBitmapByParticle(FieldImage.Value, rectangle);
|
|
|
+ // 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;
|
|
|
+ // }
|
|
|
+ // return bmap;
|
|
|
+ //}
|
|
|
#endregion
|
|
|
|
|
|
|