001package jmri.jmrix.lenz; 002 003import jmri.AddressedProgrammer; 004import jmri.Programmer; 005import jmri.managers.DefaultProgrammerManager; 006 007/** 008 * Extend DefaultProgrammerManager to provide ops mode programmers on XPressNet 009 * @see jmri.managers.DefaultProgrammerManager 010 * @author Paul Bender Copyright (C) 2003 011 * @navassoc 1 - 1 jmri.jmrix.lenz.XNetProgrammer 012 * @navassoc 1 - * jmri.jmrix.lenz.XNetOpsModeProgrammer 013 */ 014public class XNetProgrammerManager extends DefaultProgrammerManager { 015 016 protected XNetTrafficController tc; 017 018 public XNetProgrammerManager(Programmer pProgrammer, XNetSystemConnectionMemo memo) { 019 super(pProgrammer, memo); 020 tc = memo.getXNetTrafficController(); 021 } 022 023 /** 024 * XpressNet command station does provide Ops Mode. 025 * @return whether or not the command station supports Ops Mode. 026 */ 027 @Override 028 public boolean isAddressedModePossible() { 029 return tc.getCommandStation().isOpsModePossible(); 030 } 031 032 @Override 033 public AddressedProgrammer getAddressedProgrammer(boolean pLongAddress, int pAddress) { 034 return new XNetOpsModeProgrammer(pAddress, tc); 035 } 036 037 @Override 038 public AddressedProgrammer reserveAddressedProgrammer(boolean pLongAddress, int pAddress) { 039 return null; 040 } 041 042}