def open_background(self):
     '''
     Open A Pop-up To Manage the Canvas Background
     '''
     content = BackgroundMenu(self.data)
     content.setUpData(self.data)
     content.close = self.close_actions
     self._popup = Popup(title="Background Picture", content=content,
                         size_hint=(0.5, 0.5))
     self._popup.open()
Esempio n. 2
0
 def open_background(self):
     '''
     Open A Pop-up To Manage the Canvas Background
     '''
     content = BackgroundMenu(self.data)
     content.setUpData(self.data)
     content.close = self.close_actions
     self._popup = Popup(title="Background Picture",
                         content=content,
                         size_hint=(0.5, 0.5))
     self._popup.open()
Esempio n. 3
0
    def build(self):

        interface = FloatLayout()
        self.data = Data()

        if self.config.get('Maslow Settings', 'colorScheme') == 'Light':
            self.data.iconPath = './Images/Icons/normal/'
            self.data.fontColor = '[color=7a7a7a]'
            self.data.drawingColor = [.47, .47, .47]
            Window.clearcolor = (1, 1, 1, 1)
            self.data.posIndicatorColor = [0, 0, 0]
            self.data.targetInicatorColor = [1, 0, 0]
        elif self.config.get('Maslow Settings', 'colorScheme') == 'Dark':
            self.data.iconPath = './Images/Icons/highvis/'
            self.data.fontColor = '[color=000000]'
            self.data.drawingColor = [1, 1, 1]
            Window.clearcolor = (0, 0, 0, 1)
            self.data.posIndicatorColor = [1, 1, 1]
            self.data.targetInicatorColor = [1, 0, 0]
        elif self.config.get('Maslow Settings',
                             'colorScheme') == 'DarkGreyBlue':
            self.data.iconPath = './Images/Icons/darkgreyblue/'
            self.data.fontColor = '[color=000000]'
            self.data.drawingColor = [1, 1, 1]
            Window.clearcolor = (0.06, 0.10, 0.2, 1)
            self.data.posIndicatorColor = [0.51, 0.93, 0.97]
            self.data.targetInicatorColor = [1, 0, 0]

        Window.maximize()

        self.frontpage = FrontPage(self.data, name='FrontPage')
        interface.add_widget(self.frontpage)

        self.nonVisibleWidgets = NonVisibleWidgets()
        '''
        Load User Settings
        '''

        # force create an ini no matter what.
        self.config.write()

        if self.config.get('Advanced Settings', 'encoderSteps') == '8148.0':
            self.data.message_queue.put(
                "Message: This update will adjust the the number of encoder pulses per rotation from 8,148 to 8,113 in your settings which improves the positional accuracy.\n\nPerforming a calibration will help you get the most out of this update."
            )
            self.config.set('Advanced Settings', 'encoderSteps', '8113.73')
        #up the maximum feedrate
        if self.config.get('Advanced Settings', 'maxFeedrate') == '700':
            self.data.message_queue.put(
                "Message: This update will increase the maximum feedrate of your machine. You can adjust this value under the Advanced settings."
            )
            self.config.set('Advanced Settings', 'maxFeedrate', '800')
            self.config.write()

        self.data.comport = self.config.get('Maslow Settings', 'COMport')
        self.data.baudRate = int(self.config.get('Maslow Settings',
                                                 'baudRate'))
        self.data.gcodeFile = self.config.get('Maslow Settings', 'openFile')
        offsetX = float(self.config.get('Advanced Settings', 'homeX'))
        offsetY = float(self.config.get('Advanced Settings', 'homeY'))
        self.data.gcodeShift = [offsetX, offsetY]
        self.data.config = self.config
        self.config.add_callback(self.configSettingChange)

        # Background image setup
        self.data.backgroundFile = self.config.get('Background Settings',
                                                   'backgroundFile')
        self.data.backgroundManualReg = json.loads(
            self.config.get('Background Settings', 'manualReg'))
        if self.data.backgroundFile != "":
            BackgroundMenu(self.data).processBackground()
        '''
        Initializations
        '''

        self.frontpage.setUpData(self.data)
        self.nonVisibleWidgets.setUpData(self.data)
        self.frontpage.gcodecanvas.initialize()
        '''
        Scheduling
        '''

        Clock.schedule_interval(self.runPeriodically, .01)
        '''
        Push settings to machine
        '''
        self.data.bind(connectionStatus=self.requestMachineSettings)
        self.data.pushSettings = self.requestMachineSettings

        return interface