Commit d61c311a authored by Guillaume Seguin's avatar Guillaume Seguin

Update printrui/gui.py with respect to gcview changes

This commit introduces a use3dview flag, which will be made as an option as
soon as we get a better options GUI.
parent 77ac4453
...@@ -13,6 +13,8 @@ ...@@ -13,6 +13,8 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with Printrun. If not, see <http://www.gnu.org/licenses/>. # along with Printrun. If not, see <http://www.gnu.org/licenses/>.
import traceback
try: try:
import wx import wx
except: except:
...@@ -201,11 +203,17 @@ class VizPane(wx.BoxSizer): ...@@ -201,11 +203,17 @@ class VizPane(wx.BoxSizer):
extrusion_width = root.settings.preview_extrusion_width) extrusion_width = root.settings.preview_extrusion_width)
root.gviz.SetToolTip(wx.ToolTip("Click to examine / edit\n layers of loaded file")) root.gviz.SetToolTip(wx.ToolTip("Click to examine / edit\n layers of loaded file"))
root.gviz.showall = 1 root.gviz.showall = 1
use3dview = False
if use3dview:
try: try:
raise "" import printrun.gcview
import printrun.stlview root.gwindow = printrun.gcview.GcodeViewFrame(None, wx.ID_ANY, 'Gcode view, shift to move view, mousewheel to set layer', size = (600, 600), build_dimensions = root.build_dimensions_list)
root.gwindow = printrun.stlview.GCFrame(None, wx.ID_ANY, 'Gcode view, shift to move view, mousewheel to set layer', size = (600, 600))
except: except:
use3dview = False
print "3D view mode requested, but we failed to initialize it."
print "Falling back to 2D view, and here is the backtrace:"
traceback.print_exc()
if not use3dview:
root.gwindow = gviz.window([], root.gwindow = gviz.window([],
build_dimensions = root.build_dimensions_list, build_dimensions = root.build_dimensions_list,
grid = (root.settings.preview_grid_step1, root.settings.preview_grid_step2), grid = (root.settings.preview_grid_step1, root.settings.preview_grid_step2),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment