def init(self): with flx.HBox(flex=1, style="background: #e6e6df;"): with flx.FormLayout(flex=1): flx.Widget(minsize=20) self.heading = flx.LineEdit(title="Heading", text="") self.pitch = flx.LineEdit(title="Pitch", text="") self.roll = flx.LineEdit(title="Roll", text="") flx.Widget(minsize=40) with flx.FormLayout(flex=1): flx.Widget(minsize=20) self.depth = flx.LineEdit(title="Depth", text="") self.xpos = flx.LineEdit(title="X", text="") self.ypos = flx.LineEdit(title="Y", text="") flx.Widget(minsize=40) with flx.FormLayout(flex=1): flx.Widget(minsize=20) self.xvel = flx.LineEdit(title="X vel", text="") self.yvel = flx.LineEdit(title="Y vel", text="") self.zvel = flx.LineEdit(title="Z vel", text="") flx.Widget(minsize=40) with flx.FormLayout(flex=1): flx.Widget(minsize=20) self.gps_status = flx.LineEdit(title="GPS Status", text="") self.dvl_status = flx.LineEdit(title="DVL Status", text="") self.battery_status = flx.LineEdit(title="Battery level", text="") flx.Widget(minsize=40) with flx.FormLayout(flex=1): flx.Widget(minsize=20) self.vbs_fb = flx.LineEdit(title="VBS fb", text="") self.lcg_fb = flx.LineEdit(title="LCG fb", text="") self.rpm_fb = flx.LineEdit(title="RPM fb", text="") flx.Widget(minsize=40) # We subscribe to these topics at full frquency (no extra arg) self.subscribe("/sam/core/gps", "sensor_msgs/NavSatFix", self.gps_callback) self.subscribe("/sam/core/battery_fb", "sensor_msgs/BatteryState", self.battery_callback) # We only subscribe to these topics at 1hz self.subscribe("/sam/dr/odom", "nav_msgs/Odometry", self.odom_callback, 1.) self.subscribe("/sam/core/vbs_fb", "sam_msgs/PercentStamped", self.vbs_callback, 1.) self.subscribe("/sam/core/lcg_fb", "sam_msgs/PercentStamped", self.lcg_callback, 1.) self.subscribe("/sam/ctrl/depth_feedback", "std_msgs/Float64", self.depth_callback, 1.) self.subscribe("/sam/ctrl/pitch_feedback", "std_msgs/Float64", self.pitch_callback, 1.) self.subscribe("/sam/ctrl/roll_feedback", "std_msgs/Float64", self.roll_callback, 1.) self.subscribe("/sam/ctrl/yaw_feedback", "std_msgs/Float64", self.yaw_callback, 1.)
def init(self): with flx.HFix(): with flx.FormLayout() as self.form: self.b1 = flx.LineEdit(title='Name:', text='Hola') self.b2 = flx.LineEdit(title='Age:', text='Hello world') self.b3 = flx.LineEdit(title='Favorite color:', text='Foo bar') flx.Button(text='Submit') with flx.FormLayout() as self.form: self.b4 = flx.LineEdit(title='Name:', text='Hola') self.b5 = flx.LineEdit(title='Age:', text='Hello world') self.b6 = flx.LineEdit(title='Favorite color:', text='Foo bar') flx.Button(text='Submit') flx.Widget(flex=1) # Add a spacer
def init(self): self.set_title("MODEL PARAMTERS") with flx.FormLayout() as self.model_params_form: flx.Widget(flex=1) self.exterior_wall = flx.LineEdit( title='Exterior Wall', text='{}'.format(tuple(self.root.exterior_wall_tuple))) self.exterior_roof = flx.LineEdit( title='Exterior Roof', text='{}'.format(tuple(self.root.exterior_roof_tuple))) self.exterior_window = flx.LineEdit(title='Exterior Window', text='{}'.format( tuple(self.root.exterior_window_tuple))) self.eastrate = flx.LineEdit( title='East winwall ratio', text='{}'.format(tuple(self.root.eastrate_tuple))) self.westrate = flx.LineEdit( title='West winwall ratio', text='{}'.format(tuple(self.root.westrate_tuple))) self.southrate = flx.LineEdit( title='South winwall ratio', text='{}'.format(tuple(self.root.southrate_tuple))) self.northrate = flx.LineEdit( title='North winwall ratio', text='{}'.format(tuple(self.root.northrate_tuple))) self.direction = flx.LineEdit( title='direction(deg)', text='{}'.format(tuple(self.root.direction_tuple))) self.airchange = flx.LineEdit( title='airchange', text='{}'.format(tuple(self.root.airchange_tuple))) self.cop = flx.LineEdit( title='cop', text='{}'.format(tuple(self.root.cop_tuple))) self.east_shading = flx.LineEdit( title='east shading', text='{}'.format(tuple(self.root.east_shading_tuple))) self.west_shading = flx.LineEdit( title='west shading', text='{}'.format(tuple(self.root.west_shading_tuple))) self.south_shading = flx.LineEdit( title='south shading', text='{}'.format(tuple(self.root.south_shading_tuple))) self.north_shading = flx.LineEdit( title='north shading', text='{}'.format(self.root.north_shading_tuple)) self.infiltration_airchange = flx.LineEdit( title='infiltration airchange', text='{}'.format(self.root.infiltration_airchange_tuple)) flx.Widget(flex=1)
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)
def init(self, parent, descs): super().init(descs) self._parent = parent with flx.VBox(flex=1): self.lbl_title = flx.Label(css_class="center", text="protocol") with flx.VSplit(flex=1): self._cont = flx.FormLayout() self.pnl_dump = PanelDump(flex=1)
def init(self): self.set_title("PATHS") with flx.FormLayout() as self.path_constants_model: self.weather_file = flx.LineEdit( title='Weather File', text='{}'.format(self.root.weather_file_str)) self.idf_file = flx.LineEdit( title='Idf file', text='{}'.format(self.root.idf_file_str)) self.output_path = flx.LineEdit( title='Output directory', text='{}'.format(self.root.output_path_str))
def init(self): with flx.FormLayout(flex=1, maxsize=400): self.type_message = flx.LineEdit(title="Message to send:", text="") self.send_message = flx.Button(text="Publish message") self.receive_message = flx.Label(title="Received message:", text="Waiting for message...") self.announce_publish("/test_topic", "std_msgs/String") self.subscribe("/test_topic", "std_msgs/String", self.callback)
def init(self, server_name): self.is_init = False self.react = self.reaction(self._callback, "!root." + server_name.replace("/", "_")) with flx.GroupWidget(title=server_name): self.vbox = flx.FormLayout(flex=1) self.root.announce_reconfig(server_name)
def init(self): self.set_title("ALGORITHM PARAMETERS") with flx.FormLayout() as self.algo_params_model: self.mutation_param = flx.LineEdit( title='Mutation Parameter', text='{}'.format(int(self.root.mutation_param_int))) self.num_of_generation = flx.LineEdit( title='Num of genertion', text='{}'.format(int(self.root.num_of_generation_int))) self.num_of_individual = flx.LineEdit( title='Num of individual', text='{}'.format(int(self.root.num_of_individual_int))) self.num_of_tour_particps = flx.LineEdit( title='Num of tournament participents', text='{}'.format(int(self.root.num_of_tour_particps_int))) self.max_proc = flx.LineEdit( title='max process in parallel', text='{}'.format(int(self.root.max_proc_int)))
def init(self): self.set_title("CONSTANTS") with flx.FormLayout(flex=1) as self.other_constants_model: self.floor_height = flx.LineEdit( title='Floor Height', text='{}'.format(int(self.root.floor_height_float))) self.window_height = flx.LineEdit( title='Window Height', text='{}'.format(int(self.root.window_height_float))) self.window_edge_height = flx.LineEdit( title='Window edge height', text='{}'.format(int(self.root.window_edge_height_float))) self.heating_setpoint = flx.LineEdit( title='Heating setpoint', text='{}'.format(int(self.root.heating_setpoint_float))) self.cooling_setpoint = flx.LineEdit( title='Cooling setpoint', text='{}'.format(int(self.root.cooling_setpoint_float)))
def init(self): with flx.FormLayout(): with flx.TreeWidget(flex=2, title='Defaults:'): self.defaults = [] for i in range(max_scheduled): self.defaults[i] = flx.TreeItem(checked=False) self.defaults[i].set_visible(False) flx.Widget(flex=1) with flx.TreeWidget(title='Screens', max_selected=0) as self.screens: self.screens = [] for i in range(screen_num): self.screens[i] = flx.TreeItem(checked=False) self.screens[i].set_visible(False) self.update_screens() self.add_button = flx.Button(text='Add New Default')
def init(self, server_name, server_type): self.is_init = False self.server_name = server_name with flx.GroupWidget(title=server_name, flex=1): with flx.FormLayout(flex=1): self.arguments = flx.LineEdit(title="Args", text="") self.feedback = flx.LineEdit(title="Feedback", text="") self.result = flx.LineEdit(title="Result", text="") self.send_goal = flx.Button(text="Send goal") flx.Widget(minsize=40) self.reaction(self._prototype_callback, "!root." + server_name.replace("/", "_") + "_prototype") self.announce_action_client(server_name, server_type)
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): 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)
def init(self, name, topic, topic_type, actuator_settings): self.topic = topic with flx.GroupWidget(title=name, flex=1): with flx.FormLayout(flex=1): self.sliders = [] self.members = [] for settings in actuator_settings: self.sliders.append( flx.Slider(title=settings["name"], min=settings["min"], max=settings["max"], value=0)) if "type" in settings: self.members.append( (settings["member"], settings["type"])) else: self.members.append((settings["member"], "float")) #flx.Widget(minsize=10) self.announce_publish(topic, topic_type) self.subscribe(topic, topic_type, self._setpoint_callback)
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)
def init(self): with flx.FormLayout(): self.start = DatePicker(title='Start date') self.end = DatePicker(title='End date') flx.Widget(flex=1)
def init(self): with flx.FormLayout(): self.label = flx.Label(title='name:') flx.Widget(flex=1)
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)
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...")