if Publisher is not None:
Publisher().subscribe(self.onPluginUpdate, "pluginupdate")
+ pluginCount = self.normalSettingsPanel.pluginPanel.GetActivePluginCount()
+ if pluginCount == 1:
+ self.scene.notification.message("Warning: 1 plugin from the previous session is still active.")
+
+ if pluginCount > 1:
+ self.scene.notification.message("Warning: %i plugins from the previous session are still active." % pluginCount)
+
def onPluginUpdate(self,msg): #receives commands from the plugin thread
cmd = str(msg.data).split(";")
if cmd[0] == "OpenPluginProgressWindow":
if not os.path.exists(pluginInfo.getPluginBasePaths()[0]):
os.mkdir(pluginInfo.getPluginBasePaths()[0])
explorer.openExplorerPath(pluginInfo.getPluginBasePaths()[0])
+
+ def GetActivePluginCount(self):
+ pluginCount = 0
+ for pluginConfig in self.pluginConfig:
+ self._buildPluginPanel(pluginConfig)
+
+ for pluginTest in self.pluginList:
+ if pluginTest.getFilename() == pluginConfig['filename']:
+ pluginCount += 1
+
+ return pluginCount
\ No newline at end of file
The scene class keep track of an collection of objects on a build platform and their state.
It can figure out in which order to print them (if any) and if an object can be printed at all.
"""
- def __init__(self):
+ def __init__(self, sceneView=None):
self._objectList = []
self._sizeOffsets = numpy.array([0.0,0.0], numpy.float32)
self._machineSize = numpy.array([100,100,100], numpy.float32)
self._gantryHeight = 60
self._oneAtATime = True
+ self._lastOneAtATime = False
+ self._lastResultOneAtATime = True
+ self._sceneView = sceneView
+
# update the physical machine dimensions
def updateMachineDimensions(self):
self._machineSize = numpy.array([profile.getMachineSettingFloat('machine_width'), profile.getMachineSettingFloat('machine_depth'), profile.getMachineSettingFloat('machine_height')])
self._headSizeOffsets[0] = min(xMin, xMax)
self._headSizeOffsets[1] = min(yMin, yMax)
self._gantryHeight = gantryHeight
- self._oneAtATime = self._gantryHeight > 0 and profile.getPreference('oneAtATime') == 'True'
- for obj in self._objectList:
- if obj.getSize()[2] - objectSink > self._gantryHeight:
- self._oneAtATime = False
+
+ printOneAtATime = profile.getPreference('oneAtATime') == 'True'
+ self._oneAtATime = self._gantryHeight > 0 and printOneAtATime
+ if self._oneAtATime:
+ if not self._lastOneAtATime:
+ #print mode was changed by user. We need to reset that value to test with current scene content
+ self._lastResultOneAtATime = True
+
+ for obj in self._objectList:
+ if obj.getSize()[2] - objectSink > self._gantryHeight:
+ self._oneAtATime = False
+ if self._lastResultOneAtATime:
+ if self._sceneView:
+ self._sceneView.notification.message("Info: Print one at a time mode disabled. Object too tall.")
+ break
+
+ if self._lastOneAtATime and self._oneAtATime and not self._lastResultOneAtATime:
+ if self._sceneView:
+ self._sceneView.notification.message("Info: Print one at a time mode re-enabled.")
+
+ self._lastResultOneAtATime = self._oneAtATime
+ self._lastOneAtATime = printOneAtATime
headArea = numpy.array([[-xMin,-yMin],[ xMax,-yMin],[ xMax, yMax],[-xMin, yMax]], numpy.float32)