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

Added a button and code to clear gcode. #590

Merged
merged 2 commits into from
Jan 24, 2018

Conversation

thormj
Copy link
Contributor

@thormj thormj commented Jan 23, 2018

I wanted to be able to clear the g-code buffer to clean up the screen.
Plus, this is a way for me to see how to use GitHub...

@blurfl
Copy link
Collaborator

blurfl commented Jan 23, 2018

This does what it says on the box. It leaves the gcode file selection in groundcontrol.ini alone so that on next launch the previously selected gcode file is back and the location is preserved.
You've mastered the GitHub thing on the first go!
I probably won't use this option very often, though. I've got an empty gcode file with only the setup lines (G90, G20) that I use as a starting point, it accomplishes much the same thing.

@BarbourSmith
Copy link
Member

Fantastic! Excellent mastery of GitHub!

For anyone following along here's what the button looks like:

image

How do we feel about moving the button over into one of the other less crowded columns? Maybe replacing that "zero z" button that has been moved into the z-axis popup?

To make changes, just make a new commit to the same branch as you did before (ClearGCode) and it will show up here automatically 👍 👍

@thormj
Copy link
Contributor Author

thormj commented Jan 23, 2018

I thought of that, but I kinda like how each column is dedicated to something "View" (everything dealing with code) (maybe should be "Code" instead), Run (if you hit these buttons something happens).

OTOH, I suppose you could put a button on the file picker to "clear".

I was also trying to pass in python main.py -c:data:GCodeFilename:"" to see if it would blank at startup (just in case you have g-code that explodes GroundControl), but evidently I don't understand command line parameters much...

@blurfl
Copy link
Collaborator

blurfl commented Jan 23, 2018

I've had success with a command line argument to groundcontrol in the past, but can't find the code right now.
Take a look at this guy's example to passing a command line value into kivy. I started from there, I think.

@@ -156,8 +156,7 @@ def reloadGcode(self, *args):
else:
self.data.zMoves.append(index)
except:
if filename is not "":
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we added this to fix issue #520 . Sorry to nitpick!

@blurfl
Copy link
Collaborator

blurfl commented Jan 24, 2018

That patch for issue #520 isn't needed with the code brought by this PR. This handles the missing file by clearing the gcode list.

@BarbourSmith
Copy link
Member

Great catch!

@BarbourSmith
Copy link
Member

Sorry for missing that

@BarbourSmith
Copy link
Member

In that case it looks great to me! 👍 👍

@BarbourSmith BarbourSmith merged commit a2972b4 into MaslowCNC:master Jan 24, 2018
@thormj thormj deleted the ClearGCode branch January 24, 2018 06:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants