Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
Signed-off-by: Jess Frazelle <[email protected]>
  • Loading branch information
jessfraz committed Oct 19, 2024
1 parent 2a4a066 commit 281ba0e
Showing 1 changed file with 8 additions and 17 deletions.
25 changes: 8 additions & 17 deletions src/slicer/orca.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ impl Slicer {

for (index, filament) in fdm.filaments.iter().enumerate() {
let filament_name = filament.name.as_deref().unwrap_or("PLA Basic").to_string();
println!("filament_name: {:?}", filament_name);
let start_filament_str = format!("Bambu {} @BBL", filament_name);
// Do the filament overrides.
let mut filament_overrides: bambulabs::templates::Template = serde_json::from_str(&filament_str)?;
Expand Down Expand Up @@ -162,9 +161,6 @@ impl Slicer {
.to_string();

let settings = [process_config.clone(), machine_config.clone()].join(";");
println!("process_config: {:?}", process_config);
println!("machine_config: {:?}", machine_config);
println!("filament_config: {:?}", filament_configs);

let args: Vec<String> = vec![
"--load-settings".to_string(),
Expand All @@ -191,8 +187,6 @@ impl Slicer {
.to_string(),
];

println!("args: {:?}", args);

// Find the orcaslicer executable path.
let orca_slicer_path = find_orca_slicer()?;

Expand All @@ -202,29 +196,26 @@ impl Slicer {
.await
.context("Failed to execute orca-slicer command")?;

let stdout = std::str::from_utf8(&output.stdout)?;
tokio::fs::write(format!("orca-slicer-stdout-{}.txt", filament_index), &output.stdout).await?;
println!("stdout: {}", stdout);
let stderr = std::str::from_utf8(&output.stderr)?;
tokio::fs::write(format!("orca-slicer-stderr-{}.txt", filament_index), &output.stderr).await?;
println!("stderr: {}", stderr);
// Make sure the command was successful.
/*if !output.status.success() {
if !output.status.success() {
let stdout = std::str::from_utf8(&output.stdout)?;
let stderr = std::str::from_utf8(&output.stderr)?;
anyhow::bail!("Failed to : {:?}\nstdout:\n{}stderr:{}", output, stdout, stderr);
}*/
}

// Make sure the G-code file was created.
if !output_path.exists() {
anyhow::bail!("Failed to create output file");
}

// Delete all the configs.
/*tokio::fs::remove_file(&process_config).await?;
tokio::fs::remove_file(&process_config).await?;
tokio::fs::remove_file(&machine_config).await?;
tokio::fs::remove_file(&filament_config).await?;*/
for filament_config in filament_configs {
tokio::fs::remove_file(&filament_config).await?;
}

let file = TemporaryFile::new(&output_path).await?;
println!("Generated file: {:?}", output_path);

Ok(file)
}
Expand Down

0 comments on commit 281ba0e

Please sign in to comment.