p.swapXZ = self.swapXZ\r
p.swapYZ = self.swapYZ\r
p.extruder = self.extruder\r
+ p.profile = self.profile\r
\r
p.updateModelTransform()\r
\r
toolbarUtil.NormalButton(self.toolbar2, self.OnMoveUp, 'move-up.png', 'Move model up in print list')\r
toolbarUtil.NormalButton(self.toolbar2, self.OnMoveDown, 'move-down.png', 'Move model down in print list')\r
toolbarUtil.NormalButton(self.toolbar2, self.OnCopy, 'copy.png', 'Make a copy of the current selected object')\r
+ toolbarUtil.NormalButton(self.toolbar2, self.OnSetCustomProfile, 'set-profile.png', 'Set a custom profile to be used to slice a specific object.')\r
self.toolbar2.AddSeparator()\r
toolbarUtil.NormalButton(self.toolbar2, self.OnAutoPlace, 'autoplace.png', 'Automaticly organize the objects on the platform.')\r
toolbarUtil.NormalButton(self.toolbar2, self.OnSlice, 'slice.png', 'Slice to project into a gcode file.')\r
cp = ConfigParser.ConfigParser()\r
cp.read(dlg.GetPath())\r
self.list = []\r
- self.listbox.Clear()\r
i = 0\r
while cp.has_section('model_%d' % (i)):\r
section = 'model_%d' % (i)\r
i += 1\r
\r
self.list.append(item)\r
- self.listbox.AppendAndEnsureVisible(os.path.split(item.filename)[1])\r
- \r
- self.listbox.SetSelection(len(self.list)-1)\r
+\r
+ self.selected = self.list[0]\r
+ self._updateListbox() \r
self.OnListSelect(None)\r
self.preview.Refresh()\r
\r
self.list.append(item)\r
self.selection = item\r
self._updateListbox()\r
+ self.OnListSelect(None)\r
self.preview.Refresh()\r
dlg.Destroy()\r
\r
self._updateListbox()\r
self.preview.Refresh()\r
\r
+ def OnSetCustomProfile(self, e):\r
+ if self.selection == None:\r
+ return\r
+\r
+ dlg=wx.FileDialog(self, "Select profile", os.path.split(profile.getPreference('lastFile'))[0], style=wx.FD_OPEN|wx.FD_FILE_MUST_EXIST)\r
+ dlg.SetWildcard("Profile files (*.ini)|*.ini;*.INI")\r
+ if dlg.ShowModal() == wx.ID_OK:\r
+ self.selection.profile = dlg.GetPath()\r
+ else:\r
+ self.selection.profile = None\r
+ self._updateListbox()\r
+ dlg.Destroy()\r
+ \r
def _updateListbox(self):\r
self.listbox.Clear()\r
for item in self.list:\r
- self.listbox.AppendAndEnsureVisible(os.path.split(item.filename)[1])\r
+ if item.profile != None:\r
+ self.listbox.AppendAndEnsureVisible(os.path.split(item.filename)[1] + " *")\r
+ else:\r
+ self.listbox.AppendAndEnsureVisible(os.path.split(item.filename)[1])\r
if self.selection in self.list:\r
self.listbox.SetSelection(self.list.index(self.selection))\r
elif len(self.list) > 0:\r