Beispiel #1
0
    def loadModelFiles(self, filelist, showWarning=False):
        while len(filelist) > len(self.objectList):
            self.objectList.append(previewObject())
        for idx in xrange(len(filelist), len(self.objectList)):
            self.objectList[idx].mesh = None
            self.objectList[idx].filename = None
        for idx in xrange(0, len(filelist)):
            obj = self.objectList[idx]
            if obj.filename != filelist[idx]:
                obj.fileTime = None
                self.gcodeFileTime = None
                self.logFileTime = None
            obj.filename = filelist[idx]

        self.gcodeFilename = sliceRun.getExportFilename(filelist[0])
        # Do the STL file loading in a background thread so we don't block the UI.
        if self.loadThread is not None and self.loadThread.isAlive():
            self.loadThread.join()
        self.loadThread = threading.Thread(target=self.doFileLoadThread)
        self.loadThread.daemon = True
        self.loadThread.start()

        if showWarning:
            if (self.matrix - numpy.matrix([[1, 0, 0], [0, 1, 0], [0, 0, 1]], numpy.float64)).any() or len(
                profile.getPluginConfig()
            ) > 0:
                self.ShowWarningPopup("Reset scale, rotation, mirror and plugins?", self.OnResetAll)
Beispiel #2
0
    def loadModelFiles(self, filelist, showWarning=False):
        while len(filelist) > len(self.objectList):
            self.objectList.append(previewObject())
        for idx in xrange(len(filelist), len(self.objectList)):
            self.objectList[idx].mesh = None
            self.objectList[idx].filename = None
        for idx in xrange(0, len(filelist)):
            obj = self.objectList[idx]
            if obj.filename != filelist[idx]:
                obj.fileTime = None
                self.gcodeFileTime = None
                self.logFileTime = None
                obj.mesh = None
            obj.filename = filelist[idx]

        self.deselectTool()
        self.gcodeFilename = sliceRun.getExportFilename(filelist[0])
        self.gcode = None
        #Do the STL file loading in a background thread so we don't block the UI.
        if self.loadThread is not None and self.loadThread.isAlive():
            self.abortLoading = True
            self.loadThread.join()
        self.abortLoading = False
        self.loadThread = threading.Thread(target=self.doFileLoadThread)
        self.loadThread.daemon = True
        self.loadThread.start()

        if showWarning:
            if (self.matrix - numpy.matrix([[1, 0, 0], [0, 1, 0], [0, 0, 1]],
                                           numpy.float64)).any() or len(
                                               profile.getPluginConfig()) > 0:
                self.ShowWarningPopup(
                    'Reset scale, rotation, mirror and plugins?',
                    self.OnResetAll)
Beispiel #3
0
	def updateProfileToControls(self):
		self.pluginConfig = profile.getPluginConfig()
		for p in self.panelList:
			p.Show(False)
			self.pluginEnabledPanel.GetSizer().Detach(p)
		self.panelList = []
		for pluginConfig in self.pluginConfig:
			self._buildPluginPanel(pluginConfig)
Beispiel #4
0
 def updateProfileToControls(self):
     self.pluginConfig = profile.getPluginConfig()
     for p in self.panelList:
         p.Show(False)
         self.pluginEnabledPanel.GetSizer().Detach(p)
     self.panelList = []
     for pluginConfig in self.pluginConfig:
         self._buildPluginPanel(pluginConfig)
Beispiel #5
0
	def loadModelFiles(self, filelist, showWarning = False):
		while len(filelist) > len(self.objectList):
			self.objectList.append(previewObject())
		for idx in xrange(len(filelist), len(self.objectList)):
			self.objectList[idx].mesh = None
			self.objectList[idx].filename = None
		for idx in xrange(0, len(filelist)):
			obj = self.objectList[idx]
			if obj.filename != filelist[idx]:
				obj.fileTime = None
				self.gcodeFileTime = None
				self.logFileTime = None
			obj.filename = filelist[idx]
		
		self.gcodeFilename = sliceRun.getExportFilename(filelist[0])
		#Do the STL file loading in a background thread so we don't block the UI.
		if self.loadThread != None and self.loadThread.isAlive():
			self.loadThread.join()
		self.loadThread = threading.Thread(target=self.doFileLoadThread)
		self.loadThread.daemon = True
		self.loadThread.start()
		
		if showWarning:
			if profile.getProfileSettingFloat('model_scale') != 1.0 or profile.getProfileSettingFloat('model_rotate_base') != 0 or profile.getProfileSetting('flip_x') != 'False' or profile.getProfileSetting('flip_y') != 'False' or profile.getProfileSetting('flip_z') != 'False' or profile.getProfileSetting('swap_xz') != 'False' or profile.getProfileSetting('swap_yz') != 'False' or len(profile.getPluginConfig()) > 0:
				self.ShowWarningPopup('Reset scale, rotation, mirror and plugins?', self.OnResetAll)