001/* DCCppProgrammerManager.java */ 002package jmri.jmrix.dccpp; 003 004import jmri.AddressedProgrammer; 005import jmri.Programmer; 006import jmri.managers.DefaultProgrammerManager; 007 008/** 009 * Extend DefaultProgrammerManager to provide ops mode programmers on DCC++ 010 * 011 * @see jmri.managers.DefaultProgrammerManager 012 * @author Paul Bender Copyright (C) 2003 013 * @author Mark Underwood Copyright (C) 2015 014 * 015 * Based on XNetProgrammerManager by Paul Bender 016 */ 017public class DCCppProgrammerManager extends DefaultProgrammerManager { 018 019 protected DCCppTrafficController tc = null; 020 021 public DCCppProgrammerManager(Programmer pProgrammer, DCCppSystemConnectionMemo memo) { 022 super(pProgrammer, memo); 023 tc = memo.getDCCppTrafficController(); 024 } 025 026 @Override 027 public boolean isAddressedModePossible() { 028 return tc.getCommandStation().isOpsModePossible(); 029 } 030 031 @Override 032 public AddressedProgrammer getAddressedProgrammer(boolean pLongAddress, int pAddress) { 033 return new DCCppOpsModeProgrammer(pAddress, tc); 034 } 035 036 @Override 037 public AddressedProgrammer reserveAddressedProgrammer(boolean pLongAddress, int pAddress) { 038 return null; 039 } 040} 041 042