def __init__(self, parent): FabPanel.__init__(self, parent) self.construct('Path', [ ('Diameter (mm)', 'diameter', float, lambda f: f >= 0), ('Offsets (-1 to fill)', 'offsets', int, lambda f: f == -1 or f > 0), ('Overlap (0 - 1)', 'overlap', float, lambda f: 0 < f < 1), ('3D cut', 'threeD', bool), ('Z depth (mm)', 'depth', float, lambda f: f < 0), ('Top height (mm)', 'top', float), ('Bottom height (mm)', 'bottom', float), ('Step height (mm)', 'step', float, lambda f: f > 0), ('Path type', 'type', ['XY', 'XZ + YZ']), ('Tool type', 'tool', ['Flat', 'Ball']), ]) # This panel is a bit special, because modifying the checkbox # can actually change the panel's layout (different labels are # shown or hidden depending on the path type) self.threeD.Bind( wx.EVT_CHECKBOX, lambda e: (self.parent.update(), self.parent.invalidate())) self.type.Bind( wx.EVT_CHOICE, lambda e: (self.parent.update(), self.parent.invalidate()))
def __init__(self, parent): FabPanel.__init__(self, parent) self.construct('Lattice', [ ('Resolution (pixels/mm)\n', 'res', float, lambda f: f > 0)]) self.res.Bind(wx.EVT_TEXT, self.parent.update) self.img = Image(0,0)
def __init__(self, parent): FabPanel.__init__(self, parent) self.construct( 'ASDF', [('Resolution (voxels/mm)\n', 'res', float, lambda f: f > 0)]) self.res.Bind(wx.EVT_TEXT, self.parent.update)
def __init__(self, parent): FabPanel.__init__(self, parent) sizer = wx.BoxSizer(wx.VERTICAL) title = wx.lib.stattext.GenStaticText(self, wx.ID_ANY, label='Input', style=wx.ALIGN_CENTRE) title.header = True sizer.Add(title, flag=wx.EXPAND|wx.TOP|wx.LEFT|wx.RIGHT, border=5) text = wx.GridSizer(2, 2) self.file = wx.StaticText(self, label='.asdf file') self.pix = wx.StaticText(self) self.mms = wx.StaticText(self) self.ins = wx.StaticText(self) text.Add(self.file) text.Add(self.mms, flag=wx.ALIGN_LEFT|wx.EXPAND) text.Add(self.pix, flag=wx.ALIGN_LEFT|wx.EXPAND) text.Add(self.ins, flag=wx.ALIGN_LEFT|wx.EXPAND) sizer.Add(text, flag=wx.EXPAND|wx.LEFT|wx.RIGHT, border=5) resize = wx.Button(self, label='Rescale') sizer.Add(resize, flag=wx.CENTER|wx.ALL, border=5) resize.Bind(wx.EVT_BUTTON, self.resize) self.SetSizerAndFit(sizer)
def __init__(self, parent): FabPanel.__init__(self, parent) self.construct('Path', [ ('Diameter (mm)', 'diameter', float, lambda f: f >= 0), ('Offsets (-1 to fill)', 'offsets', int, lambda f: f == -1 or f > 0), ('Overlap (0 - 1)', 'overlap', float, lambda f: 0 < f < 1), ('3D cut', 'threeD', bool), ('Z depth (mm)','depth', float, lambda f: f < 0), ('Top height (mm)','top', float), ('Bottom height (mm)','bottom', float), ('Step height (mm)','step', float, lambda f: f > 0), ('Path type', 'type', ['XY','XZ + YZ']), ('Tool type', 'tool', ['Flat','Ball']), ]) # This panel is a bit special, because modifying the checkbox # can actually change the panel's layout (different labels are # shown or hidden depending on the path type) self.threeD.Bind( wx.EVT_CHECKBOX, lambda e: (self.parent.update(), self.parent.invalidate()) ) self.type.Bind( wx.EVT_CHOICE, lambda e: (self.parent.update(), self.parent.invalidate()) )
def __init__(self, parent): """ @brief Initializes the panel @param Parent UI panel """ FabPanel.__init__(self, parent) sizer = wx.BoxSizer(wx.VERTICAL) title = wx.lib.stattext.GenStaticText(self, wx.ID_ANY, label='Input', style=wx.ALIGN_CENTRE) title.header = True sizer.Add(title, flag=wx.EXPAND|wx.TOP|wx.LEFT|wx.RIGHT, border=5) self.label = wx.StaticText(self, label='.cad file') sizer.Add(self.label, flag=wx.EXPAND|wx.LEFT|wx.RIGHT, border=5) self.SetSizerAndFit(sizer)
def __init__(self, parent): """ @brief Initializes the panel @param Parent UI panel """ FabPanel.__init__(self, parent) sizer = wx.BoxSizer(wx.VERTICAL) title = wx.lib.stattext.GenStaticText(self, wx.ID_ANY, label='Input', style=wx.ALIGN_CENTRE) title.header = True sizer.Add(title, flag=wx.EXPAND | wx.TOP | wx.LEFT | wx.RIGHT, border=5) self.label = wx.StaticText(self, label='.cad file') sizer.Add(self.label, flag=wx.EXPAND | wx.LEFT | wx.RIGHT, border=5) self.SetSizerAndFit(sizer)
def __init__(self, parent): """ @brief Initializes the panel @param Parent UI panel """ FabPanel.__init__(self, parent) sizer = wx.BoxSizer(wx.VERTICAL) title = wx.lib.stattext.GenStaticText(self, wx.ID_ANY, label='Input', style=wx.ALIGN_CENTRE) title.header = True sizer.Add(title, flag=wx.EXPAND | wx.TOP | wx.LEFT | wx.RIGHT, border=5) text = wx.GridSizer(2, 2) ## @var file # UI label with filename self.file = wx.StaticText(self, label='.png file') ## @var pix # UI label with size in pixels self.pix = wx.StaticText(self) ## @var file # UI label with size in mms self.mms = wx.StaticText(self) ## @var file # UI label with size in inches self.ins = wx.StaticText(self) text.Add(self.file) text.Add(self.mms, flag=wx.ALIGN_LEFT | wx.EXPAND) text.Add(self.pix, flag=wx.ALIGN_LEFT | wx.EXPAND) text.Add(self.ins, flag=wx.ALIGN_LEFT | wx.EXPAND) sizer.Add(text, flag=wx.EXPAND | wx.LEFT | wx.RIGHT, border=5) self.SetSizerAndFit(sizer)
def __init__(self, parent): FabPanel.__init__(self, parent) self.construct('Custom plane path', [ ('Resolution (pixels/mm)\n? x ? x ?', 'res', float, lambda f: f>0), ('Diameter (mm)', 'diameter', float, lambda f: f >= 0), ('Rough stepover (0-1)', 'stepover_r', float, lambda f: 0 < f < 1), ('Finish stepover (0-1)', 'stepover_f', float, lambda f: 0 < f < 1), ('Step height (mm)','step', float, lambda f: f > 0), ('Tool type', 'tool', ['Flat','Ball']), ('Cut type', 'cut', ['Rough','Finish','Both']), ('Mode', 'mode', ['Faces', 'From view', '3x2']), ('Cuts per 180 degrees', 'cuts_per', int, lambda f: f > 1), ('Alpha', 'alpha', float), ('Beta', 'beta', float, lambda f: f >= 0 and f <= 90), ]) sizer = self.GetSizer() hs = wx.BoxSizer(wx.HORIZONTAL) get_button = wx.Button( self, wx.ID_ANY, label='Get rotation') set_button = wx.Button( self, wx.ID_ANY, label='Set rotation') get_button.Bind(wx.EVT_BUTTON, self.get_spin) set_button.Bind(wx.EVT_BUTTON, self.set_spin) hs.Add(get_button, flag=wx.LEFT|wx.TOP, border=5) hs.Add(set_button, flag=wx.LEFT|wx.TOP, border=5) sizer.Add(hs, flag=wx.CENTER|wx.BOTTOM, border=5) self._buttons = set_button, get_button self.SetSizerAndFit(sizer) self.res.Bind(wx.EVT_TEXT, self.parent.update) self.mode.Bind( wx.EVT_CHOICE, lambda e: (self.parent.update(), self.parent.invalidate()) )
def __init__(self, parent): """ @brief Initializes the panel @param Parent UI panel """ FabPanel.__init__(self, parent) sizer = wx.BoxSizer(wx.VERTICAL) title = wx.lib.stattext.GenStaticText(self, wx.ID_ANY, label='Input', style=wx.ALIGN_CENTRE) title.header = True sizer.Add(title, flag=wx.EXPAND|wx.TOP|wx.LEFT|wx.RIGHT, border=5) text = wx.GridSizer(2, 2) ## @var file # UI label with filename self.file = wx.StaticText(self, label='.png file') ## @var pix # UI label with size in pixels self.pix = wx.StaticText(self) ## @var file # UI label with size in mms self.mms = wx.StaticText(self) ## @var file # UI label with size in inches self.ins = wx.StaticText(self) text.Add(self.file) text.Add(self.mms, flag=wx.ALIGN_LEFT|wx.EXPAND) text.Add(self.pix, flag=wx.ALIGN_LEFT|wx.EXPAND) text.Add(self.ins, flag=wx.ALIGN_LEFT|wx.EXPAND) sizer.Add(text, flag=wx.EXPAND|wx.LEFT|wx.RIGHT, border=5) self.SetSizerAndFit(sizer)
def __init__(self, parent): FabPanel.__init__(self, parent) self.construct('Custom plane path', [ ('Resolution (pixels/mm)\n? x ? x ?', 'res', float, lambda f: f > 0), ('Diameter (mm)', 'diameter', float, lambda f: f >= 0), ('Rough stepover (0-1)', 'stepover_r', float, lambda f: 0 < f < 1), ('Finish stepover (0-1)', 'stepover_f', float, lambda f: 0 < f < 1), ('Step height (mm)', 'step', float, lambda f: f > 0), ('Tool type', 'tool', ['Flat', 'Ball']), ('Cut type', 'cut', ['Rough', 'Finish', 'Both']), ('Mode', 'mode', ['Faces', 'From view', '3x2']), ('Cuts per 180 degrees', 'cuts_per', int, lambda f: f > 1), ('Alpha', 'alpha', float), ('Beta', 'beta', float, lambda f: f >= 0 and f <= 90), ]) sizer = self.GetSizer() hs = wx.BoxSizer(wx.HORIZONTAL) get_button = wx.Button(self, wx.ID_ANY, label='Get rotation') set_button = wx.Button(self, wx.ID_ANY, label='Set rotation') get_button.Bind(wx.EVT_BUTTON, self.get_spin) set_button.Bind(wx.EVT_BUTTON, self.set_spin) hs.Add(get_button, flag=wx.LEFT | wx.TOP, border=5) hs.Add(set_button, flag=wx.LEFT | wx.TOP, border=5) sizer.Add(hs, flag=wx.CENTER | wx.BOTTOM, border=5) self._buttons = set_button, get_button self.SetSizerAndFit(sizer) self.res.Bind(wx.EVT_TEXT, self.parent.update) self.mode.Bind( wx.EVT_CHOICE, lambda e: (self.parent.update(), self.parent.invalidate()))
def __init__(self, parent): FabPanel.__init__(self, parent) self.construct('ASDF', [ ('Resolution (voxels/mm)\n', 'res', float, lambda f: f > 0)]) self.res.Bind(wx.EVT_TEXT, self.parent.update)
def __init__(self, parent): FabPanel.__init__(self, parent) self.construct('2D Path', [ ('Diameter (mm)', 'diameter', float, lambda f: f >= 0), ])