Package com.epam.llpd.greenhouse

Source Code of com.epam.llpd.greenhouse.App

package com.epam.llpd.greenhouse;

import com.epam.llpd.greenhouse.debug.FakeHardwareController;
import com.epam.llpd.greenhouse.web.ConfigurationHandler;

/**
* Application decides whether app is launched on Raspberry or with Emulation Mode
*/
public class App {

    public static Greenhouse createGrowBox(boolean isRunningOnRaspberry) {
        if (isRunningOnRaspberry) {
            return new Greenhouse(ConfigurationHandler.readConfigFromFile(), new PiHardwareController());
        }
        return new Greenhouse(ConfigurationHandler.readConfigFromFile(), new FakeHardwareController());
    }

    public static boolean isRaspberry() {
        return !System.getProperty("os.name").toLowerCase().startsWith("mac");
    }
}
TOP

Related Classes of com.epam.llpd.greenhouse.App

TOP
Copyright © 2018 www.massapi.com. 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.