コード例 #1
0
    def __init__(self, screen_manager, localization):

        self.systemtools_sm = screen_manager
        self.l = localization

        description = (
            self.l.get_str("The developer app is to help our engineers access extra settings and " + \
                "functions that might not be stable, or change how SmartBench behaves.") + \
            " " + \
            self.l.get_str("By using the developer app, you may risk causing damage to SmartBench.") + \
            "\n" + \
            self.l.get_str("Please enter the password if you want to continue.")
            )

        title_string = self.l.get_str('Warning!')
        ok_string = self.l.get_bold('Ok')

        def check_password(*args):
            if textinput.text == "dev":
                self.systemtools_sm.open_developer_screen()

        img = Image(source="./asmcnc/apps/shapeCutter_app/img/error_icon.png",
                    allow_stretch=False)
        label = Label(size_hint_y=1,
                      text_size=(550, None),
                      halign='center',
                      valign='middle',
                      text=description,
                      color=[0, 0, 0, 1],
                      padding=[0, 0],
                      markup=True)
        textinput = TextInput(size_hint_y=0.7, text='')

        ok_button = Button(text=ok_string, markup=True)
        ok_button.background_normal = ''
        ok_button.background_color = [230 / 255., 74 / 255., 25 / 255., 1.]

        btn_layout = BoxLayout(orientation='horizontal',
                               spacing=10,
                               padding=[20, 0, 20, 0])
        btn_layout.add_widget(ok_button)

        layout_plan = BoxLayout(orientation='vertical',
                                spacing=10,
                                padding=[40, 10, 40, 10])
        layout_plan.add_widget(img)
        layout_plan.add_widget(label)
        layout_plan.add_widget(textinput)
        layout_plan.add_widget(btn_layout)

        popup = Popup(title=title_string,
                      title_color=[0, 0, 0, 1],
                      title_font='Roboto-Bold',
                      title_size='20sp',
                      content=layout_plan,
                      size_hint=(None, None),
                      size=(600, 400),
                      auto_dismiss=False)

        popup.separator_color = [230 / 255., 74 / 255., 25 / 255., 1.]
        popup.separator_height = '4dp'
        popup.background = './asmcnc/apps/shapeCutter_app/img/popup_background.png'

        ok_button.bind(on_press=check_password)
        ok_button.bind(on_press=popup.dismiss)

        popup.open()
コード例 #2
0
    def __init__(self, screen_manager, localization):

        self.systemtools_sm = screen_manager
        self.l = localization

        description = self.l.get_str(
            'Console needs to reboot to update language settings.')
        title_string = self.l.get_str('Information')
        ok_string = self.l.get_bold('Ok')
        cancel_string = self.l.get_bold('Cancel')

        def reboot_console(*args):
            self.systemtools_sm.sm.current = 'rebooting'

        img = Image(source="./asmcnc/apps/shapeCutter_app/img/info_icon.png",
                    allow_stretch=False)
        label = Label(size_hint_y=1.7,
                      text_size=(260, None),
                      halign='center',
                      valign='middle',
                      text=description,
                      color=[0, 0, 0, 1],
                      padding=[0, 0],
                      markup=True)

        ok_button = Button(text=ok_string, markup=True)
        ok_button.background_normal = ''
        ok_button.background_color = [76 / 255., 175 / 255., 80 / 255., 1.]
        back_button = Button(text=cancel_string, markup=True)
        back_button.background_normal = ''
        back_button.background_color = [230 / 255., 74 / 255., 25 / 255., 1.]

        btn_layout = BoxLayout(orientation='horizontal',
                               spacing=15,
                               padding=[0, 0, 0, 0])
        btn_layout.add_widget(back_button)
        btn_layout.add_widget(ok_button)

        layout_plan = BoxLayout(orientation='vertical',
                                spacing=10,
                                padding=[30, 20, 30, 0])
        layout_plan.add_widget(img)
        layout_plan.add_widget(label)
        layout_plan.add_widget(btn_layout)

        popup = Popup(title=title_string,
                      title_color=[0, 0, 0, 1],
                      title_font='Roboto-Bold',
                      title_size='20sp',
                      content=layout_plan,
                      size_hint=(None, None),
                      size=(300, 300),
                      auto_dismiss=False)

        popup.background = './asmcnc/apps/shapeCutter_app/img/popup_background.png'
        popup.separator_color = [249 / 255., 206 / 255., 29 / 255., 1.]
        popup.separator_height = '4dp'

        ok_button.bind(on_press=popup.dismiss)
        ok_button.bind(on_press=reboot_console)
        back_button.bind(on_press=popup.dismiss)

        popup.open()
コード例 #3
0
    def __init__(self, screen_manager, localization):

        self.systemtools_sm = screen_manager
        self.l = localization

        description = (
            self.l.get_str(
                "Beta testing allows our engineers and beta testers to try out software updates " + \
                "that might not be stable, or change how SmartBench behaves."
                ) + \
            "\n\n" + \
            self.l.get_str("By updating to a beta version or developer branch you may risk causing damage to SmartBench.") + \
            "\n\n" + \
            self.l.get_str("Do you want to continue?")
        )

        title_string = self.l.get_str('Warning!')
        ok_string = self.l.get_bold('Yes')
        back_string = self.l.get_bold('No')

        def dev_app(*args):
            self.systemtools_sm.open_beta_testing_screen()

        img = Image(source="./asmcnc/apps/shapeCutter_app/img/error_icon.png",
                    allow_stretch=False)
        label = Label(size_hint_y=2,
                      text_size=(410, None),
                      halign='center',
                      valign='middle',
                      text=description,
                      color=[0, 0, 0, 1],
                      padding=[0, 0],
                      markup=True)

        ok_button = Button(text=ok_string, markup=True)
        ok_button.background_normal = ''
        ok_button.background_color = [76 / 255., 175 / 255., 80 / 255., 1.]
        back_button = Button(text=back_string, markup=True)
        back_button.background_normal = ''
        back_button.background_color = [230 / 255., 74 / 255., 25 / 255., 1.]

        btn_layout = BoxLayout(orientation='horizontal',
                               spacing=15,
                               padding=[0, 10, 0, 0])
        btn_layout.add_widget(back_button)
        btn_layout.add_widget(ok_button)

        layout_plan = BoxLayout(orientation='vertical',
                                spacing=10,
                                padding=[30, 20, 30, 0])
        layout_plan.add_widget(img)
        layout_plan.add_widget(label)
        layout_plan.add_widget(btn_layout)

        popup = Popup(title=title_string,
                      title_color=[0, 0, 0, 1],
                      title_font='Roboto-Bold',
                      title_size='20sp',
                      content=layout_plan,
                      size_hint=(None, None),
                      size=(550, 400),
                      auto_dismiss=False)

        popup.separator_color = [230 / 255., 74 / 255., 25 / 255., 1.]
        popup.separator_height = '4dp'
        popup.background = './asmcnc/apps/shapeCutter_app/img/popup_background.png'

        ok_button.bind(on_press=popup.dismiss)
        ok_button.bind(on_press=dev_app)
        back_button.bind(on_press=popup.dismiss)

        popup.open()
コード例 #4
0
    def __init__(self, screen_manager, localization):

        self.systemtools_sm = screen_manager
        self.l = localization

        description = self.l.get_str(
            "Please enter the password to use the factory settings.")
        title_string = self.l.get_str('Warning!')
        ok_string = self.l.get_bold('Ok')

        def check_password(*args):
            if textinput.text == "fac":
                self.systemtools_sm.open_factory_settings_screen()

        img = Image(source="./asmcnc/apps/shapeCutter_app/img/error_icon.png",
                    allow_stretch=False)
        label = Label(size_hint_y=0.7,
                      text_size=(450, None),
                      halign='center',
                      valign='middle',
                      text=description,
                      color=[0, 0, 0, 1],
                      padding=[0, 0],
                      markup=True)
        textinput = TextInput(size_hint_y=1, text='')

        ok_button = Button(text=ok_string, markup=True)
        ok_button.background_normal = ''
        ok_button.background_color = [230 / 255., 74 / 255., 25 / 255., 1.]

        btn_layout = BoxLayout(orientation='horizontal',
                               spacing=10,
                               padding=[10, 0, 10, 0])
        btn_layout.add_widget(ok_button)

        layout_plan = BoxLayout(orientation='vertical',
                                spacing=5,
                                padding=[40, 10, 40, 10])
        layout_plan.add_widget(img)
        layout_plan.add_widget(label)
        layout_plan.add_widget(textinput)
        layout_plan.add_widget(btn_layout)

        popup = Popup(
            title=title_string,
            title_color=[0, 0, 0, 1],
            title_font='Roboto-Bold',
            title_size='20sp',
            content=layout_plan,
            size_hint=(None, None),
            size=(500, 260),
            auto_dismiss=False,
            pos_hint={
                'x': 150.0 / 800.0,
                'y': 200.0 / 480.0
            },
        )

        popup.separator_color = [230 / 255., 74 / 255., 25 / 255., 1.]
        popup.separator_height = '4dp'
        popup.background = './asmcnc/apps/shapeCutter_app/img/popup_background.png'

        ok_button.bind(on_press=check_password)
        ok_button.bind(on_press=popup.dismiss)

        popup.open()
コード例 #5
0
    def __init__(self, screen_manager, localization):

        self.systemtools_sm = screen_manager
        self.l = localization

        description = (
                self.l.get_str("If your USB stick is plugged into the console, please remove it now.") + \
                "\n\n" + \
                self.l.get_str("When you have removed it, press 'Ok'.") + \
                "\n\n" + \
                self.l.get_bold("WARNING: Not following this step could cause files to be deleted from your USB stick.")
                )
        title_string = self.l.get_str('Warning!')
        ok_string = self.l.get_bold('Ok')
        cancel_string = self.l.get_bold('Cancel')

        def clear_mountpoint(*args):
            self.systemtools_sm.clear_usb_mountpoint()

        img = Image(source="./asmcnc/apps/shapeCutter_app/img/error_icon.png",
                    allow_stretch=False)
        label = Label(size_hint_y=2,
                      text_size=(320, None),
                      halign='center',
                      valign='middle',
                      text=description,
                      color=[0, 0, 0, 1],
                      padding=[0, 0],
                      markup=True)

        ok_button = Button(text=ok_string, markup=True)
        ok_button.background_normal = ''
        ok_button.background_color = [76 / 255., 175 / 255., 80 / 255., 1.]
        back_button = Button(text=cancel_string, markup=True)
        back_button.background_normal = ''
        back_button.background_color = [230 / 255., 74 / 255., 25 / 255., 1.]

        btn_layout = BoxLayout(orientation='horizontal',
                               spacing=15,
                               padding=[0, 10, 0, 0])
        btn_layout.add_widget(back_button)
        btn_layout.add_widget(ok_button)

        layout_plan = BoxLayout(orientation='vertical',
                                spacing=10,
                                padding=[30, 20, 30, 0])
        layout_plan.add_widget(img)
        layout_plan.add_widget(label)
        layout_plan.add_widget(btn_layout)

        popup = Popup(title=title_string,
                      title_color=[0, 0, 0, 1],
                      title_font='Roboto-Bold',
                      title_size='20sp',
                      content=layout_plan,
                      size_hint=(None, None),
                      size=(360, 360),
                      auto_dismiss=False)

        popup.separator_color = [230 / 255., 74 / 255., 25 / 255., 1.]
        popup.separator_height = '4dp'
        popup.background = './asmcnc/apps/shapeCutter_app/img/popup_background.png'

        ok_button.bind(on_press=popup.dismiss)
        ok_button.bind(on_press=clear_mountpoint)
        back_button.bind(on_press=popup.dismiss)

        popup.open()
