Package com.neophob.sematrix.core.properties

Examples of com.neophob.sematrix.core.properties.ApplicationConfigurationHelper


    public void testInvalidPixelInvadersConfigTwo() {    
        Properties config = new Properties();
        config.put(ConfigConstant.PIXELINVADERS_ROW1, "ROTATE_180,NO_ROTATE");
        config.put(ConfigConstant.PIXELINVADERS_ROW2, "ROTATE_90,NO_ROTATE");
        config.put(ConfigConstant.PIXELINVADERS_PANEL_ORDER, "0");
        ApplicationConfigurationHelper ph = new ApplicationConfigurationHelper(config);

        //panel order is ignored, due invalid value
        List<Integer> order = ph.getPanelOrder();
        assertEquals(Integer.valueOf(0), order.get(0));
        assertEquals(Integer.valueOf(1), order.get(1));
        assertEquals(Integer.valueOf(2), order.get(2));
        assertEquals(Integer.valueOf(3), order.get(3));
    }
View Full Code Here


    @Test
    public void testRainbowduinosConfig() {    
        Properties config = new Properties();
        config.put(ConfigConstant.RAINBOWDUINO_V2_ROW1, "5, 6");
        config.put(ConfigConstant.RAINBOWDUINO_V2_ROW2, "0x7,8");
        ApplicationConfigurationHelper ph = new ApplicationConfigurationHelper(config);

        assertEquals(4, ph.getNrOfScreens());
        assertEquals(8, ph.getDeviceXResolution());
        assertEquals(8, ph.getDeviceYResolution());

        assertEquals(4, ph.getI2cAddr().size());
        assertEquals(0, ph.getLpdDevice().size());
        assertEquals(OutputDeviceEnum.RAINBOWDUINO_V2, ph.getOutputDevice());
    }
View Full Code Here

    @Test
    public void testRainbowduinosV3Config() {    
        Properties config = new Properties();
        config.put(ConfigConstant.RAINBOWDUINO_V3_ROW1, "/dev/aaa,/dev/bbb");
        config.put(ConfigConstant.RAINBOWDUINO_V3_ROW2, "/dev/ccc, /dev/ddd");
        ApplicationConfigurationHelper ph = new ApplicationConfigurationHelper(config);

        assertEquals(4, ph.getNrOfScreens());
        assertEquals(8, ph.getDeviceXResolution());
        assertEquals(8, ph.getDeviceYResolution());
       
        assertEquals(4, ph.getRainbowduinoV3SerialDevices().size());
        assertEquals(0, ph.getLpdDevice().size());
        assertEquals(OutputDeviceEnum.RAINBOWDUINO_V3, ph.getOutputDevice());
       
        assertTrue(ph.getRainbowduinoV3SerialDevices().contains("/dev/aaa"));
        assertTrue(ph.getRainbowduinoV3SerialDevices().contains("/dev/ddd"));
    }
View Full Code Here

    public void testArtnetConfigSimple() {    
        Properties config = new Properties();
        config.put(ConfigConstant.ARTNET_IP, "192.168.1.1");
        config.put(ConfigConstant.ARTNET_ROW1, "NO_ROTATE");
        config.put(ConfigConstant.ARTNET_BROADCAST_ADDR, "255.0.0.0");
        ApplicationConfigurationHelper ph = new ApplicationConfigurationHelper(config);

        assertEquals(1, ph.getNrOfScreens());
        assertEquals(8, ph.getDeviceXResolution());
        assertEquals(8, ph.getDeviceYResolution());
        assertEquals(false, ph.isOutputSnakeCabeling());

        assertEquals(0, ph.getI2cAddr().size());
        assertEquals(0, ph.getLpdDevice().size());
        assertEquals(OutputDeviceEnum.ARTNET, ph.getOutputDevice());
       
        ArtnetDevice device = new ArtnetDevice(ph, 1);
        assertTrue(device.isConnected());      
        assertEquals(170, device.getPixelsPerUniverse());
        assertEquals(1, device.getNrOfUniverse());
View Full Code Here

        config.put(ConfigConstant.ARTNET_ROW1, "NO_ROTATE");
        config.put(ConfigConstant.ARTNET_ROW2, "NO_ROTATE");
        config.put(ConfigConstant.OUTPUT_DEVICE_RESOLUTION_X, "10");
        config.put(ConfigConstant.OUTPUT_DEVICE_RESOLUTION_Y, "8");
        config.put(ConfigConstant.OUTPUT_DEVICE_SNAKE_CABELING, "true");
        ApplicationConfigurationHelper ph = new ApplicationConfigurationHelper(config);

        assertEquals(OutputDeviceEnum.ARTNET, ph.getOutputDevice());
        assertEquals(2, ph.getNrOfScreens());
        assertEquals(10, ph.getDeviceXResolution());
        assertEquals(8, ph.getDeviceYResolution());
        assertEquals(true, ph.isOutputSnakeCabeling());

        ArtnetDevice device = new ArtnetDevice(ph, 1);
        assertEquals(170, device.getPixelsPerUniverse());
    }   
View Full Code Here

    @Test
    public void testE131Config() {    
        Properties config = new Properties();
        config.put(ConfigConstant.E131_IP, "192.168.1.1");     
        config.put(ConfigConstant.E131_ROW1, "NO_ROTATE");
        ApplicationConfigurationHelper ph = new ApplicationConfigurationHelper(config);

        assertEquals(1, ph.getNrOfScreens());
        assertEquals(8, ph.getDeviceXResolution());
        assertEquals(8, ph.getDeviceYResolution());
        assertEquals(false, ph.isOutputSnakeCabeling());

        assertEquals(0, ph.getI2cAddr().size());
        assertEquals(0, ph.getLpdDevice().size());
        assertEquals(OutputDeviceEnum.E1_31, ph.getOutputDevice());

        E1_31Device device = new E1_31Device(ph, 1);
        assertFalse(device.isSendMulticast());
        assertEquals(170, device.getPixelsPerUniverse());
        assertEquals(1, device.getNrOfUniverse());
        assertEquals(0, device.getFirstUniverseId());
       
       
       
        config = new Properties();
        config.put(ConfigConstant.E131_IP, "239.255.1.1");
        config.put(ConfigConstant.E131_ROW1, "NO_ROTATE");
        config.put(ConfigConstant.E131_FIRST_UNIVERSE_ID, "1");
        config.put(ConfigConstant.E131_PIXELS_PER_UNIVERSE, "333");
        config.put(ConfigConstant.OUTPUT_DEVICE_RESOLUTION_X, "10");
        config.put(ConfigConstant.OUTPUT_DEVICE_SNAKE_CABELING, "true");
        ph = new ApplicationConfigurationHelper(config);

        assertEquals(OutputDeviceEnum.E1_31, ph.getOutputDevice());
        assertEquals(1, ph.getNrOfScreens());
        assertEquals(10, ph.getDeviceXResolution());
        assertEquals(8, ph.getDeviceYResolution());
        assertEquals(true, ph.isOutputSnakeCabeling());

        assertEquals(0, ph.getI2cAddr().size());
        assertEquals(0, ph.getLpdDevice().size());
        assertEquals(OutputDeviceEnum.E1_31, ph.getOutputDevice());
   
        device = new E1_31Device(ph, 1);
        assertTrue(device.isSendMulticast());   
        assertEquals(1, device.getFirstUniverseId());
        assertEquals(170, device.getPixelsPerUniverse());
View Full Code Here

        config.put(ConfigConstant.E131_ROW1, "NO_ROTATE,NO_ROTATE");
        config.put(ConfigConstant.E131_ROW2, "NO_ROTATE,NO_ROTATE");
        config.put(ConfigConstant.OUTPUT_DEVICE_RESOLUTION_X, "10");
        config.put(ConfigConstant.OUTPUT_DEVICE_RESOLUTION_Y, "8");
        config.put(ConfigConstant.OUTPUT_DEVICE_SNAKE_CABELING, "true");
        ApplicationConfigurationHelper ph = new ApplicationConfigurationHelper(config);

        assertEquals(4, ph.getNrOfScreens());
        assertEquals(10, ph.getDeviceXResolution());
        assertEquals(8, ph.getDeviceYResolution());
        assertEquals(true, ph.isOutputSnakeCabeling());
        assertEquals(4, ph.getPanelOrder().size());
    }
View Full Code Here

        Properties config = new Properties();
        config.put(ConfigConstant.OUTPUT_DEVICE_RESOLUTION_X, "10");
        config.put(ConfigConstant.OUTPUT_DEVICE_RESOLUTION_Y, "13");
        config.put(ConfigConstant.OUTPUT_DEVICE_SNAKE_CABELING, "true");
        config.put(ConfigConstant.MINIDMX_BAUDRATE, "115200");
        ApplicationConfigurationHelper ph = new ApplicationConfigurationHelper(config);

        assertEquals(1, ph.getNrOfScreens());
        assertEquals(10, ph.getDeviceXResolution());
        assertEquals(13, ph.getDeviceYResolution());
        assertEquals(true, ph.isOutputSnakeCabeling());
       
        assertEquals(0, ph.getI2cAddr().size());
        assertEquals(0, ph.getLpdDevice().size());
        assertEquals(OutputDeviceEnum.MINIDMX, ph.getOutputDevice());       
   
View Full Code Here

    @Test
    public void testNullConfig() {    
        Properties config = new Properties();
        config.put(ConfigConstant.NULLOUTPUT_ROW1, "4");
        config.put(ConfigConstant.NULLOUTPUT_ROW2, "4");
        ApplicationConfigurationHelper ph = new ApplicationConfigurationHelper(config);

        assertEquals(8, ph.getNrOfScreens());
        assertEquals(8, ph.getDeviceXResolution());
        assertEquals(8, ph.getDeviceYResolution());

        assertEquals(0, ph.getI2cAddr().size());
        assertEquals(0, ph.getLpdDevice().size());
        assertEquals(OutputDeviceEnum.NULL, ph.getOutputDevice());
       
        NullDevice device = new NullDevice(ph);
        assertTrue(device.isConnected());      
    }    
View Full Code Here

    public void testMultipleConfig() {    
        Properties config = new Properties();
        config.put(ConfigConstant.RAINBOWDUINO_V2_ROW1, "4");
        config.put(ConfigConstant.ARTNET_IP, "192.168.4.2");
        config.put(ConfigConstant.ARTNET_ROW1, "NO_ROTATE");
        new ApplicationConfigurationHelper(config);
    }
View Full Code Here

TOP

Related Classes of com.neophob.sematrix.core.properties.ApplicationConfigurationHelper

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.