kopia lustrzana https://github.com/inkstitch/inkstitch
Add option to disable the stitch plan cache (#2655)
Setting the cache size to 0 bypasses the cache completely. This is necessary during development to ensure newly-changed code actually gets run. Also fixes the error pane in the params gui. * make params warning pane large enough to see contents * rename sizers in preferences dialog descriptive names * add shapely version bound * add option to disable stitch plan cache * remove out-of-date wxg file * make a cache size of 0 disable the cachepull/2862/head dev-build-kaalleen-add-glyphlist-warning
rodzic
f715f2dfb0
commit
05ca4132f1
|
@ -22,7 +22,7 @@ from ..svg import (PIXELS_PER_MM, apply_transforms, convert_length,
|
|||
get_node_transform)
|
||||
from ..svg.tags import INKSCAPE_LABEL, INKSTITCH_ATTRIBS
|
||||
from ..utils import Point, cache
|
||||
from ..utils.cache import CacheKeyGenerator, get_stitch_plan_cache
|
||||
from ..utils.cache import get_stitch_plan_cache, is_cache_disabled, CacheKeyGenerator
|
||||
|
||||
|
||||
class Param(object):
|
||||
|
@ -496,6 +496,9 @@ class EmbroideryElement(object):
|
|||
|
||||
@debug.time
|
||||
def _load_cached_stitch_groups(self, previous_stitch):
|
||||
if is_cache_disabled():
|
||||
return None
|
||||
|
||||
if not self.uses_previous_stitch():
|
||||
# we don't care about the previous stitch
|
||||
previous_stitch = None
|
||||
|
@ -519,6 +522,9 @@ class EmbroideryElement(object):
|
|||
|
||||
@debug.time
|
||||
def _save_cached_stitch_groups(self, stitch_groups, previous_stitch):
|
||||
if is_cache_disabled():
|
||||
return
|
||||
|
||||
stitch_plan_cache = get_stitch_plan_cache()
|
||||
cache_key = self.get_cache_key(previous_stitch)
|
||||
if cache_key not in stitch_plan_cache:
|
||||
|
|
|
@ -30,17 +30,17 @@ class PreferencesFrame(wx.Frame):
|
|||
self.this_svg_page = wx.Panel(self.notebook, wx.ID_ANY)
|
||||
self.notebook.AddPage(self.this_svg_page, _("This SVG"))
|
||||
|
||||
sizer_1 = wx.BoxSizer(wx.VERTICAL)
|
||||
this_svg_margin = wx.BoxSizer(wx.VERTICAL)
|
||||
|
||||
# add space above and below to center sizer_2 vertically
|
||||
sizer_1.Add((0, 20), 1, wx.EXPAND, 0)
|
||||
this_svg_margin.Add((0, 20), 1, wx.EXPAND, 0)
|
||||
|
||||
sizer_2 = wx.FlexGridSizer(2, 4, 15, 10)
|
||||
sizer_1.Add(sizer_2, 0, wx.EXPAND | wx.LEFT | wx.RIGHT, 20)
|
||||
this_svg_grid = wx.FlexGridSizer(2, 4, 15, 10)
|
||||
this_svg_margin.Add(this_svg_grid, 0, wx.EXPAND | wx.LEFT | wx.RIGHT, 20)
|
||||
|
||||
label_1 = wx.StaticText(self.this_svg_page, wx.ID_ANY, _("Minimum jump stitch length"), style=wx.ALIGN_LEFT)
|
||||
label_1.SetToolTip(_("Jump stitches smaller than this will be treated as normal stitches."))
|
||||
sizer_2.Add(label_1, 1, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 15)
|
||||
this_svg_grid.Add(label_1, 1, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 15)
|
||||
|
||||
self.minimum_jump_stitch_length = wx.SpinCtrlDouble(
|
||||
self.this_svg_page, wx.ID_ANY, inc=0.1,
|
||||
|
@ -48,16 +48,16 @@ class PreferencesFrame(wx.Frame):
|
|||
style=wx.ALIGN_RIGHT | wx.SP_ARROW_KEYS
|
||||
)
|
||||
self.minimum_jump_stitch_length.SetDigits(1)
|
||||
sizer_2.Add(self.minimum_jump_stitch_length, 0, wx.ALIGN_CENTER_VERTICAL, 0)
|
||||
this_svg_grid.Add(self.minimum_jump_stitch_length, 0, wx.ALIGN_CENTER_VERTICAL, 0)
|
||||
|
||||
label_2 = wx.StaticText(self.this_svg_page, wx.ID_ANY, _("mm"))
|
||||
sizer_2.Add(label_2, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 15)
|
||||
this_svg_grid.Add(label_2, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 15)
|
||||
|
||||
self.button_1 = wx.Button(self.this_svg_page, wx.ID_ANY, _("Set As Default"))
|
||||
sizer_2.Add(self.button_1, 0, wx.ALIGN_CENTER_VERTICAL, 0)
|
||||
this_svg_grid.Add(self.button_1, 0, wx.ALIGN_CENTER_VERTICAL, 0)
|
||||
|
||||
label_3 = wx.StaticText(self.this_svg_page, wx.ID_ANY, _("Minimum stitch length"))
|
||||
sizer_2.Add(label_3, 0, 0, 0)
|
||||
this_svg_grid.Add(label_3, 0, 0, 0)
|
||||
|
||||
self.minimum_stitch_length = wx.SpinCtrlDouble(
|
||||
self.this_svg_page, wx.ID_ANY, inc=0.1,
|
||||
|
@ -65,30 +65,30 @@ class PreferencesFrame(wx.Frame):
|
|||
style=wx.ALIGN_RIGHT | wx.SP_ARROW_KEYS
|
||||
)
|
||||
self.minimum_stitch_length.SetDigits(1)
|
||||
sizer_2.Add(self.minimum_stitch_length, 0, wx.ALIGN_CENTER_VERTICAL, 0)
|
||||
this_svg_grid.Add(self.minimum_stitch_length, 0, wx.ALIGN_CENTER_VERTICAL, 0)
|
||||
|
||||
label_4 = wx.StaticText(self.this_svg_page, wx.ID_ANY, _("mm"))
|
||||
sizer_2.Add(label_4, 0, wx.ALIGN_CENTER_VERTICAL, 0)
|
||||
this_svg_grid.Add(label_4, 0, wx.ALIGN_CENTER_VERTICAL, 0)
|
||||
|
||||
self.button_2 = wx.Button(self.this_svg_page, wx.ID_ANY, _("Set As Default"))
|
||||
sizer_2.Add(self.button_2, 0, wx.ALIGN_CENTER_VERTICAL, 0)
|
||||
this_svg_grid.Add(self.button_2, 0, wx.ALIGN_CENTER_VERTICAL, 0)
|
||||
|
||||
sizer_1.Add((0, 20), 1, wx.EXPAND, 0)
|
||||
this_svg_margin.Add((0, 20), 1, wx.EXPAND, 0)
|
||||
|
||||
self.global_page = wx.Panel(self.notebook, wx.ID_ANY)
|
||||
self.notebook.AddPage(self.global_page, _("Global"))
|
||||
|
||||
sizer_3 = wx.BoxSizer(wx.VERTICAL)
|
||||
global_margin = wx.BoxSizer(wx.VERTICAL)
|
||||
|
||||
# add space above and below to center sizer_4 vertically
|
||||
sizer_3.Add((0, 20), 1, wx.EXPAND, 0)
|
||||
global_margin.Add((0, 20), 1, wx.EXPAND, 0)
|
||||
|
||||
sizer_4 = wx.FlexGridSizer(3, 4, 15, 10)
|
||||
sizer_3.Add(sizer_4, 0, wx.EXPAND | wx.LEFT | wx.RIGHT, 20)
|
||||
global_grid_sizer = wx.FlexGridSizer(3, 4, 15, 10)
|
||||
global_margin.Add(global_grid_sizer, 0, wx.EXPAND | wx.LEFT | wx.RIGHT, 20)
|
||||
|
||||
label_5 = wx.StaticText(self.global_page, wx.ID_ANY, _("Default minimum jump stitch length"), style=wx.ALIGN_LEFT)
|
||||
label_5.SetToolTip(_("Jump stitches smaller than this will be treated as normal stitches."))
|
||||
sizer_4.Add(label_5, 1, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 15)
|
||||
global_grid_sizer.Add(label_5, 1, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 15)
|
||||
|
||||
self.default_minimum_jump_stitch_length = wx.SpinCtrlDouble(
|
||||
self.global_page, wx.ID_ANY, inc=0.1,
|
||||
|
@ -96,15 +96,15 @@ class PreferencesFrame(wx.Frame):
|
|||
style=wx.ALIGN_RIGHT | wx.SP_ARROW_KEYS
|
||||
)
|
||||
self.default_minimum_jump_stitch_length.SetDigits(1)
|
||||
sizer_4.Add(self.default_minimum_jump_stitch_length, 0, wx.ALIGN_CENTER_VERTICAL, 0)
|
||||
global_grid_sizer.Add(self.default_minimum_jump_stitch_length, 0, wx.ALIGN_CENTER_VERTICAL, 0)
|
||||
|
||||
label_6 = wx.StaticText(self.global_page, wx.ID_ANY, _("mm"))
|
||||
sizer_4.Add(label_6, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 15)
|
||||
global_grid_sizer.Add(label_6, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 15)
|
||||
|
||||
sizer_4.Add((0, 0), 0, 0, 0)
|
||||
global_grid_sizer.Add((0, 0), 0, 0, 0)
|
||||
|
||||
label_7 = wx.StaticText(self.global_page, wx.ID_ANY, _("Minimum stitch length"))
|
||||
sizer_4.Add(label_7, 0, wx.ALIGN_CENTER_VERTICAL, 0)
|
||||
global_grid_sizer.Add(label_7, 0, wx.ALIGN_CENTER_VERTICAL, 0)
|
||||
|
||||
self.default_minimum_stitch_length = wx.SpinCtrlDouble(
|
||||
self.global_page, wx.ID_ANY, inc=0.1,
|
||||
|
@ -112,16 +112,15 @@ class PreferencesFrame(wx.Frame):
|
|||
style=wx.ALIGN_RIGHT | wx.SP_ARROW_KEYS
|
||||
)
|
||||
self.default_minimum_stitch_length.SetDigits(1)
|
||||
sizer_4.Add(self.default_minimum_stitch_length, 0, wx.ALIGN_CENTER_VERTICAL, 0)
|
||||
global_grid_sizer.Add(self.default_minimum_stitch_length, 0, wx.ALIGN_CENTER_VERTICAL, 0)
|
||||
|
||||
label_8 = wx.StaticText(self.global_page, wx.ID_ANY, _("mm"))
|
||||
sizer_4.Add(label_8, 0, wx.ALIGN_CENTER_VERTICAL, 0)
|
||||
global_grid_sizer.Add(label_8, 0, wx.ALIGN_CENTER_VERTICAL, 0)
|
||||
|
||||
sizer_4.Add((0, 20), 0, 0, 0)
|
||||
global_grid_sizer.Add((0, 20), 0, 0, 0)
|
||||
|
||||
label_9 = wx.StaticText(self.global_page, wx.ID_ANY, _("Stitch plan cache size"), style=wx.ALIGN_LEFT)
|
||||
label_9.SetToolTip(_("Jump stitches smaller than this will be treated as normal stitches."))
|
||||
sizer_4.Add(label_9, 1, wx.ALIGN_CENTER_VERTICAL, 0)
|
||||
label_9 = wx.StaticText(self.global_page, wx.ID_ANY, _("Stitch plan cache size (0 to disable cache)"), style=wx.ALIGN_LEFT)
|
||||
global_grid_sizer.Add(label_9, 1, wx.ALIGN_CENTER_VERTICAL, 0)
|
||||
|
||||
self.stitch_plan_cache_size = wx.SpinCtrl(
|
||||
self.global_page, wx.ID_ANY,
|
||||
|
@ -129,15 +128,15 @@ class PreferencesFrame(wx.Frame):
|
|||
style=wx.ALIGN_RIGHT | wx.SP_ARROW_KEYS
|
||||
)
|
||||
self.stitch_plan_cache_size.SetIncrement(10)
|
||||
sizer_4.Add(self.stitch_plan_cache_size, 0, wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_RIGHT, 0)
|
||||
global_grid_sizer.Add(self.stitch_plan_cache_size, 0, wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_RIGHT, 0)
|
||||
|
||||
label_10 = wx.StaticText(self.global_page, wx.ID_ANY, _("MB"))
|
||||
sizer_4.Add(label_10, 0, wx.ALIGN_CENTER_VERTICAL, 0)
|
||||
global_grid_sizer.Add(label_10, 0, wx.ALIGN_CENTER_VERTICAL, 0)
|
||||
|
||||
self.clear_cache_button = wx.Button(self.global_page, wx.ID_ANY, _("Clear Stitch Plan Cache"))
|
||||
sizer_4.Add(self.clear_cache_button, 0, wx.ALIGN_CENTER_VERTICAL, 0)
|
||||
global_grid_sizer.Add(self.clear_cache_button, 0, wx.ALIGN_CENTER_VERTICAL, 0)
|
||||
|
||||
sizer_3.Add((0, 0), 1, wx.EXPAND, 0)
|
||||
global_margin.Add((0, 0), 1, wx.EXPAND, 0)
|
||||
|
||||
button_sizer = wx.BoxSizer(wx.HORIZONTAL)
|
||||
main_sizer.Add(button_sizer, 0, wx.BOTTOM | wx.EXPAND | wx.LEFT | wx.RIGHT, 10)
|
||||
|
@ -150,13 +149,13 @@ class PreferencesFrame(wx.Frame):
|
|||
self.ok_button = wx.Button(self.panel_1, wx.ID_OK, "")
|
||||
button_sizer.Add(self.ok_button, 0, 0, 0)
|
||||
|
||||
sizer_4.AddGrowableCol(0)
|
||||
global_grid_sizer.AddGrowableCol(0)
|
||||
|
||||
self.global_page.SetSizer(sizer_3)
|
||||
self.global_page.SetSizer(global_margin)
|
||||
|
||||
sizer_2.AddGrowableCol(0)
|
||||
this_svg_grid.AddGrowableCol(0)
|
||||
|
||||
self.this_svg_page.SetSizer(sizer_1)
|
||||
self.this_svg_page.SetSizer(this_svg_margin)
|
||||
|
||||
self.panel_1.SetSizer(main_sizer)
|
||||
|
||||
|
@ -193,6 +192,8 @@ class PreferencesFrame(wx.Frame):
|
|||
stitch_plan_cache = get_stitch_plan_cache()
|
||||
stitch_plan_cache.size_limit = int(global_settings['cache_size'] * 1024 * 1024)
|
||||
stitch_plan_cache.cull()
|
||||
if not global_settings['cache_size']:
|
||||
stitch_plan_cache.clear(retry=True)
|
||||
|
||||
def cancel_button_clicked(self, event):
|
||||
self.Destroy()
|
||||
|
|
|
@ -1,305 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<!-- generated by wxGlade 1.0.5 on Tue Aug 15 00:11:05 2023 -->
|
||||
|
||||
<application class="PreferencesApp" encoding="UTF-8" for_version="3.0" header_extension=".h" indent_amount="4" indent_symbol="space" is_template="0" language="python" mark_blocks="1" name="app" option="0" overwrite="1" path="/home/lex/repos/inkstitch/lib/gui/preferences.py" source_extension=".cpp" top_window="frame" use_gettext="1" use_new_namespace="1">
|
||||
<object class="PreferencesFrame" name="frame" base="EditFrame">
|
||||
<extracode_post>self.SetSizeHints(main_sizer.CalcMin())</extracode_post>
|
||||
<title>Preferences</title>
|
||||
<style>wxDEFAULT_FRAME_STYLE</style>
|
||||
<object class="wxPanel" name="panel_1" base="EditPanel">
|
||||
<object class="wxBoxSizer" name="main_sizer" base="EditBoxSizer">
|
||||
<orient>wxVERTICAL</orient>
|
||||
<object class="sizeritem">
|
||||
<option>1</option>
|
||||
<border>10</border>
|
||||
<flag>wxALL|wxEXPAND</flag>
|
||||
<object class="wxNotebook" name="notebook" base="EditNotebook">
|
||||
<style>wxNB_TOP</style>
|
||||
<tabs>
|
||||
<tab window="this_svg_page">This SVG</tab>
|
||||
<tab window="global_page">Global</tab>
|
||||
</tabs>
|
||||
<object class="wxPanel" name="this_svg_page" base="EditPanel">
|
||||
<style>wxTAB_TRAVERSAL</style>
|
||||
<object class="wxBoxSizer" name="sizer_1" base="EditBoxSizer">
|
||||
<orient>wxVERTICAL</orient>
|
||||
<object class="sizeritem">
|
||||
<option>1</option>
|
||||
<border>0</border>
|
||||
<flag>wxEXPAND</flag>
|
||||
<object class="spacer" name="spacer" base="EditSpacer">
|
||||
<extracode_pre># add space above and below to center sizer_2 vertically</extracode_pre>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem">
|
||||
<option>0</option>
|
||||
<border>20</border>
|
||||
<flag>wxLEFT|wxRIGHT|wxEXPAND</flag>
|
||||
<object class="wxFlexGridSizer" name="sizer_2" base="EditFlexGridSizer">
|
||||
<rows>2</rows>
|
||||
<cols>4</cols>
|
||||
<vgap>15</vgap>
|
||||
<hgap>10</hgap>
|
||||
<growable_cols>0</growable_cols>
|
||||
<object class="sizeritem">
|
||||
<option>1</option>
|
||||
<border>15</border>
|
||||
<flag>wxRIGHT|wxALIGN_CENTER_VERTICAL</flag>
|
||||
<object class="wxStaticText" name="label_1" base="EditStaticText">
|
||||
<tooltip>Jump stitches smaller than this will be treated as normal stitches.</tooltip>
|
||||
<style>wxALIGN_LEFT</style>
|
||||
<label>Minimum jump stitch length</label>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem">
|
||||
<option>0</option>
|
||||
<border>0</border>
|
||||
<flag>wxALIGN_CENTER_VERTICAL</flag>
|
||||
<object class="wxSpinCtrlDouble" name="minimum_jump_stitch_length" base="EditSpinCtrlDouble">
|
||||
<style>wxSP_ARROW_KEYS|wxALIGN_RIGHT</style>
|
||||
<value>0.0</value>
|
||||
<digits>1</digits>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem">
|
||||
<option>0</option>
|
||||
<border>15</border>
|
||||
<flag>wxRIGHT|wxALIGN_CENTER_VERTICAL</flag>
|
||||
<object class="wxStaticText" name="label_2" base="EditStaticText">
|
||||
<label>mm</label>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem">
|
||||
<option>0</option>
|
||||
<border>0</border>
|
||||
<flag>wxALIGN_CENTER_VERTICAL</flag>
|
||||
<object class="wxButton" name="button_1" base="EditButton">
|
||||
<events>
|
||||
<handler event="EVT_BUTTON">set_as_default_minimum_jump_stitch_length</handler>
|
||||
</events>
|
||||
<label>Set As Default</label>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem">
|
||||
<option>0</option>
|
||||
<border>0</border>
|
||||
<object class="wxStaticText" name="label_3" base="EditStaticText">
|
||||
<label>Minimum stitch length</label>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem">
|
||||
<option>0</option>
|
||||
<border>0</border>
|
||||
<flag>wxALIGN_CENTER_VERTICAL</flag>
|
||||
<object class="wxSpinCtrlDouble" name="minimum_stitch_length" base="EditSpinCtrlDouble">
|
||||
<style>wxSP_ARROW_KEYS|wxALIGN_RIGHT</style>
|
||||
<range>0.0, 100.0</range>
|
||||
<value>0.0</value>
|
||||
<digits>1</digits>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem">
|
||||
<option>0</option>
|
||||
<border>0</border>
|
||||
<flag>wxALIGN_CENTER_VERTICAL</flag>
|
||||
<object class="wxStaticText" name="label_4" base="EditStaticText">
|
||||
<label>mm</label>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem">
|
||||
<option>0</option>
|
||||
<border>0</border>
|
||||
<flag>wxALIGN_CENTER_VERTICAL</flag>
|
||||
<object class="wxButton" name="button_2" base="EditButton">
|
||||
<events>
|
||||
<handler event="EVT_BUTTON">set_as_default_minimum_stitch_length</handler>
|
||||
</events>
|
||||
<label>Set As Default</label>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem">
|
||||
<option>1</option>
|
||||
<border>0</border>
|
||||
<flag>wxEXPAND</flag>
|
||||
<object class="spacer" name="spacer" base="EditSpacer">
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="wxPanel" name="global_page" base="EditPanel">
|
||||
<style>wxTAB_TRAVERSAL</style>
|
||||
<object class="wxBoxSizer" name="sizer_3" base="EditBoxSizer">
|
||||
<orient>wxVERTICAL</orient>
|
||||
<object class="sizeritem">
|
||||
<option>1</option>
|
||||
<border>0</border>
|
||||
<flag>wxEXPAND</flag>
|
||||
<object class="spacer" name="spacer" base="EditSpacer">
|
||||
<extracode_pre># add space above and below to center sizer_4 vertically</extracode_pre>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem">
|
||||
<option>0</option>
|
||||
<border>20</border>
|
||||
<flag>wxLEFT|wxRIGHT|wxEXPAND</flag>
|
||||
<object class="wxFlexGridSizer" name="sizer_4" base="EditFlexGridSizer">
|
||||
<rows>3</rows>
|
||||
<cols>4</cols>
|
||||
<vgap>15</vgap>
|
||||
<hgap>10</hgap>
|
||||
<growable_cols>0</growable_cols>
|
||||
<object class="sizeritem">
|
||||
<option>1</option>
|
||||
<border>15</border>
|
||||
<flag>wxRIGHT|wxALIGN_CENTER_VERTICAL</flag>
|
||||
<object class="wxStaticText" name="label_5" base="EditStaticText">
|
||||
<tooltip>Jump stitches smaller than this will be treated as normal stitches.</tooltip>
|
||||
<style>wxALIGN_LEFT</style>
|
||||
<label>Default minimum jump stitch length</label>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem">
|
||||
<option>0</option>
|
||||
<border>0</border>
|
||||
<flag>wxALIGN_CENTER_VERTICAL</flag>
|
||||
<object class="wxSpinCtrlDouble" name="default_minimum_jump_stitch_length_copy" base="EditSpinCtrlDouble">
|
||||
<style>wxSP_ARROW_KEYS|wxALIGN_RIGHT</style>
|
||||
<range>0.0, 100.0</range>
|
||||
<value>0.0</value>
|
||||
<digits>1</digits>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem">
|
||||
<option>0</option>
|
||||
<border>15</border>
|
||||
<flag>wxRIGHT|wxALIGN_CENTER_VERTICAL</flag>
|
||||
<object class="wxStaticText" name="label_6" base="EditStaticText">
|
||||
<label>mm</label>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizerslot" />
|
||||
<object class="sizeritem">
|
||||
<option>0</option>
|
||||
<border>0</border>
|
||||
<flag>wxALIGN_CENTER_VERTICAL</flag>
|
||||
<object class="wxStaticText" name="label_7" base="EditStaticText">
|
||||
<label>Minimum stitch length</label>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem">
|
||||
<option>0</option>
|
||||
<border>0</border>
|
||||
<flag>wxALIGN_CENTER_VERTICAL</flag>
|
||||
<object class="wxSpinCtrlDouble" name="default_minimum_stitch_length" base="EditSpinCtrlDouble">
|
||||
<style>wxSP_ARROW_KEYS|wxALIGN_RIGHT</style>
|
||||
<range>0.0, 100.0</range>
|
||||
<value>0.0</value>
|
||||
<digits>1</digits>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem">
|
||||
<option>0</option>
|
||||
<border>0</border>
|
||||
<flag>wxALIGN_CENTER_VERTICAL</flag>
|
||||
<object class="wxStaticText" name="label_8" base="EditStaticText">
|
||||
<label>mm</label>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizerslot" />
|
||||
<object class="sizeritem">
|
||||
<option>1</option>
|
||||
<border>0</border>
|
||||
<flag>wxALIGN_CENTER_VERTICAL</flag>
|
||||
<object class="wxStaticText" name="label_9" base="EditStaticText">
|
||||
<tooltip>Jump stitches smaller than this will be treated as normal stitches.</tooltip>
|
||||
<style>wxALIGN_LEFT</style>
|
||||
<label>Stitch plan cache size</label>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem">
|
||||
<option>0</option>
|
||||
<border>0</border>
|
||||
<flag>wxALIGN_CENTER_VERTICAL</flag>
|
||||
<object class="wxSpinCtrlDouble" name="stitch_plan_cache_size" base="EditSpinCtrlDouble">
|
||||
<style>wxSP_ARROW_KEYS|wxALIGN_RIGHT</style>
|
||||
<range>0.0, 100.0</range>
|
||||
<value>0.0</value>
|
||||
<digits>1</digits>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem">
|
||||
<option>0</option>
|
||||
<border>0</border>
|
||||
<flag>wxALIGN_CENTER_VERTICAL</flag>
|
||||
<object class="wxStaticText" name="label_10" base="EditStaticText">
|
||||
<label>MB</label>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem">
|
||||
<option>0</option>
|
||||
<border>0</border>
|
||||
<flag>wxALIGN_CENTER_VERTICAL</flag>
|
||||
<object class="wxButton" name="button_3" base="EditButton">
|
||||
<label>Clear Stitch Plan Cache</label>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem">
|
||||
<option>1</option>
|
||||
<border>0</border>
|
||||
<flag>wxEXPAND</flag>
|
||||
<object class="spacer" name="spacer" base="EditSpacer">
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem">
|
||||
<option>0</option>
|
||||
<border>10</border>
|
||||
<flag>wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND</flag>
|
||||
<object class="wxBoxSizer" name="button_sizer" base="EditBoxSizer">
|
||||
<orient>wxHORIZONTAL</orient>
|
||||
<object class="sizeritem">
|
||||
<option>1</option>
|
||||
<border>0</border>
|
||||
<object class="spacer" name="spacer" base="EditSpacer">
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem">
|
||||
<option>0</option>
|
||||
<border>10</border>
|
||||
<flag>wxRIGHT</flag>
|
||||
<object class="wxButton" name="button_4" base="EditButton">
|
||||
<label>button_4</label>
|
||||
<stockitem>CANCEL</stockitem>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem">
|
||||
<option>0</option>
|
||||
<border>0</border>
|
||||
<object class="wxButton" name="button_5" base="EditButton">
|
||||
<label>button_5</label>
|
||||
<stockitem>OK</stockitem>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</application>
|
|
@ -23,7 +23,7 @@ class WarningPanel(wx.Panel):
|
|||
self.main_sizer.Add(self.warning, 1, wx.LEFT | wx.BOTTOM | wx.EXPAND, 10)
|
||||
|
||||
tc_style = wx.TE_MULTILINE | wx.TE_READONLY | wx.VSCROLL | wx.TE_RICH2
|
||||
self.warning_text = wx.TextCtrl(self, size=(300, 100), style=tc_style)
|
||||
self.warning_text = wx.TextCtrl(self, size=(300, 300), style=tc_style)
|
||||
font = self.warning_text.GetFont()
|
||||
font.SetFamily(wx.FONTFAMILY_TELETYPE)
|
||||
self.warning_text.SetFont(font)
|
||||
|
|
|
@ -39,6 +39,10 @@ def get_stitch_plan_cache():
|
|||
return __stitch_plan_cache
|
||||
|
||||
|
||||
def is_cache_disabled():
|
||||
return not global_settings['cache_size']
|
||||
|
||||
|
||||
class CacheKeyGenerator(object):
|
||||
"""Generate cache keys given arbitrary data.
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ DEFAULT_METADATA = {
|
|||
|
||||
DEFAULT_SETTINGS = {
|
||||
"cache_size": 100,
|
||||
"pop_out_simulator": False
|
||||
"pop_out_simulator": False,
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ wxPython>=4.1.1
|
|||
|
||||
backports.functools_lru_cache
|
||||
networkx
|
||||
shapely
|
||||
shapely>=2.0.0
|
||||
lxml
|
||||
appdirs
|
||||
numpy
|
||||
|
|
Ładowanie…
Reference in New Issue