|
@@ -152,27 +152,40 @@ namespace OTSModelSharp
|
|
|
|
|
|
String strIncAFilename = strFieldFileSubFolder + "\\" + SMPL_MSR_RESULT_INCLUSION_FILE;
|
|
|
//CIncAFileMgr pIncAFileMgr = new CIncAFileMgr(strIncAFilename);
|
|
|
- List<COTSFieldData> allFlds = new List<COTSFieldData>();
|
|
|
+ List<COTSFieldData> allMeasuredFlds = new List<COTSFieldData>();
|
|
|
CMsrSampleStatus poMsrStatus = new CMsrSampleStatus();
|
|
|
|
|
|
CMsrDisplayResults poMsrResults = smpl.GetMsrResults();
|
|
|
double aFldArea = smpl.CalculateAFieldArea();
|
|
|
SetPathName(strIncAFilename);
|
|
|
- if (GetAllFieldsFromDB(ref allFlds,ref poMsrStatus, poMsrResults, aFldArea))
|
|
|
+ if (GetAllFieldsFromDB(ref allMeasuredFlds,ref poMsrStatus, poMsrResults, aFldArea))
|
|
|
{
|
|
|
|
|
|
|
|
|
- var nodataFields = smpl.GetFieldsData();//there's only the field postion info.
|
|
|
- List<COTSFieldData> allflddata = new List<COTSFieldData>() ;//contains the field data that store in the database;
|
|
|
-
|
|
|
+ var nodataFields = smpl.GetFieldsData();//there's only the field postion info in the xml file,so the initial filed has only postion info.
|
|
|
+ List<COTSFieldData> allflddata = new List<COTSFieldData>() ;//contains all the field
|
|
|
+ //------------complete the infomation that doesn't contained in database-----
|
|
|
+ int w, h;
|
|
|
+ smpl.GetBSESize(out w, out h);
|
|
|
+ double pixelsize = smpl.CalculatePixelSize();
|
|
|
+ foreach (var f in allMeasuredFlds)
|
|
|
+ {
|
|
|
+ f.SetPixelSize(pixelsize);
|
|
|
+ f.Width = w;
|
|
|
+ f.Height = h;
|
|
|
+ f.SetIsMeasureComplete(true);
|
|
|
+
|
|
|
+ }
|
|
|
+ //------------------------------
|
|
|
foreach (var emptyfld in nodataFields)
|
|
|
{
|
|
|
bool isMeasured = false;
|
|
|
- foreach (var fldwithdata in allFlds)
|
|
|
+ foreach (var measuredField in allMeasuredFlds)
|
|
|
{
|
|
|
- if (fldwithdata.Equals(emptyfld))
|
|
|
+ if (measuredField.PositionEquals(emptyfld))
|
|
|
{
|
|
|
- allflddata.Add(fldwithdata);
|
|
|
+
|
|
|
+ allflddata.Add(measuredField);
|
|
|
isMeasured = true;
|
|
|
break;
|
|
|
}
|
|
@@ -269,20 +282,19 @@ namespace OTSModelSharp
|
|
|
|
|
|
if (!FileExists(sDatabaseName))
|
|
|
{
|
|
|
-
|
|
|
-
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
- List<System.Drawing.PointF> completedflds = new List<System.Drawing.PointF>();
|
|
|
+ List<System.Drawing.PointF> completedFldPositions = new List<System.Drawing.PointF>();
|
|
|
CIncAFileMgr incAFileMgr = new CIncAFileMgr(sDatabaseName);
|
|
|
var m_IncADataDB = incAFileMgr.GetIncADB();
|
|
|
- m_IncADataDB.GetAllFieldsRecord(ref allFlds);
|
|
|
+ List<COTSFieldData> allFldsWithdata=new List<COTSFieldData>();
|
|
|
+ m_IncADataDB.GetAllFieldsRecord(ref allFldsWithdata);
|
|
|
|
|
|
var eleChemistryDB = incAFileMgr.GetPosXrayDBMgr().GetElementChemistryDB();
|
|
|
Dictionary<string, CPosXrayClr> mapXrayInfo=new Dictionary<string, CPosXrayClr>();
|
|
|
eleChemistryDB.GetAllMapedXrayInfo(ref mapXrayInfo);
|
|
|
- foreach (var f in allFlds)
|
|
|
+ foreach (var f in allFldsWithdata)
|
|
|
{
|
|
|
foreach (var p in f.GetListAnalysisParticles())
|
|
|
{
|
|
@@ -306,7 +318,7 @@ namespace OTSModelSharp
|
|
|
var xrayDataDBDB = incAFileMgr.GetPosXrayDBMgr().GetXrayDataDB();
|
|
|
Dictionary<string, CPosXrayClr> mapXrayData=new Dictionary<string, CPosXrayClr>();// map structure:[(fieldId,xrayId),CPosXrayPtr],every element of this map represent one unique xraydata.
|
|
|
xrayDataDBDB.GetAllMapedXrayData(ref mapXrayData);
|
|
|
- foreach (var f in allFlds)
|
|
|
+ foreach (var f in allFldsWithdata)
|
|
|
{
|
|
|
foreach (var p in f.GetListAnalysisParticles())
|
|
|
{
|
|
@@ -342,7 +354,7 @@ namespace OTSModelSharp
|
|
|
if (SegmentDB.GetAllSegmentsRecord(mapSegments))
|
|
|
{
|
|
|
|
|
|
- foreach (var fld in allFlds)
|
|
|
+ foreach (var fld in allFldsWithdata)
|
|
|
{
|
|
|
int fldId = fld.GetId();
|
|
|
List<COTSParticleClr> parts = fld.GetListAnalysisParticles();
|
|
@@ -380,6 +392,45 @@ namespace OTSModelSharp
|
|
|
|
|
|
|
|
|
}
|
|
|
+ }
|
|
|
+
|
|
|
+ var fielddb = incAFileMgr.GetFieldDB();
|
|
|
+ var fielddata = fielddb.GetTableQueryForDataTable();
|
|
|
+
|
|
|
+ foreach (DataRow r in fielddata.Rows)
|
|
|
+ {
|
|
|
+ var p = new Point(Convert.ToInt32(r[(int)CFieldTable.ColumnID.N_FIELDPOS_X]), Convert.ToInt32(r[(int)CFieldTable.ColumnID.N_FIELDPOS_Y]));
|
|
|
+ completedFldPositions.Add(p);
|
|
|
+ }
|
|
|
+
|
|
|
+ status.SetCompletedFieldsCenter(completedFldPositions);
|
|
|
+
|
|
|
+
|
|
|
+ //add the empty field(there's no any particle in the bse image,so the field empty)
|
|
|
+ foreach (var p in completedFldPositions)
|
|
|
+ {
|
|
|
+ bool haveData=false;
|
|
|
+ var emptyFld = new COTSFieldData();
|
|
|
+ emptyFld.SetOTSPosition(p);
|
|
|
+ foreach (var fld in allFldsWithdata)
|
|
|
+ {
|
|
|
+
|
|
|
+ if (fld.PositionEquals(emptyFld))
|
|
|
+ {
|
|
|
+ haveData = true;
|
|
|
+ allFlds.Add(fld);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ if (!haveData)
|
|
|
+ {
|
|
|
+ allFlds.Add(emptyFld);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
// get MsrStatus info from DB.
|
|
|
var m_GenInfoDB = incAFileMgr.GetGeneralInfoDB();//DBStoreFile类
|
|
|
String strTimeStart = "";
|
|
@@ -389,16 +440,7 @@ namespace OTSModelSharp
|
|
|
m_GenInfoDB.GetStringValue(m_GenInfoDB.GetTableItemNameTimeStart(), ref strTimeStart);
|
|
|
m_GenInfoDB.GetStringValue(m_GenInfoDB.GetTableItemNameTimeEnd(), ref strTimeEnd);
|
|
|
m_GenInfoDB.GetStringValue(m_GenInfoDB.GetTableItemNameResultStatus(), ref strRstStatus);
|
|
|
- var fielddb = incAFileMgr.GetFieldDB();
|
|
|
- var fielddata = fielddb.GetTableQueryForDataTable();
|
|
|
-
|
|
|
- foreach (DataRow r in fielddata.Rows)
|
|
|
- {
|
|
|
- var p = new Point(Convert.ToInt32( r[(int)CFieldTable.ColumnID.N_FIELDPOS_X]),Convert.ToInt32( r[(int)CFieldTable.ColumnID.N_FIELDPOS_Y]));
|
|
|
- completedflds.Add(p);
|
|
|
- }
|
|
|
-
|
|
|
- status.SetCompletedFieldsCenter(completedflds);
|
|
|
+
|
|
|
|
|
|
|
|
|
DateTime timeStart, timeEnd;
|
|
@@ -442,8 +484,8 @@ namespace OTSModelSharp
|
|
|
rst.SetMeasuredArea(Convert.ToUInt64(msrFldsArea * 1000000));
|
|
|
rst.SetRatio(allPartArea / (msrFldsArea * 1000000));
|
|
|
return true;
|
|
|
- }
|
|
|
- return false;
|
|
|
+
|
|
|
+ //return false;
|
|
|
}
|
|
|
|
|
|
string ConvertFormatOfDateString(string Time)
|