use of jmri.jmrix.cmri.CMRISystemConnectionMemo in project JMRI by JMRI.
the class ConnectionConfigXml method extendElement.
/**
* Write out the SerialNode objects too
*
* @param e Element being extended
*/
@SuppressFBWarnings(value = "SBSC_USE_STRINGBUFFER_CONCATENATION")
// though it would be good to fix it if you're working in this area
@Override
protected void extendElement(Element e) {
SerialTrafficController tc = ((CMRISystemConnectionMemo) adapter.getSystemConnectionMemo()).getTrafficController();
SerialNode node = (SerialNode) tc.getNode(0);
int index = 1;
while (node != null) {
// add node as an element
Element n = new Element("node");
n.setAttribute("name", "" + node.getNodeAddress());
e.addContent(n);
// add parameters to the node as needed
n.addContent(makeParameter("nodetype", "" + node.getNodeType()));
n.addContent(makeParameter("bitspercard", "" + node.getNumBitsPerCard()));
n.addContent(makeParameter("transmissiondelay", "" + node.getTransmissionDelay()));
n.addContent(makeParameter("num2lsearchlights", "" + node.getNum2LSearchLights()));
n.addContent(makeParameter("pulsewidth", "" + node.getPulseWidth()));
String value = "";
for (int i = 0; i < node.getLocSearchLightBits().length; i++) {
value = value + Integer.toHexString(node.getLocSearchLightBits()[i] & 0xF);
}
n.addContent(makeParameter("locsearchlightbits", "" + value));
value = "";
for (int i = 0; i < node.getCardTypeLocation().length; i++) {
value = value + Integer.toHexString(node.getCardTypeLocation()[i] & 0xF);
}
n.addContent(makeParameter("cardtypelocation", "" + value));
// look for the next node
node = (SerialNode) tc.getNode(index);
index++;
}
}
use of jmri.jmrix.cmri.CMRISystemConnectionMemo in project JMRI by JMRI.
the class ConnectionConfig method loadDetails.
@Override
public void loadDetails(JPanel details) {
setInstance();
b = new JButton("Configure C/MRI nodes");
b.addActionListener(new NodeConfigAction((CMRISystemConnectionMemo) adapter.getSystemConnectionMemo()));
if (!additionalItems.contains(b)) {
additionalItems.add(b);
}
super.loadDetails(details);
}
use of jmri.jmrix.cmri.CMRISystemConnectionMemo in project JMRI by JMRI.
the class SerialDriverAdapter method configure.
/**
* set up all of the other objects to operate connected to this port
*/
@Override
public void configure() {
// connect to the traffic controller
SerialTrafficController tc = new SerialTrafficController();
tc.connectPort(this);
((CMRISystemConnectionMemo) getSystemConnectionMemo()).setTrafficController(tc);
((CMRISystemConnectionMemo) getSystemConnectionMemo()).configureManagers();
}
Aggregations