ToolsMenu.cs 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940
  1. using PaintDotNet.Annotation.Enum;
  2. using PaintDotNet.Base;
  3. using PaintDotNet.Base.CommTool;
  4. using PaintDotNet.Data.Param;
  5. using PaintDotNet.ImageCollect;
  6. using PaintDotNet.Instrument;
  7. using PaintDotNet.SystemLayer;
  8. using System;
  9. using System.Collections.Generic;
  10. using System.Diagnostics;
  11. using System.Drawing;
  12. using System.IO;
  13. using System.Linq;
  14. using System.Threading;
  15. using System.Windows.Forms;
  16. namespace PaintDotNet.Menus
  17. {
  18. /// <summary>
  19. /// 工具菜单
  20. /// </summary>
  21. internal sealed class ToolsMenu : PdnMenuItem
  22. {
  23. //网格
  24. private PdnMenuItem menuToolsGridLine;
  25. //辅助线
  26. private PdnMenuItem menuToolsAuxiliaryLine;
  27. //视图标尺
  28. private PdnMenuItem menuToolsViewRuler;
  29. //分隔线
  30. private ToolStripSeparator menuToolsSeperator1;
  31. //捕获窗口
  32. private PdnMenuItem menuToolsCaptureWindow;
  33. //捕获图像
  34. private PdnMenuItem menuToolsCapturePicture;
  35. //分割线
  36. private ToolStripSeparator menuToolsSeperator2;
  37. //直方图
  38. private PdnMenuItem menuToolsHistogram;
  39. //像素跟踪
  40. private PdnMenuItem menuToolsPixelTracking;
  41. //三维灰度
  42. private PdnMenuItem menuToolsSurfacePlot;
  43. //三维展示
  44. private PdnMenuItem menuToolsSurfacePlotShow;
  45. //图像索引
  46. private PdnMenuItem menuToolsImageIndex;
  47. //分隔线
  48. private ToolStripSeparator menuToolsSeperator3;
  49. //脚本
  50. private PdnMenuItem menuToolsScript;
  51. //工作流程
  52. private PdnMenuItem menuToolsWorkFlow;
  53. //快捷工具
  54. private PdnMenuItem menuToolsFast;
  55. //分隔线
  56. private ToolStripSeparator menuToolsSeperator4;
  57. //划痕处理
  58. private PdnMenuItem menuToolsScratchTreatment;
  59. //污迹处理
  60. private PdnMenuItem menuToolsSmudgeTreatment;
  61. //分隔线
  62. private ToolStripSeparator menuToolsSeperator5;
  63. //分栏显示
  64. private PdnMenuItem menuToolsColumnDisplay;
  65. //图片对比
  66. private PdnMenuItem menuToolsPictureComparison;
  67. //自定义界面
  68. private PdnMenuItem menuToolsCustomInterface;
  69. //生成快捷方式
  70. private PdnMenuItem menuToolsCreateShortcut;
  71. //图片信息
  72. private PdnMenuItem menuToolsImageInfo;
  73. //分隔线
  74. private ToolStripSeparator menuToolsSeperator6;
  75. //项目工程
  76. private PdnMenuItem menuToolsOpenProject;
  77. //添加到工程
  78. private PdnMenuItem menuToolsAddToProject;
  79. //分隔线
  80. private ToolStripSeparator menuToolsSeperator7;
  81. //模板管理
  82. private PdnMenuItem menuToolsTemplateManager;
  83. //生成报告
  84. private PdnMenuItem menuToolsCreateReport;
  85. //分隔线
  86. private ToolStripSeparator menuToolsSeperator8;
  87. //重新启动
  88. private PdnMenuItem menuToolsSelfRestart;
  89. //恢复图片
  90. private PdnMenuItem menuToolsRestoreImages;
  91. //
  92. // 以下是非模态对话框
  93. //
  94. //脚本管理窗口
  95. private ScriptManageDialog scriptManageDialog;
  96. public ToolsMenu(int menuId)
  97. {
  98. InitializeComponent();
  99. this.MenuId = menuId;
  100. }
  101. private void InitializeComponent()
  102. {
  103. this.menuToolsGridLine = new PdnMenuItem(ActionType.GridLine, true);
  104. this.menuToolsAuxiliaryLine = new PdnMenuItem(ActionType.AuxiliaryLine, true);
  105. this.menuToolsViewRuler = new PdnMenuItem(ActionType.ViewRuler, true);
  106. this.menuToolsSeperator1 = new ToolStripSeparator();
  107. this.menuToolsCaptureWindow = new PdnMenuItem(ActionType.CaptureWindow);
  108. this.menuToolsCapturePicture = new PdnMenuItem(ActionType.CapturePicture);
  109. this.menuToolsSeperator2 = new ToolStripSeparator();
  110. this.menuToolsHistogram = new PdnMenuItem(ActionType.Histogram);
  111. this.menuToolsPixelTracking = new PdnMenuItem(ActionType.PixelTracking);
  112. this.menuToolsSurfacePlot = new PdnMenuItem(ActionType.SurfacePlot);
  113. this.menuToolsSurfacePlotShow = new PdnMenuItem(ActionType.SurfacePlotShow);
  114. this.menuToolsImageIndex = new PdnMenuItem(ActionType.ImageIndex);
  115. this.menuToolsSeperator3 = new ToolStripSeparator();
  116. this.menuToolsScript = new PdnMenuItem(ActionType.Script);
  117. this.menuToolsWorkFlow = new PdnMenuItem(ActionType.WorkFlow);
  118. this.menuToolsFast = new PdnMenuItem(ActionType.ToolsFast);
  119. this.menuToolsSeperator4 = new ToolStripSeparator();
  120. this.menuToolsScratchTreatment = new PdnMenuItem(ActionType.ScratchTreatment);
  121. this.menuToolsSmudgeTreatment = new PdnMenuItem(ActionType.SmudgeTreatment);
  122. this.menuToolsSeperator5 = new ToolStripSeparator();
  123. this.menuToolsColumnDisplay = new PdnMenuItem(ActionType.ColumnDisplay);
  124. this.menuToolsPictureComparison = new PdnMenuItem(ActionType.PictureComparison);
  125. this.menuToolsCustomInterface = new PdnMenuItem(ActionType.CustomInterface);
  126. this.menuToolsCreateShortcut = new PdnMenuItem(ActionType.CreateShortcut);
  127. this.menuToolsImageInfo = new PdnMenuItem(ActionType.ImageInfo);
  128. this.menuToolsSeperator6 = new ToolStripSeparator();
  129. this.menuToolsOpenProject = new PdnMenuItem(ActionType.OpenProject);
  130. this.menuToolsAddToProject = new PdnMenuItem(ActionType.AddToProject);
  131. this.menuToolsSeperator7 = new ToolStripSeparator();
  132. this.menuToolsTemplateManager = new PdnMenuItem(ActionType.TemplateManager);
  133. this.menuToolsCreateReport = new PdnMenuItem(ActionType.CreateReport);
  134. this.menuToolsSeperator8 = new ToolStripSeparator();
  135. this.menuToolsRestoreImages = new PdnMenuItem(ActionType.RestoreImages);
  136. this.menuToolsSelfRestart = new PdnMenuItem(ActionType.SelfRestart);
  137. //
  138. // ToolsMenu
  139. //
  140. this.DropDownItems.AddRange(
  141. new ToolStripItem[]
  142. {
  143. this.menuToolsGridLine,
  144. this.menuToolsAuxiliaryLine,
  145. this.menuToolsViewRuler,
  146. this.menuToolsSeperator1,
  147. this.menuToolsCaptureWindow,
  148. this.menuToolsCapturePicture,
  149. this.menuToolsSeperator2,
  150. this.menuToolsHistogram,
  151. this.menuToolsPixelTracking,
  152. this.menuToolsSurfacePlot,
  153. this.menuToolsSurfacePlotShow,
  154. this.menuToolsImageIndex,
  155. this.menuToolsSeperator3,
  156. this.menuToolsScript,
  157. this.menuToolsWorkFlow,
  158. this.menuToolsFast,
  159. this.menuToolsSeperator4,
  160. this.menuToolsScratchTreatment,
  161. this.menuToolsSmudgeTreatment,
  162. this.menuToolsSeperator5,
  163. this.menuToolsColumnDisplay,
  164. this.menuToolsPictureComparison,
  165. this.menuToolsCustomInterface,
  166. this.menuToolsCreateShortcut,
  167. this.menuToolsImageInfo,
  168. this.menuToolsSeperator6,
  169. this.menuToolsOpenProject,
  170. this.menuToolsAddToProject,
  171. this.menuToolsSeperator7,
  172. this.menuToolsTemplateManager,
  173. this.menuToolsCreateReport,
  174. this.menuToolsSeperator8,
  175. this.menuToolsRestoreImages,
  176. this.menuToolsSelfRestart
  177. });
  178. this.Name = "Menu.Tools";
  179. this.Text = PdnResources.GetString("Menu.Tools.Text");
  180. //
  181. // 网格
  182. //
  183. this.menuToolsGridLine.Click += new EventHandler(MenuToolsGridLine_Click);
  184. //
  185. // 辅助线
  186. //
  187. this.menuToolsAuxiliaryLine.Click += new EventHandler(MenuToolsAuxiliaryLine_Click);
  188. //
  189. // 视图标尺
  190. //
  191. this.menuToolsViewRuler.Click += new EventHandler(MenuToolsViewRuler_Click);
  192. //
  193. // 捕获窗口
  194. //
  195. this.menuToolsCaptureWindow.Click += new EventHandler(MenuToolsCaptureWindow_Click);
  196. //
  197. // 捕获图片
  198. //
  199. this.menuToolsCapturePicture.Click += new EventHandler(MenuToolsCapturePicture_Click);
  200. //
  201. // 直方图
  202. //
  203. this.menuToolsHistogram.Click += new EventHandler(MenuToolsHistogram_Click);
  204. // 像素跟踪
  205. //
  206. this.menuToolsPixelTracking.Click += new EventHandler(MenuToolsPixelTracking_Click);
  207. //
  208. // 三维灰度
  209. //
  210. this.menuToolsSurfacePlot.Click += new EventHandler(MenuToolsSurfacePlot_Click);
  211. //
  212. // 三维展示
  213. //
  214. this.menuToolsSurfacePlotShow.Click += new EventHandler(MenuToolsSurfacePlotShow_Click);
  215. //
  216. // 图像索引
  217. //
  218. this.menuToolsImageIndex.Click += new EventHandler(MenuToolsImageIndex_Click);
  219. //
  220. // 脚本管理
  221. //
  222. this.menuToolsScript.Click += new EventHandler(MenuToolsScript_Click);
  223. //
  224. // 工作流程
  225. //
  226. this.menuToolsWorkFlow.Click += new EventHandler(MenuToolsWorkFlow_Click);
  227. //
  228. // 快捷菜单
  229. //
  230. this.menuToolsFast.Click += new EventHandler(MenuToolsFast_Click);
  231. //
  232. // 划痕处理
  233. //
  234. this.menuToolsScratchTreatment.Click += new EventHandler(MenuToolsScratchTreatment_Click);
  235. //
  236. // 污迹处理
  237. //
  238. this.menuToolsSmudgeTreatment.Click += new EventHandler(MenuToolsSmudgeTreatment_Click);
  239. //
  240. // 分栏显示
  241. //
  242. this.menuToolsColumnDisplay.Click += new EventHandler(MenuToolsColumnDisplay_Click);
  243. //
  244. // 图片对比
  245. //
  246. this.menuToolsPictureComparison.Click += new EventHandler(MenuToolsPictureComparison_Click);
  247. //
  248. // 自定义界面
  249. //
  250. this.menuToolsCustomInterface.Click += new EventHandler(MenuToolsCustomInterface_Click);
  251. //
  252. // 生成快捷方式
  253. //
  254. this.menuToolsCreateShortcut.Click += new EventHandler(MenuToolsCreateShortcut_Click);
  255. //
  256. // 图片信息
  257. //
  258. this.menuToolsImageInfo.Click += new EventHandler(MenuToolsImageInfo_Click);
  259. //
  260. // 项目工程
  261. //
  262. this.menuToolsOpenProject.Click += new EventHandler(MenuToolsOpenProject_Click);
  263. //
  264. // 添加到工程
  265. //
  266. this.menuToolsAddToProject.Click += new EventHandler(MenuToolsAddToProject_Click);
  267. //
  268. // 模板管理
  269. //
  270. this.menuToolsTemplateManager.Click += new EventHandler(MenuToolsTemplateManager_Click);
  271. //
  272. // 生成报告
  273. //
  274. this.menuToolsCreateReport.Click += new EventHandler(MenuToolsCreateReport_Click);
  275. //
  276. // 恢复图片
  277. //
  278. this.menuToolsRestoreImages.Click += new EventHandler(MenuToolsRestoreImages_Click);
  279. //
  280. // 重新启动
  281. //
  282. this.menuToolsSelfRestart.Click += new EventHandler(MenuToolsSelfRestart_Click);
  283. //
  284. // 加载菜单的文字和icon
  285. //
  286. this.LoadNames(this.Name);
  287. this.LoadIcons();
  288. }
  289. protected override void OnDropDownOpening(EventArgs e)
  290. {
  291. this.menuToolsGridLine.Checked = AppWorkspace.ActiveDocumentWorkspace != null ? AppWorkspace.ActiveDocumentWorkspace.GridLineEnabled : false;
  292. this.menuToolsAuxiliaryLine.Checked = AppWorkspace.ActiveDocumentWorkspace != null ? AppWorkspace.ActiveDocumentWorkspace.AuxiliaryLineEnabled : false;
  293. this.menuToolsViewRuler.Checked = Settings.CurrentUser.GetBoolean(SettingNames.Rulers, true);
  294. this.menuToolsSmudgeTreatment.Checked = AppWorkspace.Widgets.SmudgeTreatmentDialog.Visible;
  295. this.menuToolsScratchTreatment.Checked = AppWorkspace.Widgets.ScratchTreatmentDialog.Visible;
  296. this.menuToolsOpenProject.Checked = AppWorkspace.Widgets.ProjectEngineering.Visible;
  297. this.menuToolsWorkFlow.Checked = AppWorkspace.Widgets.WorkFlowDialog.Visible;
  298. this.menuToolsHistogram.Checked = AppWorkspace.Widgets.HistogramDialog.Visible;
  299. this.menuToolsPixelTracking.Checked = AppWorkspace.Widgets.PixelTrackingDialog.Visible;
  300. this.menuToolsImageIndex.Checked = AppWorkspace.Widgets.ImageIndexDialog.Visible;
  301. if (SurfacePlotWindow.form != null)
  302. this.menuToolsSurfacePlot.Checked = true;
  303. else
  304. this.menuToolsSurfacePlot.Checked = false;
  305. base.OnDropDownOpening(e);
  306. }
  307. /// <summary>
  308. /// 网格
  309. /// </summary>
  310. /// <param name="sender"></param>
  311. /// <param name="e"></param>
  312. private void MenuToolsGridLine_Click(object sender, EventArgs e)
  313. {
  314. if (AppWorkspace.ActiveDocumentWorkspace != null)
  315. {
  316. if (AppWorkspace.startScriptRecording)
  317. {
  318. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  319. }
  320. AppWorkspace.ActiveDocumentWorkspace.GridLineEnabled = !AppWorkspace.ActiveDocumentWorkspace.GridLineEnabled;
  321. this.AppWorkspace.toolBar.RefreshBtnSelect(AppWorkspace.ActiveDocumentWorkspace.GridLineEnabled, "GridLine");
  322. this.AppWorkspace.toolsPanel.RefreshBtnSelect(AppWorkspace.ActiveDocumentWorkspace.GridLineEnabled, "GridLine");
  323. AppWorkspace.UpdateBottomButtonSelectionStatus();
  324. AppWorkspace.ActiveDocumentWorkspace.Refresh();
  325. }
  326. }
  327. /// <summary>
  328. /// 辅助线
  329. /// </summary>
  330. /// <param name="sender"></param>
  331. /// <param name="e"></param>
  332. private void MenuToolsAuxiliaryLine_Click(object sender, EventArgs e)
  333. {
  334. if(AppWorkspace.ActiveDocumentWorkspace!=null)
  335. {
  336. if (AppWorkspace.startScriptRecording)
  337. {
  338. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  339. }
  340. AppWorkspace.ActiveDocumentWorkspace.AuxiliaryLineEnabled = !Settings.CurrentUser.GetBoolean(SettingNames.DrawAuxiliaryLine, false);
  341. this.AppWorkspace.toolBar.RefreshBtnSelect(AppWorkspace.ActiveDocumentWorkspace.AuxiliaryLineEnabled, "AuxiliaryLine");
  342. this.AppWorkspace.toolsPanel.RefreshBtnSelect(AppWorkspace.ActiveDocumentWorkspace.AuxiliaryLineEnabled, "AuxiliaryLine");
  343. Settings.CurrentUser.SetBoolean(SettingNames.DrawAuxiliaryLine, AppWorkspace.ActiveDocumentWorkspace.AuxiliaryLineEnabled);
  344. AppWorkspace.UpdateBottomButtonSelectionStatus();
  345. AppWorkspace.ActiveDocumentWorkspace.Refresh();
  346. }
  347. }
  348. /// <summary>
  349. /// 隐藏显示标尺
  350. /// </summary>
  351. /// <param name="sender"></param>
  352. /// <param name="e"></param>
  353. private void MenuToolsViewRuler_Click(object sender, EventArgs e)
  354. {
  355. if (AppWorkspace.ActiveDocumentWorkspace != null)
  356. {
  357. if (AppWorkspace.startScriptRecording)
  358. {
  359. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  360. }
  361. AppWorkspace.ActiveDocumentWorkspace.RulersEnabled = !Settings.CurrentUser.GetBoolean(SettingNames.Rulers, false);
  362. this.AppWorkspace.toolBar.RefreshBtnSelect(AppWorkspace.ActiveDocumentWorkspace.RulersEnabled, "ViewRuler");
  363. this.AppWorkspace.toolsPanel.RefreshBtnSelect(AppWorkspace.ActiveDocumentWorkspace.RulersEnabled, "ViewRuler");
  364. Settings.CurrentUser.SetBoolean(SettingNames.Rulers, AppWorkspace.ActiveDocumentWorkspace.RulersEnabled);
  365. }
  366. }
  367. /// <summary>
  368. /// 捕获屏幕
  369. /// </summary>
  370. /// <param name="sender"></param>
  371. /// <param name="e"></param>
  372. private void MenuToolsCaptureWindow_Click(object sender, EventArgs e)
  373. {
  374. if (AppWorkspace.startScriptRecording)
  375. {
  376. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  377. }
  378. Bitmap myImage = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);
  379. Graphics g = Graphics.FromImage(myImage);
  380. g.CopyFromScreen(new System.Drawing.Point(0, 0), new System.Drawing.Point(0, 0), new System.Drawing.Size(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height));
  381. g.Dispose();
  382. DocumentWorkspace dw = AppWorkspace.AddNewDocumentWorkspace();
  383. Document document = Document.FromImageMat(Camera.Tools.ToMat(myImage));
  384. dw.Document = document;
  385. dw.xmlSaveModel = Startup.instance.ruleDB;
  386. dw.InitRulerInfo();
  387. dw.fileText = PdnResources.GetString("Menu.Tools.CaptureWindow.Text")+"-00" + Startup.instance.step_length;
  388. AppWorkspace.ActiveDocumentWorkspace = dw;
  389. Startup.instance.step_length += 1;
  390. }
  391. /// <summary>
  392. /// 捕获图片,这个功能临时当作copy的功能
  393. /// 但是这个功能最终是和定倍有关系的
  394. /// </summary>
  395. /// <param name="sender"></param>
  396. /// <param name="e"></param>
  397. private void MenuToolsCapturePicture_Click(object sender, EventArgs e)
  398. {
  399. if(AppWorkspace.ActiveDocumentWorkspace != null)
  400. {
  401. if (AppWorkspace.startScriptRecording)
  402. {
  403. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  404. }
  405. AppWorkspace.ActiveDocumentWorkspace.ClearDoubleBuffer();
  406. Document document = Document.FromImageMat(Camera.Tools.ToMat((Bitmap)(AppWorkspace.ActiveDocumentWorkspace.GetClientRangePic())));
  407. DocumentWorkspace dw = AppWorkspace.AddNewDocumentWorkspace();
  408. dw.Document = document;
  409. dw.xmlSaveModel = this.AppWorkspace.ActiveDocumentWorkspace.xmlSaveModel;
  410. dw.rules = this.AppWorkspace.ActiveDocumentWorkspace.rules;
  411. dw.fileText = PdnResources.GetString("Menu.Tools.CapturePicture.Text") +"-00" + Startup.instance.step_length;
  412. AppWorkspace.ActiveDocumentWorkspace = dw;
  413. Startup.instance.step_length += 1;
  414. }
  415. }
  416. /// <summary>
  417. /// 直方图
  418. /// </summary>
  419. /// <param name="sender"></param>
  420. /// <param name="e"></param>
  421. private void MenuToolsHistogram_Click(object sender, EventArgs e)
  422. {
  423. if (AppWorkspace.startScriptRecording)
  424. {
  425. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  426. }
  427. if (AppWorkspace.ActiveDocumentWorkspace != null)
  428. {
  429. AppWorkspace.Widgets.HistogramDialog.Visible = !AppWorkspace.Widgets.HistogramDialog.Visible;
  430. this.AppWorkspace.toolBar.RefreshBtnSelect(AppWorkspace.Widgets.HistogramDialog.Visible, "Histogram");
  431. this.AppWorkspace.toolsPanel.RefreshBtnSelect(AppWorkspace.Widgets.HistogramDialog.Visible, "Histogram");
  432. this.menuToolsHistogram.Checked = AppWorkspace.Widgets.HistogramDialog.Visible;
  433. }
  434. else
  435. {
  436. if (AppWorkspace.Widgets.HistogramDialog.Visible == false)
  437. {
  438. MessageBox.Show(PdnResources.GetString("Menu.Pleaseopenthepicture.Text"));//后可以使用直方图
  439. }
  440. else
  441. AppWorkspace.Widgets.HistogramDialog.Visible = false;
  442. }
  443. if (AppWorkspace.ActiveDocumentWorkspace != null)
  444. {
  445. if (this.AppWorkspace.ActiveDocumentWorkspace.best)
  446. this.AppWorkspace.ActiveDocumentWorkspace.buttonType = 0;
  447. else if (this.AppWorkspace.ActiveDocumentWorkspace.maxMin)
  448. this.AppWorkspace.ActiveDocumentWorkspace.buttonType = 1;
  449. else if (this.AppWorkspace.ActiveDocumentWorkspace.gamma45)
  450. this.AppWorkspace.ActiveDocumentWorkspace.buttonType = 2;
  451. else if (this.AppWorkspace.ActiveDocumentWorkspace.origin)
  452. this.AppWorkspace.ActiveDocumentWorkspace.buttonType = 3;
  453. this.AppWorkspace.RefreshHistogram();
  454. AppWorkspace.ActiveDocumentWorkspace.Focus();
  455. }
  456. //using (HistogramDialog dialog = new HistogramDialog(AppWorkspace))
  457. //{
  458. // dialog.ShowDialog();
  459. //}
  460. }
  461. /// <summary>
  462. /// 像素跟踪
  463. /// </summary>
  464. /// <param name="sender"></param>
  465. /// <param name="e"></param>
  466. private void MenuToolsPixelTracking_Click(object sender, EventArgs e)
  467. {
  468. if (AppWorkspace.startScriptRecording)
  469. {
  470. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  471. }
  472. AppWorkspace.Widgets.PixelTrackingDialog.Visible = !AppWorkspace.Widgets.PixelTrackingDialog.Visible;
  473. this.AppWorkspace.toolBar.RefreshBtnSelect(AppWorkspace.Widgets.PixelTrackingDialog.Visible, "PixelTracking");
  474. this.AppWorkspace.toolsPanel.RefreshBtnSelect(AppWorkspace.Widgets.PixelTrackingDialog.Visible, "PixelTracking");
  475. this.menuToolsPixelTracking.Checked = AppWorkspace.Widgets.PixelTrackingDialog.Visible;
  476. if (CameraPreviewDialog.cameraPreviewDialog != null)
  477. CameraPreviewDialog.cameraPreviewDialog.documentWorkspace.Focus();
  478. if (AppWorkspace.ActiveDocumentWorkspace != null)
  479. {
  480. AppWorkspace.ActiveDocumentWorkspace.Focus();
  481. }
  482. }
  483. /// <summary>
  484. /// 三维灰度
  485. /// </summary>
  486. /// <param name="sender"></param>
  487. /// <param name="e"></param>
  488. private void MenuToolsSurfacePlot_Click(object sender, EventArgs e)
  489. {
  490. if (AppWorkspace.ActiveDocumentWorkspace != null)
  491. {
  492. if (AppWorkspace.startScriptRecording)
  493. {
  494. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  495. }
  496. if (SurfacePlotWindow.form != null)
  497. {
  498. SurfacePlotWindow.form.Close();
  499. this.menuToolsSurfacePlot.Checked = false;
  500. }
  501. else
  502. {
  503. SurfacePlotWindow.Run(this.AppWorkspace);
  504. this.menuToolsSurfacePlot.Checked = true;
  505. }
  506. }
  507. /*RegularTetrahedron3D*/
  508. else
  509. MessageBox.Show(PdnResources.GetString("Menu.Pleaseopenthepicture.Text"));
  510. }
  511. /// <summary>
  512. /// 三维显示
  513. /// </summary>
  514. /// <param name="sender"></param>
  515. /// <param name="e"></param>
  516. private void MenuToolsSurfacePlotShow_Click(object sender, EventArgs e)
  517. {
  518. using (ImageThreeDShowDialog imageDepthExtensionDialog = new ImageThreeDShowDialog(this.AppWorkspace))
  519. {
  520. if (AppWorkspace.startScriptRecording)
  521. {
  522. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  523. }
  524. imageDepthExtensionDialog.StartPosition = FormStartPosition.CenterScreen;
  525. imageDepthExtensionDialog.ShowDialog();
  526. }
  527. }
  528. /// <summary>
  529. /// 图像索引
  530. /// </summary>
  531. /// <param name="sender"></param>
  532. /// <param name="e"></param>
  533. private void MenuToolsImageIndex_Click(object sender, EventArgs e)
  534. {
  535. if (AppWorkspace.startScriptRecording)
  536. {
  537. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  538. }
  539. AppWorkspace.Widgets.ImageIndexDialog.Visible = !AppWorkspace.Widgets.ImageIndexDialog.Visible;
  540. this.AppWorkspace.toolBar.RefreshBtnSelect(AppWorkspace.Widgets.ImageIndexDialog.Visible, "ImageIndex");
  541. this.AppWorkspace.toolsPanel.RefreshBtnSelect(AppWorkspace.Widgets.ImageIndexDialog.Visible, "ImageIndex");
  542. AppWorkspace.Widgets.ImageIndexDialog.Width = AppWorkspace.Widgets.ImageIndexDialog.fromMinSize;
  543. this.menuToolsImageIndex.Checked = AppWorkspace.Widgets.ImageIndexDialog.Visible;
  544. if (AppWorkspace.ActiveDocumentWorkspace != null)
  545. {
  546. AppWorkspace.ActiveDocumentWorkspace.Focus();
  547. }
  548. //ImageIndexDialog dialog = new ImageIndexDialog(AppWorkspace,816);
  549. //dialog.ShowDialog();
  550. //Form form = Application.OpenForms["ImageIndexDialog"];//尝试获取已经弹出的窗口对象
  551. //FloatingFormMethod.ShowFloatForm(form, form == null ? new ImageIndexDialog(AppWorkspace)/*没有弹出的窗口对象则创建*/ : null, AppWorkspace);
  552. //this.menuToolsImageIndex.Checked = AppWorkspace.Widgets.ImageIndexDialog.Visible;
  553. }
  554. /// <summary>
  555. /// 脚本
  556. /// </summary>
  557. /// <param name="sender"></param>
  558. /// <param name="e"></param>
  559. private void MenuToolsScript_Click(object sender, EventArgs e)
  560. {
  561. if (AppWorkspace.startScriptRecording)
  562. {
  563. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  564. }
  565. scriptManageDialog = (ScriptManageDialog)Application.OpenForms["ScriptManageDialog"];//尝试获取已经弹出的窗口对象
  566. bool nullFLag = false;
  567. if (scriptManageDialog == null)
  568. {
  569. nullFLag = true;
  570. scriptManageDialog = new ScriptManageDialog(AppWorkspace);
  571. AppWorkspace.ScriptDialog = scriptManageDialog;
  572. }
  573. FloatingFormMethod.ShowFloatForm(nullFLag ? null : scriptManageDialog, scriptManageDialog, AppWorkspace);
  574. //if (scriptManageDialog == null)
  575. //{
  576. // scriptManageDialog = new ScriptManageDialog(AppWorkspace);
  577. // AppWorkspace.ScriptDialog = scriptManageDialog;
  578. // scriptManageDialog.StartPosition = FormStartPosition.CenterScreen;
  579. // scriptManageDialog.Show();
  580. //}
  581. //else
  582. //{
  583. // if (!scriptManageDialog.IsDisposed)
  584. // {
  585. // scriptManageDialog.WindowState = FormWindowState.Normal;
  586. // }
  587. // else
  588. // {
  589. // scriptManageDialog = new ScriptManageDialog(AppWorkspace);
  590. // AppWorkspace.ScriptDialog = scriptManageDialog;
  591. // scriptManageDialog.StartPosition = FormStartPosition.CenterScreen;
  592. // scriptManageDialog.Show();
  593. // }
  594. //}
  595. }
  596. /// <summary>
  597. /// 工作流程
  598. /// </summary>
  599. /// <param name="sender"></param>
  600. /// <param name="e"></param>
  601. private void MenuToolsWorkFlow_Click(object sender, EventArgs e)
  602. {
  603. if (AppWorkspace.startScriptRecording)
  604. {
  605. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  606. }
  607. AppWorkspace.Widgets.WorkFlowDialog.Visible = !AppWorkspace.Widgets.WorkFlowDialog.Visible;
  608. this.AppWorkspace.toolBar.RefreshBtnSelect(AppWorkspace.Widgets.WorkFlowDialog.Visible, "WorkFlow");
  609. this.AppWorkspace.toolsPanel.RefreshBtnSelect(AppWorkspace.Widgets.WorkFlowDialog.Visible, "WorkFlow");
  610. this.menuToolsWorkFlow.Checked = AppWorkspace.Widgets.WorkFlowDialog.Visible;
  611. if (AppWorkspace.ActiveDocumentWorkspace != null)
  612. {
  613. AppWorkspace.ActiveDocumentWorkspace.Focus();
  614. }
  615. }
  616. /// <summary>
  617. /// 快捷菜单
  618. /// </summary>
  619. /// <param name="sender"></param>
  620. /// <param name="e"></param>
  621. private void MenuToolsFast_Click(object sender, EventArgs e)
  622. {
  623. if (AppWorkspace != null)
  624. {
  625. if (AppWorkspace.startScriptRecording)
  626. {
  627. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  628. }
  629. AppWorkspace.toolsPanel.Visible = !AppWorkspace.toolsPanel.Visible;
  630. }
  631. }
  632. /// <summary>
  633. /// 划痕处理
  634. /// </summary>
  635. /// <param name="sender"></param>
  636. /// <param name="e"></param>
  637. private void MenuToolsScratchTreatment_Click(object sender, EventArgs e)
  638. {
  639. if (AppWorkspace.Widgets.SmudgeTreatmentDialog.Visible)
  640. AppWorkspace.Widgets.SmudgeTreatmentDialog.Visible = false;
  641. if (AppWorkspace.ActiveDocumentWorkspace != null)
  642. AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.DrawScratchTreatmentLine;
  643. if (AppWorkspace.ActiveDocumentWorkspace != null)
  644. {
  645. this.AppWorkspace.toolBar.RefreshBtnSelect(AppWorkspace.Widgets.SmudgeTreatmentDialog.Visible, "SmudgeTreatment");
  646. this.AppWorkspace.toolsPanel.RefreshBtnSelect(AppWorkspace.Widgets.SmudgeTreatmentDialog.Visible, "SmudgeTreatment");
  647. this.menuToolsSmudgeTreatment.Checked = AppWorkspace.Widgets.SmudgeTreatmentDialog.Visible;
  648. AppWorkspace.Widgets.ScratchTreatmentDialog.Visible = !AppWorkspace.Widgets.ScratchTreatmentDialog.Visible;
  649. this.AppWorkspace.toolBar.RefreshBtnSelect(AppWorkspace.Widgets.ScratchTreatmentDialog.Visible, "ScratchTreatment");
  650. this.AppWorkspace.toolsPanel.RefreshBtnSelect(AppWorkspace.Widgets.ScratchTreatmentDialog.Visible, "ScratchTreatment");
  651. this.menuToolsScratchTreatment.Checked = AppWorkspace.Widgets.ScratchTreatmentDialog.Visible;
  652. }
  653. }
  654. /// <summary>
  655. /// 污迹处理
  656. /// </summary>
  657. /// <param name="sender"></param>
  658. /// <param name="e"></param>
  659. private void MenuToolsSmudgeTreatment_Click(object sender, EventArgs e)
  660. {
  661. //if (AppWorkspace.ActiveDocumentWorkspace != null)
  662. //{
  663. // AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.DrawSmudgeRectangle;// DrawSmudgePolygon;// DrawSmudgeEllipse;//
  664. //}
  665. if (AppWorkspace.Widgets.ScratchTreatmentDialog.Visible)
  666. AppWorkspace.Widgets.ScratchTreatmentDialog.Visible = false;
  667. AppWorkspace.Widgets.SmudgeTreatmentDialog.RefreshActiveTool();
  668. if (AppWorkspace.ActiveDocumentWorkspace != null)
  669. {
  670. this.AppWorkspace.toolBar.RefreshBtnSelect(AppWorkspace.Widgets.ScratchTreatmentDialog.Visible, "ScratchTreatment");
  671. this.AppWorkspace.toolsPanel.RefreshBtnSelect(AppWorkspace.Widgets.ScratchTreatmentDialog.Visible, "ScratchTreatment");
  672. this.menuToolsScratchTreatment.Checked = AppWorkspace.Widgets.ScratchTreatmentDialog.Visible;
  673. AppWorkspace.Widgets.SmudgeTreatmentDialog.Visible = !AppWorkspace.Widgets.SmudgeTreatmentDialog.Visible;
  674. this.AppWorkspace.toolBar.RefreshBtnSelect(AppWorkspace.Widgets.SmudgeTreatmentDialog.Visible, "SmudgeTreatment");
  675. this.AppWorkspace.toolsPanel.RefreshBtnSelect(AppWorkspace.Widgets.SmudgeTreatmentDialog.Visible, "SmudgeTreatment");
  676. this.menuToolsSmudgeTreatment.Checked = AppWorkspace.Widgets.SmudgeTreatmentDialog.Visible;
  677. }
  678. }
  679. /// <summary>
  680. /// 自定义界面
  681. /// </summary>
  682. /// <param name="sender"></param>
  683. /// <param name="e"></param>
  684. private void MenuToolsCustomInterface_Click(object sender, EventArgs e)
  685. {
  686. if (AppWorkspace.startScriptRecording)
  687. {
  688. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  689. }
  690. CustomInterfaceDialog dialog = new CustomInterfaceDialog(AppWorkspace);
  691. dialog.ShowDialog();
  692. }
  693. /// <summary>
  694. /// 软件重启
  695. /// </summary>
  696. /// <param name="sender"></param>
  697. /// <param name="e"></param>
  698. private void MenuToolsSelfRestart_Click(object sender, EventArgs e)
  699. {
  700. DialogResult dr = MessageBox.Show(PdnResources.GetString("Menu.orestartthesoftwareModifiedimageswillnotbesaved.Text")+"!", PdnResources.GetString("Menu.ensure.text"), MessageBoxButtons.OKCancel, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1);
  701. if (dr == DialogResult.OK)
  702. {
  703. if (AppWorkspace.startScriptRecording)
  704. {
  705. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  706. }
  707. FileOperationHelper.DeleteFolder(Application.StartupPath + "\\BackupImages");//删除备份文件
  708. FileOperationHelper.DeleteFolder(Application.StartupPath + "\\BackupImagesTemp");//删除备份文件
  709. Application.ExitThread();
  710. Restart();
  711. }
  712. //Startup.CloseApplication();
  713. //SystemLayer.Shell.RestartApplication();
  714. }
  715. /// <summary>
  716. /// 恢复图片
  717. /// </summary>
  718. /// <param name="sender"></param>
  719. /// <param name="e"></param>
  720. private void MenuToolsRestoreImages_Click(object sender, EventArgs e)
  721. {
  722. List<string> imageList = FileOperationHelper.RestoreImages();
  723. if (AppWorkspace.startScriptRecording)
  724. {
  725. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  726. }
  727. if (imageList != null && imageList.Count > 0)
  728. {
  729. foreach (string imgName in imageList)
  730. {
  731. //Document document = Document.FromImage(Image.FromFile(imgName));
  732. Document document = Document.FromImageMat(new OpenCvSharp.Mat(imgName));
  733. DocumentWorkspace dw = AppWorkspace.AddNewDocumentWorkspace();
  734. dw.Document = document;
  735. dw.fileText = Path.GetFileNameWithoutExtension(imgName);
  736. AppWorkspace.ActiveDocumentWorkspace = dw;
  737. }
  738. }
  739. else
  740. MessageBox.Show(PdnResources.GetString("Menu.Therearenopicturestorecover.Text"));
  741. }
  742. private void Restart()
  743. {
  744. Thread thtmp = new Thread(new ParameterizedThreadStart(run));
  745. object appName = Application.ExecutablePath;
  746. Thread.Sleep(2000);
  747. thtmp.Start(appName);
  748. }
  749. private void run(Object obj)
  750. {
  751. Process ps = new Process();
  752. ps.StartInfo.FileName = obj.ToString();
  753. ps.Start();
  754. }
  755. /// <summary>
  756. /// 分栏显示
  757. /// </summary>
  758. /// <param name="sender"></param>
  759. /// <param name="e"></param>
  760. private void MenuToolsColumnDisplay_Click(object sender, EventArgs e)
  761. {
  762. using (ColumnsShowDialog columnsShowDialog = new ColumnsShowDialog(this.AppWorkspace))
  763. {
  764. if (AppWorkspace.startScriptRecording)
  765. {
  766. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  767. }
  768. columnsShowDialog.StartPosition = FormStartPosition.CenterScreen;
  769. columnsShowDialog.ShowDialog();
  770. }
  771. }
  772. /// <summary>
  773. /// 图片信息
  774. /// </summary>
  775. /// <param name="sender"></param>
  776. /// <param name="e"></param>
  777. private void MenuToolsImageInfo_Click(object sender, EventArgs e)
  778. {
  779. using (ImageInformation imageInformation = new ImageInformation(this.AppWorkspace))
  780. {
  781. if (AppWorkspace.startScriptRecording)
  782. {
  783. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  784. }
  785. imageInformation.StartPosition = FormStartPosition.CenterScreen;
  786. imageInformation.ShowDialog();
  787. }
  788. }
  789. /// <summary>
  790. /// 项目工程
  791. /// </summary>
  792. /// <param name="sender"></param>
  793. /// <param name="e"></param>
  794. private void MenuToolsOpenProject_Click(object sender, EventArgs e)
  795. {
  796. AppWorkspace.Widgets.ProjectEngineering.Visible = !AppWorkspace.Widgets.ProjectEngineering.Visible;
  797. if (AppWorkspace.ActiveDocumentWorkspace != null)
  798. {
  799. if (AppWorkspace.startScriptRecording)
  800. {
  801. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  802. }
  803. this.AppWorkspace.toolBar.RefreshBtnSelect(AppWorkspace.Widgets.ProjectEngineering.Visible, "OpenProject");
  804. this.AppWorkspace.toolsPanel.RefreshBtnSelect(AppWorkspace.Widgets.ProjectEngineering.Visible, "OpenProject");
  805. this.menuToolsOpenProject.Checked = AppWorkspace.Widgets.ProjectEngineering.Visible;
  806. AppWorkspace.ActiveDocumentWorkspace.Focus();
  807. }
  808. }
  809. /// <summary>
  810. /// 添加到工程
  811. /// 1、如果项目工程选择了常规操作,可以任意添加
  812. /// 2、如果项目工程选择了通用分析、专用分析,则必须选择其下的文件夹或项目进行添加
  813. /// </summary>
  814. /// <param name="sender"></param>
  815. /// <param name="e"></param>
  816. private void MenuToolsAddToProject_Click(object sender, EventArgs e)
  817. {
  818. if (AppWorkspace.startScriptRecording)
  819. {
  820. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  821. }
  822. //如果选择了文件夹,则添加到工程
  823. if (AppWorkspace.Widgets.ProjectEngineering.TreeNode!=null)
  824. {
  825. AppWorkspace.Widgets.ProjectEngineering.AddToProject();
  826. }
  827. //如果没有选择则提示,用户选择文件夹,并显示出来项目工程窗口
  828. else
  829. {
  830. AppWorkspace.Widgets.ProjectEngineering.Visible = true;
  831. MessageBox.Show(PdnResources.GetString("Menu.Pleaseselecttheprojectprojectnode.Text"));
  832. }
  833. }
  834. /// <summary>
  835. /// 图像对比
  836. /// </summary>
  837. /// <param name="sender"></param>
  838. /// <param name="e"></param>
  839. private void MenuToolsPictureComparison_Click(object sender, EventArgs e)
  840. {
  841. using (ImageComparison imageComparison = new ImageComparison(this.AppWorkspace))
  842. {
  843. if (AppWorkspace.startScriptRecording)
  844. {
  845. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  846. }
  847. imageComparison.StartPosition = FormStartPosition.CenterScreen;
  848. imageComparison.ShowDialog();
  849. }
  850. }
  851. /// <summary>
  852. /// 生成快捷方式
  853. /// </summary>
  854. /// <param name="sender"></param>
  855. /// <param name="e"></param>
  856. private void MenuToolsCreateShortcut_Click(object sender, EventArgs e)
  857. {
  858. if (AppWorkspace != null)
  859. {
  860. if (AppWorkspace.startScriptRecording)
  861. {
  862. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  863. }
  864. AppWorkspace.DoSaveLnk();
  865. }
  866. }
  867. /// <summary>
  868. /// 模板管理
  869. /// </summary>
  870. /// <param name="sender"></param>
  871. /// <param name="e"></param>
  872. private void MenuToolsTemplateManager_Click(object sender, EventArgs e)
  873. {
  874. using (TemplateManagerDialog dialog = new TemplateManagerDialog())
  875. {
  876. if (AppWorkspace.startScriptRecording)
  877. {
  878. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  879. }
  880. dialog.StartPosition = FormStartPosition.CenterParent;
  881. dialog.ShowDialog();
  882. }
  883. }
  884. /// <summary>
  885. /// 生成报告
  886. /// </summary>
  887. /// <param name="sender"></param>
  888. /// <param name="e"></param>
  889. private void MenuToolsCreateReport_Click(object sender, EventArgs e)
  890. {
  891. if (AppWorkspace.DocumentWorkspaces != null && AppWorkspace.DocumentWorkspaces.Count() > 0)
  892. {
  893. if (AppWorkspace.startScriptRecording)
  894. {
  895. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  896. }
  897. using (CreateReportDialog createReportDialog = new CreateReportDialog(this.AppWorkspace))
  898. {
  899. createReportDialog.StartPosition = FormStartPosition.CenterScreen;
  900. createReportDialog.ShowDialog();
  901. }
  902. }
  903. else
  904. MessageBox.Show(PdnResources.GetString("Menu.Thereportcannotbegeneratedwithoutanopenim.Text"));
  905. }
  906. }
  907. }