minimal version
This commit is contained in:
+22
@@ -0,0 +1,22 @@
|
||||
use std::env;
|
||||
use std::fs;
|
||||
//use gcode::Mnemonic;
|
||||
|
||||
const FILENAME:&str = "./calibrationCube.gcode";
|
||||
|
||||
fn main() {
|
||||
println!("Gcode in the file : {}",FILENAME);
|
||||
|
||||
let contents = fs::read_to_string(FILENAME).expect("Could not read the file");
|
||||
|
||||
//we use the gcode crate rather than just a string parser because it negates comments and not correct lines
|
||||
let got: Vec<_> = gcode::parse(contents.as_str()).collect();
|
||||
|
||||
let mut line_counter:i32 = 0;
|
||||
let mut command = "";
|
||||
for line in &got {
|
||||
line_counter += 1;
|
||||
//command =
|
||||
println!("{}: {}",line_counter,line);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user