Example #1
0
        public override void LogosSplusInitialize()
        {
            _SplusNVRAM = new SplusNVRAM(this);
            PRESETRAMP  = new RAMP_INFO();
            PRESETRAMP.PopulateDefaults();

            ZONEON = new Crestron.Logos.SplusObjects.DigitalInput(ZONEON__DigitalInput__, this);
            m_DigitalInputList.Add(ZONEON__DigitalInput__, ZONEON);

            ZONEOFF = new Crestron.Logos.SplusObjects.DigitalInput(ZONEOFF__DigitalInput__, this);
            m_DigitalInputList.Add(ZONEOFF__DigitalInput__, ZONEOFF);

            ZONEONOFF = new Crestron.Logos.SplusObjects.DigitalInput(ZONEONOFF__DigitalInput__, this);
            m_DigitalInputList.Add(ZONEONOFF__DigitalInput__, ZONEONOFF);

            SAVEONLVL = new Crestron.Logos.SplusObjects.DigitalInput(SAVEONLVL__DigitalInput__, this);
            m_DigitalInputList.Add(SAVEONLVL__DigitalInput__, SAVEONLVL);

            SAVEOFFLVL = new Crestron.Logos.SplusObjects.DigitalInput(SAVEOFFLVL__DigitalInput__, this);
            m_DigitalInputList.Add(SAVEOFFLVL__DigitalInput__, SAVEOFFLVL);

            ZONEONFB = new Crestron.Logos.SplusObjects.DigitalInput(ZONEONFB__DigitalInput__, this);
            m_DigitalInputList.Add(ZONEONFB__DigitalInput__, ZONEONFB);

            DALIFB = new Crestron.Logos.SplusObjects.DigitalOutput(DALIFB__DigitalOutput__, this);
            m_DigitalOutputList.Add(DALIFB__DigitalOutput__, DALIFB);

            DIMMABLEFB = new Crestron.Logos.SplusObjects.DigitalOutput(DIMMABLEFB__DigitalOutput__, this);
            m_DigitalOutputList.Add(DIMMABLEFB__DigitalOutput__, DIMMABLEFB);

            INUSEFB = new Crestron.Logos.SplusObjects.DigitalOutput(INUSEFB__DigitalOutput__, this);
            m_DigitalOutputList.Add(INUSEFB__DigitalOutput__, INUSEFB);

            RGBFB = new Crestron.Logos.SplusObjects.DigitalOutput(RGBFB__DigitalOutput__, this);
            m_DigitalOutputList.Add(RGBFB__DigitalOutput__, RGBFB);

            HARVESTEDFB = new Crestron.Logos.SplusObjects.DigitalOutput(HARVESTEDFB__DigitalOutput__, this);
            m_DigitalOutputList.Add(HARVESTEDFB__DigitalOutput__, HARVESTEDFB);

            HARVESTENABLEFB = new Crestron.Logos.SplusObjects.DigitalOutput(HARVESTENABLEFB__DigitalOutput__, this);
            m_DigitalOutputList.Add(HARVESTENABLEFB__DigitalOutput__, HARVESTENABLEFB);

            ONLVLSAVED = new Crestron.Logos.SplusObjects.DigitalOutput(ONLVLSAVED__DigitalOutput__, this);
            m_DigitalOutputList.Add(ONLVLSAVED__DigitalOutput__, ONLVLSAVED);

            OFFLVLSAVED = new Crestron.Logos.SplusObjects.DigitalOutput(OFFLVLSAVED__DigitalOutput__, this);
            m_DigitalOutputList.Add(OFFLVLSAVED__DigitalOutput__, OFFLVLSAVED);

            RAISEFROMOFF = new Crestron.Logos.SplusObjects.DigitalOutput(RAISEFROMOFF__DigitalOutput__, this);
            m_DigitalOutputList.Add(RAISEFROMOFF__DigitalOutput__, RAISEFROMOFF);

            FRIENDLYNAMESAVED = new Crestron.Logos.SplusObjects.DigitalOutput(FRIENDLYNAMESAVED__DigitalOutput__, this);
            m_DigitalOutputList.Add(FRIENDLYNAMESAVED__DigitalOutput__, FRIENDLYNAMESAVED);

            INITIALIZED = new Crestron.Logos.SplusObjects.DigitalOutput(INITIALIZED__DigitalOutput__, this);
            m_DigitalOutputList.Add(INITIALIZED__DigitalOutput__, INITIALIZED);

            TRUEFB = new Crestron.Logos.SplusObjects.AnalogInput(TRUEFB__AnalogSerialInput__, this);
            m_AnalogInputList.Add(TRUEFB__AnalogSerialInput__, TRUEFB);

            ZONELEVEL = new Crestron.Logos.SplusObjects.AnalogOutput(ZONELEVEL__AnalogSerialOutput__, this);
            m_AnalogOutputList.Add(ZONELEVEL__AnalogSerialOutput__, ZONELEVEL);

            SLEWRATE = new Crestron.Logos.SplusObjects.AnalogOutput(SLEWRATE__AnalogSerialOutput__, this);
            m_AnalogOutputList.Add(SLEWRATE__AnalogSerialOutput__, SLEWRATE);

            RAMPTIME = new Crestron.Logos.SplusObjects.AnalogOutput(RAMPTIME__AnalogSerialOutput__, this);
            m_AnalogOutputList.Add(RAMPTIME__AnalogSerialOutput__, RAMPTIME);

            WATTAGE = new Crestron.Logos.SplusObjects.AnalogOutput(WATTAGE__AnalogSerialOutput__, this);
            m_AnalogOutputList.Add(WATTAGE__AnalogSerialOutput__, WATTAGE);

            OFFLEVEL = new Crestron.Logos.SplusObjects.AnalogOutput(OFFLEVEL__AnalogSerialOutput__, this);
            m_AnalogOutputList.Add(OFFLEVEL__AnalogSerialOutput__, OFFLEVEL);

            FRIENDLYNAMEUPDATE = new Crestron.Logos.SplusObjects.StringInput(FRIENDLYNAMEUPDATE__AnalogSerialInput__, 255, this);
            m_StringInputList.Add(FRIENDLYNAMEUPDATE__AnalogSerialInput__, FRIENDLYNAMEUPDATE);

            FRIENDLYNAME = new Crestron.Logos.SplusObjects.StringOutput(FRIENDLYNAME__AnalogSerialOutput__, this);
            m_StringOutputList.Add(FRIENDLYNAME__AnalogSerialOutput__, FRIENDLYNAME);

            ZONEID = new StringParameter(ZONEID__Parameter__, this);
            m_ParameterList.Add(ZONEID__Parameter__, ZONEID);

            __SPLS_TMPVAR__WAITLABEL_23___Callback = new WaitFunction(__SPLS_TMPVAR__WAITLABEL_23___CallbackFn);

            ZONEON.OnDigitalPush.Add(new InputChangeHandlerWrapper(ZONEON_OnPush_0, false));
            ZONEOFF.OnDigitalPush.Add(new InputChangeHandlerWrapper(ZONEOFF_OnPush_1, false));
            ZONEONOFF.OnDigitalPush.Add(new InputChangeHandlerWrapper(ZONEONOFF_OnPush_2, false));
            SAVEONLVL.OnDigitalPush.Add(new InputChangeHandlerWrapper(SAVEONLVL_OnPush_3, false));
            SAVEOFFLVL.OnDigitalPush.Add(new InputChangeHandlerWrapper(SAVEOFFLVL_OnPush_4, false));
            FRIENDLYNAMEUPDATE.OnSerialChange.Add(new InputChangeHandlerWrapper(FRIENDLYNAMEUPDATE_OnChange_5, false));

            _SplusNVRAM.PopulateCustomAttributeList(true);

            NVRAM = _SplusNVRAM;
        }
Example #2
0
        private ushort COMMANDHANDLER(SplusExecutionContext __context__)
        {
            ushort LOADNUM = 0;

            ushort ROUTINGID = 0;

            ushort INDEX = 0;

            ushort CMD = 0;

            ushort FUNCTIONRETURNVALUE = 0;

            CrestronString TEMPSTRING;

            TEMPSTRING = new CrestronString(Crestron.Logos.SplusObjects.CrestronStringEncoding.eEncodingASCII, 256, this);

            CrestronString LEVELINFO;

            LEVELINFO = new CrestronString(Crestron.Logos.SplusObjects.CrestronStringEncoding.eEncodingASCII, 5, this);

            ushort LOADLEVEL = 0;

            RAMP_INFO RAMPINFO;

            RAMPINFO = new RAMP_INFO();
            RAMPINFO.PopulateDefaults();


            __context__.SourceCodeLine = 459;

            __context__.SourceCodeLine = 463;
            LOADNUM = (ushort)(Functions.Atoi(Functions.Mid(STOREDCOMMANDSTRING, (int)((5 + 3)), (int)(5))));
            __context__.SourceCodeLine = 465;
            switch ((int)Byte(STOREDCOMMANDSTRING, (int)(5)))

            {
            case 61:

            {
                __context__.SourceCodeLine = 469;
                if (Functions.TestForTrue((Functions.BoolToInt(GETLOADSINFO(__context__) >= 0))))
                {
                    __context__.SourceCodeLine = 471;
                    MakeString(TEMPSTRING, "{0:d}{1}{2}{3}{4:d}{5}{6:d1}{7}{8:d}{9}{10:d5}{11}{12:d5}{13}{14:d3}{15}{16:d5}", (short)LOADNUM, ",", G_LOADNAME, ",", (short)G_PARENTRM_ID, ",", (ushort)G_DIM_SETTING, ",", (int)G_RAMPTIME, ",", (ushort)G_UPPERLIMIT, ",", (ushort)G_LOWERLIMIT, ",", (ushort)G_TOTAL_WATTAGE, ",", (ushort)SETLEVEL.Value);
                    __context__.SourceCodeLine = 472;
                    SENDRESPONSE(__context__, (ushort)(Functions.Atoi(STOREDCOMMANDSTRING)), (ushort)(52), TEMPSTRING);
                }

                else
                {
                    __context__.SourceCodeLine = 476;
                    MakeString(TEMPSTRING, "{0:d}{1}{2}{3}{4}", (short)LOADNUM, ",", "-1", ",", "Load Not Found");
                    __context__.SourceCodeLine = 477;
                    SENDRESPONSE(__context__, (ushort)(Functions.Atoi(STOREDCOMMANDSTRING)), (ushort)(255), TEMPSTRING);
                }

                __context__.SourceCodeLine = 479;
                break;
            }

                goto case 62;

            case 62:

            {
                __context__.SourceCodeLine = 483;
                INDEX = (ushort)(Functions.Find(",", STOREDCOMMANDSTRING, 1));
                __context__.SourceCodeLine = 488;
                RAMPINFO.rampTargetValue   = (int)(Functions.Atoi(Functions.Mid(STOREDCOMMANDSTRING, (int)((INDEX + 1)), (int)(5))));
                __context__.SourceCodeLine = 490;
                INDEX = (ushort)(Functions.Find(",", STOREDCOMMANDSTRING, (INDEX + 1)));
                __context__.SourceCodeLine  = 492;
                RAMPINFO.rampTransitionTime = (uint)(Functions.Atoi(Functions.Mid(STOREDCOMMANDSTRING, (int)((INDEX + 1)), (int)(5))));
                __context__.SourceCodeLine  = 493;
                CreateRamp(SETLEVEL, ref RAMPINFO);
                __context__.SourceCodeLine = 494;
                MakeString(TEMPSTRING, "{0:d}{1}{2:d}", (short)LOADNUM, ",", (short)RAMPINFO.rampTargetValue);
                __context__.SourceCodeLine = 495;
                SENDRESPONSE(__context__, (ushort)(Functions.Atoi(STOREDCOMMANDSTRING)), (ushort)(52), TEMPSTRING);
                __context__.SourceCodeLine = 496;
                break;
            }

                goto case 63;

            case 63:

            {
                __context__.SourceCodeLine = 500;
                MakeString(TEMPSTRING, "{0:d}{1}{2:d}{3}{4:d}{5}{6:d}", (short)LOADNUM, ",", (short)((((G_RAMPTIME * (G_UPPERLIMIT - SETLEVEL.Value)) * 100) / G_UPPERLIMIT) / 100), ",", (short)SETLEVEL.Value, ",", (short)G_UPPERLIMIT);
                __context__.SourceCodeLine = 501;
                RAISELEVEL.Value           = (ushort)(1);
                __context__.SourceCodeLine = 502;
                SENDRESPONSE(__context__, (ushort)(Functions.Atoi(STOREDCOMMANDSTRING)), (ushort)(52), TEMPSTRING);
                __context__.SourceCodeLine = 503;
                break;
            }

                goto case 64;

            case 64:

            {
                __context__.SourceCodeLine = 507;
                MakeString(TEMPSTRING, "{0:d}{1}{2:d}{3}{4:d}{5}{6:d}", (short)LOADNUM, ",", (short)((((G_RAMPTIME * (SETLEVEL.Value - G_LOWERLIMIT)) * 100) / SETLEVEL.Value) / 100), ",", (short)SETLEVEL.Value, ",", (short)G_LOWERLIMIT);
                __context__.SourceCodeLine = 508;
                LOWERLEVEL.Value           = (ushort)(1);
                __context__.SourceCodeLine = 509;
                SENDRESPONSE(__context__, (ushort)(Functions.Atoi(STOREDCOMMANDSTRING)), (ushort)(52), TEMPSTRING);
                __context__.SourceCodeLine = 510;
                break;
            }

                goto case 65;

            case 65:

            {
                __context__.SourceCodeLine = 514;
                RAISELEVEL.Value           = (ushort)(0);
                __context__.SourceCodeLine = 515;
                LOWERLEVEL.Value           = (ushort)(0);
                __context__.SourceCodeLine = 516;
                MakeString(TEMPSTRING, "{0:d}{1}{2:d}", (short)LOADNUM, ",", (short)SETLEVEL.Value);
                __context__.SourceCodeLine = 517;
                SENDRESPONSE(__context__, (ushort)(Functions.Atoi(STOREDCOMMANDSTRING)), (ushort)(52), TEMPSTRING);
                __context__.SourceCodeLine = 518;
                break;
            }

                goto case 66;

            case 66:

            {
                __context__.SourceCodeLine = 522;
                Print("\r\nSubscribing to load");
                __context__.SourceCodeLine = 523;
                LOADNOTSUBSCRIBED.Value    = (ushort)(0);
                __context__.SourceCodeLine = 524;
                LOADSUBSCRIBED.Value       = (ushort)(1);
                __context__.SourceCodeLine = 525;
                LOADSUBSCRIBED.Value       = (ushort)(0);
                __context__.SourceCodeLine = 526;
                MakeString(TEMPSTRING, "{0:d}{1}{2:d}", (short)LOADNUM, ",", (ushort)SETLEVEL.Value);
                __context__.SourceCodeLine = 527;
                SENDRESPONSE(__context__, (ushort)(Functions.Atoi(STOREDCOMMANDSTRING)), (ushort)(55), TEMPSTRING);
                __context__.SourceCodeLine = 528;
                break;
            }

                goto case 67;

            case 67:

            {
                __context__.SourceCodeLine = 532;
                LOADSUBSCRIBED.Value       = (ushort)(0);
                __context__.SourceCodeLine = 533;
                LOADNOTSUBSCRIBED.Value    = (ushort)(1);
                __context__.SourceCodeLine = 534;
                LOADNOTSUBSCRIBED.Value    = (ushort)(0);
                __context__.SourceCodeLine = 535;
                MakeString(TEMPSTRING, "{0:d}{1}{2}", (short)LOADNUM, ",", "\u0036");
                __context__.SourceCodeLine = 536;
                SENDRESPONSE(__context__, (ushort)(Functions.Atoi(STOREDCOMMANDSTRING)), (ushort)(52), TEMPSTRING);
                __context__.SourceCodeLine = 537;
                break;
            }

            break;
            }



            return(0); // default return value (none specified in module)
        }