Skip to content

Commit

Permalink
v 3.3.0
Browse files Browse the repository at this point in the history
Add AxiDraw V3/B6 as standard model
Remove deprecated LooseVersion function from distutils
Update plotink
  • Loading branch information
oskay committed Jun 13, 2022
1 parent 0a73b73 commit 272634d
Show file tree
Hide file tree
Showing 9 changed files with 82 additions and 35 deletions.
7 changes: 4 additions & 3 deletions cli/axicli/axidraw_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
from plotink.plot_utils_import import from_dependency_import # plotink
exit_status = from_dependency_import("ink_extensions_utils.exit_status")

cli_version = "AxiDraw Command Line Interface 3.2.1"
cli_version = "AxiDraw Command Line Interface 3.3.0"

quick_help = '''
Basic syntax to plot a file: axicli svg_in [OPTIONS]
Expand Down Expand Up @@ -198,9 +198,10 @@ def axidraw_CLI(dev = False):

parser.add_argument("-L","--model",\
metavar='MODELCODE', type=int,\
help="AxiDraw Model (1-6). 1: AxiDraw V2 or V3. " \
help="AxiDraw Model (1-7). 1: AxiDraw V2, V3, or SE/A4. " \
+ "2:AxiDraw V3/A3 or SE/A3. 3: AxiDraw V3 XLX. " \
+ "4:AxiDraw MiniKit. 5:AxiDraw SE/A1. 6: AxiDraw SE/A2.")
+ "4:AxiDraw MiniKit. 5:AxiDraw SE/A1. 6: AxiDraw SE/A2. " \
+ "7:AxiDraw V3/B6." )

parser.add_argument("-p","--port",\
metavar='PORTNAME', type=str,\
Expand Down
26 changes: 26 additions & 0 deletions cli/pyaxidraw/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,32 @@ Please see https://axidraw.com/doc/cli_api/ for full documentation

=========================================

v 3.3 (June 2022)

Expand model option values with AxiDraw V3/B6.

v 3.2 (February 2022)

Expand model option values with AxiDraw SE/A1, SE/A2.

Improved model for time duration of raising/lowering pen-lift servo motor;
two adjustable parameters added to the configuration file.

New walk_home command added to the list of manual commands.

Plots underway can now be paused with Control+C in addition to the physical pause button.


v 3.1 (January 2022)

New plot digest feature: The digest option can enable saving a plot digest,
rather than the full SVG output

New Webhook notifications feature. Added webhook and webhook_url options.

New parameter in the axidraw_conf.py configuration file: report_lifts enables
reporting the number of pen lifts in a plot.

v 3.0 (October 2021)

Significant changes to plot optimization:
Expand Down
2 changes: 1 addition & 1 deletion cli/requirements/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ future==0.18.2
idna==3.3
ink-extensions==1.1.0
lxml==4.6.5
plotink==1.5.0
plotink==1.6.1
pyserial==3.5
requests==2.26.0
urllib3==1.26.7
23 changes: 18 additions & 5 deletions cli/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,24 @@ def replacement_setup(*args, **kwargs):
pkg_pattern = re.compile('(?P<pkg>[a-zA-Z]*)-[0-9]')
for wheel_file in glob.glob(path.join(depdir, "*")):
pkg_name = pkg_pattern.search(wheel_file).group('pkg')
pip_prefix = [sys.executable, '-m', 'pip']
try:
subprocess.check_call(
[sys.executable, '-m', 'pip', 'uninstall', '--yes', pkg_name])
subprocess.check_call(pip_prefix + ['uninstall', '--yes', pkg_name])
except subprocess.CalledProcessError: # Will be raised if there is no version to uninstall
pass
subprocess.check_call([sys.executable, '-m', 'pip', 'install', wheel_file])
try:
subprocess.run(pip_prefix + ['install', wheel_file],
capture_output=True, check=True)
except subprocess.CalledProcessError as cpe:
# in certain cases, if the user has attempted to install AxiCli with the --user
# flag, there is an error due to not propagating this flag. In this case,
# try installing again with --user. See
# https://github.com/evil-mad/axidraw/issues/119 and
# https://gitlab.com/evil-mad/AxiCli/-/issues/84
if "--user" in str(cpe.stderr):
subprocess.run(pip_prefix + ['install', '--user', wheel_file], check=True)
else:
raise
except (AttributeError, subprocess.CalledProcessError) as err:
if sys.version_info < (3, 6):
pass # pip has a standard message for this situation (see `python_requires` arg below)
Expand All @@ -57,7 +69,7 @@ def replacement_setup(*args, **kwargs):

replacement_setup(
name='axicli',
version='3.2.1',
version='3.3.0',
python_requires='>=3.6.0',
long_description=long_description,
long_description_content_type='text/plain',
Expand All @@ -69,14 +81,15 @@ def replacement_setup(*args, **kwargs):
# this only includes publicly available dependencies
'ink_extensions>=1.1.0',
'lxml>=4.6.5',
'plotink>=1.5.0',
'plotink>=1.6.1',
'pyserial>=3.5',
'requests', # just for the certificates for now
],
extras_require=extras_require,
entry_points={
'console_scripts': [
'axicli = axicli.__main__:axidraw_CLI',
'htacli = axicli.__main__:hta_CLI',
]
},
)
3 changes: 2 additions & 1 deletion inkscape driver/axidraw.inx
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ _gui-text="Pen height: DOWN, (%):">30</param>
<param name="model" type="optiongroup" appearance="minimal" indent="1" _gui-text="AxiDraw model:">
<_option value="1">AxiDraw V2, V3, or SE/A4</_option>
<_option value="2">AxiDraw V3/A3 or SE/A3</_option>
<_option value="7">AxiDraw V3/B6</_option>
<_option value="4">AxiDraw MiniKit</_option>
<_option value="5">AxiDraw SE/A1</_option>
<_option value="6">AxiDraw SE/A2</_option>
Expand Down Expand Up @@ -258,7 +259,7 @@ the Return to Home Corner command.

</param>
<_param name="copyright" type="description" indent="5" xml:space="preserve"
>Version 3.2.2 — Copyright 2022 Evil Mad Scientist</_param>
>Version 3.3.0 — Copyright 2022 Evil Mad Scientist</_param>



Expand Down
5 changes: 4 additions & 1 deletion inkscape driver/axidraw.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def __init__(self, default_logging=True, user_message_fun=message.emit, params=N
self.OptionParser.add_option_group(
common_options.core_mode_options(self.OptionParser, params.__dict__))

self.version_string = "3.2.2" # Dated 2022-05-14
self.version_string = "3.3.0" # Dated 2022-06-11

self.spew_debugdata = False

Expand Down Expand Up @@ -197,6 +197,9 @@ def update_options(self):
elif self.options.model == 6:
self.x_bounds_max = self.params.x_travel_SEA2
self.y_bounds_max = self.params.y_travel_SEA2
elif self.options.model == 7:
self.x_bounds_max = self.params.x_travel_V3B6
self.y_bounds_max = self.params.y_travel_V3B6
else:
self.x_bounds_max = self.params.x_travel_default
self.y_bounds_max = self.params.y_travel_default
Expand Down
31 changes: 17 additions & 14 deletions inkscape driver/axidraw_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,26 +150,29 @@
adjusted in everyday use. That said, proceed with caution, and keep a backup copy.
'''

# Page size values typically do not need to be changed. They primarily affect viewpoint and centering.
# Measured in page pixelssteps. Default printable area for AxiDraw is 300 x 218 mm
# Travel area limits typically do not need to be changed.
# For each model, there is an X travel and Y travel limit, given in inches.

x_travel_default = 11.81 # AxiDraw V2, V3: X Carriage travel, inches. Default: 11.81 (300 mm)
y_travel_default = 8.58 # AxiDraw V2, V3: Y Carriage travel, inches. Default: 8.58 (218 mm)
x_travel_default = 11.81 # AxiDraw V2, V3, SE/A4: X. Default: 11.81 in (300 mm)
y_travel_default = 8.58 # AxiDraw V2, V3, SE/A4: Y. Default: 8.58 in (218 mm)

x_travel_V3A3 = 16.93 # V3/A3 and SE/A3: X Carriage travel, inches. Default: 16.93 (430 mm)
y_travel_V3A3 = 11.69 # V3/A3 and SE/A3: Y Carriage travel, inches. Default: 11.69 (297 mm)
x_travel_V3A3 = 16.93 # V3/A3 and SE/A3: X Default: 16.93 in (430 mm)
y_travel_V3A3 = 11.69 # V3/A3 and SE/A3: Y Default: 11.69 in (297 mm)

x_travel_V3XLX = 23.42 # AxiDraw V3 XLX: X Carriage travel, inches. Default: 23.42 (595 mm
y_travel_V3XLX = 8.58 # AxiDraw V3 XLX: Y Carriage travel, inches. Default: 8.58 (218 mm)
x_travel_V3XLX = 23.42 # AxiDraw V3 XLX: X Default: 23.42 in (595 mm)
y_travel_V3XLX = 8.58 # AxiDraw V3 XLX: Y Default: 8.58 in (218 mm)

x_travel_MiniKit = 6.30 # AxiDraw MiniKit: X Carriage travel, inches. Default: 6.30 (160 mm)
y_travel_MiniKit = 4.00 # AxiDraw MiniKit: Y Carriage travel, inches. Default: 4.00 (101.6 mm)
x_travel_MiniKit = 6.30 # AxiDraw MiniKit: X Default: 6.30 in (160 mm)
y_travel_MiniKit = 4.00 # AxiDraw MiniKit: Y Default: 4.00 in (101.6 mm)

x_travel_SEA1 = 34.02 # AxiDraw SE/A1: X Carriage travel, inches. Default: 34.02 (864 mm)
y_travel_SEA1 = 23.39 # AxiDraw SE/A1: Y Carriage travel, inches. Default: 23.39 (594 mm)
x_travel_SEA1 = 34.02 # AxiDraw SE/A1: X Default: 34.02 in (864 mm)
y_travel_SEA1 = 23.39 # AxiDraw SE/A1: Y Default: 23.39 in (594 mm)

x_travel_SEA2 = 23.39 # AxiDraw SE/A2: X Carriage travel, inches. Default: 23.39 (594 mm)
y_travel_SEA2 = 17.01 # AxiDraw SE/A2: Y Carriage travel, inches. Default: 17.01 (432 mm )
x_travel_SEA2 = 23.39 # AxiDraw SE/A2: X Default: 23.39 in (594 mm)
y_travel_SEA2 = 17.01 # AxiDraw SE/A2: Y Default: 17.01 in (432 mm )

x_travel_V3B6 = 7.48 # AxiDraw V3/B6: X Default: 7.48 in (190 mm)
y_travel_V3B6 = 5.51 # AxiDraw V3/B6: Y Default: 5.51 in (140 mm)


native_res_factor = 1016.0 # Motor resolution factor, steps per inch. Default: 1016.0
Expand Down
2 changes: 1 addition & 1 deletion inkscape driver/axidraw_hatch.inx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ object, the hatches will be grouped with their original (filled) objects.
</param>
<separator />
<param name="aboutpage_7" type="description" indent="2">
v2.4.1. Copyright 2021, Evil Mad Scientist</_param>
v2.4.2. Copyright 2022, Evil Mad Scientist</_param>

</page>
</param>
Expand Down
18 changes: 9 additions & 9 deletions inkscape driver/axidraw_options/versions.py
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import sys
import ast
from collections import namedtuple
from distutils.version import LooseVersion
from packaging.version import parse

from axidrawinternal.plot_utils_import import from_dependency_import
ebb_serial = from_dependency_import('plotink.ebb_serial') # Requires v 0.13 in plotink https://github.com/evil-mad/plotink
ebb_serial = from_dependency_import('plotink.ebb_serial') # https://github.com/evil-mad/plotink
requests = from_dependency_import('requests')

Versions = namedtuple("Versions", "axidraw_control ebb_firmware dev_axidraw_control")
Expand Down Expand Up @@ -60,19 +60,19 @@ def log_axidraw_control_version(online_versions, current_version_string, log_fun
log_fun("This is AxiDraw Control version {}.".format(current_version_string))

if online_versions:
if LooseVersion(online_versions.axidraw_control) > LooseVersion(current_version_string):
if parse(online_versions.axidraw_control) > parse(current_version_string):
log_fun("An update is available to a newer version, v. {}.".format(
online_versions.axidraw_control))
log_fun("Please visit: axidraw.com/sw for the latest software.")
elif LooseVersion(current_version_string) > LooseVersion(online_versions.axidraw_control):
elif parse(current_version_string) > parse(online_versions.axidraw_control):
log_fun("~~ An early-release version ~~")
if (LooseVersion(online_versions.dev_axidraw_control)
> LooseVersion(current_version_string)):
if (parse(online_versions.dev_axidraw_control)
> parse(current_version_string)):
log_fun("An update is available to a newer version, v. {}.".format(
online_versions.dev_axidraw_control))
log_fun("To update, please contact AxiDraw technical support.")
elif (LooseVersion(online_versions.dev_axidraw_control)
== LooseVersion(current_version_string)):
elif (parse(online_versions.dev_axidraw_control)
== parse(current_version_string)):
log_fun("This is the newest available development version.")

log_fun('(The current "stable" release is v. {}).'.format(
Expand All @@ -87,7 +87,7 @@ def log_ebb_version(fw_version_string, online_versions, log_fun):
log_fun("\nYour AxiDraw has firmware version {}.".format(fw_version_string))

if online_versions:
if LooseVersion(online_versions.ebb_firmware) > LooseVersion(fw_version_string):
if parse(online_versions.ebb_firmware) > parse(fw_version_string):
log_fun("An update is available to EBB firmware v. {};".format(
online_versions.ebb_firmware))
log_fun("To download the updater, please visit: axidraw.com/fw\n")
Expand Down

0 comments on commit 272634d

Please sign in to comment.