Package de.mnl.srcpd4cu.util

Examples of de.mnl.srcpd4cu.util.DefaultDeviceGroup


        if (buses != null) {
            return buses;
        }
        buses = new Bus[1];
        buses[0] = new DefaultBus(firstBusNumber);
        DefaultDeviceGroup dg = DefaultDeviceGroup
            .newDescriptionDeviceGroup(buses[0]);
        new DescriptionDevice(dg);
        dg = DefaultDeviceGroup.newPowerGroup(buses[0]);
        new PowerDevice(dg);
        dg = DefaultDeviceGroup.newGenericLocoGroup
            (buses[0], GenericLocoDevice.class);
        dg.setImplicitCreationAllowed(true);
        dg = DefaultDeviceGroup.newGenericAccessoryGroup
            (buses[0], GenericAccessoryDevice.class);
        dg.setImplicitCreationAllowed(true);
        return buses;
    }
View Full Code Here


        }
        buses = new Bus[1];
        buses[0] = new EcBus(this, firstBusNumber);

        // Generic locos
        DefaultDeviceGroup dg = DefaultDeviceGroup
            .newDescriptionDeviceGroup(buses[0]);
        new DescriptionDevice(dg);
        dg = DefaultDeviceGroup.newPowerGroup(buses[0]);
        new EcPowerDevice(dg);
        dg = DefaultDeviceGroup.newGenericLocoGroup
            (buses[0], EcGenericLocoDevice.class);
        for (LocData loco : locData) {
            EcGenericLocoDevice locoDevice
                = new EcGenericLocoDevice(loco.getAddress());
            String proto = "P";
            int version = 0;
            if (loco.getFormat().equals("MM1")) {
                proto = "M";
                version = 1;
            } else if (loco.getFormat().equals("MM2")) {
                proto = "M";
                version = 2;
            } else if (loco.getFormat().equals("DCC")) {
                proto = "N";
                version = 1;
            }
            try {
                locoDevice.init(dg, proto, version, loco.getSpeedSteps(), 5);
            } catch (CommandExecutionException e) {
                log.fine("Unexpected problem while initilizing loco: "
                         + e.getMessage());
            }
        }
        dg.setImplicitCreationAllowed(true);

        // Generic Accessory
        dg = DefaultDeviceGroup.newGenericAccessoryGroup
            (buses[0], EcGenericAccessoryDevice.class);
        dg.setImplicitCreationAllowed(true);
        return buses;
    }
View Full Code Here

TOP

Related Classes of de.mnl.srcpd4cu.util.DefaultDeviceGroup

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.