Browse Source

add open/close signals for gripper and coupler
save settings

Martin Kunz 4 years ago
parent
commit
319b5c589a

+ 2 - 3
src/main/java/urgrip/Activator.java

@@ -1,12 +1,11 @@
 package urgrip;
 
-import com.ur.urcap.api.contribution.InstallationNodeService;
 import com.ur.urcap.api.contribution.installation.swing.SwingInstallationNodeService;
 import com.ur.urcap.api.contribution.program.swing.SwingProgramNodeService;
 import com.ur.urcap.api.contribution.toolbar.swing.SwingToolbarService;
 import org.osgi.framework.BundleActivator;
 import org.osgi.framework.BundleContext;
-import urgrip.installation.HelloWorldInstallationNodeService;
+import urgrip.installation.URGripInstallationNodeService;
 import urgrip.programnodes.GripperNodeService;
 import urgrip.toolbar.MyToolbarService;
 
@@ -17,7 +16,7 @@ public class Activator implements BundleActivator {
 		System.out.println("Gripper Activator says Hello World!");
 		context.registerService(SwingToolbarService.class, new MyToolbarService(), null);
 		context.registerService(SwingProgramNodeService.class, new GripperNodeService(), null);
-		context.registerService(SwingInstallationNodeService.class, new HelloWorldInstallationNodeService(), null);
+		context.registerService(SwingInstallationNodeService.class, new URGripInstallationNodeService(), null);
 	}
 
 	@Override

+ 0 - 102
src/main/java/urgrip/installation/HelloWorldInstallationNodeContribution.java

@@ -1,102 +0,0 @@
-package urgrip.installation;
-
-import com.ur.urcap.api.contribution.InstallationNodeContribution;
-import com.ur.urcap.api.contribution.installation.InstallationAPIProvider;
-import com.ur.urcap.api.domain.data.DataModel;
-import com.ur.urcap.api.domain.io.IO;
-import com.ur.urcap.api.domain.script.ScriptWriter;
-import com.ur.urcap.api.domain.userinteraction.keyboard.KeyboardInputCallback;
-import com.ur.urcap.api.domain.userinteraction.keyboard.KeyboardInputFactory;
-import com.ur.urcap.api.domain.userinteraction.keyboard.KeyboardTextInput;
-
-import java.util.Collection;
-
-public class HelloWorldInstallationNodeContribution implements InstallationNodeContribution {
-
-	private final HelloWorldInstallationNodeView view;
-	private final InstallationAPIProvider apiProvider;
-	public final static String KEY_GRIP="KEY_GRIP";
-	private final static String KEY_GRIP_DEFAULT="digital_out[0]";
-	public final static String KEY_BLOWOUT="KEY_BLOWOUT";
-	private final static String KEY_BLOWOUT_DEFAULT="digital_out[1]";
-	public final static String KEY_WAITFOR="KEY_WAITFOR";
-	private final static String KEY_WAITFOR_DEFAULT="digital_in[0]";
-
-	private DataModel model;
-
-	public HelloWorldInstallationNodeContribution(InstallationAPIProvider apiProvider, DataModel model, HelloWorldInstallationNodeView view) {
-		this.model = model;
-		this.view = view;
-		this.apiProvider=apiProvider;
-	}
-
-	@Override
-	public void openView() {
-		Collection<IO> ios = apiProvider.getInstallationAPI().getIOModel().getIOs();
-		view.setIO(ios);
-	}
-
-	@Override
-	public void closeView() {
-		setGripIO(getGripIO());
-
-	}
-
-	public boolean isDefined() {
-		if(getGripIO().isEmpty())
-			return false;
-		if(getBlowoutIO().isEmpty())
-			return false;
-		if(getWaitforIO().isEmpty())
-			return false;
-		return true;
-	}
-
-	@Override
-	public void generateScript(ScriptWriter writer) {
-		// Store the popup title in a global variable so it is globally available to all Hello World program nodes.
-		// writer.assign("hello_world_swing_popup_title", "\"" + getPopupTitle() + "\"");
-	}
-
-	public String getGripIO() {
-		return model.get(KEY_GRIP, KEY_GRIP_DEFAULT);
-	}
-
-	public String getBlowoutIO() {
-		return model.get(KEY_BLOWOUT, KEY_BLOWOUT_DEFAULT);
-	}
-
-	public String getWaitforIO() {
-		return model.get(KEY_WAITFOR, KEY_WAITFOR_DEFAULT);
-	}
-
-	public void setGripIO(String ioName) {
-		if ("".equals(ioName)) {
-			model.set(KEY_GRIP, KEY_GRIP_DEFAULT);
-		} else {
-			model.set(KEY_GRIP, ioName);
-		}
-	}
-
-	public void setBlowoutIO(String ioName) {
-		if ("".equals(ioName)) {
-			model.set(KEY_BLOWOUT, KEY_BLOWOUT_DEFAULT);
-		} else {
-			model.set(KEY_BLOWOUT, ioName);
-		}
-	}
-
-	public void setWaitforIO(String ioName) {
-		if ("".equals(ioName)) {
-			model.set(KEY_WAITFOR, KEY_WAITFOR_DEFAULT);
-		} else {
-			model.set(KEY_WAITFOR, ioName);
-		}
-	}
-
-	private void resetToDefaultValue() {
-		model.set(KEY_GRIP, KEY_GRIP_DEFAULT);
-		model.set(KEY_BLOWOUT, KEY_BLOWOUT_DEFAULT);
-		model.set(KEY_WAITFOR, KEY_WAITFOR_DEFAULT);
-	}
-}

