瀏覽代碼

Merge branch 'OTSRelease3_0' of http://36.129.163.148:30080/gogsadmin/OTS into OTSRelease3_0

gsp 1 年之前
父節點
當前提交
48c112f72a

+ 2 - 2
Bin/x64/Debug/Config/ConfigTemplate/IncA/ReportTemplateConfig.xml

@@ -1,7 +1,7 @@
 <XmlConfig>
   <M_SY>
-    <str_tb_ZBT>OTS Report</str_tb_ZBT>
-    <str_tb_FBT>XX有限公司</str_tb_FBT>
+    <str_tb_ZBT>夹杂物分析报告</str_tb_ZBT>
+    <str_tb_FBT>XXX有限公司</str_tb_FBT>
     <str_tb_YPBH>0001</str_tb_YPBH>
     <str_tb_CKBZ>GB30834</str_tb_CKBZ>
     <b_ck_ypsm>True</b_ck_ypsm>

+ 19 - 18
OTSIncAReportApp/1-UI/OTSTemplateDesigner/Export_ReportTemplate.cs

@@ -2180,17 +2180,17 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
         //绘制图例
         public Bitmap DrawATernaryDiagramLegend(List<Color> Color_list)
         {
-            Bitmap map = new Bitmap(450, 115);
+            Bitmap map = new Bitmap(260, 115);
             Graphics g = Graphics.FromImage(map);
             SolidBrush sbrush_White = new SolidBrush(Color.White);
             SolidBrush sbrush = new SolidBrush(Color.Black);
-            g.FillRectangle(sbrush_White, 0, 0, 450, 115);
-            Font myFont = new Font("Arial Unicode MS", 10, FontStyle.Bold);
+            g.FillRectangle(sbrush_White, 0, 0, 260, 115);
+            Font myFont = new Font("Arial Unicode MS", 10, FontStyle.Regular);
             Font myFont2 = new Font("Arial Unicode MS", 10, FontStyle.Regular);
-            g.DrawString("legend(length,μm)", myFont, sbrush, 140, 3);
+            g.DrawString("图例(length,μm)", myFont, sbrush, 70, 3);
             //legend(length,microns)
             Pen mypen = new Pen(Color.Black, 1);
-            g.DrawLine(mypen, 100, 19, 350, 19);
+            g.DrawLine(mypen, 70, 19, 170, 19);
 
 
             //设置标签名称
@@ -2212,29 +2212,30 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
             double d = Convert.ToDouble(sizestr.Split(',')[sizestr.Split(',').Length - 1]);
             listName.Add(d.ToString() + "~MAX");
             int PositionJeight = 27;
-            string str_unit = " μm";
+            //string str_unit = " μm";
+            string str_unit = "";
             for (int i=0;i< listName.Count;i=i+3)
             {
-                if (i< listName.Count)
+                if (i < listName.Count)
                 {
                     SolidBrush sbrush_Color = new SolidBrush(Color_list[i]);
-                    g.DrawRectangle(mypen, 26, PositionJeight, 8, 8);
-                    g.FillRectangle(sbrush_Color, 27, PositionJeight + 1, 7, 7);
-                    g.DrawString(listName[i].ToString()+ str_unit, myFont2, sbrush, 38, PositionJeight-2);
+                    g.DrawRectangle(mypen, 0, PositionJeight, 8, 8);
+                    g.FillRectangle(sbrush_Color, 1, PositionJeight + 1, 7, 7);
+                    g.DrawString(listName[i].ToString() + str_unit, myFont2, sbrush, 12, PositionJeight - 2);
                 }
-                if (i+1 < listName.Count)
+                if (i + 1 < listName.Count)
                 {
-                    SolidBrush sbrush_Color = new SolidBrush(Color_list[i+1]);
-                    g.DrawRectangle(mypen, 170, PositionJeight, 8, 8);
-                    g.FillRectangle(sbrush_Color, 171, PositionJeight + 1, 7, 7);
-                    g.DrawString(listName[i+1].ToString()+ str_unit, myFont2, sbrush, 182, PositionJeight - 2);
+                    SolidBrush sbrush_Color = new SolidBrush(Color_list[i + 1]);
+                    g.DrawRectangle(mypen, 94, PositionJeight, 8, 8);
+                    g.FillRectangle(sbrush_Color, 95, PositionJeight + 1, 7, 7);
+                    g.DrawString(listName[i + 1].ToString() + str_unit, myFont2, sbrush, 106, PositionJeight - 2);
                 }
                 if (i + 2 < listName.Count)
                 {
                     SolidBrush sbrush_Color = new SolidBrush(Color_list[i + 2]);
-                    g.DrawRectangle(mypen, 314, PositionJeight, 8, 8);
-                    g.FillRectangle(sbrush_Color, 315, PositionJeight + 1, 7, 7);
-                    g.DrawString(listName[i + 2].ToString()+ str_unit, myFont2, sbrush, 326, PositionJeight - 2);
+                    g.DrawRectangle(mypen, 188, PositionJeight, 8, 8);
+                    g.FillRectangle(sbrush_Color, 189, PositionJeight + 1, 7, 7);
+                    g.DrawString(listName[i + 2].ToString() + str_unit, myFont2, sbrush, 199, PositionJeight - 2);
                 }
 
                 PositionJeight = PositionJeight + 15;

+ 11 - 6
OTSIncAReportApp/1-UI/OTSTemplateDesigner/OTSReport_TemplateDesignerRM.cs

@@ -1086,12 +1086,17 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
                 {
                     // 获取选中的文件路径  
                     string filePath = openFileDialog.FileName;
-                    Bitmap bitmap = (Bitmap)Image.FromFile(filePath).Clone();
-                    //string str3 = System.IO.Directory.GetCurrentDirectory();
-                    //bitmap.Save(str3 + "\\Config\\ReportTemplate\\ReportIdentification.bmp");
-                    pictureBox7.Image.Dispose();
-                    pictureBox7.Image = (Image)bitmap.Clone();
-                    //bitmap.Dispose();
+                    try
+                    {
+                        Bitmap bitmap = (Bitmap)Image.FromFile(filePath).Clone();
+                        pictureBox7.Image.Dispose();
+                        pictureBox7.Image = (Image)bitmap.Clone();
+                    }
+                    catch
+                    {
+                        MessageBox.Show("图片已被打开,请关闭改图片!");
+                    }
+                    
                     
                 }
             }

+ 95 - 38
OTSIncAReportApp/ReportTemplate/OTS_DEVReport.cs

@@ -25,6 +25,9 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
 
         //float LowPlace = 3120f;
         float NeueStartposition = 3300f;
+        private string FieldOfViewArea = "";
+
+
 
         ElementSubscript subscript = new ElementSubscript();
 
@@ -146,11 +149,11 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
             setTableCellData(dev_sczs_text, str_SCZS);//视场总数
             setTableCellData(dev_flfa_text, str_FLFA);//分类方案
             setTableCellData(dev_yjctz_text, str_YJCTZ);//已检测特征
-            setTableCellData(dev_scmj_text, str_SCMJ);//视场面积
+            setTableCellData(dev_scmj_text, str_SCMJ+ "μm²");//视场面积
             setTableCellData(dev_fdbs_text, Magnification);//放大倍数
             setTableCellData(dev_bgsj_text, DateTime.Now.ToShortDateString().ToString());//报告时间:
             setTableCellData(dev_ckbz_text, TemplateClass.M_SY.str_tb_CKBZ.ToString());//参考标准
-
+            FieldOfViewArea = str_SCMJ;
             #endregion
             #region 加载模板设置文档数据
             //setXRLabelData(dev_ym, TemplateClass.M_YMYJ.str_tb_ymwb.ToString());//页眉
@@ -205,7 +208,7 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
             dev_size_6.Text = ls_partsize_dt.Rows[0]["c6"].ToString();
             dev_size_7.Text = ls_partsize_dt.Rows[0]["c7"].ToString();
             dev_DimensionTable_2.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft;
-            dev_DimensionTable_2.Text = dev_DimensionTable_2.Text.ToString() + TemplateClass.M_KLFXJG.str_cb_klcc_jsfs.ToString() + ", μm";
+            dev_DimensionTable_2.Text = dev_DimensionTable_2.Text.ToString() + TemplateClass.M_KLFXJG.str_cb_klcc_jsfs.ToString() + "(μm)";
             dev_DimensionTable_2.Font = new Font(Schriftart_chinese, dev_DimensionTable_2.Font.Size);
             for (int i = 0; i < surface_dt.Rows.Count; i++)
             {
@@ -574,7 +577,7 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
         public void setINCAtable()
         {
            
-            export_ReportTemplate.GenerateINCAtable(dev_scmj_text.Text, out DataTable dt);
+            export_ReportTemplate.GenerateINCAtable(FieldOfViewArea, out DataTable dt);
             xr_tbAreaOfInclusion.Visible = true;
             List<List<AreaOfInclusionDEVData>> list_AreaOfInclusion = new List<List<AreaOfInclusionDEVData>>();
             for (int i = 0; i < dt.Rows.Count; i++)
@@ -717,43 +720,77 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
             this.xrChart_incaSubdivision.Legend.VerticalIndent = 5;
             this.xrChart_incaSubdivision.Legend.Border.Color = Color.Red;//红色边框
         }
+
+        public static Color FromHex(string hex)
+        {
+            hex = hex.Replace("#", ""); // 移除 # 前缀  
+            byte a = 255; // 默认Alpha值为255(不透明)  
+            byte r = Convert.ToByte(hex.Substring(0, 2), 16);
+            byte g = Convert.ToByte(hex.Substring(2, 2), 16);
+            byte b = Convert.ToByte(hex.Substring(4, 2), 16);
+            return Color.FromArgb(a, r, g, b);          
+        }
         /// <summary>
         /// 三元图
         /// </summary>
         /// <param name="TemplateClass"></param>
         public void InsertReportTemplateChart_Trianglediagram()
         {
+            this.Detail.Controls.Add(add_label("三元图"));
             List<Color> Color_list = new List<Color>();
-            Color_list.Add(Color.FromArgb(238, 175, 14));
-            Color_list.Add(Color.FromArgb(0, 0, 238));
-            Color_list.Add(Color.FromArgb(0, 205, 0));
-            Color_list.Add(Color.FromArgb(238, 0, 0));
-            Color_list.Add(Color.FromArgb(153, 50, 204));
-            Color_list.Add(Color.FromArgb(255, 102, 153));
-            Color_list.Add(Color.FromArgb(160, 82, 45));
-            Color_list.Add(Color.FromArgb(181, 181, 181));
-            Color_list.Add(Color.FromArgb(250, 235, 215));
-            Color_list.Add(Color.FromArgb(238, 130, 238));
-            Color_list.Add(Color.FromArgb(174, 238, 238));
-            Color_list.Add(Color.FromArgb(247, 172, 189));
-            Color_list.Add(Color.FromArgb(202, 134, 135));
-            Color_list.Add(Color.FromArgb(34, 90, 31));
-
-            Color_list.Add(Color.FromArgb(238, 175, 14));
-            Color_list.Add(Color.FromArgb(0, 0, 238));
-            Color_list.Add(Color.FromArgb(0, 205, 0));
-            Color_list.Add(Color.FromArgb(238, 0, 0));
-            Color_list.Add(Color.FromArgb(153, 50, 204));
-            Color_list.Add(Color.FromArgb(255, 102, 153));
-            Color_list.Add(Color.FromArgb(160, 82, 45));
-            Color_list.Add(Color.FromArgb(181, 181, 181));
-            Color_list.Add(Color.FromArgb(250, 235, 215));
-            Color_list.Add(Color.FromArgb(238, 130, 238));
-            Color_list.Add(Color.FromArgb(174, 238, 238));
-            Color_list.Add(Color.FromArgb(247, 172, 189));
-            Color_list.Add(Color.FromArgb(202, 134, 135));
-            Color_list.Add(Color.FromArgb(34, 90, 31));
- 
+            Color_list.Add(FromHex("#0f4471"));
+            Color_list.Add(FromHex("#FFD700"));
+            Color_list.Add(FromHex("#ff5722"));
+            Color_list.Add(FromHex("#5628b4"));
+            Color_list.Add(FromHex("#20BF55"));
+            Color_list.Add(FromHex("#f23557"));
+            Color_list.Add(FromHex("#118df0"));
+            Color_list.Add(FromHex("#FF00FF"));
+            Color_list.Add(FromHex("#d3327b"));
+            Color_list.Add(FromHex("#ae318a"));
+            Color_list.Add(FromHex("#993090"));
+            Color_list.Add(FromHex("#6f3071"));
+            Color_list.Add(FromHex("#7711AF"));
+            Color_list.Add(FromHex("#CF77FF"));
+            Color_list.Add(FromHex("#AE004F"));
+            Color_list.Add(FromHex("#F35872"));
+            Color_list.Add(FromHex("#FA7729"));
+            Color_list.Add(FromHex("#FFC526"));
+            Color_list.Add(FromHex("#F8E71C"));
+            Color_list.Add(FromHex("#34ADAE"));
+            Color_list.Add(FromHex("#3DDFD2"));
+            Color_list.Add(FromHex("#A0FFFF"));
+     
+            //Color_list.Add(Color.FromArgb(238, 175, 14));
+            //Color_list.Add(Color.FromArgb(0, 0, 238));
+            //Color_list.Add(Color.FromArgb(0, 205, 0));
+            //Color_list.Add(Color.FromArgb(238, 0, 0));
+            //Color_list.Add(Color.FromArgb(153, 50, 204));
+            //Color_list.Add(Color.FromArgb(255, 102, 153));
+            //Color_list.Add(Color.FromArgb(160, 82, 45));
+            //Color_list.Add(Color.FromArgb(181, 181, 181));
+            //Color_list.Add(Color.FromArgb(250, 235, 215));
+            //Color_list.Add(Color.FromArgb(238, 130, 238));
+            //Color_list.Add(Color.FromArgb(174, 238, 238));
+            //Color_list.Add(Color.FromArgb(247, 172, 189));
+            //Color_list.Add(Color.FromArgb(202, 134, 135));
+            //Color_list.Add(Color.FromArgb(34, 90, 31));
+
+            //Color_list.Add(Color.FromArgb(238, 175, 14));
+            //Color_list.Add(Color.FromArgb(0, 0, 238));
+            //Color_list.Add(Color.FromArgb(0, 205, 0));
+            //Color_list.Add(Color.FromArgb(238, 0, 0));
+            //Color_list.Add(Color.FromArgb(153, 50, 204));
+            //Color_list.Add(Color.FromArgb(255, 102, 153));
+            //Color_list.Add(Color.FromArgb(160, 82, 45));
+            //Color_list.Add(Color.FromArgb(181, 181, 181));
+            //Color_list.Add(Color.FromArgb(250, 235, 215));
+            //Color_list.Add(Color.FromArgb(238, 130, 238));
+            //Color_list.Add(Color.FromArgb(174, 238, 238));
+            //Color_list.Add(Color.FromArgb(247, 172, 189));
+            //Color_list.Add(Color.FromArgb(202, 134, 135));
+            //Color_list.Add(Color.FromArgb(34, 90, 31));
+
 
             for (int i = 0; i < TemplateClass.M_SYXT.list_lbv_syxt_mblb_index.Count; i=i+4)
             {
@@ -811,7 +848,7 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
             xrTable_kllb_surface.LocationF = new PointF(0, NeueStartposition + 5);
             xrTable_kllb_surface.Visible = true;
             NeueStartposition = xrTable_kllb_surface.LocationF.Y + xrTable_kllb_surface.SizeF.Height;
-            xrTableCell2.Text = "Selected particles based on:" + TemplateClass.M_KLLBXX.str_cb_kllb_sort_p1.ToString();
+            xrTableCell2.Text = "Selected particles based on:" + TemplateClass.M_KLLBXX.str_cb_kllb_sort_p1.ToString()+ "(μm)";
             DataTable dataTable = export_ReportTemplate.Get_dev_kllb_data(TemplateClass);
 
             for (int i = 0; i < dataTable.Rows.Count; i++)
@@ -867,7 +904,7 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
                 Template.LocationF = new PointF(0, NeueStartposition);
                 Template.Borders = DevExpress.XtraPrinting.BorderSide.All;
                 Template.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft;
-                Template.Rows[0].Font = new Font(Schriftart_chinese, 14f, FontStyle.Bold);
+                Template.Rows[0].Font = new Font(Schriftart_chinese, 14f, FontStyle.Regular);
                 Template.Rows[0].BackColor = Color.DarkGray;
                 this.Detail.Controls.Add(Template);
                 //图片
@@ -1104,8 +1141,8 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
         {
             XRPictureBox xRPicture_legend = new XRPictureBox();
          
-            xRPicture_legend.LocationF = new PointF(95f, NeueStartposition);
-            xRPicture_legend.SizeF = new SizeF(504f, 120.85f);
+            xRPicture_legend.LocationF = new PointF(400f, NeueStartposition);
+            xRPicture_legend.SizeF = new SizeF(260f, 120f);
             xRPicture_legend.Sizing = DevExpress.XtraPrinting.ImageSizeMode.ZoomImage;
             ImageSource imageSource_legend = new ImageSource(export_ReportTemplate.DrawATernaryDiagramLegend(Color_list));
             xRPicture_legend.ImageSource = imageSource_legend;
@@ -1113,6 +1150,26 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
             this.Detail.Controls.Add(xRPicture_legend);
         }
         #endregion
+
+        private XRTable add_label(string str)
+        {
+            XRTable Template = new XRTable();
+            XRTableRow Template_Rows_1 = new XRTableRow();
+            XRTableCell Template_Rows1_Cell_2 = new XRTableCell();
+            Template_Rows1_Cell_2.WidthF = 630f;
+            Template_Rows1_Cell_2.Text = str;
+            Template_Rows_1.Controls.Add(Template_Rows1_Cell_2);
+            Template.Rows.Add(Template_Rows_1);
+            Template.WidthF = 630f;
+            //Template.SizeF = new SizeF(688f, 125);
+            Template.Borders = DevExpress.XtraPrinting.BorderSide.All;
+            Template.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter;
+            Template.LocationF = new PointF(30.42f, NeueStartposition);
+            Template.BackColor = Color.DarkGray;
+            NeueStartposition = NeueStartposition + Template.SizeF.Height;
+            return Template;
+        }
+
         #region 颗粒列表
         private XRTable add_XRTable()
         {