Beispiel #1
0
    def __init__(self, parent, onCloseFn=None):
        super(preferencesDialog, self).__init__(None, title=_("Preferences"))

        wx.EVT_CLOSE(self, self.OnClose)

        self.onCloseFn = onCloseFn

        self.parent = parent
        extruderCount = int(profile.getMachineSetting('extruder_amount'))

        self.panel = configBase.configPanelBase(self)

        left, right, main = self.panel.CreateConfigPanel(self)

        printWindowTypes = ['Basic']
        for p in pluginInfo.getPluginList('printwindow'):
            printWindowTypes.append(p.getName())
        configBase.TitleRow(left, _("Print window"))
        configBase.SettingRow(left, 'printing_window', printWindowTypes)

        configBase.TitleRow(left, _("Colours"))
        configBase.SettingRow(left, 'model_colour', wx.Colour)
        for i in xrange(1, extruderCount):
            configBase.SettingRow(left, 'model_colour%d' % (i + 1), wx.Colour)

        if len(resources.getLanguageOptions()) > 1:
            configBase.TitleRow(left, _("Language"))
            configBase.SettingRow(
                left, 'language',
                map(lambda n: n[1], resources.getLanguageOptions()))

        configBase.TitleRow(right, _("Filament settings"))
        configBase.SettingRow(right, 'filament_physical_density')
        configBase.SettingRow(right, 'filament_cost_kg')
        configBase.SettingRow(right, 'filament_cost_meter')

        #configBase.TitleRow(right, 'Slicer settings')
        #configBase.SettingRow(right, 'save_profile')

        #configBase.TitleRow(right, 'SD Card settings')

        configBase.TitleRow(right, _("3DK settings"))
        configBase.SettingRow(right, 'auto_detect_sd')
        # configBase.SettingRow(right, 'check_for_updates')
        configBase.SettingRow(right, 'auto_slice')
        configBase.SettingRow(right, 'submit_slice_information')

        self.okButton = wx.Button(right, -1, 'Ok')
        right.GetSizer().Add(self.okButton, (right.GetSizer().GetRows(), 1),
                             flag=wx.BOTTOM | wx.RIGHT | wx.ALIGN_RIGHT,
                             border=5)
        self.okButton.Bind(wx.EVT_BUTTON, lambda e: self.Close())

        main.Fit()
        self.Fit()
Beispiel #2
0
	def __init__(self, parent):
		super(preferencesDialog, self).__init__(None, title=_("Preferences"))

		wx.EVT_CLOSE(self, self.OnClose)

		self.parent = parent
		extruderCount = int(profile.getMachineSetting('extruder_amount'))

		self.panel = configBase.configPanelBase(self)

		left, right, main = self.panel.CreateConfigPanel(self)

		printWindowTypes = ['Basic']
		for p in pluginInfo.getPluginList('printwindow'):
			printWindowTypes.append(p.getName())
		configBase.TitleRow(left, _("Print window"))
		configBase.SettingRow(left, 'printing_window', printWindowTypes)

		configBase.TitleRow(left, _("Colours"))
		configBase.SettingRow(left, 'model_colour', wx.Colour)
		for i in xrange(1, extruderCount):
			configBase.SettingRow(left, 'model_colour%d' % (i+1), wx.Colour)

		if len(resources.getLanguageOptions()) > 1:
			configBase.TitleRow(left, _("Language"))
			configBase.SettingRow(left, 'language', map(lambda n: n[1], resources.getLanguageOptions()))

		configBase.TitleRow(right, _("Filament settings"))
		configBase.SettingRow(right, 'filament_physical_density')
		configBase.SettingRow(right, 'filament_cost_kg')
		configBase.SettingRow(right, 'filament_cost_meter')

		#configBase.TitleRow(right, 'Slicer settings')
		#configBase.SettingRow(right, 'save_profile')

		configBase.TitleRow(right, 'SD Card settings')
		configBase.SettingRow(right, 'auto_detect_sd')
		configBase.SettingRow(right, 'sdcard_rootfolder')
		#same as the expert settings button.
		self.browseButton = wx.Button(right, -1, '...', style=wx.BU_EXACTFIT)
		self.browseButton.SetFont(wx.Font(wx.SystemSettings.GetFont(wx.SYS_ANSI_VAR_FONT).GetPointSize() * 0.8, wx.FONTFAMILY_DEFAULT, wx.NORMAL, wx.FONTWEIGHT_NORMAL))
		self.browseButton.Bind(wx.EVT_BUTTON, self.OnBrowseSDRootFolder)
		right.GetSizer().Add(self.browseButton, (right.GetSizer().GetRows()-1, 2), flag=wx.ALIGN_CENTER_VERTICAL)

		"""
		configBase.TitleRow(right, _("Cura settings"))
		configBase.SettingRow(right, 'check_for_updates')
		configBase.SettingRow(right, 'submit_slice_information')
		"""
		self.okButton = wx.Button(right, -1, 'Ok')
		right.GetSizer().Add(self.okButton, (right.GetSizer().GetRows(), 0), flag=wx.BOTTOM, border=5)
		self.okButton.Bind(wx.EVT_BUTTON, lambda e: self.Close())

		main.Fit()
		self.Fit()
