|
|
@@ -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;
|