kopia lustrzana https://github.com/hdacosta400/intelligent-textiles
added new commands
rodzic
a25c86c46e
commit
dc8d9f86f2
|
@ -37,6 +37,7 @@ from .stitch_plan_preview import StitchPlanPreview
|
|||
from .zip import Zip
|
||||
from .sensor_grid import SensorGrid
|
||||
from .create_grid import CreateGrid
|
||||
from .combine_grids import CombineGrids
|
||||
__all__ = extensions = [StitchPlanPreview,
|
||||
Install,
|
||||
Params,
|
||||
|
@ -69,4 +70,5 @@ __all__ = extensions = [StitchPlanPreview,
|
|||
DuplicateParams,
|
||||
EmbroiderSettings,
|
||||
SensorGrid,
|
||||
CreateGrid]
|
||||
CreateGrid,
|
||||
CombineGrids]
|
||||
|
|
|
@ -0,0 +1,49 @@
|
|||
from .base import InkstitchExtension
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
from base64 import b64decode
|
||||
from argparse import ArgumentParser, REMAINDER
|
||||
|
||||
import appdirs
|
||||
import inkex
|
||||
from inkex import Line, Rectangle, Path
|
||||
import wx
|
||||
import wx.adv
|
||||
from lxml import etree
|
||||
|
||||
from ..elements import nodes_to_elements
|
||||
from ..gui import PresetsPanel, SimulatorPreview, info_dialog
|
||||
from ..i18n import _
|
||||
from ..lettering import Font, FontError
|
||||
from ..svg import get_correction_transform
|
||||
from ..svg.tags import (INKSCAPE_LABEL, INKSTITCH_LETTERING, SVG_GROUP_TAG,
|
||||
SVG_PATH_TAG)
|
||||
from ..utils import DotDict, cache, get_bundled_dir, get_resource_dir
|
||||
from .commands import CommandsExtension
|
||||
from .lettering_custom_font_dir import get_custom_font_dir
|
||||
|
||||
|
||||
class CombineGrids(InkstitchExtension):
|
||||
COMMANDS = ["combine_grids"]
|
||||
def __init__(self, *args, **kwargs):
|
||||
self.cancelled = False
|
||||
InkstitchExtension.__init__(self, *args, **kwargs)
|
||||
for command in self.COMMANDS:
|
||||
self.arg_parser.add_argument("--%s" % command, type=inkex.Boolean)
|
||||
def cancel(self):
|
||||
self.cancelled = True
|
||||
def effect(self):
|
||||
pass
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
inkex.errormsg(sys.argv[1:])
|
||||
parser = ArgumentParser()
|
||||
parser.add_argument("--horizontal_wires")
|
||||
parser.add_argument("--vertical_wires")
|
||||
parser.add_argument('args', nargs=REMAINDER)
|
||||
args, _ = parser.parse_known_args()
|
||||
inkex.errormsg("args:{}".format(args))
|
||||
CombineGrids(args.horizontal_wires, args.vertical_wires).run()
|
|
@ -0,0 +1,17 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<inkscape-extension translationdomain="inkstitch" xmlns="http://www.inkscape.org/namespace/inkscape/extension">
|
||||
<name>Combine Grids</name>
|
||||
<id>org.inkstitch.combine_grids</id>
|
||||
<param name="extension" type="string" gui-hidden="true">combine_grids</param>
|
||||
<effect implements-custom-gui="true">
|
||||
<object-type>all</object-type>
|
||||
<effects-menu>
|
||||
<submenu name="Ink/Stitch" translatable="no">
|
||||
<submenu name="Sensor Grid Tools" />
|
||||
</submenu>
|
||||
</effects-menu>
|
||||
</effect>
|
||||
<script>
|
||||
{{ command_tag | safe }}
|
||||
</script>
|
||||
</inkscape-extension>
|
|
@ -2,11 +2,13 @@
|
|||
<inkscape-extension translationdomain="inkstitch" xmlns="http://www.inkscape.org/namespace/inkscape/extension">
|
||||
<name>Create Grid</name>
|
||||
<id>org.inkstitch.create_grid</id>
|
||||
<param name="extension" type="string" gui-hidden="true">create_grid</param>
|
||||
<effect implements-custom-gui="true">
|
||||
<object-type>all</object-type>
|
||||
<effects-menu>
|
||||
<submenu name="Ink/Stitch" translatable="no" />
|
||||
<submenu name="Ink/Stitch" translatable="no">
|
||||
<submenu name="Sensor Grid Tools" />
|
||||
</submenu>
|
||||
</effects-menu>
|
||||
</effect>
|
||||
<script>
|
||||
|
|
|
@ -2,12 +2,13 @@
|
|||
<inkscape-extension translationdomain="inkstitch" xmlns="http://www.inkscape.org/namespace/inkscape/extension">
|
||||
<name>Sensor Grid</name>
|
||||
<id>org.inkstitch.sensor_grid</id>
|
||||
<!-- <param name="horizontal_wires" type="int" min="1" gui-text="Number of horizontal wires:" gui-hidden="false">1</param>
|
||||
<param name="vertical_wires" type="int" min="1" gui-text="Number of vertical wires:">1</param> -->
|
||||
<param name="extension" type="string" gui-hidden="true">sensor_grid</param>
|
||||
<effect implements-custom-gui="true">
|
||||
<object-type>all</object-type>
|
||||
<effects-menu>
|
||||
<submenu name="Ink/Stitch" translatable="no" />
|
||||
<submenu name="Ink/Stitch" translatable="no">
|
||||
<submenu name="Sensor Grid Tools" />
|
||||
</submenu>
|
||||
</effects-menu>
|
||||
</effect>
|
||||
<script>
|
||||
|
|
Ładowanie…
Reference in New Issue