Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion control-core/src/machines/manager_iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ impl<'a> Iterator for MachineManagerIterator<'a> {

impl MachineManager {
// Returns an iterator over all machines (both ethercat and serial)
pub fn iter(&self) -> MachineManagerIterator {
pub fn iter(&'_ self) -> MachineManagerIterator<'_> {
MachineManagerIterator {
iter: MachineManagerIter::EthercatMachines {
iter: self.ethercat_machines.iter(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export function Extruder2ControlPage() {
pressure,

motorScrewRpm,
motorPower,
combinedPower,

setExtruderMode,
Expand Down Expand Up @@ -119,9 +118,11 @@ export function Extruder2ControlPage() {
Inverter is overloaded! Please check the extruder and reduce load
if necessary.
</StatusBadge>
) : state?.inverter_status_state.fault_occurence == true ? (
) : state?.inverter_status_state.fault_occurence == true &&
state?.inverter_status_state.fault ? (
<StatusBadge variant="error">
Inverter encountered an error!! Press the restart button in Config
Inverter stopped:
{state?.inverter_status_state.fault?.fault_description}
</StatusBadge>
) : state?.inverter_status_state.running == true &&
state.inverter_status_state.fault_occurence == false ? (
Expand Down
10 changes: 10 additions & 0 deletions electron/src/machines/extruder/extruder2/extruder2Namespace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,15 @@
back: heatingStateSchema,
middle: heatingStateSchema,
});
// pub fault_code: FaultCode,
// pub fault_description: String,
// pub ts: Instant,

export const faultStateSchema = z.object({
fault_code: z.number(),
fault_description: z.string(),
time_stamp: z.number(),
});

/**
* Extruder settings state schema
Expand All @@ -113,6 +122,7 @@
* Inverter status state schema
*/
export const inverterStatusStateSchema = z.object({
fault: faultStateSchema.nullable(),
running: z.boolean(),
forward_running: z.boolean(),
reverse_running: z.boolean(),
Expand Down Expand Up @@ -205,7 +215,7 @@
const FIVE_SECOND = 5 * ONE_SECOND;
const ONE_HOUR = 60 * 60 * ONE_SECOND;

const { initialTimeSeries: screwRpm, insert: addScrewRpm } = createTimeSeries(

Check warning on line 218 in electron/src/machines/extruder/extruder2/extruder2Namespace.ts

View workflow job for this annotation

GitHub Actions / build-electron

'addScrewRpm' is assigned a value but never used

Check warning on line 218 in electron/src/machines/extruder/extruder2/extruder2Namespace.ts

View workflow job for this annotation

GitHub Actions / build-electron

'screwRpm' is assigned a value but never used

Check warning on line 218 in electron/src/machines/extruder/extruder2/extruder2Namespace.ts

View workflow job for this annotation

GitHub Actions / build-electron

'addScrewRpm' is assigned a value but never used

Check warning on line 218 in electron/src/machines/extruder/extruder2/extruder2Namespace.ts

View workflow job for this annotation

GitHub Actions / build-electron

'screwRpm' is assigned a value but never used
TWENTY_MILLISECOND,
ONE_SECOND,
FIVE_SECOND,
Expand Down
12 changes: 10 additions & 2 deletions server/src/machines/extruder1/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ impl LiveValuesEvent {
}
}

#[derive(Serialize, Debug, Clone, PartialEq, BuildEvent)]
#[derive(Serialize, Debug, Clone, BuildEvent)]
pub struct StateEvent {
pub is_default_state: bool,
/// rotation state
Expand Down Expand Up @@ -144,8 +144,16 @@ pub struct ExtruderSettingsState {
pub pressure_limit_enabled: bool,
}

#[derive(Serialize, Debug, Clone, PartialEq)]
#[derive(Serialize, Debug, Clone)]
pub struct FaultState {
pub fault_code: u16,
pub fault_description: String,
pub time_stamp: u64,
}

#[derive(Serialize, Debug, Clone)]
pub struct InverterStatusState {
pub fault: Option<FaultState>,
/// RUN (Inverter running)
pub running: bool,
/// Forward running motor spins forward
Expand Down
Loading
Loading