Skip to content

Commit

Permalink
0.0.8
Browse files Browse the repository at this point in the history
**Added**
  - Pop-up notification on error.

**Changed**
  - Removed placeholder attribute on  Data Collector Flag to make it more obvious there's nothing typed in it.

**Fixed**
  - Delta printers not collecting mesh data points.
  • Loading branch information
jneilliii authored Apr 23, 2018
2 parents 8d10eae + 8ade5f2 commit af596e6
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 14 deletions.
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,17 @@ or manually using this URL:

## Changelog

**[0.0.8]** (04/22/2018)

**Added**
- Pop-up notification on error.

**Changed**
- Removed placeholder attribute on Data Collector Flag to make it more obvious there's nothing typed in it.

**Fixed**
- Delta printers not collecting mesh data points.

**[0.0.7]** (04/20/218)

**Changed**
Expand Down Expand Up @@ -101,6 +112,7 @@ or manually using this URL:

**Initial Release**

[0.0.8]: https://github.com/jneilliii/OctoPrint-BedLevelVisualizer/tree/0.0.8
[0.0.7]: https://github.com/jneilliii/OctoPrint-BedLevelVisualizer/tree/0.0.7
[0.0.6]: https://github.com/jneilliii/OctoPrint-BedLevelVisualizer/tree/0.0.6
[0.0.5]: https://github.com/jneilliii/OctoPrint-BedLevelVisualizer/tree/0.0.5
Expand All @@ -111,4 +123,5 @@ or manually using this URL:

## To-Do
- [ ] Pause standard OctoPrint temperature polling or squash the responses until processing is completed.
- [ ] Orientation testing to verify axes are in correct direction.
- [ ] Orientation testing to verify axes are in correct direction.
- [ ] Calculate bed dimensions and apply to probe points for display on graph, #28.
21 changes: 14 additions & 7 deletions octoprint_bedlevelvisualizer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def __init__(self):

##~~ SettingsPlugin
def get_settings_defaults(self):
return dict(command="G28\nG29 T",stored_mesh=[],save_mesh=True,prusa_mode=False,mesh_timestamp="",report_flag="",report_types=["Bed Topography Report:","Bilinear Leveling Grid:","Subdivided with CATMULL ROM Leveling Grid:","Measured points:"])
return dict(command="G28\nG29 T",stored_mesh=[],save_mesh=True,prusa_mode=False,mesh_timestamp="",report_flag="",report_types=["Bed Topography Report:","Bed Topography Report for CSV:","Bilinear Leveling Grid:","Subdivided with CATMULL ROM Leveling Grid:","Measured points:"])

##~~ StartupPlugin
def on_after_startup(self):
Expand All @@ -34,13 +34,20 @@ def processGCODE(self, comm, line, *args, **kwargs):
self.mesh = []
return line

if self.processing and "ok" not in line and re.match(r"\s?\d?\s?(\+?-?\[?\s?\d+.\d+[\]?,?\s?]+)+", line.strip()):
if self.processing and "ok" not in line and re.match(r"^((\d\s)|(\[?\s?\+?\-?\d?\.\d+\]?\s*\,?)|(\s?\.\s*)|(NAN\,?))+$", line.strip()):
self._logger.info(line.strip());
new_line = re.sub(r"< \d+:\d+:\d+(\s+(AM|PM))?:","",line.strip())
new_line = re.sub(r"[\[\]]\s?","",new_line)
new_line = re.sub(r"\s+"," ",new_line)
new_line = re.sub(r"\s+","\t",new_line)
new_line = new_line.split("\t")
# new_line = re.sub(r"< \d+:\d+:\d+(\s+(AM|PM))?:","",line.strip())
# new_line = re.sub(r"[\[\]]\s?","",new_line)
# new_line = re.sub(r"\s+"," ",new_line)
# new_line = re.sub(r"\s+","\t",new_line)

new_line = re.sub(r"\[ +","",line.strip())
new_line = re.sub(r"[\]NA]","",new_line)
new_line = re.sub(r"( +)|\,","\t",new_line)
new_line = re.sub(r"(\.\t)","\t",new_line)
new_line = re.sub(r"\.$","",new_line)
new_line = new_line.split("\t")

self._logger.info("converted to:")
self._logger.info(new_line)

