Exemplo n.º 1
0
	def OnSaveProfile(self, e):
		dlg=wx.FileDialog(self, "Select profile file to save", os.path.split(profile.getPreference('lastFile'))[0], style=wx.FD_SAVE)
		dlg.SetWildcard("ini files (*.ini)|*.ini")
		if dlg.ShowModal() == wx.ID_OK:
			profileFile = dlg.GetPath()
			profile.saveGlobalProfile(profileFile)
		dlg.Destroy()
Exemplo n.º 2
0
 def OnSaveProfile(self, e):
     dlg = wx.FileDialog(self,
                         "Select profile file to save",
                         os.path.split(
                             profile.getPreference('lastFile'))[0],
                         style=wx.FD_SAVE)
     dlg.SetWildcard("ini files (*.ini)|*.ini")
     if dlg.ShowModal() == wx.ID_OK:
         profileFile = dlg.GetPath()
         profile.saveGlobalProfile(profileFile)
     dlg.Destroy()
Exemplo n.º 3
0
    def __init__(self, mainWindow, parent, filelist):
        wx.Panel.__init__(self, parent, -1)
        self.mainWindow = mainWindow
        self.filelist = filelist
        self.abort = False

        box = wx.StaticBox(self, -1, filelist[0])
        self.sizer = wx.StaticBoxSizer(box, wx.HORIZONTAL)

        mainSizer = wx.BoxSizer(wx.VERTICAL)
        mainSizer.Add(self.sizer, 0, flag=wx.EXPAND)

        self.statusText = wx.StaticText(self, -1, "Starting...")
        self.progressGauge = wx.Gauge(self, -1)
        self.progressGauge.SetRange(10000 * len(filelist))
        self.abortButton = wx.Button(self, -1, "X", style=wx.BU_EXACTFIT)
        self.sizer.Add(self.statusText, 2, flag=wx.ALIGN_CENTER)
        self.sizer.Add(self.progressGauge, 2)
        self.sizer.Add(self.abortButton, 0)

        self.Bind(wx.EVT_BUTTON, self.OnAbort, self.abortButton)

        self.SetSizer(mainSizer)
        self.prevStep = 'start'
        self.totalDoneFactor = 0.0
        self.startTime = time.time()
        if profile.getPreference('save_profile') == 'True':
            profile.saveGlobalProfile(
                self.filelist[0][:self.filelist[0].rfind('.')] +
                "_profile.ini")
        cmdList = []
        for filename in self.filelist:
            idx = self.filelist.index(filename)
            #print filename, idx
            if idx > 0:
                profile.setTempOverride('fan_enabled', 'False')
                profile.setTempOverride('skirt_line_count', '0')
                profile.setTempOverride(
                    'machine_center_x',
                    profile.getProfileSettingFloat('machine_center_x') -
                    profile.getPreferenceFloat('extruder_offset_x%d' % (idx)))
                profile.setTempOverride(
                    'machine_center_y',
                    profile.getProfileSettingFloat('machine_center_y') -
                    profile.getPreferenceFloat('extruder_offset_y%d' % (idx)))
                profile.setTempOverride('alternative_center', self.filelist[0])
            if len(self.filelist) > 1:
                profile.setTempOverride('add_start_end_gcode', 'False')
                profile.setTempOverride('gcode_extension', 'multi_extrude_tmp')
            cmdList.append(sliceRun.getSliceCommand(filename))
        profile.resetTempOverride()
        self.thread = WorkerThread(self, filelist, cmdList)
Exemplo n.º 4
0
	def __init__(self, mainWindow, parent, filelist):
		wx.Panel.__init__(self, parent, -1)
		self.mainWindow = mainWindow
		self.filelist = filelist
		self.abort = False
		
		box = wx.StaticBox(self, -1, filelist[0])
		self.sizer = wx.StaticBoxSizer(box, wx.HORIZONTAL)

		mainSizer = wx.BoxSizer(wx.VERTICAL) 
		mainSizer.Add(self.sizer, 0, flag=wx.EXPAND)

		self.statusText = wx.StaticText(self, -1, "Starting...")
		self.progressGauge = wx.Gauge(self, -1)
		self.progressGauge.SetRange(10000 * len(filelist))
		self.abortButton = wx.Button(self, -1, "X", style=wx.BU_EXACTFIT)
		self.sizer.Add(self.statusText, 2, flag=wx.ALIGN_CENTER )
		self.sizer.Add(self.progressGauge, 2)
		self.sizer.Add(self.abortButton, 0)

		self.Bind(wx.EVT_BUTTON, self.OnAbort, self.abortButton)

		self.SetSizer(mainSizer)
		self.prevStep = 'start'
		self.totalDoneFactor = 0.0
		self.startTime = time.time()
		if profile.getPreference('save_profile') == 'True':
			profile.saveGlobalProfile(self.filelist[0][: self.filelist[0].rfind('.')] + "_profile.ini")
		cmdList = []
		for filename in self.filelist:
			idx = self.filelist.index(filename)
			#print filename, idx
			if idx > 0:
				profile.setTempOverride('fan_enabled', 'False')
				profile.setTempOverride('skirt_line_count', '0')
				profile.setTempOverride('machine_center_x', profile.getProfileSettingFloat('machine_center_x') - profile.getPreferenceFloat('extruder_offset_x%d' % (idx)))
				profile.setTempOverride('machine_center_y', profile.getProfileSettingFloat('machine_center_y') - profile.getPreferenceFloat('extruder_offset_y%d' % (idx)))
				profile.setTempOverride('alternative_center', self.filelist[0])
			if len(self.filelist) > 1:
				profile.setTempOverride('add_start_end_gcode', 'False')
				profile.setTempOverride('gcode_extension', 'multi_extrude_tmp')
			cmdList.append(sliceRun.getSliceCommand(filename))
		profile.resetTempOverride()
		self.thread = WorkerThread(self, filelist, cmdList)
Exemplo n.º 5
0
 def OnClose(self, e):
     profile.saveGlobalProfile(profile.getDefaultProfilePath())
     self.Destroy()
Exemplo n.º 6
0
 def OnClose(self, e):
     profile.saveGlobalProfile(profile.getDefaultProfilePath())
     self.Destroy()