-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #54 from Hacking3DPrinters/testing
Release 0.2.4
- Loading branch information
Showing
9 changed files
with
99 additions
and
59 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import chess | ||
import gcode | ||
import __main__ | ||
import robotic_chess.chess | ||
import robotic_chess.gcode | ||
import robotic_chess.octoprint | ||
# main code goes here |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
from os import system as cmd | ||
from os.path import exists | ||
class PrinterError(Exception): | ||
pass | ||
class Printer: | ||
def __init__(self): | ||
self.loaded_file=False | ||
cmd('octoprint-cli connection connect') | ||
def load_file(self, file='./output.gcode'): | ||
if exists(file): | ||
self.loaded_file=True | ||
cmd('octoprint-cli print select {path}'.format(path=str(file))) | ||
else: | ||
raise PrinterError('File selected was invalid') | ||
def start_file(self): | ||
if self.loaded_file: | ||
cmd('octoprint-cli print start') | ||
self.loaded_file=False | ||
else: | ||
raise PrinterError('No file selected using Printer.load_file()') | ||
def run_gcode(self,gcode=()): | ||
if str(type(gcode))=='<class \'tuple\'>': | ||
for gcmd in gcode: | ||
cmd('octoprint-cli gcode {command}'.format(command=str(gcmd))) | ||
else: | ||
raise PrinterError('gcode was not in tuple form') | ||
def connect(self): | ||
# should never be called | ||
cmd('octoprint-cli connection connect') | ||
def disconnect(self): | ||
cmd('octoprint-cli connection disconnect') |