Beispiel #3
0
	def __init__(self, parent):
		super(preferencesDialog, self).__init__(parent, title=_("Preferences"))

		wx.EVT_CLOSE(self, self.OnClose)

		self.parent = parent
		extruderCount = int(profile.getMachineSetting('extruder_amount'))

		self.panel = configBase.configPanelBase(self)

		left, right, main = self.panel.CreateConfigPanel(self)

		printWindowTypes = ['Basic']
		for p in pluginInfo.getPluginList('printwindow'):
			printWindowTypes.append(p.getName())
		configBase.TitleRow(left, _("Print window"))
		configBase.SettingRow(left, 'printing_window', printWindowTypes)

		configBase.TitleRow(left, _("Colours"))
		configBase.SettingRow(left, 'model_colour', wx.Colour)
		for i in xrange(1, extruderCount):
			configBase.SettingRow(left, 'model_colour%d' % (i+1), wx.Colour)

		if len(resources.getLanguageOptions()) > 1:
			configBase.TitleRow(left, _("Language"))
			configBase.SettingRow(left, 'language', map(lambda n: n[1], resources.getLanguageOptions()))

		configBase.TitleRow(right, _("Filament settings"))
		configBase.SettingRow(right, 'filament_physical_density')
		configBase.SettingRow(right, 'filament_cost_kg')
		configBase.SettingRow(right, 'filament_cost_meter')

		#configBase.TitleRow(right, 'Slicer settings')
		#configBase.SettingRow(right, 'save_profile')

		#configBase.TitleRow(right, 'SD Card settings')

		configBase.TitleRow(right, _("Cura settings"))
		configBase.SettingRow(right, 'auto_detect_sd')
		configBase.SettingRow(right, 'check_for_updates')
		#configBase.SettingRow(right, 'submit_slice_information')

		self.okButton = wx.Button(right, -1, _('Ok'))
		right.GetSizer().Add(self.okButton, (right.GetSizer().GetRows(), 0), flag=wx.BOTTOM, border=5)
		self.okButton.Bind(wx.EVT_BUTTON, lambda e: self.Close())

		main.Fit()
		self.Fit()
Beispiel #4
0
	def __init__(self, parent, callback):
		wx.Panel.__init__(self, parent,-1)
		#Plugin page
		self.pluginList = pluginInfo.getPluginList("postprocess")
		self.callback = callback

		sizer = wx.GridBagSizer(2, 2)
		self.SetSizer(sizer)

		pluginStringList = []
		for p in self.pluginList:
			pluginStringList.append(p.getName())

		self.listbox = wx.ListBox(self, -1, choices=pluginStringList)
		title = wx.StaticText(self, -1, _("Plugins:"))
		title.SetFont(wx.Font(wx.SystemSettings.GetFont(wx.SYS_ANSI_VAR_FONT).GetPointSize(), wx.FONTFAMILY_DEFAULT, wx.NORMAL, wx.FONTWEIGHT_BOLD))
		helpButton = wx.Button(self, -1, '?', style=wx.BU_EXACTFIT)
		addButton = wx.Button(self, -1, 'V', style=wx.BU_EXACTFIT)
		openPluginLocationButton = wx.Button(self, -1, _("Open plugin location"))
		sb = wx.StaticBox(self, label=_("Enabled plugins"))
		boxsizer = wx.StaticBoxSizer(sb, wx.VERTICAL)
		self.pluginEnabledPanel = scrolledpanel.ScrolledPanel(self)
		self.pluginEnabledPanel.SetupScrolling(False, True)

		sizer.Add(title, (0,0), border=10, flag=wx.ALIGN_CENTER_VERTICAL|wx.LEFT|wx.TOP)
		sizer.Add(helpButton, (0,1), border=10, flag=wx.ALIGN_RIGHT|wx.RIGHT|wx.TOP)
		sizer.Add(self.listbox, (1,0), span=(2,2), border=10, flag=wx.EXPAND|wx.LEFT|wx.RIGHT)
		sizer.Add(addButton, (3,0), span=(1,2), border=5, flag=wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_BOTTOM)
		sizer.Add(boxsizer, (4,0), span=(4,2), border=10, flag=wx.EXPAND|wx.LEFT|wx.RIGHT)
		sizer.Add(openPluginLocationButton, (8, 0), border=10, flag=wx.LEFT|wx.BOTTOM)
		boxsizer.Add(self.pluginEnabledPanel, 1, flag=wx.EXPAND)

		sizer.AddGrowableCol(0)
		sizer.AddGrowableRow(1) # Plugins list box
		sizer.AddGrowableRow(4) # Enabled plugins
		sizer.AddGrowableRow(5) # Enabled plugins
		sizer.AddGrowableRow(6) # Enabled plugins

		sizer = wx.BoxSizer(wx.VERTICAL)
		self.pluginEnabledPanel.SetSizer(sizer)

		self.Bind(wx.EVT_BUTTON, self.OnAdd, addButton)
		self.Bind(wx.EVT_BUTTON, self.OnGeneralHelp, helpButton)
		self.Bind(wx.EVT_BUTTON, self.OnOpenPluginLocation, openPluginLocationButton)
		self.listbox.Bind(wx.EVT_LEFT_DCLICK, self.OnAdd)
		self.panelList = []
		self.updateProfileToControls()
Beispiel #5
0
	def __init__(self, parent, callback):
		wx.Panel.__init__(self, parent,-1)
		#Plugin page
		self.pluginList = pluginInfo.getPluginList("postprocess")
		self.callback = callback

		sizer = wx.GridBagSizer(2, 2)
		self.SetSizer(sizer)

		pluginStringList = []
		for p in self.pluginList:
			pluginStringList.append(p.getName())

		self.listbox = wx.ListBox(self, -1, choices=pluginStringList)
		title = wx.StaticText(self, -1, _("Plugins:"))
		title.SetFont(wx.Font(wx.SystemSettings.GetFont(wx.SYS_ANSI_VAR_FONT).GetPointSize(), wx.FONTFAMILY_DEFAULT, wx.NORMAL, wx.FONTWEIGHT_BOLD))
		helpButton = wx.Button(self, -1, '?', style=wx.BU_EXACTFIT)
		addButton = wx.Button(self, -1, 'V', style=wx.BU_EXACTFIT)
		openPluginLocationButton = wx.Button(self, -1, _("Open plugin location"))
		sb = wx.StaticBox(self, label=_("Enabled plugins"))
		boxsizer = wx.StaticBoxSizer(sb, wx.VERTICAL)
		self.pluginEnabledPanel = scrolledpanel.ScrolledPanel(self)
		self.pluginEnabledPanel.SetupScrolling(False, True)

		sizer.Add(title, (0,0), border=10, flag=wx.ALIGN_CENTER_VERTICAL|wx.LEFT|wx.TOP)
		sizer.Add(helpButton, (0,1), border=10, flag=wx.ALIGN_RIGHT|wx.RIGHT|wx.TOP)
		sizer.Add(self.listbox, (1,0), span=(2,2), border=10, flag=wx.EXPAND|wx.LEFT|wx.RIGHT)
		sizer.Add(addButton, (3,0), span=(1,2), border=5, flag=wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_BOTTOM)
		sizer.Add(boxsizer, (4,0), span=(4,2), border=10, flag=wx.EXPAND|wx.LEFT|wx.RIGHT)
		sizer.Add(openPluginLocationButton, (8, 0), border=10, flag=wx.LEFT|wx.BOTTOM)
		boxsizer.Add(self.pluginEnabledPanel, 1, flag=wx.EXPAND)

		sizer.AddGrowableCol(0)
		sizer.AddGrowableRow(1) # Plugins list box
		sizer.AddGrowableRow(4) # Enabled plugins
		sizer.AddGrowableRow(5) # Enabled plugins
		sizer.AddGrowableRow(6) # Enabled plugins

		sizer = wx.BoxSizer(wx.VERTICAL)
		self.pluginEnabledPanel.SetSizer(sizer)

		self.Bind(wx.EVT_BUTTON, self.OnAdd, addButton)
		self.Bind(wx.EVT_BUTTON, self.OnGeneralHelp, helpButton)
		self.Bind(wx.EVT_BUTTON, self.OnOpenPluginLocation, openPluginLocationButton)
		self.listbox.Bind(wx.EVT_LEFT_DCLICK, self.OnAdd)
		self.panelList = []
		self.updateProfileToControls()
	def OnPrinterControlWizard(self, e):
		connectionGroup = self._printerConnectionManager.getAvailableGroup()
		connection = None

		#Select a serial connection
		if connectionGroup is not None:
			connections = connectionGroup.getAvailableConnections()
			connection = connections[0]

		if connection is not None:
			#Select the pronterface plugin dir fullpath and run it
			for p in pluginInfo.getPluginList('printwindow_mod'):
				if p.getName() == "Pronterface UI for REDD Cura":
					print "Opening proterface window"
					connection.window = printWindow.printWindowPlugin(self, connection, p.getFullFilename())
					break
				else:
					print "REDD : Pronterface plugin is missing"
			connection.window.Show()
			connection.window.Raise()
		else:
			wx.MessageBox("Please connect a 3D printer to open Printer Control wizard","3D Printer not found",wx.OK | wx.ICON_ERROR)
			print "MAX : A serial comm to 3D printer is needed to proceed"
