insidedesign.py 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341
  1. #!/usr/bin/env python
  2. # -*- coding: UTF-8 -*-
  3. import wx
  4. import gettext
  5. from baseframe import BaseFrame
  6. class InsideDesign(BaseFrame):
  7. def __init__(self, *args, **kwds):
  8. kwds["style"] = wx.DEFAULT_FRAME_STYLE
  9. super(InsideDesign, self).__init__(*args, **kwds)
  10. self.notebook_1 = wx.Notebook(self, wx.ID_ANY, style=0)
  11. self.tab_simulation = wx.Panel(self.notebook_1, wx.ID_ANY)
  12. ####################
  13. ## ref area
  14. ####################
  15. self.panel_rosbag_play = wx.Panel(self.tab_simulation, wx.ID_ANY)
  16. self.sizer_79_staticbox = wx.StaticBox(self.tab_simulation, wx.ID_ANY, "")
  17. self.button_confirm_topics = wx.Button(self.tab_simulation, wx.ID_ANY, _("Refresh"))
  18. self.button_rviz = wx.ToggleButton(self.tab_simulation, wx.ID_ANY, _("RViz"))
  19. ###########################
  20. ## scroll module
  21. ###########################
  22. self.panel_5 = wx.ScrolledWindow(self.tab_simulation, wx.ID_ANY, style=wx.TAB_TRAVERSAL)
  23. self.label_rosbag_info = wx.StaticText(self.panel_5, wx.ID_ANY, "")
  24. self.bitmap_logo = wx.StaticBitmap(self, wx.ID_ANY, wx.NullBitmap)
  25. ###############################################
  26. ## For Select Tab
  27. ###############################################
  28. self.tab_select = wx.Panel(self.notebook_1, wx.ID_ANY)
  29. self.sizer_select_box = wx.BoxSizer(wx.VERTICAL)
  30. self.sizer_select_topics = wx.BoxSizer(wx.VERTICAL)
  31. self.select_scroll = wx.ScrolledWindow(self.tab_select, wx.ID_ANY, style=wx.TAB_TRAVERSAL)
  32. ################################
  33. ## For Depth Tab
  34. ################################
  35. self.tab_depth = wx.Panel(self.notebook_1, wx.ID_ANY)
  36. self.sizer_depth_box = wx.BoxSizer(wx.VERTICAL)
  37. self.sizer_depth_topics = wx.BoxSizer(wx.VERTICAL)
  38. self.depth_scroll = wx.ScrolledWindow(self.tab_depth, wx.ID_ANY, style=wx.TAB_TRAVERSAL)
  39. # self.panel_rosbag_play2 = wx.Panel(self.tab_depth, wx.ID_ANY)
  40. ########################
  41. ## play stop pause bar area
  42. ########################
  43. self.button_play_rosbag_play = wx.ToggleButton(self.tab_select, wx.ID_ANY, _("Start Conversion"))
  44. self.button_stop_rosbag_play = wx.ToggleButton(self.tab_select, wx.ID_ANY, _("Stop"))
  45. self.button_pause_rosbag_play = wx.ToggleButton(self.tab_select, wx.ID_ANY, _("Pause"))
  46. self.label_rosbag_play_bar = wx.StaticText(self.tab_select, wx.ID_ANY, _("Playing ... 82 %"))
  47. self.label_rosbag_play_pos = wx.StaticText(self.tab_select, wx.ID_ANY, "")
  48. self.static_line_3 = wx.StaticLine(self.tab_select, wx.ID_ANY)
  49. self.label_rosbag_play_total = wx.StaticText(self.tab_select, wx.ID_ANY, "")
  50. self.button_stop_rosbag_play.Enable(False)
  51. self.button_stop_rosbag_play.SetValue(1)
  52. self.button_pause_rosbag_play.Enable(False)
  53. self.label_rosbag_play_pos.SetMinSize((32, 17))
  54. self.label_rosbag_play_total.SetMinSize((32, 17))
  55. self.Bind(wx.EVT_TOGGLEBUTTON, self.OnROSbagPlay, self.button_play_rosbag_play)
  56. self.Bind(wx.EVT_TOGGLEBUTTON, self.OnROSbagPlay, self.button_stop_rosbag_play)
  57. self.Bind(wx.EVT_TOGGLEBUTTON, self.OnROSbagPlay, self.button_pause_rosbag_play)
  58. self.button_confirm_depth = wx.ToggleButton(self.tab_depth, wx.ID_ANY, _("confirm"))
  59. self.button_play_rosbag_play2 = wx.ToggleButton(self.tab_depth, wx.ID_ANY, _("Start Conversion"))
  60. self.button_stop_rosbag_play2 = wx.ToggleButton(self.tab_depth, wx.ID_ANY, _("Stop"))
  61. self.button_pause_rosbag_play2 = wx.ToggleButton(self.tab_depth, wx.ID_ANY, _("Pause"))
  62. self.label_rosbag_play_bar2 = wx.StaticText(self.tab_depth, wx.ID_ANY, _("Playing ... 82 %"))
  63. self.label_rosbag_play_pos2 = wx.StaticText(self.tab_depth, wx.ID_ANY, "")
  64. self.static_line_2 = wx.StaticLine(self.tab_depth, wx.ID_ANY)
  65. self.label_rosbag_play_total2 = wx.StaticText(self.tab_depth, wx.ID_ANY, "")
  66. self.button_stop_rosbag_play2.Enable(False)
  67. self.button_stop_rosbag_play2.SetValue(1)
  68. self.button_pause_rosbag_play2.Enable(False)
  69. self.label_rosbag_play_pos2.SetMinSize((32, 17))
  70. self.label_rosbag_play_total2.SetMinSize((32, 17))
  71. self.Bind(wx.EVT_TOGGLEBUTTON, self.OnROSbagPlay2, self.button_play_rosbag_play2)
  72. self.Bind(wx.EVT_TOGGLEBUTTON, self.OnROSbagPlay2, self.button_stop_rosbag_play2)
  73. self.Bind(wx.EVT_TOGGLEBUTTON, self.OnROSbagPlay2, self.button_pause_rosbag_play2)
  74. self.__set_properties()
  75. self.Bind(wx.EVT_BUTTON, self.OnGetConfirmTopics, self.button_confirm_topics)
  76. self.Bind(wx.EVT_TOGGLEBUTTON, self.OnRviz, self.button_rviz)
  77. self.Bind(wx.EVT_TOGGLEBUTTON, self.OnConfirmDepth, self.button_confirm_depth)
  78. def __set_properties(self):
  79. super(InsideDesign, self).set_properties()
  80. self.panel_5.SetScrollRate(10, 10)
  81. self.select_scroll.SetScrollRate(10, 10)
  82. self.depth_scroll.SetScrollRate(10, 10)
  83. def _do_layout(self):
  84. self.sizer_1 = wx.BoxSizer(wx.VERTICAL)
  85. sizer_29 = wx.BoxSizer(wx.HORIZONTAL)
  86. # self.sizer_cpuinfo = wx.BoxSizer(wx.HORIZONTAL)
  87. ######################3
  88. ## 大きい中の枠組みの定義
  89. #######################
  90. sizer_78 = wx.BoxSizer(wx.VERTICAL)
  91. sizer_37 = wx.BoxSizer(wx.HORIZONTAL)
  92. self.sizer_79_staticbox.Lower()
  93. sizer_79 = wx.StaticBoxSizer(self.sizer_79_staticbox, wx.VERTICAL)
  94. sizer_79.Add(self.panel_rosbag_play, 1, wx.ALL | wx.EXPAND, 4)
  95. # sizer_79.Add(self.panel_rosbag_play2, 1, wx.ALL | wx.EXPAND, 4)
  96. sizer_button_topics = wx.BoxSizer(wx.HORIZONTAL)
  97. sizer_button_topics.Add(self.button_confirm_topics, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)
  98. sizer_button_topics.Add(self.button_rviz, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)
  99. sizer_79.Add(sizer_button_topics)
  100. sizer_78.Add(sizer_79, 0, wx.ALL | wx.EXPAND, 4)
  101. ################################3
  102. ## sizer_80 play, stop pause
  103. ################################3
  104. sizer_play_stop_pause_bar_area = wx.BoxSizer(wx.HORIZONTAL)
  105. sizer_play_bar_area = wx.BoxSizer(wx.HORIZONTAL)
  106. sizer_inside_play_bar_area = wx.BoxSizer(wx.VERTICAL)
  107. sizer_inside_play_stop_pause = wx.BoxSizer(wx.HORIZONTAL)
  108. sizer_inside_play_stop_pause.Add(self.button_play_rosbag_play, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)
  109. sizer_inside_play_stop_pause.Add(self.button_stop_rosbag_play, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)
  110. sizer_inside_play_stop_pause.Add(self.button_pause_rosbag_play, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)
  111. sizer_play_stop_pause_bar_area.Add(sizer_inside_play_stop_pause, 1, wx.EXPAND, 0)
  112. sizer_play_bar_area.Add(self.label_rosbag_play_bar, 1, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)
  113. sizer_inside_play_bar_area.Add(self.label_rosbag_play_pos, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.ALIGN_CENTER_VERTICAL, 0)
  114. sizer_inside_play_bar_area.Add(self.static_line_3, 0, wx.EXPAND, 0)
  115. sizer_inside_play_bar_area.Add(self.label_rosbag_play_total, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.ALIGN_CENTER_VERTICAL, 0)
  116. sizer_play_bar_area.Add(sizer_inside_play_bar_area, 0, wx.ALL | wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, 4)
  117. sizer_play_stop_pause_bar_area.Add(sizer_play_bar_area, 1, wx.EXPAND, 0)
  118. self.sizer_select_box.Add(self.select_scroll, 1, wx.EXPAND, 0)
  119. self.sizer_select_box.Add(sizer_play_stop_pause_bar_area, 0, wx.ALL | wx.EXPAND, 4)
  120. sizer_play_stop_pause_bar_area2 = wx.BoxSizer(wx.HORIZONTAL)
  121. sizer_play_bar_area2 = wx.BoxSizer(wx.HORIZONTAL)
  122. sizer_inside_play_bar_area2 = wx.BoxSizer(wx.VERTICAL)
  123. sizer_inside_play_stop_pause2 = wx.BoxSizer(wx.HORIZONTAL)
  124. sizer_inside_play_stop_pause2.Add(self.button_confirm_depth, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 2)
  125. sizer_inside_play_stop_pause2.Add(self.button_play_rosbag_play2, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 2)
  126. sizer_inside_play_stop_pause2.Add(self.button_stop_rosbag_play2, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 2)
  127. sizer_inside_play_stop_pause2.Add(self.button_pause_rosbag_play2, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 2)
  128. sizer_play_stop_pause_bar_area2.Add(sizer_inside_play_stop_pause2, 1, wx.EXPAND, 0)
  129. sizer_play_bar_area2.Add(self.label_rosbag_play_bar2, 1, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)
  130. sizer_inside_play_bar_area2.Add(self.label_rosbag_play_pos2, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.ALIGN_CENTER_VERTICAL, 0)
  131. sizer_inside_play_bar_area2.Add(self.static_line_2, 0, wx.EXPAND, 0)
  132. sizer_inside_play_bar_area2.Add(self.label_rosbag_play_total2, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.ALIGN_CENTER_VERTICAL, 0)
  133. sizer_play_bar_area2.Add(sizer_inside_play_bar_area2, 0, wx.ALL | wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, 4)
  134. sizer_play_stop_pause_bar_area2.Add(sizer_play_bar_area2, 1, wx.EXPAND, 0)
  135. self.sizer_depth_box.Add(self.depth_scroll, 1, wx.EXPAND, 0)
  136. self.sizer_depth_box.Add(sizer_play_stop_pause_bar_area2, 0, wx.ALL | wx.EXPAND, 4)
  137. ###############################
  138. # only scroll window self.panel_5
  139. ###############################
  140. sizer_37.Add(self.label_rosbag_info, 1, wx.ALL | wx.EXPAND, 4)
  141. self.panel_5.SetSizer(sizer_37)
  142. sizer_78.Add(self.panel_5, 1, wx.EXPAND, 0)
  143. self.tab_status = wx.Panel(self.notebook_1, wx.ID_ANY)
  144. self.panel_3 = wx.ScrolledWindow(self.tab_status, wx.ID_ANY, style=wx.TAB_TRAVERSAL)
  145. self.label_top_cmd = wx.StaticText(self.panel_3, wx.ID_ANY, "")
  146. self.tab_simulation.SetSizer(sizer_78)
  147. self.tab_select.SetSizer(self.sizer_select_box)
  148. self.tab_depth.SetSizer(self.sizer_depth_box)
  149. self.notebook_1.AddPage(self.tab_simulation, _("Input Bag File"))
  150. self.notebook_1.AddPage(self.tab_select, _("Save object from Topics"))
  151. self.notebook_1.AddPage(self.tab_depth, _("Save Depth from Image and Lidar"))
  152. self.sizer_1.Add(self.notebook_1, 1, wx.EXPAND | wx.ALL, 0)
  153. # sizer_29.Add((0, 100), 0, wx.EXPAND, 0) # width line
  154. # sizer_29.Add(self.sizer_cpuinfo, 1, wx.EXPAND, 0)
  155. # self.sizer_1.Add(sizer_29, 0, wx.EXPAND, 0)
  156. #
  157. # self.sizer_1.Add(self.bitmap_logo, 0, 0, 0)
  158. self.SetSizer(self.sizer_1)
  159. self.Layout()
  160. def OnLaunchKill(self, event): # wxGlade: MyFrame.<event_handler>
  161. print "Event handler 'OnLaunchKill' not implemented!"
  162. event.Skip()
  163. def OnSetupLocalizer(self, event): # wxGlade: MyFrame.<event_handler>
  164. print "Event handler 'OnSetupLocalizer' not implemented!"
  165. event.Skip()
  166. def OnCalibrationPublisher(self, event): # wxGlade: MyFrame.<event_handler>
  167. print "Event handler 'OnCalibrationPublisher' not implemented!"
  168. event.Skip()
  169. def OnLamp(self, event): # wxGlade: MyFrame.<event_handler>
  170. print "Event handler 'OnLamp' not implemented!"
  171. event.Skip()
  172. def OnIndi(self, event): # wxGlade: MyFrame.<event_handler>
  173. print "Event handler 'OnIndi' not implemented!"
  174. event.Skip()
  175. def OnGear(self, event): # wxGlade: MyFrame.<event_handler>
  176. print "Event handler 'OnGear' not implemented!"
  177. event.Skip()
  178. def OnQuery(self, event): # wxGlade: MyFrame.<event_handler>
  179. print "Event handler 'OnQuery' not implemented!"
  180. event.Skip()
  181. def OnROSbagPlay(self, event): # wxGlade: MyFrame.<event_handler>
  182. print "Event handler 'OnROSbagPlay' not implemented!"
  183. event.Skip()
  184. def OnROSbagPlay2(self, event): # wxGlade: MyFrame.<event_handler>
  185. print "Event handler 'OnROSbagPlay2' not implemented!"
  186. event.Skip()
  187. def OnRviz(self, event):
  188. print(1)
  189. event.Skip()
  190. def OnFtrace(self, event): # wxGlade: MyFrame.<event_handler>
  191. print "Event handler 'OnFtrace' not implemented!"
  192. event.Skip()
  193. def OnEcho(self, event): # wxGlade: MyFrame.<event_handler>
  194. print "Event handler 'OnEcho' not implemented!"
  195. event.Skip()
  196. def OnRefreshTopics(self, event): # wxGlade: MyFrame.<event_handler>
  197. print "Event handler 'OnRefreshTopics' not implemented!"
  198. event.Skip()
  199. def OnGetConfirmTopics(self, event):
  200. print("Event handler 'OnGetConfirmTopics' not implemented!")
  201. event.Skip()
  202. def OnConfirmDepth(self, event):
  203. print("Event handler 'OnConfirmDepth' not implemented")
  204. event.Skip()
  205. class MyDialogROSbagRecord(wx.Dialog):
  206. def __init__(self, *args, **kwds):
  207. # begin wxGlade: MyDialogROSbagRecord.__init__
  208. kwds["style"] = wx.DEFAULT_DIALOG_STYLE
  209. wx.Dialog.__init__(self, *args, **kwds)
  210. self.text_ctrl = wx.TextCtrl(self, wx.ID_ANY, "")
  211. self.button_ref = wx.Button(self, wx.ID_ANY, _("Ref"))
  212. self.checkbox_split = wx.CheckBox(self, wx.ID_ANY, _("split"))
  213. self.label_2 = wx.StaticText(self, wx.ID_ANY, _("size"))
  214. self.text_ctrl_size = wx.TextCtrl(self, wx.ID_ANY, "")
  215. self.label_2_copy = wx.StaticText(self, wx.ID_ANY, _("MB"))
  216. self.button_start = wx.Button(self, wx.ID_ANY, _("Start"))
  217. self.button_stop = wx.Button(self, wx.ID_ANY, _("Stop"))
  218. self.panel_1 = wx.ScrolledWindow(self, wx.ID_ANY, style=wx.TAB_TRAVERSAL)
  219. self.button_refresh = wx.Button(self, wx.ID_ANY, _("Refresh"))
  220. self.__set_properties()
  221. self.__do_layout()
  222. self.Bind(wx.EVT_BUTTON, self.OnRef, self.button_ref)
  223. self.Bind(wx.EVT_BUTTON, self.OnStart, self.button_start)
  224. self.Bind(wx.EVT_BUTTON, self.OnStop, self.button_stop)
  225. self.Bind(wx.EVT_BUTTON, self.OnRefresh, self.button_refresh)
  226. # end wxGlade
  227. def __set_properties(self):
  228. # begin wxGlade: MyDialogROSbagRecord.__set_properties
  229. self.SetTitle(_("ROSBAG Record"))
  230. self.SetSize((300, 430))
  231. self.button_ref.SetMinSize((40, 29))
  232. self.text_ctrl_size.SetMinSize((50, 27))
  233. self.button_stop.Enable(False)
  234. self.panel_1.SetScrollRate(10, 10)
  235. # end wxGlade
  236. def __do_layout(self):
  237. # begin wxGlade: MyDialogROSbagRecord.__do_layout
  238. sizer_41 = wx.BoxSizer(wx.VERTICAL)
  239. self.sizer_topic = wx.BoxSizer(wx.VERTICAL)
  240. sizer_44 = wx.BoxSizer(wx.HORIZONTAL)
  241. sizer_22 = wx.BoxSizer(wx.HORIZONTAL)
  242. sizer_23 = wx.BoxSizer(wx.HORIZONTAL)
  243. sizer_28_copy_1 = wx.BoxSizer(wx.HORIZONTAL)
  244. sizer_28_copy_1.Add(self.text_ctrl, 1, wx.LEFT | wx.TOP, 4)
  245. sizer_28_copy_1.Add(self.button_ref, 0, wx.LEFT | wx.RIGHT | wx.TOP, 4)
  246. sizer_41.Add(sizer_28_copy_1, 0, wx.EXPAND, 0)
  247. sizer_22.Add(self.checkbox_split, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)
  248. sizer_23.Add(self.label_2, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)
  249. sizer_23.Add(self.text_ctrl_size, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)
  250. sizer_23.Add(self.label_2_copy, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)
  251. sizer_22.Add(sizer_23, 1, wx.LEFT | wx.EXPAND, 20)
  252. sizer_41.Add(sizer_22, 0, wx.EXPAND, 0)
  253. sizer_44.Add(self.button_start, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)
  254. sizer_44.Add(self.button_stop, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)
  255. sizer_41.Add(sizer_44, 0, wx.EXPAND, 0)
  256. self.panel_1.SetSizer(self.sizer_topic)
  257. sizer_41.Add(self.panel_1, 1, wx.EXPAND, 0)
  258. sizer_41.Add(self.button_refresh, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)
  259. self.SetSizer(sizer_41)
  260. self.Layout()
  261. # end wxGlade
  262. def OnRef(self, event): # wxGlade: MyDialogROSbagRecord.<event_handler>
  263. print "Event handler 'OnRef' not implemented!"
  264. event.Skip()
  265. def OnStart(self, event): # wxGlade: MyDialogROSbagRecord.<event_handler>
  266. print "Event handler 'OnStart' not implemented!"
  267. event.Skip()
  268. def OnStop(self, event): # wxGlade: MyDialogROSbagRecord.<event_handler>
  269. print "Event handler 'OnStop' not implemented!"
  270. event.Skip()
  271. def OnRefresh(self, event): # wxGlade: MyDialogROSbagRecord.<event_handler>
  272. print "Event handler 'OnRefresh' not implemented!"
  273. event.Skip()
  274. # end of class MyDialogCarPedestrian
  275. class MyApp(wx.App):
  276. def OnInit(self):
  277. wx.InitAllImageHandlers()
  278. frame_1 = InsideDesign(None, wx.ID_ANY, "")
  279. self.SetTopWindow(frame_1)
  280. frame_1.Show()
  281. return 1
  282. # end of class MyApp
  283. if __name__ == "__main__":
  284. gettext.install("app") # replace with the appropriate catalog name
  285. app = MyApp(0)
  286. app.MainLoop()