Pārlūkot izejas kodu

doesn't DisConnect the sem after reading or writing data to bruker device untill exit the whole application.

gsp 3 gadi atpakaļ
vecāks
revīzija
da32102403

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

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <XMLData PathName="HardwareConfig.xml" ID="1">
-  <Member RegName="SemControllerName" drive="Bruker" ImageInputSources="BSE" />
-  <Member RegName="EDSName" drive="Bruker" />
+  <Member RegName="SemControllerName" drive="OffLine" ImageInputSources="BSE" />
+  <Member RegName="EDSName" drive="OffLine" />
 </XMLData>

+ 1 - 1
Bin/x64/Debug/Config/SysData/OTSProgMgrParam.pmf

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<XMLData RunMode="ProfessionalMode" SysType="IncA">
+<XMLData RunMode="ProfessionalMode" SysType="CleanlinessA">
   <Member RegName="GenParam" DefaultArea="100" DefaultSampleName="Sample" DefaultShape="0" MeasParamFileFolderName=".\Config\ProData\" MeasSwitch="true" PartSTDLibFolderName=".\Config\SysData\" PropertyDisplayMode="0" StdLibFileName="Baohuzha" StdLibTypeIndex="0" SteelTechnology="0" UseSysSTD="true" />
   <Member RegName="ImageProcParam" m_autoBGRemoveType="0" m_BGRemoveType="0">
     <Member RegName="BGGray" end="255" start="150" />

+ 1 - 2
OTSIncAMeasureApp/0-OTSModel/Measure/GetBSEPic/CMsrThread.cs

