object DO_SEARCH_OnPush_0(Object __EventInfo__) { Crestron.Logos.SplusObjects.SignalEventArgs __SignalEventArg__ = (Crestron.Logos.SplusObjects.SignalEventArgs)__EventInfo__; try { SplusExecutionContext __context__ = SplusThreadStartCode(__SignalEventArg__); short IRESULT = 0; short IFINDRESULT = 0; FILE_INFO FI; FI = new FILE_INFO(); FI.PopulateDefaults(); ushort IFILECOUNT = 0; __context__.SourceCodeLine = 33; StartFileOperations( ); __context__.SourceCodeLine = 35; IRESULT = (short)(SetCurrentDirectory(SEARCH_PATH__DOLLAR__)); __context__.SourceCodeLine = 37; if (Functions.TestForTrue((Functions.BoolToInt(IRESULT < 0)))) { __context__.SourceCodeLine = 39; SETFILECOUNT(__context__, (ushort)(0)); __context__.SourceCodeLine = 40; Functions.TerminateEvent(); } __context__.SourceCodeLine = 43; IFILECOUNT = (ushort)(0); __context__.SourceCodeLine = 45; IFINDRESULT = (short)(FindFirst(FILENAME_SPEC__DOLLAR__, ref FI)); __context__.SourceCodeLine = 47; while (Functions.TestForTrue((Functions.BoolToInt(IFINDRESULT == 0)))) { __context__.SourceCodeLine = 49; IFILECOUNT = (ushort)((IFILECOUNT + 1)); __context__.SourceCodeLine = 50; IFINDRESULT = (short)(FindNext(ref FI)); __context__.SourceCodeLine = 47; } __context__.SourceCodeLine = 53; SETFILECOUNT(__context__, (ushort)(IFILECOUNT)); __context__.SourceCodeLine = 55; EndFileOperations( ); } catch (Exception e) { ObjectCatchHandler(e); } finally { ObjectFinallyHandler(__SignalEventArg__); } return(this); }
public override void LogosSplusInitialize() { _SplusNVRAM = new SplusNVRAM(this); SBUF = new CrestronString(Crestron.Logos.SplusObjects.CrestronStringEncoding.eEncodingASCII, 2000, this); FILE_CONTENTS = new CrestronString(Crestron.Logos.SplusObjects.CrestronStringEncoding.eEncodingASCII, 2000, this); FILE_LINE = new CrestronString(Crestron.Logos.SplusObjects.CrestronStringEncoding.eEncodingASCII, 50, this); STR = new CrestronString(Crestron.Logos.SplusObjects.CrestronStringEncoding.eEncodingASCII, 50, this); NFILEINFO = new FILE_INFO(); NFILEINFO.PopulateDefaults(); PRESET_INIT = new Crestron.Logos.SplusObjects.DigitalInput(PRESET_INIT__DigitalInput__, this); m_DigitalInputList.Add(PRESET_INIT__DigitalInput__, PRESET_INIT); PRESET_SAVE = new Crestron.Logos.SplusObjects.DigitalInput(PRESET_SAVE__DigitalInput__, this); m_DigitalInputList.Add(PRESET_SAVE__DigitalInput__, PRESET_SAVE); PRESET_SAVED_FB = new Crestron.Logos.SplusObjects.DigitalOutput(PRESET_SAVED_FB__DigitalOutput__, this); m_DigitalOutputList.Add(PRESET_SAVED_FB__DigitalOutput__, PRESET_SAVED_FB); LEVEL_IN = new InOutArray <AnalogInput>(32, this); for (uint i = 0; i < 32; i++) { LEVEL_IN[i + 1] = new Crestron.Logos.SplusObjects.AnalogInput(LEVEL_IN__AnalogSerialInput__ + i, LEVEL_IN__AnalogSerialInput__, this); m_AnalogInputList.Add(LEVEL_IN__AnalogSerialInput__ + i, LEVEL_IN[i + 1]); } LEVEL_OUT = new InOutArray <AnalogOutput>(32, this); for (uint i = 0; i < 32; i++) { LEVEL_OUT[i + 1] = new Crestron.Logos.SplusObjects.AnalogOutput(LEVEL_OUT__AnalogSerialOutput__ + i, this); m_AnalogOutputList.Add(LEVEL_OUT__AnalogSerialOutput__ + i, LEVEL_OUT[i + 1]); } DEFAULT_LEVEL = new UShortParameter(DEFAULT_LEVEL__Parameter__, this); m_ParameterList.Add(DEFAULT_LEVEL__Parameter__, DEFAULT_LEVEL); ROOMID = new StringParameter(ROOMID__Parameter__, this); m_ParameterList.Add(ROOMID__Parameter__, ROOMID); FILE_PATH = new StringParameter(FILE_PATH__Parameter__, this); m_ParameterList.Add(FILE_PATH__Parameter__, FILE_PATH); PRESET_NAME = new StringParameter(PRESET_NAME__Parameter__, this); m_ParameterList.Add(PRESET_NAME__Parameter__, PRESET_NAME); PRESET_SAVE.OnDigitalPush.Add(new InputChangeHandlerWrapper(PRESET_SAVE_OnPush_0, false)); PRESET_INIT.OnDigitalPush.Add(new InputChangeHandlerWrapper(PRESET_INIT_OnPush_1, false)); _SplusNVRAM.PopulateCustomAttributeList(true); NVRAM = _SplusNVRAM; }
private void WRITESETPOINTS(SplusExecutionContext __context__) { short FILEHANDLE = 0; FILE_INFO FILEINFO; FILEINFO = new FILE_INFO(); FILEINFO.PopulateDefaults(); __context__.SourceCodeLine = 92; StartFileOperations( ); __context__.SourceCodeLine = 94; FILEHANDLE = (short)(FileOpen(FILENAME, (ushort)(((1 | 256) | 512) | 32768))); __context__.SourceCodeLine = 96; if (Functions.TestForTrue((Functions.BoolToInt(FILEHANDLE >= 0)))) { __context__.SourceCodeLine = 99; WriteInteger((short)(FILEHANDLE), (ushort)(HEAT)); __context__.SourceCodeLine = 100; WriteInteger((short)(FILEHANDLE), (ushort)(COOL)); __context__.SourceCodeLine = 101; WriteInteger((short)(FILEHANDLE), (ushort)(AUTO1PT)); __context__.SourceCodeLine = 102; WriteInteger((short)(FILEHANDLE), (ushort)(SETBKENABLED)); __context__.SourceCodeLine = 104; } else { __context__.SourceCodeLine = 110; } __context__.SourceCodeLine = 114; FileClose((short)(FILEHANDLE)); __context__.SourceCodeLine = 116; EndFileOperations( ); }
private CrestronString FNFINDMOBILEPROJECT(SplusExecutionContext __context__) { FILE_INFO FIFILEINFO; FIFILEINFO = new FILE_INFO(); FIFILEINFO.PopulateDefaults(); ushort NALTLOCATIONFOUND = 0; ushort NPOSITION = 0; short SNMANIFESTFILEFOUND = 0; short SNSTARTFILEIOERROR = 0; short SNENDFILEIOERROR = 0; CrestronString SMANIFESTFILENAME__DOLLAR__; CrestronString SMANIFESTSEARCHPATH__DOLLAR__; CrestronString SMANIFESTSEARCHPATHALT__DOLLAR__; SMANIFESTFILENAME__DOLLAR__ = new CrestronString(Crestron.Logos.SplusObjects.CrestronStringEncoding.eEncodingASCII, 200, this); SMANIFESTSEARCHPATH__DOLLAR__ = new CrestronString(Crestron.Logos.SplusObjects.CrestronStringEncoding.eEncodingASCII, 250, this); SMANIFESTSEARCHPATHALT__DOLLAR__ = new CrestronString(Crestron.Logos.SplusObjects.CrestronStringEncoding.eEncodingASCII, 250, this); __context__.SourceCodeLine = 291; if (Functions.TestForTrue((G_NDEBUG))) { __context__.SourceCodeLine = 291; Trace("***** Start fnFindMobileProject *****\r\n"); } __context__.SourceCodeLine = 293; NALTLOCATIONFOUND = (ushort)(0); __context__.SourceCodeLine = 295; FNGETSEARCHLOCATION(__context__); __context__.SourceCodeLine = 297; if (Functions.TestForTrue((Functions.BoolToInt(Functions.Length(G_SMATCHSEGMENT__DOLLAR__) > 1)))) { __context__.SourceCodeLine = 299; MakeString(SMANIFESTSEARCHPATH__DOLLAR__, "{0}*{1}{2}", G_SSEARCHLOCATION__DOLLAR__, G_SMATCHSEGMENT__DOLLAR__, "*_Manifest.xml"); } else { __context__.SourceCodeLine = 303; MakeString(SMANIFESTSEARCHPATH__DOLLAR__, "{0}{1}", G_SSEARCHLOCATION__DOLLAR__, "*_Manifest.xml"); } __context__.SourceCodeLine = 305; if (Functions.TestForTrue((Functions.BoolToInt(Functions.Length(SMANIFESTSEARCHPATHALT__DOLLAR__) > 1)))) { __context__.SourceCodeLine = 307; if (Functions.TestForTrue((Functions.BoolToInt(Functions.Length(G_SMATCHSEGMENT__DOLLAR__) > 1)))) { __context__.SourceCodeLine = 309; MakeString(SMANIFESTSEARCHPATHALT__DOLLAR__, "{0}*{1}{2}", G_SSEARCHLOCATIONALT__DOLLAR__, G_SMATCHSEGMENT__DOLLAR__, "*_Manifest.xml"); } else { __context__.SourceCodeLine = 313; MakeString(SMANIFESTSEARCHPATHALT__DOLLAR__, "{0}{1}", G_SSEARCHLOCATIONALT__DOLLAR__, "*_Manifest.xml"); } __context__.SourceCodeLine = 315; NALTLOCATIONFOUND = (ushort)(1); } else { __context__.SourceCodeLine = 319; Functions.ClearBuffer(SMANIFESTSEARCHPATHALT__DOLLAR__); __context__.SourceCodeLine = 320; NALTLOCATIONFOUND = (ushort)(0); } __context__.SourceCodeLine = 323; if (Functions.TestForTrue((G_NDEBUG))) { __context__.SourceCodeLine = 323; Trace("sManifestSearchPath$ = {0}\r\n", SMANIFESTSEARCHPATH__DOLLAR__); } __context__.SourceCodeLine = 324; if (Functions.TestForTrue((G_NDEBUG))) { __context__.SourceCodeLine = 324; Trace("sManifestSearchPathAlt$ = {0}\r\n", SMANIFESTSEARCHPATHALT__DOLLAR__); } __context__.SourceCodeLine = 326; MakeString(SMANIFESTSEARCHPATH__DOLLAR__, "{0}", FNADDSPECIALCHARACTERS(__context__, SMANIFESTSEARCHPATH__DOLLAR__)); __context__.SourceCodeLine = 327; MakeString(SMANIFESTSEARCHPATHALT__DOLLAR__, "{0}", FNADDSPECIALCHARACTERS(__context__, SMANIFESTSEARCHPATHALT__DOLLAR__)); __context__.SourceCodeLine = 329; if (Functions.TestForTrue((G_NDEBUG))) { __context__.SourceCodeLine = 329; Trace("sManifestSearchPath$ = {0}\r\n", SMANIFESTSEARCHPATH__DOLLAR__); } __context__.SourceCodeLine = 330; if (Functions.TestForTrue((G_NDEBUG))) { __context__.SourceCodeLine = 330; Trace("sManifestSearchPathAlt$ = {0}\r\n", SMANIFESTSEARCHPATHALT__DOLLAR__); } __context__.SourceCodeLine = 332; SNSTARTFILEIOERROR = (short)(StartFileOperations()); __context__.SourceCodeLine = 333; while (Functions.TestForTrue((Functions.BoolToInt(SNSTARTFILEIOERROR != 0)))) { __context__.SourceCodeLine = 335; if (Functions.TestForTrue((G_NDEBUG))) { __context__.SourceCodeLine = 335; Trace("Start File Operations Error Retrying\r\n"); } __context__.SourceCodeLine = 336; Functions.Delay((int)(100)); __context__.SourceCodeLine = 337; SNSTARTFILEIOERROR = (short)(StartFileOperations()); __context__.SourceCodeLine = 333; } __context__.SourceCodeLine = 340; { int __SPLS_TMPVAR__SWTCH_2__ = ((int)Functions.GetSeries()); { if (Functions.TestForTrue((__SPLS_TMPVAR__SWTCH_2__ == (2)))) { __context__.SourceCodeLine = 344; SNMANIFESTFILEFOUND = (short)(FindFirst(SMANIFESTSEARCHPATH__DOLLAR__, ref FIFILEINFO)); __context__.SourceCodeLine = 345; FindClose( ); } else if (Functions.TestForTrue((__SPLS_TMPVAR__SWTCH_2__ == (3)))) { __context__.SourceCodeLine = 349; SNMANIFESTFILEFOUND = (short)(FindFirstShared(SMANIFESTSEARCHPATH__DOLLAR__, ref FIFILEINFO)); __context__.SourceCodeLine = 350; FindClose( ); } } } __context__.SourceCodeLine = 354; if (Functions.TestForTrue((G_NDEBUG))) { __context__.SourceCodeLine = 354; Trace("snManifestFileFound = {0:d}\r\n", (short)SNMANIFESTFILEFOUND); } __context__.SourceCodeLine = 356; if (Functions.TestForTrue((Functions.BoolToInt(SNMANIFESTFILEFOUND == 0)))) { __context__.SourceCodeLine = 358; MakeString(SMANIFESTFILENAME__DOLLAR__, "{0}", FIFILEINFO.Name); } else { __context__.SourceCodeLine = 360; if (Functions.TestForTrue((NALTLOCATIONFOUND))) { __context__.SourceCodeLine = 362; { int __SPLS_TMPVAR__SWTCH_3__ = ((int)Functions.GetSeries()); { if (Functions.TestForTrue((__SPLS_TMPVAR__SWTCH_3__ == (2)))) { __context__.SourceCodeLine = 366; SNMANIFESTFILEFOUND = (short)(FindFirst(SMANIFESTSEARCHPATHALT__DOLLAR__, ref FIFILEINFO)); __context__.SourceCodeLine = 367; FindClose( ); } else if (Functions.TestForTrue((__SPLS_TMPVAR__SWTCH_3__ == (3)))) { __context__.SourceCodeLine = 371; SNMANIFESTFILEFOUND = (short)(FindFirstShared(SMANIFESTSEARCHPATHALT__DOLLAR__, ref FIFILEINFO)); __context__.SourceCodeLine = 372; FindClose( ); } } } __context__.SourceCodeLine = 376; if (Functions.TestForTrue((Functions.BoolToInt(SNMANIFESTFILEFOUND == 0)))) { __context__.SourceCodeLine = 378; MakeString(SMANIFESTFILENAME__DOLLAR__, "{0}", FIFILEINFO.Name); } else { __context__.SourceCodeLine = 382; MakeString(SMANIFESTFILENAME__DOLLAR__, "{0}", "Error Finding Project"); } } else { __context__.SourceCodeLine = 387; MakeString(SMANIFESTFILENAME__DOLLAR__, "{0}", "Error Finding Project"); } } __context__.SourceCodeLine = 389; SNENDFILEIOERROR = (short)(EndFileOperations()); __context__.SourceCodeLine = 390; while (Functions.TestForTrue((Functions.BoolToInt(SNENDFILEIOERROR != 0)))) { __context__.SourceCodeLine = 392; if (Functions.TestForTrue((G_NDEBUG))) { __context__.SourceCodeLine = 392; Trace("End File Operations Error Retrying\r\n"); } __context__.SourceCodeLine = 393; Functions.Delay((int)(100)); __context__.SourceCodeLine = 394; SNENDFILEIOERROR = (short)(EndFileOperations()); __context__.SourceCodeLine = 390; } __context__.SourceCodeLine = 397; if (Functions.TestForTrue((G_NDEBUG))) { __context__.SourceCodeLine = 397; Trace("sManifestFileName$ = {0}\r\n", SMANIFESTFILENAME__DOLLAR__); } __context__.SourceCodeLine = 399; if (Functions.TestForTrue((Functions.BoolToInt(SMANIFESTFILENAME__DOLLAR__ != "Error Finding Project")))) { __context__.SourceCodeLine = 401; MakeString(SMANIFESTFILENAME__DOLLAR__, "{0}", FNREMOVESPECIALCHARACTERS(__context__, SMANIFESTFILENAME__DOLLAR__)); __context__.SourceCodeLine = 402; NPOSITION = (ushort)(Functions.Find("_Manifest.xml", SMANIFESTFILENAME__DOLLAR__)); __context__.SourceCodeLine = 403; if (Functions.TestForTrue((G_NDEBUG))) { __context__.SourceCodeLine = 403; Trace("sManifestFileName$ = {0}\r\n", SMANIFESTFILENAME__DOLLAR__); } __context__.SourceCodeLine = 404; if (Functions.TestForTrue((G_NDEBUG))) { __context__.SourceCodeLine = 404; Trace("nPosition = {0:d}\r\n", (short)NPOSITION); } __context__.SourceCodeLine = 406; if (Functions.TestForTrue((NPOSITION))) { __context__.SourceCodeLine = 408; MakeString(SMANIFESTFILENAME__DOLLAR__, "{0}", Functions.Left(SMANIFESTFILENAME__DOLLAR__, (int)((NPOSITION - 1)))); } } __context__.SourceCodeLine = 412; return(SMANIFESTFILENAME__DOLLAR__); __context__.SourceCodeLine = 414; if (Functions.TestForTrue((G_NDEBUG))) { __context__.SourceCodeLine = 414; Trace("***** End fnFindMobileProject *****\r\n"); } }
public override void LogosSplusInitialize() { _SplusNVRAM = new SplusNVRAM(this); G_LOADS_FILE__DOLLAR__ = new CrestronString(Crestron.Logos.SplusObjects.CrestronStringEncoding.eEncodingASCII, 96, this); G_LOADNAME = new CrestronString(Crestron.Logos.SplusObjects.CrestronStringEncoding.eEncodingASCII, 50, this); G_LASTSAVEDTIME = new CrestronString(Crestron.Logos.SplusObjects.CrestronStringEncoding.eEncodingASCII, 8, this); G_LASTSAVEDDATE = new CrestronString(Crestron.Logos.SplusObjects.CrestronStringEncoding.eEncodingASCII, 10, this); STOREDCOMMANDSTRING = new CrestronString(Crestron.Logos.SplusObjects.CrestronStringEncoding.eEncodingASCII, 256, this); G_FILEINFO = new FILE_INFO(); G_FILEINFO.PopulateDefaults(); LOAD_LEVEL_INCREASING = new Crestron.Logos.SplusObjects.DigitalInput(LOAD_LEVEL_INCREASING__DigitalInput__, this); m_DigitalInputList.Add(LOAD_LEVEL_INCREASING__DigitalInput__, LOAD_LEVEL_INCREASING); LOAD_LEVEL_DECREASING = new Crestron.Logos.SplusObjects.DigitalInput(LOAD_LEVEL_DECREASING__DigitalInput__, this); m_DigitalInputList.Add(LOAD_LEVEL_DECREASING__DigitalInput__, LOAD_LEVEL_DECREASING); LOAD_LEVEL_RAMPING = new Crestron.Logos.SplusObjects.DigitalInput(LOAD_LEVEL_RAMPING__DigitalInput__, this); m_DigitalInputList.Add(LOAD_LEVEL_RAMPING__DigitalInput__, LOAD_LEVEL_RAMPING); SUBSCRIPTIONEXPIRED = new Crestron.Logos.SplusObjects.DigitalInput(SUBSCRIPTIONEXPIRED__DigitalInput__, this); m_DigitalInputList.Add(SUBSCRIPTIONEXPIRED__DigitalInput__, SUBSCRIPTIONEXPIRED); RAISELEVEL = new Crestron.Logos.SplusObjects.DigitalOutput(RAISELEVEL__DigitalOutput__, this); m_DigitalOutputList.Add(RAISELEVEL__DigitalOutput__, RAISELEVEL); LOWERLEVEL = new Crestron.Logos.SplusObjects.DigitalOutput(LOWERLEVEL__DigitalOutput__, this); m_DigitalOutputList.Add(LOWERLEVEL__DigitalOutput__, LOWERLEVEL); LOADSUBSCRIBED = new Crestron.Logos.SplusObjects.DigitalOutput(LOADSUBSCRIBED__DigitalOutput__, this); m_DigitalOutputList.Add(LOADSUBSCRIBED__DigitalOutput__, LOADSUBSCRIBED); LOADNOTSUBSCRIBED = new Crestron.Logos.SplusObjects.DigitalOutput(LOADNOTSUBSCRIBED__DigitalOutput__, this); m_DigitalOutputList.Add(LOADNOTSUBSCRIBED__DigitalOutput__, LOADNOTSUBSCRIBED); SETLEVEL = new Crestron.Logos.SplusObjects.AnalogOutput(SETLEVEL__AnalogSerialOutput__, this); m_AnalogOutputList.Add(SETLEVEL__AnalogSerialOutput__, SETLEVEL); RESPONSEID = new Crestron.Logos.SplusObjects.AnalogOutput(RESPONSEID__AnalogSerialOutput__, this); m_AnalogOutputList.Add(RESPONSEID__AnalogSerialOutput__, RESPONSEID); PATH__DOLLAR__ = new Crestron.Logos.SplusObjects.StringInput(PATH__DOLLAR____AnalogSerialInput__, 64, this); m_StringInputList.Add(PATH__DOLLAR____AnalogSerialInput__, PATH__DOLLAR__); RESPONSE__DOLLAR__ = new Crestron.Logos.SplusObjects.StringOutput(RESPONSE__DOLLAR____AnalogSerialOutput__, this); m_StringOutputList.Add(RESPONSE__DOLLAR____AnalogSerialOutput__, RESPONSE__DOLLAR__); LOAD_CMD__DOLLAR__ = new Crestron.Logos.SplusObjects.BufferInput(LOAD_CMD__DOLLAR____AnalogSerialInput__, 512, this); m_StringInputList.Add(LOAD_CMD__DOLLAR____AnalogSerialInput__, LOAD_CMD__DOLLAR__); LOAD_NUMBER = new UShortParameter(LOAD_NUMBER__Parameter__, this); m_ParameterList.Add(LOAD_NUMBER__Parameter__, LOAD_NUMBER); LOAD_CMD__DOLLAR__.OnSerialChange.Add(new InputChangeHandlerWrapper(LOAD_CMD__DOLLAR___OnChange_0, false)); SUBSCRIPTIONEXPIRED.OnDigitalPush.Add(new InputChangeHandlerWrapper(SUBSCRIPTIONEXPIRED_OnPush_1, false)); LOAD_LEVEL_INCREASING.OnDigitalPush.Add(new InputChangeHandlerWrapper(LOAD_LEVEL_INCREASING_OnPush_2, false)); LOAD_LEVEL_DECREASING.OnDigitalPush.Add(new InputChangeHandlerWrapper(LOAD_LEVEL_DECREASING_OnPush_3, false)); LOAD_LEVEL_RAMPING.OnDigitalRelease.Add(new InputChangeHandlerWrapper(LOAD_LEVEL_RAMPING_OnRelease_4, false)); PATH__DOLLAR__.OnSerialChange.Add(new InputChangeHandlerWrapper(PATH__DOLLAR___OnChange_5, false)); _SplusNVRAM.PopulateCustomAttributeList(true); NVRAM = _SplusNVRAM; }
object CONCAT_OnPush_0(Object __EventInfo__) { Crestron.Logos.SplusObjects.SignalEventArgs __SignalEventArg__ = (Crestron.Logos.SplusObjects.SignalEventArgs)__EventInfo__; try { SplusExecutionContext __context__ = SplusThreadStartCode(__SignalEventArg__); short IRESULT = 0; short IFINDRESULT = 0; short IFILEHANDLEWRITE = 0; short IFILEHANDLEREAD = 0; ushort I = 0; CrestronString SREADDATA; SREADDATA = new CrestronString(Crestron.Logos.SplusObjects.CrestronStringEncoding.eEncodingASCII, 300, this); CrestronString SREADFILENAME; SREADFILENAME = new CrestronString(Crestron.Logos.SplusObjects.CrestronStringEncoding.eEncodingASCII, 100, this); FILE_INFO FI; FI = new FILE_INFO(); FI.PopulateDefaults(); ushort IFILECOUNT = 0; __context__.SourceCodeLine = 23; StartFileOperations( ); __context__.SourceCodeLine = 25; FileDelete(WRITE_FILENAME__DOLLAR__); __context__.SourceCodeLine = 27; IFILEHANDLEWRITE = (short)(FileOpen(WRITE_FILENAME__DOLLAR__, (ushort)((256 | 1) | 16384))); __context__.SourceCodeLine = 29; if (Functions.TestForTrue((Functions.BoolToInt(IFILEHANDLEWRITE >= 0)))) { __context__.SourceCodeLine = 31; IRESULT = (short)(SetCurrentDirectory(READ_PATH__DOLLAR__)); __context__.SourceCodeLine = 33; if (Functions.TestForTrue((Functions.BoolToInt(IRESULT < 0)))) { __context__.SourceCodeLine = 35; RESPONSE_MSG__DOLLAR__.UpdateValue("ERROR\r\n>"); __context__.SourceCodeLine = 36; Functions.TerminateEvent(); } __context__.SourceCodeLine = 39; IFILECOUNT = (ushort)(0); __context__.SourceCodeLine = 41; IFINDRESULT = (short)(FindFirst(READ_WILDCARD__DOLLAR__, ref FI)); __context__.SourceCodeLine = 43; while (Functions.TestForTrue((Functions.Not(IFINDRESULT)))) { __context__.SourceCodeLine = 45; SREADFILENAME.UpdateValue(FI.Name); __context__.SourceCodeLine = 46; IFILEHANDLEREAD = (short)(FileOpen(SREADFILENAME, (ushort)(0 | 32768))); __context__.SourceCodeLine = 48; if (Functions.TestForTrue((Functions.BoolToInt(IFILEHANDLEREAD >= 0)))) { __context__.SourceCodeLine = 51; IFILECOUNT = (ushort)((IFILECOUNT + 1)); __context__.SourceCodeLine = 53; SREADDATA.UpdateValue("[" + FI.Name + "]"); __context__.SourceCodeLine = 54; FileWrite((short)(IFILEHANDLEWRITE), SREADDATA, (ushort)(Functions.Length(SREADDATA))); __context__.SourceCodeLine = 55; FileWrite((short)(IFILEHANDLEWRITE), "\u000D\u000A", (ushort)(2)); __context__.SourceCodeLine = 57; I = (ushort)(1); __context__.SourceCodeLine = 59; while (Functions.TestForTrue((Functions.Not(FileEOF((short)(IFILEHANDLEREAD)))))) { __context__.SourceCodeLine = 61; IRESULT = (short)(FileRead((short)(IFILEHANDLEREAD), SREADDATA, (ushort)(256))); __context__.SourceCodeLine = 63; if (Functions.TestForTrue((Functions.BoolToInt(IRESULT > 0)))) { __context__.SourceCodeLine = 66; FileWrite((short)(IFILEHANDLEWRITE), SREADDATA, (ushort)(Functions.Length(SREADDATA))); } else { __context__.SourceCodeLine = 70; break; } __context__.SourceCodeLine = 59; } __context__.SourceCodeLine = 74; FileWrite((short)(IFILEHANDLEWRITE), "\u000D\u000A", (ushort)(2)); __context__.SourceCodeLine = 75; IRESULT = (short)(FileClose((short)(IFILEHANDLEREAD))); } __context__.SourceCodeLine = 78; IFINDRESULT = (short)(FindNext(ref FI)); __context__.SourceCodeLine = 43; } __context__.SourceCodeLine = 82; IRESULT = (short)(FileClose((short)(IFILEHANDLEWRITE))); __context__.SourceCodeLine = 84; RESPONSE_MSG__DOLLAR__.UpdateValue("OK " + Functions.ItoA((int)(IFILECOUNT)) + "\r\n>"); } else { __context__.SourceCodeLine = 88; RESPONSE_MSG__DOLLAR__.UpdateValue("ERROR\r\n>"); } __context__.SourceCodeLine = 90; EndFileOperations( ); } catch (Exception e) { ObjectCatchHandler(e); } finally { ObjectFinallyHandler(__SignalEventArg__); } return(this); }
private void WRITEEVENTSTOFILE(SplusExecutionContext __context__) { ushort I = 0; short IFILEHANDLE = 0; short IARCHHANDLE = 0; CrestronString WRITESTR; CrestronString MSG; WRITESTR = new CrestronString(Crestron.Logos.SplusObjects.CrestronStringEncoding.eEncodingASCII, 100, this); MSG = new CrestronString(Crestron.Logos.SplusObjects.CrestronStringEncoding.eEncodingASCII, 85, this); FILE_INFO FINFO; FINFO = new FILE_INFO(); FINFO.PopulateDefaults(); int SPACE = 0; __context__.SourceCodeLine = 172; StartFileOperations( ); __context__.SourceCodeLine = 174; IFILEHANDLE = (short)(FileOpen(G_FILENAME, (ushort)(((256 | 8) | 2) | 16384))); __context__.SourceCodeLine = 176; SPACE = (int)(GETDISKSPACE(__context__)); __context__.SourceCodeLine = 178; if (Functions.TestForTrue((Functions.BoolToInt((Functions.TestForTrue(Functions.BoolToInt(SPACE > 0)) && Functions.TestForTrue(Functions.BoolToInt(SPACE < 5000))))))) { __context__.SourceCodeLine = 180; MakeString(MSG, "LOGGING STOPPED AT {0} ON {1}\r\nMINIMUM REQUIRED DISK SPACE: {2:d}\r\n", Functions.Time( ), Functions.Date((int)(1)), (short)5000); __context__.SourceCodeLine = 181; Print("{0}", MSG); __context__.SourceCodeLine = 183; if (Functions.TestForTrue((Functions.BoolToInt(SPACE > 85)))) { __context__.SourceCodeLine = 184; FileWrite((short)(IFILEHANDLE), MSG, (ushort)(Functions.Length(MSG))); } __context__.SourceCodeLine = 186; SCHEDULER_LOGSTATE.Value = (ushort)(0); __context__.SourceCodeLine = 187; _SplusNVRAM.LOGSTATE = (ushort)(0); } else { __context__.SourceCodeLine = 192; ushort __FN_FORSTART_VAL__1 = (ushort)(1); ushort __FN_FOREND_VAL__1 = (ushort)(G_INEXTLOGINDEX - 1); int __FN_FORSTEP_VAL__1 = (int)1; for (I = __FN_FORSTART_VAL__1; (__FN_FORSTEP_VAL__1 > 0) ? ((I >= __FN_FORSTART_VAL__1) && (I <= __FN_FOREND_VAL__1)) : ((I <= __FN_FORSTART_VAL__1) && (I >= __FN_FOREND_VAL__1)); I += (ushort)__FN_FORSTEP_VAL__1) { __context__.SourceCodeLine = 194; if (Functions.TestForTrue((Functions.BoolToInt(FileSeek((short)(IFILEHANDLE), (uint)(0), (ushort)(1)) > 10000)))) { __context__.SourceCodeLine = 196; FileClose((short)(IFILEHANDLE)); __context__.SourceCodeLine = 197; IFILEHANDLE = (short)(FileOpen(G_FILENAME, (ushort)(0 | 16384))); __context__.SourceCodeLine = 198; IFILEHANDLE = (short)(CYCLELOG(__context__, (short)(IFILEHANDLE))); } __context__.SourceCodeLine = 201; WRITESTR.UpdateValue(G_LOGDATA [I].DATA); __context__.SourceCodeLine = 202; FileWrite((short)(IFILEHANDLE), WRITESTR, (ushort)(Functions.Length(WRITESTR))); __context__.SourceCodeLine = 204; Functions.ProcessLogic( ); __context__.SourceCodeLine = 192; } __context__.SourceCodeLine = 207; if (Functions.TestForTrue((G_BLOGOVERFLOW))) { __context__.SourceCodeLine = 209; FileWrite((short)(IFILEHANDLE), "ERROR: LOG OVERFLOW\r\n", (ushort)(21)); __context__.SourceCodeLine = 210; G_BLOGOVERFLOW = (ushort)(0); } } __context__.SourceCodeLine = 214; FileClose((short)(IFILEHANDLE)); __context__.SourceCodeLine = 216; EndFileOperations( ); __context__.SourceCodeLine = 218; G_INEXTLOGINDEX = (ushort)(1); }
object CONCAT_OnPush_0(Object __EventInfo__) { Crestron.Logos.SplusObjects.SignalEventArgs __SignalEventArg__ = (Crestron.Logos.SplusObjects.SignalEventArgs)__EventInfo__; try { SplusExecutionContext __context__ = SplusThreadStartCode(__SignalEventArg__); short IRESULT = 0; short IFINDRESULT = 0; short IFILEHANDLEWRITE = 0; short IFILEHANDLEREAD = 0; ushort I = 0; ushort POS = 0; CrestronString SREADDATA; SREADDATA = new CrestronString(Crestron.Logos.SplusObjects.CrestronStringEncoding.eEncodingASCII, 300, this); CrestronString SREADFILENAME; CrestronString TYPE; SREADFILENAME = new CrestronString(Crestron.Logos.SplusObjects.CrestronStringEncoding.eEncodingASCII, 100, this); TYPE = new CrestronString(Crestron.Logos.SplusObjects.CrestronStringEncoding.eEncodingASCII, 25, this); FILE_INFO FI; FI = new FILE_INFO(); FI.PopulateDefaults(); ushort IFILECOUNT = 0; uint TEMPFADETIME = 0; uint TEMPOFFTIME = 0; LOAD_SETTING TEMPLOADSETTING; TEMPLOADSETTING = new LOAD_SETTING(this, true); TEMPLOADSETTING.PopulateCustomAttributeList(false); __context__.SourceCodeLine = 42; StartFileOperations( ); __context__.SourceCodeLine = 44; FileDelete(WRITE_FILENAME__DOLLAR__); __context__.SourceCodeLine = 46; IFILEHANDLEWRITE = (short)(FileOpen(WRITE_FILENAME__DOLLAR__, (ushort)((256 | 1) | 16384))); __context__.SourceCodeLine = 48; if (Functions.TestForTrue((Functions.BoolToInt(IFILEHANDLEWRITE >= 0)))) { __context__.SourceCodeLine = 50; IRESULT = (short)(SetCurrentDirectory(READ_PATH__DOLLAR__)); __context__.SourceCodeLine = 52; if (Functions.TestForTrue((Functions.BoolToInt(IRESULT < 0)))) { __context__.SourceCodeLine = 54; RESPONSE_MSG__DOLLAR__.UpdateValue("ERROR\r\n>"); __context__.SourceCodeLine = 55; Functions.TerminateEvent(); } __context__.SourceCodeLine = 58; IFILECOUNT = (ushort)(0); __context__.SourceCodeLine = 60; IFINDRESULT = (short)(FindFirst("BinaryScene_*.dat", ref FI)); __context__.SourceCodeLine = 62; while (Functions.TestForTrue((Functions.Not(IFINDRESULT)))) { __context__.SourceCodeLine = 64; SREADFILENAME.UpdateValue(FI.Name); __context__.SourceCodeLine = 65; IFILEHANDLEREAD = (short)(FileOpen(SREADFILENAME, (ushort)(0 | 32768))); __context__.SourceCodeLine = 66; if (Functions.TestForTrue((Functions.BoolToInt(IFILEHANDLEREAD >= 0)))) { __context__.SourceCodeLine = 69; IFILECOUNT = (ushort)((IFILECOUNT + 1)); __context__.SourceCodeLine = 70; POS = (ushort)((Functions.Find("_", FI.Name, 1) + 1)); __context__.SourceCodeLine = 71; SREADDATA.UpdateValue(Functions.Mid(FI.Name, (int)(POS), (int)(((Functions.Length(FI.Name) - POS) - 3)))); __context__.SourceCodeLine = 72; SREADDATA.UpdateValue("[scene_" + SREADDATA + ".dat]\u000D\u000A"); __context__.SourceCodeLine = 73; FileWrite((short)(IFILEHANDLEWRITE), SREADDATA, (ushort)(Functions.Length(SREADDATA))); __context__.SourceCodeLine = 74; ReadString((short)(IFILEHANDLEREAD), ref SREADDATA); __context__.SourceCodeLine = 75; SREADDATA.UpdateValue("File Version\t" + SREADDATA + "\u000D\u000A"); __context__.SourceCodeLine = 76; FileWrite((short)(IFILEHANDLEWRITE), SREADDATA, (ushort)(Functions.Length(SREADDATA))); __context__.SourceCodeLine = 77; SREADDATA.UpdateValue("Modified Date\t" + Functions.ItoA((int)(FI.iDate)) + "\u000D\u000A"); __context__.SourceCodeLine = 78; FileWrite((short)(IFILEHANDLEWRITE), SREADDATA, (ushort)(Functions.Length(SREADDATA))); __context__.SourceCodeLine = 79; SREADDATA.UpdateValue("Modified Time\t" + Functions.ItoA((int)(FI.iTime)) + "\u000D\u000A"); __context__.SourceCodeLine = 80; FileWrite((short)(IFILEHANDLEWRITE), SREADDATA, (ushort)(Functions.Length(SREADDATA))); __context__.SourceCodeLine = 82; ReadLongInteger((short)(IFILEHANDLEREAD), ref TEMPFADETIME); __context__.SourceCodeLine = 83; SREADDATA.UpdateValue("Scene Fade Time\t" + Functions.LtoA((int)(TEMPFADETIME)) + "\u000D\u000A"); __context__.SourceCodeLine = 84; FileWrite((short)(IFILEHANDLEWRITE), SREADDATA, (ushort)(Functions.Length(SREADDATA))); __context__.SourceCodeLine = 86; ReadLongInteger((short)(IFILEHANDLEREAD), ref TEMPOFFTIME); __context__.SourceCodeLine = 87; SREADDATA.UpdateValue("Scene Off Time\t" + Functions.LtoA((int)(TEMPOFFTIME)) + "\u000D\u000A"); __context__.SourceCodeLine = 88; FileWrite((short)(IFILEHANDLEWRITE), SREADDATA, (ushort)(Functions.Length(SREADDATA))); __context__.SourceCodeLine = 89; SREADDATA.UpdateValue("Load ID\tTarget Level\u000D\u000A"); __context__.SourceCodeLine = 90; FileWrite((short)(IFILEHANDLEWRITE), SREADDATA, (ushort)(Functions.Length(SREADDATA))); __context__.SourceCodeLine = 92; while (Functions.TestForTrue((Functions.Not(FileEOF((short)(IFILEHANDLEREAD)))))) { __context__.SourceCodeLine = 94; ReadStructure((short)(IFILEHANDLEREAD), TEMPLOADSETTING); __context__.SourceCodeLine = 96; if (Functions.TestForTrue((Functions.BoolToInt((Functions.TestForTrue(Functions.BoolToInt(TEMPLOADSETTING.LLEVEL >= 0)) && Functions.TestForTrue(TEMPLOADSETTING.DIMMABLE)))))) { __context__.SourceCodeLine = 98; if (Functions.TestForTrue((Functions.BoolToInt(TEMPLOADSETTING.LOADEXCLUDED == 0)))) { __context__.SourceCodeLine = 99; MakeString(SREADDATA, "{0:d}\t{1:d}\u000D\u000A", (int)TEMPLOADSETTING.LOADID, (int)TEMPLOADSETTING.LLEVEL); } else { __context__.SourceCodeLine = 101; MakeString(SREADDATA, "{0:d}\t{1:d}\txd\u000D\u000A", (int)TEMPLOADSETTING.LOADID, (int)TEMPLOADSETTING.LLEVEL); } } else { __context__.SourceCodeLine = 108; if (Functions.TestForTrue((Functions.BoolToInt(TEMPLOADSETTING.LOADEXCLUDED == 0)))) { __context__.SourceCodeLine = 110; if (Functions.TestForTrue((Functions.BoolToInt((Functions.TestForTrue(Functions.BoolToInt((Functions.TestForTrue(Functions.BoolToInt(TEMPLOADSETTING.LLEVEL == -3)) || Functions.TestForTrue(Functions.BoolToInt(TEMPLOADSETTING.LLEVEL == -4))))) || Functions.TestForTrue(Functions.BoolToInt(TEMPLOADSETTING.DIMMABLE == 0))))))) { __context__.SourceCodeLine = 112; TYPE.UpdateValue("on"); } else { __context__.SourceCodeLine = 114; if (Functions.TestForTrue((Functions.BoolToInt((Functions.TestForTrue(Functions.BoolToInt((Functions.TestForTrue(Functions.BoolToInt(TEMPLOADSETTING.LLEVEL == -3)) || Functions.TestForTrue(Functions.BoolToInt(TEMPLOADSETTING.LLEVEL == -4))))) || Functions.TestForTrue(Functions.BoolToInt(TEMPLOADSETTING.DIMMABLE == 0))))))) { __context__.SourceCodeLine = 116; TYPE.UpdateValue("off"); } } } __context__.SourceCodeLine = 120; if (Functions.TestForTrue((Functions.BoolToInt(TEMPLOADSETTING.LOADEXCLUDED == 1)))) { __context__.SourceCodeLine = 121; MakeString(SREADDATA, "{0:d}\t{1}\txn\u000D\u000A", (int)TEMPLOADSETTING.LOADID, TYPE); } else { __context__.SourceCodeLine = 123; MakeString(SREADDATA, "{0:d}\t{1}\u000D\u000A", (int)TEMPLOADSETTING.LOADID, TYPE); } } __context__.SourceCodeLine = 125; FileWrite((short)(IFILEHANDLEWRITE), SREADDATA, (ushort)(Functions.Length(SREADDATA))); __context__.SourceCodeLine = 92; } __context__.SourceCodeLine = 127; FileWrite((short)(IFILEHANDLEWRITE), "\u000D\u000A", (ushort)(Functions.Length("\u000D\u000A"))); __context__.SourceCodeLine = 128; IRESULT = (short)(FileClose((short)(IFILEHANDLEREAD))); } __context__.SourceCodeLine = 131; IFINDRESULT = (short)(FindNext(ref FI)); __context__.SourceCodeLine = 62; } __context__.SourceCodeLine = 135; IRESULT = (short)(FileClose((short)(IFILEHANDLEWRITE))); __context__.SourceCodeLine = 137; RESPONSE_MSG__DOLLAR__.UpdateValue("OK " + Functions.ItoA((int)(IFILECOUNT)) + "\r\n>"); } else { __context__.SourceCodeLine = 141; RESPONSE_MSG__DOLLAR__.UpdateValue("ERROR\r\n>"); } __context__.SourceCodeLine = 143; EndFileOperations( ); } catch (Exception e) { ObjectCatchHandler(e); } finally { ObjectFinallyHandler(__SignalEventArg__); } return(this); }