示例#1
0
 def init(self):
     with flx.FormLayout() as self.form:
         self.update_button = flx.Button(text='Update JAR', flex=1)
         flx.Widget(flex=1)
         self.name = flx.LineEdit(title='Display Name')
         self.rotation = flx.ComboBox(title='Rotation:', options=rotations, selected_index=0)
         self.new_screen = flx.Button(text='Create New Display', flex=1)
示例#2
0
 def init(self):
     self.json = None
     with flx.FormLayout() as self.form:
         self.name = flx.ComboBox(title='Display Name:', options=screens)
         self.rotation = flx.ComboBox(title='Rotation:', options=rotations)
         flx.Widget(flex=1)
         with flx.TreeWidget(flex=2, title='Defaults:', max_selected = 1) as self.default_box:
             self.defaults = []
             for i in range(max_scheduled):
                 self.defaults[i] = flx.TreeItem(title=str(i), checked=False)
                 self.defaults[i].set_visible(False)
         with flx.TreeWidget(flex=2, title='Events:', max_selected = 1) as self.event_box:
             self.events = []
             for i in range(max_scheduled):
                 self.events[i] = flx.TreeItem(title=str(i), checked=False)
                 self.events[i].set_visible(False)
         self.delete = flx.Button(text='Delete Selected Entries')
         self.revert = flx.Button(text='Revert Changes')
         self.upload = flx.Button(text='Save and Upload')
         flx.Widget(flex=5)
示例#3
0
 def init(self):
     with flx.VBox():
         self.root.set_status('Sniffing')
         with flx.HBox():
             iface = self.root.pnl_config.get_section_config(
                 "common", "iface", "lo")
             if ifnames.count(iface) == 0:
                 iface = "lo"
             self.iface = flx.ComboBox(options=ifnames,
                                       flex=2,
                                       selected_key=iface)
             self.start_stop = flx.Button(text="start", flex=1)
             flx.Label(text="", flex=6)
         self.view = PanelRxView(flex=1)
示例#4
0
    def init(self):
        self.nsamples = 200
        self.start_time = time()
        self.status = flx.Label(text='...')
        self.plot_num = 3
        self.plot = []
        self.plot_combobox = []
        self.plot_label = []
        self.plot_latest_val = []
        self.latest_params_names = {}
        self.latest_params_values = {}


        with flx.HSplit(flex=1):
            with flx.GroupWidget(flex=1, title="Plot options", minsize=(270,0)):  
                    with flx.VBox():
                        self.buttons = {}
                        button_list = list(SolarData.commands.keys())
                        for button_name in button_list:
                            with flx.HBox():    
                                self.buttons[button_name] = flx.Button(text=button_name)
                                setattr(self.buttons[button_name],'button_action', button_name)
                                self.buttons[button_name].reaction(self._on_button_pressed, 'pointer_click')
                                self.buttons[button_name].reaction(self._on_button_down, 'pointer_down')
                                self.buttons[button_name].reaction(self._on_button_up, 'pointer_up')
                                flx.Widget(flex=1)

                        for i in range(0, self.plot_num):
                            with flx.HBox():
                                self.plot_combobox[i] = flx.ComboBox(options=list(SolarData.params.keys()), editable=False, selected_index=i) 
                                self.plot_combobox[i].reaction(self.combobox_changed, 'user_selected')
                                self.plot_label[i] = flx.Label(text='Value:')
                                self.plot_latest_val[i] = flx.Label(text='')
                                flx.Widget(flex=1)

                        for i in range(0, len(SolarData.params.keys())):
                            with flx.HBox():
                                name = list(SolarData.params.keys())[i]
                                self.latest_params_names[name] = flx.Label(text='{0}:'.format(name))
                                self.latest_params_values[name] = flx.Label(text='NaN')
                                flx.Widget(flex=1)

                        flx.Widget(flex=1)

            with flx.VBox(flex=4):
                for i in range(0, self.plot_num):
                    self.plot[i] = flx.PlotWidget(flex=1, minsize=(270,0), style='width: 640px; height: 320px;',xdata=[], yrange=(0, 100),ylabel='Plot ' + str(i+1))
                    self.update_plot_range(i)
示例#5
0
    def init(self):

        combo_options = ['Paris', 'New York', 'Enschede', 'Tokio']

        with flx.HBox():
            self.tree = TreeWithControls(flex=1, max_selected=1)
            self.combo = flx.ComboBox(flex=1,
                                      options=combo_options,
                                      editable=True)

        with self.tree:
            for cat in ('foo', 'bar', 'spam'):
                with flx.TreeItem(text=cat):
                    for name in ('Martin', 'Kees', 'Hans'):
                        item = flx.TreeItem(title=name)
                        item.set_checked(cat == 'foo' or None)
示例#6
0
文件: twente.py 项目: Ph0enixxx/flexx
    def init(self):

        with flx.HFix():
            flx.Widget(flex=1)
            with flx.VBox(flex=0, style='min-width:200px'):
                with flx.GroupWidget(title='Plot options'):
                    flx.Label(text='Month')
                    self.month = flx.ComboBox(options=months,
                                              selected_index=12,
                                              style='width: 100%')
                    self.smoothing_label = flx.Label(text='Smoothing')
                    self.smoothing = flx.Slider(max=20,
                                                step=2,
                                                text='{value} samples')
                flx.Widget(flex=3)
            with flx.VBox(flex=4):
                self.plot = flx.PlotWidget(flex=1,
                                           xdata=years,
                                           yrange=(-5, 20),
                                           title='Average monthly temperature',
                                           xlabel='year',
                                           ylabel=u'temperature (°C)')
            flx.Widget(flex=1)
示例#7
0
 def init(self):
     with flx.FormLayout() as self.form:
         self.browse = flx.Button(text='Select Media File to Upload')
         self.name = flx.LineEdit(title='Name of Event:', text='')
         self.type = flx.ComboBox(title='Type of Media', options=types, selected_index=0)
         self.media = flx.ComboBox(title='Media File:', options=medias)
示例#8
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)