Browse Source

Merge branch 'dev' of http://192.168.1.123:10080/gaoshipeng/OTS2_0 into dev

CXS 5 years ago
parent
commit
c38df4e068

+ 2 - 1
OTS/OTSModelSharp/Measure/GetStageInfo/StageFile.cs

@@ -625,7 +625,8 @@ namespace OTSModelSharp
             int nDiameter_nHeight = nValue;
 
             // create domain
-            Rect aa =new rectDomain(0, 0, nDiameter_Width, nDiameter_nHeight);
+            Rectangle rectDomain = new Rectangle();
+               // (0, 0, nDiameter_Width, nDiameter_nHeight);
             pDomain = new CDomain(nShape, rectDomain);
             pDomain.OffsetDomain(new System.Drawing.Point(nCentreX - (nDiameter_Width / 2), nCentreY - (nDiameter_nHeight / 2)));
             // return the domain pointer

+ 24 - 18
OTS/OTSModelSharp/Measure/GetXrayInfo/PosXrayFileMgr.cs

@@ -38,12 +38,16 @@ namespace OTSModelSharp
 
         IMeasureHardware m_MeasureHardware;
 
+        CSQLiteTable cSQLiteTable = new CSQLiteTable();
+
         //public
         public CPosXrayFileMgr(String fileName)
         {
             // initialization
             m_strPathName = fileName;
             Init();
+            var posXrayDB = this.GetXrayInfoDB();
+            posXrayDB.Init();
         }
         //Create
         public bool CreateXrayFile()
@@ -257,7 +261,7 @@ namespace OTSModelSharp
 
             // find max value
             UInt32 nMax = nXrayData[0];
-            for (int i = 0; i < otsdataconst.GENERALXRAYCHANNELS; i++)
+            for (uint i = 0; i < otsdataconst.GENERALXRAYCHANNELS; i++)
             {
                 if (nXrayData[i] > nMax)
                     nMax = nXrayData[i];
@@ -281,14 +285,14 @@ namespace OTSModelSharp
             // find range
             List<uint> listUp = new List<uint>();
             List<uint> listDown = new List<uint>();
-            //listUp.Clear();
+            listUp.Clear();
             for (uint i = 0; i < otsdataconst.GENERALXRAYCHANNELS - 1; i++)
             {
                 if (nXrayData[i] == 0 && nXrayData[i + 1] == nMax)
                     listUp.Add(i);
             }
 
-            //listDown.clear();
+            listDown.Clear();
             for (uint i = 1; i < otsdataconst.GENERALXRAYCHANNELS; i++)
             {
                 if (nXrayData[i] == nMax && nXrayData[i + 1] == 0)
@@ -351,6 +355,8 @@ namespace OTSModelSharp
             nXrayData = null;//delete[] nXrayData;
             nXrayDataOld = null;//delete[] nXrayDataOld;
 
+           
+
             // ok, return TRUE
             return true;
         }
@@ -364,11 +370,11 @@ namespace OTSModelSharp
             if (m_pElementChemistryDB == null)
             {
                 //CElementChemistryDB cElementChemistryDB = new CElementChemistryDB();
-                //var datastorePtr = GetDatastore();
-                //if (datastorePtr!=null)
-                //{
-                //    m_pElementChemistryDB = datastorePtr;
-                //}
+                var datastorePtr = GetDatastore();
+                if (datastorePtr!=null)
+                {
+                    m_pElementChemistryDB =new  CElementChemistryDB(datastorePtr, cSQLiteTable);
+                }
 
                 m_pElementChemistryDB = new CElementChemistryDB(this.GetFileName(), new CElementChemistryTable());
             }
@@ -381,7 +387,7 @@ namespace OTSModelSharp
         {
             //get x-ray info list
             List<CPosXrayInfo> listInfo = new List<CPosXrayInfo>();
-            //listInfo.Clear();
+            listInfo.Clear();
             if (!GetXrayInfoList(ref listInfo, fldId))
             {
                 logger.Error("GetXrayList: get x-ray info failed.");
@@ -621,12 +627,12 @@ namespace OTSModelSharp
         {
             if (m_pXrayDataDB==null)
             {
-                //var datastorePtr = GetDatastore();
-                //                 if (datastorePtr!=null)
-                //                 {
+               var datastorePtr = GetDatastore();
+               if (datastorePtr!=null)
+               {
                 //m_pXrayDataDB = datastorePtr;
                 m_pXrayDataDB = new CXRayDataDB(this.GetFileName(), new CXRayDataTable());
-               // }
+               }
             }
             return m_pXrayDataDB;
         }
@@ -635,11 +641,11 @@ namespace OTSModelSharp
         {
             if (m_pXrayInfoDB==null)
             {
-                //var datastorePtr = GetDatastore();
-                //if (datastorePtr!=null)
-                //{
-                //    m_pXrayInfoDB = datastorePtr;
-                //}
+                var datastorePtr = GetDatastore();
+                if (datastorePtr!=null)
+               {
+                    m_pXrayInfoDB = new CPosXrayInfoDB(datastorePtr, cSQLiteTable);
+                }
                 m_pXrayInfoDB = new CPosXrayInfoDB(this.GetFileName(),new CPosXrayInfoTable());
             }
             return m_pXrayInfoDB;