Recipes where action=printed now contain their model & print profile

This commit is contained in:
Sebastian Kuzminsky 2025-04-02 22:50:56 -06:00
parent 98353e926a
commit e0e38503f0
8 changed files with 17 additions and 25 deletions

View file

@ -7,8 +7,5 @@ filament={}
[dependencies]
tools=["fdm-printer"]
[config]
model="https://github.com/DerSchultze/Peristaltic-Controller@92a4d9b:stl/bearing-hub.STL"
[action]
print={}
print = { model="https://github.com/DerSchultze/Peristaltic-Controller/blob/92a4d9b/stl/bearing-hub.STL", profile="placeholder" }

View file

@ -7,8 +7,6 @@ filament={}
[dependencies]
tools=["fdm-printer"]
[config]
model="https://github.com/DerSchultze/Peristaltic-Controller@92a4d9b:stl/bearing-hub-top.STL"
[action]
print={}
print={ model="https://github.com/DerSchultze/Peristaltic-Controller/blob/92a4d9b/stl/bearing-hub-top.STL", profile="placeholder" }

View file

@ -7,8 +7,5 @@ filament={}
[dependencies]
tools=["fdm-printer"]
[config]
model="https://github.com/DerSchultze/Peristaltic-Controller@92a4d9b:stl/pump-top.STL"
[action]
print={}
print={ model="https://github.com/DerSchultze/Peristaltic-Controller/blob/92a4d9b/stl/pump-top.STL", profile="placeholder" }

View file

@ -7,8 +7,5 @@ filament={}
[dependencies]
tools=["fdm-printer"]
[config]
model="https://github.com/DerSchultze/Peristaltic-Controller@92a4d9b:stl/CheapPump.STL"
[action]
print={}
print={ model="https://github.com/DerSchultze/Peristaltic-Controller/blob/92a4d9b/stl/CheapPump.STL", profile="placeholder" }

View file

@ -7,8 +7,5 @@ filament={}
[dependencies]
tools=["fdm-printer"]
[config]
model="https://github.com/DerSchultze/Peristaltic-Controller@92a4d9b:stl/tube-support.STL"
[action]
print={}
print={ model="https://github.com/DerSchultze/Peristaltic-Controller/blob/92a4d9b/stl/tube-support.STL", profile="placeholder" }

View file

@ -49,11 +49,17 @@ pub struct Purchase {
pub documentation: Option<Vec<String>>,
}
#[derive(Debug, serde::Deserialize, PartialEq)]
pub struct PrintedPart {
pub model: String,
pub profile: String,
}
#[derive(Debug, serde::Deserialize, PartialEq)]
#[allow(non_camel_case_types)]
pub enum Action {
process(String),
print,
print(PrintedPart),
purchase(Purchase),
}
@ -150,7 +156,7 @@ impl Recipe {
// A "print" is a recipe whose Action is "print".
pub fn is_print(&self) -> bool {
match self.action {
Action::print => true,
Action::print(_) => true,
_ => false,
}
}

View file

@ -195,8 +195,8 @@ impl Repo {
crate::recipe::Action::process(process) => {
writeln!(puml_file, "{} : {:?}", input_object_name, process)?;
}
crate::recipe::Action::print => {
writeln!(puml_file, "{} : print", input_object_name)?;
crate::recipe::Action::print(printed_part) => {
writeln!(puml_file, "{} : {:?}", input_object_name, printed_part)?;
}
crate::recipe::Action::purchase(_purchase) => {
writeln!(puml_file, "{} : buy", input_object_name)?;

View file

@ -182,8 +182,8 @@ impl Repos {
crate::recipe::Action::process(process) => {
writeln!(puml_file, "{} : {:?}", input_object_name, process)?;
}
crate::recipe::Action::print => {
writeln!(puml_file, "{} : print", input_object_name)?;
crate::recipe::Action::print(printed_part) => {
writeln!(puml_file, "{} : {:?}", input_object_name, printed_part)?;
}
crate::recipe::Action::purchase(_purchase) => {
writeln!(puml_file, "{} : buy", input_object_name)?;