ImageCollectionMenu.cs 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367
  1. using Resources;
  2. using SmartCoalApplication.Actions;
  3. using SmartCoalApplication.Core;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Drawing;
  7. using System.IO;
  8. using System.Windows.Forms;
  9. namespace SmartCoalApplication.Menus
  10. {
  11. /// <summary>
  12. /// 图像采集菜单
  13. /// </summary>
  14. internal sealed class ImageCollectionMenu : PdnMenuItem
  15. {
  16. public int index = 0;
  17. private PdnMenuItem menuCameraSelection;
  18. private PdnMenuItem menuCameraSetting;
  19. private PdnMenuItem menuCameraAdjust;
  20. private PdnMenuItem menuCameraFrame;
  21. private PdnMenuItem menuCameraConventional;
  22. private ToolStripSeparator menuSeparator1;
  23. private PdnMenuItem menuImageCollectHdr;
  24. private ToolStripSeparator menuSeparator2;
  25. private PdnMenuItem menuPreviewAction;
  26. private PdnMenuItem menuPreviewActionClose;
  27. private PdnMenuItem menuShootAction;
  28. private ToolStripSeparator menuSeparator3;
  29. private PdnMenuItem menuAutofocus;
  30. private PdnMenuItem menuRealTimeDepth;
  31. private PdnMenuItem menuRealTimeStitching;
  32. private PdnMenuItem menuAutomaticDepth;
  33. private PdnMenuItem menuImageStitching;
  34. private PdnMenuItem menuTimedShooting;
  35. private PdnMenuItem menuVideoRecording;
  36. private PdnMenuItem menuZaxisScan;
  37. private PdnMenuItem menuMultiDimensional;
  38. private PdnMenuItem menuListOfLocations;
  39. // 曝光
  40. private PdnMenuItem menuAdjustExposure;
  41. // 白平衡
  42. private PdnMenuItem menuAdjustWhiteBalance;
  43. // 增益
  44. private PdnMenuItem menuAdjustGain;
  45. // 饱和度
  46. private PdnMenuItem menuAdjustSaturation;
  47. // 相机模式
  48. private PdnMenuItem menuFrameCameraMode;
  49. // 相机设置
  50. private PdnMenuItem menuFrameCameraSet;
  51. // 图像旋转
  52. private PdnMenuItem menuCommonRotate;
  53. public ImageCollectionMenu(int menuId)
  54. {
  55. InitializeComponent();
  56. this.MenuId = menuId;
  57. }
  58. protected override void OnAppWorkspaceChanged()
  59. {
  60. base.OnAppWorkspaceChanged();
  61. }
  62. private void InitializeComponent()
  63. {
  64. //相机选择
  65. this.menuCameraSelection = new PdnMenuItem(ActionType.CameraSelection);
  66. this.menuCameraSelection.AutomaticScript = false;
  67. //相机设置
  68. this.menuCameraSetting = new PdnMenuItem(ActionType.CameraSetting);
  69. this.menuCameraSetting.AutomaticScript = false;
  70. //调节
  71. this.menuCameraAdjust = new PdnMenuItem(ActionType.CameraAdjust);
  72. this.menuCameraAdjust.AutomaticScript = false;
  73. //边框
  74. this.menuCameraFrame = new PdnMenuItem(ActionType.CameraFrame);
  75. this.menuCameraFrame.AutomaticScript = false;
  76. //常规
  77. this.menuCameraConventional = new PdnMenuItem(ActionType.CameraConventional);
  78. this.menuCameraConventional.AutomaticScript = false;
  79. //分隔线
  80. this.menuSeparator1 = new ToolStripSeparator();
  81. //HDR
  82. this.menuImageCollectHdr = new PdnMenuItem(ActionType.ImageCollectHdr);
  83. this.menuImageCollectHdr.AutomaticScript = false;
  84. //分隔线
  85. this.menuSeparator2 = new ToolStripSeparator();
  86. //预览
  87. this.menuPreviewAction = new PdnMenuItem(ActionType.PreviewExtraction);
  88. this.menuPreviewAction.AutomaticScript = false;
  89. //关闭预览
  90. this.menuPreviewActionClose = new PdnMenuItem(ActionType.PreviewExtractionClose);
  91. this.menuPreviewActionClose.AutomaticScript = false;
  92. //拍摄
  93. this.menuShootAction = new PdnMenuItem(ActionType.ShootAction);
  94. this.menuShootAction.AutomaticScript = false;
  95. //分隔线
  96. this.menuSeparator3 = new ToolStripSeparator();
  97. //自动聚焦
  98. this.menuAutofocus = new PdnMenuItem(ActionType.Autofocus);
  99. this.menuAutofocus.AutomaticScript = false;
  100. //实时景深扩展
  101. this.menuRealTimeDepth = new PdnMenuItem(ActionType.RealTimeDepth);
  102. this.menuRealTimeDepth.AutomaticScript = false;
  103. //实时图像拼接
  104. this.menuRealTimeStitching = new PdnMenuItem(ActionType.RealTimeStitching);
  105. this.menuRealTimeStitching.AutomaticScript = false;
  106. //自动景深扩展
  107. this.menuAutomaticDepth = new PdnMenuItem(ActionType.AutomaticDepth);
  108. this.menuAutomaticDepth.AutomaticScript = false;
  109. //图像拼接
  110. this.menuImageStitching = new PdnMenuItem(ActionType.ImageStitching);
  111. this.menuImageStitching.AutomaticScript = false;
  112. //实时拍摄
  113. this.menuTimedShooting = new PdnMenuItem(ActionType.TimedShooting);
  114. this.menuTimedShooting.AutomaticScript = false;
  115. //视频录像
  116. this.menuVideoRecording = new PdnMenuItem(ActionType.VideoRecording);
  117. this.menuVideoRecording.AutomaticScript = false;
  118. //z轴扫描
  119. this.menuZaxisScan = new PdnMenuItem(ActionType.ZaxisScan);
  120. this.menuZaxisScan.AutomaticScript = false;
  121. //多维图像合成
  122. this.menuMultiDimensional = new PdnMenuItem(ActionType.MultiDimensional);
  123. this.menuMultiDimensional.AutomaticScript = false;
  124. //位置列表
  125. this.menuListOfLocations = new PdnMenuItem(ActionType.ListOfLocations);
  126. this.menuListOfLocations.AutomaticScript = false;
  127. // 曝光
  128. this.menuAdjustExposure = new PdnMenuItem(ActionType.AdjustExposure);
  129. this.menuAdjustExposure.AutomaticScript = false;
  130. // 白平衡
  131. this.menuAdjustWhiteBalance = new PdnMenuItem(ActionType.AdjustWhiteBalance);
  132. this.menuAdjustWhiteBalance.AutomaticScript = false;
  133. // 增益
  134. this.menuAdjustGain = new PdnMenuItem(ActionType.AdjustGain);
  135. this.menuAdjustGain.AutomaticScript = false;
  136. // 饱和度
  137. this.menuAdjustSaturation = new PdnMenuItem(ActionType.AdjustSaturation);
  138. this.menuAdjustSaturation.AutomaticScript = false;
  139. // 相机模式
  140. this.menuFrameCameraMode = new PdnMenuItem(ActionType.FrameCameraMode);
  141. this.menuFrameCameraMode.AutomaticScript = false;
  142. // 相机设置
  143. this.menuFrameCameraSet = new PdnMenuItem(ActionType.FrameCameraSet);
  144. this.menuFrameCameraSet.AutomaticScript = false;
  145. // 图像旋转
  146. this.menuCommonRotate = new PdnMenuItem(ActionType.CommonRotate);
  147. this.menuCommonRotate.AutomaticScript = false;
  148. //
  149. // 主菜单
  150. //
  151. this.DropDownItems.AddRange(new ToolStripItem[] {
  152. this.menuCameraSelection,
  153. this.menuCameraSetting,
  154. this.menuCameraAdjust,
  155. this.menuCameraFrame,
  156. this.menuCameraConventional,
  157. this.menuSeparator1,
  158. this.menuImageCollectHdr,
  159. //this.menuSeparator2,
  160. this.menuPreviewAction,
  161. this.menuPreviewActionClose,
  162. this.menuShootAction,
  163. this.menuSeparator3,
  164. this.menuAutofocus,
  165. this.menuRealTimeDepth,
  166. this.menuRealTimeStitching,
  167. this.menuAutomaticDepth,
  168. this.menuImageStitching,
  169. this.menuTimedShooting,
  170. this.menuVideoRecording,
  171. this.menuZaxisScan,
  172. this.menuMultiDimensional,
  173. this.menuListOfLocations
  174. });
  175. this.Name = "Menu.ImageCollection";
  176. this.Text = PdnResources.GetString("Menu.ImageCollection.Text");
  177. //调节
  178. this.menuCameraAdjust.Click += null;
  179. this.menuCameraAdjust.DropDownItems.AddRange(new ToolStripItem[] {
  180. this.menuAdjustExposure,
  181. this.menuAdjustWhiteBalance,
  182. this.menuAdjustGain,
  183. this.menuAdjustSaturation
  184. });
  185. //
  186. // 调节 - 曝光时间
  187. //
  188. this.menuAdjustExposure.NeedWaitKey = true;
  189. this.menuAdjustExposure.Click += new System.EventHandler(this.AdjustExposure_Click);
  190. this.menuAdjustExposure.Text = PdnResources.GetString("Menu.timeofexposure.text");
  191. this.menuAdjustExposure.Image = PdnResources.GetImageResource("Icons.MenuImageCollectionExposureTimeIcon.png").Reference;
  192. //
  193. // 调节 - 白平衡
  194. //
  195. this.menuAdjustWhiteBalance.NeedWaitKey = true;
  196. this.menuAdjustWhiteBalance.Click += new System.EventHandler(this.AdjustWhiteBalance_Click);
  197. this.menuAdjustWhiteBalance.Text = PdnResources.GetString("Menu.Image.WhiteBalance.Text");
  198. this.menuAdjustWhiteBalance.Image = PdnResources.GetImageResource("Icons.MenuImageCollectionWhiteBalanceIcon.png").Reference;
  199. //
  200. // 调节 - 增益
  201. //
  202. this.menuAdjustGain.NeedWaitKey = true;
  203. this.menuAdjustGain.Click += new System.EventHandler(this.AdjustGain_Click);
  204. this.menuAdjustGain.Text = PdnResources.GetString("Menu.imagecapture.adjust.Gain.text");
  205. this.menuAdjustGain.Image = PdnResources.GetImageResource("Icons.MenuImageCollectionGainIcon.png").Reference;
  206. //
  207. // 调节 - 饱和度
  208. //
  209. this.menuAdjustSaturation.NeedWaitKey = true;
  210. this.menuAdjustSaturation.Click += new System.EventHandler(this.AdjustSaturation_Click);
  211. this.menuAdjustSaturation.Text = PdnResources.GetString("Menu.saturation.text");
  212. this.menuAdjustSaturation.Image = PdnResources.GetImageResource("Icons.MenuImageCollectionSaturationIcon.png").Reference;
  213. //
  214. // 边框
  215. //
  216. this.menuCameraFrame.Click += null;
  217. this.menuCameraFrame.DropDownItems.AddRange(new ToolStripItem[] {
  218. this.menuFrameCameraMode,
  219. this.menuFrameCameraSet
  220. });
  221. //
  222. // 边框 - 相机模式
  223. //
  224. this.menuFrameCameraMode.NeedWaitKey = true;
  225. this.menuFrameCameraMode.Click += new System.EventHandler(this.FrameCameraMode_Click);
  226. this.menuFrameCameraMode.Text = PdnResources.GetString("Menu.Cameramode.text");
  227. this.menuFrameCameraMode.Image = PdnResources.GetImageResource("Icons.MenuImageCollectionFrameCameraModeIcon.png").Reference;
  228. //
  229. // 边框 - 相机设置
  230. //
  231. this.menuFrameCameraSet.NeedWaitKey = true;
  232. this.menuFrameCameraSet.Click += new System.EventHandler(this.FrameCameraSet_Click);
  233. this.menuFrameCameraSet.Text = PdnResources.GetString("Menu.ImageCollection.CameraSetting.Text");
  234. this.menuFrameCameraSet.Image = PdnResources.GetImageResource("Icons.MenuImageCollectionFrameCameraSetIcon.png").Reference;
  235. //
  236. // 常规
  237. //
  238. this.menuCameraConventional.Click += null;
  239. this.menuCameraConventional.DropDownItems.AddRange(new ToolStripItem[] {
  240. this.menuCommonRotate,
  241. });
  242. //
  243. // 边框 - 相机设置
  244. //
  245. this.menuCommonRotate.NeedWaitKey = true;
  246. this.menuCommonRotate.Click += new System.EventHandler(this.CommonRotate_Click);
  247. this.menuCommonRotate.Text = PdnResources.GetString("Menu.Imagerotation.text");
  248. this.menuCommonRotate.Image = PdnResources.GetImageResource("Icons.MenuImageCollectionCommonRotateIcon.png").Reference;
  249. //
  250. // HDR
  251. //
  252. this.menuImageCollectHdr.Click += new System.EventHandler(this.HDR_Click);
  253. //
  254. // 预览窗口
  255. //
  256. this.menuPreviewAction.NeedWaitKey = true;
  257. this.menuPreviewAction.Click += new System.EventHandler(this.previewExtraction_Click);
  258. //
  259. // 关闭预览
  260. //
  261. this.menuPreviewActionClose.NeedWaitKey = true;
  262. this.menuPreviewActionClose.Click += new System.EventHandler(this.PreviewActionClose_Click);
  263. //
  264. // 加载菜单的文字和icon
  265. //
  266. this.LoadNames(this.Name);
  267. this.LoadIcons();
  268. }
  269. #region 自动聚焦
  270. /// <summary>
  271. /// 自动聚焦
  272. /// </summary>
  273. /// <param name="sender"></param>
  274. /// <param name="e"></param>
  275. private void Autofocus_Click(object sender, EventArgs e)
  276. {
  277. }
  278. #endregion
  279. protected override void OnDropDownOpening(EventArgs e)
  280. {
  281. }
  282. private void MenuCreameItem_Click(object sender, EventArgs e)
  283. {
  284. }
  285. private void CommonRotate_Click(object sender, EventArgs e)
  286. {
  287. }
  288. private void FrameCameraSet_Click(object sender, EventArgs e)
  289. {
  290. }
  291. private void FrameCameraMode_Click(object sender, EventArgs e)
  292. {
  293. }
  294. private void AdjustSaturation_Click(object sender, EventArgs e)
  295. {
  296. }
  297. private void AdjustGain_Click(object sender, EventArgs e)
  298. {
  299. }
  300. private void AdjustWhiteBalance_Click(object sender, EventArgs e)
  301. {
  302. }
  303. private void AdjustExposure_Click(object sender, EventArgs e)
  304. {
  305. }
  306. private void HDR_Click(object sender, EventArgs e)
  307. {
  308. }
  309. /// <summary>
  310. /// 预览窗口
  311. /// </summary>
  312. /// <param name="sender"></param>
  313. /// <param name="e"></param>
  314. private void previewExtraction_Click(object sender, System.EventArgs e)
  315. {
  316. }
  317. /// <summary>
  318. /// 关闭预览
  319. /// </summary>
  320. /// <param name="sender"></param>
  321. /// <param name="e"></param>
  322. private void PreviewActionClose_Click(object sender, System.EventArgs e)
  323. {
  324. }
  325. }
  326. }