Skip to content

Commit

Permalink
Major changes to Control Panel, switched direction of some replicator…
Browse files Browse the repository at this point in the history
… buttons, changed temperature graph based on support's input.
  • Loading branch information
Ted authored and Ted committed Jan 24, 2012
1 parent 3f17219 commit 276af05
Show file tree
Hide file tree
Showing 21 changed files with 575 additions and 345 deletions.
20 changes: 20 additions & 0 deletions machines/test.xml
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -19,6 +19,26 @@
<cooldown> <cooldown>
</cooldown> </cooldown>
</machine> </machine>
<machine>
<name>Virtual Printer Dual</name>
<geometry type="cartesian">
<!-- different pulleys on X and Y axii -->
<axis id="x" length="100" maxfeedrate="5000" stepspermm="11.767463" endstops="min"/>
<axis id="y" length="100" maxfeedrate="5000" stepspermm="11.767463" endstops="min"/>
<axis id="z" length="100" maxfeedrate="150" stepspermm="320" endstops="min"/>
</geometry>
<tools>
<tool name="Magic Left" type="extruder" material="abs" motor="true" fan="true" index="1" heater="true"/>
<tool name="Magic Right" type="extruder" material="abs" motor="true" fan="true" index="0" heater="true" heatedplatform="true"/>
</tools>
<clamps></clamps>
<driver name="virtualprinter">
</driver>
<warmup>
</warmup>
<cooldown>
</cooldown>
</machine>
<machine> <machine>
<name>Virtual Printer w/ A and B Axes</name> <name>Virtual Printer w/ A and B Axes</name>
<geometry type="cartesian"> <geometry type="cartesian">
Expand Down
File renamed without changes
File renamed without changes
Binary file added resources/images/jog/makerbot/LeftX-.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/jog/makerbot/LeftX-Over.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
Binary file added resources/images/jog/makerbot/LeftY-.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/jog/makerbot/LeftY-Over.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/jog/makerbot/RightX+.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/jog/makerbot/RightX+Over.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
Binary file added resources/images/jog/makerbot/RightY+.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/jog/makerbot/RightY+Over.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
5 changes: 3 additions & 2 deletions src/replicatorg/app/ui/CallbackTextField.java
Original file line number Original file line Diff line number Diff line change
@@ -1,16 +1,17 @@
package replicatorg.app.ui; package replicatorg.app.ui;


import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.text.Format; import java.text.Format;


import replicatorg.app.Base; import replicatorg.app.Base;
import replicatorg.app.ui.controlpanel.ExtruderPanel; import replicatorg.app.ui.controlpanel.ExtruderPanel;


