Comments (9)
Thanks @1bigpig for the list. I have already started the implementation of the functions and it is helpful to see what I need. BTW are the AMxx variables somethink standard, otherwise I would prefer a bit more easier to remember names, like
"feed", "coolant", "plane",...
Also in my implementation since I am based on the python evaluation the variables will be case sensitive.
from bcnc.
@vlachoudis First off, it is your program, you can call them whatever you would like. I am referencing the grbl wiki:
https://github.com/grbl/grbl/wiki/Configuring-Grbl-v0.9#g---view-gcode-parser-state
Sonny calls it the $G parser-state but the wiki uses the sentence: "These active modes determine how the next G-code block or command will be interpreted by Grbl's G-code parser."
I would like to be careful and generic enough that I could do things like store the state of the G-code parser. For example:
;Save the state of the G-code parser
< ;feed=[AMFR]>
< ;coolant=[AMCS]>
< ;plane=[AMWP]>
< ;unit=[AMMI]>
< ;absrel=[AMAR]>
< ;spindle=[AMSS]>
M5 ;turn off spindle
M9 ;turn off coolant
G91 ;switch to relative mode
G21 ;switch to metric
...do something cool like a tool change here...
;Restore the state of the G-code parser
G[plane]
G[unit]
G[absrel]
F[feed]
M[coolant]
M[spindle]
from bcnc.
There's an idea that I'd like to propose, that could be related to the coming scripting feature. it's about the possibilities to interact with the global flow of gcode.
It's consist to have bCNC react to some gcode events, for example when the program end or pause. This will allow bCNC to run external script or executable. So as example, it could be possible to automatically send a screenshot by email when work finish. Or may be an alert in case of errors. Or run a custom button code at specific line of gcode. Just an raw idea for now.
from bcnc.
@effer theoretically now with the function evaluation and python code execution you can execute any python command like
%import os; os.system("play ringtone.wav")
I didn't try it but it should work.
Otherwise I could introduce a
%system cmd
command to execute any system command
from bcnc.
Yes this works, but it is not sync with code execution.
It's executed as soon the line is buffered to grbl, this doesn't allow some useful application.
from bcnc.
If you want to have it in sync with the code.
You should use the command "%wait"
The sender thread will wait until Grbl reports "Idle" as state
from bcnc.
Ok.
Just as reference:
%wait must be int the line before. Commands in the same line of %wait seems ignored.
Also in the editor if you add new line, the python code is executed. This should be avoided IMO.
from bcnc.
Indeed wait should be on the line above.
Concerning the python code in the editor it is a tricky one! I need to execute them, because if they change the gcode, it has to plot it correctly. But how can it know if it is not indented to change the gcode? Maybe introduce another keyword to execute commands only during the running... hmmm...
from bcnc.
If you see in the code CNC.py method parseLine2 (I have to change the name not very nice), there are a few special commands
%wait (without any argument, wait for the idle state of grbl)
%pause (display a message on status and put machine on hold)
%update (update variable in the interface)
All other commands starting with % are send literally to python for execution
from bcnc.
Related Issues (20)
- TypeError: 'range' object doesn't support item deletion, triggered by Utils.py:533
- can not update HOT 4
- incompatible numpy version?
- Tabs created as progressive up/down moves. HOT 1
- undo modification in garc definition
- Fonts specified in px, not point.
- Exceptions when hacked
- UnboundLocalError: cannot access local variable 'ef' where it is not associated with a value
- Large files issue random straight lines HOT 3
- Customizable button. How to update variable value? HOT 1
- Issue due to"sudo python3 -m bCNC"
- Enable Private Vulnerability Reporting in GitHub
- gcode is displayed in a small scrollable frame. HOT 4
- Dragknife M5 after every path
- Slice mesh doesn't work HOT 2
- Coordi ates display
- 100% reproducible: Crash after "scan"
- Pocket closes the program HOT 5
- bcnc
- flatpak just killed my pc..
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bcnc.