Skip to content

Commit

Permalink
add print speed command;
Browse files Browse the repository at this point in the history
Signed-off-by: Jess Frazelle <github@jessfraz.com>
  • Loading branch information
jessfraz committed Aug 15, 2024
1 parent 1da4082 commit e000af9
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 0 deletions.
18 changes: 18 additions & 0 deletions bambulabs/src/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,8 @@ pub enum Print {
ProjectFile(ProjectFile),
/// Pause the print.
Pause(Pause),
/// Print speed.
PrintSpeed(PrintSpeed),
/// Resume the print.
Resume(Resume),
/// Stop the print.
Expand All @@ -231,6 +233,7 @@ impl Print {
Print::GcodeLine(gcode_line) => gcode_line.sequence_id.clone(),
Print::ProjectFile(project_file) => project_file.sequence_id.clone(),
Print::Pause(pause) => pause.sequence_id.clone(),
Print::PrintSpeed(print_speed) => print_speed.sequence_id.clone(),
Print::Resume(resume) => resume.sequence_id.clone(),
Print::Stop(stop) => stop.sequence_id.clone(),
Print::ExtrusionCaliGet(extrusion_cali_get) => extrusion_cali_get.sequence_id.clone(),
Expand Down Expand Up @@ -371,6 +374,21 @@ pub struct ExtrusionCaliGet {
other: BTreeMap<String, Value>,
}

/// A print speed command.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
pub struct PrintSpeed {
/// The sequence id.
pub sequence_id: SequenceId,
/// The reason for the message.
pub reason: Option<Reason>,
/// The result of the command.
pub result: Result,
/// The param.
pub param: String,
#[serde(flatten)]
other: BTreeMap<String, Value>,
}

/// A push status message.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema)]
pub struct PushStatus {
Expand Down
48 changes: 48 additions & 0 deletions openapi/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -1253,6 +1253,54 @@
],
"type": "object"
},
{
"additionalProperties": true,
"description": "Print speed.",
"properties": {
"command": {
"enum": [
"print_speed"
],
"type": "string"
},
"param": {
"description": "The param.",
"type": "string"
},
"reason": {
"allOf": [
{
"$ref": "#/components/schemas/Reason"
}
],
"description": "The reason for the message.",
"nullable": true
},
"result": {
"allOf": [
{
"$ref": "#/components/schemas/Result"
}
],
"description": "The result of the command."
},
"sequence_id": {
"allOf": [
{
"$ref": "#/components/schemas/SequenceId"
}
],
"description": "The sequence id."
}
},
"required": [
"command",
"param",
"result",
"sequence_id"
],
"type": "object"
},
{
"additionalProperties": true,
"description": "Resume the print.",
Expand Down

0 comments on commit e000af9

Please sign in to comment.