Exemple #1
0
        /// <summary>
        /// SIMPL+ can only execute the default constructor. If you have variables that require initialization, please
        /// use an Initialize method
        /// </summary>
        ///

        //Completed
        #region Instantiation
        public Roku(string Host, int Port, string Description, string ProcessorIPAddress)
        {
            try
            {
                // IP Address, Port Number -- Username && Password??
                appList       = new List <sAppInfo>(); //Instantiate App List
                rokuEventArgs = new RokuEventArgs();

                if (Port == 0)
                {
                    Port = 8060;
                }

                baseRequest                = string.Format(@"http://{0}:{1}/", Host, Port);
                description                = Description;
                rokuEventArgs.rokuName     = description;
                rokuHttpClient             = new HttpClient();
                rokuHttpClient.HostAddress = Host;
                rokuHttpClient.Port        = Port;
                processorIPAddress         = ProcessorIPAddress;
                //TODO: Define the necessary information for this Roku device
                numRokus++;
                ClearAppList();
            }
            catch (Exception e)
            {
                ErrorLog.Error("Error Instantiating Roku, Reason: {0}", e.Message);
            }
        }
Exemple #2
0
        void testRokue_onResponseProcessed(object sender, RokuEventArgs e)
        {
            int offset;

            switch (e.requestMade)
            {
            case eRokuRequest.GetAppList:
                testPanel.SmartObjects[2].UShortInput["Set Number of Items"].UShortValue = (ushort)e.applicationList.Count;
                ErrorLog.Notice("Number of Apps is: {0}", e.applicationList.Count);
                foreach (var app in e.applicationList)
                {
                    int appIndex = e.applicationList.IndexOf(app);
                    offset = (appIndex * 2) + 1;
                    CrestronConsole.PrintLine(string.Format("App Name: {0} Image URL: {1} -- {2}", app.appName, app.appIcon, app.appId));
                    testPanel.SmartObjects[2].StringInput[string.Format("text-o{0}", offset)].StringValue     = app.appName;
                    testPanel.SmartObjects[2].BooleanOutput[string.Format("press{0}", offset)].Name           = string.Format("App: {0}-{1}", app.appName, app.appId);
                    testPanel.SmartObjects[2].StringInput[string.Format("text-o{0}", offset + 1)].StringValue = app.appIcon;
                }
                break;

            default:
                break;
            }
        }