|
@@ -4,6 +4,8 @@ import com.ur.urcap.api.contribution.toolbar.ToolbarAPIProvider;
|
|
import com.ur.urcap.api.contribution.toolbar.ToolbarContext;
|
|
import com.ur.urcap.api.contribution.toolbar.ToolbarContext;
|
|
import com.ur.urcap.api.contribution.toolbar.swing.SwingToolbarContribution;
|
|
import com.ur.urcap.api.contribution.toolbar.swing.SwingToolbarContribution;
|
|
import com.ur.urcap.api.domain.io.DigitalIO;
|
|
import com.ur.urcap.api.domain.io.DigitalIO;
|
|
|
|
+import urgrip.installation.URGripInstallationNodeContribution;
|
|
|
|
+import urgrip.installation.URGripInstallationNodeService;
|
|
|
|
|
|
import javax.swing.*;
|
|
import javax.swing.*;
|
|
import java.awt.*;
|
|
import java.awt.*;
|
|
@@ -16,14 +18,13 @@ class MyToolbarContribution implements SwingToolbarContribution {
|
|
private final ToolbarContext context;
|
|
private final ToolbarContext context;
|
|
private final ToolbarAPIProvider apiProvider;
|
|
private final ToolbarAPIProvider apiProvider;
|
|
private final IOHandler ioHandler;
|
|
private final IOHandler ioHandler;
|
|
|
|
+ private final URGripInstallationNodeContribution installationNode;
|
|
private JLabel demoToolStatus;
|
|
private JLabel demoToolStatus;
|
|
private HashMap<String, JCheckBox> boxes=new HashMap<>();
|
|
private HashMap<String, JCheckBox> boxes=new HashMap<>();
|
|
- private DigitalIO out0,out1, in0, in1;
|
|
|
|
|
|
+ private DigitalIO ioGripClose, ioGripOpen, ioCoupleClose, ioCoupleOpen, blowout, waitfor;
|
|
private JButton bGrip;
|
|
private JButton bGrip;
|
|
private JButton bRelease;
|
|
private JButton bRelease;
|
|
private JButton bBlow;
|
|
private JButton bBlow;
|
|
- private JButton couple;
|
|
|
|
- private JButton decouple;
|
|
|
|
private JButton bCouple;
|
|
private JButton bCouple;
|
|
private JButton bDecouple;
|
|
private JButton bDecouple;
|
|
|
|
|
|
@@ -32,10 +33,13 @@ class MyToolbarContribution implements SwingToolbarContribution {
|
|
this.context = context;
|
|
this.context = context;
|
|
this.apiProvider = context.getAPIProvider();
|
|
this.apiProvider = context.getAPIProvider();
|
|
this.ioHandler = new IOHandler(this.apiProvider.getApplicationAPI().getIOModel());
|
|
this.ioHandler = new IOHandler(this.apiProvider.getApplicationAPI().getIOModel());
|
|
|
|
+ this.installationNode = apiProvider.getApplicationAPI().getInstallationNode(URGripInstallationNodeContribution.class);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void openView() {
|
|
public void openView() {
|
|
|
|
+ initializeIO();
|
|
|
|
+
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -44,11 +48,13 @@ class MyToolbarContribution implements SwingToolbarContribution {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- private void InitializeIO() {
|
|
|
|
- out0 = ioHandler.getDigitalIO("tool_out[0]");
|
|
|
|
- out1 = ioHandler.getDigitalIO("tool_out[1]");
|
|
|
|
- in0 = ioHandler.getDigitalIO("tool_in[0]");
|
|
|
|
- in1 = ioHandler.getDigitalIO("tool_in[1]");
|
|
|
|
|
|
+ private void initializeIO() {
|
|
|
|
+ ioGripClose = ioHandler.getDigitalIO(installationNode.getGripCloseIO());
|
|
|
|
+ ioGripOpen = ioHandler.getDigitalIO(installationNode.getGripOpenIO());
|
|
|
|
+ ioCoupleClose = ioHandler.getDigitalIO(installationNode.getCoupleCloseIO());
|
|
|
|
+ ioCoupleOpen = ioHandler.getDigitalIO(installationNode.getCoupleOpenIO());
|
|
|
|
+ blowout = ioHandler.getDigitalIO(installationNode.getBlowoutIO());
|
|
|
|
+ waitfor = ioHandler.getDigitalIO(installationNode.getWaitforIO());
|
|
}
|
|
}
|
|
|
|
|
|
public void buildUI(JPanel jPanel) {
|
|
public void buildUI(JPanel jPanel) {
|
|
@@ -76,7 +82,8 @@ class MyToolbarContribution implements SwingToolbarContribution {
|
|
box.add(bGrip);
|
|
box.add(bGrip);
|
|
new MyButton(bGrip, new HandleButton() {
|
|
new MyButton(bGrip, new HandleButton() {
|
|
@Override public void action() {
|
|
@Override public void action() {
|
|
- out0.setValue(true);
|
|
|
|
|
|
+ ioGripOpen.setValue(true);
|
|
|
|
+ ioGripClose.setValue(false);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
@@ -84,15 +91,21 @@ class MyToolbarContribution implements SwingToolbarContribution {
|
|
box.add(bRelease);
|
|
box.add(bRelease);
|
|
new MyButton(bRelease, new HandleButton() {
|
|
new MyButton(bRelease, new HandleButton() {
|
|
@Override public void action() {
|
|
@Override public void action() {
|
|
- out0.setValue(false);
|
|
|
|
|
|
+ ioGripOpen.setValue(false);
|
|
|
|
+ ioGripClose.setValue(true);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
bBlow = new JButton("blow out");
|
|
bBlow = new JButton("blow out");
|
|
box.add(bBlow);
|
|
box.add(bBlow);
|
|
new MyButton(bBlow, new HandleButton() {
|
|
new MyButton(bBlow, new HandleButton() {
|
|
- @Override public void action() {
|
|
|
|
- out0.setValue(false);
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public void down() {
|
|
|
|
+ blowout.setValue(true);
|
|
|
|
+ }
|
|
|
|
+ @Override
|
|
|
|
+ public void up() {
|
|
|
|
+ blowout.setValue(false);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
@@ -100,7 +113,8 @@ class MyToolbarContribution implements SwingToolbarContribution {
|
|
box.add(bCouple);
|
|
box.add(bCouple);
|
|
new MyButton(bCouple, new HandleButton() {
|
|
new MyButton(bCouple, new HandleButton() {
|
|
@Override public void action() {
|
|
@Override public void action() {
|
|
- out0.setValue(false);
|
|
|
|
|
|
+ ioCoupleClose.setValue(false);
|
|
|
|
+ ioCoupleOpen.setValue(true);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
@@ -108,7 +122,8 @@ class MyToolbarContribution implements SwingToolbarContribution {
|
|
box.add(bDecouple);
|
|
box.add(bDecouple);
|
|
new MyButton(bDecouple, new HandleButton() {
|
|
new MyButton(bDecouple, new HandleButton() {
|
|
@Override public void action() {
|
|
@Override public void action() {
|
|
- out0.setValue(false);
|
|
|
|
|
|
+ ioCoupleClose.setValue(true);
|
|
|
|
+ ioCoupleOpen.setValue(false);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
return box;
|
|
return box;
|