param simulator: stitch plan metadata (#2200)

pull/2213/head
Kaalleen 2023-04-08 19:14:38 +02:00 zatwierdzone przez GitHub
rodzic acdb911145
commit 36503c13e0
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
3 zmienionych plików z 16 dodań i 5 usunięć

Wyświetl plik

@ -31,9 +31,11 @@ class LetteringFrame(wx.Frame):
DEFAULT_FONT = "small_font"
def __init__(self, *args, **kwargs):
# begin wxGlade: MyFrame.__init__
self.group = kwargs.pop('group')
self.cancel_hook = kwargs.pop('on_cancel', None)
self.metadata = kwargs.pop('metadata', [])
# begin wxGlade: MyFrame.__init__
wx.Frame.__init__(self, None, wx.ID_ANY,
_("Ink/Stitch Lettering")
)
@ -492,8 +494,9 @@ class Lettering(CommandsExtension):
return group
def effect(self):
metadata = self.get_inkstitch_metadata()
app = wx.App()
frame = LetteringFrame(group=self.get_or_create_group(), on_cancel=self.cancel)
frame = LetteringFrame(group=self.get_or_create_group(), on_cancel=self.cancel, metadata=metadata)
# position left, center
current_screen = wx.Display.GetFromPoint(wx.GetMousePosition())

Wyświetl plik

@ -478,9 +478,11 @@ class SettingsFrame(wx.Frame):
lc = wx.Locale()
lc.Init(wx.LANGUAGE_DEFAULT)
# begin wxGlade: MyFrame.__init__
self.tabs_factory = kwargs.pop('tabs_factory', [])
self.cancel_hook = kwargs.pop('on_cancel', None)
self.metadata = kwargs.pop('metadata', [])
# begin wxGlade: MyFrame.__init__
wx.Frame.__init__(self, None, wx.ID_ANY,
_("Embroidery Params")
)
@ -786,8 +788,11 @@ class Params(InkstitchExtension):
def effect(self):
try:
app = wx.App()
metadata = self.get_inkstitch_metadata()
frame = SettingsFrame(
tabs_factory=self.create_tabs, on_cancel=self.cancel)
tabs_factory=self.create_tabs,
on_cancel=self.cancel,
metadata=metadata)
# position left, center
current_screen = wx.Display.GetFromPoint(wx.GetMousePosition())

Wyświetl plik

@ -805,7 +805,10 @@ class SimulatorPreview(Thread):
return
if patches and not self.refresh_needed.is_set():
stitch_plan = stitch_groups_to_stitch_plan(patches)
metadata = self.parent.metadata
collapse_len = metadata['collapse_len_mm']
min_stitch_len = metadata['min_stitch_len_mm']
stitch_plan = stitch_groups_to_stitch_plan(patches, collapse_len=collapse_len, min_stitch_len=min_stitch_len)
# GUI stuff needs to happen in the main thread, so we ask the main
# thread to call refresh_simulator().