예제 #1
0
def edit_identity_cards(identity_cards,matrix,desktop):

    windows=guizero.Window(desktop,layout='grid',title='Edit',visible=False)
    road={}
    text_box=guizero.TextBox(windows,grid=[20,0],width=45,enabled=False)
    end = guizero.PushButton(windows, grid=[20, 1], text='End',command=lambda: save_(identity_cards, road, matrix, windows))
    directs=guizero.Combo(windows,options=["up", "down", "left","right"],grid=[20,2])
    option=guizero.PushButton(windows,grid=[20,4],text='Nome')

    y=14
    for i in range(15):
        for x in range(20):
            dictionary = {'X': 'black', 'o': 'green', ' ': 'white', 'v': 'yellow'}
            road[x,y]=box(x,i,identity_cards[x,y],windows,text_box,directs,option)
            road[x,y].step.bg=dictionary[matrix[x,y]]
        y-=1

    windows.show(wait=True)
예제 #2
0
#!/usr/bin/env python3

import guizero

app = guizero.App(title="My second GUI app",
                  width=300,
                  height=200,
                  layout="grid")

combo_label = guizero.Text(app, text="Which film?", grid=[0, 0], align='left')
film_choice = guizero.Combo(app,
                            options=['Star Wars', 'Frozen', 'Lion King'],
                            grid=[1, 0],
                            align="left")

cbox_label = guizero.Text(app, text="Seat Type", grid=[0, 1], align='left')
vip_seat = guizero.CheckBox(app, text="VIP seat?", grid=[1, 1], align='left')

row_choice = guizero.ButtonGroup(app,
                                 options=[["Front", "F"], ["Middle", "M"],
                                          ["Back", "B"]],
                                 selected="M",
                                 horizontal=True,
                                 grid=[1, 2],
                                 align="left")


def do_booking():
    print(film_choice.value)
    print(vip_seat.value)
    print(row_choice.value)
예제 #3
0
        "byteSize": serial.EIGHTBITS
    },
    "FT-817ND": {
        "TX": bytes([10, 10, 10, 10, 8]),
        "RX": bytes([10, 10, 10, 10, 136]),
        "Baud": ["4800", "9600", "38400"],
        "stopBits": serial.STOPBITS_TWO,
        "parity": serial.PARITY_NONE,
        "byteSize": serial.EIGHTBITS
    }
}

root = guizero.App(title="rts2cat", layout="grid", width=219, height=166)
radioLabel = guizero.Text(root, text="Radio: ", grid=[0, 0], align="left")
radioSelection = guizero.Combo(root,
                               options=radioOptions,
                               grid=[1, 0],
                               align="left")


def updateTick():

    if radioBaudSelection._options != radioCommands[
            radioSelection.value]["Baud"]:

        radioBaudSelection._options = radioCommands[
            radioSelection.value]["Baud"]

        radioBaudSelection._refresh_options()

    if radioSelection.value == "":
    def __init__(self, app, ip_selection, current_config):
        self.ip_selection = ip_selection
        self.current_config = current_config

        self.window = guizero.Window(app,
                                     title="Sensors Configuration",
                                     width=625,
                                     height=385,
                                     layout="grid",
                                     visible=False)

        self.text_select = guizero.Text(
            self.window,
            text="Select Sensor IPs in the main window",
            grid=[1, 1, 3, 1],
            color='#CB0000',
            align="left")

        self.textbox_config = guizero.TextBox(
            self.window,
            text=app_variables.default_sensor_config_text.strip(),
            grid=[1, 2],
            width=75,
            height=18,
            multiline=True,
            scrollbar=True,
            align="right")

        self.button_get_config = guizero.PushButton(
            self.window,
            text="Get Sensor\nConfiguration",
            command=self.button_get,
            grid=[1, 10],
            align="left")

        self.text_select_combo = guizero.Text(
            self.window,
            text="Select Configuration File to Edit",
            grid=[1, 10],
            color='blue',
            align="top")

        self.combo_dropdown_selection = guizero.Combo(
            self.window,
            options=[
                "Configuration", "Installed Sensors", "Wifi",
                "Trigger Variances"
            ],
            grid=[1, 10],
            command=self.combo_selection,
            align="bottom")

        self.button_set_config = guizero.PushButton(
            self.window,
            text="Set Sensor\nConfiguration",
            command=self.button_set,
            grid=[1, 10],
            align="right")

        # Window Tweaks
        self.window.tk.resizable(False, False)
        self.textbox_config.bg = "black"
        self.textbox_config.text_color = "white"
        self.textbox_config.tk.config(insertbackground="red")
