Skip to content

Commit

Permalink
0.1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
jneilliii committed Sep 4, 2018
1 parent 0301f6c commit 7227f7d
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 18 deletions.
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ into this
![screenshot](screenshot.png)

## Known Issues
- Since version 0.1.3 there is a python dependency on numpy. As a result; if you don't already have numpy the install can take in excess of 30 minutes to complete on a pi. Just be patient and let it run and eventually the plugin install will finish.
- If you have Marlin's Auto Temperature Reporting Feature enabled you will want to have M155 S30 and M155 S3 surrounding your G29 command, see settings screenshot, otherwise the collected data will be tainted.
- ~~Currently there is a conflict with the TempsGraph plugin. If you have this plugin installed you will receive an error that Plotyle.react is not a function. There is a version update pending on that plugin to resolve this issue, just waiting on the author to release.~~ Resolved with TempsGraph release [0.3.3](https://github.com/1r0b1n0/OctoPrint-Tempsgraph/releases/tag/0.3.3).

Expand Down Expand Up @@ -69,8 +70,19 @@ or manually using this URL:
## Changelog
**[0.1.5]** (09/03/2018)
**Added**
- Option to make center of bed the origin point per request. Helpful when using a fixed center leveling system as described [here](https://github.com/PrusaOwners/prusaowners/wiki/Bed_Leveling_without_Wave_Springs).
- Option to make measured offsets relative to origin position, related to above addition but could be useful elsewhere.
**Changed**
- X/Y axis calculations to resolve bug discovered during above changes where if your leveling grid was based on an odd number of probe points the maximum perimeters were getting dropped due to rounding errors.
**[0.1.4]** (08/06/2018)
- Fixed issue introduced with previous updates.
**Fixed**
- Issue introduced with previous update that was causing some leveling reports to not be identified correctly.
**[0.1.3]** (08/05/2018)
Expand Down Expand Up @@ -168,6 +180,8 @@ or manually using this URL:
**Initial Release**
[0.1.5]: https://github.com/jneilliii/OctoPrint-BedLevelVisualizer/tree/0.1.5
[0.1.4]: https://github.com/jneilliii/OctoPrint-BedLevelVisualizer/tree/0.1.4
[0.1.3]: https://github.com/jneilliii/OctoPrint-BedLevelVisualizer/tree/0.1.3
[0.1.2]: https://github.com/jneilliii/OctoPrint-BedLevelVisualizer/tree/0.1.2
[0.1.1]: https://github.com/jneilliii/OctoPrint-BedLevelVisualizer/tree/0.1.1
Expand Down
12 changes: 11 additions & 1 deletion octoprint_bedlevelvisualizer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ def get_settings_defaults(self):
mesh_timestamp="",
flipX=False,
flipY=False,
stripFirst=False)
stripFirst=False,
use_center_origin=False,
use_relative_offsets=False)

##~~ StartupPlugin
def on_after_startup(self):
Expand Down Expand Up @@ -131,6 +133,14 @@ def processGCODE(self, comm, line, *args, **kwargs):
self.processing = False
if self._settings.get(["flipY"]):
self.mesh.reverse()

if self._settings.get(["use_relative_offsets"]):
self.mesh = np.array(self.mesh)
if self._settings.get(["use_center_origin"]):
self.mesh = np.subtract(self.mesh, self.mesh[len(self.mesh[0])/2,len(self.mesh)/2], dtype=np.float, casting='unsafe').tolist()
else:
self.mesh = np.subtract(self.mesh, self.mesh[0,0], dtype=np.float, casting='unsafe').tolist()

self._plugin_manager.send_plugin_message(self._identifier, dict(mesh=self.mesh,bed=bed))

return line
Expand Down
22 changes: 12 additions & 10 deletions octoprint_bedlevelvisualizer/static/js/bedlevelvisualizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,22 @@ $(function () {
if (mesh_data.mesh.length > 0) {
var x_data = [];
var y_data = [];
for(i = mesh_data.bed.x_min;i <= mesh_data.bed.x_max;i += mesh_data.bed.x_max/(mesh_data.mesh[0].length - 1)){
if(mesh_data.bed.type == "circular"){
x_data.push(Math.round((i - mesh_data.bed.x_max/2)));

for(var i = 0;i <= (mesh_data.mesh[0].length - 1);i++){
if((mesh_data.bed.type == "circular") || self.settingsViewModel.settings.plugins.bedlevelvisualizer.use_center_origin()){
x_data.push(Math.round(mesh_data.bed.x_min - (mesh_data.bed.x_max/2)+i/(mesh_data.mesh[0].length - 1)*(mesh_data.bed.x_max - mesh_data.bed.x_min)));
} else {
x_data.push(Math.round(i));
x_data.push(Math.round(mesh_data.bed.x_min+i/(mesh_data.mesh[0].length - 1)*(mesh_data.bed.x_max - mesh_data.bed.x_min)));
}
}
for(i = mesh_data.bed.y_min;i <= mesh_data.bed.y_max;i += mesh_data.bed.y_max/(mesh_data.mesh.length -1)){
if(mesh_data.bed.type == "circular"){
y_data.push(Math.round((i - mesh_data.bed.y_max/2)));
};

for(var i = 0;i <= (mesh_data.mesh.length - 1);i++){
if((mesh_data.bed.type == "circular") || self.settingsViewModel.settings.plugins.bedlevelvisualizer.use_center_origin()){
y_data.push(Math.round(mesh_data.bed.y_min - (mesh_data.bed.y_max/2)+i/(mesh_data.mesh.length - 1)*(mesh_data.bed.y_max - mesh_data.bed.y_min)));
} else {
y_data.push(Math.round(i));
y_data.push(Math.round(mesh_data.bed.y_min+i/(mesh_data.mesh.length - 1)*(mesh_data.bed.y_max - mesh_data.bed.y_min)));
}
}
};

self.drawMesh(mesh_data.mesh,true,x_data,y_data,mesh_data.bed.z_max);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
<div class="control-group span4">
<i class="icon icon-info-sign" title="Flip the mesh data in the X direction." data-toggle="tooltip"></i> Flip X Axis <input class="input-checkbox" type="checkbox" id="bedlevelvisualizer_flipX" data-bind="checked: settingsViewModel.settings.plugins.bedlevelvisualizer.flipX" style="display: inline-block;margin-bottom: 5px;"></input>
</div>
<div class="control-group span4">
<i class="icon icon-info-sign" title="Make origin point center of bed." data-toggle="tooltip"></i> Use Center Origin <input class="input-checkbox" type="checkbox" id="bedlevelvisualizer_use_center_origin" data-bind="checked: settingsViewModel.settings.plugins.bedlevelvisualizer.use_center_origin" style="display: inline-block;margin-bottom: 5px;"></input>
</div>
</div>
<div class="row-fluid">
<div class="control-group span4">
Expand All @@ -27,6 +30,9 @@
<div class="control-group span4">
<i class="icon icon-info-sign" title="Flip the mesh data in the Y direction." data-toggle="tooltip"></i> Flip Y Axis <input class="input-checkbox" type="checkbox" id="bedlevelvisualizer_flipY" data-bind="checked: settingsViewModel.settings.plugins.bedlevelvisualizer.flipY" style="display: inline-block;margin-bottom: 5px;"></input>
</div>
<div class="control-group span4">
<i class="icon icon-info-sign" title="Make all z offsets relative to origin point." data-toggle="tooltip"></i> Use Relative Z Offsets <input class="input-checkbox" type="checkbox" id="bedlevelvisualizer_use_relative_offsets" data-bind="checked: settingsViewModel.settings.plugins.bedlevelvisualizer.use_relative_offsets" style="display: inline-block;margin-bottom: 5px;"></input>
</div>
</div>
</div>
<div id="bedlevelvisualizer_stored_data" class="tab-pane">
Expand Down
Binary file modified settings_general.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
plugin_name = "Bed Visualizer"

# The plugin's version. Can be overwritten within OctoPrint's internal data via __plugin_version__ in the plugin module
plugin_version = "0.1.4"
plugin_version = "0.1.5"

# The plugin's description. Can be overwritten within OctoPrint's internal data via __plugin_description__ in the plugin
# module
Expand Down
8 changes: 3 additions & 5 deletions virtual_level_report_delta_marlin_bugfix.gcode
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
@BEDLEVELVISUALIZER
!!DEBUG:send echo:Home XYZ first
!!DEBUG:send
@BEDLEVELVISUALIZER
!!DEBUG:send Bed Topography Report:
!!DEBUG:send
!!DEBUG:send ( -98, 98) ( 98, 98)
Expand All @@ -15,9 +13,9 @@
!!DEBUG:send |
!!DEBUG:send 7 | . -0.026 +0.105 +0.065 +0.050 +0.090 +0.105 +0.080 +0.065 +0.075 +0.090 .
!!DEBUG:send |
!!DEBUG:send 6 | +0.100 +0.105 +0.080 +0.085 +0.060 +0.200 [-0.015] +0.060 +0.050 -0.064 +0.015 .
!!DEBUG:send 6 | +0.100 +0.105 +0.080 +0.085 +0.060 +0.200 [-0.015] +0.060 +0.050 -0.064 +0.015 +0.100
!!DEBUG:send |
!!DEBUG:send 5 | +0.150 -0.002 +0.105 +0.110 +0.095 +0.205 +0.060 +0.040 +0.035 -0.069 +0.043 .
!!DEBUG:send 5 | +0.150 -0.002 +0.105 +0.110 +0.095 +0.205 +0.060 +0.040 +0.035 -0.069 +0.043 +0.150
!!DEBUG:send |
!!DEBUG:send 4 | . +0.160 +0.155 +0.110 -0.000 +0.080 -0.057 -0.078 +0.045 -0.058 +0.087 .
!!DEBUG:send |
Expand Down

0 comments on commit 7227f7d

Please sign in to comment.