2018-12-16 01:21:41 +00:00
|
|
|
from ..gui import show_simulator
|
2018-04-29 01:26:53 +00:00
|
|
|
from ..stitch_plan import patches_to_stitch_plan
|
2018-12-16 01:21:41 +00:00
|
|
|
from .base import InkstitchExtension
|
2018-04-29 01:26:53 +00:00
|
|
|
|
|
|
|
|
|
|
|
class Simulate(InkstitchExtension):
|
|
|
|
def __init__(self):
|
|
|
|
InkstitchExtension.__init__(self)
|
|
|
|
self.OptionParser.add_option("-P", "--path",
|
|
|
|
action="store", type="string",
|
|
|
|
dest="path", default=".",
|
|
|
|
help="Directory in which to store output file")
|
|
|
|
|
|
|
|
def effect(self):
|
|
|
|
if not self.get_elements():
|
|
|
|
return
|
|
|
|
patches = self.elements_to_patches(self.elements)
|
|
|
|
stitch_plan = patches_to_stitch_plan(patches)
|
2018-09-01 17:35:47 +00:00
|
|
|
show_simulator(stitch_plan)
|