예제 #5
0
    #    t += volumen*pump_ml_to_s
    #print(ingredients)
    
    
=======

    #    print('for ' + (volumen*pump_ml_to_s)-t + ' sec')
    #    t += volumen*pump_ml_to_s
    #print(ingredients)

>>>>>>> e1856f4529bc40e669bdbe2a7f00bc1255faaf09



drinks = MyDrinks.FinalDrinksList()
#print(drinks)

drinknames = [drinkid[1] for drinkid in drinks]

<<<<<<< HEAD
app = guizero.App(title="BartenderTron 3000")
=======
app = guizero.App(title="Bartendertron3000")
>>>>>>> e1856f4529bc40e669bdbe2a7f00bc1255faaf09

drink_choice = guizero.Combo(app, options=drinknames, grid=[1,0], align="left")

choice_drink = guizero.PushButton(app, command=PressDrinkButton, text="Pour drink", grid=[1,3], align="left")

app.display()
    def __init__(self):
        self.current_config = app_config.get_from_file()

        self.app = guizero.App(title="KootNet Sensors - Control Center",
                               width=405,
                               height=295,
                               layout="grid")

        self.app.on_close(self._app_exit)

        self.text_download_db = "Download SQL Databases"
        self.text_system_report = "Systems Report"
        self.text_configuration_report = "Configurations Report"
        self.text_test_sensors = "Sensors Test Report"

        self.ip_selection = CreateIPSelector(self.app, self.current_config)
        self._set_ip_list()

        self.window_control_center_config = CreateConfigWindow(
            self.app, self.current_config, self.ip_selection)
        self.window_sensor_display = CreateSensorDisplayWindow(
            self.app, self.ip_selection, self.current_config)
        self.window_sensor_commands = CreateSensorCommandsWindow(
            self.app, self.ip_selection, self.current_config)
        self.window_sensor_config = CreateSensorConfigWindow(
            self.app, self.ip_selection, self.current_config)
        self.window_sensor_logs = CreateSensorLogsWindow(
            self.app, self.ip_selection, self.current_config)
        self.window_graph = CreateGraphingWindow(self.app, self.ip_selection,
                                                 self.current_config)
        self.window_db_info = CreateDataBaseInfoWindow(self.app,
                                                       self.current_config)
        self.window_sensor_notes = CreateDataBaseNotesWindow(
            self.app, self.ip_selection, self.current_config, "sensor")
        self.window_db_notes = CreateDataBaseNotesWindow(
            self.app, self.ip_selection, self.current_config, "database")
        self.window_about = CreateAboutWindow(self.app)

        self.app_menubar = guizero.MenuBar(
            self.app,
            toplevel=["File", "Sensors", "Graphing & Databases", "Help"],
            options=[
                [[
                    "Control Center Configuration",
                    self.window_control_center_config.window.show
                ], ["Open Logs", self._app_menu_open_logs],
                 [
                     "Save IP List",
                     self.window_control_center_config.save_ip_list
                 ], ["Reset IP List", self._reset_ip_list],
                 ["Quit", self._app_exit]],
                [["Remote Display", self.window_sensor_display.window.show],
                 ["View & Download Logs", self.window_sensor_logs.window.show],
                 ["Online Notes Editor", self.window_sensor_notes.window.show],
                 ["Send Commands", self.window_sensor_commands.window.show],
                 [
                     "Update Configurations",
                     self.window_sensor_config.window.show
                 ]],
                [["Graphing", self.window_graph.window.show],
                 ["DataBase Info", self.window_db_info.window.show],
                 ["Offline Notes Editor", self.window_db_notes.window.show]],
                [["KootNet Sensors - About", self.window_about.window.show],
                 ["KootNet Sensors - Website", self._app_menu_open_website],
                 [
                     "Sensor Units - Making a Sensor",
                     self._app_menu_open_build_sensor
                 ], ["Sensor Units - Help", self._app_menu_open_sensor_help],
                 [
                     "Control Center - Help",
                     self._app_menu_open_control_center_help
                 ]]
            ])

        self.app_button_check_sensor = guizero.PushButton(
            self.app,
            text="Check Sensors\nStatus",
            command=self.ip_selection.get_verified_ip_list,
            grid=[1, 15, 2, 1],
            align="left")

        self.combo_dropdown_selection = guizero.Combo(
            self.app,
            options=[
                self.text_system_report, self.text_configuration_report,
                self.text_test_sensors, self.text_download_db
            ],
            command=self._app_dropdown_change,
            grid=[2, 15, 3, 1],
            align="bottom")

        self.app_button_main_create = guizero.PushButton(
            self.app,
            text="Create",
            command=self._app_button_proceed,
            grid=[4, 15],
            align="right")

        # Window Tweaks
        self.app.tk.resizable(False, False)
    def __init__(self, app, ip_selection, current_config):
        self.ip_selection = ip_selection
        self.current_config = current_config

        self.text_upgrades_smb = "Regular SMB"
        self.text_upgrades_http = "Regular HTTP"
        self.text_upgrades_smb_dev = "Development SMB"
        self.text_upgrades_http_dev = "Development HTTP"
        self.text_upgrades_os = "Operating System"

        self.text_power_restart_services = "Restart Services"
        self.text_power_reboot = "Reboot"
        self.text_power_shutdown = "Shutdown"

        self.text_system_change_name = "Change Sensors Names"
        self.text_system_check_dependencies = "Check Dependencies"
        self.text_system_sync_clock = "Sync Date & Time"
        self.text_system_clear_log_primary = "Clear Primary Log"
        self.text_system_clear_log_network = "Clear Network Log"
        self.text_system_clear_log_sensors = "Clear Sensors Log"

        self.window = guizero.Window(app,
                                     title="Sensor Commands",
                                     width=280,
                                     height=240,
                                     layout="grid",
                                     visible=False)

        self.text_select = guizero.Text(
            self.window,
            text="Select Sensor IPs in the main window",
            grid=[1, 1],
            color='#CB0000',
            align="left")

        self.text_upgrade = guizero.Text(self.window,
                                         text="Upgrade Commands",
                                         grid=[1, 2],
                                         color='blue',
                                         align="left")

        self.upgrade_dropdown_selection = guizero.Combo(
            self.window,
            options=[
                self.text_upgrades_http, self.text_upgrades_smb,
                self.text_upgrades_http_dev, self.text_upgrades_smb_dev,
                self.text_upgrades_os
            ],
            grid=[1, 3],
            align="left")

        self.button_upgrade_proceed = guizero.PushButton(
            self.window,
            text="Proceed",
            command=self._proceed_upgrade,
            grid=[1, 3],
            align="right")

        self.text_power = guizero.Text(self.window,
                                       text="Power Commands",
                                       grid=[1, 24],
                                       color='blue',
                                       align="left")

        self.power_dropdown_selection = guizero.Combo(
            self.window,
            options=[
                self.text_power_restart_services, self.text_power_reboot,
                self.text_power_shutdown
            ],
            grid=[1, 25],
            align="left")

        self.button_power_proceed = guizero.PushButton(
            self.window,
            text="Proceed",
            command=self._proceed_power,
            grid=[1, 25],
            align="right")

        self.text_other = guizero.Text(self.window,
                                       text="System Commands",
                                       grid=[1, 36],
                                       color='blue',
                                       align="left")

        self.system_dropdown_selection = guizero.Combo(
            self.window,
            options=[
                self.text_system_change_name,
                self.text_system_check_dependencies,
                self.text_system_sync_clock,
                self.text_system_clear_log_primary,
                self.text_system_clear_log_network,
                self.text_system_clear_log_sensors
            ],
            grid=[1, 37],
            align="left")

        self.button_system_proceed = guizero.PushButton(
            self.window,
            text="Proceed",
            command=self._proceed_system,
            grid=[1, 37],
            align="right")

        # Window Tweaks
        self.window.tk.resizable(False, False)
예제 #8
0
                           height=60)
graph_button_box.tk.config(pady=15)
graph_button = gui.PushButton(graph_button_box,
                              open_graph_url,
                              text='Go to my graph!',
                              pady=5)

graph_id_box = gui.Box(graph_properties_box, grid=[2, 0], width=150, height=60)
graph_id_text = gui.Text(graph_id_box,
                         text='Graph ID: ',
                         size=11,
                         color='red',
                         align='left')
graph_name_combo = gui.Combo(graph_id_box,
                             options=['graph1', 'test1'],
                             selected='graph1',
                             width=11,
                             align='right')

# # Pixel Options Box
pixel_options_box = gui.Box(app, grid=[0, 2], width=170, height=140)

pixel_options_box_heading = gui.Text(pixel_options_box,
                                     text='Pixel Options:',
                                     size=11,
                                     color='red')
pixel_options_box_heading.tk.config(pady=12)
pixel_options = gui.ButtonGroup(pixel_options_box,
                                options=[['Add a pixel', 'add'],
                                         ['Modify a pixel', 'modify'],
                                         ['Delete a pixel', 'delete']],