+ 0 - 95
src/main/java/urgrip/installation/HelloWorldInstallationNodeView.java

@@ -1,95 +0,0 @@
-package urgrip.installation;
-
-import com.ur.urcap.api.contribution.installation.swing.SwingInstallationNodeView;
-import com.ur.urcap.api.domain.io.IO;
-import com.ur.urcap.api.domain.userinteraction.keyboard.KeyboardTextInput;
-import urgrip.programnodes.Style;
-
-import javax.swing.*;
-import javax.swing.text.SimpleAttributeSet;
-import javax.swing.text.StyleConstants;
-import java.awt.Component;
-import java.awt.Dimension;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.util.Collection;
-import java.util.Vector;
-
-import static urgrip.installation.HelloWorldInstallationNodeContribution.*;
-
-public class HelloWorldInstallationNodeView implements SwingInstallationNodeView<HelloWorldInstallationNodeContribution> {
-
-	private final Style style;
-	private JComboBox ddGrip;
-	private JComboBox ddBlow;
-	private JComboBox ddWaitFor;
-
-	public HelloWorldInstallationNodeView(Style style) {
-		this.style = style;
-	}
-
-	@Override
-	public void buildUI(JPanel jPanel, final HelloWorldInstallationNodeContribution installationNode) {
-		jPanel.setLayout(new BoxLayout(jPanel, BoxLayout.Y_AXIS));
-		jPanel.add(createInfo());
-		jPanel.add(createVerticalSpacing());
-		// jPanel.add(createInput(installationNode));
-		ddGrip = createDropdown(KEY_GRIP);
-		jPanel.add(ddGrip);
-		ddBlow = createDropdown(KEY_BLOWOUT);
-		jPanel.add(ddBlow);
-		ddWaitFor = createDropdown(KEY_WAITFOR);
-		jPanel.add(ddWaitFor);
-	}
-
-	private JComboBox createDropdown(String key) {
-		Box section = Box.createHorizontalBox();
-		section.setAlignmentX(Component.LEFT_ALIGNMENT);
-		JComboBox jcb = new JComboBox();
-		jcb.setPreferredSize(style.getInputfieldSize());
-		jcb.setMaximumSize(style.getInputfieldSize());
-		jcb.setMinimumSize(style.getInputfieldSize());
-		jcb.addActionListener(new ActionListener() {
-			@Override
-			public void actionPerformed(ActionEvent actionEvent) {
-			}
-		});
-		section.add(new JLabel(key));
-		section.add(jcb);
-		return jcb;
-	}
-
-	private Box createInfo() {
-		Box infoBox = Box.createVerticalBox();
-		infoBox.setAlignmentX(Component.LEFT_ALIGNMENT);
-		JTextPane pane = new JTextPane();
-		pane.setBorder(BorderFactory.createEmptyBorder());
-		SimpleAttributeSet attributeSet = new SimpleAttributeSet();
-		StyleConstants.setLineSpacing(attributeSet, 0.5f);
-		StyleConstants.setLeftIndent(attributeSet, 0f);
-		pane.setParagraphAttributes(attributeSet, false);
-		pane.setText("The popup title below is shared between all Hello World program nodes.\nThe title cannot be empty.");
-		pane.setEditable(false);
-		pane.setMaximumSize(pane.getPreferredSize());
-		pane.setBackground(infoBox.getBackground());
-		infoBox.add(pane);
-		return infoBox;
-	}
-
-
-	private Component createHorizontalSpacing() {
-		return Box.createRigidArea(new Dimension(style.getHorizontalSpacing(), 0));
-	}
-
-	private Component createVerticalSpacing() {
-		return Box.createRigidArea(new Dimension(0, style.getVerticalSpacing()));
-	}
-
-	public void setIO(Collection<IO> ios) {
-		Vector<IO> iov=new Vector<>();
-		iov.addAll(ios);
-		ddGrip.setModel(new DefaultComboBoxModel(iov));
-		ddBlow.setModel(new DefaultComboBoxModel(iov));
-		ddWaitFor.setModel(new DefaultComboBoxModel(iov));
-	}
-}

