فهرست منبع

Merge branch 'ZJX' into dev

zhangjiaxin 4 سال پیش
والد
کامیت
2ac3b67dfd

+ 1 - 0
Bin/x64/Debug/Config/ProData/DefaultTriTemplateFile.tpf

@@ -6,4 +6,5 @@
   <Member TemplateId="4" TemplateName="MnO.S.Al2O3" Element="Mn.S.Al" Group="MnO-Mn.S-S.Al2O3-Al" />
   <Member TemplateId="5" TemplateName="CaO.TiN.Al2O3" Element="Ca.Ti.Al" Group="CaO-Ca.TiN-Ti.Al2O3-Al" />
   <Member TemplateId="6" TemplateName="Mn.Ni.Co" Element=".Ni." Group="Mn-.Ni-Ni.Co-" />
+  <Member TemplateId="20210913145438" TemplateName="CaO.CaS.Al2O3" Element="Ca.S,Ca.Al" Group="CaO-Ca.CaS-S,Ca.Al2O3-Al" />
 </XMLData>

+ 2 - 2
Bin/x64/Debug/Config/ProData/ReportTemplateConfig.xml

@@ -60,7 +60,7 @@
       <MB2>CaO.SiO2.Al2O3</MB2>
       <MB3>MnO.S.Al2O3</MB3>
       <MB4>CaO.TiN.Al2O3</MB4>
-      <MB5>Mn.Ni.Co</MB5>
+      <MB5>CaO.CaS.Al2O3</MB5>
     </list_lbv_syxt_mblb>
     <list_lbv_syxt_mblb_index>
       <MBIndex0>0</MBIndex0>
@@ -68,7 +68,7 @@
       <MBIndex2>2</MBIndex2>
       <MBIndex3>3</MBIndex3>
       <MBIndex4>4</MBIndex4>
-      <MBIndex5>5</MBIndex5>
+      <MBIndex5>6</MBIndex5>
     </list_lbv_syxt_mblb_index>
   </M_SYXT>
   <M_KLLBXX>

BIN
Bin/x64/Debug/Config/Simulate/SimImage.bmp


+ 3 - 2
OTSIncAMeasureApp/0-OTSModel/Measure/GetParamData/COTSMsrPrjResultData.cs

@@ -437,8 +437,7 @@ namespace OTSModelSharp
             // Save or Save As, if strPathName is not empty, it is exist in the computer, this is a save action
             String strPathName = GetPathName();
 
-            // is this a new file?
-            strPathName.Trim();
+            
             if (strPathName.CompareTo(UNTITLED_FILE_NAME) == 0)
             {
                 // this is a new file 
@@ -446,6 +445,8 @@ namespace OTSModelSharp
                 // return save as result
                 return SaveAs();
             }
+            // is this a new file?
+            strPathName.Trim();
             //保存测量项目文件 .prj
             XmlDocument doc = new XmlDocument();
             doc.Load(strPathName);

+ 2 - 2
OTSIncAMeasureApp/OTSIncAMeasureAppForm.cs

@@ -883,7 +883,7 @@ namespace OTSMeasureApp
             bool iRev = m_ProjData.SaveAs();
             if (!iRev)
             {
-                log.Error("(OTSIncAMeasureAppForm.ribbonOrbMenuItemSaveAs_Click)  m_DataMgrFun.SaveAsFile()  Failed !");
+                //log.Trace("(OTSIncAMeasureAppForm.ribbonOrbMenuItemSaveAs_Click)  m_DataMgrFun.SaveAsFile()  Failed !");
                 return;
             }
         }
@@ -893,7 +893,7 @@ namespace OTSMeasureApp
             bool iRev = m_ProjData.Save();
             if (!iRev)
             {
-                log.Error("(OTSIncAMeasureAppForm.rbSaveFile_Click)  m_DataMgrFun.SaveFile()  Failed !");
+                //log.Trace("(OTSIncAMeasureAppForm.rbSaveFile_Click)  m_DataMgrFun.SaveFile()  Failed !");
                 return;
             }
         }

+ 106 - 7
OTSIncAReportApp/Control_Graph/Controls/Control_DrawDistrbutionImageAndBSE.cs

@@ -8,6 +8,7 @@ using OTSPeriodicTable;
 
 using System;
 using System.Collections.Generic;
+using System.Data;
 using System.Drawing;
 using System.Drawing.Drawing2D;
 using System.Linq;
@@ -157,6 +158,12 @@ namespace OTSIncAReportGraph.Controls
 
         private Color m_ColorNotContent = Color.SkyBlue;
 
+        //读取背景原图的名称和图片
+        private List<Image> originalImages = new List<Image>();
+        private List<string> originalImageNames = new List<string>();
+        //背景使用原图
+        private bool OriginalBackground = false;
+ 
         /// <summary>
         /// 当前正在显示的数据源名称,用来与框架调用条件判断使用
         /// </summary>
@@ -328,10 +335,21 @@ namespace OTSIncAReportGraph.Controls
         #region 绘制函数
         protected override void OnPaint(PaintEventArgs e)//处理重绘情况
         {
-            #region //填充个背景色矩形-----------------------------------------------
-            SolidBrush b = new SolidBrush(m_backrangecolor);
-            e.Graphics.FillRectangle(b, m_backrectf);
-            #endregion
+            if (OriginalBackground)
+            {
+                GetPic(e);
+            }
+            else
+            {
+                #region //填充个背景色矩形-----------------------------------------------
+                SolidBrush b = new SolidBrush(m_backrangecolor);
+                e.Graphics.FillRectangle(b, m_backrectf);
+                #endregion
+            }
+
+
+
+
 
             #region //计算并进行绘制部份------------------------------------
             //绘制完缩放的图形后,将基数变回,否则会一直刷新无限变大变小
@@ -1546,6 +1564,16 @@ namespace OTSIncAReportGraph.Controls
             m_backrectf = new RectangleF(m_backrectf.X - offex_p.X, m_backrectf.Y - offex_p.Y,
                 m_backrectf.Width, m_backrectf.Height);
 
+
+            for (int i =0;i< m_list_dfield.Count;i++)
+            {
+                RectangleF dField = m_list_dfield[i].Current_Rect;
+                dField.X = dField.X-offex_p.X;
+                dField.Y = dField.Y - offex_p.Y;
+                m_list_dfield[i].Current_Rect = dField;
+            }
+
+
             Invalidate();
         }
 
@@ -1779,11 +1807,12 @@ namespace OTSIncAReportGraph.Controls
         /// <summary>
         /// 设置显示BSE原图,还是显示分布图带有标准库的
         /// </summary>
-        /// <param name="in_b">false为显示原bse图像,true为显示带有标准库代表色的图像</param>
-        public void ShowMode(bool in_b)
+        /// <param name="a_type">false为显示原bse图像,true为显示带有标准库代表色的图像</param>
+        public void ShowMode(string a_type)
         {
-            if (in_b == false)
+            if (a_type == "去背景显示")
             {
+                OriginalBackground = false;
                 //bse图时,显示背景图为白色
                 m_backrangecolor = Color.White;
                 foreach (DParticle ls_dp in m_list_baseobject)
@@ -1794,8 +1823,32 @@ namespace OTSIncAReportGraph.Controls
                     }
                 }
             }
+            else if (a_type== "原图显示")
+            {
+                OriginalBackground = true;
+                foreach (DParticle ls_dp in m_list_baseobject)
+                {
+                    foreach (DSegment ls_ds in ls_dp.DSegments)
+                    {
+                        ls_ds.ShowMode = SegmentShowMode.DRAWPOINT;
+                    }
+                }
+            }
+            else if(a_type== "原图颗粒分布")
+            {
+                OriginalBackground = true;
+                foreach (DParticle ls_dp in m_list_baseobject)
+                {
+                    foreach (DSegment ls_ds in ls_dp.DSegments)
+                    {
+                        ls_ds.ShowMode = SegmentShowMode.DRAWLINE;
+                    }
+                }
+            }
+
             else
             {
+                OriginalBackground = false;
                 m_backrangecolor = Color.Gainsboro;
                 foreach (DParticle ls_dp in m_list_baseobject)
                 {
@@ -1827,6 +1880,52 @@ namespace OTSIncAReportGraph.Controls
             return icount;
         }
 
+        /// <summary>
+        /// 获取所有原图
+        /// </summary>
+        /// <param name="args"></param>
+        /// <returns></returns>
+        private void GetPic(PaintEventArgs args)
+        {
+            //将原图读取到内存中
+            if (originalImages.Count == 0)
+            {
+                string path = resultFile.FilePath;
+                System.IO.DirectoryInfo theFolder = new System.IO.DirectoryInfo(path + "\\FIELD_FILES");
+                foreach (System.IO.FileInfo nextifile in theFolder.GetFiles())
+                {
+                    if (nextifile.Name.Contains(".bmp") == true || nextifile.Name.Contains(".BMP") == true)
+                    {
+                        Image image = Image.FromFile(path + "\\FIELD_FILES\\" + nextifile.Name);
+                        originalImageNames.Add(nextifile.Name);
+                        originalImages.Add(image);
+                    }
+                }
+            }
+            //绘制原图的大小和位置
+            if (m_list_dfield.Count > 0)
+            {
+                if (originalImageNames.Count > 0)
+                {
+                    for (int i = 0; i < originalImageNames.Count; i++)
+                    {
+                        Size size = new Size();
+                        string ImageName = originalImageNames[i].ToString();
+                        Image Image = originalImages[i];
+                        string result = System.Text.RegularExpressions.Regex.Replace(ImageName, @"[^0-9]+", "");
+                        size.Height = (int)m_list_dfield[Convert.ToInt32(result)].Current_Rect.Height;
+                        size.Width = (int)m_list_dfield[Convert.ToInt32(result)].Current_Rect.Width;
+                        Bitmap bitmap = new Bitmap(Image, size);
+
+
+                        PointF pointF = new PointF();
+                        pointF.X = m_list_dfield[Convert.ToInt32(result)].Current_Rect.X;
+                        pointF.Y = m_list_dfield[Convert.ToInt32(result)].Current_Rect.Y;
+                        args.Graphics.DrawImage(bitmap, pointF);
+                    }
+                }
+            }
+        }
         #endregion
 
         #region Debug下执行的辅助测试代码

+ 2 - 2
OTSIncAReportApp/FunctionClass/OTSDataMgrFunction/DataMgrFun.cs

@@ -212,8 +212,8 @@ namespace OTSIncAReportApp.OTSDataMgrFunction
                 sampleData1.iItemValType = OTS_ITEM_TYPES.COMBO;
                 sampleData1.bReadOnly = false;
                 sampleData1.sDescriptionInfo = "Survey Chart Type";
-                sampleData1.itemVal = "BSE";
-                sampleData1.comboDownList = new List<string>() { "BSE", sSCaptionName13 };//bse,颗粒分类图
+                sampleData1.itemVal = "去背景显示";
+                sampleData1.comboDownList = new List<string>() { "去背景显示", sSCaptionName13,"原图显示","原图颗粒分布" };//bse,颗粒分类图
                 list.Add(sampleData1);
 
                 //测量图类型

+ 3 - 8
OTSIncAReportApp/FunctionClass/OTSDisplaySGridData/SampleGrid.cs

@@ -493,14 +493,9 @@ namespace OTSIncAReportApp.OTSDataMgrFunction
                             idx = m_RstProp.m_ReportApp.m_DataMgrFun.GetSampleIndexByPropItemName(m_RstProp.m_ReportApp.SourceGridData.SampleDataList, OTSIncAReportApp.OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.IMAGE_TYPE);
                             string ImageType = prop.SampleDataList[idx].itemVal.ToString();
                             //切换BSE和分类,两种影像的显示方式
-                            if (ImageType == "BSE") //sc.strBSEType == "BSE"
-                            {
-                                m_RstProp.m_ReportApp.im_Control_DrawDistrbutionImageAndBSE.ShowMode(false);
-                            }
-                            else
-                            {
-                                m_RstProp.m_ReportApp.im_Control_DrawDistrbutionImageAndBSE.ShowMode(true);
-                            }
+                            
+                             m_RstProp.m_ReportApp.im_Control_DrawDistrbutionImageAndBSE.ShowMode(ImageType);
+                           
 
 
                         }

+ 1 - 1
OTSIncAReportApp/frmMeasureRstMgr.cs

@@ -301,7 +301,7 @@ namespace OTSIncAReportApp
             {
                 return;
             }
-
+           
             //为了使用国标,保留clr向底层加载的代码部份-----------------------------------------------
             //m_ReportApp.m_ReportProjFileMgr.AddASmplMsrResultMgr(str_path);
             //m_ReportApp.m_ReportProjFileMgr.SetSelectedPicture(1);

+ 2 - 0
OTSIncAReportApp/frmReportApp.cs

@@ -205,7 +205,9 @@ namespace OTSIncAReportApp
         /// </summary>
         public frmReportApp(string[] str_resultfilepaths)
         {
+            
             m_str_resultfilepaths = str_resultfilepaths;
+            
             InitializeComponent();
 
             m_OutputNlog = new OutputNlog();

+ 2 - 2
OTSIncAReportTemplate/OTSIncAReportTemplate.cs

@@ -61,7 +61,7 @@ namespace OTSIncAReportTemplate
             //}
 
             //方便测试代码分岐
-            bool bDebug = false;
+            bool bDebug = true;
             if (bDebug == false)
             {
                 m_arg1 = args[0].Replace("^", " ");
@@ -85,7 +85,7 @@ namespace OTSIncAReportTemplate
                 //m_arg4 = "0-983";
                 //m_arg5 = "";
 
-                m_arg1 = "C:\\Users\\admin\\Desktop\\ots2.0测量结果\\曹磊\\曹磊\\1\\Sample1\\ReportTemplateDB.db";
+                m_arg1 = "C:\\Users\\admin\\Desktop\\ots\\ots\\1\\Sample1\\ReportTemplateDB.db";
                 m_arg2 = "./Config/ProData/ReportTemplateConfig.xml";
                 m_arg3 = "MainReport";
                 m_arg4 = "100";