001package jmri.jmrix.ecos; 002 003import jmri.AddressedProgrammer; 004import jmri.Programmer; 005import jmri.managers.DefaultProgrammerManager; 006 007/** 008 * Extend DefaultProgrammerManager to provide programmers on ECos 009 * Programming track is supported from ECoS firmware version 4.1. 010 * Ops mode or POM is supported from ECoS firmware version 4.2.3 011 * 012 * @see jmri.managers.DefaultProgrammerManager 013 * @author Karl Johan Lisby Copyright (C) 2015 and 2018 014 */ 015public class EcosProgrammerManager extends DefaultProgrammerManager { 016 017 //private Programmer mProgrammer; 018 public EcosProgrammerManager(Programmer serviceModeProgrammer, EcosSystemConnectionMemo memo) { 019 super(serviceModeProgrammer, memo); 020 this.tc = memo.getTrafficController(); 021 } 022 EcosTrafficController tc; 023 024 /** 025 * ECoS command station provides Ops Mode on the LAN interface. 026 * 027 * @return true 028 */ 029 @Override 030 public boolean isAddressedModePossible() { 031 return true; 032 } 033 034 // @Override 035 // public java.util.List<ProgrammingMode> getDefaultModes() { 036 // java.util.ArrayList<ProgrammingMode> retval = new java.util.ArrayList<>(); 037 // retval.add(ProgrammingMode.DIRECTBYTEMODE); 038 // return retval; 039 // } 040 041 @Override 042 public AddressedProgrammer getAddressedProgrammer(boolean pLongAddress, int pAddress) { 043 return new EcosOpsModeProgrammer(tc, pAddress, pLongAddress); 044 } 045 046 @Override 047 public AddressedProgrammer reserveAddressedProgrammer(boolean pLongAddress, int pAddress) { 048 return null; 049 } 050 051}