Skip to content

Commit

Permalink
use pre-existing TC instead of re-creating
Browse files Browse the repository at this point in the history
  • Loading branch information
bobjacobsen committed May 25, 2019
1 parent 555610d commit 3131a9d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
Expand Up @@ -28,13 +28,13 @@ public NetworkDriverAdapter() {
*/
@Override
public void configure() {
// connect to the traffic controller
// connect to the traffic controller, which is provided via the memo
log.debug("set tc for memo {}", getSystemConnectionMemo().getUserName());
EasyDccTrafficController control = new EasyDccTrafficController(getSystemConnectionMemo());
control.connectPort(this);
this.getSystemConnectionMemo().setEasyDccTrafficController(control);

getSystemConnectionMemo().getTrafficController().connectPort(this);

// do the common manager config
this.getSystemConnectionMemo().configureManagers();
getSystemConnectionMemo().configureManagers();
}

@Override
Expand Down
9 changes: 4 additions & 5 deletions java/src/jmri/jmrix/easydcc/simulator/SimulatorAdapter.java
Expand Up @@ -102,12 +102,11 @@ public boolean okToSend() {
*/
@Override
public void configure() {
// connect to the traffic controller
// connect to the traffic controller, which is provided via the memo
log.debug("set tc for memo {}", getSystemConnectionMemo().getUserName());
EasyDccTrafficController control = new EasyDccSimulatorTrafficController(getSystemConnectionMemo());
//compare with: XNetTrafficController packets = new XNetPacketizer(new LenzCommandStation());
control.connectPort(this);
this.getSystemConnectionMemo().setEasyDccTrafficController(control);

getSystemConnectionMemo().getTrafficController().connectPort(this);

// do the common manager config
this.getSystemConnectionMemo().configureManagers();

Expand Down

0 comments on commit 3131a9d

Please sign in to comment.