How to use sizer method in Molotov

Best Python code snippet using molotov_python

rtmgr.py

Source:rtmgr.py Github

copy

Full Screen

1#!/usr/bin/env python2# -*- coding: UTF-8 -*-3#4# generated by wxGlade 0.6.8 on Fri Sep 2 19:08:14 20165#6import wx7# begin wxGlade: dependencies8import gettext9# end wxGlade10# begin wxGlade: extracode11# end wxGlade12class MyFrame(wx.Frame):13 def __init__(self, *args, **kwds):14 # begin wxGlade: MyFrame.__init__15 kwds["style"] = wx.DEFAULT_FRAME_STYLE16 wx.Frame.__init__(self, *args, **kwds)17 self.notebook_1 = wx.Notebook(self, wx.ID_ANY, style=0)18 self.tab_simulation = wx.Panel(self.notebook_1, wx.ID_ANY)19 self.panel_rosbag_play = wx.Panel(self.tab_simulation, wx.ID_ANY)20 self.sizer_79_staticbox = wx.StaticBox(self.tab_simulation, wx.ID_ANY, "")21 self.button_play_rosbag_play = wx.ToggleButton(self.tab_simulation, wx.ID_ANY, _("Play"))22 self.button_stop_rosbag_play = wx.ToggleButton(self.tab_simulation, wx.ID_ANY, _("Stop"))23 self.button_pause_rosbag_play = wx.ToggleButton(self.tab_simulation, wx.ID_ANY, _("Pause"))24 self.label_rosbag_play_bar = wx.StaticText(self.tab_simulation, wx.ID_ANY, _("Playing ... 82 %"))25 self.label_rosbag_play_pos = wx.StaticText(self.tab_simulation, wx.ID_ANY, "")26 self.static_line_3 = wx.StaticLine(self.tab_simulation, wx.ID_ANY)27 self.label_rosbag_play_total = wx.StaticText(self.tab_simulation, wx.ID_ANY, "")28 self.panel_5 = wx.ScrolledWindow(self.tab_simulation, wx.ID_ANY, style=wx.TAB_TRAVERSAL)29 self.label_rosbag_info = wx.StaticText(self.panel_5, wx.ID_ANY, "")30 self.button_rosbag_simulation = wx.ToggleButton(self.tab_simulation, wx.ID_ANY, _("ROSBAG"))31 self.button_rviz_simulation = wx.ToggleButton(self.tab_simulation, wx.ID_ANY, _("RViz"))32 self.button_rqt_simulation = wx.ToggleButton(self.tab_simulation, wx.ID_ANY, _("RQT"))33 self.bitmap_logo = wx.StaticBitmap(self, wx.ID_ANY, wx.NullBitmap)34 self.__set_properties()35 self.__do_layout()36 self.Bind(wx.EVT_TOGGLEBUTTON, self.OnRosbagPlay, self.button_play_rosbag_play)37 self.Bind(wx.EVT_TOGGLEBUTTON, self.OnRosbagPlay, self.button_stop_rosbag_play)38 self.Bind(wx.EVT_TOGGLEBUTTON, self.OnRosbagPlay, self.button_pause_rosbag_play)39 self.Bind(wx.EVT_TOGGLEBUTTON, self.OnRosbagRecord, self.button_rosbag_simulation)40 self.Bind(wx.EVT_TOGGLEBUTTON, self.OnLaunchKill, self.button_rviz_simulation)41 self.Bind(wx.EVT_TOGGLEBUTTON, self.OnLaunchKill, self.button_rqt_simulation)42 self.Bind(wx.EVT_TOGGLEBUTTON, self.OnLaunchKill, self.button_system_monitor)43 def __set_properties(self):44 # begin wxGlade: MyFrame.__set_properties45 self.SetTitle(_("Runtime Manager"))46 self.SetSize((806, 584))47 self.button_stop_rosbag_play.Enable(False)48 self.button_stop_rosbag_play.SetValue(1)49 self.button_pause_rosbag_play.Enable(False)50 self.label_rosbag_play_pos.SetMinSize((32, 17))51 self.label_rosbag_play_total.SetMinSize((32, 17))52 self.panel_5.SetScrollRate(10, 10)53 def __do_layout(self):54 pass55 # # begin wxGlade: MyFrame.__do_layout56 # self.sizer_1 = wx.BoxSizer(wx.VERTICAL)57 # sizer_29 = wx.BoxSizer(wx.HORIZONTAL)58 # self.sizer_cpuinfo = wx.BoxSizer(wx.HORIZONTAL)59 # sizer_85_copy = wx.BoxSizer(wx.VERTICAL)60 # sizer_51_copy_copy = wx.BoxSizer(wx.HORIZONTAL)61 # sizer_52_copy_1_copy = wx.BoxSizer(wx.HORIZONTAL)62 # sizer_60_copy_copy = wx.BoxSizer(wx.HORIZONTAL)63 # sizer_32 = wx.BoxSizer(wx.HORIZONTAL)64 # sizer_34 = wx.BoxSizer(wx.VERTICAL)65 # self.sizer_36_staticbox.Lower()66 # sizer_36 = wx.StaticBoxSizer(self.sizer_36_staticbox, wx.HORIZONTAL)67 # sizer_topics_info = wx.BoxSizer(wx.VERTICAL)68 # sizer_35 = wx.BoxSizer(wx.VERTICAL)69 # self.sizer_topics_list = wx.BoxSizer(wx.VERTICAL)70 # sizer_85 = wx.BoxSizer(wx.VERTICAL)71 # sizer_51_copy = wx.BoxSizer(wx.HORIZONTAL)72 # sizer_52_copy_1 = wx.BoxSizer(wx.HORIZONTAL)73 # sizer_60_copy = wx.BoxSizer(wx.HORIZONTAL)74 # sizer_20 = wx.BoxSizer(wx.HORIZONTAL)75 # self.sizer_stdout_staticbox.Lower()76 # sizer_stdout = wx.StaticBoxSizer(self.sizer_stdout_staticbox, wx.VERTICAL)77 # sizer_38 = wx.BoxSizer(wx.HORIZONTAL)78 # self.sizer_87_staticbox.Lower()79 # sizer_87 = wx.StaticBoxSizer(self.sizer_87_staticbox, wx.HORIZONTAL)80 # self.sizer_86_staticbox.Lower()81 # sizer_86 = wx.StaticBoxSizer(self.sizer_86_staticbox, wx.HORIZONTAL)82 # sizer_19 = wx.BoxSizer(wx.HORIZONTAL)83 # sizer_78 = wx.BoxSizer(wx.VERTICAL)84 # sizer_62_copy_copy_copy_copy_copy = wx.BoxSizer(wx.HORIZONTAL)85 # sizer_52_copy_copy_copy_copy_copy_copy = wx.BoxSizer(wx.HORIZONTAL)86 # sizer_37 = wx.BoxSizer(wx.HORIZONTAL)87 # sizer_80 = wx.BoxSizer(wx.HORIZONTAL)88 # sizer_82 = wx.BoxSizer(wx.HORIZONTAL)89 # sizer_83 = wx.BoxSizer(wx.VERTICAL)90 # sizer_81 = wx.BoxSizer(wx.HORIZONTAL)91 # self.sizer_79_staticbox.Lower()92 # sizer_79 = wx.StaticBoxSizer(self.sizer_79_staticbox, wx.VERTICAL)93 # sizer_10 = wx.BoxSizer(wx.VERTICAL)94 # sizer_62_copy_copy_copy_copy = wx.BoxSizer(wx.HORIZONTAL)95 # sizer_52_copy_copy_copy_copy_copy = wx.BoxSizer(wx.HORIZONTAL)96 # sizer_11 = wx.BoxSizer(wx.HORIZONTAL)97 # sizer_17 = wx.BoxSizer(wx.VERTICAL)98 # sizer_18 = wx.BoxSizer(wx.HORIZONTAL)99 # sizer_24 = wx.BoxSizer(wx.VERTICAL)100 # sizer_62_copy_copy_copy = wx.BoxSizer(wx.HORIZONTAL)101 # sizer_52_copy_copy_copy_copy = wx.BoxSizer(wx.HORIZONTAL)102 # self.sizer_26_staticbox.Lower()103 # sizer_26 = wx.StaticBoxSizer(self.sizer_26_staticbox, wx.VERTICAL)104 # sizer_77 = wx.BoxSizer(wx.HORIZONTAL)105 # sizer_66 = wx.BoxSizer(wx.VERTICAL)106 # sizer_72 = wx.BoxSizer(wx.HORIZONTAL)107 # sizer_75 = wx.BoxSizer(wx.HORIZONTAL)108 # sizer_76_copy = wx.BoxSizer(wx.VERTICAL)109 # sizer_54_copy = wx.BoxSizer(wx.HORIZONTAL)110 # sizer_76 = wx.BoxSizer(wx.VERTICAL)111 # sizer_54 = wx.BoxSizer(wx.HORIZONTAL)112 # sizer_9 = wx.BoxSizer(wx.HORIZONTAL)113 # self.sizer_12_staticbox.Lower()114 # sizer_12 = wx.StaticBoxSizer(self.sizer_12_staticbox, wx.VERTICAL)115 # self.sizer_25_staticbox.Lower()116 # sizer_25 = wx.StaticBoxSizer(self.sizer_25_staticbox, wx.HORIZONTAL)117 # sizer_71 = wx.BoxSizer(wx.VERTICAL)118 # sizer_62_copy_copy = wx.BoxSizer(wx.HORIZONTAL)119 # sizer_52_copy_copy_copy = wx.BoxSizer(wx.HORIZONTAL)120 # sizer_47 = wx.BoxSizer(wx.HORIZONTAL)121 # sizer_27 = wx.BoxSizer(wx.HORIZONTAL)122 # sizer_68 = wx.BoxSizer(wx.VERTICAL)123 # sizer_62_copy = wx.BoxSizer(wx.HORIZONTAL)124 # sizer_52_copy_copy = wx.BoxSizer(wx.HORIZONTAL)125 # sizer_5 = wx.BoxSizer(wx.HORIZONTAL)126 # sizer_7 = wx.BoxSizer(wx.VERTICAL)127 # self.sizer_70_staticbox.Lower()128 # sizer_70 = wx.StaticBoxSizer(self.sizer_70_staticbox, wx.VERTICAL)129 # self.sizer_69_staticbox.Lower()130 # sizer_69 = wx.StaticBoxSizer(self.sizer_69_staticbox, wx.VERTICAL)131 # sizer_33 = wx.BoxSizer(wx.VERTICAL)132 # sizer_4 = wx.BoxSizer(wx.VERTICAL)133 # sizer_62 = wx.BoxSizer(wx.HORIZONTAL)134 # sizer_52_copy = wx.BoxSizer(wx.HORIZONTAL)135 # self.sizer_39_staticbox.Lower()136 # sizer_39 = wx.StaticBoxSizer(self.sizer_39_staticbox, wx.VERTICAL)137 # sizer_53_copy_3_copy_2_copy = wx.BoxSizer(wx.HORIZONTAL)138 # sizer_53_copy_3_copy_2 = wx.BoxSizer(wx.HORIZONTAL)139 # self.sizer_61_staticbox.Lower()140 # sizer_61 = wx.StaticBoxSizer(self.sizer_61_staticbox, wx.VERTICAL)141 # sizer_53_copy_3_copy_1 = wx.BoxSizer(wx.HORIZONTAL)142 # sizer_53_copy_4 = wx.BoxSizer(wx.HORIZONTAL)143 # sizer_8 = wx.BoxSizer(wx.HORIZONTAL)144 # sizer_64 = wx.BoxSizer(wx.HORIZONTAL)145 # sizer_53_copy_3_copy = wx.BoxSizer(wx.HORIZONTAL)146 # sizer_63 = wx.BoxSizer(wx.HORIZONTAL)147 # sizer_53_copy_3 = wx.BoxSizer(wx.HORIZONTAL)148 # sizer_40 = wx.BoxSizer(wx.VERTICAL)149 # sizer_62_copy_copy_copy_1 = wx.BoxSizer(wx.HORIZONTAL)150 # sizer_52_copy_copy_copy_copy_1 = wx.BoxSizer(wx.HORIZONTAL)151 # sizer_46 = wx.BoxSizer(wx.VERTICAL)152 # self.sizer_43_copy_staticbox.Lower()153 # sizer_43_copy = wx.StaticBoxSizer(self.sizer_43_copy_staticbox, wx.HORIZONTAL)154 # self.sizer_43_staticbox.Lower()155 # sizer_43 = wx.StaticBoxSizer(self.sizer_43_staticbox, wx.HORIZONTAL)156 # self.sizer_42_staticbox.Lower()157 # sizer_42 = wx.StaticBoxSizer(self.sizer_42_staticbox, wx.HORIZONTAL)158 # sizer_16 = wx.BoxSizer(wx.VERTICAL)159 # sizer_51 = wx.BoxSizer(wx.HORIZONTAL)160 # sizer_52 = wx.BoxSizer(wx.HORIZONTAL)161 # sizer_60 = wx.BoxSizer(wx.HORIZONTAL)162 # self.sizer_45_staticbox.Lower()163 # sizer_45 = wx.StaticBoxSizer(self.sizer_45_staticbox, wx.VERTICAL)164 # sizer_59 = wx.BoxSizer(wx.HORIZONTAL)165 # sizer_53_copy = wx.BoxSizer(wx.HORIZONTAL)166 # sizer_53_copy_copy = wx.BoxSizer(wx.HORIZONTAL)167 # sizer_53_copy_2_copy = wx.BoxSizer(wx.HORIZONTAL)168 # sizer_53_copy_2 = wx.BoxSizer(wx.HORIZONTAL)169 # sizer_53_copy_1 = wx.BoxSizer(wx.HORIZONTAL)170 # sizer_53 = wx.BoxSizer(wx.HORIZONTAL)171 # sizer_53.Add(self.button_map_qs, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)172 # sizer_53.Add(self.panel_map_qs, 1, wx.ALIGN_CENTER_VERTICAL, 0)173 # sizer_53.Add(self.label_map_qs, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)174 # sizer_45.Add(sizer_53, 1, wx.EXPAND, 0)175 # sizer_53_copy_1.Add(self.button_sensing_qs, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)176 # sizer_53_copy_1.Add(self.panel_sensing_qs, 1, wx.ALIGN_CENTER_VERTICAL, 0)177 # sizer_53_copy_1.Add(self.label_sensing_qs, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)178 # sizer_45.Add(sizer_53_copy_1, 1, wx.EXPAND, 0)179 # sizer_53_copy_2.Add(self.button_localization_qs, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)180 # sizer_53_copy_2.Add(self.panel_localization_qs, 1, wx.ALIGN_CENTER_VERTICAL, 0)181 # sizer_53_copy_2.Add(self.label_localization_qs, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)182 # sizer_45.Add(sizer_53_copy_2, 1, wx.EXPAND, 0)183 # sizer_53_copy_2_copy.Add(self.button_detection_qs, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)184 # sizer_53_copy_2_copy.Add(self.panel_detection_qs, 1, wx.ALIGN_CENTER_VERTICAL, 0)185 # sizer_53_copy_2_copy.Add(self.label_detection_qs, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)186 # sizer_45.Add(sizer_53_copy_2_copy, 1, wx.EXPAND, 0)187 # sizer_53_copy_copy.Add(self.button_mission_planning_qs, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)188 # sizer_53_copy_copy.Add(self.panel_mission_planning_qs, 1, wx.ALIGN_CENTER_VERTICAL, 0)189 # sizer_53_copy_copy.Add(self.label_mission_planning_qs, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)190 # sizer_45.Add(sizer_53_copy_copy, 1, wx.EXPAND, 0)191 # sizer_53_copy.Add(self.button_motion_planning_qs, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)192 # sizer_53_copy.Add(self.panel_motion_planning_qs, 1, wx.ALIGN_CENTER_VERTICAL, 0)193 # sizer_53_copy.Add(self.label_motion_planning_qs, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)194 # sizer_45.Add(sizer_53_copy, 1, wx.EXPAND, 0)195 # sizer_59.Add(self.button_android_tablet_qs, 1, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)196 # sizer_59.Add(self.button_oculus_rift_qs, 1, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)197 # sizer_59.Add(self.button_vehicle_gateway_qs, 1, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)198 # sizer_59.Add(self.button_cloud_data_qs, 1, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)199 # sizer_45.Add(sizer_59, 1, wx.EXPAND, 0)200 # sizer_16.Add(sizer_45, 1, wx.ALL | wx.EXPAND, 4)201 # sizer_60.Add(self.button_auto_pilot_qs, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)202 # sizer_51.Add(sizer_60, 1, wx.EXPAND, 0)203 # sizer_52.Add(self.button_rosbag_qs, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)204 # sizer_52.Add(self.button_rviz_qs, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)205 # sizer_52.Add(self.button_rqt_qs, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)206 # sizer_51.Add(sizer_52, 0, wx.EXPAND, 0)207 # sizer_16.Add(sizer_51, 0, wx.EXPAND, 0)208 # self.tab_qs.SetSizer(sizer_16)209 # sizer_46.Add(self.radio_box_localizer, 0, wx.ALL, 4)210 # sizer_42.Add(self.button_setup_tf, 0, wx.ALL, 4)211 # sizer_42.Add(self.panel_setup_tf, 1, wx.ALL, 4)212 # sizer_46.Add(sizer_42, 0, wx.ALL | wx.EXPAND, 4)213 # sizer_43.Add(self.button_vehicle_model, 0, wx.ALL, 4)214 # sizer_43.Add(self.panel_vehicle_model, 1, wx.ALL, 4)215 # sizer_46.Add(sizer_43, 0, wx.ALL | wx.EXPAND, 4)216 # sizer_43_copy.Add(self.button_vehicle_info, 0, wx.ALL, 4)217 # sizer_43_copy.Add(self.panel_vehicle_info, 1, wx.ALL, 4)218 # sizer_46.Add(sizer_43_copy, 0, wx.ALL | wx.EXPAND, 10)219 # sizer_40.Add(sizer_46, 1, wx.EXPAND, 0)220 # sizer_62_copy_copy_copy_1.Add((20, 20), 1, 0, 0)221 # sizer_52_copy_copy_copy_copy_1.Add(self.button_rosbag_setup, 0, wx.ALL, 4)222 # sizer_52_copy_copy_copy_copy_1.Add(self.button_rviz_setup, 0, wx.ALL, 4)223 # sizer_52_copy_copy_copy_copy_1.Add(self.button_rqt_setup, 0, wx.ALL, 4)224 # sizer_62_copy_copy_copy_1.Add(sizer_52_copy_copy_copy_copy_1, 0, wx.EXPAND, 0)225 # sizer_40.Add(sizer_62_copy_copy_copy_1, 0, wx.EXPAND, 0)226 # self.tab_setup.SetSizer(sizer_40)227 # sizer_53_copy_3.Add(self.button_point_cloud, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)228 # sizer_53_copy_3.Add(self.panel_point_cloud, 1, wx.ALIGN_CENTER_VERTICAL, 0)229 # sizer_63.Add(sizer_53_copy_3, 1, wx.EXPAND, 0)230 # sizer_61.Add(sizer_63, 0, wx.TOP | wx.EXPAND, 4)231 # sizer_64.Add(self.checkbox_auto_update, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)232 # sizer_64.Add(self.choice_scene_num, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)233 # sizer_53_copy_3_copy.Add(self.button_area_lists, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)234 # sizer_53_copy_3_copy.Add(self.label_9, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)235 # sizer_53_copy_3_copy.Add(self.panel_area_lists, 1, wx.ALIGN_CENTER_VERTICAL, 0)236 # sizer_64.Add(sizer_53_copy_3_copy, 1, wx.BOTTOM | wx.EXPAND, 4)237 # sizer_61.Add(sizer_64, 0, wx.BOTTOM | wx.EXPAND, 4)238 # sizer_8.Add(self.label_point_cloud_bar, 1, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)239 # sizer_8.Add(self.label_point_cloud, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)240 # sizer_61.Add(sizer_8, 1, wx.ALL | wx.EXPAND, 4)241 # sizer_61.Add(self.static_line_4, 0, wx.TOP | wx.BOTTOM | wx.EXPAND, 4)242 # sizer_53_copy_4.Add(self.button_vector_map, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)243 # sizer_53_copy_4.Add(self.panel_vector_map, 1, wx.ALIGN_CENTER_VERTICAL, 0)244 # sizer_61.Add(sizer_53_copy_4, 0, wx.TOP | wx.BOTTOM | wx.EXPAND, 4)245 # sizer_61.Add(self.static_line_5, 0, wx.TOP | wx.BOTTOM | wx.EXPAND, 4)246 # sizer_53_copy_3_copy_1.Add(self.button_tf, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)247 # sizer_53_copy_3_copy_1.Add(self.panel_tf, 1, wx.ALIGN_CENTER_VERTICAL, 0)248 # sizer_61.Add(sizer_53_copy_3_copy_1, 0, wx.TOP | wx.BOTTOM | wx.EXPAND, 4)249 # sizer_4.Add(sizer_61, 0, wx.ALL | wx.EXPAND, 4)250 # sizer_53_copy_3_copy_2.Add(self.button_pcd_filter, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)251 # sizer_53_copy_3_copy_2.Add(self.panel_pcd_filter, 1, wx.ALIGN_CENTER_VERTICAL, 0)252 # sizer_39.Add(sizer_53_copy_3_copy_2, 0, wx.EXPAND, 0)253 # sizer_39.Add(self.static_line_5_copy, 0, wx.TOP | wx.BOTTOM | wx.EXPAND, 4)254 # sizer_53_copy_3_copy_2_copy.Add(self.button_pcd_binarizer, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)255 # sizer_53_copy_3_copy_2_copy.Add(self.panel_pcd_binarizer, 1, wx.ALIGN_CENTER_VERTICAL, 0)256 # sizer_39.Add(sizer_53_copy_3_copy_2_copy, 0, wx.EXPAND, 0)257 # sizer_4.Add(sizer_39, 0, wx.LEFT | wx.RIGHT | wx.EXPAND, 4)258 # sizer_62.Add((20, 20), 1, 0, 0)259 # sizer_52_copy.Add(self.button_rosbag_map, 0, wx.ALL, 4)260 # sizer_52_copy.Add(self.button_rviz_map, 0, wx.ALL, 4)261 # sizer_52_copy.Add(self.button_rqt_map, 0, wx.ALL, 4)262 # sizer_62.Add(sizer_52_copy, 0, wx.EXPAND, 0)263 # sizer_4.Add(sizer_62, 0, wx.EXPAND, 0)264 # self.tab_map.SetSizer(sizer_4)265 # sizer_33.Add(self.panel_sensing, 1, wx.EXPAND, 0)266 # sizer_5.Add(sizer_33, 1, wx.ALL | wx.EXPAND, 4)267 # sizer_7.Add(self.tree_ctrl_sense, 2, wx.EXPAND, 0)268 # sizer_69.Add(self.button_calibration_toolkit, 1, wx.ALL | wx.EXPAND | wx.ALIGN_CENTER_HORIZONTAL, 4)269 # sizer_69.Add(self.button_calibration_publisher, 1, wx.ALL | wx.EXPAND | wx.ALIGN_CENTER_HORIZONTAL, 4)270 # sizer_7.Add(sizer_69, 2, wx.TOP | wx.EXPAND, 8)271 # sizer_70.Add(self.button_points_image, 1, wx.ALL | wx.EXPAND | wx.ALIGN_CENTER_HORIZONTAL, 4)272 # sizer_70.Add(self.button_virtual_scan_image, 1, wx.ALL | wx.EXPAND | wx.ALIGN_CENTER_HORIZONTAL, 4)273 # sizer_70.Add(self.button_scan_image, 1, wx.ALL | wx.EXPAND | wx.ALIGN_CENTER_HORIZONTAL, 4)274 # sizer_7.Add(sizer_70, 3, wx.TOP | wx.BOTTOM | wx.EXPAND, 8)275 # sizer_5.Add(sizer_7, 1, wx.ALL | wx.EXPAND, 4)276 # sizer_68.Add(sizer_5, 1, wx.EXPAND, 0)277 # sizer_62_copy.Add((20, 20), 1, 0, 0)278 # sizer_52_copy_copy.Add(self.button_rosbag_sensing, 0, wx.ALL, 4)279 # sizer_52_copy_copy.Add(self.button_rviz_sensing, 0, wx.ALL, 4)280 # sizer_52_copy_copy.Add(self.button_rqt_sensing, 0, wx.ALL, 4)281 # sizer_62_copy.Add(sizer_52_copy_copy, 0, wx.EXPAND, 0)282 # sizer_68.Add(sizer_62_copy, 0, wx.EXPAND, 0)283 # self.tab_sensing.SetSizer(sizer_68)284 # sizer_27.Add(self.tree_ctrl_0, 1, wx.EXPAND, 0)285 # sizer_27.Add(self.tree_ctrl_1, 1, wx.EXPAND, 0)286 # sizer_71.Add(sizer_27, 1, wx.EXPAND, 0)287 # sizer_47.Add(self.button_synchronization, 0, wx.ALL, 4)288 # sizer_62_copy_copy.Add(sizer_47, 1, wx.EXPAND, 0)289 # sizer_52_copy_copy_copy.Add(self.button_rosbag_computing, 0, wx.ALL, 4)290 # sizer_52_copy_copy_copy.Add(self.button_rviz_computing, 0, wx.ALL, 4)291 # sizer_52_copy_copy_copy.Add(self.button_rqt_computing, 0, wx.ALL, 4)292 # sizer_62_copy_copy.Add(sizer_52_copy_copy_copy, 0, wx.EXPAND, 0)293 # sizer_71.Add(sizer_62_copy_copy, 0, wx.EXPAND, 0)294 # self.tab_computing.SetSizer(sizer_71)295 # sizer_25.Add(self.button_android_tablet_interface, 1, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)296 # sizer_25.Add(self.button_oculus_rift_interface, 1, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)297 # sizer_25.Add(self.button_vehicle_gateway_interface, 1, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)298 # sizer_9.Add(sizer_25, 3, wx.ALL | wx.EXPAND, 4)299 # sizer_12.Add(self.checkbox_sound, 1, wx.ALL | wx.ALIGN_CENTER_HORIZONTAL, 4)300 # sizer_9.Add(sizer_12, 1, wx.ALL | wx.EXPAND, 4)301 # sizer_24.Add(sizer_9, 1, wx.EXPAND, 0)302 # sizer_72.Add(self.button_auto_pilot_interface, 1, wx.ALL | wx.EXPAND, 4)303 # sizer_75.Add((20, 20), 1, 0, 0)304 # sizer_76.Add(self.label_5, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)305 # sizer_54.Add(self.button_statchk_lamp_l, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)306 # sizer_54.Add(self.button_statchk_lamp_r, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)307 # sizer_76.Add(sizer_54, 1, wx.EXPAND, 0)308 # sizer_75.Add(sizer_76, 1, 0, 0)309 # sizer_76_copy.Add(self.label_5_copy, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)310 # sizer_54_copy.Add(self.button_statchk_indi_l, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)311 # sizer_54_copy.Add(self.button_statchk_indi_r, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)312 # sizer_76_copy.Add(sizer_54_copy, 1, wx.EXPAND, 0)313 # sizer_75.Add(sizer_76_copy, 1, 0, 0)314 # sizer_75.Add((20, 20), 1, 0, 0)315 # sizer_72.Add(sizer_75, 1, 0, 0)316 # sizer_26.Add(sizer_72, 0, wx.EXPAND, 0)317 # sizer_66.Add(self.button_statchk_d, 0, wx.ALL | wx.EXPAND, 4)318 # sizer_66.Add(self.button_statchk_r, 0, wx.ALL | wx.EXPAND, 4)319 # sizer_66.Add(self.button_statchk_b, 0, wx.ALL | wx.EXPAND, 4)320 # sizer_66.Add(self.button_statchk_n, 0, wx.ALL | wx.EXPAND, 4)321 # sizer_77.Add(sizer_66, 0, wx.ALL | wx.EXPAND, 4)322 # sizer_77.Add(self.panel_interface_cc, 1, wx.ALL, 4)323 # sizer_26.Add(sizer_77, 0, wx.EXPAND, 0)324 # sizer_24.Add(sizer_26, 0, wx.ALL | wx.EXPAND, 4)325 # sizer_24.Add((20, 20), 1, 0, 0)326 # sizer_62_copy_copy_copy.Add((20, 20), 1, 0, 0)327 # sizer_52_copy_copy_copy_copy.Add(self.button_rosbag_interface, 0, wx.ALL, 4)328 # sizer_52_copy_copy_copy_copy.Add(self.button_rviz_interface, 0, wx.ALL, 4)329 # sizer_52_copy_copy_copy_copy.Add(self.button_rqt_interface, 0, wx.ALL, 4)330 # sizer_62_copy_copy_copy.Add(sizer_52_copy_copy_copy_copy, 0, wx.EXPAND, 0)331 # sizer_24.Add(sizer_62_copy_copy_copy, 0, wx.EXPAND, 0)332 # self.tab_interface.SetSizer(sizer_24)333 # sizer_11.Add(self.tree_ctrl_data, 1, wx.ALL | wx.EXPAND, 4)334 # sizer_18.Add(self.text_ctrl_query, 1, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)335 # sizer_18.Add(self.button_query, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)336 # sizer_17.Add(sizer_18, 0, wx.EXPAND, 0)337 # sizer_17.Add(self.list_ctrl_sql, 1, wx.ALL | wx.EXPAND, 4)338 # sizer_17.Add((85, 29), 0, wx.ALL | wx.ALIGN_CENTER_HORIZONTAL, 4)339 # sizer_11.Add(sizer_17, 1, wx.ALL | wx.EXPAND, 4)340 # sizer_10.Add(sizer_11, 1, wx.ALL | wx.EXPAND, 4)341 # sizer_62_copy_copy_copy_copy.Add((20, 20), 1, 0, 0)342 # sizer_52_copy_copy_copy_copy_copy.Add(self.button_rosbag_database, 0, wx.ALL, 4)343 # sizer_52_copy_copy_copy_copy_copy.Add(self.button_rviz_database, 0, wx.ALL, 4)344 # sizer_52_copy_copy_copy_copy_copy.Add(self.button_rqt_database, 0, wx.ALL, 4)345 # sizer_62_copy_copy_copy_copy.Add(sizer_52_copy_copy_copy_copy_copy, 0, wx.EXPAND, 0)346 # sizer_10.Add(sizer_62_copy_copy_copy_copy, 0, wx.EXPAND, 0)347 # self.tab_database.SetSizer(sizer_10)348 # sizer_79.Add(self.panel_rosbag_play, 1, wx.ALL | wx.EXPAND, 4)349 # sizer_78.Add(sizer_79, 0, wx.ALL | wx.EXPAND, 4)350 # sizer_81.Add(self.button_play_rosbag_play, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)351 # sizer_81.Add(self.button_stop_rosbag_play, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)352 # sizer_81.Add(self.button_pause_rosbag_play, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)353 # sizer_80.Add(sizer_81, 1, wx.EXPAND, 0)354 # sizer_82.Add(self.label_rosbag_play_bar, 1, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)355 # sizer_83.Add(self.label_rosbag_play_pos, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.ALIGN_CENTER_VERTICAL, 0)356 # sizer_83.Add(self.static_line_3, 0, wx.EXPAND, 0)357 # sizer_83.Add(self.label_rosbag_play_total, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.ALIGN_CENTER_VERTICAL, 0)358 # sizer_82.Add(sizer_83, 0, wx.ALL | wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, 4)359 # sizer_80.Add(sizer_82, 1, wx.EXPAND, 0)360 # sizer_78.Add(sizer_80, 0, wx.ALL | wx.EXPAND, 4)361 # sizer_37.Add(self.label_rosbag_info, 1, wx.ALL | wx.EXPAND, 4)362 # self.panel_5.SetSizer(sizer_37)363 # sizer_78.Add(self.panel_5, 1, wx.EXPAND, 0)364 # sizer_62_copy_copy_copy_copy_copy.Add((20, 20), 1, 0, 0)365 # sizer_52_copy_copy_copy_copy_copy_copy.Add(self.button_rosbag_simulation, 0, wx.ALL, 4)366 # sizer_52_copy_copy_copy_copy_copy_copy.Add(self.button_rviz_simulation, 0, wx.ALL, 4)367 # sizer_52_copy_copy_copy_copy_copy_copy.Add(self.button_rqt_simulation, 0, wx.ALL, 4)368 # sizer_62_copy_copy_copy_copy_copy.Add(sizer_52_copy_copy_copy_copy_copy_copy, 0, wx.EXPAND, 0)369 # sizer_78.Add(sizer_62_copy_copy_copy_copy_copy, 0, wx.EXPAND, 0)370 # self.tab_simulation.SetSizer(sizer_78)371 # sizer_19.Add(self.label_top_cmd, 1, wx.ALL | wx.EXPAND, 4)372 # sizer_85.Add(sizer_86, 1, wx.ALL | wx.EXPAND, 4)373 # sizer_87.Add(self.label_node_time, 1, wx.ALL, 4)374 # sizer_38.Add(self.checkbox_stdout, 0, wx.LEFT, 4)375 # sizer_38.Add(self.checkbox_stderr, 0, wx.LEFT, 4)376 # sizer_stdout.Add(sizer_38, 0, wx.EXPAND, 0)377 # sizer_stdout.Add(self.text_ctrl_stdout, 1, wx.ALL | wx.EXPAND, 4)378 # sizer_20.Add(sizer_stdout, 1, wx.EXPAND, 0)379 # sizer_85.Add(sizer_20, 1, wx.EXPAND, 0)380 # sizer_60_copy.Add(self.button_system_monitor, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)381 # sizer_60_copy.Add(self.button_ftrace, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)382 # sizer_51_copy.Add(sizer_60_copy, 1, wx.EXPAND, 0)383 # sizer_52_copy_1.Add(self.button_rosbag_status, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)384 # sizer_52_copy_1.Add(self.button_rviz_status, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)385 # sizer_52_copy_1.Add(self.button_rqt_status, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)386 # sizer_51_copy.Add(sizer_52_copy_1, 0, wx.EXPAND, 0)387 # sizer_85.Add(sizer_51_copy, 0, wx.EXPAND, 0)388 # self.tab_status.SetSizer(sizer_85)389 # self.panel_topics_list.SetSizer(self.sizer_topics_list)390 # sizer_32.Add(self.panel_topics_list, 1, wx.EXPAND, 0)391 # sizer_35.Add(self.checkbox_topics_echo, 0, wx.LEFT, 4)392 # sizer_35.Add(self.text_ctrl_topics_echo, 1, wx.ALL | wx.EXPAND, 4)393 # sizer_34.Add(sizer_35, 1, wx.EXPAND, 0)394 # sizer_topics_info.Add(self.label_topics_info, 0, 0, 0)395 # self.panel_topics_info.SetSizer(sizer_topics_info)396 # sizer_36.Add(self.panel_topics_info, 1, wx.EXPAND, 0)397 # sizer_34.Add(sizer_36, 1, wx.EXPAND, 0)398 # sizer_32.Add(sizer_34, 1, wx.EXPAND, 0)399 # sizer_85_copy.Add(sizer_32, 1, wx.EXPAND, 0)400 # sizer_60_copy_copy.Add(self.button_refresh_topics, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)401 # sizer_51_copy_copy.Add(sizer_60_copy_copy, 1, wx.EXPAND, 0)402 # sizer_52_copy_1_copy.Add(self.button_rosbag_topics, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)403 # sizer_52_copy_1_copy.Add(self.button_rviz_topics, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)404 # sizer_52_copy_1_copy.Add(self.button_rqt_topics, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)405 # sizer_51_copy_copy.Add(sizer_52_copy_1_copy, 0, wx.EXPAND, 0)406 # sizer_85_copy.Add(sizer_51_copy_copy, 0, wx.EXPAND, 0)407 # self.tab_topics.SetSizer(sizer_85_copy)408 # self.notebook_1.AddPage(self.tab_qs, _("Quick Start"))409 # self.notebook_1.AddPage(self.tab_setup, _("Setup"))410 # self.notebook_1.AddPage(self.tab_map, _("Map"))411 # self.notebook_1.AddPage(self.tab_sensing, _("Sensing"))412 # self.notebook_1.AddPage(self.tab_computing, _("Computing"))413 # self.notebook_1.AddPage(self.tab_interface, _("Interface"))414 # self.notebook_1.AddPage(self.tab_database, _("Database"))415 # self.notebook_1.AddPage(self.tab_simulation, _("Simulation"))416 # self.notebook_1.AddPage(self.tab_status, _("Status"))417 # self.notebook_1.AddPage(self.tab_topics, _("Topics"))418 # self.sizer_1.Add(self.notebook_1, 1, wx.EXPAND, 0)419 # sizer_29.Add((0, 100), 0, wx.EXPAND, 0)420 # sizer_29.Add(self.sizer_cpuinfo, 1, wx.EXPAND, 0)421 # self.sizer_1.Add(sizer_29, 0, wx.EXPAND, 0)422 # self.sizer_1.Add(self.bitmap_logo, 0, 0, 0)423 # self.SetSizer(self.sizer_1)424 # self.Layout()425 # # end wxGlade426 def OnLaunchKill(self, event): # wxGlade: MyFrame.<event_handler>427 print "Event handler 'OnLaunchKill' not implemented!"428 event.Skip()429 def OnAutoPilot(self, event): # wxGlade: MyFrame.<event_handler>430 print "Event handler 'OnAutoPilot' not implemented!"431 event.Skip()432 def OnRosbagRecord(self, event): # wxGlade: MyFrame.<event_handler>433 print "Event handler 'OnRosbagRecord' not implemented!"434 event.Skip()435 def OnSetupLocalizer(self, event): # wxGlade: MyFrame.<event_handler>436 print "Event handler 'OnSetupLocalizer' not implemented!"437 event.Skip()438 def OnCalibrationPublisher(self, event): # wxGlade: MyFrame.<event_handler>439 print "Event handler 'OnCalibrationPublisher' not implemented!"440 event.Skip()441 def OnLamp(self, event): # wxGlade: MyFrame.<event_handler>442 print "Event handler 'OnLamp' not implemented!"443 event.Skip()444 def OnIndi(self, event): # wxGlade: MyFrame.<event_handler>445 print "Event handler 'OnIndi' not implemented!"446 event.Skip()447 def OnGear(self, event): # wxGlade: MyFrame.<event_handler>448 print "Event handler 'OnGear' not implemented!"449 event.Skip()450 def OnQuery(self, event): # wxGlade: MyFrame.<event_handler>451 print "Event handler 'OnQuery' not implemented!"452 event.Skip()453 def OnRosbagPlay(self, event): # wxGlade: MyFrame.<event_handler>454 print "Event handler 'OnRosbagPlay' not implemented!"455 event.Skip()456 def OnFtrace(self, event): # wxGlade: MyFrame.<event_handler>457 print "Event handler 'OnFtrace' not implemented!"458 event.Skip()459 def OnEcho(self, event): # wxGlade: MyFrame.<event_handler>460 print "Event handler 'OnEcho' not implemented!"461 event.Skip()462 def OnRefreshTopics(self, event): # wxGlade: MyFrame.<event_handler>463 print "Event handler 'OnRefreshTopics' not implemented!"464 event.Skip()465# end of class MyFrame466class MyDialog(wx.Dialog):467 def __init__(self, *args, **kwds):468 # begin wxGlade: MyDialog.__init__469 kwds["style"] = wx.DEFAULT_DIALOG_STYLE470 wx.Dialog.__init__(self, *args, **kwds)471 self.panel_2 = wx.ScrolledWindow(self, wx.ID_ANY, style=wx.TAB_TRAVERSAL)472 self.radio_box = wx.RadioBox(self.panel_2, wx.ID_ANY, "", choices=[_("0"), _("1"), _("2"), _("3")], majorDimension=0, style=wx.RA_SPECIFY_ROWS)473 self.button_1 = wx.Button(self, wx.ID_ANY, _("OK"))474 self.button_1_copy = wx.Button(self, wx.ID_ANY, _("Cancel"))475 self.__set_properties()476 self.__do_layout()477 self.Bind(wx.EVT_BUTTON, self.OnOk, self.button_1)478 self.Bind(wx.EVT_BUTTON, self.OnCancel, self.button_1_copy)479 # end wxGlade480 def __set_properties(self):481 # begin wxGlade: MyDialog.__set_properties482 self.SetSize((258, 212))483 self.radio_box.SetSelection(0)484 self.panel_2.SetScrollRate(10, 10)485 # end wxGlade486 def __do_layout(self):487 # begin wxGlade: MyDialog.__do_layout488 sizer_13 = wx.BoxSizer(wx.VERTICAL)489 sizer_15 = wx.BoxSizer(wx.HORIZONTAL)490 sizer_14 = wx.BoxSizer(wx.HORIZONTAL)491 sizer_14.Add(self.radio_box, 1, wx.LEFT | wx.RIGHT | wx.TOP | wx.ALIGN_CENTER_HORIZONTAL, 4)492 self.panel_2.SetSizer(sizer_14)493 sizer_13.Add(self.panel_2, 1, wx.EXPAND, 0)494 sizer_15.Add(self.button_1, 0, wx.ALL, 4)495 sizer_15.Add(self.button_1_copy, 0, wx.ALL, 4)496 sizer_13.Add(sizer_15, 0, wx.ALIGN_CENTER_HORIZONTAL, 0)497 self.SetSizer(sizer_13)498 self.Layout()499 # end wxGlade500 def OnOk(self, event): # wxGlade: MyDialog.<event_handler>501 print "Event handler 'OnOk' not implemented!"502 event.Skip()503 def OnCancel(self, event): # wxGlade: MyDialog.<event_handler>504 print "Event handler 'OnCancel' not implemented!"505 event.Skip()506# end of class MyDialog507class MyDialogParam(wx.Dialog):508 def __init__(self, *args, **kwds):509 # begin wxGlade: MyDialogParam.__init__510 kwds["style"] = wx.DEFAULT_DIALOG_STYLE511 wx.Dialog.__init__(self, *args, **kwds)512 self.panel_v = wx.ScrolledWindow(self, wx.ID_ANY, style=wx.TAB_TRAVERSAL)513 self.button_1 = wx.Button(self, wx.ID_ANY, _("OK"))514 self.button_1_copy = wx.Button(self, wx.ID_ANY, _("Cancel"))515 self.__set_properties()516 self.__do_layout()517 self.Bind(wx.EVT_BUTTON, self.OnOk, self.button_1)518 self.Bind(wx.EVT_BUTTON, self.OnCancel, self.button_1_copy)519 # end wxGlade520 def __set_properties(self):521 # begin wxGlade: MyDialogParam.__set_properties522 self.SetTitle(_("dialog_3"))523 self.SetSize((470, 300))524 self.panel_v.SetScrollRate(10, 10)525 # end wxGlade526 def __do_layout(self):527 # begin wxGlade: MyDialogParam.__do_layout528 sizer_30 = wx.BoxSizer(wx.VERTICAL)529 sizer_31 = wx.BoxSizer(wx.HORIZONTAL)530 self.sizer_v = wx.BoxSizer(wx.VERTICAL)531 self.panel_v.SetSizer(self.sizer_v)532 sizer_30.Add(self.panel_v, 1, wx.EXPAND, 0)533 sizer_31.Add(self.button_1, 0, wx.ALL, 4)534 sizer_31.Add(self.button_1_copy, 0, wx.ALL, 4)535 sizer_30.Add(sizer_31, 0, wx.ALIGN_CENTER_HORIZONTAL, 0)536 self.SetSizer(sizer_30)537 self.Layout()538 # end wxGlade539 def OnOk(self, event): # wxGlade: MyDialogParam.<event_handler>540 print "Event handler 'OnOk' not implemented!"541 event.Skip()542 def OnCancel(self, event): # wxGlade: MyDialogParam.<event_handler>543 print "Event handler 'OnCancel' not implemented!"544 event.Skip()545# end of class MyDialogParam546class MyDialogRosbagRecord(wx.Dialog):547 def __init__(self, *args, **kwds):548 # begin wxGlade: MyDialogRosbagRecord.__init__549 kwds["style"] = wx.DEFAULT_DIALOG_STYLE550 wx.Dialog.__init__(self, *args, **kwds)551 self.text_ctrl = wx.TextCtrl(self, wx.ID_ANY, "")552 self.button_ref = wx.Button(self, wx.ID_ANY, _("Ref"))553 self.checkbox_split = wx.CheckBox(self, wx.ID_ANY, _("split"))554 self.label_2 = wx.StaticText(self, wx.ID_ANY, _("size"))555 self.text_ctrl_size = wx.TextCtrl(self, wx.ID_ANY, "")556 self.label_2_copy = wx.StaticText(self, wx.ID_ANY, _("MB"))557 self.button_start = wx.Button(self, wx.ID_ANY, _("Start"))558 self.button_stop = wx.Button(self, wx.ID_ANY, _("Stop"))559 self.panel_1 = wx.ScrolledWindow(self, wx.ID_ANY, style=wx.TAB_TRAVERSAL)560 self.button_refresh = wx.Button(self, wx.ID_ANY, _("Refresh"))561 self.__set_properties()562 self.__do_layout()563 self.Bind(wx.EVT_BUTTON, self.OnRef, self.button_ref)564 self.Bind(wx.EVT_BUTTON, self.OnStart, self.button_start)565 self.Bind(wx.EVT_BUTTON, self.OnStop, self.button_stop)566 self.Bind(wx.EVT_BUTTON, self.OnRefresh, self.button_refresh)567 # end wxGlade568 def __set_properties(self):569 # begin wxGlade: MyDialogRosbagRecord.__set_properties570 self.SetTitle(_("ROSBAG Record"))571 self.SetSize((300, 430))572 self.button_ref.SetMinSize((40, 29))573 self.text_ctrl_size.SetMinSize((50, 27))574 self.button_stop.Enable(False)575 self.panel_1.SetScrollRate(10, 10)576 # end wxGlade577 def __do_layout(self):578 # begin wxGlade: MyDialogRosbagRecord.__do_layout579 sizer_41 = wx.BoxSizer(wx.VERTICAL)580 self.sizer_topic = wx.BoxSizer(wx.VERTICAL)581 sizer_44 = wx.BoxSizer(wx.HORIZONTAL)582 sizer_22 = wx.BoxSizer(wx.HORIZONTAL)583 sizer_23 = wx.BoxSizer(wx.HORIZONTAL)584 sizer_28_copy_1 = wx.BoxSizer(wx.HORIZONTAL)585 sizer_28_copy_1.Add(self.text_ctrl, 1, wx.LEFT | wx.TOP, 4)586 sizer_28_copy_1.Add(self.button_ref, 0, wx.LEFT | wx.RIGHT | wx.TOP, 4)587 sizer_41.Add(sizer_28_copy_1, 0, wx.EXPAND, 0)588 sizer_22.Add(self.checkbox_split, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)589 sizer_23.Add(self.label_2, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)590 sizer_23.Add(self.text_ctrl_size, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)591 sizer_23.Add(self.label_2_copy, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)592 sizer_22.Add(sizer_23, 1, wx.LEFT | wx.EXPAND, 20)593 sizer_41.Add(sizer_22, 0, wx.EXPAND, 0)594 sizer_44.Add(self.button_start, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)595 sizer_44.Add(self.button_stop, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)596 sizer_41.Add(sizer_44, 0, wx.EXPAND, 0)597 self.panel_1.SetSizer(self.sizer_topic)598 sizer_41.Add(self.panel_1, 1, wx.EXPAND, 0)599 sizer_41.Add(self.button_refresh, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)600 self.SetSizer(sizer_41)601 self.Layout()602 # end wxGlade603 def OnRef(self, event): # wxGlade: MyDialogRosbagRecord.<event_handler>604 print "Event handler 'OnRef' not implemented!"605 event.Skip()606 def OnStart(self, event): # wxGlade: MyDialogRosbagRecord.<event_handler>607 print "Event handler 'OnStart' not implemented!"608 event.Skip()609 def OnStop(self, event): # wxGlade: MyDialogRosbagRecord.<event_handler>610 print "Event handler 'OnStop' not implemented!"611 event.Skip()612 def OnRefresh(self, event): # wxGlade: MyDialogRosbagRecord.<event_handler>613 print "Event handler 'OnRefresh' not implemented!"614 event.Skip()615# end of class MyDialogRosbagRecord616class MyDialogLaneStop(wx.Dialog):617 def __init__(self, *args, **kwds):618 # begin wxGlade: MyDialogLaneStop.__init__619 kwds["style"] = wx.DEFAULT_DIALOG_STYLE620 wx.Dialog.__init__(self, *args, **kwds)621 self.button_red_light = wx.Button(self, wx.ID_ANY, _("Red Light"))622 self.button_green_light = wx.Button(self, wx.ID_ANY, _("Green Light"))623 self.sizer_3_staticbox = wx.StaticBox(self, wx.ID_ANY, _("Traffic Light"))624 self.button_left_lane = wx.Button(self, wx.ID_ANY, _("<< Left Lane"))625 self.button_right_lane = wx.Button(self, wx.ID_ANY, _("Right Lane >>"))626 self.sizer_3_copy_staticbox = wx.StaticBox(self, wx.ID_ANY, _("Lane Change"))627 self.button_keep_at = wx.Button(self, wx.ID_ANY, _("Keep at"))628 self.text_keep_at = wx.TextCtrl(self, wx.ID_ANY, _("60"))629 self.label_1 = wx.StaticText(self, wx.ID_ANY, _("km/h"))630 self.button_stop_in = wx.Button(self, wx.ID_ANY, _("Stop in"))631 self.text_ctrl_stop_in = wx.TextCtrl(self, wx.ID_ANY, _("5.0"))632 self.label_1_copy = wx.StaticText(self, wx.ID_ANY, _("m"))633 self.sizer_6_staticbox = wx.StaticBox(self, wx.ID_ANY, _("Currnet Lane"))634 self.checkbox_lane_stop = wx.CheckBox(self, wx.ID_ANY, _("Use traffic light recognition result"))635 self.sizer_47_staticbox = wx.StaticBox(self, wx.ID_ANY, _("topic:/config/lane_stop"))636 self.button_1 = wx.Button(self, wx.ID_ANY, _("OK"))637 self.button_1_copy = wx.Button(self, wx.ID_ANY, _("Cancel"))638 self.__set_properties()639 self.__do_layout()640 self.Bind(wx.EVT_BUTTON, self.OnTrafficRedLight, self.button_red_light)641 self.Bind(wx.EVT_BUTTON, self.OnTrafficGreenLight, self.button_green_light)642 self.Bind(wx.EVT_CHECKBOX, self.OnTrafficLightRecognition, self.checkbox_lane_stop)643 self.Bind(wx.EVT_BUTTON, self.OnOk, self.button_1)644 self.Bind(wx.EVT_BUTTON, self.OnCancel, self.button_1_copy)645 # end wxGlade646 def __set_properties(self):647 # begin wxGlade: MyDialogLaneStop.__set_properties648 self.SetTitle(_("lane_stop"))649 self.button_red_light.SetBackgroundColour(wx.Colour(255, 0, 0))650 self.button_green_light.SetBackgroundColour(wx.Colour(0, 255, 0))651 self.text_keep_at.SetMinSize((40, 27))652 self.text_ctrl_stop_in.SetMinSize((40, 27))653 # end wxGlade654 def __do_layout(self):655 # begin wxGlade: MyDialogLaneStop.__do_layout656 sizer_30 = wx.BoxSizer(wx.VERTICAL)657 sizer_31 = wx.BoxSizer(wx.HORIZONTAL)658 self.sizer_47_staticbox.Lower()659 sizer_47 = wx.StaticBoxSizer(self.sizer_47_staticbox, wx.VERTICAL)660 self.sizer_v = wx.BoxSizer(wx.VERTICAL)661 sizer_2 = wx.BoxSizer(wx.HORIZONTAL)662 self.sizer_6_staticbox.Lower()663 sizer_6 = wx.StaticBoxSizer(self.sizer_6_staticbox, wx.VERTICAL)664 sizer_21_copy = wx.BoxSizer(wx.HORIZONTAL)665 sizer_21 = wx.BoxSizer(wx.HORIZONTAL)666 self.sizer_3_copy_staticbox.Lower()667 sizer_3_copy = wx.StaticBoxSizer(self.sizer_3_copy_staticbox, wx.VERTICAL)668 self.sizer_3_staticbox.Lower()669 sizer_3 = wx.StaticBoxSizer(self.sizer_3_staticbox, wx.VERTICAL)670 sizer_3.Add(self.button_red_light, 0, wx.ALL | wx.ALIGN_CENTER_HORIZONTAL | wx.ALIGN_CENTER_VERTICAL, 4)671 sizer_3.Add(self.button_green_light, 0, wx.ALL | wx.ALIGN_CENTER_HORIZONTAL | wx.ALIGN_CENTER_VERTICAL, 4)672 sizer_2.Add(sizer_3, 1, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)673 sizer_3_copy.Add(self.button_left_lane, 0, wx.ALL | wx.ALIGN_CENTER_HORIZONTAL | wx.ALIGN_CENTER_VERTICAL, 4)674 sizer_3_copy.Add(self.button_right_lane, 0, wx.ALL | wx.ALIGN_CENTER_HORIZONTAL | wx.ALIGN_CENTER_VERTICAL, 4)675 sizer_2.Add(sizer_3_copy, 1, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)676 sizer_21.Add(self.button_keep_at, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)677 sizer_21.Add(self.text_keep_at, 0, wx.ALIGN_CENTER_VERTICAL, 0)678 sizer_21.Add(self.label_1, 0, wx.ALIGN_CENTER_VERTICAL, 0)679 sizer_6.Add(sizer_21, 0, wx.EXPAND, 0)680 sizer_21_copy.Add(self.button_stop_in, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)681 sizer_21_copy.Add(self.text_ctrl_stop_in, 0, wx.ALIGN_CENTER_VERTICAL, 0)682 sizer_21_copy.Add(self.label_1_copy, 0, wx.ALIGN_CENTER_VERTICAL, 0)683 sizer_6.Add(sizer_21_copy, 0, wx.EXPAND, 0)684 sizer_2.Add(sizer_6, 1, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)685 self.sizer_v.Add(sizer_2, 1, wx.EXPAND, 0)686 sizer_30.Add(self.sizer_v, 1, wx.EXPAND, 0)687 sizer_47.Add(self.checkbox_lane_stop, 0, 0, 0)688 sizer_30.Add(sizer_47, 0, wx.ALL | wx.EXPAND, 4)689 sizer_31.Add(self.button_1, 0, wx.ALL, 4)690 sizer_31.Add(self.button_1_copy, 0, wx.ALL, 4)691 sizer_30.Add(sizer_31, 0, wx.ALIGN_CENTER_HORIZONTAL, 0)692 self.SetSizer(sizer_30)693 sizer_30.Fit(self)694 self.Layout()695 # end wxGlade696 def OnTrafficRedLight(self, event): # wxGlade: MyDialogLaneStop.<event_handler>697 print "Event handler 'OnTrafficRedLight' not implemented!"698 event.Skip()699 def OnTrafficGreenLight(self, event): # wxGlade: MyDialogLaneStop.<event_handler>700 print "Event handler 'OnTrafficGreenLight' not implemented!"701 event.Skip()702 def OnTrafficLightRecognition(self, event): # wxGlade: MyDialogLaneStop.<event_handler>703 print "Event handler 'OnTrafficLightRecognition' not implemented!"704 event.Skip()705 def OnOk(self, event): # wxGlade: MyDialogLaneStop.<event_handler>706 print "Event handler 'OnOk' not implemented!"707 event.Skip()708 def OnCancel(self, event): # wxGlade: MyDialogLaneStop.<event_handler>709 print "Event handler 'OnCancel' not implemented!"710 event.Skip()711# end of class MyDialogLaneStop712class MyDialogNdtMapping(wx.Dialog):713 def __init__(self, *args, **kwds):714 # begin wxGlade: MyDialogNdtMapping.__init__715 kwds["style"] = wx.CAPTION716 wx.Dialog.__init__(self, *args, **kwds)717 self.panel_v = wx.ScrolledWindow(self, wx.ID_ANY, style=wx.TAB_TRAVERSAL)718 self.static_line_1 = wx.StaticLine(self, wx.ID_ANY)719 self.text_ctrl_path = wx.TextCtrl(self, wx.ID_ANY, "")720 self.button_ref_path = wx.Button(self, wx.ID_ANY, _("Ref"))721 self.radio_btn_filter_resolution = wx.RadioButton(self, wx.ID_ANY, _("Filter Resolution"))722 self.text_ctrl_filter_resolution = wx.TextCtrl(self, wx.ID_ANY, _("0.2"))723 self.radio_btn_original = wx.RadioButton(self, wx.ID_ANY, _("Original"))724 self.button_3 = wx.Button(self, wx.ID_ANY, _("PCD OUTPUT"))725 self.static_line_2 = wx.StaticLine(self, wx.ID_ANY)726 self.button_1 = wx.Button(self, wx.ID_ANY, _("Close"))727 self.__set_properties()728 self.__do_layout()729 self.Bind(wx.EVT_BUTTON, self.OnRef, self.button_ref_path)730 self.Bind(wx.EVT_RADIOBUTTON, self.OnRadio, self.radio_btn_filter_resolution)731 self.Bind(wx.EVT_RADIOBUTTON, self.OnRadio, self.radio_btn_original)732 self.Bind(wx.EVT_BUTTON, self.OnPcdOutput, self.button_3)733 self.Bind(wx.EVT_BUTTON, self.OnOk, self.button_1)734 # end wxGlade735 def __set_properties(self):736 # begin wxGlade: MyDialogNdtMapping.__set_properties737 self.SetTitle(_("ndt_mapping"))738 self.SetSize((352, 341))739 self.panel_v.SetScrollRate(10, 10)740 self.button_ref_path.SetMinSize((40, 29))741 # end wxGlade742 def __do_layout(self):743 # begin wxGlade: MyDialogNdtMapping.__do_layout744 sizer_30 = wx.BoxSizer(wx.VERTICAL)745 sizer_48 = wx.BoxSizer(wx.VERTICAL)746 sizer_49 = wx.BoxSizer(wx.HORIZONTAL)747 sizer_28_copy_1 = wx.BoxSizer(wx.HORIZONTAL)748 sizer_30.Add(self.panel_v, 1, wx.EXPAND, 0)749 sizer_30.Add(self.static_line_1, 0, wx.EXPAND, 0)750 sizer_28_copy_1.Add(self.text_ctrl_path, 1, wx.LEFT | wx.TOP, 4)751 sizer_28_copy_1.Add(self.button_ref_path, 0, wx.LEFT | wx.RIGHT | wx.TOP, 4)752 sizer_48.Add(sizer_28_copy_1, 0, wx.ALL | wx.EXPAND, 4)753 sizer_49.Add(self.radio_btn_filter_resolution, 0, wx.ALL, 4)754 sizer_49.Add(self.text_ctrl_filter_resolution, 0, wx.ALL, 4)755 sizer_49.Add(self.radio_btn_original, 0, wx.ALL, 4)756 sizer_48.Add(sizer_49, 0, wx.ALL | wx.EXPAND, 4)757 sizer_48.Add(self.button_3, 0, wx.ALL | wx.ALIGN_CENTER_HORIZONTAL, 4)758 sizer_30.Add(sizer_48, 0, wx.EXPAND, 0)759 sizer_30.Add(self.static_line_2, 0, wx.EXPAND, 0)760 sizer_30.Add(self.button_1, 0, wx.ALL | wx.ALIGN_CENTER_HORIZONTAL, 4)761 self.SetSizer(sizer_30)762 self.Layout()763 # end wxGlade764 def OnRef(self, event): # wxGlade: MyDialogNdtMapping.<event_handler>765 print "Event handler 'OnRef' not implemented!"766 event.Skip()767 def OnRadio(self, event): # wxGlade: MyDialogNdtMapping.<event_handler>768 print "Event handler 'OnRadio' not implemented!"769 event.Skip()770 def OnPcdOutput(self, event): # wxGlade: MyDialogNdtMapping.<event_handler>771 print "Event handler 'OnPcdOutput' not implemented!"772 event.Skip()773 def OnOk(self, event): # wxGlade: MyDialogNdtMapping.<event_handler>774 print "Event handler 'OnOk' not implemented!"775 event.Skip()776# end of class MyDialogNdtMapping777class MyDialogDpm(wx.Dialog):778 def __init__(self, *args, **kwds):779 # begin wxGlade: MyDialogDpm.__init__780 kwds["style"] = wx.DEFAULT_DIALOG_STYLE781 wx.Dialog.__init__(self, *args, **kwds)782 self.panel_v = wx.ScrolledWindow(self, wx.ID_ANY, style=wx.TAB_TRAVERSAL)783 self.button_1 = wx.Button(self, wx.ID_ANY, _("Detection Start"))784 self.hyperlink_car = wx.HyperlinkCtrl(self, wx.ID_ANY, _("car_param_tuning"), "")785 self.hyperlink_pedestrian = wx.HyperlinkCtrl(self, wx.ID_ANY, _("pedestrian_param_tuning"), "")786 self.__set_properties()787 self.__do_layout()788 self.Bind(wx.EVT_BUTTON, self.OnOk, self.button_1)789 self.Bind(wx.EVT_HYPERLINK, self.OnLink, self.hyperlink_car)790 self.Bind(wx.EVT_HYPERLINK, self.OnLink, self.hyperlink_pedestrian)791 # end wxGlade792 def __set_properties(self):793 # begin wxGlade: MyDialogDpm.__set_properties794 self.SetTitle(_("dialog_6"))795 self.SetSize((470, 350))796 self.panel_v.SetScrollRate(10, 10)797 # end wxGlade798 def __do_layout(self):799 # begin wxGlade: MyDialogDpm.__do_layout800 sizer_30 = wx.BoxSizer(wx.VERTICAL)801 sizer_31 = wx.BoxSizer(wx.HORIZONTAL)802 sizer_28 = wx.BoxSizer(wx.VERTICAL)803 self.sizer_v = wx.BoxSizer(wx.VERTICAL)804 self.panel_v.SetSizer(self.sizer_v)805 sizer_30.Add(self.panel_v, 1, wx.EXPAND, 0)806 sizer_31.Add(self.button_1, 1, wx.ALL | wx.EXPAND, 4)807 sizer_28.Add(self.hyperlink_car, 0, wx.ALL, 4)808 sizer_28.Add(self.hyperlink_pedestrian, 0, wx.ALL, 4)809 sizer_31.Add(sizer_28, 1, wx.EXPAND, 0)810 sizer_30.Add(sizer_31, 0, wx.EXPAND, 0)811 self.SetSizer(sizer_30)812 self.Layout()813 # end wxGlade814 def OnOk(self, event): # wxGlade: MyDialogDpm.<event_handler>815 print "Event handler 'OnOk' not implemented!"816 event.Skip()817 def OnLink(self, event): # wxGlade: MyDialogDpm.<event_handler>818 print "Event handler 'OnLink' not implemented!"819 event.Skip()820# end of class MyDialogDpm821class MyDialogCarPedestrian(wx.Dialog):822 def __init__(self, *args, **kwds):823 # begin wxGlade: MyDialogCarPedestrian.__init__824 kwds["style"] = wx.DEFAULT_DIALOG_STYLE825 wx.Dialog.__init__(self, *args, **kwds)826 self.hyperlink_car = wx.HyperlinkCtrl(self, wx.ID_ANY, _("parameter tuning for car"), "")827 self.hyperlink_pedestrian = wx.HyperlinkCtrl(self, wx.ID_ANY, _("parameter tuning for pedestrian"), "")828 self.__set_properties()829 self.__do_layout()830 self.Bind(wx.EVT_HYPERLINK, self.OnLink, self.hyperlink_car)831 self.Bind(wx.EVT_HYPERLINK, self.OnLink, self.hyperlink_pedestrian)832 # end wxGlade833 def __set_properties(self):834 # begin wxGlade: MyDialogCarPedestrian.__set_properties835 self.SetTitle(_("dialog_7"))836 # end wxGlade837 def __do_layout(self):838 # begin wxGlade: MyDialogCarPedestrian.__do_layout839 sizer_28 = wx.BoxSizer(wx.VERTICAL)840 sizer_28.Add(self.hyperlink_car, 0, wx.ALL, 4)841 sizer_28.Add(self.hyperlink_pedestrian, 0, wx.ALL, 4)842 self.SetSizer(sizer_28)843 sizer_28.Fit(self)844 self.Layout()845 # end wxGlade846 def OnLink(self, event): # wxGlade: MyDialogCarPedestrian.<event_handler>847 print "Event handler 'OnLink' not implemented!"848 event.Skip()849# end of class MyDialogCarPedestrian850class MyApp(wx.App):851 def OnInit(self):852 wx.InitAllImageHandlers()853 frame_1 = MyFrame(None, wx.ID_ANY, "")854 self.SetTopWindow(frame_1)855 frame_1.Show()856 return 1857# end of class MyApp858if __name__ == "__main__":859 gettext.install("app") # replace with the appropriate catalog name860 app = MyApp(0)...

