Description
Several instruction classes don't properly inherit from a base class, breaking type inference:
InstructionFeedRate has no parent class
Instruction3DPrinterPlottingHeight has no parent class
Instruction3DPrinterNavigationHeight has no parent class
Create a Protocol that all instruction classes implement, ensuring consistent interface.
Proposed Changes
Add to instruction module:
from typing import Protocol
class Instruction(Protocol):
def to_g_code(self) -> str: ...
def __str__(self) -> str: ...
Ensure all instruction classes either:
- Inherit from a common base class, OR
- Implement the Protocol interface
Acceptance Criteria
Description
Several instruction classes don't properly inherit from a base class, breaking type inference:
InstructionFeedRatehas no parent classInstruction3DPrinterPlottingHeighthas no parent classInstruction3DPrinterNavigationHeighthas no parent classCreate a
Protocolthat all instruction classes implement, ensuring consistent interface.Proposed Changes
Add to instruction module:
Ensure all instruction classes either:
Acceptance Criteria
Instructionprotocol in instruction moduleInstructionFeedRateimplements the protocol (add_BaseInstructioninheritance or ensure protocol compliance)Instruction3DPrinterPlottingHeightimplements the protocolInstruction3DPrinterNavigationHeightimplements the protocolTInstructionUniontype in_Layer.pyto use the protocol