Commit e2be9ae8 authored by Nicholas Gar Hei Chan's avatar Nicholas Gar Hei Chan
Browse files

Edits to file paths

parent 858544ce
......@@ -12,9 +12,11 @@ from __future__ import absolute_import
import octoprint.plugin
import sys
sys.path.insert(0, '/home/ngchan/devel/gcode-parser/gcode-parser')
import os
import gcode_parser as gcp
#sys.path.insert(0, '/home/ngchan/devel/gcode-parser/gcode-parser')
#import gcode_parser as gcp
import flask
class AutofdpPlugin(octoprint.plugin.SettingsPlugin,
......@@ -59,7 +61,8 @@ class AutofdpPlugin(octoprint.plugin.SettingsPlugin,
self._plugin_manager.send_plugin_message(self._identifier, data)
def process_gcode(self, payload):
self.model = gcp.parse_gcode("/home/ngchan/.octoprint/uploads/{}".format(payload['name']))
full_path = os.path.expanduser("~/.octoprint/uploads/{}".format(payload['name']))
self.model = gcp.parse_gcode(full_path)
self.num_layers = len(self.model.layers)
self.curr_layer = 0;
......@@ -67,9 +70,6 @@ class AutofdpPlugin(octoprint.plugin.SettingsPlugin,
if event == 'FileSelected':
self._logger.info('File selected: "{}" at path "{}"'.format(payload['name'], payload['path']))
self.process_gcode(payload)
self._logger.info(self._printer.get_current_data())
self._logger.info('GCODE Processed: {} layers'.format(self.num_layers))
self.send_layer(0)
if event == 'Dwelling': #G4 command received
......@@ -132,7 +132,7 @@ class AutofdpPlugin(octoprint.plugin.SettingsPlugin,
##~~ CUSTOM FUNCTIONS FOR FAULT DETECTION PROBE
def sample_layer(self):
return True
def probe_point(self, x, y, z):
"""
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment