Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GPX pull request #44 Compatibility #92

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ all: GPX/build
make -C $$dir $@; \
echo "Exiting $$dir"; \
done
python setup.py develop
python3 setup.py develop

GPX/build: GPX/configure
mkdir -p GPX/build
Expand Down
2 changes: 1 addition & 1 deletion octoprint_GPX/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ def batcheeprom(self, *args, **kwargs):
try:
response[eepromid] = gpx.read_eeprom(eepromid)
except ValueError:
SELF._LOGGER.WARN("UNKNOWN EEPROM id %s" % eepromid)
self._logger.warn("UNKNOWN EEPROM id %s" % eepromid)
except gpx.UnknownFirmware:
self._logger.warn("Unrecognized firmware flavor or version.")
return make_response("Unrecognize firmware flavor or version", 400)
Expand Down
11 changes: 6 additions & 5 deletions octoprint_GPX/static/js/gpx.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,15 +250,15 @@ $(function() {
ko.mapping.fromJS(response, self.eeprom);
bit = 0x1;
for (axis in self.axes) {
self.steps_per_mm[axis](self.eeprom["AXIS_STEPS_PER_MM_" + axis]() / 1000000.0);
self.steps_per_mm[axis](self.eeprom["AXIS_STEPS_PER_MM_" + axis]());
self.home[axis](self.eeprom["AXIS_HOME_POSITIONS_STEPS_" + axis]() / self.steps_per_mm[axis]());
self.invert_axis[axis](!!(self.eeprom.AXIS_INVERSION() & bit));
self.invert_endstop[axis](!!(self.eeprom.ENDSTOP_INVERSION() & bit));
bit <<= 1;
}
self.z_hold(!(self.eeprom.AXIS_INVERSION() & 0x80));
self.jkn_k(self.eeprom.JKN_ADVANCE_K() / 100000.0);
self.jkn_k2(self.eeprom.JKN_ADVANCE_K2() / 100000.0);
self.jkn_k(self.eeprom.JKN_ADVANCE_K());
self.jkn_k2(self.eeprom.JKN_ADVANCE_K2());
self.toolhead_offset.X(self.eeprom.TOOLHEAD_OFFSET_SETTINGS_X() /self.steps_per_mm.X());
self.toolhead_offset.Y(self.eeprom.TOOLHEAD_OFFSET_SETTINGS_Y() /self.steps_per_mm.Y());
self.max_zdelta(self.eeprom.ALEVEL_MAX_ZDELTA() / self.steps_per_mm.Z());
Expand All @@ -280,15 +280,16 @@ $(function() {
var endstop_inversion = self.eeprom.ENDSTOP_INVERSION() & 0xe0;
for (axis in self.axes) {
self.eeprom["AXIS_HOME_POSITIONS_STEPS_" + axis]((self.home[axis]() * self.steps_per_mm[axis]()) | 0);
self.eeprom["AXIS_STEPS_PER_MM_" + axis](self.steps_per_mm[axis]());
if (self.invert_axis[axis]()) axis_inversion |= bit;
if (self.invert_endstop[axis]()) endstop_inversion |= bit;
bit <<= 1;
}
if (!self.z_hold()) axis_inversion |= 0x80;
self.eeprom.AXIS_INVERSION(axis_inversion);
self.eeprom.ENDSTOP_INVERSION(endstop_inversion);
self.eeprom.JKN_ADVANCE_K((self.jkn_k() * 100000) | 0);
self.eeprom.JKN_ADVANCE_K2((self.jkn_k2() * 100000) | 0);
self.eeprom.JKN_ADVANCE_K(self.jkn_k());
self.eeprom.JKN_ADVANCE_K2(self.jkn_k2());
self.eeprom.TOOLHEAD_OFFSET_SETTINGS_X((self.toolhead_offset.X() * self.steps_per_mm.X()) | 0);
self.eeprom.TOOLHEAD_OFFSET_SETTINGS_Y((self.toolhead_offset.Y() * self.steps_per_mm.Y()) | 0);
self.eeprom.ALEVEL_MAX_ZDELTA((self.max_zdelta() * self.steps_per_mm.Z()) | 0);
Expand Down
3 changes: 3 additions & 0 deletions octoprint_GPX/templates/GPX_settings.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,9 @@
{% set axis_name = axis + ' axis' + gpx_axis_suffix(axis) %}
{{ gpx_checkbox('invert_axis.' + axis, _('Invert {}').format(axis_name), _('If an axis is moving in the wrong direction, toggle that axis')) }}
{% endfor %}
{% for axis in axes %}
{{ gpx_spinner_unit('steps_per_mm.' + axis, _('steps/mm'), 0.000001, 0, 0, _('{} Steps per mm').format(axis), _('The number of steps per mm')) }}
{% endfor %}
</div>
</div>
<div id="gpx_eeprom_endstops" class="tab-pane">
Expand Down