public class CallbackTextField extends ActionTextField { public class CallbackTextField extends ActionTextField {
ExtruderPanel panel; ActionListener panel;
String actionCommand; String actionCommand;


public CallbackTextField(ExtruderPanel panel, String actionCommand, String name, int columns, Format format) { public CallbackTextField(ActionListener panel, String actionCommand, String name, int columns, Format format) {
super(null, columns, format); super(null, columns, format);
// setMaximumSize(new Dimension(textBoxWidth, 25)); // setMaximumSize(new Dimension(textBoxWidth, 25));
// setMinimumSize(new Dimension(textBoxWidth, 25)); // setMinimumSize(new Dimension(textBoxWidth, 25));
Expand Down
75 changes: 41 additions & 34 deletions src/replicatorg/app/ui/controlpanel/ControlPanelWindow.java
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@
import replicatorg.machine.model.AxisId; import replicatorg.machine.model.AxisId;
import replicatorg.machine.model.Endstops; import replicatorg.machine.model.Endstops;
import replicatorg.machine.model.MachineType; import replicatorg.machine.model.MachineType;
import replicatorg.machine.model.ToolModel;


public class ControlPanelWindow extends JFrame implements public class ControlPanelWindow extends JFrame implements
ChangeListener, WindowListener, ChangeListener, WindowListener,
Expand Down Expand Up @@ -156,14 +155,14 @@ public void actionPerformed(ActionEvent e){
mainPanel.setLayout(new MigLayout("gap 5, ins 5, flowy")); mainPanel.setLayout(new MigLayout("gap 5, ins 5, flowy"));


jogPanel = new JogPanel(machine); jogPanel = new JogPanel(machine);
mainPanel.add(jogPanel,"split 4, growx"); mainPanel.add(jogPanel,"split 4, growx, growy");
mainPanel.add(createActivationPanel(),"split, growx"); mainPanel.add(createActivationPanel(),"split, growx");
if(newMachine.getMachineType() == MachineType.THE_REPLICATOR) if(newMachine.getMachineType() == MachineType.THE_REPLICATOR)
{ {
mainPanel.add(ledStripButton ,"growx"); mainPanel.add(ledStripButton ,"growx");
mainPanel.add(createBeepPanel(), "growx"); mainPanel.add(createBeepPanel(), "growx");
} }
mainPanel.add(createToolsPanel(),"newline, growy"); mainPanel.add(alternateToolsPanel(),"newline, growy");


this.setResizable(false); this.setResizable(false);
add(mainPanel); add(mainPanel);
Expand Down Expand Up @@ -299,40 +298,48 @@ public void actionPerformed(ActionEvent e) {


Vector<ExtruderPanel> extruderPanels = new Vector<ExtruderPanel>(); Vector<ExtruderPanel> extruderPanels = new Vector<ExtruderPanel>();


protected JComponent createToolsPanel() { // protected JComponent createToolsPanel() {
toolsPane = new JTabbedPane(); // toolsPane = new JTabbedPane();

//
// reverse list, such that Left/Right appears natural to users // // reverse list, such that Left/Right appears natural to users
for( int i = machine.getModel().getTools().size(); i > 0; i--) { // for( int i = machine.getModel().getTools().size(); i > 0; i--) {
ToolModel t = machine.getModel().getTools().elementAt(i -1); // ToolModel t = machine.getModel().getTools().elementAt(i -1);
// for (Enumeration<ToolModel> e = machine.getModel().getTools().elements(); e.hasMoreElements();) { //// for (Enumeration<ToolModel> e = machine.getModel().getTools().elements(); e.hasMoreElements();) {
// ToolModel t = e.nextElement(); //// ToolModel t = e.nextElement();
if (t == null) continue; // if (t == null) continue;
if (t.getType().equals("extruder")) { // if (t.getType().equals("extruder")) {
Base.logger.fine("Creating panel for " + t.getName()); // Base.logger.fine("Creating panel for " + t.getName());
ExtruderPanel extruderPanel = new ExtruderPanel(machine,t); // ExtruderPanel extruderPanel = new ExtruderPanel(machine,t);
toolsPane.addTab(t.getName() + " Plastic Extruder",extruderPanel); // toolsPane.addTab(t.getName() + " Plastic Extruder",extruderPanel);
extruderPanels.add(extruderPanel); // extruderPanels.add(extruderPanel);
if (machine.getModel().currentTool() == t) { // if (machine.getModel().currentTool() == t) {
toolsPane.setSelectedComponent(extruderPanel); // toolsPane.setSelectedComponent(extruderPanel);
} // }
} else { // } else {
Base.logger.warning("Unsupported tool for control panel."); // Base.logger.warning("Unsupported tool for control panel.");
} // }
} // }
toolsPane.addChangeListener(new ChangeListener() { // // This is no longer necessary, stuff just sends commands to the correct tool
public void stateChanged(ChangeEvent ce) { //// toolsPane.addChangeListener(new ChangeListener() {
final JTabbedPane tp = (JTabbedPane)ce.getSource(); //// public void stateChanged(ChangeEvent ce) {
final ExtruderPanel ep = (ExtruderPanel)tp.getSelectedComponent(); //// final JTabbedPane tp = (JTabbedPane)ce.getSource();
machine.runCommand(new replicatorg.drivers.commands.SelectTool(ep.getTool().getIndex())); //// final ExtruderPanel ep = (ExtruderPanel)tp.getSelectedComponent();
} //// machine.runCommand(new replicatorg.drivers.commands.SelectTool(ep.getTool().getIndex()));
}); //// }
return toolsPane; //// });
// return toolsPane;
// }

protected JComponent alternateToolsPanel() {
extruderPanels.add(0, new ExtruderPanel(machine));
return extruderPanels.firstElement();
} }


public void updateStatus() { public void updateStatus() {
if(jogPanel != null) jogPanel.updateStatus(); if(jogPanel != null)
else Base.logger.severe("null jog panel"); jogPanel.updateStatus();
else
Base.logger.severe("null jog panel");


for (ExtruderPanel e : extruderPanels) { for (ExtruderPanel e : extruderPanels) {
e.updateStatus(); e.updateStatus();
Expand Down
Loading

0 comments on commit 276af05

Please sign in to comment.