Ejemplo n.º 1
0
        /// <summary>
        /// Thread to create all the necessary logic and devices
        /// </summary>
        /// <returns>unused object</returns>
        private object SystemSetup()
        {
            this.config = new Configuration.ConfigManager();

            // Potential check you can do to make your program more dynamic
            // Any "box" processor is an appliance.
            // VC-4 is a server
            // We're not using this for either Lab1 or Lab2
            if (CrestronEnvironment.DevicePlatform == eDevicePlatform.Appliance)
            {
            }
            else if (CrestronEnvironment.DevicePlatform == eDevicePlatform.Server)
            {
            }

            var configFile = $"{Directory.GetApplicationRootDirectory()}/User/config.json";

            ErrorLog.Notice($"{LogHeader} trying to read config file: {configFile} in dir {Directory.GetApplicationRootDirectory()}");
            if (this.config.ReadConfig(configFile))
            {
                this.manager = new SystemManager(this.config.RoomConfig, this);
            }
            else
            {
                ErrorLog.Error(string.Format(LogHeader + "Unable to read config!"));
            }

            return(null);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Thread to create all the necessary logic and devices
        /// </summary>
        /// <returns>unused object</returns>
        private object SystemSetup()
        {
            this.config = new Configuration.ConfigManager();

            // Potential check you can do to make your program more dynamic
            // Any "box" processor is an appliance.
            // VC-4 is a server
            // We're not using this for either Lab1 or Lab2
            if (CrestronEnvironment.DevicePlatform == eDevicePlatform.Appliance)
            {
            }
            else if (CrestronEnvironment.DevicePlatform == eDevicePlatform.Server)
            {
            }

            if (this.config.ReadConfig(System.IO.Path.Combine(Directory.GetApplicationRootDirectory(), "User", "config.json")))
            {
                this.manager = new SystemManager(this.config.RoomConfig, this);
            }
            else
            {
                ErrorLog.Error(LogHeader + "Unable to read config!");
            }

            return(null);
        }