001/* MrcProgrammerManager.java */
002package jmri.jmrix.mrc;
003
004import jmri.AddressedProgrammer;
005import jmri.Programmer;
006import jmri.managers.DefaultProgrammerManager;
007
008/**
009 * Extend DefaultProgrammerManager to provide ops mode programmers for MRC
010 * systems
011 *
012 * @author Bob Jacobsen Copyright (C) 2002
013 * @author Ken Cameron Copyright (C) 2014
014 * @author Kevin Dickerson Copyright (C) 2014
015 * 
016 */
017public class MrcProgrammerManager extends DefaultProgrammerManager {
018
019    MrcSystemConnectionMemo memo;
020
021    public MrcProgrammerManager(Programmer serviceModeProgrammer, MrcSystemConnectionMemo memo) {
022        super(serviceModeProgrammer, memo);
023        this.memo = memo;
024    }
025
026    /**
027     * Works with command station to provide Ops Mode, so say it works
028     *
029     * @return true
030     */
031    @Override
032    public boolean isAddressedModePossible() {
033        return true;
034    }
035
036    /**
037     * @return true
038     */
039    @Override
040    public boolean isGlobalProgrammerAvailable() {
041        return true;
042    }
043
044    @Override
045    public AddressedProgrammer getAddressedProgrammer(boolean pLongAddress, int pAddress) {
046        return new MrcOpsModeProgrammer(memo, pAddress, pLongAddress);
047    }
048
049    @Override
050    public AddressedProgrammer reserveAddressedProgrammer(boolean pLongAddress, int pAddress) {
051        return null;
052    }
053}
054
055
056