Comments (5)
There is already the print()
command. However, running such code in the simulator may not have the desired effect. Any GCode which is emitted by print()
will be missed by the simulator. You could preprocess with TPL, then run the resulting GCode in the simulator.
from camotics.
It should be writing to the same stream. CAMotics::CommandLineApp::stream
is also passed to TPLContext
in TPLangApp::run()
in tplang.cpp
. This is what cb::StdModule::print()
writes to. Are you saying that print()
still ends up in stdout
when you set --out <filename>
? What build are you using?
from camotics.
I just tested this in my local build and the streams are the same. I in believe v1.2 print()
always prints to stdout but that has been fixed. I've been trying to make a new CAMotics release for a long time now but haven't been able to find the time. You can always build from source.
from camotics.
That was a quick reply. Thank you!
We are not talking about the simulator. Just TPL. The simulator cannot understand arbitrary g-code. That's obvious.
I tried what you suggested using the tplang program as preprocessor. But, when executing
tplang test.tpl --out "test.nc"
Where the file test.tpl is
print("G0 X0 Y0");
print("G1 X10");
The resulting file test.nc is
G21
M2
The command line console does show
G0 X0 Y0G1 X10
in the standard output, and we could use --out -
but then we are conflating two different streams. One with the g-code and the standard output.
I have tried to understand how the print
command works following the source code. The only appearance of "print"
is in GCodeInterpreter::specialComment()
which uses LOG_INFO
. However, both message()
and comment()
call the same-named methods in GCode::GCodeMachine
and these methods use GCode::GCodeMachine::stream
which is the output file of CommandLineApp::build()
initialized in CommandLineApp::init()
.
As far as I can understand the source code, there is no command to emit g-code from TPL. I mean, a command that has a semantics that says "write to the g-code file/stream". We can use print
(to standard output) and make the g-code file be the standard ouput to get around that, but... is this it? By design?
from camotics.
tplang --version
says 1.2
from camotics.
Related Issues (20)
- Custom Tool Shape HOT 1
- src/glibc.c and compat_glibc wrappers in v1.3.0 HOT 4
- Invalid JSON number error in some locales.
- All dialog boxes broken HOT 2
- Is it possible to run interactively with the Python API? (line-by-line) HOT 1
- Use of Intel HD graphics 2000 with Win7 HOT 1
- Color of Workpiece HOT 2
- save the resolution HOT 7
- Any reason why CHANGELOG shows 1.2.1 and 1.3.0 but no releases were generated for them? HOT 1
- Suggested Patch to Add Picking To TPL Files HOT 3
- Implement ambient occlusion in 3D lighting.
- how to add other machines? HOT 16
- Newer Version Build for usage with FreeCAD HOT 11
- Debian 12 libssl and v8_compress_pointers (Embedder-vs-V8 build configuration mismatch) HOT 1
- Python API `get_path()` throws NULL pointer runtime error HOT 2
- Build broken due to missing boost header HOT 3
- Debian Bookwrom HOT 2
- ERROR: On embedder side pointer compression is ENABLED while on V8 side it's DISABLED. HOT 3
- Fixture modeling and collision detection. HOT 2
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 camotics.