Example #1
0
    def init(self):
        self.selectedImages = []

        with flx.TabLayout() as self.tabs:
            with flx.HFix(title="selection", flex=1) as self.selector_view:
                with flx.VFix() as self.images:
                    flx.Label(text="Images", flex=(1, 1))
                    self.imageGrid = ImageGrid(
                        4,
                        4,
                        path_provider,
                        lambda o, idx, idy: self.image_click_handler(
                            o, idx, idy),
                        flex=(1, 9))
                self.images.node.style.backgroundColor = "#88888888"
                with flx.VFix() as self.selected:
                    flx.Label(text="Selected", flex=(1, 1))
                    self.selectedGrid = ImageGrid(
                        4,
                        4,
                        self.selected_provider,
                        lambda o, idx, idy: self.selected_click_handler(
                            o, idx, idy),
                        flex=(1, 9))
            with flx.HFix(title="results", flex=1) as self.result_view:
                self.resultGrid = ImageGrid(8, 4, path_provider, flex=(1, 1))
Example #2
0
 def init(self):
     global main
     main = self
     global url
     url = window.location['origin']
     print(url)
     self.update_screen_list()
     self.update_media_list()
     global is_admin
     is_admin = self.send_request('GET', url + '/auth', '').responseText == 'admin'
     with flx.FormLayout():
         with flx.HSplit():
             self.logout = flx.Button(title='logout', text='Logout', flex=1)
             flx.Widget(flex=5)
             self.new_dashboard = flx.Button(title='new_dashboard', text='New Dashboard', flex=1)
         with flx.TabLayout(flex=5):
             EditDisplay(title='Edit a Display')
             Defaults(title='Modify Defaults')
             if is_admin:
                 Events(title='Modify Events')
                 System(title='System')
         self.edit_media = EditMedia(flex=2)
Example #3
0
    def init(self):

        with flx.VBox(flex=0, minsize=400, style="background: #9d9;"):
            self.thruster_angles = GenericActuatorBox(
                "Thruster Angles", "core/thrust_vector_cmd",
                "sam_msgs/ThrusterAngles", [{
                    "name": "Hori.",
                    "member": "thruster_horizontal_radians",
                    "min": -0.1,
                    "max": 0.18
                }, {
                    "name": "Vert.",
                    "member": "thruster_vertical_radians",
                    "min": -0.1,
                    "max": 0.15
                }])
            self.thruster_rpms = GenericActuatorBox(
                "Thruster RPMs", "core/rpm_cmd", "sam_msgs/ThrusterRPMs",
                [{
                    "name": "Front",
                    "member": "thruster_1_rpm",
                    "min": -1000,
                    "max": 1000,
                    "type": "int"
                }, {
                    "name": "Back",
                    "member": "thruster_2_rpm",
                    "min": -1000,
                    "max": 1000,
                    "type": "int"
                }])
            self.leak_button = flx.Button(text="No leaks...",
                                          style="background: #008000;",
                                          disabled=True)
            lcg_actuator = ActuatorBox("Pitch - LCG",
                                       "sam_msgs/PercentStamped",
                                       "core/lcg_cmd", "core/lcg_fb",
                                       "ctrl/lcg/pid_enable",
                                       "ctrl/lcg/setpoint", -1.6, 1.6)
            vbs_actuator = ActuatorBox("Depth - VBS",
                                       "sam_msgs/PercentStamped",
                                       "core/vbs_cmd", "core/vbs_fb",
                                       "ctrl/vbs/pid_enable",
                                       "ctrl/vbs/setpoint", 0, 5)
            tcg_actuator = ActuatorBox("Roll - TCG", "sam_msgs/BallastAngles",
                                       "core/tcg_cmd", "",
                                       "ctrl/tcg/pid_enable",
                                       "ctrl/tcg/setpoint", -1.6, 1.6, True)

            #flx.Widget(flex=1)
            with flx.TabLayout(flex=1):
                self.startup_check = ROSActionClientWidget(
                    "startup_check",
                    "sam_msgs/SystemsCheck",
                    title="Startup check",
                    flex=1)
                self.gps_fix_action = ROSActionClientWidget(
                    "gps_fix_server",
                    "sam_msgs/GetGPSFix",
                    title="Get GPS fix",
                    flex=1)

            self.abort_button = flx.Button(text="Abort",
                                           style="background: #ff6961;")

            self.subscribe("core/leak_fb", "sam_msgs/Leak", self.leak_callback)
            self.announce_publish("abort", "std_msgs/Empty")
Example #4
0
 def init(self):
     with flx.TabLayout():
         CirclesViewController(title='Status')
         Networking(title='Networking')
Example #5
0
 def init(self):
     with flx.TabLayout():
         Splines(title='Spline demo')
         Twente(title='Temperature vis')
         Drawing(title='Drawing app')
         flx.YoutubeWidget(title='Video')
Example #6
0
 def init(self):
     with flx.TabLayout() as self.t:
         self.a = flx.MultiLineEdit(title='input', style='background:#a00;')
         self.b = flx.Widget(title='green', style='background:#0a0;')
         self.c = flx.Widget(title='blue', style='background:#00a;')
Example #7
0
    def init(self):
        with flx.TabLayout() as self.tabbar:
            with flx.HBox(title='A'):
                with flx.VBox(flex=0):
                    flx.Widget(flex=0)

                    flx.Label(text='Select Environment: ')
                    self.logselector = flx.ComboBox(
                        options=flx.relay.stock_list,
                        selected_index=0,
                        style='width: 100%',
                        maxsize=(500, 320))
                    self.logselector.set_editable(True)
                    flx.Label(text='Basic Algorithm: ')
                    self.BasicAlgo = {}
                    self.b1 = flx.ToggleButton(text='Gen93 NWSEL')
                    self.BasicAlgo['Gen93 NWSEL'] = False
                    self.b2 = flx.ToggleButton(
                        text='Gen97 NWSEL w.o. INTERRAT RSSI')
                    self.BasicAlgo['Gen97 NWSEL w.o. INTERRAT RSSI'] = False
                    self.b3 = flx.ToggleButton(
                        text='Gen97 NWSEL with INTERRAT RSSI', checked=True)
                    self.BasicAlgo['Gen97 NWSEL with INTERRAT RSSI'] = True
                    flx.Label(text='Press Run: ')
                    self.button = flx.Button(text='Run')
                    self.button.reaction(self._do_work, 'pointer_down')
                    flx.Widget(flex=1)
                    flx.Label(
                        text=
                        "Tutorial@http://wiki/display/~MTK13028/01.+Startup")
                    flx.Label(text=r"Log@\\pc17080057\log_pool")
                with flx.VBox(flex=1):
                    self.view = smartms.SmartMSView()
            with flx.Widget(title='B'):
                self.r1 = flx.RadioButton(text='Gen93 NWSEL')
                self.r2 = flx.RadioButton(
                    text='Gen97 NWSEL w.o. INTERRAT RSSI')
                self.r3 = flx.RadioButton(
                    text='Gen97 NWSEL with INTERRAT RSSI', checked=True)
                flx.Label(text='Your Algorithm: ')
                with flx.VBox():
                    self.msg_edit = flx.TextAreaEdit(
                        flex=1,
                        placeholder_text=
                        'Enter code to simulate...\npress Shift+Enter to submit'
                    )

        self.text = ''

        self.log = flx.relay.stock_list[0]
        print(self.log)
        self.LTE_ENV = LTE_Environment(flx.relay.ROOT_PATH + '/' + self.log)
        self.UMTS_ENV = UMTS_Environment(flx.relay.ROOT_PATH + '/' + self.log)
        self.GSM_ENV = GSM_Environment(flx.relay.ROOT_PATH + '/' + self.log)

        self.UE = UE_Configuration(WEB_SIM_FILE_PATH,
                                   [LTE_ENV, UMTS_ENV, GSM_ENV])

        self.Agent = AgentClass(
            webview=self.view,
            env_ls=[self.LTE_ENV, self.UMTS_ENV, self.GSM_ENV],
            ue=self.UE)