コード例 #6
0
    def __init__(self, screen_manager, localization):

        self.systemtools_sm = screen_manager
        self.l = localization

        description = self.l.get_str(
            "Would you like to download the system logs onto a USB stick?")
        title_string = self.l.get_str('Warning!')
        ok_string = self.l.get_bold('Yes')
        back_string = self.l.get_bold('No')

        def download_logs(*args):
            self.systemtools_sm.download_logs_to_usb()

        img = Image(source="./asmcnc/apps/shapeCutter_app/img/error_icon.png",
                    allow_stretch=False)
        label = Label(size_hint_y=2,
                      text_size=(320, None),
                      halign='center',
                      valign='middle',
                      text=description,
                      color=[0, 0, 0, 1],
                      padding=[0, 0],
                      markup=True)

        ok_button = Button(text=ok_string, markup=True)
        ok_button.background_normal = ''
        ok_button.background_color = [76 / 255., 175 / 255., 80 / 255., 1.]
        back_button = Button(text=back_string, markup=True)
        back_button.background_normal = ''
        back_button.background_color = [230 / 255., 74 / 255., 25 / 255., 1.]

        btn_layout = BoxLayout(orientation='horizontal',
                               spacing=15,
                               padding=[0, 5, 0, 0])
        btn_layout.add_widget(back_button)
        btn_layout.add_widget(ok_button)

        layout_plan = BoxLayout(orientation='vertical',
                                spacing=10,
                                padding=[30, 20, 30, 0])
        layout_plan.add_widget(img)
        layout_plan.add_widget(label)
        layout_plan.add_widget(btn_layout)

        popup = Popup(title=title_string,
                      title_color=[0, 0, 0, 1],
                      title_font='Roboto-Bold',
                      title_size='20sp',
                      content=layout_plan,
                      size_hint=(None, None),
                      size=(360, 360),
                      auto_dismiss=False)

        popup.separator_color = [230 / 255., 74 / 255., 25 / 255., 1.]
        popup.separator_height = '4dp'
        popup.background = './asmcnc/apps/shapeCutter_app/img/popup_background.png'

        ok_button.bind(on_press=popup.dismiss)
        ok_button.bind(on_press=download_logs)
        back_button.bind(on_press=popup.dismiss)

        popup.open()
コード例 #7
0
    def __init__(self, screen_manager, localization):

        self.sm = screen_manager
        self.l = localization

        description = (
                self.l.get_str("You are SAVING the new laser crosshair offset.") + \
                "\n\n" + \
                self.l.get_str("Please confirm that the laser crosshair lines up with the centre of your reference mark.")
            )

        save_laser_datum_offset_string = self.l.get_str(
            'SAVE laser crosshair offset')
        yes_string = self.l.get_bold("Yes, set offset")
        no_string = self.l.get_bold("No, go back")

        def save_laser_datum_offset(*args):
            self.sm.get_screen(
                'maintenance').laser_datum_buttons_widget.save_laser_offset()

        img = Image(source="./asmcnc/apps/shapeCutter_app/img/info_icon.png",
                    allow_stretch=False)
        label = Label(size_hint_y=1.4,
                      text_size=(460, None),
                      halign='center',
                      valign='middle',
                      text=description,
                      color=[0, 0, 0, 1],
                      padding=[20, 20],
                      markup=True)

        ok_button = Button(text=yes_string, markup=True)
        ok_button.background_normal = ''
        ok_button.background_color = [76 / 255., 175 / 255., 80 / 255., 1.]
        back_button = Button(text=no_string, markup=True)
        back_button.background_normal = ''
        back_button.background_color = [230 / 255., 74 / 255., 25 / 255., 1.]

        btn_layout = BoxLayout(orientation='horizontal',
                               spacing=10,
                               padding=[0, 0, 0, 0])
        btn_layout.add_widget(back_button)
        btn_layout.add_widget(ok_button)

        layout_plan = BoxLayout(orientation='vertical',
                                spacing=10,
                                padding=[10, 20, 10, 20])
        layout_plan.add_widget(img)
        layout_plan.add_widget(label)
        layout_plan.add_widget(btn_layout)

        popup = Popup(title=save_laser_datum_offset_string,
                      title_color=[0, 0, 0, 1],
                      title_font='Roboto-Bold',
                      title_size='20sp',
                      content=layout_plan,
                      size_hint=(None, None),
                      size=(500, 360),
                      auto_dismiss=False)

        popup.separator_color = [249 / 255., 206 / 255., 29 / 255., 1.]
        popup.separator_height = '4dp'
        popup.background = './asmcnc/apps/shapeCutter_app/img/popup_background.png'

        ok_button.bind(on_press=popup.dismiss)
        ok_button.bind(on_press=save_laser_datum_offset)
        back_button.bind(on_press=popup.dismiss)

        popup.open()
コード例 #8
0
    def __init__(self, screen_manager, test1, test2, test3, test4, test5):

        self.sm = screen_manager

        # img = Image(source="./asmcnc/apps/shapeCutter_app/img/info_icon.png", allow_stretch=False)
        label1 = Label(size_hint_y=1,
                       text_size=(None, None),
                       markup=True,
                       halign='left',
                       valign='middle',
                       text=test1,
                       color=[0, 0, 0, 1],
                       padding=[5, 5])
        label2 = Label(size_hint_y=1,
                       text_size=(None, None),
                       markup=True,
                       halign='left',
                       valign='middle',
                       text=test2,
                       color=[0, 0, 0, 1],
                       padding=[5, 5])
        label3 = Label(size_hint_y=1,
                       text_size=(None, None),
                       markup=True,
                       halign='left',
                       valign='middle',
                       text=test3,
                       color=[0, 0, 0, 1],
                       padding=[5, 5])
        label4 = Label(size_hint_y=1,
                       text_size=(None, None),
                       markup=True,
                       halign='left',
                       valign='middle',
                       text=test4,
                       color=[0, 0, 0, 1],
                       padding=[5, 5])
        label5 = Label(size_hint_y=1,
                       text_size=(None, None),
                       markup=True,
                       halign='left',
                       valign='middle',
                       text=test5,
                       color=[0, 0, 0, 1],
                       padding=[5, 5])

        ok_button = Button(text='[b]Ok[/b]', markup=True)
        ok_button.background_normal = ''
        ok_button.background_color = [76 / 255., 175 / 255., 80 / 255., 1.]

        text_layout = BoxLayout(orientation='horizontal', spacing=0, padding=0)
        text_layout.add_widget(label1)
        text_layout.add_widget(label2)
        text_layout.add_widget(label3)
        text_layout.add_widget(label4)
        text_layout.add_widget(label5)

        btn_layout = BoxLayout(orientation='horizontal',
                               spacing=15,
                               padding=[150, 10, 150, 0],
                               size_hint_y=0.4)
        btn_layout.add_widget(ok_button)

        layout_plan = BoxLayout(orientation='vertical',
                                spacing=10,
                                padding=[10, 10, 10, 10])
        # layout_plan.add_widget(img)
        layout_plan.add_widget(text_layout)
        layout_plan.add_widget(btn_layout)

        popup = Popup(title='Output',
                      title_color=[0, 0, 0, 1],
                      title_font='Roboto-Bold',
                      title_size='20sp',
                      content=layout_plan,
                      size_hint=(None, None),
                      size=(780, 460),
                      auto_dismiss=False)

        popup.background = './asmcnc/apps/shapeCutter_app/img/popup_background.png'
        popup.separator_color = [249 / 255., 206 / 255., 29 / 255., 1.]
        popup.separator_height = '4dp'

        ok_button.bind(on_press=popup.dismiss)

        popup.open()
コード例 #9
0
    def __init__(self, screen_manager, localization):

        self.sm = screen_manager
        self.l = localization

        description = (
                self.l.get_str("You are RESETTING the laser crosshair offset by setting a new REFERENCE MARK with your tool.") + \
                "\n\n" + \
                self.l.get_str("Confirm that you have not moved the position of the tool in the X or Y axis since making your mark.")
            )

        reset_laser_datum_offset_string = self.l.get_str(
            'RESET laser crosshair offset')
        yes_string = self.l.get_bold("Yes, set reference here")
        no_string = self.l.get_bold("No, go back")

        def reset_laser_datum_offset(*args):
            self.sm.get_screen(
                'maintenance').laser_datum_buttons_widget.reset_laser_offset()

        img = Image(source="./asmcnc/apps/shapeCutter_app/img/info_icon.png",
                    allow_stretch=False)
        label = Label(size_hint_y=1.4,
                      text_size=(460, None),
                      halign='center',
                      valign='middle',
                      text=description,
                      color=[0, 0, 0, 1],
                      padding=[20, 20],
                      markup=True)

        yes_font_size = 14
        if len(yes_string) > 40:
            yes_font_size = 13
        ok_button = Button(text=yes_string,
                           markup=True,
                           font_size=yes_font_size)
        ok_button.background_normal = ''
        ok_button.background_color = [76 / 255., 175 / 255., 80 / 255., 1.]
        back_button = Button(text=no_string, markup=True)
        back_button.background_normal = ''
        back_button.background_color = [230 / 255., 74 / 255., 25 / 255., 1.]

        btn_layout = BoxLayout(orientation='horizontal',
                               spacing=10,
                               padding=[0, 0, 0, 0])
        btn_layout.add_widget(back_button)
        btn_layout.add_widget(ok_button)

        layout_plan = BoxLayout(orientation='vertical',
                                spacing=10,
                                padding=[10, 20, 10, 20])
        layout_plan.add_widget(img)
        layout_plan.add_widget(label)
        layout_plan.add_widget(btn_layout)

        popup = Popup(title=reset_laser_datum_offset_string,
                      title_color=[0, 0, 0, 1],
                      title_font='Roboto-Bold',
                      title_size='20sp',
                      content=layout_plan,
                      size_hint=(None, None),
                      size=(500, 380),
                      auto_dismiss=False)

        popup.separator_color = [249 / 255., 206 / 255., 29 / 255., 1.]
        popup.separator_height = '4dp'
        popup.background = './asmcnc/apps/shapeCutter_app/img/popup_background.png'

        ok_button.bind(on_press=popup.dismiss)
        ok_button.bind(on_press=reset_laser_datum_offset)
        back_button.bind(on_press=popup.dismiss)

        popup.open()
コード例 #10
0
    def __init__(self, screen_manager, localization):

        self.sm = screen_manager
        self.l = localization

        label_width = 660

        # do this as a grid layout instead
        description_top = (
            self.l.get_bold("Brush use:") + "\n" + \
            "  " + self.l.get_bold("Value:") + " " + self.l.get_str("The running hours of the brushes.") + "\n" + \
            "  " + self.l.get_bold("Restore:") + " " + self.l.get_str("Return to the hours previously logged.") + "\n" + \
            "  " + self.l.get_bold("Reset:") + " " + self.l.get_str("Set the running hours to zero.")
            )

        description_bottom = (
                self.l.get_bold("Brush reminder:") + "\n" + \
                "  " + self.l.get_bold("Value:") + " " + self.l.get_str("Set to the hours the brushes are expected to last.") + "\n" + \
                "  " + self.l.get_str("This will vary depending on heavy use (~120 hours) or light use (~500 hours).") + "\n" + \
                "  " + self.l.get_str("It is best to set to worst case, inspect the brushes, and update as necessary.") + "\n" + \
                "  " + self.l.get_bold("Restore:") + " " + self.l.get_str("Return the brush reminder to the hours previously set.") + "\n" + \
                "  " + self.l.get_bold("Reset:") + " " + self.l.get_str("Sets the brush reminder to 120 hours.")
            )

        img = Image(source="./asmcnc/apps/shapeCutter_app/img/info_icon.png",
                    allow_stretch=False)
        label_top = Label(size_hint_y=1,
                          text_size=(476, self.height),
                          markup=True,
                          halign='left',
                          valign='bottom',
                          text=description_top,
                          color=[0, 0, 0, 1],
                          padding=[0, 0],
                          width=476)
        label_blank = Label(size_hint_y=0.1,
                            text_size=(476, self.height),
                            markup=True,
                            halign='left',
                            valign='bottom',
                            text='',
                            color=[0, 0, 0, 1],
                            padding=[0, 0],
                            width=476)
        label_bottom = Label(text_size=(760, None),
                             markup=True,
                             halign='left',
                             valign='top',
                             text=description_bottom,
                             color=[0, 0, 0, 1],
                             padding=[0, 0],
                             width=760)

        img_full_brush = Image(
            source="./asmcnc/apps/maintenance_app/img/brush_long_img.png",
            allow_stretch=False,
            size=(68, 99))
        label_full_brush_top = Label(text=self.l.get_bold("NEW"),
                                     text_size=(68, self.height),
                                     size_hint_y=0.1,
                                     font_size='12sp',
                                     markup=True,
                                     halign='left',
                                     valign='middle',
                                     color=[0, 0, 0, 1],
                                     padding=[0, 0],
                                     width=img_full_brush.width)
        label_full_brush_length = Label(text="[b]16mm[/b]",
                                        text_size=(68, self.height),
                                        size_hint_y=0.1,
                                        font_size='12sp',
                                        markup=True,
                                        halign='left',
                                        valign='middle',
                                        color=[0, 0, 0, 1],
                                        padding=[0, 0],
                                        width=img_full_brush.width)
        label_full_brush_tolerance = Label(text="[b](+/-0.2mm)[/b]",
                                           text_size=(68, self.height),
                                           size_hint_y=0.1,
                                           font_size='12sp',
                                           markup=True,
                                           halign='left',
                                           valign='middle',
                                           color=[0, 0, 0, 1],
                                           padding=[0, 0],
                                           width=img_full_brush.width)

        example_full_length = BoxLayout(orientation='vertical',
                                        padding=0,
                                        spacing=5,
                                        size_hint_x=None,
                                        width=68)
        example_full_length.add_widget(label_full_brush_top)
        example_full_length.add_widget(img_full_brush)
        example_full_length.add_widget(label_full_brush_length)
        example_full_length.add_widget(label_full_brush_tolerance)

        img_med_brush = Image(
            source="./asmcnc/apps/maintenance_app/img/brush_med_img.png",
            allow_stretch=False,
            size=(68, 99))
        label_med_brush_top = Label(text=self.l.get_bold("LOW"),
                                    text_size=(68, self.height),
                                    size_hint_y=0.1,
                                    font_size='12sp',
                                    markup=True,
                                    halign='left',
                                    valign='middle',
                                    color=[0, 0, 0, 1],
                                    padding=[0, 0],
                                    width=68)
        label_med_brush_length = Label(text="[b]10mm[/b]",
                                       text_size=(68, self.height),
                                       size_hint_y=0.1,
                                       font_size='12sp',
                                       markup=True,
                                       halign='left',
                                       valign='middle',
                                       color=[0, 0, 0, 1],
                                       padding=[0, 0],
                                       width=68)
        label_med_brush_tolerance = Label(text="[b](+/-0.2mm)[/b]",
                                          text_size=(68, self.height),
                                          size_hint_y=0.1,
                                          font_size='12sp',
                                          markup=True,
                                          halign='left',
                                          valign='middle',
                                          color=[0, 0, 0, 1],
                                          padding=[0, 0],
                                          width=68)

        example_med_length = BoxLayout(orientation='vertical',
                                       padding=0,
                                       spacing=5,
                                       size_hint_x=None,
                                       width=68)
        example_med_length.add_widget(label_med_brush_top)
        example_med_length.add_widget(img_med_brush)
        example_med_length.add_widget(label_med_brush_length)
        example_med_length.add_widget(label_med_brush_tolerance)

        img_short_brush = Image(
            source="./asmcnc/apps/maintenance_app/img/brush_short_img.png",
            allow_stretch=False,
            size=(68, 99))
        label_short_brush_top = Label(text=self.l.get_bold("SHUT-OFF"),
                                      text_size=(88, self.height),
                                      size_hint_y=0.1,
                                      font_size='12sp',
                                      markup=True,
                                      halign='left',
                                      valign='middle',
                                      color=[0, 0, 0, 1],
                                      padding=[0, 0],
                                      width=88)
        label_short_brush_length = Label(text="[b]9.5mm[/b]",
                                         text_size=(68, self.height),
                                         size_hint_y=0.1,
                                         font_size='12sp',
                                         markup=True,
                                         halign='left',
                                         valign='middle',
                                         color=[0, 0, 0, 1],
                                         padding=[0, 0],
                                         width=68)
        label_short_brush_tolerance = Label(text="[b](+/-0.2mm)[/b]",
                                            text_size=(68, self.height),
                                            size_hint_y=0.1,
                                            font_size='12sp',
                                            markup=True,
                                            halign='left',
                                            valign='middle',
                                            color=[0, 0, 0, 1],
                                            padding=[0, 0],
                                            width=68)

        example_short_length = BoxLayout(orientation='vertical',
                                         padding=0,
                                         spacing=5,
                                         size_hint_x=None,
                                         width=80)
        example_short_length.add_widget(label_short_brush_top)
        example_short_length.add_widget(img_short_brush)
        example_short_length.add_widget(label_short_brush_length)
        example_short_length.add_widget(label_short_brush_tolerance)

        ok_button = Button(text='[b]Ok[/b]', markup=True)
        ok_button.background_normal = ''
        ok_button.background_color = [76 / 255., 175 / 255., 80 / 255., 1.]

        examples_layout = BoxLayout(orientation='horizontal',
                                    padding=[0, 0, 20, 0],
                                    spacing=20,
                                    size_hint_x=None,
                                    width=284)
        examples_layout.add_widget(example_full_length)
        examples_layout.add_widget(example_med_length)
        examples_layout.add_widget(example_short_length)

        label_cheat = BoxLayout(orientation='vertical',
                                padding=0,
                                spacing=5,
                                size_hint_x=None,
                                width=476)
        label_cheat.add_widget(label_blank)
        label_cheat.add_widget(label_top)

        btn_layout = BoxLayout(orientation='horizontal',
                               padding=[150, 0, 150, 0],
                               size_hint_y=0.9)
        btn_layout.add_widget(ok_button)

        use_layout = BoxLayout(orientation='horizontal',
                               spacing=0,
                               padding=0,
                               size_hint_y=2,
                               size_hint_x=None,
                               width=760)
        use_layout.add_widget(label_cheat)
        use_layout.add_widget(examples_layout)

        reminder_layout = BoxLayout(orientation='horizontal',
                                    spacing=0,
                                    padding=0,
                                    size_hint_y=2.5,
                                    size_hint_x=None,
                                    width=760)
        reminder_layout.add_widget(label_bottom)

        layout_plan = BoxLayout(orientation='vertical',
                                spacing=0,
                                padding=[0, 0, 0, 0],
                                width=780)
        layout_plan.add_widget(img)
        layout_plan.add_widget(use_layout)
        layout_plan.add_widget(reminder_layout)
        layout_plan.add_widget(btn_layout)

        popup = Popup(title='Information',
                      title_color=[0, 0, 0, 1],
                      title_font='Roboto-Bold',
                      title_size='20sp',
                      content=layout_plan,
                      size_hint=(None, None),
                      size=(780, 460),
                      auto_dismiss=False)

        popup.background = './asmcnc/apps/shapeCutter_app/img/popup_background.png'
        popup.separator_color = [249 / 255., 206 / 255., 29 / 255., 1.]
        popup.separator_height = '4dp'

        ok_button.bind(on_press=popup.dismiss)

        popup.open()
コード例 #11
0
    def __init__(self, screen_manager, wifi_or_usb):

        self.sm = screen_manager

        description = "The update you are trying to install is a beta release.\n\n" + \
        "This is a version of the software that allows our developers and product testers to " + \
        "try out new features and identify any bugs before the next customer release.\n\n" + \
        "This release might not be stable, and it is recommended that you wait until the full " + \
        "update. If you decide to update and you have any issues, please contact Yeti Tool support.\n\n" + \
        "Do you want to continue?"

        def do_update(*args):
            if wifi_or_usb == 'wifi':
                self.sm.get_screen('update').get_sw_update_over_wifi()
            elif wifi_or_usb == 'usb':
                self.sm.get_screen('update').get_sw_update_over_usb()

        img = Image(source="./asmcnc/apps/shapeCutter_app/img/error_icon.png",
                    allow_stretch=False)
        label = Label(size_hint_y=2,
                      text_size=(620, None),
                      halign='center',
                      valign='middle',
                      text=description,
                      color=[0, 0, 0, 1],
                      padding=[0, 0],
                      markup=True)

        ok_button = Button(text='[b]Yes[/b]', markup=True)
        ok_button.background_normal = ''
        ok_button.background_color = [76 / 255., 175 / 255., 80 / 255., 1.]
        back_button = Button(text='[b]No[/b]', markup=True)
        back_button.background_normal = ''
        back_button.background_color = [230 / 255., 74 / 255., 25 / 255., 1.]

        btn_layout = BoxLayout(orientation='horizontal',
                               spacing=15,
                               padding=[0, 5, 0, 0])
        btn_layout.add_widget(back_button)
        btn_layout.add_widget(ok_button)

        layout_plan = BoxLayout(orientation='vertical',
                                spacing=10,
                                padding=[30, 20, 30, 0])
        layout_plan.add_widget(img)
        layout_plan.add_widget(label)
        layout_plan.add_widget(btn_layout)

        popup = Popup(title='Warning!',
                      title_color=[0, 0, 0, 1],
                      title_font='Roboto-Bold',
                      title_size='20sp',
                      content=layout_plan,
                      size_hint=(None, None),
                      size=(700, 450),
                      auto_dismiss=False)

        popup.separator_color = [230 / 255., 74 / 255., 25 / 255., 1.]
        popup.separator_height = '4dp'
        popup.background = './asmcnc/apps/shapeCutter_app/img/popup_background.png'

        ok_button.bind(on_press=popup.dismiss)
        ok_button.bind(on_press=do_update)
        back_button.bind(on_press=popup.dismiss)

        popup.open()
コード例 #12
0
    def __init__(self, consent_manager, localization):

        self.c = consent_manager
        self.l = localization

        def decline_confirmed(*args):
            self.c.decline_terms_and_disable_wifi()

        description = (
        self.l.get_bold("Are you sure you want to decline the data policy? This will disable the Console Wi-Fi.") + \
   "\n\n" + \
   self.l.get_str("You can change your data preferences in the System Tools app at any time.")
        )

        title_string = self.l.get_str('Warning!') + " " + self.l.get_str(
            "Are you sure?")
        ok_string = self.l.get_bold("Yes, disable Wi-Fi")
        back_string = self.l.get_bold('No, go back')

        img = Image(source="./asmcnc/apps/shapeCutter_app/img/error_icon.png",
                    allow_stretch=False)
        label = Label(size_hint_y=1.3,
                      text_size=(380, None),
                      halign='center',
                      valign='middle',
                      text=description,
                      color=[0, 0, 0, 1],
                      padding=[0, 0],
                      markup=True)

        ok_button = Button(text=ok_string, markup=True)
        ok_button.background_normal = ''
        ok_button.background_color = [230 / 255., 74 / 255., 25 / 255., 1.]
        back_button = Button(text=back_string, markup=True)
        back_button.background_normal = ''
        back_button.background_color = [76 / 255., 175 / 255., 80 / 255., 1.]

        btn_layout = BoxLayout(orientation='horizontal',
                               spacing=10,
                               padding=[20, 0, 20, 0])
        btn_layout.add_widget(back_button)
        btn_layout.add_widget(ok_button)

        layout_plan = BoxLayout(orientation='vertical',
                                spacing=10,
                                padding=[10, 20, 10, 20])
        layout_plan.add_widget(img)
        layout_plan.add_widget(label)
        layout_plan.add_widget(btn_layout)

        popup = Popup(title=title_string,
                      title_color=[0, 0, 0, 1],
                      title_font='Roboto-Bold',
                      title_size='20sp',
                      content=layout_plan,
                      size_hint=(None, None),
                      size=(500, 400),
                      auto_dismiss=False)

        popup.separator_color = [230 / 255., 74 / 255., 25 / 255., 1.]
        popup.separator_height = '4dp'
        popup.background = './asmcnc/apps/shapeCutter_app/img/popup_background.png'

        ok_button.bind(on_press=popup.dismiss)
        ok_button.bind(on_press=decline_confirmed)
        back_button.bind(on_press=popup.dismiss)

        popup.open()
コード例 #13
0
    def __init__(self, screen_manager, machine, localization, xy, warning_message):
        
      self.sm = screen_manager
      self.m = machine
      self.l = localization
      
      description = warning_message
      title_string = self.l.get_str('Warning!')
      yes_string = self.l.get_bold('Yes')
      no_string = self.l.get_bold('No')
      # chk_message = "         Use laser datum?"
      chk_message = self.l.get_str('Use laser crosshair?')

      def on_checkbox_active(checkbox, value):
        if value: 
          self.sm.get_screen('home').default_datum_choice = 'laser'
        else:
          self.sm.get_screen('home').default_datum_choice = 'spindle'

      def set_datum(*args):

          if (self.sm.get_screen('home').default_datum_choice == 'laser' and self.m.is_laser_enabled == True):

            if xy == 'X':
                self.m.set_x_datum_with_laser() #testing!!
            elif xy == 'Y':
                self.m.set_y_datum_with_laser()
                
            elif xy == 'XY':
                self.m.set_workzone_to_pos_xy_with_laser()

          else:

            if xy == 'X':
                self.m.set_x_datum()
            elif xy == 'Y':
                self.m.set_y_datum()
            elif xy == 'XY':
                self.m.set_workzone_to_pos_xy()


      def set_checkbox_default():
        if self.sm.get_screen('home').default_datum_choice == 'spindle':
          return False
        elif self.sm.get_screen('home').default_datum_choice == 'laser':
          return True

      img = Image(source="./asmcnc/apps/shapeCutter_app/img/error_icon.png", allow_stretch=False)
      label = Label(size_hint_y=1, text_size=(360, None), halign='center', valign='middle', text=description, color=[0,0,0,1], padding=[40,20], markup = True)
      

      ok_button = Button(text=yes_string, markup = True)
      ok_button.background_normal = ''
      ok_button.background_color = [76 / 255., 175 / 255., 80 / 255., 1.]
      back_button = Button(text=no_string, markup = True)
      back_button.background_normal = ''
      back_button.background_color = [230 / 255., 74 / 255., 25 / 255., 1.]

     
      btn_layout = BoxLayout(orientation='horizontal', spacing=10, padding=[0,0,0,0])
      btn_layout.add_widget(back_button)
      btn_layout.add_widget(ok_button)


      if self.m.is_laser_enabled == True:
        chk_label = Label(size_hint_y=1, size_hint_x=0.8, halign='center', valign='middle', text=chk_message, text_size=[200,100], color=[0,0,0,1], padding=[0,20], markup = True)
        checkbox = CheckBox(size_hint_x=0.2, background_checkbox_normal="./asmcnc/skavaUI/img/checkbox_inactive.png", active=set_checkbox_default())
        chk_layout = BoxLayout(orientation='horizontal', spacing=0, padding=[5,0,5,0])
        chk_layout.add_widget(chk_label)
        chk_layout.add_widget(checkbox)

      layout_plan = BoxLayout(orientation='vertical', spacing=10, padding=[20,20,20,20])
      layout_plan.add_widget(img)
      layout_plan.add_widget(label)
      if self.m.is_laser_enabled == True: layout_plan.add_widget(chk_layout)
      layout_plan.add_widget(btn_layout)
      
      popup = Popup(title=title_string,
                    title_color=[0, 0, 0, 1],
                    title_font= 'Roboto-Bold',
                    title_size = '20sp',
                    content=layout_plan,
                    size_hint=(None, None),
                    size=(300, 350),
                    auto_dismiss= False
                    )
      
      popup.separator_color = [230 / 255., 74 / 255., 25 / 255., 1.]
      popup.separator_height = '4dp'
      popup.background = './asmcnc/apps/shapeCutter_app/img/popup_background.png'
      
      if self.m.is_laser_enabled == True: checkbox.bind(active=on_checkbox_active)

      ok_button.bind(on_press=popup.dismiss)
      ok_button.bind(on_press=set_datum)
      back_button.bind(on_press=popup.dismiss)

      popup.open()
コード例 #14
0
    def __init__(self, screen_manager, app_manager, machine, localization, message, go_to):
        
        self.sm = screen_manager
        self.am = app_manager
        self.m = machine
        self.l = localization
        
        if go_to == 'calibration':
          description = message
        else:
          description = (
              message + "\n\n" + \
              self.l.get_bold("WARNING") + ": " + \
              self.l.get_bold("Delaying key maintenance tasks or dismissing reminders could cause wear and breakage of important parts!")
            )


        def open_app(*args):

            if go_to == 'calibration':
              self.am.start_calibration_app('go')

            elif go_to == 'brushes':
              self.am.start_maintenance_app('brush_tab')

            elif go_to == 'lubrication': 
              self.m.write_z_head_maintenance_settings(0)

        
        def calibration_delay(*args):
          new_time = float(float(320*3600) + self.m.time_to_remind_user_to_calibrate_seconds)
          self.m.write_calibration_settings(self.m.time_since_calibration_seconds, new_time)


        img = Image(source="./asmcnc/apps/shapeCutter_app/img/error_icon.png", allow_stretch=False)
        label = Label(size_hint_y=2, text_size=(680, None), halign='center', valign='middle', text=description, color=[0,0,0,1], padding=[10,0], markup = True)

        title_string = self.l.get_str('Maintenance reminder!')

        if go_to == 'calibration':
          ok_text = self.l.get_bold('Calibrate now!')
          back_text = self.l.get_bold('Remind me in 320 hours')

        if go_to == 'lubrication':
          ok_text = self.l.get_bold('Ok! Z-head lubricated!')
          back_text = self.l.get_bold('Remind me later')

        if go_to == 'brushes':
          ok_text = self.l.get_bold('Change brushes now!')
          back_text = self.l.get_bold('Remind me later')


        ok_button = Button(text=ok_text, markup = True)
        back_button = Button(text=back_text, markup = True)
        ok_button.background_normal = ''
        ok_button.background_color = [76 / 255., 175 / 255., 80 / 255., 1.]
        back_button.background_normal = ''
        back_button.background_color = [230 / 255., 74 / 255., 25 / 255., 1.]

       
        btn_layout = BoxLayout(orientation='horizontal', spacing=10, padding=[0,0,0,0], size_hint_y = 0.6)
        btn_layout.add_widget(back_button)
        btn_layout.add_widget(ok_button)
        
        layout_plan = BoxLayout(orientation='vertical', spacing=0, padding=[10,10,10,5])
        layout_plan.add_widget(img)
        layout_plan.add_widget(label)
        layout_plan.add_widget(btn_layout)
        

        popup = Popup(title=title_string,
                      title_color=[0, 0, 0, 1],
                      title_font= 'Roboto-Bold',
                      title_size = '22sp',
                      content=layout_plan,
                      size_hint=(None, None),
                      size=(700, 460),
                      auto_dismiss= False
                      )
        
        popup.separator_color = [230 / 255., 74 / 255., 25 / 255., 1.]
        popup.separator_height = '4dp'
        popup.background = './asmcnc/apps/shapeCutter_app/img/popup_background.png'
        
        ok_button.bind(on_press=popup.dismiss)
        ok_button.bind(on_press=open_app)
        back_button.bind(on_press=popup.dismiss)

        if go_to == 'calibration':
          back_button.bind(on_press=calibration_delay)      

        popup.open()
コード例 #15
0
    def __init__(self, **kwargs):
        
        self.sm = kwargs['screen_manager']
        self.l = kwargs['localization']
        self.function = kwargs['function']
        self.file_selection = kwargs['file_selection']
        
        if self.file_selection == 'all':
          description = self.l.get_str("Are you sure you want to delete these files?")
        else:
          description = self.l.get_str("Are you sure you want to delete this file?")

        title_string = self.l.get_str('Warning!')
        yes_string = self.l.get_bold('Yes')
        no_string = self.l.get_bold('No')
        
        def delete(*args):
          if self.file_selection == 'all':
            self.function()
          else:
            self.function(self.file_selection)

        def back(*args):
          return False
        
        img = Image(source="./asmcnc/apps/shapeCutter_app/img/error_icon.png", allow_stretch=False)
        label = Label(size_hint_y=2, text_size=(260, None), halign='center', valign='middle', text=description, color=[0,0,0,1], padding=[0,0], markup = True)
        
        ok_button = Button(text=yes_string, markup = True)
        ok_button.background_normal = ''
        ok_button.background_color = [76 / 255., 175 / 255., 80 / 255., 1.]
        back_button = Button(text=no_string, markup = True)
        back_button.background_normal = ''
        back_button.background_color = [230 / 255., 74 / 255., 25 / 255., 1.]

       
        btn_layout = BoxLayout(orientation='horizontal', spacing=15, padding=[0,5,0,0])
        btn_layout.add_widget(back_button)
        btn_layout.add_widget(ok_button)
        
        layout_plan = BoxLayout(orientation='vertical', spacing=10, padding=[30,20,30,0])
        layout_plan.add_widget(img)
        layout_plan.add_widget(label)
        layout_plan.add_widget(btn_layout)
        
        popup = Popup(title=title_string,
                      title_color=[0, 0, 0, 1],
                      title_font= 'Roboto-Bold',
                      title_size = '20sp',
                      content=layout_plan,
                      size_hint=(None, None),
                      size=(300, 350),
                      auto_dismiss= False
                      )
        
        popup.separator_color = [230 / 255., 74 / 255., 25 / 255., 1.]
        popup.separator_height = '4dp'
        popup.background = './asmcnc/apps/shapeCutter_app/img/popup_background.png'
        
        ok_button.bind(on_press=popup.dismiss)
        ok_button.bind(on_press=delete)
        back_button.bind(on_press=popup.dismiss)
        back_button.bind(on_press=back)

        popup.open()