+ 158 - 0
src/main/java/urgrip/installation/URGripInstallationNodeContribution.java

@@ -0,0 +1,158 @@
+package urgrip.installation;
+
+import com.ur.urcap.api.contribution.InstallationNodeContribution;
+import com.ur.urcap.api.contribution.installation.InstallationAPIProvider;
+import com.ur.urcap.api.domain.data.DataModel;
+import com.ur.urcap.api.domain.io.IO;
+import com.ur.urcap.api.domain.script.ScriptWriter;
+
+import java.util.Collection;
+
+public class URGripInstallationNodeContribution implements InstallationNodeContribution {
+
+	private final URGripInstallationNodeView view;
+	private final InstallationAPIProvider apiProvider;
+	public final static String KEY_GRIP_OPEN = "KEY_GRIP_OPEN";
+	public final static String KEY_GRIP_OPEN_DEFAULT="digital_out[0]";
+
+	public final static String KEY_GRIP_CLOSE = "KEY_GRIP_CLOSE";
+	public final static String KEY_GRIP_CLOSE_DEFAULT="digital_out[0]";
+
+	public final static String KEY_BLOWOUT="KEY_BLOWOUT";
+	public final static String KEY_BLOWOUT_DEFAULT="digital_out[1]";
+
+	public final static String KEY_COUPLE_OPEN = "KEY_COUPLE_OPEN";
+	public final static String KEY_COUPLE_OPEN_DEFAULT="digital_out[0]";
+
+	public final static String KEY_COUPLE_CLOSE = "KEY_COUPLE_CLOSE";
+	public final static String KEY_COUPLE_CLOSE_DEFAULT="digital_out[0]";
+
+
+	public final static String KEY_WAITFOR="KEY_WAITFOR";
+	public final static String KEY_WAITFOR_DEFAULT="digital_in[0]";
+
+	private DataModel model;
+
+	public URGripInstallationNodeContribution(InstallationAPIProvider apiProvider, DataModel model, URGripInstallationNodeView view) {
+		this.model = model;
+		this.view = view;
+		this.apiProvider=apiProvider;
+	}
+
+	@Override
+	public void openView() {
+		Collection<IO> ios = apiProvider.getInstallationAPI().getIOModel().getIOs();
+		view.setIO(ios, model);
+	}
+
+	@Override
+	public void closeView() {
+	}
+
+	public boolean isDefined() {
+		if(getGripOpenIO().isEmpty())
+			return false;
+		if(getGripCloseIO().isEmpty())
+			return false;
+		if(getCoupleOpenIO().isEmpty())
+			return false;
+		if(getCoupleCloseIO().isEmpty())
+			return false;
+		if(getBlowoutIO().isEmpty())
+			return false;
+		if(getWaitforIO().isEmpty())
+			return false;
+		return true;
+	}
+
+	@Override
+	public void generateScript(ScriptWriter writer) {
+		// Store the popup title in a global variable so it is globally available to all Hello World program nodes.
+		// writer.assign("hello_world_swing_popup_title", "\"" + getPopupTitle() + "\"");
+	}
+
+	public void setValue(String key, String value) {
+		model.set(key, value);
+	}
+
+	public String getGripCloseIO() {
+		return model.get(KEY_GRIP_CLOSE, KEY_GRIP_CLOSE_DEFAULT);
+	}
+	public String getGripOpenIO() {
+		return model.get(KEY_GRIP_OPEN, KEY_GRIP_OPEN_DEFAULT);
+	}
+
+	public String getCoupleCloseIO() {
+		return model.get(KEY_COUPLE_CLOSE, KEY_COUPLE_CLOSE_DEFAULT);
+	}
+	public String getCoupleOpenIO() {
+		return model.get(KEY_COUPLE_OPEN, KEY_COUPLE_OPEN_DEFAULT);
+	}
+
+	public String getBlowoutIO() {
+		return model.get(KEY_BLOWOUT, KEY_BLOWOUT_DEFAULT);
+	}
+
+	public String getWaitforIO() {
+		return model.get(KEY_WAITFOR, KEY_WAITFOR_DEFAULT);
+	}
+
+	public void setKeyGripOpenIO(String ioName) {
+		if ("".equals(ioName)) {
+			model.set(KEY_GRIP_OPEN, KEY_GRIP_OPEN_DEFAULT);
+		} else {
+			model.set(KEY_GRIP_OPEN, ioName);
+		}
+	}
+
+	public void setKeyGripCloseIO(String ioName) {
+		if ("".equals(ioName)) {
+			model.set(KEY_GRIP_CLOSE, KEY_GRIP_CLOSE_DEFAULT);
+		} else {
+			model.set(KEY_GRIP_CLOSE, ioName);
+		}
+	}
+
+	public void setKeyCoupleOpenIO(String ioName) {
+		if ("".equals(ioName)) {
+			model.set(KEY_COUPLE_OPEN, KEY_COUPLE_OPEN_DEFAULT);
+		} else {
+			model.set(KEY_COUPLE_OPEN, ioName);
+		}
+	}
+
+	public void setKeyCoupleCloseIO(String ioName) {
+		if ("".equals(ioName)) {
+			model.set(KEY_COUPLE_CLOSE, KEY_COUPLE_CLOSE_DEFAULT);
+		} else {
+			model.set(KEY_COUPLE_CLOSE, ioName);
+		}
+	}
+
+	public void setBlowoutIO(String ioName) {
+		if ("".equals(ioName)) {
+			model.set(KEY_BLOWOUT, KEY_BLOWOUT_DEFAULT);
+		} else {
+			model.set(KEY_BLOWOUT, ioName);
+		}
+	}
+
+	public void setWaitforIO(String ioName) {
+		if ("".equals(ioName)) {
+			model.set(KEY_WAITFOR, KEY_WAITFOR_DEFAULT);
+		} else {
+			model.set(KEY_WAITFOR, ioName);
+		}
+	}
+
+	private void resetToDefaultValue() {
+		model.set(KEY_GRIP_CLOSE, KEY_GRIP_CLOSE_DEFAULT);
+		model.set(KEY_GRIP_OPEN, KEY_GRIP_OPEN_DEFAULT);
+
+		model.set(KEY_COUPLE_CLOSE, KEY_COUPLE_CLOSE_DEFAULT);
+		model.set(KEY_COUPLE_OPEN, KEY_COUPLE_OPEN_DEFAULT);
+
+		model.set(KEY_BLOWOUT, KEY_BLOWOUT_DEFAULT);
+		model.set(KEY_WAITFOR, KEY_WAITFOR_DEFAULT);
+	}
+}

+ 5 - 5
src/main/java/urgrip/installation/HelloWorldInstallationNodeService.java

@@ -12,7 +12,7 @@ import urgrip.programnodes.V5Style;
 
 import java.util.Locale;
 
-public class HelloWorldInstallationNodeService implements SwingInstallationNodeService<HelloWorldInstallationNodeContribution, HelloWorldInstallationNodeView> {
+public class URGripInstallationNodeService implements SwingInstallationNodeService<URGripInstallationNodeContribution, URGripInstallationNodeView> {
 
 	@Override
 	public void configureContribution(ContributionConfiguration configuration) {
@@ -24,14 +24,14 @@ public class HelloWorldInstallationNodeService implements SwingInstallationNodeS
 	}
 
 	@Override
-	public HelloWorldInstallationNodeView createView(ViewAPIProvider apiProvider) {
+	public URGripInstallationNodeView createView(ViewAPIProvider apiProvider) {
 		SystemAPI systemAPI = apiProvider.getSystemAPI();
 		Style style =  new V5Style();
-		return new HelloWorldInstallationNodeView(style);
+		return new URGripInstallationNodeView(style);
 	}
 
 	@Override
-	public HelloWorldInstallationNodeContribution createInstallationNode(InstallationAPIProvider apiProvider, HelloWorldInstallationNodeView view, DataModel model, CreationContext context) {
-		return new HelloWorldInstallationNodeContribution(apiProvider, model, view);
+	public URGripInstallationNodeContribution createInstallationNode(InstallationAPIProvider apiProvider, URGripInstallationNodeView view, DataModel model, CreationContext context) {
+		return new URGripInstallationNodeContribution(apiProvider, model, view);
 	}
 }

+ 133 - 0
src/main/java/urgrip/installation/URGripInstallationNodeView.java

@@ -0,0 +1,133 @@
+package urgrip.installation;
+
+import com.ur.urcap.api.contribution.installation.swing.SwingInstallationNodeView;
+import com.ur.urcap.api.domain.data.DataModel;
+import com.ur.urcap.api.domain.io.IO;
+import urgrip.programnodes.Style;
+
+import javax.swing.*;
+import javax.swing.text.SimpleAttributeSet;
+import javax.swing.text.StyleConstants;
+import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.Collection;
+import java.util.Vector;
+
+import static urgrip.installation.URGripInstallationNodeContribution.*;
+
+public class URGripInstallationNodeView implements SwingInstallationNodeView<URGripInstallationNodeContribution> {
+
+	private final Style style;
+	private Box ddGripOpen;
+	private Box ddGripClose;
+	private Box ddBlow;
+	private Box ddCoupleOpen;
+	private Box ddCoupleClose;
+	private Box ddWaitFor;
+	private URGripInstallationNodeContribution installationNode;
+
+	public URGripInstallationNodeView(Style style) {
+		this.style = style;
+	}
+
+	@Override
+	public void buildUI(JPanel jPanel, final URGripInstallationNodeContribution installationNode) {
+		this.installationNode=installationNode;
+		Box.createVerticalBox();
+		jPanel.setLayout(new BoxLayout(jPanel, BoxLayout.Y_AXIS));
+		// jPanel.add(createInfo());
+		// jPanel.add(createVerticalSpacing());
+		// jPanel.add(createInput(installationNode));
+		ddGripOpen = createDropdown(KEY_GRIP_OPEN);
+		jPanel.add(ddGripOpen);
+		ddGripClose = createDropdown(KEY_GRIP_CLOSE);
+		jPanel.add(ddGripClose);
+
+		ddCoupleOpen = createDropdown(KEY_COUPLE_OPEN);
+		jPanel.add(ddCoupleOpen);
+		ddCoupleClose = createDropdown(KEY_COUPLE_CLOSE);
+		jPanel.add(ddCoupleClose);
+
+		ddBlow = createDropdown(KEY_BLOWOUT);
+		jPanel.add(ddBlow);
+		ddWaitFor = createDropdown(KEY_WAITFOR);
+		jPanel.add(ddWaitFor);
+	}
+
+	private Box createDropdown(String key) {
+		Box section = Box.createHorizontalBox();
+
+		section.setAlignmentX(Component.LEFT_ALIGNMENT);
+		JComboBox jcb = new JComboBox();
+		jcb.setPreferredSize(style.getInputfieldSize());
+		jcb.setMaximumSize(style.getInputfieldSize());
+		jcb.setMinimumSize(style.getInputfieldSize());
+		jcb.addActionListener(new ActionListener() {
+			@Override
+			public void actionPerformed(ActionEvent actionEvent) {
+				installationNode.setValue(key, (String) jcb.getSelectedItem());
+			}
+		});
+		JLabel jl=new JLabel(key);
+		jl.setLabelFor(jcb);
+		section.add(jl);
+		section.add(createHorizontalSpacing());
+		section.add(jcb);
+		return section;
+	}
+
+	private Box createInfo() {
+		Box infoBox = Box.createVerticalBox();
+		infoBox.setAlignmentX(Component.LEFT_ALIGNMENT);
+		JTextPane pane = new JTextPane();
+		pane.setBorder(BorderFactory.createEmptyBorder());
+		SimpleAttributeSet attributeSet = new SimpleAttributeSet();
+		StyleConstants.setLineSpacing(attributeSet, 0.5f);
+		StyleConstants.setLeftIndent(attributeSet, 0f);
+		pane.setParagraphAttributes(attributeSet, false);
+		pane.setText("The popup title below is shared between all Hello World program nodes.\nThe title cannot be empty.");
+		pane.setEditable(false);
+		pane.setMaximumSize(pane.getPreferredSize());
+		pane.setBackground(infoBox.getBackground());
+		infoBox.add(pane);
+		return infoBox;
+	}
+	private JComboBox getCBFromBox(Box b) {
+		return (JComboBox) b.getComponent(2);
+	}
+
+	private Component createHorizontalSpacing() {
+		return Box.createRigidArea(new Dimension(style.getHorizontalSpacing(), 0));
+	}
+
+	private Component createVerticalSpacing() {
+		return Box.createRigidArea(new Dimension(0, style.getVerticalSpacing()));
+	}
+
+	public void setIO(Collection<IO> ios, DataModel model) {
+		Vector<String> iov=new Vector<>();
+		for(IO io: ios)
+			iov.add(io.getName());
+
+		getCBFromBox(ddGripClose).setModel(new DefaultComboBoxModel(iov));
+		getCBFromBox(ddGripClose).setSelectedItem(model.get(KEY_GRIP_CLOSE, KEY_GRIP_CLOSE_DEFAULT));
+
+		getCBFromBox(ddGripOpen).setModel(new DefaultComboBoxModel(iov));
+		getCBFromBox(ddGripOpen).setSelectedItem(model.get(KEY_GRIP_OPEN, KEY_GRIP_OPEN_DEFAULT));
+
+
+		getCBFromBox(ddCoupleClose).setModel(new DefaultComboBoxModel(iov));
+		getCBFromBox(ddCoupleClose).setSelectedItem(model.get(KEY_COUPLE_CLOSE, KEY_COUPLE_CLOSE_DEFAULT));
+
+		getCBFromBox(ddCoupleOpen).setModel(new DefaultComboBoxModel(iov));
+		getCBFromBox(ddCoupleOpen).setSelectedItem(model.get(KEY_COUPLE_OPEN, KEY_COUPLE_OPEN_DEFAULT));
+
+		getCBFromBox(ddBlow).setModel(new DefaultComboBoxModel(iov));
+		getCBFromBox(ddBlow).setSelectedItem(model.get(KEY_BLOWOUT, KEY_BLOWOUT_DEFAULT));
+
+		getCBFromBox(ddWaitFor).setModel(new DefaultComboBoxModel(iov));
+		getCBFromBox(ddWaitFor).setSelectedItem(model.get(KEY_WAITFOR, KEY_WAITFOR_DEFAULT));
+	}
+}

+ 2 - 2
src/main/java/urgrip/toolbar/MyButton.java

@@ -21,9 +21,9 @@ public class MyButton implements ChangeListener, ActionListener {
     @Override
     public void stateChanged(ChangeEvent e) {
 
-        ButtonModel model = (ButtonModel) e.getSource();
+        JButton button = (JButton) e.getSource();
         if(e.getSource()==button) {
-            if(model.isPressed())
+            if(button.getModel().isPressed())
                 cb.down();
             else cb.up();
 

+ 29 - 14
src/main/java/urgrip/toolbar/MyToolbarContribution.java

@@ -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.swing.SwingToolbarContribution;
 import com.ur.urcap.api.domain.io.DigitalIO;
+import urgrip.installation.URGripInstallationNodeContribution;
+import urgrip.installation.URGripInstallationNodeService;
 
 import javax.swing.*;
 import java.awt.*;
@@ -16,14 +18,13 @@ class MyToolbarContribution implements SwingToolbarContribution {
     private final ToolbarContext context;
     private final ToolbarAPIProvider apiProvider;
     private final IOHandler ioHandler;
+    private final URGripInstallationNodeContribution installationNode;
     private JLabel demoToolStatus;
     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 bRelease;
     private JButton bBlow;
-    private JButton couple;
-    private JButton decouple;
     private JButton bCouple;
     private JButton bDecouple;
 
@@ -32,10 +33,13 @@ class MyToolbarContribution implements SwingToolbarContribution {
         this.context = context;
         this.apiProvider = context.getAPIProvider();
         this.ioHandler = new IOHandler(this.apiProvider.getApplicationAPI().getIOModel());
+        this.installationNode = apiProvider.getApplicationAPI().getInstallationNode(URGripInstallationNodeContribution.class);
     }
 
     @Override
     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) {
@@ -76,7 +82,8 @@ class MyToolbarContribution implements SwingToolbarContribution {
         box.add(bGrip);
         new MyButton(bGrip, new HandleButton() {
             @Override public void action() {
-                out0.setValue(true);
+                ioGripOpen.setValue(true);
+                ioGripClose.setValue(false);
             }
         });
 
@@ -84,15 +91,21 @@ class MyToolbarContribution implements SwingToolbarContribution {
         box.add(bRelease);
         new MyButton(bRelease, new HandleButton() {
             @Override public void action() {
-                out0.setValue(false);
+                ioGripOpen.setValue(false);
+                ioGripClose.setValue(true);
             }
         });
 
         bBlow = new JButton("blow out");
         box.add(bBlow);
         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);
         new MyButton(bCouple, new HandleButton() {
             @Override public void action() {
-                out0.setValue(false);
+                ioCoupleClose.setValue(false);
+                ioCoupleOpen.setValue(true);
             }
         });
 
@@ -108,7 +122,8 @@ class MyToolbarContribution implements SwingToolbarContribution {
         box.add(bDecouple);
         new MyButton(bDecouple, new HandleButton() {
             @Override public void action() {
-                out0.setValue(false);
+                ioCoupleClose.setValue(true);
+                ioCoupleOpen.setValue(false);
             }
         });
         return box;