def init(self): self.box = [] with flx.VBox( flex=1, style='border:2px solid gray;border-radius: 5px;text-align:left' ): with flx.HFix(flex=1, style='text-align:left'): flx.Label(text='Testpmd args:') self.cb_as = flx.CheckBox(text="auto-start") self.cb_crc = flx.CheckBox(text="disable-crc-strip") self.cb_fia = flx.CheckBox(text="flow-isolate-all") with flx.HBox(flex=1): ui.Label(text='--rxq:', flex=0) self.rxq = ui.LineEdit(text='1', flex=1) ui.Label(flex=1, text='') ui.Label(text='--rxd:', flex=0) self.rxd = ui.LineEdit(text='64', flex=1) ui.Label(flex=1, text='') ui.Label(text='--txq:', flex=0) self.txq = ui.LineEdit(text='1', flex=1) ui.Label(flex=1, text='') ui.Label(text='--txd:', flex=0) self.txd = ui.LineEdit(text='64', flex=1) ui.Label(flex=1, text='') ui.Label(text='--hairpin:', flex=0) self.hairpin = ui.LineEdit(text='0', flex=1) with flx.HFix(flex=1, style=' text-align:left'): self.cmdline = ui.Label(text='testpmd cmdline:', flex=10) self.start = flx.Button(text='start', flex=1)
def init(self): with flx.VBox( style='border:2px solid gray;border-radius: 5px; align:left'): with flx.VBox(style='border:2px solid gray;border-radius: 5px'): with flx.HSplit(flex=1, style='text-align:left;'): ui.Label(text='vxlan encap data:') ui.Label(text='eth src:') self.eth_src = ui.LineEdit(text='0') ui.Label(text='eth dst:') self.eth_dst = ui.LineEdit(text='0') ui.Label(text='eth type:') self.eth_type = ui.LineEdit(text='0x0800') ui.Label(text='ip src:') self.ip_src = ui.LineEdit(text='0') ui.Label(text='ip dst:') self.ip_dst = ui.LineEdit(text='0') ui.Label(text='udp src:') self.udp_src = ui.LineEdit(text='0') ui.Label(text='udp dst:') self.udp_dst = ui.LineEdit(text='4789') ui.Label(text='vni:') self.vni = ui.LineEdit(text='123') with flx.HBox(): self.encap_disp = ui.Label(text='encap_data:') with flx.HSplit(): self.smacs = flx.CheckBox(text="set_mac_src", flex=2) self.smacs_v = ui.LineEdit(text='192.168.1.2', flex=2) self.smacd = flx.CheckBox(text="set_mac_dst", flex=2) self.smacd_v = ui.LineEdit(text='192.168.1.5', flex=2) self.sip4s = flx.CheckBox(text="set_ipv4_src", flex=2) self.sip4s_v = ui.LineEdit(text='192.168.1.2', flex=2) self.sip4d = flx.CheckBox(text="set_ipv4_dst", flex=2) self.sip4d_v = ui.LineEdit(text='192.168.1.5', flex=2) self.stps = flx.CheckBox(text="set_tp_src", flex=2) self.stps_v = ui.LineEdit(text='3456', flex=1) self.stpd = flx.CheckBox(text="set_tp_dst", flex=2) self.stpd_v = ui.LineEdit(text='3446', flex=1) with flx.HBox(): self.cnt = flx.CheckBox(text="count") self.decap = flx.CheckBox(text="vxlan_decap") self.encap = flx.CheckBox(text="vxlan_encap") self.stag = flx.CheckBox(text="set_tag") self.stag_v = ui.LineEdit(text='12') self.fate = ui.ComboBox(editable=True, selected_key='jump', options=('jump', 'drop', 'rss', 'queue', 'port id')) self.fate_v = ui.LineEdit(text='2') self.add = flx.Button(text='add') with flx.HBox(): self.flow_detail = ui.Label(text="Flow to be added")
def init(self): with flx.HBox(): with flx.VBox(flex=0, minsize=150): self.b1 = flx.RadioButton(text='Linear') self.b2 = flx.RadioButton(text='Basis') self.b3 = flx.RadioButton(text='Cardinal', checked=True) self.b4 = flx.RadioButton(text='Catmull Rom') self.b5 = flx.RadioButton(text='Lagrange') self.b6 = flx.RadioButton(text='Lanczos') flx.Widget(minsize=10) closed = flx.CheckBox(text='Closed') flx.Widget(minsize=10) self.tension = flx.Slider(min=-0.5, max=1, value=0.5, text=lambda: 'Tension: {value}') flx.Widget(flex=1) with flx.VBox(flex=1): flx.Label(text=GENERAL_TEXT, wrap=True, style='font-size: 12px;') self.explanation = flx.Label(text=CARDINAL_TEXT, wrap=True, style='font-size: 12px;') self.spline = SplineWidget(flex=1, closed=lambda: closed.checked, tension=lambda: self.tension.value)
def init(self): self.box = [] with flx.VBox(flex=1, title='EAL args', style='border:2px solid gray;border-radius: 5px'): with flx.HBox(): ui.Label(flex=1, text='EAL args: ') ui.Label(flex=0, text='--master-lcore:') self.mc = ui.LineEdit(flex=2, text='0') ui.Label(flex=1, text='') ui.Label(flex=0, text=" -c COREMASK:") self.cm = ui.LineEdit(flex=2, text='0xff') ui.Label(flex=1, text='') ui.Label(flex=0, text=' --file-prefix:') self.fp = ui.LineEdit(flex=2, text='/tmp/') self.nohp = flx.CheckBox(flex=2, text='--no-huge') self.hpunlink = flx.CheckBox(flex=2, text='--huge-unlink')
def init(self): with flx.HBox(): self.leaflet = LeafletWidget( flex=1, center=(52, 4.1), zoom=12, show_scale=lambda: self.cbs.checked, show_layers=lambda: self.cbl.checked, ) with flx.VBox(): self.btna = flx.Button(text='Add SeaMap') self.btnr = flx.Button(text='Remove SeaMap') self.cbs = flx.CheckBox(text='Show scale') self.cbl = flx.CheckBox(text='Show layers') self.list = flx.VBox() flx.Widget(flex=1) self.leaflet.add_layer('http://a.tile.openstreetmap.org/', 'OpenStreetMap')
def init(self): self.box = [] with flx.HSplit(flex=1, style='border:2px solid gray;border-radius: 5px'): with flx.VBox(flex=1): flx.Label(text=' ', flex=1) flx.Label(text='Device List', flex=1) flx.Label(text=' ', flex=1) with flx.VBox(flex=3): for i, dev in enumerate(self.root.interface_list): txt = " PCI_ID: " + self.root.pci_list[ i] + " mac: " + self.root.mac_list[i].upper( ) + "Interface: " + dev self.box.append(flx.CheckBox(text=txt))
def init(self, name, actuator_type, setpoint_topic, feedback_topic, cont_enable_topic, cont_setpoint_topic, cont_min, cont_max, is_angles=False): self.setpoint_topic = setpoint_topic self.cont_setpoint_topic = cont_setpoint_topic self.cont_enable_topic = cont_enable_topic self.is_angles = is_angles with flx.GroupWidget(title=name, flex=1): with flx.FormLayout(flex=1): flx.Label(text="Actuator setpoint") if is_angles: self.set_slider = flx.Slider(title="0", min=-1.6, max=1.6) self.set_slider2 = flx.Slider(title="0", min=-1.6, max=1.6) else: self.set_slider = flx.Slider(title="50", min=0, max=100, value=50) flx.Label(text="Controller setpoint") self.enable_cont = flx.CheckBox(title="Enabled") self.enable_cont.set_checked(True) self.cont_slider = flx.Slider(title="0", min=cont_min, max=cont_max, value=0) flx.Widget(minsize=20) self.announce_publish(setpoint_topic, actuator_type) self.announce_publish(cont_setpoint_topic, "std_msgs/Float64") self.announce_publish(cont_enable_topic, "std_msgs/Bool") self.subscribe(setpoint_topic, actuator_type, self._setpoint_callback) self.subscribe(cont_setpoint_topic, "std_msgs/Float64", self._cont_callback) self.subscribe(cont_enable_topic, "std_msgs/Bool", self._enable_callback) if is_angles: self.reaction(self._setpoint_slider, "set_slider2.user_done")
def init(self): with flx.FormLayout(flex=1, maxsize=400): self.type_message = flx.CheckBox(title="Checked?") self.send_message = flx.Button(text="Request service") self.receive_message = flx.Label(title="Response:", text="Waiting for response...")