Permalink
Browse files

Major changes to Control Panel, switched direction of some replicator…

… buttons, changed temperature graph based on support's input.
  • Loading branch information...
tedbrandston committed Jan 24, 2012
1 parent 3f17219 commit 276af0525b98a8f249742e8c992936a0a5c208f5
View
@@ -19,6 +19,26 @@
<cooldown>
</cooldown>
</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>
<name>Virtual Printer w/ A and B Axes</name>
<geometry type="cartesian">
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,16 +1,17 @@
package replicatorg.app.ui;
import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
import java.text.Format;
import replicatorg.app.Base;
import replicatorg.app.ui.controlpanel.ExtruderPanel;
public class CallbackTextField extends ActionTextField {
- ExtruderPanel panel;
+ ActionListener panel;
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);
// setMaximumSize(new Dimension(textBoxWidth, 25));
// setMinimumSize(new Dimension(textBoxWidth, 25));
@@ -72,7 +72,6 @@
import replicatorg.machine.model.AxisId;
import replicatorg.machine.model.Endstops;
import replicatorg.machine.model.MachineType;
-import replicatorg.machine.model.ToolModel;
public class ControlPanelWindow extends JFrame implements
ChangeListener, WindowListener,
@@ -156,14 +155,14 @@ public void actionPerformed(ActionEvent e){
mainPanel.setLayout(new MigLayout("gap 5, ins 5, flowy"));
jogPanel = new JogPanel(machine);
- mainPanel.add(jogPanel,"split 4, growx");
+ mainPanel.add(jogPanel,"split 4, growx, growy");
mainPanel.add(createActivationPanel(),"split, growx");
if(newMachine.getMachineType() == MachineType.THE_REPLICATOR)
{
mainPanel.add(ledStripButton ,"growx");
mainPanel.add(createBeepPanel(), "growx");
}
- mainPanel.add(createToolsPanel(),"newline, growy");
+ mainPanel.add(alternateToolsPanel(),"newline, growy");
this.setResizable(false);
add(mainPanel);
@@ -299,40 +298,48 @@ public void actionPerformed(ActionEvent e) {
Vector<ExtruderPanel> extruderPanels = new Vector<ExtruderPanel>();
- protected JComponent createToolsPanel() {
- toolsPane = new JTabbedPane();
-
- // reverse list, such that Left/Right appears natural to users
- for( int i = machine.getModel().getTools().size(); i > 0; i--) {
- ToolModel t = machine.getModel().getTools().elementAt(i -1);
-// for (Enumeration<ToolModel> e = machine.getModel().getTools().elements(); e.hasMoreElements();) {
-// ToolModel t = e.nextElement();
- if (t == null) continue;
- if (t.getType().equals("extruder")) {
- Base.logger.fine("Creating panel for " + t.getName());
- ExtruderPanel extruderPanel = new ExtruderPanel(machine,t);
- toolsPane.addTab(t.getName() + " Plastic Extruder",extruderPanel);
- extruderPanels.add(extruderPanel);
- if (machine.getModel().currentTool() == t) {
- toolsPane.setSelectedComponent(extruderPanel);
- }
- } else {
- Base.logger.warning("Unsupported tool for control panel.");
- }
- }
- toolsPane.addChangeListener(new ChangeListener() {
- public void stateChanged(ChangeEvent ce) {
- final JTabbedPane tp = (JTabbedPane)ce.getSource();
- final ExtruderPanel ep = (ExtruderPanel)tp.getSelectedComponent();
- machine.runCommand(new replicatorg.drivers.commands.SelectTool(ep.getTool().getIndex()));
- }
- });
- return toolsPane;
+// protected JComponent createToolsPanel() {
+// toolsPane = new JTabbedPane();
+//
+// // reverse list, such that Left/Right appears natural to users
+// for( int i = machine.getModel().getTools().size(); i > 0; i--) {
+// ToolModel t = machine.getModel().getTools().elementAt(i -1);
+//// for (Enumeration<ToolModel> e = machine.getModel().getTools().elements(); e.hasMoreElements();) {
+//// ToolModel t = e.nextElement();
+// if (t == null) continue;
+// if (t.getType().equals("extruder")) {
+// Base.logger.fine("Creating panel for " + t.getName());
+// ExtruderPanel extruderPanel = new ExtruderPanel(machine,t);
+// toolsPane.addTab(t.getName() + " Plastic Extruder",extruderPanel);
+// extruderPanels.add(extruderPanel);
+// if (machine.getModel().currentTool() == t) {
+// toolsPane.setSelectedComponent(extruderPanel);
+// }
+// } else {
+// Base.logger.warning("Unsupported tool for control panel.");
+// }
+// }
+// // This is no longer necessary, stuff just sends commands to the correct tool
+//// toolsPane.addChangeListener(new ChangeListener() {
+//// public void stateChanged(ChangeEvent ce) {
+//// final JTabbedPane tp = (JTabbedPane)ce.getSource();
+//// final ExtruderPanel ep = (ExtruderPanel)tp.getSelectedComponent();
+//// machine.runCommand(new replicatorg.drivers.commands.SelectTool(ep.getTool().getIndex()));
+//// }
+//// });
+// return toolsPane;
+// }
+
+ protected JComponent alternateToolsPanel() {
+ extruderPanels.add(0, new ExtruderPanel(machine));
+ return extruderPanels.firstElement();
}
public void updateStatus() {
- if(jogPanel != null) jogPanel.updateStatus();
- else Base.logger.severe("null jog panel");
+ if(jogPanel != null)
+ jogPanel.updateStatus();
+ else
+ Base.logger.severe("null jog panel");
for (ExtruderPanel e : extruderPanels) {
e.updateStatus();
Oops, something went wrong.

0 comments on commit 276af05

Please sign in to comment.