Permalink
Browse files

dist-all.sh: Changed so it doesn't give errors when run

thingomatic.xml: Updated so all profiles clearly specify platform and extruder version
MachineLoader.java: Removed an error msg since a sub-function send a very clear error message
MainWindow.java: added a quick case-ignore compare, added a warning when changing to a 'mk5' profile from any/all no 'mk5' profiles. Added a new machine load fail error message.
  • Loading branch information...
1 parent 06b782c commit a2f80a3457b56664d8d77f02539c86a41a121b63 @FarMcKon FarMcKon committed Sep 22, 2011
View
@@ -1,7 +1,7 @@
#!/bin/sh
# I created this because I couldn't get the ant target dist to compile on OS X =ml=
-if [[ `uname` != 'Darwin' ]]; then
+if [ `uname` != 'Darwin' ]; then
echo "OS X is required to build all distros."
echo "You have been warned!"
fi
View
@@ -1,7 +1,7 @@
<?xml version="1.1" encoding="utf-8"?>
<machines>
<machine>
- <name>Thingomatic w/ Automated Build Platform</name>
+ <name>Thingomatic w/ ABP Extruder MK5</name>
<geometry type="cartesian">
<!-- different pulleys on X and Y axii -->
<axis id="x" length="106" maxfeedrate="4000" homingfeedrate="500" stepspermm="47.069852" endstops="min"/> <!-- Pulley dia: 10.82mm / 1/8 step = 1/(10.82 * pi / 1600) -->
@@ -25,7 +25,7 @@ M18
</machine>
<machine>
- <name>Thingomatic w/ Heated Build Platform</name>
+ <name>Thingomatic w/ HBP and Extruder MK5</name>
<geometry type="cartesian">
<!-- different pulleys on X and Y axii -->
<axis id="x" length="106" maxfeedrate="4000" homingfeedrate="500" stepspermm="47.069852" endstops="min"/> <!-- Pulley dia: 10.82mm / 1/8 step = 1/(10.82 * pi / 1600) -->
@@ -49,7 +49,7 @@ M18
</cooldown>
</machine>
<machine>
- <name>Thingomatic w/ HBP and Stepstruder MK6</name>
+ <name>Thingomatic w/ HBP and Extruder MK6</name>
<geometry type="cartesian">
<!-- different pulleys on X and Y axii -->
<axis id="x" length="106" maxfeedrate="4000" homingfeedrate="500" stepspermm="47.069852" endstops="min"/> <!-- Pulley dia: 10.82mm / 1/8 step = 1/(10.82 * pi / 1600) -->
@@ -58,7 +58,8 @@ M18
<axis id="a" length="100000" maxfeedrate="1600" stepspermm="50.235478806907409" endstops="none"/> <!-- stepspermm is incoming filament length, 127 is ca. 4 RPM, 1600 ca. 50 RPM -->
</geometry>
<tools>
- <tool name="Stepstruder MK6" type="extruder" material="abs" motor="true" fan="true" heatedplatform="true" motor_steps="1600" default_rpm="1.98" heater="true" stepper_axis="a"/>
+ <tool name="Stepstruder MK6" type="extruder" material="abs" motor="true" fan="true" heatedplatform="true" motor_steps="1600"
+ default_rpm="1.98" heater="true" stepper_axis="a"/>
</tools>
<clamps></clamps>
<driver name="makerbot4ga">
@@ -73,7 +74,32 @@ M18
</cooldown>
</machine>
<machine>
- <name>Thingomatic w/ ABP and Stepstruder MK6</name>
+ <name>Thingomatic w/ HBP and Extruder MK7</name>
+ <geometry type="cartesian">
+ <!-- different pulleys on X and Y axii -->
+ <axis id="x" length="106" maxfeedrate="4000" homingfeedrate="500" stepspermm="47.069852" endstops="min"/> <!-- Pulley dia: 10.82mm / 1/8 step = 1/(10.82 * pi / 1600) -->
+ <axis id="y" length="120" maxfeedrate="4000" homingfeedrate="500" stepspermm="47.069852" endstops="min"/> <!-- Pulley dia: 10.82mm / 1/8 step = 1/(10.82 * pi / 1600) -->
+ <axis id="z" length="106" maxfeedrate="1000" homingfeedrate="500" stepspermm="200" endstops="max"/> <!-- TR-8x8 Z axis = 1/(8/1600) -->
+ <axis id="a" length="100000" maxfeedrate="1600" stepspermm="50.235478806907409" endstops="none"/> <!-- stepspermm is incoming filament length, 127 is ca. 4 RPM, 1600 ca. 50 RPM -->
+ </geometry>
+ <tools>
+ <tool name="Stepstruder MK7" type="extruder" material="abs" motor="true" fan="true" heatedplatform="true" motor_steps="1600"
+ default_rpm="3" heater="true" stepper_axis="a"/>
+ </tools>
+ <clamps></clamps>
+ <driver name="makerbot4ga">
+ <!-- optional: <portname>COM1</portname> -->
+ <rate>115200</rate>
+ </driver>
+ <warmup>
+ </warmup>
+ <cooldown>
+(Turn off steppers after a build.)
+M18
+ </cooldown>
+ </machine>
+ <machine>
+ <name>Thingomatic w/ ABP and Extruder MK6</name>
<geometry type="cartesian">
<!-- different pulleys on X and Y axii -->
<axis id="x" length="106" maxfeedrate="4000" homingfeedrate="500" stepspermm="47.069852" endstops="min"/> <!-- Pulley dia: 10.82mm / 1/8 step = 1/(10.82 * pi / 1600) -->
@@ -96,6 +122,30 @@ M18
M18
</cooldown>
</machine>
+ <machine>
+ <name>Thingomatic w/ ABP and Extruder MK7</name>
+ <geometry type="cartesian">
+ <!-- different pulleys on X and Y axii -->
+ <axis id="x" length="106" maxfeedrate="4000" homingfeedrate="500" stepspermm="47.069852" endstops="min"/> <!-- Pulley dia: 10.82mm / 1/8 step = 1/(10.82 * pi / 1600) -->
+ <axis id="y" length="120" maxfeedrate="4000" homingfeedrate="500" stepspermm="47.069852" endstops="min"/> <!-- Pulley dia: 10.82mm / 1/8 step = 1/(10.82 * pi / 1600) -->
+ <axis id="z" length="106" maxfeedrate="1000" homingfeedrate="500" stepspermm="200" endstops="max"/> <!-- TR-8x8 Z axis = 1/(8/1600) -->
+ <axis id="a" length="100000" maxfeedrate="1600" stepspermm="50.235478806907409" endstops="none"/> <!-- stepspermm is incoming filament length, 127 is ca. 4 RPM, 1600 ca. 50 RPM -->
+ </geometry>
+ <tools>
+ <tool name="Stepstruder MK7" type="extruder" material="abs" motor="true" heatedplatform="true" automatedplatform="true" motor_steps="1600" default_rpm="3" heater="true" stepper_axis="a"/>
+ </tools>
+ <clamps></clamps>
+ <driver name="makerbot4ga">
+ <!-- optional: <portname>COM1</portname> -->
+ <rate>115200</rate>
+ </driver>
+ <warmup>
+ </warmup>
+ <cooldown>
+(Turn off steppers after a build.)
+M18
+ </cooldown>
+ </machine>
<machine>
<name>Thingomatic w/ Frostruder</name>
@@ -1005,6 +1005,14 @@ protected void handleRealTimeControl() {
}
}
class MachineMenuListener implements ActionListener {
+
+ /* a quick case insensitive match function.
+ * @returns true of subString is in baseString (case insensitive), false otherwise
+ **/
+ public boolean containsIgnoreCase(String baseString, String subString) {
+ return Pattern.compile(Pattern.quote(subString), Pattern.CASE_INSENSITIVE).matcher(baseString).find();
+
+ }
public void actionPerformed(ActionEvent e) {
if (machineMenu == null) {
System.out.println("machineMenu is null");
@@ -1020,6 +1028,16 @@ public void actionPerformed(ActionEvent e) {
if (e.getSource() instanceof JRadioButtonMenuItem) {
JRadioButtonMenuItem item = (JRadioButtonMenuItem) e.getSource();
final String name = item.getText();
+
+ //if new machine driver name have "Mk5" and the previous driver name does not
+ if(containsIgnoreCase(name, "MK5" ) &&
+ (containsIgnoreCase( Base.preferences.get("machine.name", null), "MK5") == false ) )
+ {
+ String msg = new String("MK6 or newer downgrading to MK5 requires manual changes.\n Search 'Mk5 Extruder Downgrade' on http://wiki.makerbot.com for instructions.");
+ JOptionPane.showMessageDialog(null, msg, "Warning:Manual Downgrade to MK5 Needed", JOptionPane.WARNING_MESSAGE);
+
+ }
+
Base.preferences.put("machine.name", name);
}
}
@@ -1039,6 +1057,9 @@ public void actionPerformed(ActionEvent e) {
}
}
+ /* Function to generate a list of
+ * supported machines to be displayed in the Driver menu item.
+ */
protected void populateMachineMenu() {
machineMenu.removeAll();
machineMenuListener = new MachineMenuListener();
@@ -1052,8 +1073,8 @@ protected void populateMachineMenu() {
System.out.println("error retrieving machine list");
exception.printStackTrace();
}
-
Collections.sort(names);
+
ButtonGroup radiogroup = new ButtonGroup();
for (String name : names ) {
@@ -1333,6 +1354,7 @@ public void handleConnect() {
if ( name != null ) {
loadMachine(name, true);
}
+
}
public void handleOnboardPrefs() {
@@ -2535,8 +2557,12 @@ public void loadMachine(String name, boolean doConnect) {
// 3. If this is a new machine, record a reference to it
// 4. Hook the machine to the main window.
- machineLoader.load(name);
- // TODO: Check if the machine failed to load, and bail here if necessary?
+ boolean loaded = machineLoader.load(name);
+
+ if(loaded == false) {
+ Base.logger.severe("could not load machine '" + name + "' please check Driver-> <Machine Name> ");
+ return;
+ }
String targetPort;
@@ -60,7 +60,10 @@ private MachineFactory() {
*/
public static Machine load(String name, MachineCallbackHandler callbackHandler) {
Node machineNode = getMachineNode(name);
- if (machineNode == null) { return null; }
+ if (machineNode == null) {
+ Base.logger.log(Level.SEVERE, "Could not load machine '" + name + "' no machineNode found");
+ return null;
+ }
return new Machine(machineNode, callbackHandler);
}
@@ -74,11 +77,10 @@ public static Machine loadSimulator() {
Base.preferences.getBoolean("machine.showExperimental", false);
MachineMap mm = getMachineMap();
for (Entry<String, Element> entry : mm.entrySet()) {
+ // filter out experimental machines of needed
if (!showExperimental) {
- // filter on experimental attribute.
String exp = entry.getValue().getAttribute("experimental");
if (exp.length() != 0 && !exp.equals("0")) {
- // Hide name
continue;
}
}
@@ -52,12 +52,13 @@ public Driver getDriver() {
public boolean load(String machineType) {
if (isLoaded()) {
machine.dispose();
+ machine = null;
}
machine = MachineFactory.load(machineType, callbackHandler);
if (machine == null) {
- Base.logger.severe("Unable to connect to machine!");
+ // no err, the above load() function prints an error
return false;
}

0 comments on commit a2f80a3

Please sign in to comment.