|
|
@@ -275,7 +275,7 @@ namespace OTSModelSharp
|
|
|
m_IncADataDB.GetAllFieldsRecord(ref allFlds);
|
|
|
|
|
|
var eleChemistryDB = incAFileMgr.GetPosXrayDBMgr().GetElementChemistryDB();
|
|
|
- Dictionary<List<int>, CPosXrayClr> mapXrayInfo=new Dictionary<List<int>, CPosXrayClr>();
|
|
|
+ Dictionary<string, CPosXrayClr> mapXrayInfo=new Dictionary<string, CPosXrayClr>();
|
|
|
eleChemistryDB.GetAllMapedXrayInfo(ref mapXrayInfo);
|
|
|
foreach (var f in allFlds)
|
|
|
{
|
|
|
@@ -283,9 +283,10 @@ namespace OTSModelSharp
|
|
|
{
|
|
|
int curFldId = f.GetId();
|
|
|
int xrayId = p.GetAnalysisId();
|
|
|
- List<int> fldvec=new List<int>();
|
|
|
- fldvec.Add(curFldId);
|
|
|
- fldvec.Add(xrayId);
|
|
|
+ string fldvec="";
|
|
|
+ fldvec+=curFldId.ToString();
|
|
|
+ fldvec+="_";
|
|
|
+ fldvec += xrayId.ToString();
|
|
|
//auto cXray = mapXrayInfo.find(fldvec);
|
|
|
if (mapXrayInfo.ContainsKey(fldvec))
|
|
|
{
|
|
|
@@ -298,7 +299,7 @@ namespace OTSModelSharp
|
|
|
|
|
|
|
|
|
var xrayDataDBDB = incAFileMgr.GetPosXrayDBMgr().GetXrayDataDB();
|
|
|
- Dictionary<List<int>, CPosXrayClr> mapXrayData=new Dictionary<List<int>, CPosXrayClr>();// map structure:[(fieldId,xrayId),CPosXrayPtr],every element of this map represent one unique xraydata.
|
|
|
+ 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)
|
|
|
{
|
|
|
@@ -306,9 +307,10 @@ namespace OTSModelSharp
|
|
|
{
|
|
|
int curFldId = f.GetId();
|
|
|
int xrayId = p.GetAnalysisId();
|
|
|
- List<int> fldvec=new List<int>();
|
|
|
- fldvec.Add (curFldId);
|
|
|
- fldvec.Add (xrayId);
|
|
|
+ string fldvec="";
|
|
|
+ fldvec+=curFldId.ToString();
|
|
|
+ fldvec += "_";
|
|
|
+ fldvec += xrayId.ToString();
|
|
|
//auto cXray = mapXrayData.find(fldvec);
|
|
|
if (mapXrayData.ContainsKey(fldvec))
|
|
|
{
|
|
|
@@ -331,7 +333,7 @@ namespace OTSModelSharp
|
|
|
Dictionary<int, List<COTSParticleClr>> mapTypeParticles = new Dictionary<int,List<COTSParticleClr>>();//record typeId relevants particlelist;
|
|
|
|
|
|
List<COTSSegmentClr> AllSegments = new List<COTSSegmentClr>();
|
|
|
- Dictionary<List<int>, List<COTSSegmentClr>> mapSegments = new Dictionary<List<int>, List<COTSSegmentClr>>();
|
|
|
+ Dictionary<string, List<COTSSegmentClr>> mapSegments = new Dictionary<string, List<COTSSegmentClr>>();
|
|
|
if (SegmentDB.GetAllSegmentsRecord(mapSegments))
|
|
|
{
|
|
|
|
|
|
@@ -341,9 +343,10 @@ namespace OTSModelSharp
|
|
|
List<COTSParticleClr> parts = fld.GetListAnalysisParticles();
|
|
|
foreach (var part in parts)
|
|
|
{
|
|
|
- List<int> fldvec = new List<int>();
|
|
|
- fldvec.Add(fldId);
|
|
|
- fldvec.Add(part.GetTagId());
|
|
|
+ string fldvec = "";
|
|
|
+ fldvec+=fldId.ToString();
|
|
|
+ fldvec += "_";
|
|
|
+ fldvec+=part.GetTagId().ToString();
|
|
|
|
|
|
|
|
|
if (mapSegments.ContainsKey(fldvec))
|
|
|
@@ -383,6 +386,7 @@ namespace OTSModelSharp
|
|
|
|
|
|
status.SetCompletedFieldsCenter(completedflds);
|
|
|
status.SetCompletedFields(completedflds.Count);
|
|
|
+
|
|
|
DateTime timeStart, timeEnd;
|
|
|
try
|
|
|
{
|
|
|
@@ -398,6 +402,7 @@ namespace OTSModelSharp
|
|
|
status.SetEndTime(timeEnd);
|
|
|
status.SetUsedTime(timeEnd - timeStart);
|
|
|
status.SetStatus((OTS_MSR_SAMPLE_STATUS)Convert.ToInt32(strRstStatus));
|
|
|
+
|
|
|
//get MsrResults data from map.
|
|
|
List<CMsrResultItem> rstItms = new List<CMsrResultItem>();
|
|
|
double allPartArea = 0;
|
|
|
@@ -1424,7 +1429,7 @@ namespace OTSModelSharp
|
|
|
|
|
|
foreach (var spl in m_listSamples)
|
|
|
{
|
|
|
-
|
|
|
+
|
|
|
//get the parameter MsrParam object
|
|
|
CSampleParam pMsrParam = spl.GetMsrParams();
|
|
|
string stdFileName = pMsrParam.GetSTDName();
|
|
|
@@ -1434,31 +1439,33 @@ namespace OTSModelSharp
|
|
|
}
|
|
|
|
|
|
string filename = strFilePath + "\\" + spl.GetName() + "\\" + spl.GetName() + ".rst";
|
|
|
- //获取测量项目文件
|
|
|
- XmlDocument doc = new XmlDocument();
|
|
|
- //载入xml文件
|
|
|
- doc.Load(filename);
|
|
|
-
|
|
|
- pMsrParam.SetSTDName(stdFileName);
|
|
|
- XmlNode root = doc.SelectSingleNode("XMLData");
|
|
|
- root.RemoveAll();
|
|
|
- Serialize(true, doc, root);
|
|
|
-
|
|
|
+ ////获取测量项目文件
|
|
|
+ //XmlDocument doc = new XmlDocument();
|
|
|
+ ////载入xml文件
|
|
|
+ //doc.Load(filename);
|
|
|
|
|
|
+ //pMsrParam.SetSTDName(stdFileName);
|
|
|
+ //XmlNode root = doc.SelectSingleNode("XMLData");
|
|
|
+ //root.RemoveAll();
|
|
|
+ //spl.Serialize(true, doc, root);
|
|
|
|
|
|
- //string imgpath = filename.GetBuffer(0);
|
|
|
- //const char* file = imgpath.c_str();
|
|
|
- //tinyxml2::XMLDocument doc;
|
|
|
- //if (doc.LoadFile(file) != 0)
|
|
|
- //{
|
|
|
|
|
|
- // return NULL;
|
|
|
- //}
|
|
|
- //tinyxml2::XMLElement* root = doc.RootElement();
|
|
|
- //std::string sem = "Sample";
|
|
|
- //tinyxml2::XMLElement* member = queryUserNodeByName(root, sem);
|
|
|
- //tinyxml2::XMLElement* member1 = queryUserNodeByName(member, "MsrParams");
|
|
|
- //member1->SetAttribute("STDName", stdFileName);
|
|
|
+
|
|
|
+ //string imgpath = filename;
|
|
|
+ //const string file = imgpath;
|
|
|
+ XmlDocument doc=new XmlDocument();
|
|
|
+ doc.Load(filename);
|
|
|
+
|
|
|
+ XmlNode root = doc.SelectSingleNode("XMLData");
|
|
|
+ string sem = "Sample";
|
|
|
+ var members = root.SelectNodes(sem);
|
|
|
+ foreach (XmlNode member1 in members)
|
|
|
+ {
|
|
|
+ var paramNode = member1.SelectSingleNode("MsrParams");
|
|
|
+
|
|
|
+ ((XmlElement)paramNode).SetAttribute("STDName",stdFileName);
|
|
|
+ }
|
|
|
+
|
|
|
doc.Save(filename);
|
|
|
|
|
|
//get the steel technology parameter
|