|
@@ -2,6 +2,7 @@ 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.DigitalIO;
|
|
|
import com.ur.urcap.api.domain.io.IO;
|
|
|
import com.ur.urcap.api.domain.io.IOModel;
|
|
|
import urgrip.programnodes.Style;
|
|
@@ -110,28 +111,34 @@ public class URGripInstallationNodeView implements SwingInstallationNodeView<URG
|
|
|
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.getDefaultName());
|
|
|
+ public void setIO(Collection<DigitalIO> ios, DataModel model) {
|
|
|
+ Vector<String> ioDOUT=new Vector<>();
|
|
|
+ Vector<String> ioDIN=new Vector<>();
|
|
|
|
|
|
- getCBFromBox(ddGripClose).setModel(new DefaultComboBoxModel(iov));
|
|
|
+ for(DigitalIO io: ios) {
|
|
|
+ if(io.isInput())
|
|
|
+ ioDIN.add(io.getDefaultName());
|
|
|
+ else
|
|
|
+ ioDOUT.add(io.getDefaultName());
|
|
|
+ }
|
|
|
+
|
|
|
+ getCBFromBox(ddGripClose).setModel(new DefaultComboBoxModel(ioDOUT));
|
|
|
getCBFromBox(ddGripClose).setSelectedItem(model.get(KEY_GRIP_CLOSE, KEY_GRIP_CLOSE_DEFAULT));
|
|
|
|
|
|
- getCBFromBox(ddGripOpen).setModel(new DefaultComboBoxModel(iov));
|
|
|
+ getCBFromBox(ddGripOpen).setModel(new DefaultComboBoxModel(ioDOUT));
|
|
|
getCBFromBox(ddGripOpen).setSelectedItem(model.get(KEY_GRIP_OPEN, KEY_GRIP_OPEN_DEFAULT));
|
|
|
|
|
|
|
|
|
- getCBFromBox(ddCoupleClose).setModel(new DefaultComboBoxModel(iov));
|
|
|
+ getCBFromBox(ddCoupleClose).setModel(new DefaultComboBoxModel(ioDOUT));
|
|
|
getCBFromBox(ddCoupleClose).setSelectedItem(model.get(KEY_COUPLE_CLOSE, KEY_COUPLE_CLOSE_DEFAULT));
|
|
|
|
|
|
- getCBFromBox(ddCoupleOpen).setModel(new DefaultComboBoxModel(iov));
|
|
|
+ getCBFromBox(ddCoupleOpen).setModel(new DefaultComboBoxModel(ioDOUT));
|
|
|
getCBFromBox(ddCoupleOpen).setSelectedItem(model.get(KEY_COUPLE_OPEN, KEY_COUPLE_OPEN_DEFAULT));
|
|
|
|
|
|
- getCBFromBox(ddBlow).setModel(new DefaultComboBoxModel(iov));
|
|
|
+ getCBFromBox(ddBlow).setModel(new DefaultComboBoxModel(ioDOUT));
|
|
|
getCBFromBox(ddBlow).setSelectedItem(model.get(KEY_BLOWOUT, KEY_BLOWOUT_DEFAULT));
|
|
|
|
|
|
- getCBFromBox(ddWaitFor).setModel(new DefaultComboBoxModel(iov));
|
|
|
+ getCBFromBox(ddWaitFor).setModel(new DefaultComboBoxModel(ioDIN));
|
|
|
getCBFromBox(ddWaitFor).setSelectedItem(model.get(KEY_WAITFOR, KEY_WAITFOR_DEFAULT));
|
|
|
}
|
|
|
}
|