Full Screen

Full Screen

synthetic_data.py

Source:synthetic_data.py Github

copy

Full Screen

1#################################################################################2# #3# (C) 2010 Michael Bieri #4# #5# This file is part of NESSY. #6# #7# NESSY is free software: you can redistribute it and/or modify #8# it under the terms of the GNU General Public License as published by #9# the Free Software Foundation, either version 3 of the License, or #10# (at your option) any later version. #11# #12# NESSY is distributed in the hope that it will be useful, #13# but WITHOUT ANY WARRANTY; without even the implied warranty of #14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #15# GNU General Public License for more details. #16# #17# You should have received a copy of the GNU General Public License #18# along with NESSY; if not, write to the Free Software #19# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #20# #21#################################################################################22# Python modules23from math import exp24from os import sep25from random import uniform26import wx27# NESSY modules28from conf.path import NESSY_PIC, SYNTHETIC_PIC29from conf.filedialog import opendir30from conf.message import error_popup, message31from math_fns.models import model_1, model_2, model_3, model_4, model_532class Initial_guess(wx.Dialog):33 """Set up initial Guess."""34 def __init__(self, model, main, *args, **kwds):35 # assign parameters36 self.model = int(model)37 self.main = main38 # create window39 kwds["style"] = wx.CAPTION40 wx.Dialog.__init__(self, *args, **kwds)41 self.SetTitle("NESSY")42 _icon = wx.EmptyIcon()43 _icon.CopyFromBitmap(wx.Bitmap(NESSY_PIC, wx.BITMAP_TYPE_ANY))44 self.SetIcon(_icon)45 # Build entries46 self.build()47 def build(self):48 # mainsizer49 mainsizer = wx.BoxSizer(wx.VERTICAL)50 # header51 self.header = wx.StaticText(self, -1, "Set Parameters")52 self.header.SetFont(wx.Font(11, wx.DEFAULT, wx.NORMAL, wx.BOLD, 0, ""))53 mainsizer.Add(self.header, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5)54 # R255 sizer_r2 = wx.BoxSizer(wx.HORIZONTAL)56 self.label_r2 = wx.StaticText(self, -1, "R2 [1/s]:")57 self.label_r2.SetMinSize((100, 17))58 sizer_r2.Add(self.label_r2, 0, wx.ALL, 5)59 self.r2 = wx.TextCtrl(self, -1, str(self.main.p[0][0]))60 self.r2.SetMinSize((80, 23))61 sizer_r2.Add(self.r2, 0, wx.RIGHT, 5)62 mainsizer.Add(sizer_r2, 1, wx.EXPAND, 0)63 # Model 264 if self.model == 2:65 # Phi66 sizer_phi = wx.BoxSizer(wx.HORIZONTAL)67 self.label_phi = wx.StaticText(self, -1, "Phi [1/s]:")68 self.label_phi.SetMinSize((100, 17))69 sizer_phi.Add(self.label_phi, 0, wx.ALL, 5)70 self.phi = wx.TextCtrl(self, -1, str(self.main.p[1][1]))71 self.phi.SetMinSize((80, 23))72 sizer_phi.Add(self.phi, 0, wx.RIGHT, 5)73 mainsizer.Add(sizer_phi, 1, wx.EXPAND, 0)74 # Kex75 sizer_kex = wx.BoxSizer(wx.HORIZONTAL)76 self.label_kex = wx.StaticText(self, -1, "kex [1/s]:")77 self.label_kex.SetMinSize((100, 17))78 sizer_kex.Add(self.label_kex, 0, wx.ALL, 5)79 self.kex = wx.TextCtrl(self, -1, str(self.main.p[1][2]))80 self.kex.SetMinSize((80, 23))81 sizer_kex.Add(self.kex, 0, wx.RIGHT, 5)82 mainsizer.Add(sizer_kex, 1, wx.EXPAND, 0)83 # Model 384 if self.model == 3:85 # Kex86 sizer_kex = wx.BoxSizer(wx.HORIZONTAL)87 self.label_kex = wx.StaticText(self, -1, "kex [1/s]:")88 self.label_kex.SetMinSize((100, 17))89 sizer_kex.Add(self.label_kex, 0, wx.ALL, 5)90 self.kex = wx.TextCtrl(self, -1, str(self.main.p[2][1]))91 self.kex.SetMinSize((80, 23))92 sizer_kex.Add(self.kex, 0, wx.RIGHT, 5)93 mainsizer.Add(sizer_kex, 1, wx.EXPAND, 0)94 # dw95 sizer_dw = wx.BoxSizer(wx.HORIZONTAL)96 self.label_dw = wx.StaticText(self, -1, "dw [1/s]:")97 self.label_dw.SetMinSize((100, 17))98 sizer_dw.Add(self.label_dw, 0, wx.ALL, 5)99 self.dw = wx.TextCtrl(self, -1, str(self.main.p[2][2]))100 self.dw.SetMinSize((80, 23))101 sizer_dw.Add(self.dw, 0, wx.RIGHT, 5)102 mainsizer.Add(sizer_dw, 1, wx.EXPAND, 0)103 # pb104 sizer_pb = wx.BoxSizer(wx.HORIZONTAL)105 self.label_pb = wx.StaticText(self, -1, "pb:")106 self.label_pb.SetMinSize((100, 17))107 sizer_pb.Add(self.label_pb, 0, wx.ALL, 5)108 self.pb = wx.TextCtrl(self, -1, str(self.main.p[2][3]))109 self.pb.SetMinSize((80, 23))110 sizer_pb.Add(self.pb, 0, wx.RIGHT, 5)111 mainsizer.Add(sizer_pb, 1, wx.EXPAND, 0)112 # Model 4113 if self.model == 4:114 # Phi1115 sizer_phi = wx.BoxSizer(wx.HORIZONTAL)116 self.label_phi = wx.StaticText(self, -1, "Phi [1/s]:")117 self.label_phi.SetMinSize((100, 17))118 sizer_phi.Add(self.label_phi, 0, wx.ALL, 5)119 self.phi = wx.TextCtrl(self, -1, str(self.main.p[3][1]))120 self.phi.SetMinSize((80, 23))121 sizer_phi.Add(self.phi, 0, wx.RIGHT, 5)122 mainsizer.Add(sizer_phi, 1, wx.EXPAND, 0)123 # Kex1124 sizer_kex = wx.BoxSizer(wx.HORIZONTAL)125 self.label_kex = wx.StaticText(self, -1, "kex [1/s]:")126 self.label_kex.SetMinSize((100, 17))127 sizer_kex.Add(self.label_kex, 0, wx.ALL, 5)128 self.kex = wx.TextCtrl(self, -1, str(self.main.p[3][2]))129 self.kex.SetMinSize((80, 23))130 sizer_kex.Add(self.kex, 0, wx.RIGHT, 5)131 mainsizer.Add(sizer_kex, 1, wx.EXPAND, 0)132 # phi2133 sizer_phi2 = wx.BoxSizer(wx.HORIZONTAL)134 self.label_phi2 = wx.StaticText(self, -1, "phi2 [1/s]:")135 self.label_phi2.SetMinSize((100, 17))136 sizer_phi2.Add(self.label_phi2, 0, wx.ALL, 5)137 self.phi2 = wx.TextCtrl(self, -1, str(self.main.p[3][3]))138 self.phi2.SetMinSize((80, 23))139 sizer_phi2.Add(self.phi2, 0, wx.RIGHT, 5)140 mainsizer.Add(sizer_phi2, 1, wx.EXPAND, 0)141 # Kex2142 sizer_kex2 = wx.BoxSizer(wx.HORIZONTAL)143 self.label_kex2 = wx.StaticText(self, -1, "kex2 [1/s]:")144 self.label_kex2.SetMinSize((100, 17))145 sizer_kex2.Add(self.label_kex2, 0, wx.ALL, 5)146 self.kex2 = wx.TextCtrl(self, -1, str(self.main.p[3][4]))147 self.kex2.SetMinSize((80, 23))148 sizer_kex2.Add(self.kex2, 0, wx.RIGHT, 5)149 mainsizer.Add(sizer_kex2, 1, wx.EXPAND, 0)150 # Model 5151 if self.model == 5:152 # Kex153 sizer_kex = wx.BoxSizer(wx.HORIZONTAL)154 self.label_kex = wx.StaticText(self, -1, "kex [1/s]:")155 self.label_kex.SetMinSize((100, 17))156 sizer_kex.Add(self.label_kex, 0, wx.ALL, 5)157 self.kex = wx.TextCtrl(self, -1, str(self.main.p[4][1]))158 self.kex.SetMinSize((80, 23))159 sizer_kex.Add(self.kex, 0, wx.RIGHT, 5)160 mainsizer.Add(sizer_kex, 1, wx.EXPAND, 0)161 # dw162 sizer_dw = wx.BoxSizer(wx.HORIZONTAL)163 self.label_dw = wx.StaticText(self, -1, "dw [1/s]:")164 self.label_dw.SetMinSize((100, 17))165 sizer_dw.Add(self.label_dw, 0, wx.ALL, 5)166 self.dw = wx.TextCtrl(self, -1, str(self.main.p[4][2]))167 self.dw.SetMinSize((80, 23))168 sizer_dw.Add(self.dw, 0, wx.RIGHT, 5)169 mainsizer.Add(sizer_dw, 1, wx.EXPAND, 0)170 # pb171 sizer_pb = wx.BoxSizer(wx.HORIZONTAL)172 self.label_pb = wx.StaticText(self, -1, "pb:")173 self.label_pb.SetMinSize((100, 17))174 sizer_pb.Add(self.label_pb, 0, wx.ALL, 5)175 self.pb = wx.TextCtrl(self, -1, str(self.main.p[4][3]))176 self.pb.SetMinSize((80, 23))177 sizer_pb.Add(self.pb, 0, wx.RIGHT, 5)178 mainsizer.Add(sizer_pb, 1, wx.EXPAND, 0)179 # kex2180 sizer_kex2 = wx.BoxSizer(wx.HORIZONTAL)181 self.label_kex2 = wx.StaticText(self, -1, "kex2 [1/s]:")182 self.label_kex2.SetMinSize((100, 17))183 sizer_kex2.Add(self.label_kex2, 0, wx.ALL, 5)184 self.kex2 = wx.TextCtrl(self, -1, str(self.main.p[4][4]))185 self.kex2.SetMinSize((80, 23))186 sizer_kex2.Add(self.kex2, 0, wx.RIGHT, 5)187 mainsizer.Add(sizer_kex2, 1, wx.EXPAND, 0)188 # dw2189 sizer_dw2 = wx.BoxSizer(wx.HORIZONTAL)190 self.label_dw2 = wx.StaticText(self, -1, "dw2 [1/s]:")191 self.label_dw2.SetMinSize((100, 17))192 sizer_dw2.Add(self.label_dw2, 0, wx.ALL, 5)193 self.dw2 = wx.TextCtrl(self, -1, str(self.main.p[4][5]))194 self.dw2.SetMinSize((80, 23))195 sizer_dw2.Add(self.dw2, 0, wx.RIGHT, 5)196 mainsizer.Add(sizer_dw2, 1, wx.EXPAND, 0)197 # pc198 sizer_pc = wx.BoxSizer(wx.HORIZONTAL)199 self.label_pc = wx.StaticText(self, -1, "pc:")200 self.label_pc.SetMinSize((100, 17))201 sizer_pc.Add(self.label_pc, 0, wx.ALL, 5)202 self.pc = wx.TextCtrl(self, -1, str(self.main.p[4][6]))203 self.pc.SetMinSize((80, 23))204 sizer_pc.Add(self.pc, 0, wx.RIGHT, 5)205 mainsizer.Add(sizer_pc, 1, wx.EXPAND, 0)206 # Buttons207 sizer_buttons = wx.BoxSizer(wx.HORIZONTAL)208 self.button_create = wx.Button(self, -1, "Start")209 self.Bind(wx.EVT_BUTTON, self.start, self.button_create)210 sizer_buttons.Add(self.button_create, 0, wx.ALL, 5)211 self.button_cancel = wx.Button(self, -1, "Abort")212 self.Bind(wx.EVT_BUTTON, self.abort, self.button_cancel)213 sizer_buttons.Add(self.button_cancel, 0, wx.ALL, 5)214 mainsizer.Add(sizer_buttons, 0, wx.ALIGN_CENTER_HORIZONTAL, 0)215 # Pack dialog216 self.SetSizer(mainsizer)217 mainsizer.Fit(self)218 self.Layout()219 def start(self, event):220 # set parameters221 # model 1222 if self.model == 1:223 self.main.p[0] = [float(self.r2.GetValue())]224 # model 2225 if self.model == 2:226 self.main.p[1] = [float(self.r2.GetValue()), float(self.phi.GetValue()), float(self.kex.GetValue())]227 # model 3228 if self.model == 3:229 self.main.p[2] = [float(self.r2.GetValue()), float(self.kex.GetValue()), float(self.dw.GetValue()), float(self.pb.GetValue())]230 # model 4231 if self.model == 4:232 self.main.p[3] = [float(self.r2.GetValue()), float(self.phi.GetValue()), float(self.kex.GetValue()), float(self.phi2.GetValue()), float(self.kex2.GetValue())]233 # model 3234 if self.model == 5:235 self.main.p[4] = [float(self.r2.GetValue()), float(self.kex.GetValue()), float(self.dw.GetValue()), float(self.pb.GetValue()), float(self.kex2.GetValue()), float(self.dw2.GetValue()), float(self.pc.GetValue())]236 # close dialog237 self.Destroy()238 def abort(self, event):239 self.main.p = None240 self.Destroy()241class Synthetic_data(wx.Dialog):242 """Class to generate synthetic data."""243 def __init__(self, directory, *args, **kwds):244 # directory245 self.proj_directory = directory246 # Experiment type247 self.exp_mode = 0248 # initial guess249 p1 = ['15.23']250 p2 = ['15.23', '47457.43', '3750.25']251 p3 = ['15.23', '306.15', '1875.51', '0.072']252 p4 = ['15.23', '47457.43', '3750.25', '27457.43', '750.25']253 p5 = ['15.23', '157.48', '1222.74', '0.062', '428.55', '52.25', '0.33']254 self.p = [p1, p2, p3, p4, p5]255 # Create the dialog256 kwds["style"] = wx.CAPTION257 wx.Dialog.__init__(self, *args, **kwds)258 self.SetTitle("NESSY")259 _icon = wx.EmptyIcon()260 _icon.CopyFromBitmap(wx.Bitmap(NESSY_PIC, wx.BITMAP_TYPE_ANY))261 self.SetIcon(_icon)262 # Build window263 self.build()264 def build(self):265 # mainsizer266 mainsizer = wx.BoxSizer(wx.VERTICAL)267 # subsizer268 subsizer = wx.BoxSizer(wx.HORIZONTAL)269 # bitmap270 self.bitmap = wx.StaticBitmap(self, -1, wx.Bitmap(SYNTHETIC_PIC, wx.BITMAP_TYPE_ANY))271 subsizer.Add(self.bitmap, 0, wx.ALL, 5)272 # right sizer273 right_sizer = wx.BoxSizer(wx.VERTICAL)274 # header275 self.header = wx.StaticText(self, -1, "Synthetic Data Creator")276 self.header.SetFont(wx.Font(11, wx.DEFAULT, wx.NORMAL, wx.BOLD, 0, ""))277 right_sizer.Add(self.header, 0, wx.ALL, 5)278 # frequencies279 sizer_freq = wx.BoxSizer(wx.HORIZONTAL)280 self.label_freq = wx.StaticText(self, -1, "CPMG frequencies (x-values) [Hz]:")281 self.label_freq.SetMinSize((230, 17))282 sizer_freq.Add(self.label_freq, 0, wx.LEFT|wx.TOP, 5)283 self.freq = wx.TextCtrl(self, -1, "0, 25, 50, 50, 75, 75, 100, 150, 150, 200, 200, 300, 500, 600, 700, 900, 1000, 1500, 2000")284 self.freq.SetMinSize((300, 23))285 sizer_freq.Add(self.freq, 0, wx.RIGHT, 5)286 right_sizer.Add(sizer_freq, 0, 0, 0)287 # CPMG delay288 sizer_delay = wx.BoxSizer(wx.HORIZONTAL)289 self.label_delay = wx.StaticText(self, -1, "CPMG delay [s]:")290 self.label_delay.SetMinSize((230, 17))291 sizer_delay.Add(self.label_delay, 0, wx.LEFT|wx.TOP, 5)292 self.cpmg_delay = wx.TextCtrl(self, -1, "0.08")293 self.cpmg_delay.SetMinSize((80, 23))294 sizer_delay.Add(self.cpmg_delay, 0, 0, 0)295 right_sizer.Add(sizer_delay, 0, wx.EXPAND, 0)296 # directory297 sizer_directory = wx.BoxSizer(wx.HORIZONTAL)298 self.label_directory = wx.StaticText(self, -1, "Output directory:")299 self.label_directory.SetMinSize((230, 17))300 sizer_directory.Add(self.label_directory, 0, wx.LEFT|wx.TOP, 5)301 self.directory = wx.TextCtrl(self, -1, self.proj_directory)302 self.directory.SetMinSize((265, 23))303 sizer_directory.Add(self.directory, 0, wx.TOP, 5)304 self.button_directory = wx.Button(self, -1, "+")305 self.button_directory.SetMinSize((30, 23))306 self.Bind(wx.EVT_BUTTON, self.select_directory, self.button_directory)307 sizer_directory.Add(self.button_directory, 0, wx.LEFT|wx.RIGHT|wx.TOP, 5)308 right_sizer.Add(sizer_directory, 0, wx.EXPAND, 0)309 # model310 sizer_model = wx.BoxSizer(wx.HORIZONTAL)311 self.label_model = wx.StaticText(self, -1, "Model:")312 self.label_model.SetMinSize((230, 17))313 sizer_model.Add(self.label_model, 0, wx.LEFT|wx.TOP, 5)314 self.model = wx.ComboBox(self, -1, choices=["1:\tno exchange", "2:\t2 states fast exchange", "3:\t2 states slow exchange", "4:\t3 states fast exchange", "5:\t3 states slow exchange"], style=wx.CB_DROPDOWN)315 self.model.SetMinSize((300, 25))316 self.model.SetSelection(1)317 sizer_model.Add(self.model, 0, wx.TOP, 5)318 right_sizer.Add(sizer_model, 0, wx.EXPAND, 0)319 # error320 sizer_error = wx.BoxSizer(wx.HORIZONTAL)321 self.label_error = wx.StaticText(self, -1, "Error [%]:")322 self.label_error.SetMinSize((230, 17))323 sizer_error.Add(self.label_error, 0, wx.LEFT|wx.TOP|wx.ALIGN_BOTTOM, 5)324 self.error = wx.Slider(self, -1, 5, 1, 20, style=wx.SL_HORIZONTAL|wx.SL_LABELS)325 self.error.SetMinSize((300, 38))326 sizer_error.Add(self.error, 0, wx.RIGHT|wx.TOP, 5)327 right_sizer.Add(sizer_error, 0, wx.EXPAND, 0)328 # Experiment Typt329 sizer_expsel = wx.BoxSizer(wx.HORIZONTAL)330 # CPMG331 self.cpmg = wx.RadioButton(self, -1, "CPMG")332 sizer_expsel.Add(self.cpmg, 0, wx.LEFT|wx.RIGHT, 5)333 self.Bind(wx.EVT_RADIOBUTTON, self.selcpmg, self.cpmg)334 # On resonance R1rho335 self.onresonance = wx.RadioButton(self, -1, "On resonance R1rho")336 sizer_expsel.Add(self.onresonance, 0, wx.LEFT|wx.RIGHT, 5)337 self.Bind(wx.EVT_RADIOBUTTON, self.selon, self.onresonance)338 # Off resonance R1rho339 self.offresonance = wx.RadioButton(self, -1, "Off resonance R1rho")340 sizer_expsel.Add(self.offresonance, 0, wx.LEFT|wx.RIGHT, 5)341 self.Bind(wx.EVT_RADIOBUTTON, self.seloff, self.offresonance)342 right_sizer.Add(sizer_expsel, 0, wx.TOP|wx.BOTTOM|wx.ALIGN_CENTER_HORIZONTAL, 10)343 # Buttons344 sizer_buttons = wx.BoxSizer(wx.HORIZONTAL)345 self.button_create = wx.Button(self, -1, "Create")346 self.Bind(wx.EVT_BUTTON, self.craete_lists, self.button_create)347 sizer_buttons.Add(self.button_create, 0, wx.ALL, 5)348 self.button_restore = wx.Button(self, -1, "Restore default")349 self.Bind(wx.EVT_BUTTON, self.restore, self.button_restore)350 sizer_buttons.Add(self.button_restore, 0, wx.ALL, 5)351 self.button_cancel = wx.Button(self, -1, "Close")352 self.Bind(wx.EVT_BUTTON, self.cancel, self.button_cancel)353 sizer_buttons.Add(self.button_cancel, 0, wx.ALL, 5)354 right_sizer.Add(sizer_buttons, 0, wx.ALIGN_CENTER_HORIZONTAL, 0)355 # Pack right sizer356 subsizer.Add(right_sizer, 0, wx.EXPAND, 0)357 # Pack window358 mainsizer.Add(subsizer, 0, wx.EXPAND, 0)359 self.SetSizer(mainsizer)360 mainsizer.Fit(self)361 self.Layout()362 def cancel(self, event):363 self.Destroy()364 def craete_lists(self, event):365 # check entries366 if str(self.directory.GetValue()) == '':367 error_popup('No directory specified!')368 return369 # create x values370 x_values = str(self.freq.GetValue()).split(',')371 # error372 error = float(self.error.GetValue()) / 200373 # CPMG delay374 cpmg_delay = float(self.cpmg_delay.GetValue())375 # reference intensity376 I0 = 10000377 # models378 # CPMG379 if self.exp_mode == 0:380 models = {"1:\tno exchange": model_1, "2:\t2 states fast exchange": model_2, "3:\t2 states slow exchange": model_3, "4:\t3 states fast exchange": model_4, "5:\t3 states slow exchange": model_5}381 # selected model382 selected_model = str(self.model.GetValue())383 # set initial guess384 guess = Initial_guess(selected_model[0:1], self, None, -1, "")385 guess.ShowModal()386 # Abort387 if self.p == None:388 return389 # csv file containers390 csv_x = []391 csv_y = []392 # loop over x-values393 for y in range(0, len(x_values)):394 # reference395 if int(x_values[y]) == 0:396 # save file397 filename = str(self.directory.GetValue())+sep+'Dataset_'+str(y+1)+'.txt'398 # open file399 file = open(filename, 'w')400 file.write('Dummy-1-NH\tNone\tNone\t'+str(I0))401 file.close()402 # datapoint403 else:404 # calculate R2eff405 R2eff_tmp = models[selected_model](float(x_values[y]), self.p[int(selected_model[0:1])-1])406 R2eff = R2eff_tmp + uniform(-error, error)*R2eff_tmp407 # calculate intensity408 y_value = I0 / exp(R2eff*cpmg_delay)409 # save file410 filename = str(self.directory.GetValue())+sep+'Dataset_'+str(y+1)+'.txt'411 # open file412 file = open(filename, 'w')413 file.write('Dummy-1-NH\tNone\tNone\t'+str(y_value))414 file.close()415 # for csv file416 csv_x.append(str(x_values[y]))417 csv_y.append(str(R2eff))418 # write vd list419 file = open(str(self.directory.GetValue())+sep+'vd', 'w')420 for i in range(0, len(x_values)):421 file.write(str(int(x_values[i]))+'\n')422 file.close()423 # create csv file424 file = open(str(self.directory.GetValue())+sep+'Synthetic_R2eff.csv', 'w')425 if self.exp_mode == 0:426 file.write('CPMG freq [Hz];R2eff [1/s]\n\n')427 else:428 file.write('Spin lock field [Hz];R1rho [1/s]\n\n')429 for i in range(0, len(csv_x)):430 file.write(str(int(csv_x[i]))+';'+str(float(csv_y[i]))+'\n')431 file.close()432 # feedback433 message('Synthetic data set was successfully created!\n\nData is in Sparky format.', self)434 def restore(self, event):435 # CPMG frequencies436 self.freq.SetValue("0, 25, 50, 50, 75, 75, 100, 150, 150, 200, 200, 300, 500, 600, 700, 900, 1000, 1500, 2000")437 # CPMG delay438 self.cpmg_delay.SetValue("0.04")439 # Directory440 self.directory.SetValue(self.proj_directory)441 # error442 self.error.SetValue(5)443 def select_directory(self, event):444 folder = opendir('Select folder', str(self.directory.GetValue()), self)445 if folder:446 self.directory.SetValue(folder)447 def selcpmg(self, event):448 self.label_delay.SetLabel('CPMG delay [s]:')449 self.label_freq.SetLabel("CPMG frequencies (x-values) [Hz]:")450 self.exp_mode = 0451 def selon(self, event):452 self.label_delay.SetLabel('Spin lock time [s]')453 self.label_freq.SetLabel("Spin lock field [Hz]:")454 self.exp_mode = 1455 def seloff(self, event):456 self.label_delay.SetLabel('Spin lock time [s]')457 self.label_freq.SetLabel("Spin lock field [Hz]:")...