@@ -150,8 +150,7 @@ namespace OTSModelSharp
         }
         void ThreadOver()
         {
-            loger.Info("Disconnect SEM!");
-            m_SemController.DisConnect();
+            
 
 
             DateTime timeEnd = m_ThreadStatus.GetEndTime();

+ 6 - 2
OTSIncAMeasureApp/0-OTSModel/ServiceCenter/SemController.cs

@@ -10,11 +10,15 @@ namespace OTSModelSharp.ServiceInterface
 {
     public class SemController : ISemController
     {
-     public static  NSOTSController.COTSControlFunExport hw;
+     public static  NSOTSController.COTSControlFunExport hw=null;
 
         public SemController()
         {
-            hw = new NSOTSController.COTSControlFunExport();
+            if (hw == null)
+            {
+                hw = new NSOTSController.COTSControlFunExport();
+            }
+            
         }
 
         public bool Connect()

+ 4 - 0
OTSIncAMeasureApp/1-OTSMeasure/CMeasureThreadWrapper.cs

@@ -382,6 +382,10 @@ namespace OTSMeasureApp
 
 
         #endregion
+        public void DisconnectSEM()
+        {
+            m_MsrThread.GetSEMController().DisConnect();
+        }
 
         public bool GetMsrRetData(ref SMSR_COMPLETE_DATA MsrCompleteData)
         {

+ 5 - 10
OTSIncAMeasureApp/OTSIncAMeasureAppForm.cs

@@ -68,12 +68,6 @@ namespace OTSMeasureApp
         public OTSMeasureOutputNlog m_OTSMeasureOutputNlog = null;
 
       
-        //STMrsSampleRetThreadMsg MSTMsg;
-        //PostLogMsg m_LogMsg;
-     
-
-       
-
       
         public COTSMeasureParam m_ProjParam = null;
 
@@ -86,8 +80,7 @@ namespace OTSMeasureApp
         public CMeasureThreadWrapper m_MsrThreadWrapper = null;
                           
       
-        //获取BSE图数据变量
-        //public byte[] m_BSEData = null;
+
 
         // 测量线程当前状态  True: 正在测量;  False: 测量结束 
         public bool MeasureThreadRunFlag { get => m_MsrThreadWrapper.BGWorkThreadIsRunning();  }
@@ -432,7 +425,9 @@ namespace OTSMeasureApp
                         return;
                     }
                 }
-
+                log.Info("Disconnect SEM!");
+                m_MsrThreadWrapper.DisconnectSEM();
+                m_MsrThreadWrapper.SetWorkThreadPending();
             }
             catch (Exception ex)
             {
@@ -440,7 +435,7 @@ namespace OTSMeasureApp
                 log.Error("OTSIncAMeasureAppForm_FormClosing-"+ message + ":" + ex.ToString());
             }
             //CloseAllContents();
-            m_MsrThreadWrapper.SetWorkThreadPending();
+           
             //m_MsrThreadWrapper.freeHw();
             Process.GetCurrentProcess().Kill();
           

+ 1 - 1
OTSIncAReportApp/Control_Graph/Controls/Control_DrawDistrbutionImageAndBSE.cs

@@ -1417,7 +1417,7 @@ namespace OTSIncAReportGraph.Controls
                 Thread.Sleep(500);
 
                 //第三步,断开电镜连接
-                m_OTSIncAReportFun.DisConnectSEM();
+                //m_OTSIncAReportFun.DisConnectSEM();
 
                 Thread.Sleep(1000);
 

+ 1 - 1
OTSIncAReportApp/Control_Graph/Controls/Control_DrawDistrbutionSortImage.cs

@@ -1145,7 +1145,7 @@ namespace OTSIncAReportGraph.Controls
                 Thread.Sleep(500);
 
                 //第三步,断开电镜连接
-                m_OTSIncAReportFun.DisConnectSEM();
+                //m_OTSIncAReportFun.DisConnectSEM();
 
                 Thread.Sleep(1000);
 

+ 9 - 25
OTSIncAReportApp/Control_Graph/OTSIncAReportGraphFuncation/OTSIncAReportFun.cs

@@ -68,7 +68,7 @@ namespace OTSIncAReportGraph.OTSIncAReportGraphFuncation
         public int m_segment_overflownumber = 400;
 
         //电镜设置对象
-        public NSOTSController.COTSControlFunExport m_cfun = null;
+        public  ServiceInterface.SemController m_cfun = null;
 
         //是否已经连接到了电镜
         public bool m_SEMConnectionState = false;
@@ -91,7 +91,7 @@ namespace OTSIncAReportGraph.OTSIncAReportGraphFuncation
         {
             m_Control_DrawDistrbutionImageAndBSE = in_Control_DrawDistrbutionImageAndBSE;
             resultFile = result;
-            m_cfun = new COTSControlFunExport();//重新new一下试试呢,不New并不好用  It's better to reinitialize, but it's not good to uninitialize
+            m_cfun =new ServiceInterface.SemController();
 
             table = lan.GetNameTable("OTSIncAReportFun");
         }
@@ -105,7 +105,7 @@ namespace OTSIncAReportGraph.OTSIncAReportGraphFuncation
         {
             m_Control_DrawdistrbutionsortImage = in_Control_DrawDistrbutionSortimage;
             resultFile = result;
-            m_cfun = new COTSControlFunExport();//重新new一下试试呢,不New并不好用  It's better to reinitialize, but it's not good to uninitialize
+            m_cfun = new ServiceInterface.SemController();
 
             table = lan.GetNameTable("OTSIncAReportFun");
         }
@@ -382,25 +382,22 @@ namespace OTSIncAReportGraph.OTSIncAReportGraphFuncation
         /// </summary>
         public void ConnectToSEM()
         {
-            if (m_cfun == null)
-            {
-                m_cfun = new COTSControlFunExport();
-            }
+           
          
             log.Trace("(Connection_ForDrawDistrbutionImageAndBSE)" + "Connect to SEM");
             if (!m_SEMConnectionState)
             {
-             
+
 
                 //和电镜建立通讯连接
-                m_SEMConnectionState = m_cfun.ConncetSem();
+                m_SEMConnectionState = m_cfun.Connect();
              
                 log.Trace("(Connection_ForDrawDistrbutionImageAndBSE)" + "Connect to SEM" + ":--" + m_SEMConnectionState + "---");
 
                 ///获取当前电镜的ID号
-                m_SEM_ID = m_cfun.GetSemType();
+                //m_SEM_ID = m_cfun.get
               
-                log.Trace("(Connection_ForDrawDistrbutionImageAndBSE)" + "ID:"  + m_SEM_ID.ToString());
+                //log.Trace("(Connection_ForDrawDistrbutionImageAndBSE)" + "ID:"  + m_SEM_ID.ToString());
             }
             else
             {
@@ -438,26 +435,13 @@ namespace OTSIncAReportGraph.OTSIncAReportGraphFuncation
 
             if (m_SEMConnectionState)
             {
-                m_cfun.MoveSEMToPoint(in_PositionX, in_PositionY, ls_PositionR);
+                m_cfun.MoveSEMToPoint(new Point((int)in_PositionX, (int)in_PositionY), ls_PositionR);
             }
            
         }
 
       
 
-        /// <summary>
-        /// 断开电镜连接
-        /// </summary>
-        public void DisConnectSEM()
-        {
-     
-            log.Trace("(DisConnectSEM_ForDrawDistrbutionImageAndBSE)" );
-            m_cfun.DisconnectSem();
-        /// <summary>
-
-            m_SEMConnectionState = false;
-        }
-
        
         #endregion
 

+ 9 - 72
OTSIncAReportApp/FunctionClass/OTSDataMgrFunction/DataMgrFun.cs

@@ -531,13 +531,10 @@ namespace OTSIncAReportApp.OTSDataMgrFunction
             {
                 if (val.Contains("+"))
                 {
-                    //ret.SampleDataList[GetSampleIndexByPropItemName(ret.SampleDataList, OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE)].bReadOnly = true;
-                    //ret.SampleDataList[GetSampleIndexByPropItemName(ret.SampleDataList, OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE)].itemVal = ret.SampleDataList[1].comboDownList[0];
                     ret.SampleDataList[GetSampleIndexByPropItemName(ret.SampleDataList, OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE)].itemVal = val;
                 }
                 else
                 {
-                    //ret.SampleDataList[GetSampleIndexByPropItemName(ret.SampleDataList, OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE)].bReadOnly = false;
                     DataOperation.Model.ResultFile resultFile = m_ReportApp.resultFilesList.Find(s => s.FileName == val);
                     int index = m_ReportApp.resultFilesList.IndexOf(resultFile);
                     m_ReportApp.WorkingResult = index;
@@ -549,14 +546,7 @@ namespace OTSIncAReportApp.OTSDataMgrFunction
 
             }
 
-            ////使用哪种方法来替代,字符串呢?
-            //List<OTS_RETORT_PROP_GRID_ITEMS> list_oo = new List<OTS_RETORT_PROP_GRID_ITEMS>();
-            //list_oo.Add(OTS_RETORT_PROP_GRID_ITEMS.SIZE_CAL_METHOD_TYPE);
 
-            //OTS_RETORT_PROP_GRID_ITEMS[] list_oo2 = new OTS_RETORT_PROP_GRID_ITEMS[4] { OTS_RETORT_PROP_GRID_ITEMS.SIZE_CAL_METHOD_TYPE ,
-            //    OTS_RETORT_PROP_GRID_ITEMS.SIZE_CAL_METHOD_TYPE ,
-            //    OTS_RETORT_PROP_GRID_ITEMS.SIZE_CAL_METHOD_TYPE ,
-            //    OTS_RETORT_PROP_GRID_ITEMS.SIZE_CAL_METHOD_TYPE };
             ////---------------------------------------------------------------
 
             //测量图显示方式
@@ -615,7 +605,6 @@ namespace OTSIncAReportApp.OTSDataMgrFunction
                 }
                 else if (sel == 1)//分析颗粒类型
                 {
-                    //strlist = ",0,2,3,4,13,";
                     list_showgrid_item = new List<OTS_REPORT_PROP_GRID_ITEMS>(){OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE,//0
                         OTS_REPORT_PROP_GRID_ITEMS.IMAGE_TYPE,//2
                         OTS_REPORT_PROP_GRID_ITEMS.IMAGE_DISPLAY_TYPE,//3
@@ -624,7 +613,6 @@ namespace OTSIncAReportApp.OTSDataMgrFunction
                 }
                 else if (sel == 2)//颗粒尺寸类型
                 {
-                    //strlist = ",0,2,3,4,9,10,13,";
                     list_showgrid_item = new List<OTS_REPORT_PROP_GRID_ITEMS>(){OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE,//0
                         OTS_REPORT_PROP_GRID_ITEMS.IMAGE_TYPE,//2
                         OTS_REPORT_PROP_GRID_ITEMS.IMAGE_DISPLAY_TYPE,//3
@@ -656,15 +644,11 @@ namespace OTSIncAReportApp.OTSDataMgrFunction
                 switch (sel)
                 {
                     case 0:
-                        //strlist = strlist.Replace("11,", "").Replace("12,", "");
                         list_showgrid_item.Remove(OTS_REPORT_PROP_GRID_ITEMS.GRAIN_SIZE_MIN);//11
                         list_showgrid_item.Remove(OTS_REPORT_PROP_GRID_ITEMS.GRAIN_SIZE_MAX);//12
                         break;
                     case 1:
-                        //if (!strlist.Contains(",11,"))
-                        //{
-                        //    strlist = strlist + "11,12,";
-                        //}
+                 
                         if (!list_showgrid_item.Contains(OTS_REPORT_PROP_GRID_ITEMS.GRAIN_SIZE_MIN))
                         {
                             list_showgrid_item.Add(OTS_REPORT_PROP_GRID_ITEMS.GRAIN_SIZE_MIN);//11
@@ -676,10 +660,7 @@ namespace OTSIncAReportApp.OTSDataMgrFunction
                         ret.SampleDataList[GetSampleIndexByPropItemName(ret.SampleDataList, OTS_REPORT_PROP_GRID_ITEMS.GRAIN_SIZE_MAX)].itemVal = "0";
                         break;
                     default:
-                        //if (!strlist.Contains(",11,"))
-                        //{
-                        //    strlist = strlist + "11,12,";
-                        //}
+                 
                         if (!list_showgrid_item.Contains(OTS_REPORT_PROP_GRID_ITEMS.GRAIN_SIZE_MIN))
                         {
                             list_showgrid_item.Add(OTS_REPORT_PROP_GRID_ITEMS.GRAIN_SIZE_MIN);//11
@@ -746,14 +727,10 @@ namespace OTSIncAReportApp.OTSDataMgrFunction
             {
                 if (val.Contains("+"))
                 {
-
-                    //ret.SampleDataList[GetSampleIndexByPropItemName(ret.SampleDataList, OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE)].bReadOnly = true;
-                    //ret.SampleDataList[GetSampleIndexByPropItemName(ret.SampleDataList, OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE)].itemVal = ret.SampleDataList[1].comboDownList[0];
                     ret.SampleDataList[GetSampleIndexByPropItemName(ret.SampleDataList, OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE)].itemVal = val;
                 }
                 else
                 {
-                    //ret.SampleDataList[GetSampleIndexByPropItemName(ret.SampleDataList, OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE)].bReadOnly = false;
                     DataOperation.Model.ResultFile resultFile = m_ReportApp.resultFilesList.Find(s => s.FileName == val);
                     int index = m_ReportApp.resultFilesList.IndexOf(resultFile);
                     m_ReportApp.WorkingResult = index;
@@ -772,10 +749,7 @@ namespace OTSIncAReportApp.OTSDataMgrFunction
                 switch (sel)
                 {
                     case 2://颗粒成份
-                        //if (!strlist.Contains(",13,"))
-                        //{
-                        //    strlist = strlist + "13,";
-                        //}
+             
                         if (!list_showgrid_item.Contains(OTS_REPORT_PROP_GRID_ITEMS.SIZE_CAL_METHOD_TYPE))//13
                         {
                             list_showgrid_item.Add(OTS_REPORT_PROP_GRID_ITEMS.SIZE_CAL_METHOD_TYPE);
@@ -783,14 +757,7 @@ namespace OTSIncAReportApp.OTSDataMgrFunction
                         list_showgrid_item.Remove(OTS_REPORT_PROP_GRID_ITEMS.GRAIN_SIZE_CLASS_TABLE);//9
                         break;
                     case 4://颗粒尺寸分布
-                        //if (!strlist.Contains(",9,"))
-                        //{
-                        //    strlist = strlist + "9,";
-                        //}
-                        //if (!strlist.Contains(",13,"))
-                        //{
-                        //    strlist = strlist + "13,";
-                        //}
+               
                         if (!list_showgrid_item.Contains(OTS_REPORT_PROP_GRID_ITEMS.GRAIN_SIZE_CLASS_TABLE))//9
                         {
                             list_showgrid_item.Add(OTS_REPORT_PROP_GRID_ITEMS.GRAIN_SIZE_CLASS_TABLE);
@@ -801,8 +768,7 @@ namespace OTSIncAReportApp.OTSDataMgrFunction
                         }
                         break;
                     default://其它Grid模块不需要,粒级表和尺寸计算法
-                        //strlist = strlist.Replace("9,", "");
-                        //strlist = strlist.Replace("13,", "");
+                      
                         list_showgrid_item.Remove(OTS_REPORT_PROP_GRID_ITEMS.GRAIN_SIZE_CLASS_TABLE);//9
                         //list_showgrid_item.Remove(OTS_REPORT_PROP_GRID_ITEMS.SIZE_CAL_METHOD_TYPE);//13
                         break;
@@ -872,14 +838,7 @@ namespace OTSIncAReportApp.OTSDataMgrFunction
                 switch (sel)
                 {
                     case 4://三元相图
-                        //if (!strlist.Contains(",13,") && !strlist.Contains(",15,"))
-                        //{
-                        //    strlist = strlist + "13,15,";
-                        //}
-                        //else if (!strlist.Contains(",15,"))
-                        //{
-                        //    strlist = strlist + "15,";
-                        //}
+            
 
                         if (!list_showgrid_item.Contains(OTS_REPORT_PROP_GRID_ITEMS.SIZE_CAL_METHOD_TYPE) && !list_showgrid_item.Contains(OTS_REPORT_PROP_GRID_ITEMS.TRIO_CHART_TYPE) && !list_showgrid_item.Contains(OTS_REPORT_PROP_GRID_ITEMS.GRAIN_SIZE_CLASS_TABLE))
                         {
@@ -894,18 +853,7 @@ namespace OTSIncAReportApp.OTSDataMgrFunction
 
                         break;
                     case 3://颗粒尺寸分布图
-                        //if (!strlist.Contains(",9,"))
-                        //{
-                        //    strlist = strlist + "9,";
-                        //}
-                        //if (!strlist.Contains(",13,"))
-                        //{
-                        //    strlist = strlist + "13,";
-                        //}
-                        //if (strlist.Contains(",15,"))
-                        //{
-                        //    strlist = strlist.Replace("15,", "");
-                        //}
+       
 
                         if (!list_showgrid_item.Contains(OTS_REPORT_PROP_GRID_ITEMS.GRAIN_SIZE_CLASS_TABLE))//9
                         {
@@ -921,10 +869,7 @@ namespace OTSIncAReportApp.OTSDataMgrFunction
                         }
                         break;
                     default:
-                        //if (!list_showgrid_item.Contains(OTS_REPORT_PROP_GRID_ITEMS.SIZE_CAL_METHOD_TYPE))//13
-                        //{
-                        //    list_showgrid_item.Add(OTS_REPORT_PROP_GRID_ITEMS.SIZE_CAL_METHOD_TYPE);
-                        //}
+                   
                         list_showgrid_item.Remove(OTS_REPORT_PROP_GRID_ITEMS.GRAIN_SIZE_CLASS_TABLE);
                         list_showgrid_item.Remove(OTS_REPORT_PROP_GRID_ITEMS.TRIO_CHART_TYPE);//15
                         break;
@@ -972,15 +917,7 @@ namespace OTSIncAReportApp.OTSDataMgrFunction
         {
             OTSSampleMeaInfo ret = new OTSSampleMeaInfo();
             ret.TabIndex = source.TabIndex;
-            //ret.TSampleParam.sSampleTitleName = source.TSampleParam.sSampleTitleName;
-            //string havestr = source.TSampleParam.sSampleTitleName;
-            //for (int i = 0; i < source.SampleDataList.Count; i++)
-            //{
-            //    if (havestr.Contains(((int)source.SampleDataList[i].iItemId).ToString()))
-            //    {
-            //        ret.SampleDataList.Add(source.SampleDataList[i]);
-            //    }
-            //}
+
 
             //new
             List<OTS_REPORT_PROP_GRID_ITEMS> list_shogrid_items = source.TSampleParam.List_ShowGrid_Items;

+ 1 - 0
OTSIncAReportApp/OTSIncAReportApp.csproj

@@ -486,6 +486,7 @@
     </Compile>
     <Compile Include="FunctionClass\Union\Language.cs" />
     <Compile Include="FunctionClass\Union\OTSSysSTDMgrClass.cs" />
+    <Compile Include="ServiceCenter\SemController.cs" />
     <EmbeddedResource Include="Control_Grids\ParticlesGridDevidePage.resx">
       <DependentUpon>ParticlesGridDevidePage.cs</DependentUpon>
     </EmbeddedResource>

+ 14 - 12
OTSIncAReportApp/frmReportApp.Designer.cs

@@ -182,7 +182,7 @@
             // 
             this.ribbon1.Font = new System.Drawing.Font("微软雅黑", 9F);
             this.ribbon1.Location = new System.Drawing.Point(0, 0);
-            this.ribbon1.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+            this.ribbon1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.ribbon1.Minimized = false;
             this.ribbon1.Name = "ribbon1";
             // 
@@ -210,7 +210,7 @@
             this.ribbon1.QuickAcessToolbar.ToolTip = null;
             this.ribbon1.QuickAcessToolbar.ToolTipImage = null;
             this.ribbon1.QuickAcessToolbar.ToolTipTitle = null;
-            this.ribbon1.Size = new System.Drawing.Size(1914, 195);
+            this.ribbon1.Size = new System.Drawing.Size(1276, 130);
             this.ribbon1.TabIndex = 0;
             this.ribbon1.Tabs.Add(this.ribbonTab1);
             this.ribbon1.Tabs.Add(this.rbMenu);
@@ -527,11 +527,11 @@
             this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
             this.RSGrayVal,
             this.mouseMatter});
-            this.statusStrip1.Location = new System.Drawing.Point(0, 1003);
+            this.statusStrip1.Location = new System.Drawing.Point(0, 666);
             this.statusStrip1.Name = "statusStrip1";
-            this.statusStrip1.Padding = new System.Windows.Forms.Padding(14, 0, 2, 0);
+            this.statusStrip1.Padding = new System.Windows.Forms.Padding(9, 0, 1, 0);
             this.statusStrip1.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
-            this.statusStrip1.Size = new System.Drawing.Size(1914, 35);
+            this.statusStrip1.Size = new System.Drawing.Size(1276, 26);
             this.statusStrip1.TabIndex = 4;
             this.statusStrip1.Text = "statusStrip1";
             // 
@@ -539,14 +539,14 @@
             // 
             this.RSGrayVal.BorderSides = System.Windows.Forms.ToolStripStatusLabelBorderSides.Right;
             this.RSGrayVal.Name = "RSGrayVal";
-            this.RSGrayVal.Size = new System.Drawing.Size(68, 28);
+            this.RSGrayVal.Size = new System.Drawing.Size(48, 21);
             this.RSGrayVal.Text = "灰度值";
             // 
             // mouseMatter
             // 
             this.mouseMatter.BorderSides = System.Windows.Forms.ToolStripStatusLabelBorderSides.Right;
             this.mouseMatter.Name = "mouseMatter";
-            this.mouseMatter.Size = new System.Drawing.Size(122, 28);
+            this.mouseMatter.Size = new System.Drawing.Size(84, 21);
             this.mouseMatter.Text = "鼠标点的物质";
             // 
             // DockWindowPanel
@@ -554,9 +554,10 @@
             this.DockWindowPanel.ActiveAutoHideContent = null;
             this.DockWindowPanel.Dock = System.Windows.Forms.DockStyle.Fill;
             this.DockWindowPanel.DockBackColor = System.Drawing.SystemColors.Control;
-            this.DockWindowPanel.Location = new System.Drawing.Point(0, 195);
+            this.DockWindowPanel.Location = new System.Drawing.Point(0, 130);
+            this.DockWindowPanel.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.DockWindowPanel.Name = "DockWindowPanel";
-            this.DockWindowPanel.Size = new System.Drawing.Size(1914, 808);
+            this.DockWindowPanel.Size = new System.Drawing.Size(1276, 536);
             dockPanelGradient1.EndColor = System.Drawing.SystemColors.ControlLight;
             dockPanelGradient1.StartColor = System.Drawing.SystemColors.ControlLight;
             autoHideStripSkin1.DockStripGradient = dockPanelGradient1;
@@ -633,18 +634,19 @@
             // 
             // frmReportApp
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(1914, 1038);
+            this.ClientSize = new System.Drawing.Size(1276, 692);
             this.Controls.Add(this.DockWindowPanel);
             this.Controls.Add(this.statusStrip1);
             this.Controls.Add(this.ribbon1);
             this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
             this.IsMdiContainer = true;
-            this.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+            this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.Name = "frmReportApp";
             this.Text = "报告程序";
             this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
+            this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frmReportApp_FormClosing);
             this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.frmReportApp_FormClosed);
             this.Load += new System.EventHandler(this.OTSReportApp_Load);
             this.statusStrip1.ResumeLayout(false);

+ 7 - 1
OTSIncAReportApp/frmReportApp.cs

@@ -1192,7 +1192,7 @@ namespace OTSIncAReportApp
         {
             Process.GetCurrentProcess().Kill();
             this.Hide();//打开EChar图后,回收浏览器资源暂卡,为达到操作流畅性,先隐藏窗体再回收资源
-            //m_DataMgrFun.DisposeCppObject();
+           
             this.Invoke(new Action(() =>
             {
                 if (Cef.IsInitialized)
@@ -1240,6 +1240,12 @@ namespace OTSIncAReportApp
 
             else return false;
         }
+
+        private void frmReportApp_FormClosing(object sender, FormClosingEventArgs e)
+        {
+            ServiceInterface.SemController sem = new ServiceInterface.SemController();
+            sem.DisConnect();
+        }
     }
 }