|
|
@@ -5,10 +5,13 @@ using System.Data.SQLite;
|
|
|
|
|
|
using System.Drawing;
|
|
|
using System.Linq;
|
|
|
-
|
|
|
+using Microsoft.Office.Interop.Excel;
|
|
|
using OTSCLRINTERFACE;
|
|
|
using OTSDataType;
|
|
|
+using OTSMeasureApp._0_OTSModel.OTSDataType;
|
|
|
using OTSModelSharp.DTLBase;
|
|
|
+using DataTable = System.Data.DataTable;
|
|
|
+using Rectangle = System.Drawing.Rectangle;
|
|
|
|
|
|
namespace OTSModelSharp
|
|
|
{
|
|
|
@@ -25,9 +28,17 @@ namespace OTSModelSharp
|
|
|
//Rectangle prec = (Rectangle)a_pParticle.GetParticleRect();
|
|
|
//System.Drawing.Point pos = (System.Drawing.Point)a_pParticle.GetSEMPos();
|
|
|
|
|
|
- Rectangle rec = (Rectangle)a_pParticle.GetParticleRect();
|
|
|
+ System.Drawing.Rectangle rec = (System.Drawing.Rectangle)a_pParticle.GetParticleRect();
|
|
|
System.Drawing.Point xrayPos = (System.Drawing.Point)a_pParticle.GetXRayPos();
|
|
|
System.Drawing.Point semPos = (System.Drawing.Point)a_pParticle.GetSEMPos();
|
|
|
+ System.Drawing.Point otsfieldPos= (System.Drawing.Point)a_pParticle.GetFieldOTSPos();
|
|
|
+ //int l = 0;
|
|
|
+ //int t = 0;
|
|
|
+ //int r = 0;
|
|
|
+ //int b = 0;
|
|
|
+ //a_pParticle.GetOTSRect(ref l, ref t, ref r, ref b);
|
|
|
+ //COTSRect cOTSRect = new COTSRect(l,t,r,b);
|
|
|
+ //System.Drawing.PointF otsPos=cOTSRect.GetCenterPoint();
|
|
|
String sInsertFormat = tableInfoPtr.GetInsertCommandFormatString(true);
|
|
|
var cmd = tableInfoPtr.GetInsertCommand(true);
|
|
|
|
|
|
@@ -45,8 +56,8 @@ namespace OTSModelSharp
|
|
|
|
|
|
paras[10].Value = a_pParticle.GetFeretDiameter();
|
|
|
paras[11].Value = (int)(a_pParticle.GetFeature().GetSegmentsList().Count);
|
|
|
- paras[12].Value = semPos.X;
|
|
|
- paras[13].Value = semPos.Y;
|
|
|
+ paras[12].Value = otsfieldPos.X;
|
|
|
+ paras[13].Value = otsfieldPos.Y;
|
|
|
paras[14].Value = a_pParticle.GetParticleId();
|
|
|
paras[15].Value = a_pParticle.GetDMAX();
|
|
|
paras[16].Value = a_pParticle.GetDMIN();
|
|
|
@@ -138,7 +149,7 @@ namespace OTSModelSharp
|
|
|
return new KeyValuePair<string, SQLiteParameter[]>(sSQLCommand,paras);
|
|
|
}
|
|
|
|
|
|
- public KeyValuePair<string,SQLiteParameter[]> GegInsertingAnParticleCmd(COTSParticleClr a_pParticle, System.Drawing.PointF fldPos)
|
|
|
+ public KeyValuePair<string,SQLiteParameter[]> GegInsertingAnParticleCmd(COTSParticleClr a_pParticle)
|
|
|
{
|
|
|
|
|
|
var tableInfoPtr = GetTableInfo();
|
|
|
@@ -148,11 +159,11 @@ namespace OTSModelSharp
|
|
|
|
|
|
var sInsertCmd = tableInfoPtr.GetInsertCommand(true);
|
|
|
|
|
|
- Rectangle rec = (Rectangle)a_pParticle.GetParticleRect();
|
|
|
+ System.Drawing.Rectangle rec = (System.Drawing.Rectangle)a_pParticle.GetParticleRect();
|
|
|
System.Drawing.Point xrayPos = (System.Drawing.Point)a_pParticle.GetXRayPos();
|
|
|
System.Drawing.Point semPos = (System.Drawing.Point)a_pParticle.GetSEMPos();
|
|
|
-
|
|
|
-
|
|
|
+ System.Drawing.Point fldOTSPos = (System.Drawing.Point)a_pParticle.GetFieldOTSPos();
|
|
|
+
|
|
|
var paras = sInsertCmd.Value;
|
|
|
paras[0].Value = a_pParticle.GetFieldId();
|
|
|
paras[1].Value = a_pParticle.GetAnalysisId();
|
|
|
@@ -167,8 +178,8 @@ namespace OTSModelSharp
|
|
|
|
|
|
paras[10].Value = a_pParticle.GetFeretDiameter();
|
|
|
paras[11].Value = (int)(a_pParticle.GetFeature().GetSegmentsList().Count);
|
|
|
- paras[12].Value = fldPos.X;
|
|
|
- paras[13].Value = fldPos.Y;
|
|
|
+ paras[12].Value = fldOTSPos.X;
|
|
|
+ paras[13].Value = fldOTSPos.Y;
|
|
|
paras[14].Value = a_pParticle.GetParticleId();
|
|
|
paras[15].Value = a_pParticle.GetDMAX();
|
|
|
paras[16].Value = a_pParticle.GetDMIN();
|
|
|
@@ -203,16 +214,22 @@ namespace OTSModelSharp
|
|
|
if (!mapFld.Keys.Contains(curFldId))
|
|
|
{
|
|
|
System.Drawing.Point fldPos = new System.Drawing.Point();
|
|
|
- fldPos.X = Convert.ToInt32(allRecords.Rows[i][(int)CIncADataTable.ColumnID.N_FldPosX]);
|
|
|
- fldPos.Y = Convert.ToInt32(allRecords.Rows[i][(int)CIncADataTable.ColumnID.N_FldPosY]);
|
|
|
+ fldPos.X = Convert.ToInt32(allRecords.Rows[i][(int)CIncADataTable.ColumnID.N_FieldPosX]);
|
|
|
+ fldPos.Y = Convert.ToInt32(allRecords.Rows[i][(int)CIncADataTable.ColumnID.N_FieldPosY]);
|
|
|
+ System.Drawing.Point fldSEMPos = new System.Drawing.Point();
|
|
|
+ fldSEMPos.X = Convert.ToInt32(allRecords.Rows[i][(int)CIncADataTable.ColumnID.N_SEMPOS_X]);
|
|
|
+ fldSEMPos.Y = Convert.ToInt32(allRecords.Rows[i][(int)CIncADataTable.ColumnID.N_SEMPOS_Y]);
|
|
|
|
|
|
COTSField fld = new COTSField(new PointF(fldPos.X,fldPos.Y),pixelsize);
|
|
|
|
|
|
fld.SetId(Convert.ToInt32(allRecords.Rows[i][(int)CIncADataTable.ColumnID.N_FIELD_ID]));
|
|
|
fld.SetOTSPosition(fldPos);
|
|
|
+ fld.SetSemPos(fldSEMPos);
|
|
|
List<COTSParticleClr> ps = fld.GetListAnalysisParticles();
|
|
|
COTSParticleClr p = new COTSParticleClr();
|
|
|
p.SetFieldId(fld.GetId());
|
|
|
+ p.SetFieldOTSPos(fldPos);
|
|
|
+ p.SetSEMPos(fldSEMPos);
|
|
|
p.SetParticleId(Convert.ToInt32(allRecords.Rows[i][(int)CIncADataTable.ColumnID.N_PARTICLE_ID]));
|
|
|
|
|
|
int top = Convert.ToInt32(allRecords.Rows[i][(int)CIncADataTable.ColumnID.N_RECT_TOP]);
|
|
|
@@ -249,10 +266,18 @@ namespace OTSModelSharp
|
|
|
{
|
|
|
COTSField fld = mapFld[curFldId];
|
|
|
List<COTSParticleClr> ps = fld.GetListAnalysisParticles();
|
|
|
+ System.Drawing.Point fldPos = new System.Drawing.Point();
|
|
|
+ fldPos.X = Convert.ToInt32(allRecords.Rows[i][(int)CIncADataTable.ColumnID.N_FieldPosX]);
|
|
|
+ fldPos.Y = Convert.ToInt32(allRecords.Rows[i][(int)CIncADataTable.ColumnID.N_FieldPosY]);
|
|
|
+ System.Drawing.Point fldSEMPos = new System.Drawing.Point();
|
|
|
+ fldSEMPos.X = Convert.ToInt32(allRecords.Rows[i][(int)CIncADataTable.ColumnID.N_SEMPOS_X]);
|
|
|
+ fldSEMPos.Y = Convert.ToInt32(allRecords.Rows[i][(int)CIncADataTable.ColumnID.N_SEMPOS_Y]);
|
|
|
COTSParticleClr p = new COTSParticleClr();
|
|
|
p.SetFieldId(fld.GetId());
|
|
|
+ p.SetFieldOTSPos(fld.GetOTSPosition());
|
|
|
p.SetParticleId(Convert.ToInt32(allRecords.Rows[i][(int)CIncADataTable.ColumnID.N_PARTICLE_ID]));
|
|
|
-
|
|
|
+ p.SetSEMPos(fldSEMPos);
|
|
|
+ p.SetFieldOTSPos(fldPos);
|
|
|
int top = Convert.ToInt32(allRecords.Rows[i][(int)CIncADataTable.ColumnID.N_RECT_TOP]);
|
|
|
int left = Convert.ToInt32(allRecords.Rows[i][(int)CIncADataTable.ColumnID.N_RECT_LEFT]);
|
|
|
int width = Convert.ToInt32(allRecords.Rows[i][(int)CIncADataTable.ColumnID.N_RECT_WIDTH]);
|