frmReportApp.cs 48 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203
  1. using CefSharp;
  2. using CefSharp.WinForms;
  3. using OTS.WinFormsUI.Docking;
  4. using OTSIncAReportApp.OTSDataMgrFunction;
  5. using OTSIncAReportApp.OTSRibbon;
  6. using OTSIncAReportApp.OTSSampleReportInfo;
  7. using OTSIncAReportApp.SysMgrTools;
  8. using OTSIncAReprotCharts;
  9. using System;
  10. using System.Collections;
  11. using System.Collections.Generic;
  12. using System.Data;
  13. using System.Windows.Forms;
  14. namespace OTSIncAReportApp
  15. {
  16. /// <summary>
  17. /// 报告主窗体类
  18. /// </summary>
  19. public partial class frmReportApp : Form
  20. {
  21. #region 共享窗体对象--------------------------------------------------------------------------------------
  22. public frmMeasureRstMgr m_RstWindow = null; //测量结果,树控件窗体,属性Grid窗体
  23. public frmMeasureRstProp m_PropWindow = null; //属性Grid窗体
  24. public frmSampleImage m_SImageWindow = null; //BSE窗体
  25. public frmCharts m_CChartsWindow = null; //图表窗体
  26. public frmTables m_CTablesWindow = null; //报表窗体
  27. public frmReportSysConfig m_ReportSysConfigForm; //配置参数窗体
  28. #endregion //-----------------------------------------------------------------------------------------------
  29. #region 报告类结构相关------------------------------------------------------------------------------------
  30. NLog.Logger log;
  31. const String m_csFileName = "OTSReportAppLog"; //日志文件名常量
  32. public OutputNlog m_OutputNlog; //日志类对象
  33. public DataMgrFun m_DataMgrFun = null; //DataMgrFun 对象, 此类是和调用C++ DataMGR交互数据
  34. public OTSRibbonFun m_RibbonFun = null; //报告菜单相关操作类
  35. public string m_OTSReportMgrParamFile = "\\Config\\SysData\\OTSReportMgrParam.rpf"; //报告对应使用的参数文件名
  36. public int ResultFileId = 0; //测量结果ID
  37. public List<DataOperation.Model.ResultFile> resultFilesList = new List<DataOperation.Model.ResultFile>(); //测量结果列表
  38. public DataOperation.Model.RptConfigFile m_RptConfigFile = new DataOperation.Model.RptConfigFile(); //报表程序的配置文件
  39. public int WorkingResult = -1; //当前工作结果
  40. public OTSSampleMeaInfo SourceGridData = new OTSSampleMeaInfo(); //当前SourceGrid
  41. public List<OTSSampleMeaInfo> SourceGridDataList = new List<OTSSampleMeaInfo>(); //所有模块的SourceGrid
  42. public List<OTSSampleMeaInfo> SourceGridDataListLog = new List<OTSSampleMeaInfo>(); //所有模块的SourceGrid使用记录
  43. public List<DataOperation.Model.Particle> SelectedParticles = new List<DataOperation.Model.Particle>(); //所有选择颗粒
  44. public string MoreSource = "";
  45. Hashtable table; //国际化表
  46. string[] m_str_resultfilepaths;
  47. #endregion //-----------------------------------------------------------------------------------------------
  48. #region EChart相关变量------------------------------------------------------------------------------------
  49. //定义浏览器
  50. public CefSharp.WinForms.ChromiumWebBrowser browser;
  51. public CefSharp.WinForms.ChromiumWebBrowser browsermore;//多测量结果对比时使用
  52. public bool more = false;
  53. public bool trans = false;
  54. //定义浏览器
  55. public CefSharp.WinForms.ChromiumWebBrowser browser_trio;
  56. public CefSharp.WinForms.ChromiumWebBrowser browser_triomore;//多测量结果对比时使用
  57. public class JsEvent
  58. {
  59. public string MessageText { set; get; }
  60. public void ShowTest()
  61. {
  62. MessageBox.Show(MessageText);
  63. }
  64. }
  65. public JsEvent js = new JsEvent();
  66. public string m_reportname;
  67. public string data;
  68. public string type;
  69. public bool timerKG;
  70. #endregion //------------------------------------------------------------------------------------------------
  71. #region 各功能模块窗体 -----------------------------------------------------------------------------------
  72. /// <summary>
  73. /// 颗粒分布图
  74. /// </summary>
  75. public OTSIncAReportGraph.Controls.Control_DrawDistrbutionImageAndBSE im_Control_DrawDistrbutionImageAndBSE = null;
  76. /// <summary>
  77. /// 颗粒排序图
  78. /// </summary>
  79. public OTSIncAReportGraph.Controls.Control_DrawDistrbutionSortImage im_Control_DrawDistrbutionSortImage = null;
  80. /// <summary>
  81. /// 颗粒列表_分页
  82. /// </summary>
  83. public OTSIncAReportGrids.ParticlesGridDevidePage im_ParticlesGridDevidePage = null;
  84. /// <summary>
  85. /// 颗粒成份分布表
  86. /// </summary>
  87. public OTSIncAReportGrids.CompositionDistributionGrid im_CompositionDistributionGrid = null;
  88. /// <summary>
  89. /// 平均元素含量表
  90. /// </summary>
  91. public OTSIncAReportGrids.ElementCompositionAvgGrid im_ElementCompositionAvgGrid = null;
  92. /// <summary>
  93. /// 元素含量表
  94. /// </summary>
  95. public OTSIncAReportGrids.ElementContentGrid im_ElementContentGrid = null;
  96. /// <summary>
  97. /// 颗粒尺寸表
  98. /// </summary>
  99. public OTSIncAReportGrids.ParticlesSizeGrid im_ParticlesSizeGrid = null;
  100. /// <summary>
  101. /// 测量结果概况
  102. /// </summary>
  103. public OTSIncAReportGrids.ResultGrid im_ResultGrid = null;
  104. /// <summary>
  105. /// 颗粒成份图EChart
  106. /// </summary>
  107. public Control_ECharts.EChart_ParticlesComposition im_EChart_ParticlesComposition = null;
  108. /// <summary>
  109. /// 三元相图EChart
  110. /// </summary>
  111. public Control_ECharts.EChart_Trianglediagram im_EChart_Trianglediagram = null;
  112. #endregion //--------------------------------------------------------------------------------------------
  113. #region 窗体初始化及构造函数
  114. /// <summary>
  115. /// 窗体构造函数
  116. /// </summary>
  117. public frmReportApp()
  118. {
  119. InitializeComponent();
  120. //m_ReportProjFileMgr = new OTSINTERFACE.COTSReportProjFileMgrClr();
  121. m_OutputNlog = new OutputNlog();
  122. m_OutputNlog.Visible = true;
  123. //树窗口
  124. m_RstWindow = new frmMeasureRstMgr(this);
  125. //属性窗口
  126. m_PropWindow = new frmMeasureRstProp(this);
  127. //分布图,排列图窗体
  128. m_SImageWindow = new frmSampleImage(this);
  129. //chart图表窗体
  130. m_CChartsWindow = new frmCharts(this);
  131. //grid表格窗体
  132. m_CTablesWindow = new frmTables(this);
  133. //初始化Ribbon类,操作Ribbon按钮的可用或者不可用
  134. m_RibbonFun = new OTSRibbonFun(this);
  135. //和DataMgr进行数据交互类
  136. m_DataMgrFun = new DataMgrFun(this);
  137. //配置文件管理窗体
  138. m_ReportSysConfigForm = new frmReportSysConfig(this);
  139. SetTag();
  140. #region 国际化语言
  141. Language lan = new Language(this);
  142. table = lan.GetNameTable(this.Name);
  143. #endregion
  144. }
  145. /// <summary>
  146. /// 为生成后没有Name的控件添加标签,为了国际化语言设置时可以找到这个控件
  147. /// </summary>
  148. protected void SetTag()
  149. {
  150. ribbonPanel3.Tag = "ribbonPanel3";
  151. ribbonPanel2.Tag = "ribbonPanel2";
  152. rbSelTool.Tag = "rbSelTool";
  153. rbChoiceTools.Tag = "rbChoiceTools";
  154. ribbonTab1.Tag = "ribbonTab1";
  155. rbMenu.Tag = "rbMenu";
  156. dpbOpen.Tag = "dpbOpen";
  157. dpbExport.Tag = "dpbExport";
  158. dpbCopy.Tag = "dpbCopy";
  159. dpbCopyAll.Tag = "dpbCopyAll";
  160. ribbonOrbOptionButton1.Tag = "ribbonOrbOptionButton1";
  161. }
  162. /// <summary>
  163. /// 窗体构造函数,可接收多个测量结果文件
  164. /// </summary>
  165. public frmReportApp(string[] str_resultfilepaths)
  166. {
  167. m_str_resultfilepaths = str_resultfilepaths;
  168. InitializeComponent();
  169. m_OutputNlog = new OutputNlog();
  170. m_OutputNlog.Visible = true;
  171. //树窗口
  172. m_RstWindow = new frmMeasureRstMgr(this);
  173. //属性窗口
  174. m_PropWindow = new frmMeasureRstProp(this);
  175. //初始化图形组件中返回的颗粒列表对象
  176. SelectedParticles = new List<DataOperation.Model.Particle>();
  177. //分布图,排列图窗体
  178. m_SImageWindow = new frmSampleImage(this);
  179. //chart图表窗体
  180. m_CChartsWindow = new frmCharts(this);
  181. //grid表格窗体
  182. m_CTablesWindow = new frmTables(this);
  183. //初始化Ribbon类,操作Ribbon按钮的可用或者不可用
  184. m_RibbonFun = new OTSRibbonFun(this);
  185. //和DataMgr进行数据交互类
  186. m_DataMgrFun = new DataMgrFun(this);//必须放在new frmReportSysConfig(this)前
  187. //配置文件管理窗体
  188. m_ReportSysConfigForm = new frmReportSysConfig(this);
  189. SetTag();
  190. #region 国际化语言
  191. Language lan = new Language(this);
  192. table = lan.GetNameTable(this.Name);
  193. #endregion
  194. }
  195. /// <summary>
  196. /// 报告主窗体加载事件
  197. /// </summary>
  198. /// <param name="sender"></param>
  199. /// <param name="e"></param>
  200. private void OTSReportApp_Load(object sender, EventArgs e)
  201. {
  202. log = NLog.LogManager.GetCurrentClassLogger();
  203. if (Cef.IsInitialized == false)
  204. {
  205. var settings = new CefSettings();
  206. settings.Locale = "zh-CN";
  207. settings.CefCommandLineArgs.Add("disable-gpu", "1");
  208. Cef.Initialize(settings);
  209. }
  210. //加载配置文件
  211. string pathe = Application.StartupPath + m_OTSReportMgrParamFile;
  212. DataSet ds = DataOperation.DataAccess.XMLoperate.GetXml(pathe);
  213. m_RptConfigFile.FileFolderSize = ds.Tables[0].Rows[0]["FileFolderSize"].ToString();
  214. m_RptConfigFile.FileFolderTrigTemp = ds.Tables[0].Rows[0]["FileFolderTrigTemp"].ToString();
  215. m_RptConfigFile.Scale = ds.Tables[0].Rows[0]["Scale"].ToString();
  216. m_RptConfigFile.PartSizeFile = ds.Tables[1].Rows[2]["Name"].ToString();
  217. m_RptConfigFile.TriTempFile = ds.Tables[1].Rows[3]["Name"].ToString();
  218. //设置菜单按钮,都为true状态
  219. m_RibbonFun.SetAllRibbonButnStatu(false);
  220. //创建,树窗口,属性grid窗口,分布图,grid,chart窗体等。
  221. CreateNewWorkspaceWindow();
  222. //激活测量结果窗体
  223. this.m_RstWindow.Activate();
  224. //激活分布图窗体
  225. this.m_SImageWindow.Activate();
  226. if (m_str_resultfilepaths != null)
  227. {
  228. //构造函数直接接收传入的测量结果文件,并加载
  229. for (int i = 0; i < m_str_resultfilepaths.Length; i++)
  230. {
  231. this.m_RstWindow.AddSampleClick(m_str_resultfilepaths[i].Replace("^", " "));
  232. }
  233. }
  234. }
  235. #endregion
  236. #region Ribbon菜单按钮及菜单相关按按钮事件
  237. /// <summary>
  238. /// 新建按钮事件
  239. /// </summary>
  240. /// <param name="sender"></param>
  241. /// <param name="e"></param>
  242. private void ribTitleNewFile_Click(object sender, EventArgs e)
  243. {
  244. InitReportProState();
  245. }
  246. /// <summary>
  247. /// 初始伦报告加载
  248. /// </summary>
  249. public void InitReportProState()
  250. {
  251. //清除树窗体
  252. m_RstWindow.treeView1.Nodes.Clear();
  253. //清除属性Grid
  254. m_PropWindow.m_SampleGrid = new SampleGrid(m_PropWindow);
  255. resultFilesList.Clear();
  256. //清除各模块报表文件
  257. m_CChartsWindow.Controls.Clear();
  258. m_CTablesWindow.Controls.Clear();
  259. m_SImageWindow.Controls.Clear();
  260. //再重新初始化下拉菜单和ribbon菜单中的按钮状态
  261. m_RibbonFun.SetAllRibbonButnStatu(false);
  262. im_Control_DrawDistrbutionImageAndBSE = null;
  263. im_Control_DrawDistrbutionSortImage = null;
  264. im_ParticlesGridDevidePage = null;
  265. im_CompositionDistributionGrid = null;
  266. im_ElementCompositionAvgGrid = null;
  267. im_ElementContentGrid = null;
  268. im_ParticlesSizeGrid = null;
  269. im_ResultGrid = null;
  270. }
  271. /// <summary>
  272. /// 程序管理按钮点击事件
  273. /// </summary>
  274. /// <param name="sender"></param>
  275. /// <param name="e"></param>
  276. private void RibbonOrbOptionButton1_Click(object sender, EventArgs e)
  277. {
  278. //程序管理
  279. m_ReportSysConfigForm.ShowDialog();
  280. }
  281. /// <summary>
  282. /// 打开报告项目文件按钮事件
  283. /// </summary>
  284. /// <param name="sender"></param>
  285. /// <param name="e"></param>
  286. private void rbOpen_Click(object sender, EventArgs e)
  287. {
  288. string path = "";
  289. OpenFileDialog fileDialog = new OpenFileDialog();
  290. fileDialog.Filter = "文本文件|*.rst";
  291. fileDialog.RestoreDirectory = true;
  292. if (fileDialog.ShowDialog() == DialogResult.OK)
  293. path = System.IO.Path.GetFullPath(fileDialog.FileName);
  294. this.m_RstWindow.AddSampleClick(path);
  295. }
  296. /// <summary>
  297. /// 模板导出按钮事件
  298. /// </summary>
  299. /// <param name="sender"></param>
  300. /// <param name="e"></param>
  301. private void rbOut_Click(object sender, EventArgs e)
  302. {
  303. OTSReport_Export oe = new OTSReport_Export(this);
  304. oe.ShowDialog();
  305. }
  306. /// <summary>
  307. /// 全图匹配按钮事件
  308. /// </summary>
  309. /// <param name="sender"></param>
  310. /// <param name="e"></param>
  311. private void rbAllImage_Click(object sender, EventArgs e)
  312. {
  313. int tabIndex = (int)(m_PropWindow.tabIndex);
  314. switch (tabIndex)
  315. {
  316. case (int)DisplayPicutureType.AnalyzeImg:
  317. int idx = m_DataMgrFun.GetSampleIndexByPropItemName(SourceGridData.SampleDataList, OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.IMAGE_DISPLAY_TYPE);
  318. int imgDisType = SourceGridData.SampleDataList[idx].comboDownList.IndexOf(SourceGridData.SampleDataList[idx].itemVal.ToString());
  319. if (imgDisType == 0)
  320. {
  321. if (im_Control_DrawDistrbutionImageAndBSE != null)
  322. {
  323. //分布图
  324. im_Control_DrawDistrbutionImageAndBSE.FullGraphMate();
  325. im_Control_DrawDistrbutionImageAndBSE.Invalidate();
  326. }
  327. }
  328. else
  329. {
  330. if (im_Control_DrawDistrbutionSortImage != null)
  331. {
  332. //排列图
  333. }
  334. }
  335. break;
  336. case (int)DisplayPicutureType.AnalyzeDataTable:
  337. break;
  338. case (int)DisplayPicutureType.AnalyzeDataChart:
  339. break;
  340. default:
  341. break;
  342. }
  343. }
  344. /// <summary>
  345. /// 宽度匹配按钮事件
  346. /// </summary>
  347. /// <param name="sender"></param>
  348. /// <param name="e"></param>
  349. private void rbWidthImage_Click(object sender, EventArgs e)
  350. {
  351. int tabIndex = (int)(m_PropWindow.tabIndex);
  352. switch (tabIndex)
  353. {
  354. case (int)DisplayPicutureType.AnalyzeImg:
  355. int idx = m_DataMgrFun.GetSampleIndexByPropItemName(SourceGridData.SampleDataList, OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.IMAGE_DISPLAY_TYPE);
  356. int imgDisType = SourceGridData.SampleDataList[idx].comboDownList.IndexOf(SourceGridData.SampleDataList[idx].itemVal.ToString());
  357. if (imgDisType == 0)
  358. {
  359. if (im_Control_DrawDistrbutionImageAndBSE != null)
  360. {
  361. //分布图
  362. im_Control_DrawDistrbutionImageAndBSE.WidthMate();
  363. im_Control_DrawDistrbutionImageAndBSE.Invalidate();
  364. }
  365. }
  366. else
  367. {
  368. if (im_Control_DrawDistrbutionSortImage != null)
  369. {
  370. //排列图
  371. }
  372. }
  373. break;
  374. case (int)DisplayPicutureType.AnalyzeDataTable:
  375. break;
  376. case (int)DisplayPicutureType.AnalyzeDataChart:
  377. break;
  378. default:
  379. break;
  380. }
  381. }
  382. /// <summary>
  383. /// 帧图边框按钮事件
  384. /// </summary>
  385. /// <param name="sender"></param>
  386. /// <param name="e"></param>
  387. private void rbFrame_Click(object sender, EventArgs e)
  388. {
  389. int tabIndex = (int)(m_PropWindow.tabIndex);
  390. switch (tabIndex)
  391. {
  392. case (int)DisplayPicutureType.AnalyzeImg:
  393. int idx = m_DataMgrFun.GetSampleIndexByPropItemName(SourceGridData.SampleDataList, OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.IMAGE_DISPLAY_TYPE);
  394. int imgDisType = SourceGridData.SampleDataList[idx].comboDownList.IndexOf(SourceGridData.SampleDataList[idx].itemVal.ToString());
  395. if (imgDisType == 0)
  396. {
  397. if (im_Control_DrawDistrbutionImageAndBSE != null)
  398. {
  399. //分布图
  400. im_Control_DrawDistrbutionImageAndBSE.ShowGridLine();
  401. im_Control_DrawDistrbutionImageAndBSE.Invalidate();
  402. }
  403. }
  404. else
  405. {
  406. if (im_Control_DrawDistrbutionSortImage != null)
  407. {
  408. }
  409. }
  410. break;
  411. case (int)DisplayPicutureType.AnalyzeDataTable:
  412. break;
  413. case (int)DisplayPicutureType.AnalyzeDataChart:
  414. break;
  415. default:
  416. break;
  417. }
  418. }
  419. /// <summary>
  420. /// 标尺按钮事件
  421. /// </summary>
  422. /// <param name="sender"></param>
  423. /// <param name="e"></param>
  424. private void rbStaff_Click(object sender, EventArgs e)
  425. {
  426. int tabIndex = (int)(m_PropWindow.tabIndex);
  427. switch (tabIndex)
  428. {
  429. case (int)DisplayPicutureType.AnalyzeImg:
  430. int idx = m_DataMgrFun.GetSampleIndexByPropItemName(SourceGridData.SampleDataList, OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.IMAGE_DISPLAY_TYPE);
  431. int imgDisType = SourceGridData.SampleDataList[idx].comboDownList.IndexOf(SourceGridData.SampleDataList[idx].itemVal.ToString());
  432. if (imgDisType == 0)
  433. {
  434. if (im_Control_DrawDistrbutionImageAndBSE != null)
  435. {
  436. //分布图
  437. im_Control_DrawDistrbutionImageAndBSE.ShowRulerControl();
  438. im_Control_DrawDistrbutionImageAndBSE.Invalidate();
  439. }
  440. }
  441. else
  442. {
  443. if (im_Control_DrawDistrbutionSortImage != null)
  444. {
  445. im_Control_DrawDistrbutionSortImage.ShowRulerControl();
  446. im_Control_DrawDistrbutionSortImage.Invalidate();
  447. }
  448. }
  449. break;
  450. case (int)DisplayPicutureType.AnalyzeDataTable:
  451. break;
  452. case (int)DisplayPicutureType.AnalyzeDataChart:
  453. break;
  454. default:
  455. break;
  456. }
  457. }
  458. /// <summary>
  459. /// 恢复按钮事件
  460. /// </summary>
  461. /// <param name="sender"></param>
  462. /// <param name="e"></param>
  463. private void rbRenew_Click(object sender, EventArgs e)
  464. {
  465. int tabIndex = (int)m_PropWindow.tabIndex;
  466. int idx = m_DataMgrFun.GetSampleIndexByPropItemName(SourceGridData.SampleDataList, OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.IMAGE_DISPLAY_TYPE);
  467. int DisType = SourceGridData.SampleDataList[idx].comboDownList.IndexOf(SourceGridData.SampleDataList[idx].itemVal.ToString());
  468. switch (tabIndex)
  469. {
  470. case (int)DisplayPicutureType.AnalyzeImg:
  471. if (DisType == (int)IMAGE_DISPLAY_TYPE.GENERAL)
  472. {
  473. if (im_Control_DrawDistrbutionImageAndBSE != null)
  474. {
  475. //分布图
  476. im_Control_DrawDistrbutionImageAndBSE.ShowRulerControl(false);
  477. im_Control_DrawDistrbutionImageAndBSE.ShowGridLine(false);
  478. im_Control_DrawDistrbutionImageAndBSE.Invalidate();
  479. m_SImageWindow.Controls.Clear();
  480. im_Control_DrawDistrbutionImageAndBSE = new OTSIncAReportGraph.Controls.Control_DrawDistrbutionImageAndBSE(this);
  481. im_Control_DrawDistrbutionImageAndBSE.Dock = DockStyle.Fill;
  482. m_SImageWindow.Controls.Add(im_Control_DrawDistrbutionImageAndBSE);
  483. m_SImageWindow.Activate();
  484. im_Control_DrawDistrbutionImageAndBSE.ShowSourceName = "";
  485. im_Control_DrawDistrbutionImageAndBSE.DrawDistrbutionImageAndBSE_ByQuery(SourceGridData);
  486. im_Control_DrawDistrbutionImageAndBSE.SetSelectParticle(SelectedParticles);
  487. //并删除排列图
  488. im_Control_DrawDistrbutionSortImage = null;
  489. }
  490. }
  491. if (DisType == (int)IMAGE_DISPLAY_TYPE.IMAGE_GRID)
  492. {
  493. if (im_Control_DrawDistrbutionSortImage != null)
  494. {
  495. //排序图
  496. im_Control_DrawDistrbutionSortImage.ShowRulerControl(false);
  497. im_Control_DrawDistrbutionSortImage.Invalidate();
  498. m_SImageWindow.Controls.Clear();
  499. im_Control_DrawDistrbutionSortImage = new OTSIncAReportGraph.Controls.Control_DrawDistrbutionSortImage(this);
  500. im_Control_DrawDistrbutionSortImage.Dock = DockStyle.Fill;
  501. m_SImageWindow.Controls.Add(im_Control_DrawDistrbutionSortImage);
  502. m_SImageWindow.Activate();
  503. im_Control_DrawDistrbutionSortImage.ShowSourceName = "";
  504. im_Control_DrawDistrbutionSortImage.Control_DrawDistrbutionSortImage_ByQuery(SourceGridData);
  505. im_Control_DrawDistrbutionSortImage.SetSelectParticle(SelectedParticles);
  506. }
  507. }
  508. break;
  509. case (int)DisplayPicutureType.AnalyzeDataTable:
  510. break;
  511. case (int)DisplayPicutureType.AnalyzeDataChart:
  512. break;
  513. default:
  514. break;
  515. }
  516. }
  517. /// <summary>
  518. /// 反选操作按钮事件
  519. /// </summary>
  520. /// <param name="sender"></param>
  521. /// <param name="e"></param>
  522. private void rbReverseSelection_Click(object sender, EventArgs e)
  523. {
  524. int tabIndex = (int)(m_PropWindow.tabIndex);
  525. switch (tabIndex)
  526. {
  527. case (int)DisplayPicutureType.AnalyzeImg:
  528. int idx = m_DataMgrFun.GetSampleIndexByPropItemName(SourceGridData.SampleDataList, OTSIncAReportApp.OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.IMAGE_DISPLAY_TYPE);
  529. int imgDisType = SourceGridData.SampleDataList[idx].comboDownList.IndexOf(SourceGridData.SampleDataList[idx].itemVal.ToString());
  530. if (imgDisType == 0)
  531. {
  532. if (im_Control_DrawDistrbutionImageAndBSE != null)
  533. {
  534. //分布图
  535. im_Control_DrawDistrbutionImageAndBSE.ReverSeSelection();
  536. }
  537. }
  538. else
  539. {
  540. if (im_Control_DrawDistrbutionSortImage != null)
  541. {
  542. im_Control_DrawDistrbutionSortImage.ReverSeSelection();
  543. }
  544. }
  545. break;
  546. case (int)DisplayPicutureType.AnalyzeDataTable:
  547. break;
  548. case (int)DisplayPicutureType.AnalyzeDataChart:
  549. break;
  550. default:
  551. break;
  552. }
  553. }
  554. /// <summary>
  555. /// 圆形工具按钮事件
  556. /// </summary>
  557. /// <param name="sender"></param>
  558. /// <param name="e"></param>
  559. private void rbCircular_Click(object sender, EventArgs e)
  560. {
  561. int tabIndex = (int)(m_PropWindow.tabIndex);
  562. switch (tabIndex)
  563. {
  564. case (int)DisplayPicutureType.AnalyzeImg:
  565. int idx = m_DataMgrFun.GetSampleIndexByPropItemName(SourceGridData.SampleDataList, OTSIncAReportApp.OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.IMAGE_DISPLAY_TYPE);
  566. int imgDisType = SourceGridData.SampleDataList[idx].comboDownList.IndexOf(SourceGridData.SampleDataList[idx].itemVal.ToString());
  567. if (imgDisType == 0)
  568. {
  569. if (im_Control_DrawDistrbutionImageAndBSE != null)
  570. {
  571. //分布图
  572. im_Control_DrawDistrbutionImageAndBSE.MultiSelect_Ellipse();
  573. }
  574. }
  575. else
  576. {
  577. if (im_Control_DrawDistrbutionSortImage != null)
  578. {
  579. im_Control_DrawDistrbutionSortImage.MultiSelect_Ellipse();
  580. }
  581. }
  582. break;
  583. case (int)DisplayPicutureType.AnalyzeDataTable:
  584. break;
  585. case (int)DisplayPicutureType.AnalyzeDataChart:
  586. break;
  587. default:
  588. break;
  589. }
  590. }
  591. /// <summary>
  592. /// 矩形工具按钮事件
  593. /// </summary>
  594. /// <param name="sender"></param>
  595. /// <param name="e"></param>
  596. private void rbRectangle_Click(object sender, EventArgs e)
  597. {
  598. int tabIndex = (int)(m_PropWindow.tabIndex);
  599. switch (tabIndex)
  600. {
  601. case (int)DisplayPicutureType.AnalyzeImg:
  602. int idx = m_DataMgrFun.GetSampleIndexByPropItemName(SourceGridData.SampleDataList, OTSIncAReportApp.OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.IMAGE_DISPLAY_TYPE);
  603. int imgDisType = SourceGridData.SampleDataList[idx].comboDownList.IndexOf(SourceGridData.SampleDataList[idx].itemVal.ToString());
  604. if (imgDisType == 0)
  605. {
  606. if (im_Control_DrawDistrbutionImageAndBSE != null)
  607. {
  608. //分布图
  609. im_Control_DrawDistrbutionImageAndBSE.MultiSelect_Rectangle();
  610. }
  611. }
  612. else
  613. {
  614. if (im_Control_DrawDistrbutionSortImage != null)
  615. {
  616. im_Control_DrawDistrbutionSortImage.MultiSelect_Rectangle();
  617. }
  618. }
  619. break;
  620. case (int)DisplayPicutureType.AnalyzeDataTable:
  621. break;
  622. case (int)DisplayPicutureType.AnalyzeDataChart:
  623. break;
  624. default:
  625. break;
  626. }
  627. }
  628. /// <summary>
  629. /// 取消多边形选择工具按钮事件
  630. /// </summary>
  631. /// <param name="sender"></param>
  632. /// <param name="e"></param>
  633. private void rbCancel_Click(object sender, EventArgs e)
  634. {
  635. int tabIndex = (int)(m_PropWindow.tabIndex);
  636. switch (tabIndex)
  637. {
  638. case (int)DisplayPicutureType.AnalyzeImg:
  639. int idx = m_DataMgrFun.GetSampleIndexByPropItemName(SourceGridData.SampleDataList, OTSIncAReportApp.OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.IMAGE_DISPLAY_TYPE);
  640. int imgDisType = SourceGridData.SampleDataList[idx].comboDownList.IndexOf(SourceGridData.SampleDataList[idx].itemVal.ToString());
  641. if (imgDisType == 0)// oper_module == "颗粒分布图"
  642. {
  643. if (im_Control_DrawDistrbutionImageAndBSE != null)
  644. {
  645. //分布图
  646. im_Control_DrawDistrbutionImageAndBSE.DeselectAllParticle();
  647. }
  648. }
  649. else
  650. {
  651. if (im_Control_DrawDistrbutionSortImage != null)
  652. {
  653. im_Control_DrawDistrbutionSortImage.DeselectAllParticle();
  654. }
  655. }
  656. break;
  657. case (int)DisplayPicutureType.AnalyzeDataTable:
  658. break;
  659. case (int)DisplayPicutureType.AnalyzeDataChart:
  660. break;
  661. default:
  662. break;
  663. }
  664. }
  665. #endregion
  666. #region 自定义封装相关方法
  667. /// <summary>
  668. /// 新建一个工作区域
  669. /// </summary>
  670. public void CreateNewWorkspaceWindow()
  671. {
  672. //Show BSE图窗口
  673. CreateSampleWindow();
  674. //创建测量数据窗口
  675. CreateCTablesWindow();
  676. //创建图表窗口
  677. CreateChartsWindow();
  678. m_OutputNlog = new OutputNlog();
  679. m_OutputNlog.Show(DockWindowPanel, OTS.WinFormsUI.Docking.DockState.DockRight);
  680. m_OutputNlog.Visible = true;
  681. m_RstWindow.Show(DockWindowPanel, OTS.WinFormsUI.Docking.DockState.DockLeft);
  682. m_PropWindow.Show(DockWindowPanel);
  683. DockWindowPanel.DockLeftPortion = 300;
  684. DockWindowPanel.DockRightPortion = 351;
  685. }
  686. /// <summary>
  687. /// 创建新的窗体
  688. /// </summary>
  689. /// <param name="WorkWindow"></param>
  690. /// <param name="iType"></param>
  691. /// <returns></returns>
  692. private OTS.WinFormsUI.Docking.DockContent CreateNewDocument(OTS.WinFormsUI.Docking.DockContent WorkWindow, DisplayPicutureType iType)
  693. {
  694. string text = "";
  695. if (iType == DisplayPicutureType.AnalyzeImg)
  696. {
  697. text = "分析图";
  698. }
  699. else if (iType == DisplayPicutureType.AnalyzeDataTable)
  700. {
  701. text = "分析数据表";
  702. }
  703. else if (iType == DisplayPicutureType.AnalyzeDataChart)
  704. {
  705. text = "分析数据图";
  706. }
  707. WorkWindow.Text = text;
  708. return WorkWindow;
  709. }
  710. /// <summary>
  711. /// 创建样品BSE图窗口
  712. /// </summary>
  713. public void CreateSampleWindow()
  714. {
  715. if (null == m_SImageWindow)
  716. {
  717. m_SImageWindow = new frmSampleImage(this);
  718. }
  719. m_SImageWindow = (frmSampleImage)CreateNewDocument(m_SImageWindow, DisplayPicutureType.AnalyzeImg);
  720. if (DockWindowPanel.DocumentStyle == DocumentStyle.SystemMdi)
  721. {
  722. m_SImageWindow.MdiParent = this;
  723. m_SImageWindow.Show();
  724. }
  725. else
  726. {
  727. m_SImageWindow.Show(DockWindowPanel);
  728. }
  729. }
  730. /// <summary>
  731. /// 创建Grid表格窗体
  732. /// </summary>
  733. private void CreateCTablesWindow()
  734. {
  735. if (null == m_CTablesWindow)
  736. {
  737. m_CTablesWindow = new frmTables(this);
  738. }
  739. m_CTablesWindow = (frmTables)CreateNewDocument(m_CTablesWindow, DisplayPicutureType.AnalyzeDataTable);
  740. if (DockWindowPanel.DocumentStyle == DocumentStyle.SystemMdi)
  741. {
  742. m_CTablesWindow.MdiParent = this;
  743. m_CTablesWindow.Show();
  744. }
  745. else
  746. {
  747. m_CTablesWindow.Show(DockWindowPanel);
  748. }
  749. }
  750. /// <summary>
  751. /// 创建chart图表窗体
  752. /// </summary>
  753. private void CreateChartsWindow()
  754. {
  755. if (null == m_CChartsWindow)
  756. {
  757. m_CChartsWindow = new frmCharts(this);
  758. }
  759. m_CChartsWindow = (frmCharts)CreateNewDocument(m_CChartsWindow, DisplayPicutureType.AnalyzeDataChart);
  760. if (DockWindowPanel.DocumentStyle == DocumentStyle.SystemMdi)
  761. {
  762. m_CChartsWindow.MdiParent = this;
  763. m_CChartsWindow.Show();
  764. }
  765. else
  766. {
  767. m_CChartsWindow.Show(DockWindowPanel);
  768. }
  769. }
  770. /// <summary>
  771. /// 添加属性Grid相关数据
  772. /// </summary>
  773. public void DisCurrentPicProperty()
  774. {
  775. OTSSampleMeaInfo SMInfo = new OTSSampleMeaInfo();
  776. //获取工作样品属性
  777. if (!m_DataMgrFun.GetWorkSamplePropertyVal(ref SMInfo))
  778. {
  779. return;
  780. }
  781. //添加属性Grid相关数据
  782. m_PropWindow.DisProperyWindow(SMInfo);
  783. }
  784. /// <summary>
  785. /// 新建样品时提示保存样品信息Messagebox
  786. /// </summary>
  787. /// <returns></returns>
  788. public int ShowSaveInfoMsgBox()
  789. {
  790. //是否保存修改信息,保存样品信息提示
  791. int iRev = (int)MessageBox.Show("是否保存修改信息", "信息提示", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning);
  792. if (iRev == (int)DialogResult.Yes)
  793. {
  794. return (int)MessageBoxRev.DIALOG_YES;
  795. }
  796. else if (iRev == (int)DialogResult.No)
  797. {
  798. return (int)MessageBoxRev.DIALOG_NO;
  799. }
  800. else
  801. {
  802. return (int)MessageBoxRev.DIALOG_CANCEL;
  803. }
  804. }
  805. #endregion
  806. #region 系统菜单相关功能
  807. private void ribbonOrbMenuItem4_Click(object sender, EventArgs e)
  808. {
  809. MemoryManagementClass.FlushMemory();
  810. //系统菜单,输出
  811. OTSReport_Export oe = new OTSReport_Export(this);
  812. oe.ShowDialog();
  813. oe.Dispose();
  814. oe = null;
  815. MemoryManagementClass.FlushMemory();
  816. }
  817. /// <summary>
  818. /// 复制
  819. /// </summary>
  820. /// <param name="sender"></param>
  821. /// <param name="e"></param>
  822. private void ribbonOrbMenuItem6_Click(object sender, EventArgs e)
  823. {
  824. int tabIndex = (int)m_PropWindow.tabIndex;
  825. //int imgDisType = SourceGridData.SampleDataList[2].comboDownList.IndexOf(SourceGridData.SampleDataList[2].itemVal.ToString());
  826. //int calTableType = SourceGridData.SampleDataList[2].comboDownList.IndexOf(SourceGridData.SampleDataList[2].itemVal.ToString());
  827. //int calChartType = SourceGridData.SampleDataList[2].comboDownList.IndexOf(SourceGridData.SampleDataList[2].itemVal.ToString());
  828. int idx = m_DataMgrFun.GetSampleIndexByPropItemName(SourceGridData.SampleDataList, OTSIncAReportApp.OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.CALCULATE_TABLE_TYPE);
  829. int DisType = SourceGridData.SampleDataList[idx].comboDownList.IndexOf(SourceGridData.SampleDataList[idx].itemVal.ToString());
  830. switch (tabIndex)
  831. {
  832. case (int)DisplayPicutureType.AnalyzeImg: //如果是分布图,排列图
  833. if (DisType == (int)IMAGE_DISPLAY_TYPE.GENERAL) //oper_module == "颗粒分布图"
  834. {
  835. if (im_Control_DrawDistrbutionImageAndBSE != null)
  836. {
  837. //分布图
  838. im_Control_DrawDistrbutionImageAndBSE.CopyToBitmap();
  839. }
  840. }
  841. if (DisType == (int)IMAGE_DISPLAY_TYPE.IMAGE_GRID)
  842. {
  843. if (im_Control_DrawDistrbutionSortImage != null)
  844. {
  845. //排列图
  846. im_Control_DrawDistrbutionSortImage.CopyToBitmap();
  847. }
  848. }
  849. break;
  850. case (int)DisplayPicutureType.AnalyzeDataTable: //如果是Grid表格
  851. if (DisType == (int)CALCULATE_TABLE_TYPE.MEASURE_INFO)
  852. {
  853. if (im_ResultGrid != null)
  854. {
  855. //测量结果信息
  856. im_ResultGrid.CopySelected();
  857. }
  858. }
  859. if (DisType == (int)CALCULATE_TABLE_TYPE.PARTICALE_GENE_INFO)
  860. {
  861. if (im_ParticlesGridDevidePage != null)
  862. {
  863. //颗粒列表
  864. im_ParticlesGridDevidePage.CopySelected();
  865. }
  866. }
  867. if (DisType == (int)CALCULATE_TABLE_TYPE.PARTICALE_COMP)
  868. {
  869. if (im_CompositionDistributionGrid != null)
  870. {
  871. //成份分布表
  872. im_CompositionDistributionGrid.CopySelected();
  873. }
  874. }
  875. if (DisType == (int)CALCULATE_TABLE_TYPE.AVE_ELEMENT_COMP)
  876. {
  877. if (im_ElementCompositionAvgGrid != null)
  878. {
  879. //平均元素含量表
  880. im_ElementCompositionAvgGrid.CopySelected();
  881. }
  882. }
  883. if (DisType == (int)CALCULATE_TABLE_TYPE.ELEMENT_COMP)
  884. {
  885. if (im_ElementContentGrid != null)
  886. {
  887. //元素含量表
  888. im_ElementContentGrid.CopySelected();
  889. }
  890. }
  891. if (DisType == (int)CALCULATE_TABLE_TYPE.PARTICALE_SIZE_DISTRIBUTION)
  892. {
  893. if (im_ParticlesSizeGrid != null)
  894. {
  895. //颗粒尺寸表
  896. im_ParticlesSizeGrid.CopySelected();
  897. }
  898. }
  899. break;
  900. case (int)DisplayPicutureType.AnalyzeDataChart: //如果是Chart图表
  901. if (DisType == (int)CALCULATE_CHART_TYPE.PARTICALE_COMP)
  902. {
  903. //if (im_ParticalesCompositionChart != null)
  904. //{
  905. // //颗粒成份图
  906. // im_ParticalesCompositionChart.CopyToBitmap();
  907. //}
  908. }
  909. if (DisType == (int)CALCULATE_CHART_TYPE.ELEMENT_COMP)
  910. {
  911. //if (im_ElementCompositionChart != null)
  912. //{
  913. // //元素成份图
  914. // im_ElementCompositionChart.CopyToBitmap();
  915. //}
  916. }
  917. if (DisType == (int)CALCULATE_CHART_TYPE.PARTICALE_SIZE_DISTRIBUTION)
  918. {
  919. //if (im_ParticalesSizeDistributionChart != null)
  920. //{
  921. // //颗粒尺寸分布图
  922. // im_ParticalesSizeDistributionChart.CopyToBitmap();
  923. //}
  924. }
  925. if (DisType == (int)CALCULATE_CHART_TYPE.TRIO_CHART)
  926. {
  927. //if (im_Trianglediagram != null)
  928. //{
  929. // //三角图
  930. // im_Trianglediagram.CopyToBitmap();
  931. //}
  932. }
  933. break;
  934. default:
  935. break;
  936. }
  937. }
  938. /// <summary>
  939. /// 复制全部
  940. /// </summary>
  941. /// <param name="sender"></param>
  942. /// <param name="e"></param>
  943. private void ribbonOrbMenuItem8_Click(object sender, EventArgs e)
  944. {
  945. int tabIndex = (int)m_PropWindow.tabIndex;
  946. int idx = m_DataMgrFun.GetSampleIndexByPropItemName(SourceGridData.SampleDataList, OTSIncAReportApp.OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.CALCULATE_TABLE_TYPE);
  947. int DisType = SourceGridData.SampleDataList[idx].comboDownList.IndexOf(SourceGridData.SampleDataList[idx].itemVal.ToString());
  948. switch (tabIndex)
  949. {
  950. case (int)DisplayPicutureType.AnalyzeImg:
  951. if (DisType == (int)IMAGE_DISPLAY_TYPE.GENERAL)
  952. {
  953. if (im_Control_DrawDistrbutionImageAndBSE != null)
  954. {
  955. //分布图
  956. im_Control_DrawDistrbutionImageAndBSE.CopyToBitmap();
  957. }
  958. }
  959. if (DisType == (int)IMAGE_DISPLAY_TYPE.IMAGE_GRID)
  960. {
  961. if (im_Control_DrawDistrbutionSortImage != null)
  962. {
  963. //排列图
  964. im_Control_DrawDistrbutionSortImage.CopyToBitmap();
  965. }
  966. }
  967. break;
  968. case (int)DisplayPicutureType.AnalyzeDataTable:
  969. if (DisType == (int)CALCULATE_TABLE_TYPE.MEASURE_INFO)
  970. {
  971. if (im_ResultGrid != null)
  972. {
  973. //测量结果信息
  974. im_ResultGrid.CopyAll();
  975. }
  976. }
  977. if (DisType == (int)CALCULATE_TABLE_TYPE.PARTICALE_GENE_INFO)
  978. {
  979. if (im_ParticlesGridDevidePage != null)
  980. {
  981. //颗粒列表
  982. im_ParticlesGridDevidePage.CopyAll();
  983. }
  984. }
  985. if (DisType == (int)CALCULATE_TABLE_TYPE.PARTICALE_COMP)
  986. {
  987. if (im_CompositionDistributionGrid != null)
  988. {
  989. //成份分布表
  990. im_CompositionDistributionGrid.CopyAll();
  991. }
  992. }
  993. if (DisType == (int)CALCULATE_TABLE_TYPE.AVE_ELEMENT_COMP)
  994. {
  995. if (im_ElementCompositionAvgGrid != null)
  996. {
  997. //平均元素含量表
  998. im_ElementCompositionAvgGrid.CopyAll();
  999. }
  1000. }
  1001. if (DisType == (int)CALCULATE_TABLE_TYPE.ELEMENT_COMP)
  1002. {
  1003. if (im_ElementContentGrid != null)
  1004. {
  1005. //元素含量表
  1006. im_ElementContentGrid.CopyAll();
  1007. }
  1008. }
  1009. if (DisType == (int)CALCULATE_TABLE_TYPE.PARTICALE_SIZE_DISTRIBUTION)
  1010. {
  1011. if (im_ParticlesSizeGrid != null)
  1012. {
  1013. //颗粒尺寸表
  1014. im_ParticlesSizeGrid.CopyAll();
  1015. }
  1016. }
  1017. break;
  1018. case (int)DisplayPicutureType.AnalyzeDataChart:
  1019. if (DisType == (int)CALCULATE_CHART_TYPE.PARTICALE_COMP)
  1020. {
  1021. //if (im_ParticalesCompositionChart != null)
  1022. //{
  1023. // //颗粒成份图
  1024. // im_ParticalesCompositionChart.CopyToBitmap();
  1025. //}
  1026. }
  1027. if (DisType == (int)CALCULATE_CHART_TYPE.ELEMENT_COMP)
  1028. {
  1029. //if (im_ElementCompositionChart != null)
  1030. //{
  1031. // //元素成份图
  1032. // im_ElementCompositionChart.CopyToBitmap();
  1033. //}
  1034. }
  1035. if (DisType == (int)CALCULATE_CHART_TYPE.PARTICALE_SIZE_DISTRIBUTION)
  1036. {
  1037. //if (im_ParticalesSizeDistributionChart != null)
  1038. //{
  1039. // //颗粒尺寸分布图
  1040. // im_ParticalesSizeDistributionChart.CopyToBitmap();
  1041. //}
  1042. }
  1043. if (DisType == (int)CALCULATE_CHART_TYPE.TRIO_CHART)
  1044. {
  1045. //if (im_Trianglediagram != null)
  1046. //{
  1047. // //三角图
  1048. // im_Trianglediagram.CopyToBitmap();
  1049. //}
  1050. }
  1051. break;
  1052. default:
  1053. break;
  1054. }
  1055. }
  1056. private void frmReportApp_FormClosed(object sender, FormClosedEventArgs e)
  1057. {
  1058. this.Hide();//打开EChar图后,回收浏览器资源暂卡,为达到操作流畅性,先隐藏窗体再回收资源
  1059. //m_DataMgrFun.DisposeCppObject();
  1060. this.Invoke(new Action(() =>
  1061. {
  1062. if (Cef.IsInitialized)
  1063. Cef.Shutdown();
  1064. }));
  1065. }
  1066. #endregion
  1067. }
  1068. }