Beispiel #7
0
    def __init__(self, parent):
        super(preferencesDialog, self).__init__(None, title=_("Preferences"))

        wx.EVT_CLOSE(self, self.OnClose)

        self.parent = parent
        extruderCount = int(profile.getMachineSetting('extruder_amount'))

        self.panel = configBase.configPanelBase(self)

        left, right, main = self.panel.CreateConfigPanel(self)

        printWindowTypes = ['Basic']
        for p in pluginInfo.getPluginList('printwindow'):
            printWindowTypes.append(p.getName())
        configBase.TitleRow(left, _("Print window"))
        configBase.SettingRow(left, 'printing_window', printWindowTypes)

        configBase.TitleRow(left, _("Colours"))
        configBase.SettingRow(left, 'model_colour', wx.Colour)
        for i in xrange(1, extruderCount):
            configBase.SettingRow(left, 'model_colour%d' % (i + 1), wx.Colour)

        if len(resources.getLanguageOptions()) > 1:
            configBase.TitleRow(left, _("Language"))
            configBase.SettingRow(
                left, 'language',
                map(lambda n: n[1], resources.getLanguageOptions()))

        configBase.TitleRow(right, _("Filament settings"))
        configBase.SettingRow(right, 'filament_physical_density')
        configBase.SettingRow(right, 'filament_cost_kg')
        configBase.SettingRow(right, 'filament_cost_meter')

        #configBase.TitleRow(right, 'Slicer settings')
        #configBase.SettingRow(right, 'save_profile')

        configBase.TitleRow(right, 'SD Card settings')
        configBase.SettingRow(right, 'auto_detect_sd')
        configBase.SettingRow(right, 'sdcard_rootfolder')
        #same as the expert settings button.
        self.browseButton = wx.Button(right, -1, '...', style=wx.BU_EXACTFIT)
        self.browseButton.SetFont(
            wx.Font(
                wx.SystemSettings.GetFont(wx.SYS_ANSI_VAR_FONT).GetPointSize()
                * 0.8, wx.FONTFAMILY_DEFAULT, wx.NORMAL, wx.FONTWEIGHT_NORMAL))
        self.browseButton.Bind(wx.EVT_BUTTON, self.OnBrowseSDRootFolder)
        right.GetSizer().Add(self.browseButton,
                             (right.GetSizer().GetRows() - 1, 2),
                             flag=wx.ALIGN_CENTER_VERTICAL)

        configBase.TitleRow(right, _("Cura settings"))
        configBase.SettingRow(right, 'check_for_updates')
        configBase.SettingRow(right, 'submit_slice_information')

        self.okButton = wx.Button(right, -1, 'Ok')
        right.GetSizer().Add(self.okButton, (right.GetSizer().GetRows(), 0),
                             flag=wx.BOTTOM,
                             border=5)
        self.okButton.Bind(wx.EVT_BUTTON, lambda e: self.Close())

        main.Fit()
        self.Fit()