Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing deprecated driver code, etc. #267

Open
wants to merge 36 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
32b246d
Added a (failing) test to demonstrate dithering.
cbiffle Mar 9, 2012
cab13a4
Removed the excess-tracking code from the drivers.
cbiffle Mar 9, 2012
3cfb577
Fixed compilation errors in MachineLoaderTest.
cbiffle Mar 9, 2012
c01bd8d
Removed unused deprecated code in Sanguino3GDriver.
cbiffle Mar 9, 2012
45dc178
Fixed incorrect override that disabled stepper fan.
cbiffle Mar 9, 2012
f9db2bb
Removed overrides of deprecated API in MightyBoard.
cbiffle Mar 9, 2012
75c54f1
Improved code reuse in Makerbot4G*Driver.
cbiffle Mar 9, 2012
5ea1e1c
@Deprecated/@Override cleanup in Driver classes.
cbiffle Mar 9, 2012
ecc5d15
Cleaned up DriverBaseImplementation, mostly.
cbiffle Mar 9, 2012
3b6b3f6
Marked SerialDriver as abstract.
cbiffle Mar 9, 2012
17b477d
Cleaned up Sanguino3GDriver, mostly.
cbiffle Mar 9, 2012
1b37a7c
Cleaned up Makerbot4GDriver.
cbiffle Mar 9, 2012
8172560
Removed an unused variable from MB4GAD.
cbiffle Mar 9, 2012
ff84f72
Miscellaneous cleanups in driver package:
cbiffle Mar 10, 2012
77bf80a
Fixed infinite recursion in setMotorDirection.
cbiffle Mar 10, 2012
49bf43b
Added @Overrides in two virtual drivers.
cbiffle Mar 10, 2012
0b374df
Modernizing Driver's API.
cbiffle Mar 10, 2012
06a13f0
Modernized DriverQueryInterface.
cbiffle Mar 10, 2012
3202278
Removed old-style tool status methods from Driver.
cbiffle Mar 10, 2012
9901d17
Removed old-style methods for motor speed/dir from Driver.
cbiffle Mar 10, 2012
b1060b9
Removed old-style motor enable/disable methods from Driver.
cbiffle Mar 10, 2012
7d0291f
Removed old-style temperature control methods from Driver.
cbiffle Mar 10, 2012
102a0f7
Removed old-style fan control methods from Driver.
cbiffle Mar 10, 2012
4ecb79c
Removed old-style ABP method from Driver.
cbiffle Mar 10, 2012
9af8624
Removed old-style valve control methods from Driver.
cbiffle Mar 10, 2012
c54fd32
Removed old-style spindle methods from Driver.
cbiffle Mar 10, 2012
7af51aa
Valve G-Code commands are now multi-tool aware.
cbiffle Mar 10, 2012
5bd64ac
Spindle and temperature G-Codes are now multitool-aware.
cbiffle Mar 10, 2012
f3db5c8
Most (all?) commands now take explicit tool indices.
cbiffle Mar 10, 2012
0e207ef
Added driver name and stop info to DriverQueryInterface.
cbiffle Mar 10, 2012
7b9c9cb
Added code to defend against the negative tool hack.
cbiffle Mar 10, 2012
d6c7147
Fixed a typo introduced in 06a13f07.
cbiffle Mar 10, 2012
f2343b0
Cleaned up MCode parser to use 'tool' field.
cbiffle Mar 10, 2012
bf8c128
Fixed HBP control hack in ExtruderPanel.
cbiffle Mar 10, 2012
98c625e
Removed bogus NaN check in ExtruderPanel.
cbiffle Mar 10, 2012
e21879f
Merge branch 'master' of https://github.com/makerbot/ReplicatorG into…
cbiffle Mar 12, 2012
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
Prev Previous commit
Next Next commit
Removed old-style methods for motor speed/dir from Driver.
Fortunately, most code was already using the new-style methods.
cbiffle committed Mar 10, 2012

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 9901d17afb81143918eb20875cab297ccd78a0d0
4 changes: 2 additions & 2 deletions src/replicatorg/app/ui/controlpanel/ExtruderPanel.java
Original file line number Diff line number Diff line change
@@ -801,14 +801,14 @@ private void handleChangedItem(ItemEvent e, ToolModel tool) {
machine.runCommand(new replicatorg.drivers.commands.SetMotorDirection(AxialDirection.CLOCKWISE,toolhead));
// TODO: Hack to support RepRap/Ultimaker- always re-send RPM
if (tool.motorHasEncoder() || tool.motorIsStepper()) {
machine.runCommand(new replicatorg.drivers.commands.SetMotorSpeedRPM(machine.getDriver().getMotorRPM(),toolhead));
machine.runCommand(new replicatorg.drivers.commands.SetMotorSpeedRPM(machine.getDriverQueryInterface().getMotorRPM(toolhead), toolhead));
}
machine.runCommand(new replicatorg.drivers.commands.EnableExtruderMotor(toolhead));
} else if (name.equals("motor-reverse")) {
machine.runCommand(new replicatorg.drivers.commands.SetMotorDirection(AxialDirection.COUNTERCLOCKWISE,toolhead));
// TODO: Hack to support RepRap/Ultimaker- always re-send RPM
if (tool.motorHasEncoder() || tool.motorIsStepper()) {
machine.runCommand(new replicatorg.drivers.commands.SetMotorSpeedRPM(machine.getDriver().getMotorRPM(),toolhead));
machine.runCommand(new replicatorg.drivers.commands.SetMotorSpeedRPM(machine.getDriverQueryInterface().getMotorRPM(toolhead), toolhead));
}
machine.runCommand(new replicatorg.drivers.commands.EnableExtruderMotor(toolhead));
} else if (name.equals("motor-stop")) {
4 changes: 0 additions & 4 deletions src/replicatorg/drivers/Driver.java
Original file line number Diff line number Diff line change
@@ -271,18 +271,14 @@ public interface Driver {
/***************************************************************************
* Motor interface functions
**************************************************************************/
@Deprecated public void setMotorDirection(int dir);
public void setMotorDirection(int dir, int toolhead);

public void setMotorRPM(double rpm, int toolhead) throws RetryException;

@Deprecated public void setMotorSpeedPWM(int pwm) throws RetryException;
public void setMotorSpeedPWM(int pwm, int toolhead) throws RetryException;

@Deprecated public double getMotorRPM();
public double getMotorRPM(int toolhead);

@Deprecated public int getMotorSpeedPWM();
public int getMotorSpeedPWM(int toolhead);

/**
17 changes: 0 additions & 17 deletions src/replicatorg/drivers/DriverBaseImplementation.java
Original file line number Diff line number Diff line change
@@ -457,10 +457,6 @@ protected Point5d getDelta(Point5d p) {
/***************************************************************************
* Motor interface functions
**************************************************************************/
@Deprecated @Override public void setMotorDirection(int dir) {
this.setMotorDirection(dir, machine.currentTool().getIndex());
}

@Override
public void setMotorDirection(int dir, int toolhead) {
/// toolhead -1 indicate auto-detect. Fast hack to get software out..
@@ -479,11 +475,6 @@ public void setMotorRPM(double rpm, int toolhead) throws RetryException {

}

@Deprecated @Override
public void setMotorSpeedPWM(int pwm) throws RetryException {
this.setMotorSpeedPWM(pwm, machine.currentTool().getIndex());
}

@Override public void setMotorSpeedPWM(int pwm, int toolhead) throws RetryException {
/// toolhead -1 indicate auto-detect.Fast hack to get software out..
if(toolhead == -1 ) toolhead = machine.currentTool().getIndex();
@@ -536,19 +527,11 @@ public void disableMotor() throws RetryException {

}

@Deprecated @Override public double getMotorRPM() {
return getMotorRPM(-1);
}

@Override public double getMotorRPM(int toolhead) {
if (toolhead == -1) toolhead = machine.currentTool().getIndex();
return machine.getTool(toolhead).getMotorSpeedRPM();
}

@Deprecated @Override public int getMotorSpeedPWM() {
return getMotorSpeedPWM(-1);
}

@Override public int getMotorSpeedPWM(int toolhead) {
if (toolhead == -1) toolhead = machine.currentTool().getIndex();
return machine.getTool(toolhead).getMotorSpeedPWM();
7 changes: 4 additions & 3 deletions src/replicatorg/drivers/gen3/Makerbot4GAlternateDriver.java
Original file line number Diff line number Diff line change
@@ -236,9 +236,10 @@ protected void queueNewPoint(Point5d steps, long us, int relative) throws RetryE
* Overridden to not ask the board for the RPM as it would report the RPM from the extruder
* controller, which doesn't know about it in this case.
*/
@Override public double getMotorRPM() {
double rpm = machine.currentTool().getMotorSpeedRPM();
machine.currentTool().setMotorSpeedReadingRPM(rpm);
@Override public double getMotorRPM(int toolhead) {
ToolModel tool = machine.getTool(toolhead);
double rpm = tool.getMotorSpeedRPM();
tool.setMotorSpeedReadingRPM(rpm);
return rpm;
}

2 changes: 1 addition & 1 deletion src/replicatorg/drivers/gen3/MightyBoard.java
Original file line number Diff line number Diff line change
@@ -297,11 +297,11 @@ public boolean initializeBot()
for (ToolModel t : getMachine().getTools()) {
if (t != null) {
initSlave(t.getIndex());
getMotorRPM(t.getIndex()); //load our motor RPM from firmware if we can.
}
}

getStepperValues(); //read our current steppers into a local cache
getMotorRPM(); //load our motor RPM from firmware if we can.
if (verifyMachineId() == false ) //read and verify our PID/VID if we can
{
Base.logger.severe("Machine ID Mismatch. Please re-select your machine.");