Expand Down
7 changes: 6 additions & 1 deletion octoprint_bedlevelvisualizer/static/js/bedlevelvisualizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,12 @@ $(function () {
};
Plotly.react('bedlevelvisualizergraph', data, layout);
} catch(err) {
console.log('No data to graph, verify "Data Collector Flag" in settings then press Update button.');
new PNotify({
title: 'Bed Visualizer Error',
text: '<div class="row-fluid">Looks like your settings are not correct or there was an error. Please see the <a href="https://github.com/jneilliii/OctoPrint-BedLevelVisualizer/blob/master/README.md">Readme</a> for configuration hints.</div><pre>'+err+'</pre>',
type: 'error',
hide: false
});
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
<form class="form-horizontal">
<div class="control-group">
<label for="bedlevelvisualizer_report_flag"><i class="icon icon-info-sign" title="Message received just prior to mesh data"></i> Data Collector Flag</label>
<input class="input-block-level" type="text" id="bedlevelvisualizer_report_flag" data-bind="value: settingsViewModel.settings.plugins.bedlevelvisualizer.report_flag" placeholder="Bed Topography Report:,Bilinear Leveling Grid:,Subdivided with CATMULL ROM Leveling Grid:"></input>
<input class="input-block-level" type="text" id="bedlevelvisualizer_report_flag" data-bind="value: settingsViewModel.settings.plugins.bedlevelvisualizer.report_flag"></input>
<div class="row-fluid"><b>Common Examples:</b></br>
<ul data-bind="foreach: settingsViewModel.settings.plugins.bedlevelvisualizer.report_types"><li data-bind="text: $data"></li></ul>
</div>
</div>
<div class="control-group">
<label for="bedlevelvisualizer_command"><i class="icon icon-info-sign" title="GCODE commands to send to printer to retrieve grid data"></i> GCODE Commands</label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
</style>
<div class="row-fluid" id="bedlevelvisualizerwait" style="text-align: center;font-size: 25px;vertical-align: middle;" data-bind="visible: processing()"><i class="icon-spinner icon-spin icon-3"></i> <b>Please wait, retrieving current mesh.</b></div>
<div class="row-fluid" id="bedlevelvisualizerwarning" style="text-align: center;font-size: 25px;vertical-align: middle;" data-bind="visible: !loginStateViewModel.isUser()"><i class="icon-warning-sign icon-3" style="color:red"></i> <b>You must be logged in.</b></div>
<div class="row-fluid" data-bind="visible: loginStateViewModel.isUser() && !processing()">
<div class="row-fluid" id="bedlevelvisualizernocollector" style="text-align: center;font-size: 25px;vertical-align: middle;" data-bind="visible: (settingsViewModel.settings.plugins.bedlevelvisualizer.report_flag() == '')"><i class="icon-warning-sign icon-3" style="color:red"></i> <b>Verify "Data Collector Flag" in settings is set appropriately.</b></div>
<div class="row-fluid" id="bedlevelvisualizernocollector" style="text-align: center;font-size: 25px;vertical-align: middle;" data-bind="visible: settingsViewModel.settings.plugins.bedlevelvisualizer.report_flag() == '' && loginStateViewModel.isUser()"><i class="icon-warning-sign icon-3" style="color:red"></i> Missing "Data Collector Flag" setting. Please see the <a href="https://github.com/jneilliii/OctoPrint-BedLevelVisualizer/blob/master/README.md">Readme</a> for configuration hints.</div>
<div class="row-fluid" data-bind="visible: (loginStateViewModel.isUser() && !processing() && settingsViewModel.settings.plugins.bedlevelvisualizer.report_flag() !== '')">
<div class="row-fluid" id="bedlevelvisualizergraph"></div>
<div class="row-fluid" id="bedlevelvisualizerbutton" style="text-align: center;padding-top: 20px;"><button class="btn" data-bind="click: updateMesh,enable: controlViewModel.isOperational() && !controlViewModel.isPrinting() && loginStateViewModel.isUser() && !processing(),visible: (settingsViewModel.settings.plugins.bedlevelvisualizer.report_flag() !== '')"><i class="icon-2 icon-info-sign" data-bind="attr: {'title': mesh_status}"></i> Update</button></div>
<div class="row-fluid" id="bedlevelvisualizerbutton" style="text-align: center;padding-top: 20px;"><button class="btn" data-bind="click: updateMesh,enable: controlViewModel.isOperational() && !controlViewModel.isPrinting() && loginStateViewModel.isUser() && !processing() && settingsViewModel.settings.plugins.bedlevelvisualizer.report_flag() !== ''"><i class="icon-2 icon-info-sign" data-bind="attr: {'title': mesh_status}"></i> Update</button></div>
</div>
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.0.7"
plugin_version = "0.0.8"

# The plugin's description. Can be overwritten within OctoPrint's internal data via __plugin_description__ in the plugin
# module
Expand Down

0 comments on commit af596e6

Please sign in to comment.