Full Screen

Full Screen

nessy_settings.py

Source:nessy_settings.py Github

copy

Full Screen

1#################################################################################2# #3# (C) 2010 Michael Bieri #4# (C) 2016 Edward d'Auvergne #5# #6# This file is part of NESSY. #7# #8# NESSY is free software: you can redistribute it and/or modify #9# it under the terms of the GNU General Public License as published by #10# the Free Software Foundation, either version 3 of the License, or #11# (at your option) any later version. #12# #13# NESSY is distributed in the hope that it will be useful, #14# but WITHOUT ANY WARRANTY; without even the implied warranty of #15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #16# GNU General Public License for more details. #17# #18# You should have received a copy of the GNU General Public License #19# along with NESSY; if not, write to the Free Software #20# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #21# #22#################################################################################23# Python modules24from os import sep25import wx26# NESSY modules27from conf.message import question, error_popup28from conf.path import NESSY_PIC, SETTINGS_SIDE_PIC29from conf.project import stringtolist30class settings(wx.Dialog):31 def __init__(self, main, *args, **kwds):32 """Create Dialog."""33 # assign main frame34 self.main = main35 # Create Window36 kwds["style"] = wx.CAPTION|wx.CLOSE_BOX37 wx.Dialog.__init__(self, *args, **kwds)38 self.SetTitle("NESSY Settings")39 _icon = wx.EmptyIcon()40 _icon.CopyFromBitmap(wx.Bitmap(NESSY_PIC, wx.BITMAP_TYPE_ANY))41 self.SetIcon(_icon)42 # Main sizer43 mainsizer = wx.BoxSizer(wx.VERTICAL)44 # subsizer45 subsizer = wx.BoxSizer(wx.HORIZONTAL)46 # Image47 self.bitmap = wx.StaticBitmap(self, -1, wx.Bitmap(SETTINGS_SIDE_PIC, wx.BITMAP_TYPE_ANY))48 subsizer.Add(self.bitmap, 0, wx.ALL, 5)49 # right sizer50 right_sizer = wx.BoxSizer(wx.VERTICAL)51 # Title52 self.title = wx.StaticText(self, -1, "NESSY Settings")53 self.title.SetFont(wx.Font(14, wx.DEFAULT, wx.NORMAL, wx.BOLD, 0, ""))54 right_sizer.Add(self.title, 0, wx.ALL, 5)55 # Model Selection Mode56 sizer_modsel = wx.BoxSizer(wx.HORIZONTAL)57 self.label_modsel = wx.StaticText(self, -1, "Model Selection Mode:")58 self.label_modsel.SetMinSize((250, 34))59 sizer_modsel.Add(self.label_modsel, 0, wx.LEFT|wx.RIGHT|wx.ALIGN_CENTER_VERTICAL, 5)60 # AICc61 self.aicc = wx.RadioButton(self, -1, "AICc")62 sizer_modsel.Add(self.aicc, 0, wx.LEFT|wx.RIGHT, 5)63 # AIC64 self.aic = wx.RadioButton(self, -1, "AIC")65 sizer_modsel.Add(self.aic, 0, wx.LEFT|wx.RIGHT, 5)66 # F-Test67 self.f_test = wx.RadioButton(self, -1, "F-Test")68 sizer_modsel.Add(self.f_test, 0, wx.LEFT|wx.RIGHT, 5)69 #Chi270 self.chi = wx.RadioButton(self, -1, "Chi2")71 sizer_modsel.Add(self.chi, 0, wx.LEFT|wx.RIGHT, 5)72 #Alpha73 #self.alpha = wx.RadioButton(self, -1, "Alpha")74 #self.alpha.SetToolTipString("Chemical exchange time regime is characterized by:\nalpha = ( (B(0)2 + B(0)1) / (B(0)2 - B(0)1) ) * ( (Rex2 - Rex1) / (Rex2 + Rex1) )\n\nThis function is only applicable for global fits!\nFast exchange 2-site model has to be calculated.\n\nFor individual fits, it will be automaticall set to AICc.")75 #sizer_modsel.Add(self.alpha, 0, wx.LEFT|wx.RIGHT, 5)76 #Chi277 self.manual = wx.RadioButton(self, -1, "Manual")78 sizer_modsel.Add(self.manual, 0, wx.LEFT|wx.RIGHT, 5)79 # Pack Model Selection80 right_sizer.Add(sizer_modsel, 0, 0, 0)81 # Monte Carlo82 sizer_mc = wx.BoxSizer(wx.HORIZONTAL)83 self.label_mc = wx.StaticText(self, -1, "Number of Monte Carlo Simulations:")84 self.label_mc.SetMinSize((250, 34))85 sizer_mc.Add(self.label_mc, 0, wx.LEFT|wx.RIGHT|wx.ALIGN_CENTER_VERTICAL, 5)86 self.num_mc = wx.SpinCtrl(self, -1, "500", min=2, max=1000)87 sizer_mc.Add(self.num_mc, 0, wx.LEFT|wx.RIGHT, 5)88 right_sizer.Add(sizer_mc, 0, 0, 0)89 # Grid increment90 sizer = wx.BoxSizer(wx.HORIZONTAL)91 label_grid = wx.StaticText(self, -1, "Increments for Grid Search:")92 label_grid.SetMinSize((250, 34))93 sizer.Add(label_grid, 0, wx.LEFT|wx.RIGHT|wx.ALIGN_CENTER_VERTICAL, 5)94 # R295 #labelr2 = wx.StaticText(self, -1, "R2: ")96 #sizer.Add(labelr2, 0, wx.LEFT|wx.ALIGN_CENTER_VERTICAL, 5)97 #self.r2 = wx.TextCtrl(self, -1, str(self.main.GRID_INCREMENT[0]))98 #self.r2.SetMinSize((50, 23))99 #sizer.Add(self.r2, 0, wx.ALIGN_CENTER_VERTICAL, 0)100 # kex101 labelkex = wx.StaticText(self, -1, "kex: ")102 sizer.Add(labelkex, 0, wx.LEFT|wx.ALIGN_CENTER_VERTICAL, 5)103 self.kex = wx.TextCtrl(self, -1, str(self.main.GRID_INCREMENT[1]))104 self.kex.SetMinSize((50, 23))105 sizer.Add(self.kex, 0, wx.ALIGN_CENTER_VERTICAL, 0)106 # dw107 labeldw = wx.StaticText(self, -1, "dw: ")108 sizer.Add(labeldw, 0, wx.LEFT|wx.ALIGN_CENTER_VERTICAL, 5)109 self.dw = wx.TextCtrl(self, -1, str(self.main.GRID_INCREMENT[2]))110 self.dw.SetMinSize((50, 23))111 sizer.Add(self.dw, 0, wx.ALIGN_CENTER_VERTICAL, 0)112 # pb113 labelpb = wx.StaticText(self, -1, "pb: ")114 sizer.Add(labelpb, 0, wx.LEFT|wx.ALIGN_CENTER_VERTICAL, 5)115 self.pb = wx.TextCtrl(self, -1, str(self.main.GRID_INCREMENT[3]))116 self.pb.SetMinSize((50, 23))117 sizer.Add(self.pb, 0, wx.ALIGN_CENTER_VERTICAL, 0)118 # phi119 labelphi = wx.StaticText(self, -1, "phi: ")120 sizer.Add(labelphi, 0, wx.LEFT|wx.ALIGN_CENTER_VERTICAL, 5)121 self.phi = wx.TextCtrl(self, -1, str(self.main.GRID_INCREMENT[4]))122 self.phi.SetMinSize((50, 23))123 sizer.Add(self.phi, 0, wx.ALIGN_CENTER_VERTICAL, 0)124 right_sizer.Add(sizer, 0, 0, 0)125 # use gridsearch126 sizer = wx.BoxSizer(wx.HORIZONTAL)127 label = wx.StaticText(self, -1, "Minimisation Method:")128 label.SetMinSize((250, 34))129 sizer.Add(label, 0, wx.LEFT|wx.RIGHT|wx.ALIGN_CENTER_VERTICAL, 5)130 self.minimisation_method = wx.ComboBox(self, -1, choices=["Least square only", "Least square until convergence", "Grid search & least square"], style=wx.CB_DROPDOWN | wx.CB_READONLY)131 self.minimisation_method.SetMinSize((230, 25))132 sizer.Add(self.minimisation_method, 0, wx.LEFT, 5)133 right_sizer.Add(sizer, 0, 0, 0)134 # use gridsearch135 sizer = wx.BoxSizer(wx.HORIZONTAL)136 label = wx.StaticText(self, -1, "Fitting accuracy:")137 label.SetMinSize((250, 34))138 sizer.Add(label, 0, wx.LEFT|wx.RIGHT|wx.ALIGN_CENTER_VERTICAL, 5)139 self.fit_accuracy = wx.ComboBox(self, -1, choices=["Exact", "Moderate", "Loose"], style=wx.CB_DROPDOWN | wx.CB_READONLY)140 self.fit_accuracy.SetMinSize((230, 25))141 sizer.Add(self.fit_accuracy, 0, wx.LEFT, 5)142 right_sizer.Add(sizer, 0, 0, 0)143 # Number of Data sets144 #sizer_data = wx.BoxSizer(wx.HORIZONTAL)145 #self.label_data = wx.StaticText(self, -1, "Maximum Data Sets:")146 #self.label_data.SetMinSize((250, 34))147 #sizer_data.Add(self.label_data, 0, wx.ALL, 5)148 #self.num_datasets = wx.SpinCtrl(self, -1, "0", min=20, max=100)149 #sizer_data.Add(self.num_datasets, 0, wx.ALL, 5)150 #right_sizer.Add(sizer_data, 0, 0, 0)151 # R20 limit152 #sizer_r2 = wx.BoxSizer(wx.HORIZONTAL)153 #self.label_r2 = wx.StaticText(self, -1, "Limit of R20 relative to\nR2eff of highest frequency [%]:")154 #self.label_r2.SetMinSize((250, 34))155 #sizer_r2.Add(self.label_r2, 0, wx.ALL, 5)156 #self.min_r2 = wx.TextCtrl(self, -1, "30.0")157 #sizer_r2.Add(self.min_r2, 0, wx.LEFT|wx.ALIGN_CENTER_VERTICAL, 5)158 #right_sizer.Add(sizer_r2, 0, 0, 0)159 # Exclude Difference160 sizer_diff = wx.BoxSizer(wx.HORIZONTAL)161 self.label_diff = wx.StaticText(self, -1, "Minimal Difference Between Lowest\nand Highest R2eff(v[CPMG]) in [1/s]:")162 self.label_diff.SetMinSize((250, 34))163 sizer_diff.Add(self.label_diff, 0, wx.LEFT|wx.RIGHT|wx.ALIGN_CENTER_VERTICAL, 5)164 self.min_diff = wx.TextCtrl(self, -1, "2.0")165 sizer_diff.Add(self.min_diff, 0, wx.LEFT|wx.ALIGN_CENTER_VERTICAL, 5)166 right_sizer.Add(sizer_diff, 0, 0, 0)167 # Exclude time point168 sizer_ex = wx.BoxSizer(wx.HORIZONTAL)169 self.label_ex = wx.StaticText(self, -1, "Calculate Models 2-5:")170 self.label_ex.SetMinSize((250, 34))171 sizer_ex.Add(self.label_ex, 0, wx.LEFT|wx.RIGHT|wx.ALIGN_CENTER_VERTICAL, 5)172 self.exclude_order = wx.ComboBox(self, -1, choices=["only if exchange is expected", "for entire dataset"], style=wx.CB_DROPDOWN | wx.CB_READONLY)173 self.exclude_order.SetMinSize((230, 25))174 sizer_ex.Add(self.exclude_order, 0, wx.LEFT, 5)175 right_sizer.Add(sizer_ex, 0, 0, 0)176 # Scale y axis R2eff plots177 sizer_plots = wx.BoxSizer(wx.HORIZONTAL)178 self.label_plots = wx.StaticText(self, -1, "Y axis in R2eff / R1rho plots [Hz]:")179 self.label_plots.SetMinSize((250, 34))180 sizer_plots.Add(self.label_plots, 0, wx.LEFT|wx.RIGHT|wx.ALIGN_CENTER_VERTICAL, 5)181 self.range_plots = wx.TextCtrl(self, -1, "0-50")182 sizer_plots.Add(self.range_plots, 0, wx.LEFT, 5)183 right_sizer.Add(sizer_plots, 0, 0, 0)184 # Weight of frame in plots185 sizer_weight = wx.BoxSizer(wx.HORIZONTAL)186 self.label_weight = wx.StaticText(self, -1, "Width of frame in plots [points]:")187 self.label_weight.SetMinSize((250, 34))188 sizer_weight.Add(self.label_weight, 0, wx.LEFT|wx.RIGHT|wx.ALIGN_CENTER_VERTICAL, 5)189 self.range_weight = wx.TextCtrl(self, -1, str(self.main.FRAMEWIDTH))190 sizer_weight.Add(self.range_weight, 0, wx.LEFT, 5)191 right_sizer.Add(sizer_weight, 0, 0, 0)192 # Image format for plots193 sizer_format = wx.BoxSizer(wx.HORIZONTAL)194 self.label_format = wx.StaticText(self, -1, "Output format for plots:")195 self.label_format.SetMinSize((250, 34))196 sizer_format.Add(self.label_format, 0, wx.LEFT|wx.RIGHT|wx.ALIGN_CENTER_VERTICAL, 5)197 self.plot_format = wx.ComboBox(self, -1, choices=["SVG", "PS", "EPS", "PDF"], style=wx.CB_DROPDOWN | wx.CB_READONLY)198 self.plot_format.SetMinSize((60, 25))199 sizer_format.Add(self.plot_format, 0, wx.LEFT, 5)200 right_sizer.Add(sizer_format, 0, 0, 0)201 # Create intensity plots202 sizer_intensity = wx.BoxSizer(wx.HORIZONTAL)203 self.label_intensity = wx.StaticText(self, -1, "Create Intensity plots?")204 self.label_intensity.SetMinSize((250, 34))205 sizer_intensity.Add(self.label_intensity, 0, wx.LEFT|wx.RIGHT|wx.ALIGN_CENTER_VERTICAL, 5)206 self.plot_intensity = wx.ComboBox(self, -1, choices=["Yes", "No"], style=wx.CB_DROPDOWN | wx.CB_READONLY)207 self.plot_intensity.SetMinSize((60, 25))208 sizer_intensity.Add(self.plot_intensity, 0, wx.LEFT, 5)209 right_sizer.Add(sizer_intensity, 0, 0, 0)210 # Create R2eff plots211 sizer_r2eff_plots = wx.BoxSizer(wx.HORIZONTAL)212 self.label_r2eff_plots = wx.StaticText(self, -1, "Create R2eff / R1rho plots?")213 self.label_r2eff_plots.SetMinSize((250, 34))214 sizer_r2eff_plots.Add(self.label_r2eff_plots, 0, wx.LEFT|wx.RIGHT|wx.ALIGN_CENTER_VERTICAL, 5)215 self.plot_r2eff_plots = wx.ComboBox(self, -1, choices=["Yes", "No"], style=wx.CB_DROPDOWN | wx.CB_READONLY)216 self.plot_r2eff_plots.SetMinSize((60, 25))217 sizer_r2eff_plots.Add(self.plot_r2eff_plots, 0, wx.LEFT, 5)218 right_sizer.Add(sizer_r2eff_plots, 0, 0, 0)219 # Attention Text220 #self.label_Text = wx.StaticText(self, -1, "Attention:\n\nChanging NESSY Settings strongly influences NESSY calculation!\n\nModel Selection: Default method is Akaike Information Criteria with a second order\n correction for small sample sizes (AICc). AICc does not require normally distributed data and \ntakes in account small sample size (n < 50).", style=wx.ALIGN_CENTRE)221 #self.label_Text.SetMinSize((400, 160))222 #right_sizer.Add(self.label_Text, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 15)223 # Buttons224 sizer_buttons = wx.BoxSizer(wx.HORIZONTAL)225 self.button_cancel = wx.Button(self, -1, "Cancel")226 self.Bind(wx.EVT_BUTTON, self.cancel, self.button_cancel)227 sizer_buttons.Add(self.button_cancel, 0, wx.ALL, 5)228 self.button_restore = wx.Button(self, -1, "Restore Default")229 self.Bind(wx.EVT_BUTTON, self.restore, self.button_restore)230 sizer_buttons.Add(self.button_restore, 0, wx.ALL, 5)231 self.button_save = wx.Button(self, -1, "Save")232 self.Bind(wx.EVT_BUTTON, self.save, self.button_save)233 sizer_buttons.Add(self.button_save, 0, wx.ALL, 5)234 right_sizer.Add(sizer_buttons, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.TOP, 20)235 # add to right sizer236 subsizer.Add(right_sizer, 0, 0, 0)237 #mainsizer.Add(subsizer, 0, 0, 0)238 # vertical line239 line = wx.StaticLine(self, -1, style=wx.LI_VERTICAL)240 subsizer.Add(line, 0, wx.EXPAND|wx.ALL, 5)241 # Other settings242 sizer = wx.BoxSizer(wx.VERTICAL)243 # Models244 self.button_models = wx.Button(self, -1, "Select Models")245 self.button_models.SetMinSize((150, 40))246 self.Bind(wx.EVT_BUTTON, self.main.models, self.button_models)247 sizer.Add(self.button_models, 0, wx.ALL, 5)248 # residues249 self.button_residues = wx.Button(self, -1, "Select Residues")250 self.button_residues.SetMinSize((150, 40))251 self.Bind(wx.EVT_BUTTON, self.main.select_res, self.button_residues)252 sizer.Add(self.button_residues, 0, wx.ALL, 5)253 # Boundaries254 self.button_bound = wx.Button(self, -1, "Boundaries")255 self.button_bound.SetMinSize((150, 40))256 self.Bind(wx.EVT_BUTTON, self.main.constraints, self.button_bound)257 sizer.Add(self.button_bound, 0, wx.ALL, 5)258 # Manual model seletcion259 self.button_sel = wx.Button(self, -1, "Manual Model Selection")260 self.button_sel.SetMinSize((150, 40))261 self.Bind(wx.EVT_BUTTON, self.main.manual_selection, self.button_sel)262 sizer.Add(self.button_sel, 0, wx.ALL, 5)263 # att to right sizer264 subsizer.Add(sizer, 0, wx.TOP, 50)265 mainsizer.Add(subsizer, 0, 0, 0)266 # Pack dialog267 self.SetSizer(mainsizer)268 mainsizer.Fit(self)269 self.Layout()270 self.sync(read=True)271 def cancel(self, event): # Cancel272 self.Destroy()273 def save(self, event): # save settings274 if question('Do you want to change NESSY settings?'):275 q = self.sync(read=False)276 if q == 'error': return277 self.Destroy()278 def restore(self, event): # restore default settings279 self.main.SETTINGS = ['AICc', '500', '20', '2.0', '50.0', '0', '40'] # [Model selection, Monte Carlo, Data sets, Difference to exclude, R2 limit]280 self.sync(read=True)281 self.main.FRAMEWIDTH=2282 self.range_weight.SetValue('2')283 self.plot_format.SetSelection(0)284 def sync(self, read=True):285 #read from settings286 if read:287 # Model selection288 if self.main.SETTINGS[0] == 'AICc':289 self.aicc.SetValue(True)290 #self.alpha.SetValue(False)291 if self.main.SETTINGS[0] == 'AIC':292 self.aic.SetValue(True)293 #self.alpha.SetValue(False)294 if self.main.SETTINGS[0] == 'F':295 self.f_test.SetValue(True)296 #self.alpha.SetValue(False)297 if self.main.SETTINGS[0] == 'Chi2':298 self.chi.SetValue(True)299 if self.main.SETTINGS[0] == 'Manual':300 self.manual.SetValue(True)301 # Monte Carlo Simulation302 self.num_mc.SetValue(int(self.main.SETTINGS[1]))303 # Number of Datasets304 #self.num_datasets.SetValue(int(self.main.SETTINGS[2]))305 # Diff to exclude306 self.min_diff.SetValue(self.main.SETTINGS[3])307 # use of grid search308 if self.main.GRIDSEARCH: self.minimisation_method.SetSelection(2)309 elif self.main.CONVERGENCE: self.minimisation_method.SetSelection(1)310 else: self.minimisation_method.SetSelection(0)311 # R2 minit312 #self.min_r2.SetValue(self.main.SETTINGS[4])313 # y-axis range314 self.range_plots.SetValue(str(self.main.SETTINGS[5])+' - '+str(self.main.SETTINGS[6]))315 # Output format for plot316 self.plot_format.SetSelection(self.main.PLOT2SELECTION[self.main.PLOTFORMAT])317 # exclude order318 if self.main.FITALLMODELS:319 self.exclude_order.SetSelection(1)320 else:321 self.exclude_order.SetSelection(0)322 # Create intensity plots323 self.plot_intensity.SetSelection(int(self.main.CREATE_INTENSITYPLOT))324 # Create intensity plots325 self.plot_r2eff_plots.SetSelection(int(self.main.CREATE_R2EFFPLOT))326 # fitting accuracy327 if self.main.tolerance == 1.49012e-20: self.fit_accuracy.SetSelection(0)328 elif self.main.tolerance == 1.49012e-10: self.fit_accuracy.SetSelection(1)329 elif self.main.tolerance == 1.49012e-5: self.fit_accuracy.SetSelection(2)330 else: self.fit_accuracy.SetSelection(0)331 # change settings332 else:333 # Model Selection334 if self.aicc.GetValue() == True:335 self.main.SETTINGS[0] = 'AICc'336 elif self.aic.GetValue() == True:337 self.main.SETTINGS[0] = 'AIC'338 elif self.f_test.GetValue() == True:339 self.main.SETTINGS[0] = 'F'340 elif self.chi.GetValue() == True:341 self.main.SETTINGS[0] = 'Chi2'342 elif self.manual.GetValue() == True:343 self.main.SETTINGS[0] = 'Manual'344 # Monte Carlo Simulation345 self.main.SETTINGS[1] = str(self.num_mc.GetValue())346 # Number of Datasets347 #self.main.SETTINGS[2] = str(self.num_datasets.GetValue())348 # Diff to exclude349 self.main.SETTINGS[3]= str(self.min_diff.GetValue())350 # R2 minit351 #self.main.SETTINGS[4] = str(self.min_r2.GetValue())352 # y-axis range353 y_range = str(self.range_plots.GetValue()).split('-')354 self.main.SETTINGS[5] = y_range[0].strip()355 self.main.SETTINGS[6] = y_range[1].strip()356 # Frame width for plots357 self.main.FRAMEWIDTH = float(self.range_weight.GetValue())358 # Output format for plot359 self.main.PLOTFORMAT = self.main.SELECTION2PLOT[str(self.plot_format.GetSelection())]360 # exclude order361 if self.exclude_order.GetSelection() == 1:362 self.main.FITALLMODELS = True363 else:364 self.main.FITALLMODELS = False365 # Create intensity plots366 self.main.CREATE_INTENSITYPLOT = str(self.plot_intensity.GetSelection())367 # Create intensity plots368 self.main.CREATE_R2EFFPLOT = str(self.plot_r2eff_plots.GetSelection())369 # use of grid search370 if self.minimisation_method.GetSelection() == 0:371 self.main.GRIDSEARCH = False372 self.main.CONVERGENCE = False373 elif self.minimisation_method.GetSelection() == 1:374 self.main.GRIDSEARCH = False375 self.main.CONVERGENCE = True376 elif self.minimisation_method.GetSelection() == 2:377 self.main.GRIDSEARCH = True378 self.main.CONVERGENCE = False379 # Fitting accuracy380 if self.fit_accuracy.GetSelection() == 0: self.main.tolerance = 1.49012e-20381 elif self.fit_accuracy.GetSelection() == 1: self.main.tolerance = 1.49012e-10382 elif self.fit_accuracy.GetSelection() == 2: self.main.tolerance = 1.49012e-5383 # Increments for grid search384 # test if values385 try:386 r2 = 1#float(self.r2.GetValue())387 kex = float(self.kex.GetValue())388 dw = float(self.dw.GetValue())389 pb = float(self.pb.GetValue())390 phi = float(self.phi.GetValue())391 except:392 error_popup('Increment steps have to be numbers.', self)393 return 'error'...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Molotov automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful