コード例 #1
0
    def getFirmwareHardware(self):
        ver = self._version

        if profile.getMachineSetting('machine_type') != 'BCN3DSigma' and profile.getMachineSetting(
                'machine_type') != 'BCN3DPlus' and profile.getMachineSetting('machine_type') != 'BCN3DR':
            wx.MessageBox(_("I am sorry, but Cura does not process firmware updates for your machine configuration."),
                          _("Firmware update"), wx.OK | wx.ICON_ERROR)
            return
        elif profile.getMachineSetting('machine_type') == 'BCN3DSigma' or profile.getMachineSetting(
                'machine_type') == 'BCN3DPlus' or profile.getMachineSetting('machine_type') == 'BCN3DR':
            myVersion = version.getLatestFHVersion(ver)


            if myVersion == None:
                return

            if version.downloadLatestFHVersion != None:
                org = os.getcwd()
                if sys.platform.startswith('win'):
                    self._dir = os.getcwd() + '\Compiled Firmware'
                    os.chdir(self._dir)
                elif sys.platform.startswith('darwin'):
                    self._dir = os.getcwd() + '/Compiled Firmware/'
                    os.chdir(self._dir)

                for filename in os.listdir(self._dir):
                    if filename.endswith(".hex"):
                        machineCom.InstallFirmware(self, filename)

                check = filter(lambda x: x.isdigit(), myVersion)
                print 'deberian ser solo digitos ', check
                goodOne = check[-3:]
                print 'good one ', goodOne


                for filename in os.listdir(org):
                    if filename.startswith("SD"):
                        print 'esto es el two ', filename
                        check2 = filter(lambda x: x.isdigit(), filename)
                        self._goodTwo = check2[-3:]
                        print 'esto es el two con solo numeros ', self._goodTwo

                if goodOne == self._goodTwo:
                    print 'hemos entrado porque tenemos que actualizar ficheros'
                    choice = wx.MessageBox(_("You need to update the files on your printers SD Card\n"
                                             "Press 'OK' to learn how to do it."), _("SD Files Updater"), wx.OK)
                    if choice == wx.OK:
                        os.chdir(org)
                        self.GetParent().FindWindowById(wx.ID_FORWARD).Enable()
                        self.GetParent().ShowPage(self.GetNext())

                elif goodOne != self._goodTwo:
                    print 'ya hemos acabado, no tenemos que actualizar nada para la SD'


                    wx.MessageBox(_("You are done!\n\nEnjoy the new version."), _("Firmware updater"), wx.OK | wx.ICON_INFORMATION)
                    #if thing == wx.OK:
                        #self.Bind(wx.wizard.EVT_WIZARD_FINISHED, thing)
                    #self.Destroy()
                    print 'done'
コード例 #2
0
    def getFirmwareHardware(self):
        ver = self._version

        if profile.getMachineSetting('machine_type') != 'BCN3DSigma' and profile.getMachineSetting('machine_type') != 'BCN3DPlus' and profile.getMachineSetting('machine_type') != 'BCN3DR':
            wx.MessageBox(_("I am sorry, but Cura does not process firmware updates for your machine configuration."), _("Firmware update"), wx.OK | wx.ICON_ERROR)
            return
        elif profile.getMachineSetting('machine_type') == 'BCN3DSigma' or profile.getMachineSetting('machine_type') == 'BCN3DPlus' or profile.getMachineSetting('machine_type') == 'BCN3DR':
            myVersion = version.getLatestFHVersion(ver)

            if myVersion == None:
                return

            if version.downloadLatestFHVersion != None:
                dlg=wx.FileDialog(None, _("Open firmware to upload"), os.getcwd(), style=wx.FD_OPEN|wx.FD_FILE_MUST_EXIST)
                dlg.SetWildcard("HEX file (*.hex)|*.hex;*.HEX")
                if dlg.ShowModal() == wx.ID_OK:
                    filename = dlg.GetPath()
                    dlg.Destroy()
                    if not(os.path.exists(filename)):
                        return
                    #For some reason my Ubuntu 10.10 crashes here.
                    InstallFirmware(self, filename)
                    #In case we want to delete the file after it has been installed
                    #os.chdir(os.path.expanduser('~') + '\Documents\BCN3DSigma')
                    #path = os.getcwd()
                    #shutil.rmtree(path)
                if dlg != wx.FD_OPEN:
                    os.chdir(os.path.expanduser('~') + '\Documents')
                    return
                else:
                    wx.MessageBox(_("You are running the latest version of firmware!"), _("Awesome!"), wx.ICON_INFORMATION)
コード例 #3
0
    def getFirmwareHardware(self):
        ver = self._version
 
        if profile.getMachineSetting('machine_type') != 'BCN3DSigma' and profile.getMachineSetting(
                'machine_type') != 'BCN3DPlus' and profile.getMachineSetting('machine_type') != 'BCN3DR':
            wx.MessageBox(_("I am sorry, but Cura does not process firmware updates for your machine configuration."),
                          _("Firmware update"), wx.OK | wx.ICON_ERROR)
            return
        elif profile.getMachineSetting('machine_type') == 'BCN3DSigma' or profile.getMachineSetting(
                'machine_type') == 'BCN3DPlus' or profile.getMachineSetting('machine_type') == 'BCN3DR':
            myVersion = version.getLatestFHVersion(ver)
 
            if myVersion == None:
                return
 
            if version.downloadLatestFHVersion != None:
                org = os.getcwd()
                if sys.platform.startswith('win'):
                    self._dir = os.getcwd() + '\Compiled Firmware'
                    os.chdir(self._dir)
                elif sys.platform.startswith('darwin'):
                    self._dir = os.getcwd() + '/Compiled Firmware/'
                    os.chdir(self._dir)
 
                for filename in os.listdir(self._dir):
                    if filename.endswith(".hex"):
                        InstallFirmware(self, filename)
 
                for filename in os.listdir(org):
                    if filename.startswith("SD"):
                        choice = wx.MessageBox(_("You need to update the files on your printers SD Card\n"
                                                 "Press 'OK' to learn how to do it."), _("Firmware update"), wx.OK)
                        if choice == wx.OK:
                            webbrowser.open(
                                'https://github.com/BCN3D/BCN3D-Cura-Windows/wiki/Updating-the-SD-Files-from-the-LCD-Display')
コード例 #4
0
    def getFirmwareHardware(self):
        ver = self._version

        if profile.getMachineSetting(
                'machine_type') != 'BCN3DSigma' and profile.getMachineSetting(
                    'machine_type'
                ) != 'BCN3DPlus' and profile.getMachineSetting(
                    'machine_type') != 'BCN3DR':
            wx.MessageBox(
                _("I am sorry, but Cura does not process firmware updates for your machine configuration."
                  ), _("Firmware update"), wx.OK | wx.ICON_ERROR)
            return
        elif profile.getMachineSetting(
                'machine_type') == 'BCN3DSigma' or profile.getMachineSetting(
                    'machine_type'
                ) == 'BCN3DPlus' or profile.getMachineSetting(
                    'machine_type') == 'BCN3DR':
            myVersion = version.getLatestFHVersion(ver)

            if myVersion == None:
                return

            if version.downloadLatestFHVersion != None:
                org = os.getcwd()
                if sys.platform.startswith('win'):
                    self._dir = os.getcwd() + '\Compiled Firmware'
                    os.chdir(self._dir)
                elif sys.platform.startswith('darwin'):
                    self._dir = os.getcwd() + '/Compiled Firmware/'
                    os.chdir(self._dir)

                for filename in os.listdir(self._dir):
                    if filename.endswith(".hex"):
                        InstallFirmware(self, filename)

                for filename in os.listdir(org):
                    if filename.startswith("SD"):
                        choice = wx.MessageBox(
                            _("You need to update the files on your printers SD Card\n"
                              "Press 'OK' to learn how to do it."),
                            _("Firmware update"), wx.OK)
                        if choice == wx.OK:
                            webbrowser.open(
                                'https://github.com/BCN3D/BCN3D-Cura-Windows/wiki/Updating-the-SD-Files-from-the-LCD-Display'
                            )
コード例 #5
0
ファイル: machineCom.py プロジェクト: remelbourne/Cura-BCN3D
    def getFirmwareHardware(self):
        ver = self._version

        if profile.getMachineSetting(
                'machine_type') != 'BCN3DSigma' and profile.getMachineSetting(
                    'machine_type'
                ) != 'BCN3DPlus' and profile.getMachineSetting(
                    'machine_type') != 'BCN3DR':
            wx.MessageBox(
                _("I am sorry, but Cura does not process firmware updates for your machine configuration."
                  ), _("Firmware update"), wx.OK | wx.ICON_ERROR)
            return
        elif profile.getMachineSetting(
                'machine_type') == 'BCN3DSigma' or profile.getMachineSetting(
                    'machine_type'
                ) == 'BCN3DPlus' or profile.getMachineSetting(
                    'machine_type') == 'BCN3DR':
            myVersion = version.getLatestFHVersion(ver)

            if myVersion == None:
                return

            if version.downloadLatestFHVersion != None:
                dlg = wx.FileDialog(None,
                                    _("Open firmware to upload"),
                                    os.getcwd(),
                                    style=wx.FD_OPEN | wx.FD_FILE_MUST_EXIST)
                dlg.SetWildcard("HEX file (*.hex)|*.hex;*.HEX")
                if dlg.ShowModal() == wx.ID_OK:
                    filename = dlg.GetPath()
                    dlg.Destroy()
                    if not (os.path.exists(filename)):
                        return
                    #For some reason my Ubuntu 10.10 crashes here.
                    InstallFirmware(self, filename)
                    #In case we want to delete the file after it has been installed
                    #os.chdir(os.path.expanduser('~') + '\Documents\BCN3DSigma')
                    #path = os.getcwd()
                    #shutil.rmtree(path)
                if dlg != wx.FD_OPEN:
                    os.chdir(os.path.expanduser('~') + '\Documents')
                    return
コード例 #6
0
    def getFirmwareHardware(self):
        ver = self._version

        if profile.getMachineSetting(
                'machine_type') != 'BCN3DSigma' and profile.getMachineSetting(
                    'machine_type'
                ) != 'BCN3DPlus' and profile.getMachineSetting(
                    'machine_type') != 'BCN3DR':
            wx.MessageBox(
                _("I am sorry, but Cura does not process firmware updates for your machine configuration."
                  ), _("Firmware update"), wx.OK | wx.ICON_ERROR)
            return
        elif profile.getMachineSetting(
                'machine_type') == 'BCN3DSigma' or profile.getMachineSetting(
                    'machine_type'
                ) == 'BCN3DPlus' or profile.getMachineSetting(
                    'machine_type') == 'BCN3DR':
            myVersion = version.getLatestFHVersion(ver)

            if myVersion == None:
                return

            if version.downloadLatestFHVersion != None:
                org = os.getcwd()
                if sys.platform.startswith('win'):
                    self._dir = os.getcwd() + '\Compiled Firmware'
                    os.chdir(self._dir)
                elif sys.platform.startswith('darwin'):
                    self._dir = os.getcwd() + '/Compiled Firmware/'
                    os.chdir(self._dir)

                for filename in os.listdir(self._dir):
                    if filename.endswith(".hex"):
                        machineCom.InstallFirmware(self, filename)

                check = filter(lambda x: x.isdigit(), myVersion)
                print 'deberian ser solo digitos ', check
                goodOne = check[-3:]
                print 'good one ', goodOne

                for filename in os.listdir(org):
                    if filename.startswith("SD"):
                        print 'esto es el two ', filename
                        check2 = filter(lambda x: x.isdigit(), filename)
                        self._goodTwo = check2[-3:]
                        print 'esto es el two con solo numeros ', self._goodTwo

                if goodOne == self._goodTwo:
                    print 'hemos entrado porque tenemos que actualizar ficheros'
                    choice = wx.MessageBox(
                        _("You need to update the files on your printers SD Card\n"
                          "Press 'OK' to learn how to do it."),
                        _("SD Files Updater"), wx.OK)
                    if choice == wx.OK:
                        os.chdir(org)
                        self.GetParent().FindWindowById(wx.ID_FORWARD).Enable()
                        self.GetParent().ShowPage(self.GetNext())

                elif goodOne != self._goodTwo:
                    print 'ya hemos acabado, no tenemos que actualizar nada para la SD'

                    wx.MessageBox(_("You are done!\n\nEnjoy the new version."),
                                  _("Firmware updater"),
                                  wx.OK | wx.ICON_INFORMATION)
                    #if thing == wx.OK:
                    #self.Bind(wx.wizard.EVT_WIZARD_FINISHED, thing)
                    #self.Destroy()
                    print 'done'