public override object FunctionMain(object __obj__) { try { SplusExecutionContext __context__ = SplusFunctionMainStartCode(); __context__.SourceCodeLine = 107; WaitForInitializationComplete( ); __context__.SourceCodeLine = 110; // RegisterEvent( JSON , RETURNITEMVALUE , SIMPLPLUSEVENTHANDLER ) try { g_criticalSection.Enter(); JSON.returnItemValue += SIMPLPLUSEVENTHANDLER; } finally { g_criticalSection.Leave(); } ; __context__.SourceCodeLine = 111; ROOMLISTLENGHTVAR = (ushort)(0); __context__.SourceCodeLine = 112; JSON.Initialize(FILEPATH__DOLLAR__.ToString()); __context__.SourceCodeLine = 113; GETROOMCOUNT(__context__); } catch (Exception e) { ObjectCatchHandler(e); } finally { ObjectFinallyHandler(); } return(__obj__); }
public override object FunctionMain(object __obj__) { try { SplusExecutionContext __context__ = SplusFunctionMainStartCode(); __context__.SourceCodeLine = 194; WaitForInitializationComplete( ); __context__.SourceCodeLine = 195; // RegisterEvent( MYROOM , ROOMONOFFUPDATE , MYONOFFHANDLER ) try { g_criticalSection.Enter(); MYROOM.RoomOnOffUpdate += MYONOFFHANDLER; } finally { g_criticalSection.Leave(); } ; __context__.SourceCodeLine = 196; // RegisterEvent( MYROOM , ROOMBRIUPDATE , MYBRIHANDLER ) try { g_criticalSection.Enter(); MYROOM.RoomBriUpdate += MYBRIHANDLER; } finally { g_criticalSection.Leave(); } ; __context__.SourceCodeLine = 197; // RegisterEvent( MYROOM , ROOMHUEUPDATE , MYHUEHANDLER ) try { g_criticalSection.Enter(); MYROOM.RoomHueUpdate += MYHUEHANDLER; } finally { g_criticalSection.Leave(); } ; __context__.SourceCodeLine = 198; // RegisterEvent( MYROOM , ROOMSATUPDATE , MYSATHANDLER ) try { g_criticalSection.Enter(); MYROOM.RoomSatUpdate += MYSATHANDLER; } finally { g_criticalSection.Leave(); } ; __context__.SourceCodeLine = 199; // RegisterEvent( MYROOM , ROOMUPDATE , MYROOMHANDLER ) try { g_criticalSection.Enter(); MYROOM.RoomUpdate += MYROOMHANDLER; } finally { g_criticalSection.Leave(); } ; __context__.SourceCodeLine = 200; // RegisterEvent( MYROOM , ROOMONLINEUPDATE , MYONLINEHANDLER ) try { g_criticalSection.Enter(); MYROOM.RoomOnlineUpdate += MYONLINEHANDLER; } finally { g_criticalSection.Leave(); } ; } catch (Exception e) { ObjectCatchHandler(e); } finally { ObjectFinallyHandler(); } return(__obj__); }
public override object FunctionMain(object __obj__) { try { SplusExecutionContext __context__ = SplusFunctionMainStartCode(); __context__.SourceCodeLine = 139; WaitForInitializationComplete( ); __context__.SourceCodeLine = 140; // RegisterEvent( MYLIGHT , BULBONOFFUPDATE , MYONOFFHANDLER ) try { g_criticalSection.Enter(); MYLIGHT.BulbOnOffUpdate += MYONOFFHANDLER; } finally { g_criticalSection.Leave(); } ; __context__.SourceCodeLine = 141; // RegisterEvent( MYLIGHT , BULBBRIUPDATE , MYBRIHANDLER ) try { g_criticalSection.Enter(); MYLIGHT.BulbBriUpdate += MYBRIHANDLER; } finally { g_criticalSection.Leave(); } ; __context__.SourceCodeLine = 142; // RegisterEvent( MYLIGHT , BULBHUEUPDATE , MYHUEHANDLER ) try { g_criticalSection.Enter(); MYLIGHT.BulbHueUpdate += MYHUEHANDLER; } finally { g_criticalSection.Leave(); } ; __context__.SourceCodeLine = 143; // RegisterEvent( MYLIGHT , BULBSATUPDATE , MYSATHANDLER ) try { g_criticalSection.Enter(); MYLIGHT.BulbSatUpdate += MYSATHANDLER; } finally { g_criticalSection.Leave(); } ; __context__.SourceCodeLine = 144; // RegisterEvent( MYLIGHT , BULBONLINEUPDATE , MYONLINEHANDLER ) try { g_criticalSection.Enter(); MYLIGHT.BulbOnlineUpdate += MYONLINEHANDLER; } finally { g_criticalSection.Leave(); } ; __context__.SourceCodeLine = 145; // RegisterEvent( MYLIGHT , BULBUPDATE , MYLIGHTHANDLER ) try { g_criticalSection.Enter(); MYLIGHT.BulbUpdate += MYLIGHTHANDLER; } finally { g_criticalSection.Leave(); } ; } catch (Exception e) { ObjectCatchHandler(e); } finally { ObjectFinallyHandler(); } return(__obj__); }
internal void Dial(string number, CodecCommandArg[] args, DialResult callback) { #if DEBUG Debug.WriteInfo("Codec Dial", "Checking Capabilities"); Debug.WriteInfo(" MaxCalls", "{0}", _codec.Capabilities.Conference.MaxCalls); Debug.WriteInfo(" MaxActiveCalls", "{0}", _codec.Capabilities.Conference.MaxActiveCalls); Debug.WriteInfo(" MaxAudioCalls", "{0}", _codec.Capabilities.Conference.MaxAudioCalls); Debug.WriteInfo(" MaxVideoCalls", "{0}", _codec.Capabilities.Conference.MaxVideoCalls); Debug.WriteInfo(" NumberOfActiveCalls", "{0}", _codec.SystemUnit.State.NumberOfActiveCalls); Debug.WriteInfo(" NumberOfSuspendedCalls", "{0}", _codec.SystemUnit.State.NumberOfSuspendedCalls); Debug.WriteInfo(" TotalNumberOfCalls", "{0}", _codec.SystemUnit.State.TotalNumberOfCalls); #endif var numberOfConnectedVideoCalls = this.Count(c => c.Connected && c.CallType == CallType.Video); var shouldHoldACall = (_codec.SystemUnit.State.NumberOfActiveCalls > 0 && _codec.SystemUnit.State.NumberOfActiveCalls == _codec.Capabilities.Conference.MaxActiveCalls) || (numberOfConnectedVideoCalls > 0 && numberOfConnectedVideoCalls == _codec.Capabilities.Conference.MaxVideoCalls); if (shouldHoldACall) { #if DEBUG Debug.WriteWarn("Codec needs to hold another call before calling!"); #endif try { var lastConnectedCall = _codec.Calls.LastOrDefault(c => c.Connected); if (lastConnectedCall != null) { lastConnectedCall.Hold(); } } catch (Exception e) { CloudLog.Exception(e); } } var cmd = new CodecCommand("", "Dial"); cmd.Args.Add("Number", number); cmd.Args.Add(args); var requestId = _codec.SendCommandAsync(cmd, (id, ok, result) => { var callBackInfo = _dialCallbacks[id]; _dialCallbacksLock.Enter(); _dialCallbacks.Remove(id); _dialCallbacksLock.Leave(); Debug.WriteInfo("Dial Result Callback", "Request {0}, OK = {1}\r\n{2}", id, ok, result); if (ok) { var callId = int.Parse(result.Element("CallId").Value); Debug.WriteSuccess("Dial Result OK, call {0}", callId); callBackInfo.CallBack(0, "OK", callId); return; } try { var cause = int.Parse(result.Element("Cause").Value); var message = result.Element("Description").Value; Debug.WriteError("Dial Failed, Error {0} - {1}", cause, message); callBackInfo.CallBack(cause, message, 0); } catch { Debug.WriteError("Dial Result", result != null ? result.ToString(SaveOptions.DisableFormatting) : "Unknown Error"); } }); var info = new DialCallBackInfo() { NumberDialed = number, CallBack = callback }; _dialCallbacksLock.Enter(); _dialCallbacks[requestId] = info; _dialCallbacksLock.Leave(); }
object INIT_OnPush_0(Object __EventInfo__) { Crestron.Logos.SplusObjects.SignalEventArgs __SignalEventArg__ = (Crestron.Logos.SplusObjects.SignalEventArgs)__EventInfo__; try { SplusExecutionContext __context__ = SplusThreadStartCode(__SignalEventArg__); __context__.SourceCodeLine = 134; if (Functions.TestForTrue((Functions.BoolToInt(GetSymbolReferenceName() == "DEBUG")))) { __context__.SourceCodeLine = 134; MYBRIDGE.DebugOn = (ushort)(1); } __context__.SourceCodeLine = 135; MYBRIDGE.SymbolName = ("P" + Functions.ItoA((int)(GetProgramNumber())) + ":" + GetSymbolInstanceName( )).ToString(); __context__.SourceCodeLine = 136; MYBRIDGE.SymbolFileName = (FILE_NAME).ToString(); __context__.SourceCodeLine = 137; MYBRIDGE.FriendlyId = (ushort)(AV_RECEIVER_NUMBER.Value); __context__.SourceCodeLine = 138; MYBRIDGE.NumInputs = (ushort)(NUMBER_OF_INPUTS.Value); __context__.SourceCodeLine = 139; MYBRIDGE.AccessLevel = (ushort)(ACCESS_LEVEL.Value); __context__.SourceCodeLine = 140; MYBRIDGE.FriendlyName = (AV_RECEIVER_NAME + Functions.ItoA((int)(AV_RECEIVER_NUMBER.Value))).ToString(); __context__.SourceCodeLine = 141; MYBRIDGE.ReadAtBootup = (READ_AT_BOOTUP).ToString(); __context__.SourceCodeLine = 143; MYBRIDGE.NumDigitals = (ushort)(32); __context__.SourceCodeLine = 144; MYBRIDGE.NumAnalogs = (ushort)(32); __context__.SourceCodeLine = 146; // RegisterEvent( MYBRIDGE , ONREFRESHINPUTSEVENT , HANDLEREFRESHCHANGE ) try { g_criticalSection.Enter(); MYBRIDGE.OnRefreshInputsEvent += HANDLEREFRESHCHANGE; } finally { g_criticalSection.Leave(); } ; __context__.SourceCodeLine = 148; // RegisterEvent( MYBRIDGE , ONBUSYEVENT , HANDLEBUSYEVENT ) try { g_criticalSection.Enter(); MYBRIDGE.OnBusyEvent += HANDLEBUSYEVENT; } finally { g_criticalSection.Leave(); } ; __context__.SourceCodeLine = 150; // RegisterEvent( MYBRIDGE , ONDIGITALOUTPUTCHANGE , HANDLEDIGITALOUTPUT ) try { g_criticalSection.Enter(); MYBRIDGE.OnDigitalOutputChange += HANDLEDIGITALOUTPUT; } finally { g_criticalSection.Leave(); } ; __context__.SourceCodeLine = 151; // RegisterEvent( MYBRIDGE , ONANALOGOUTPUTCHANGE , HANDLEANALOGOUTPUT ) try { g_criticalSection.Enter(); MYBRIDGE.OnAnalogOutputChange += HANDLEANALOGOUTPUT; } finally { g_criticalSection.Leave(); } ; __context__.SourceCodeLine = 153; // RegisterEvent( MYBRIDGE , SETZONEONCONTROLCHANGE , HANDLEPOWERONCONTROL ) try { g_criticalSection.Enter(); MYBRIDGE.SetZoneOnControlChange += HANDLEPOWERONCONTROL; } finally { g_criticalSection.Leave(); } ; __context__.SourceCodeLine = 154; // RegisterEvent( MYBRIDGE , SETZONEOFFCONTROLCHANGE , HANDLEPOWEROFFCONTROL ) try { g_criticalSection.Enter(); MYBRIDGE.SetZoneOffControlChange += HANDLEPOWEROFFCONTROL; } finally { g_criticalSection.Leave(); } ; __context__.SourceCodeLine = 155; // RegisterEvent( MYBRIDGE , SETZONETOGGLECONTROLCHANGE , HANDLEPOWERTOGGLECONTROL ) try { g_criticalSection.Enter(); MYBRIDGE.SetZoneToggleControlChange += HANDLEPOWERTOGGLECONTROL; } finally { g_criticalSection.Leave(); } ; __context__.SourceCodeLine = 156; // RegisterEvent( MYBRIDGE , SETVOLUMEVALUECONTROLCHANGE , HANDLEVOLUMEVALUECONTROL ) try { g_criticalSection.Enter(); MYBRIDGE.SetVolumeValueControlChange += HANDLEVOLUMEVALUECONTROL; } finally { g_criticalSection.Leave(); } ; __context__.SourceCodeLine = 157; // RegisterEvent( MYBRIDGE , SETSOURCECONTROLCHANGE , HANDLEINPUTVALUECONTROL ) try { g_criticalSection.Enter(); MYBRIDGE.SetSourceControlChange += HANDLEINPUTVALUECONTROL; } finally { g_criticalSection.Leave(); } ; __context__.SourceCodeLine = 158; // RegisterEvent( MYBRIDGE , SETVOLUMEUPCONTROLCHANGE , HANDLEVOLUMEUPCONTROL ) try { g_criticalSection.Enter(); MYBRIDGE.SetVolumeUpControlChange += HANDLEVOLUMEUPCONTROL; } finally { g_criticalSection.Leave(); } ; __context__.SourceCodeLine = 159; // RegisterEvent( MYBRIDGE , SETVOLUMEDOWNCONTROLCHANGE , HANDLEVOLUMEDOWNCONTROL ) try { g_criticalSection.Enter(); MYBRIDGE.SetVolumeDownControlChange += HANDLEVOLUMEDOWNCONTROL; } finally { g_criticalSection.Leave(); } ; __context__.SourceCodeLine = 160; // RegisterEvent( MYBRIDGE , SETMUTEONCONTROLCHANGE , HANDLEMUTEONCONTROL ) try { g_criticalSection.Enter(); MYBRIDGE.SetMuteOnControlChange += HANDLEMUTEONCONTROL; } finally { g_criticalSection.Leave(); } ; __context__.SourceCodeLine = 161; // RegisterEvent( MYBRIDGE , SETMUTEOFFCONTROLCHANGE , HANDLEMUTEOFFCONTROL ) try { g_criticalSection.Enter(); MYBRIDGE.SetMuteOffControlChange += HANDLEMUTEOFFCONTROL; } finally { g_criticalSection.Leave(); } ; __context__.SourceCodeLine = 162; // RegisterEvent( MYBRIDGE , SETMUTETOGGLECONTROLCHANGE , HANDLEMUTETOGGLECONTROL ) try { g_criticalSection.Enter(); MYBRIDGE.SetMuteToggleControlChange += HANDLEMUTETOGGLECONTROL; } finally { g_criticalSection.Leave(); } ; __context__.SourceCodeLine = 164; // RegisterEvent( MYBRIDGE , SETCOMMANDSTRINGCHANGE , HANDLECOMMANDSTRINGCHANGE ) try { g_criticalSection.Enter(); MYBRIDGE.SetCommandStringChange += HANDLECOMMANDSTRINGCHANGE; } finally { g_criticalSection.Leave(); } ; __context__.SourceCodeLine = 165; // RegisterEvent( MYBRIDGE , SETSENDPACKETTXCHANGE , HANDLEPACKETTXCHANGE ) try { g_criticalSection.Enter(); MYBRIDGE.SetSendPacketTxChange += HANDLEPACKETTXCHANGE; } finally { g_criticalSection.Leave(); } ; __context__.SourceCodeLine = 167; MYBRIDGE.RegisterWithCore( ); } catch (Exception e) { ObjectCatchHandler(e); } finally { ObjectFinallyHandler(__SignalEventArg__); } return(this); }
public static ushort ReadFile() { ErrorLog.Notice(String.Format("Checking For SmartThings Credentials File")); bool success = false; int isRead = 0; FileStream myFS = null; XmlReader myXMLReader = null; myCC.Enter(); // Will not finish, until you have the Critical Section try { //Check if the File Exists if (!Crestron.SimplSharp.CrestronIO.File.Exists(String.Format("\\NVRAM\\{0}\\SmartThings\\Credentials.xml", InitialParametersClass.ProgramIDTag))) { ErrorLog.Error(String.Format("SmartThings Credentials File Not Found\n")); ErrorLog.Error("Please Re Run the Authentication Sequence"); isRead = 1; } //File was Found, Now Read It. if (isRead == 0) { myFS = new FileStream(String.Format("\\NVRAM\\{0}\\SmartThings\\Credentials.xml", InitialParametersClass.ProgramIDTag), FileMode.Open); myXMLReader = new XmlReader(myFS); myXMLReader.Read(); while (!myXMLReader.EOF) { if (myXMLReader.NodeType == XmlNodeType.Element) { switch (myXMLReader.Name.ToUpper()) { case "CLIENTID": { string sTemp = myXMLReader.ReadElementContentAsString(); if (SmartThingsReceiver.ClientID != sTemp) { ErrorLog.Error("SmartThings Credential File Does Not Match the Client ID provided in the Program!"); ErrorLog.Error("Please Re Run the Authentication Sequence"); ErrorLog.Notice("Module = {0}, File = {1}", ClientID, sTemp); break; } else { break; } } case "AUTHCODE": { SmartThingsReceiver.AuthCode = myXMLReader.ReadElementContentAsString(); break; } case "ACCESSTOKEN": { SmartThingsReceiver.AccessToken = myXMLReader.ReadElementContentAsString(); break; } case "INSTALLATIONURL": { SmartThingsReceiver.InstallationURL = myXMLReader.ReadElementContentAsString(); break; } default: { myXMLReader.Read(); break; } } } else { myXMLReader.Read(); } } success = true; Authorized = 1; } else { success = true; } } catch (Exception e) { //Crestron.SimplSharp.ErrorLog.Error(String.Format("ReadFile Error: {0}\n", e.Message)); success = false; } finally { if (myXMLReader != null) { myXMLReader.Close(); } if (myFS != null) { myFS.Close(); } myCC.Leave(); } if (success) { return(1); } else { return(0); } }
/// <summary> /// Aquire a lock and return the LockToken when the lock is aquired. /// </summary> /// <returns>LockToken object</returns> public LockToken AquireLock() { _criticalSection.Enter(); return(new LockToken(this)); }
public override object FunctionMain(object __obj__) { ushort I = 0; try { SplusExecutionContext __context__ = SplusFunctionMainStartCode(); __context__.SourceCodeLine = 177; // RegisterEvent( SP , ONSPACEACTION , HANDLESPACEACTION ) try { g_criticalSection.Enter(); SP.OnSpaceAction += HANDLESPACEACTION; } finally { g_criticalSection.Leave(); } ; __context__.SourceCodeLine = 178; SP.RegisterSceneName((ushort)(0), SCENENAME0.ToString()); __context__.SourceCodeLine = 179; ushort __FN_FORSTART_VAL__1 = (ushort)(1); ushort __FN_FOREND_VAL__1 = (ushort)10; 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 = 180; SP.RegisterSceneName((ushort)(I), SCENENAME[I].ToString()); __context__.SourceCodeLine = 179; } __context__.SourceCodeLine = 181; SP.UpdateSupportedActions((ushort)(SUPPORTSKEYPADACTIONS.Value), (ushort)(SUPPORTSOCCUPANCYACTIONS.Value), (ushort)(SUPPORTSPHOTOCELLACTIONS.Value)); __context__.SourceCodeLine = 182; ushort __FN_FORSTART_VAL__2 = (ushort)(1); ushort __FN_FOREND_VAL__2 = (ushort)50; int __FN_FORSTEP_VAL__2 = (int)1; for (I = __FN_FORSTART_VAL__2; (__FN_FORSTEP_VAL__2 > 0) ? ((I >= __FN_FORSTART_VAL__2) && (I <= __FN_FOREND_VAL__2)) : ((I <= __FN_FORSTART_VAL__2) && (I >= __FN_FOREND_VAL__2)); I += (ushort)__FN_FORSTEP_VAL__2) { __context__.SourceCodeLine = 183; if (Functions.TestForTrue((IsSignalDefined(LOCALACTION[I])))) { __context__.SourceCodeLine = 184; SP.RegisterDiscreteAction((ushort)(I), LOCALACTIONNAME[I].ToString()); } __context__.SourceCodeLine = 182; } __context__.SourceCodeLine = 185; WaitForInitializationComplete( ); __context__.SourceCodeLine = 186; if (Functions.TestForTrue((Functions.BoolToInt((Functions.TestForTrue(Functions.BoolToInt((Functions.TestForTrue(Functions.Not(IsSignalDefined(SPACEID_OVERRIDE))) && Functions.TestForTrue(Functions.Not(IsSignalDefined(SPACENAME_OVERRIDE)))))) && Functions.TestForTrue(REGISTERSPACE.Value)))))) { __context__.SourceCodeLine = 187; _SPACEID.UpdateValue(SPACEID); __context__.SourceCodeLine = 188; _SPACENAME.UpdateValue(SPACENAME); __context__.SourceCodeLine = 189; REGISTER(__context__); } __context__.SourceCodeLine = 191; STARTED = (ushort)(1); } catch (Exception e) { ObjectCatchHandler(e); } finally { ObjectFinallyHandler(); } return(__obj__); }
/// <summary> /// This Method Will Retrieve all pushes since x. /// </summary> /// <returns></returns> public ushort getPush() { string commandstring = ""; if (Access_Code != "") { HttpsClient client = new HttpsClient(); client.PeerVerification = false; client.HostVerification = false; client.Verbose = false; HttpsClientRequest request = new HttpsClientRequest(); HttpsClientResponse response; String url = "https://api.pushbullet.com/v2/pushes"; try { myCC.Enter(); // Will not finish, until you have the Critical Section request.KeepAlive = true; request.Url.Parse(url); request.RequestType = Crestron.SimplSharp.Net.Https.RequestType.Get; request.Header.SetHeaderValue("Content-Type", "application/json"); request.Header.SetHeaderValue("Authorization", "Bearer " + Access_Code); request.ContentString = commandstring; // Dispatch will actually make the request with the server response = client.Dispatch(request); client.Abort(); if (response.Code >= 200 && response.Code < 300) { string s = response.ContentString.ToString(); //ErrorLog.Notice(s + "\n"); string[] words = s.Split(','); string PushIden = ""; string PushTitle = ""; string PushMessage = ""; bool PushUnread = true; bool SentMessage = false; foreach (string word in words) { //ErrorLog.Notice(word + "\n"); if (word.Contains("\"iden\"")) { PushIden = word.Substring(8, word.Length - 9); } if (word.Contains("title")) { PushTitle = word.Substring(9, word.Length - 10); if (PushTitle.Contains("\"")) { PushTitle.Substring(0, PushTitle.Length - 1); } } if (word.Contains("body")) { if (word.Contains("}")) { PushMessage = word.Substring(8, word.Length - 10); } else { PushMessage = word.Substring(8, word.Length - 9); if (PushMessage.Contains("\"")) { PushMessage.Substring(0, PushMessage.Length - 1); } } } if (word.Contains("dismissed")) { if (word.Contains("true")) { PushUnread = false; continue; } } if (word.Contains("sender_email") && word.Contains(Sender_Email)) { SentMessage = true; } if (word.Contains("}")) { //TODO Trigger Event To Output String to S+ if (PushTitle != "" || PushMessage != "") { if (PushUnread == true) { if (SentMessage != true) { PushReceived("CMD=" + PushTitle + "." + PushMessage + ";"); } ushort result = dismissPush(PushIden); } } PushIden = ""; PushTitle = ""; PushMessage = ""; PushUnread = false; } } //ErrorLog.Notice(response.ContentString.ToString()); // A response code between 200 and 300 means it was successful. return(1); } else { ErrorLog.Notice("Response Code = " + response.Code.ToString() + "\n"); // A reponse code outside this range means the server threw an error. return(0); } } catch (Exception e) { ErrorLog.Error("Exception in Pushbullet - GetInfo: " + e.ToString()); return(0); } finally { myCC.Leave(); } } else { return(0); } }
private object SystemThreadProcess(object userSpecific) { try { while (true) { if (_userPrompts.Count == 0) { _systemWait.Wait(2000); } if (_programStopping) { return(null); } if (_userPrompts.Count == 0) { goto CheckTimers; } try { var prompts = _userPrompts.ToArray(); // We have queued prompts that aren't showing as current system prompts if (prompts.Any(p => p.State == PromptState.Queued) && !prompts.Any(p => p.State == PromptState.Shown && p.Room == null)) { //Debug.WriteInfo("Prompts queued! System {0}, Room {1}", // _userPrompts.Count(p => p.State == PromptState.Queued && p.Room == null), // _userPrompts.Count(p => p.State == PromptState.Queued && p.Room != null)); // Look for any system prompts (not specific to a room) var prompt = prompts.FirstOrDefault(p => p.State == PromptState.Queued && p.Room == null); if (prompt != null) { var roomPrompts = prompts.Where(p => p.State == PromptState.Shown && p.Room != null); // Close any active room prompts and reset to queue as system will override var pArray = roomPrompts as UserPrompt[] ?? roomPrompts.ToArray(); foreach (var roomPrompt in pArray) { roomPrompt.State = PromptState.Queued; } if (pArray.Any()) { Thread.Sleep(200); } prompt.State = PromptState.Shown; //Debug.WriteInfo("Showing system prompt on all UIs!"); foreach (var uiController in UIControllers) { uiController.ShowPrompt(prompt); } } else { // No system prompts to show so we can show any room prompts foreach (var room in Rooms) { var room1 = room; // Already showing a prompt in this room ... skip the room if (_userPrompts.Any(p => p.State == PromptState.Shown && p.Room == room1)) { continue; } prompt = prompts.FirstOrDefault( p => p.State == PromptState.Queued && p.Room == room1); if (prompt != null && prompt.State != PromptState.Cancelled) { prompt.State = PromptState.Shown; foreach (var uiController in UIControllers.ForRoom(room1)) { uiController.ShowPrompt(prompt); } } } } } //if (prompts.Length > 0) // Debug.WriteInfo("Removing {0} expired prompts", prompts.Length); foreach (var userPrompt in prompts.Where(p => p.State != PromptState.Queued && p.State != PromptState.Shown)) { _userPromptsLock.Enter(); _userPrompts.Remove(userPrompt); _userPromptsLock.Leave(); } } catch (Exception e) { CloudLog.Exception(e); Thread.Sleep(1000); } CheckTimers: if (!Booted) { continue; } if (SecondsSinceLastSystemTimerCallback > 10 && !_timersBrokenFlag) { _timersBrokenFlag = true; CloudLog.Error( "System Timer last checked in {0} seconds ago. Will reboot processor in 10 minutes if not fixed!!", SecondsSinceLastSystemTimerCallback); } else if (SecondsSinceLastSystemTimerCallback > 600 && _timersBrokenFlag) { CloudLog.Error("Automatic reboot now!"); var response = string.Empty; CrestronConsole.SendControlSystemCommand("REBOOT", ref response); } else if (_timersBrokenFlag && SecondsSinceLastSystemTimerCallback < 10) { _timersBrokenFlag = false; CloudLog.Warn("System Timer checked in {0} seconds ago after a delay", SecondsSinceLastSystemTimerCallback); } CrestronEnvironment.AllowOtherAppsToRun(); } } catch (Exception e) { CloudLog.Exception(e, "Unhandled Exception in SystemThreadProcess()!"); return(null); } }
object INIT_OnPush_0(Object __EventInfo__) { Crestron.Logos.SplusObjects.SignalEventArgs __SignalEventArg__ = (Crestron.Logos.SplusObjects.SignalEventArgs)__EventInfo__; try { SplusExecutionContext __context__ = SplusThreadStartCode(__SignalEventArg__); ushort I = 0; __context__.SourceCodeLine = 126; if (Functions.TestForTrue((Functions.BoolToInt(GetSymbolReferenceName() == "DEBUG")))) { __context__.SourceCodeLine = 126; MYBRIDGE.DebugOn = (ushort)(1); } __context__.SourceCodeLine = 127; MYBRIDGE.SymbolName = ("P" + Functions.ItoA((int)(GetProgramNumber())) + ":" + GetSymbolInstanceName( )).ToString(); __context__.SourceCodeLine = 128; MYBRIDGE.FriendlyId = (ushort)(DEVICE_ID.Value); __context__.SourceCodeLine = 129; MYBRIDGE.FriendlyName = (DEVICE_NAME + Functions.ItoA((int)(DEVICE_ID.Value))).ToString(); __context__.SourceCodeLine = 130; MYBRIDGE.AccessLevel = (ushort)(ACCESS_LEVEL.Value); __context__.SourceCodeLine = 131; MYBRIDGE.ReadAtBootup = (READ_AT_BOOTUP).ToString(); __context__.SourceCodeLine = 132; MYBRIDGE.HandheldPageNum = (ushort)(HANDHELD_PAGE_TYPE.Value); __context__.SourceCodeLine = 133; MYBRIDGE.NumDefaultButtonLabels = (ushort)(DEFAULT_NUM_BUTTON_LABELS.Value); __context__.SourceCodeLine = 134; MYBRIDGE.NumDefaultListLabels = (ushort)(DEFAULT_NUM_LIST_LABELS.Value); __context__.SourceCodeLine = 136; MYBRIDGE.NumListDigitals = (ushort)(50); __context__.SourceCodeLine = 137; MYBRIDGE.NumListAnalogs = (ushort)(50); __context__.SourceCodeLine = 138; MYBRIDGE.NumListSerials = (ushort)(50); __context__.SourceCodeLine = 140; // RegisterEvent( MYBRIDGE , ONREFRESHINPUTSEVENT , HANDLEREFRESHCHANGE ) try { g_criticalSection.Enter(); MYBRIDGE.OnRefreshInputsEvent += HANDLEREFRESHCHANGE; } finally { g_criticalSection.Leave(); } ; __context__.SourceCodeLine = 142; // RegisterEvent( MYBRIDGE , ONDIGITALOUTPUTCHANGE , HANDLEDIGITALOUTPUT ) try { g_criticalSection.Enter(); MYBRIDGE.OnDigitalOutputChange += HANDLEDIGITALOUTPUT; } finally { g_criticalSection.Leave(); } ; __context__.SourceCodeLine = 143; // RegisterEvent( MYBRIDGE , ONANALOGOUTPUTCHANGE , HANDLEANALOGOUTPUT ) try { g_criticalSection.Enter(); MYBRIDGE.OnAnalogOutputChange += HANDLEANALOGOUTPUT; } finally { g_criticalSection.Leave(); } ; __context__.SourceCodeLine = 144; // RegisterEvent( MYBRIDGE , ONSERIALOUTPUTCHANGE , HANDLESERIALOUTPUT ) try { g_criticalSection.Enter(); MYBRIDGE.OnSerialOutputChange += HANDLESERIALOUTPUT; } finally { g_criticalSection.Leave(); } ; __context__.SourceCodeLine = 146; // RegisterEvent( MYBRIDGE , SETLISTDIGITALCONTROLCHANGE , HANDLELISTDIGITALCONTROLCHANGE ) try { g_criticalSection.Enter(); MYBRIDGE.SetListDigitalControlChange += HANDLELISTDIGITALCONTROLCHANGE; } finally { g_criticalSection.Leave(); } ; __context__.SourceCodeLine = 148; // RegisterEvent( MYBRIDGE , SETINUSECHANGE , HANDLEINUSECHANGE ) try { g_criticalSection.Enter(); MYBRIDGE.SetInUseChange += HANDLEINUSECHANGE; } finally { g_criticalSection.Leave(); } ; __context__.SourceCodeLine = 150; ushort __FN_FORSTART_VAL__1 = (ushort)(300); ushort __FN_FOREND_VAL__1 = (ushort)1; int __FN_FORSTEP_VAL__1 = (int)Functions.ToLongInteger(-(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 = 152; if (Functions.TestForTrue((IsSignalDefined(D_IN[I])))) { __context__.SourceCodeLine = 154; GINUMDIGITALS = (ushort)(I); __context__.SourceCodeLine = 155; break; } __context__.SourceCodeLine = 150; } __context__.SourceCodeLine = 159; ushort __FN_FORSTART_VAL__2 = (ushort)(100); ushort __FN_FOREND_VAL__2 = (ushort)1; int __FN_FORSTEP_VAL__2 = (int)Functions.ToLongInteger(-(1)); for (I = __FN_FORSTART_VAL__2; (__FN_FORSTEP_VAL__2 > 0) ? ((I >= __FN_FORSTART_VAL__2) && (I <= __FN_FOREND_VAL__2)) : ((I <= __FN_FORSTART_VAL__2) && (I >= __FN_FOREND_VAL__2)); I += (ushort)__FN_FORSTEP_VAL__2) { __context__.SourceCodeLine = 161; if (Functions.TestForTrue((IsSignalDefined(A_IN[I])))) { __context__.SourceCodeLine = 163; GINUMANALOGS = (ushort)(I); __context__.SourceCodeLine = 164; break; } __context__.SourceCodeLine = 159; } __context__.SourceCodeLine = 168; ushort __FN_FORSTART_VAL__3 = (ushort)(100); ushort __FN_FOREND_VAL__3 = (ushort)1; int __FN_FORSTEP_VAL__3 = (int)Functions.ToLongInteger(-(1)); for (I = __FN_FORSTART_VAL__3; (__FN_FORSTEP_VAL__3 > 0) ? ((I >= __FN_FORSTART_VAL__3) && (I <= __FN_FOREND_VAL__3)) : ((I <= __FN_FORSTART_VAL__3) && (I >= __FN_FOREND_VAL__3)); I += (ushort)__FN_FORSTEP_VAL__3) { __context__.SourceCodeLine = 170; if (Functions.TestForTrue((IsSignalDefined(S_IN[I])))) { __context__.SourceCodeLine = 172; GINUMSERIALS = (ushort)(I); __context__.SourceCodeLine = 173; break; } __context__.SourceCodeLine = 168; } __context__.SourceCodeLine = 177; MYBRIDGE.NumDigitals = (ushort)(GINUMDIGITALS); __context__.SourceCodeLine = 178; MYBRIDGE.NumAnalogs = (ushort)(GINUMANALOGS); __context__.SourceCodeLine = 179; MYBRIDGE.NumSerials = (ushort)(GINUMSERIALS); __context__.SourceCodeLine = 181; MYBRIDGE.RegisterWithCore( ); } catch (Exception e) { ObjectCatchHandler(e); } finally { ObjectFinallyHandler(__SignalEventArg__); } return(this); }
object INIT_OnPush_0(Object __EventInfo__) { Crestron.Logos.SplusObjects.SignalEventArgs __SignalEventArg__ = (Crestron.Logos.SplusObjects.SignalEventArgs)__EventInfo__; try { SplusExecutionContext __context__ = SplusThreadStartCode(__SignalEventArg__); ushort I = 0; __context__.SourceCodeLine = 121; if (Functions.TestForTrue((Functions.BoolToInt(GetSymbolReferenceName() == "DEBUG")))) { __context__.SourceCodeLine = 121; MYBRIDGE.DebugOn = (ushort)(1); } __context__.SourceCodeLine = 122; MYBRIDGE.SymbolName = ("P" + Functions.ItoA((int)(GetProgramNumber())) + ":" + GetSymbolInstanceName( )).ToString(); __context__.SourceCodeLine = 123; MYBRIDGE.FriendlyId = (ushort)(SYSTEM_ID.Value); __context__.SourceCodeLine = 124; MYBRIDGE.FriendlyName = (SYSTEM_NAME).ToString(); __context__.SourceCodeLine = 125; MYBRIDGE.NumZones = (ushort)(NUMBER_OF_ZONES.Value); __context__.SourceCodeLine = 126; MYBRIDGE.AccessLevel = (ushort)(ACCESS_LEVEL.Value); __context__.SourceCodeLine = 127; MYBRIDGE.ReadAtBootup = (READ_AT_BOOTUP).ToString(); __context__.SourceCodeLine = 129; MYBRIDGE.NumListDigitals = (ushort)(50); __context__.SourceCodeLine = 130; MYBRIDGE.NumListAnalogs = (ushort)(50); __context__.SourceCodeLine = 131; MYBRIDGE.NumListSerials = (ushort)(50); __context__.SourceCodeLine = 133; // RegisterEvent( MYBRIDGE , ONREFRESHINPUTSEVENT , HANDLEREFRESHCHANGE ) try { g_criticalSection.Enter(); MYBRIDGE.OnRefreshInputsEvent += HANDLEREFRESHCHANGE; } finally { g_criticalSection.Leave(); } ; __context__.SourceCodeLine = 135; // RegisterEvent( MYBRIDGE , ONDIGITALOUTPUTCHANGE , HANDLEDIGITALOUTPUT ) try { g_criticalSection.Enter(); MYBRIDGE.OnDigitalOutputChange += HANDLEDIGITALOUTPUT; } finally { g_criticalSection.Leave(); } ; __context__.SourceCodeLine = 136; // RegisterEvent( MYBRIDGE , ONANALOGOUTPUTCHANGE , HANDLEANALOGOUTPUT ) try { g_criticalSection.Enter(); MYBRIDGE.OnAnalogOutputChange += HANDLEANALOGOUTPUT; } finally { g_criticalSection.Leave(); } ; __context__.SourceCodeLine = 137; // RegisterEvent( MYBRIDGE , ONSERIALOUTPUTCHANGE , HANDLESERIALOUTPUT ) try { g_criticalSection.Enter(); MYBRIDGE.OnSerialOutputChange += HANDLESERIALOUTPUT; } finally { g_criticalSection.Leave(); } ; __context__.SourceCodeLine = 139; // RegisterEvent( MYBRIDGE , SETLISTDIGITALCONTROLCHANGE , HANDLELISTDIGITALCONTROLCHANGE ) try { g_criticalSection.Enter(); MYBRIDGE.SetListDigitalControlChange += HANDLELISTDIGITALCONTROLCHANGE; } finally { g_criticalSection.Leave(); } ; __context__.SourceCodeLine = 141; // RegisterEvent( MYBRIDGE , SETINUSECHANGE , HANDLEINUSECHANGE ) try { g_criticalSection.Enter(); MYBRIDGE.SetInUseChange += HANDLEINUSECHANGE; } finally { g_criticalSection.Leave(); } ; __context__.SourceCodeLine = 143; ushort __FN_FORSTART_VAL__1 = (ushort)(300); ushort __FN_FOREND_VAL__1 = (ushort)1; int __FN_FORSTEP_VAL__1 = (int)Functions.ToLongInteger(-(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 = 145; if (Functions.TestForTrue((IsSignalDefined(D_IN[I])))) { __context__.SourceCodeLine = 147; GINUMDIGITALS = (ushort)(I); __context__.SourceCodeLine = 148; break; } __context__.SourceCodeLine = 143; } __context__.SourceCodeLine = 152; ushort __FN_FORSTART_VAL__2 = (ushort)(100); ushort __FN_FOREND_VAL__2 = (ushort)1; int __FN_FORSTEP_VAL__2 = (int)Functions.ToLongInteger(-(1)); for (I = __FN_FORSTART_VAL__2; (__FN_FORSTEP_VAL__2 > 0) ? ((I >= __FN_FORSTART_VAL__2) && (I <= __FN_FOREND_VAL__2)) : ((I <= __FN_FORSTART_VAL__2) && (I >= __FN_FOREND_VAL__2)); I += (ushort)__FN_FORSTEP_VAL__2) { __context__.SourceCodeLine = 154; if (Functions.TestForTrue((IsSignalDefined(A_IN[I])))) { __context__.SourceCodeLine = 156; GINUMANALOGS = (ushort)(I); __context__.SourceCodeLine = 157; break; } __context__.SourceCodeLine = 152; } __context__.SourceCodeLine = 161; ushort __FN_FORSTART_VAL__3 = (ushort)(100); ushort __FN_FOREND_VAL__3 = (ushort)1; int __FN_FORSTEP_VAL__3 = (int)Functions.ToLongInteger(-(1)); for (I = __FN_FORSTART_VAL__3; (__FN_FORSTEP_VAL__3 > 0) ? ((I >= __FN_FORSTART_VAL__3) && (I <= __FN_FOREND_VAL__3)) : ((I <= __FN_FORSTART_VAL__3) && (I >= __FN_FOREND_VAL__3)); I += (ushort)__FN_FORSTEP_VAL__3) { __context__.SourceCodeLine = 163; if (Functions.TestForTrue((IsSignalDefined(S_IN[I])))) { __context__.SourceCodeLine = 165; GINUMSERIALS = (ushort)(I); __context__.SourceCodeLine = 166; break; } __context__.SourceCodeLine = 161; } __context__.SourceCodeLine = 170; MYBRIDGE.NumDigitals = (ushort)(GINUMDIGITALS); __context__.SourceCodeLine = 171; MYBRIDGE.NumAnalogs = (ushort)(GINUMANALOGS); __context__.SourceCodeLine = 172; MYBRIDGE.NumSerials = (ushort)(GINUMSERIALS); __context__.SourceCodeLine = 174; MYBRIDGE.RegisterWithCore( ); } catch (Exception e) { ObjectCatchHandler(e); } finally { ObjectFinallyHandler(__SignalEventArg__); } return(this); }
object INIT_OnPush_0(Object __EventInfo__) { Crestron.Logos.SplusObjects.SignalEventArgs __SignalEventArg__ = (Crestron.Logos.SplusObjects.SignalEventArgs)__EventInfo__; try { SplusExecutionContext __context__ = SplusThreadStartCode(__SignalEventArg__); __context__.SourceCodeLine = 92; if (Functions.TestForTrue((Functions.BoolToInt(GetSymbolReferenceName() == "DEBUG")))) { __context__.SourceCodeLine = 92; MYBRIDGE.DebugOn = (ushort)(1); } __context__.SourceCodeLine = 93; MYBRIDGE.SymbolName = ("P" + Functions.ItoA((int)(GetProgramNumber())) + ":" + GetSymbolInstanceName( )).ToString(); __context__.SourceCodeLine = 94; MYBRIDGE.FriendlyId = (ushort)(OUTPUT_NUMBER.Value); __context__.SourceCodeLine = 95; MYBRIDGE.OutputNumber = (ushort)(OUTPUT_NUMBER.Value); __context__.SourceCodeLine = 96; MYBRIDGE.ParentId = (ushort)(SWITCHER_NUMBER.Value); __context__.SourceCodeLine = 97; MYBRIDGE.ParentTypeNum = (ushort)(SWITCHER_TYPE.Value); __context__.SourceCodeLine = 98; MYBRIDGE.FriendlyName = (OUTPUT_NAME).ToString(); __context__.SourceCodeLine = 99; MYBRIDGE.AccessLevel = (ushort)(ACCESS_LEVEL.Value); __context__.SourceCodeLine = 100; MYBRIDGE.SymbolFileName = (FILE_NAME).ToString(); __context__.SourceCodeLine = 101; MYBRIDGE.ReadAtBootup = (READ_AT_BOOTUP).ToString(); __context__.SourceCodeLine = 103; MYBRIDGE.NumDigitals = (ushort)(10); __context__.SourceCodeLine = 104; MYBRIDGE.NumAnalogs = (ushort)(10); __context__.SourceCodeLine = 106; // RegisterEvent( MYBRIDGE , ONREFRESHINPUTSEVENT , HANDLEREFRESHCHANGE ) try { g_criticalSection.Enter(); MYBRIDGE.OnRefreshInputsEvent += HANDLEREFRESHCHANGE; } finally { g_criticalSection.Leave(); } ; __context__.SourceCodeLine = 108; // RegisterEvent( MYBRIDGE , ONDIGITALOUTPUTCHANGE , HANDLEDIGITALOUTPUT ) try { g_criticalSection.Enter(); MYBRIDGE.OnDigitalOutputChange += HANDLEDIGITALOUTPUT; } finally { g_criticalSection.Leave(); } ; __context__.SourceCodeLine = 109; // RegisterEvent( MYBRIDGE , ONANALOGOUTPUTCHANGE , HANDLEANALOGOUTPUT ) try { g_criticalSection.Enter(); MYBRIDGE.OnAnalogOutputChange += HANDLEANALOGOUTPUT; } finally { g_criticalSection.Leave(); } ; __context__.SourceCodeLine = 111; // RegisterEvent( MYBRIDGE , SETSOURCECONTROLCHANGE , HANDLESOURCEVALUECONTROL ) try { g_criticalSection.Enter(); MYBRIDGE.SetSourceControlChange += HANDLESOURCEVALUECONTROL; } finally { g_criticalSection.Leave(); } ; __context__.SourceCodeLine = 112; // RegisterEvent( MYBRIDGE , SETAUDIOSOURCECONTROLCHANGE , HANDLEAUDIOSOURCEVALUECONTROL ) try { g_criticalSection.Enter(); MYBRIDGE.SetAudioSourceControlChange += HANDLEAUDIOSOURCEVALUECONTROL; } finally { g_criticalSection.Leave(); } ; __context__.SourceCodeLine = 114; MYBRIDGE.RegisterWithCore( ); } catch (Exception e) { ObjectCatchHandler(e); } finally { ObjectFinallyHandler(__SignalEventArg__); } return(this); }
object INIT_OnPush_0(Object __EventInfo__) { Crestron.Logos.SplusObjects.SignalEventArgs __SignalEventArg__ = (Crestron.Logos.SplusObjects.SignalEventArgs)__EventInfo__; try { SplusExecutionContext __context__ = SplusThreadStartCode(__SignalEventArg__); ushort I = 0; __context__.SourceCodeLine = 108; if (Functions.TestForTrue((Functions.BoolToInt(GetSymbolReferenceName() == "DEBUG")))) { __context__.SourceCodeLine = 108; MYBRIDGE.DebugOn = (ushort)(1); } __context__.SourceCodeLine = 109; MYBRIDGE.SymbolName = ("P" + Functions.ItoA((int)(GetProgramNumber())) + ":" + GetSymbolInstanceName( )).ToString(); __context__.SourceCodeLine = 110; MYBRIDGE.FriendlyId = (ushort)(SOURCE_ID.Value); __context__.SourceCodeLine = 111; MYBRIDGE.FriendlyName = (SOURCE_NAME + Functions.ItoA((int)(SOURCE_ID.Value))).ToString(); __context__.SourceCodeLine = 112; MYBRIDGE.AccessLevel = (ushort)(ACCESS_LEVEL.Value); __context__.SourceCodeLine = 113; MYBRIDGE.ReadAtBootup = (READ_AT_BOOTUP).ToString(); __context__.SourceCodeLine = 114; MYBRIDGE.DefaultAudioSwitcherId = (ushort)(AUDIO_SWITCHER.Value); __context__.SourceCodeLine = 115; MYBRIDGE.DefaultAudioInputNumber = (ushort)(AUDIO_INPUT.Value); __context__.SourceCodeLine = 116; MYBRIDGE.DefaultVideoSwitcherId = (ushort)(VIDEO_SWITCHER.Value); __context__.SourceCodeLine = 117; MYBRIDGE.DefaultVideoInputNumber = (ushort)(VIDEO_INPUT.Value); __context__.SourceCodeLine = 118; MYBRIDGE.HandheldPageNum = (ushort)(PD_Const.cHandheldFullListPage); __context__.SourceCodeLine = 120; MYBRIDGE.NumListDigitals = (ushort)(50); __context__.SourceCodeLine = 121; MYBRIDGE.NumListAnalogs = (ushort)(50); __context__.SourceCodeLine = 122; MYBRIDGE.NumListSerials = (ushort)(50); __context__.SourceCodeLine = 123; MYBRIDGE.NumQuickDigitals = (ushort)(50); __context__.SourceCodeLine = 124; MYBRIDGE.NumQuickAnalogs = (ushort)(50); __context__.SourceCodeLine = 125; MYBRIDGE.NumQuickSerials = (ushort)(50); __context__.SourceCodeLine = 127; // RegisterEvent( MYBRIDGE , ONREFRESHINPUTSEVENT , HANDLEREFRESHCHANGE ) try { g_criticalSection.Enter(); MYBRIDGE.OnRefreshInputsEvent += HANDLEREFRESHCHANGE; } finally { g_criticalSection.Leave(); } ; __context__.SourceCodeLine = 128; // RegisterEvent( MYBRIDGE , SETINUSECHANGE , HANDLEINUSECHANGE ) try { g_criticalSection.Enter(); MYBRIDGE.SetInUseChange += HANDLEINUSECHANGE; } finally { g_criticalSection.Leave(); } ; __context__.SourceCodeLine = 130; // RegisterEvent( MYBRIDGE , ONDIGITALOUTPUTCHANGE , HANDLEDIGITALOUTPUT ) try { g_criticalSection.Enter(); MYBRIDGE.OnDigitalOutputChange += HANDLEDIGITALOUTPUT; } finally { g_criticalSection.Leave(); } ; __context__.SourceCodeLine = 132; // RegisterEvent( MYBRIDGE , SETQUICKCONTROLCHANGE , HANDLEQUICKCONTROLCHANGE ) try { g_criticalSection.Enter(); MYBRIDGE.SetQuickControlChange += HANDLEQUICKCONTROLCHANGE; } finally { g_criticalSection.Leave(); } ; __context__.SourceCodeLine = 133; // RegisterEvent( MYBRIDGE , SETLISTDIGITALCONTROLCHANGE , HANDLELISTDIGITALCONTROLCHANGE ) try { g_criticalSection.Enter(); MYBRIDGE.SetListDigitalControlChange += HANDLELISTDIGITALCONTROLCHANGE; } finally { g_criticalSection.Leave(); } ; __context__.SourceCodeLine = 135; ushort __FN_FORSTART_VAL__1 = (ushort)(300); ushort __FN_FOREND_VAL__1 = (ushort)1; int __FN_FORSTEP_VAL__1 = (int)Functions.ToLongInteger(-(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 = 137; if (Functions.TestForTrue((IsSignalDefined(D_OUT[I])))) { __context__.SourceCodeLine = 139; GINUMDIGITALS = (ushort)(I); __context__.SourceCodeLine = 140; break; } __context__.SourceCodeLine = 135; } __context__.SourceCodeLine = 144; ushort __FN_FORSTART_VAL__2 = (ushort)(100); ushort __FN_FOREND_VAL__2 = (ushort)1; int __FN_FORSTEP_VAL__2 = (int)Functions.ToLongInteger(-(1)); for (I = __FN_FORSTART_VAL__2; (__FN_FORSTEP_VAL__2 > 0) ? ((I >= __FN_FORSTART_VAL__2) && (I <= __FN_FOREND_VAL__2)) : ((I <= __FN_FORSTART_VAL__2) && (I >= __FN_FOREND_VAL__2)); I += (ushort)__FN_FORSTEP_VAL__2) { __context__.SourceCodeLine = 146; if (Functions.TestForTrue((IsSignalDefined(S_IN[I])))) { __context__.SourceCodeLine = 148; GINUMSERIALS = (ushort)(I); __context__.SourceCodeLine = 149; break; } __context__.SourceCodeLine = 144; } __context__.SourceCodeLine = 153; MYBRIDGE.NumDigitals = (ushort)(GINUMDIGITALS); __context__.SourceCodeLine = 154; MYBRIDGE.NumSerials = (ushort)(GINUMSERIALS); __context__.SourceCodeLine = 156; MYBRIDGE.RegisterWithCore( ); } catch (Exception e) { ObjectCatchHandler(e); } finally { ObjectFinallyHandler(__SignalEventArg__); } return(this); }
public LockScope(CCriticalSection criticalSection) { _criticalSection = criticalSection; _criticalSection.Enter(); }
object INIT_COMPLETE_OnPush_0(Object __EventInfo__) { Crestron.Logos.SplusObjects.SignalEventArgs __SignalEventArg__ = (Crestron.Logos.SplusObjects.SignalEventArgs)__EventInfo__; try { SplusExecutionContext __context__ = SplusThreadStartCode(__SignalEventArg__); __context__.SourceCodeLine = 90; if (Functions.TestForTrue((Functions.BoolToInt(GetSymbolReferenceName() == "DEBUG")))) { __context__.SourceCodeLine = 90; MYBRIDGE.DebugOn = (ushort)(1); } __context__.SourceCodeLine = 91; MYBRIDGE.SymbolName = ("P" + Functions.ItoA((int)(GetProgramNumber())) + ":" + GetSymbolInstanceName( )).ToString(); __context__.SourceCodeLine = 92; MYBRIDGE.SymbolFileName = (FILE_NAME).ToString(); __context__.SourceCodeLine = 93; MYBRIDGE.FriendlyId = (ushort)(ZONE_NUMBER.Value); __context__.SourceCodeLine = 94; MYBRIDGE.NumScenes = (ushort)(NUMBEROFSCENES.Value); __context__.SourceCodeLine = 95; MYBRIDGE.NumLoads = (ushort)(NUMBEROFLOADS.Value); __context__.SourceCodeLine = 96; MYBRIDGE.AccessLevel = (ushort)(ACCESS_LEVEL.Value); __context__.SourceCodeLine = 97; MYBRIDGE.FriendlyName = (ZONE_NAME + Functions.ItoA((int)(ZONE_NUMBER.Value))).ToString(); __context__.SourceCodeLine = 98; MYBRIDGE.ReadAtBootup = (READ_AT_BOOTUP).ToString(); __context__.SourceCodeLine = 100; MYBRIDGE.NumDigitals = (ushort)(40); __context__.SourceCodeLine = 101; MYBRIDGE.NumSerials = (ushort)(NUMBEROFLOADS.Value); __context__.SourceCodeLine = 102; MYBRIDGE.NumAnalogs = (ushort)(NUMBEROFLOADS.Value); __context__.SourceCodeLine = 103; MYBRIDGE.NumListDigitals = (ushort)(NUMBEROFSCENES.Value); __context__.SourceCodeLine = 105; // RegisterEvent( MYBRIDGE , ONREFRESHINPUTSEVENT , HANDLEREFRESHCHANGE ) try { g_criticalSection.Enter(); MYBRIDGE.OnRefreshInputsEvent += HANDLEREFRESHCHANGE; } finally { g_criticalSection.Leave(); } ; __context__.SourceCodeLine = 107; // RegisterEvent( MYBRIDGE , ONDIGITALOUTPUTCHANGE , HANDLEDIGITALOUTPUT ) try { g_criticalSection.Enter(); MYBRIDGE.OnDigitalOutputChange += HANDLEDIGITALOUTPUT; } finally { g_criticalSection.Leave(); } ; __context__.SourceCodeLine = 108; // RegisterEvent( MYBRIDGE , ONANALOGOUTPUTCHANGE , HANDLEANALOGOUTPUT ) try { g_criticalSection.Enter(); MYBRIDGE.OnAnalogOutputChange += HANDLEANALOGOUTPUT; } finally { g_criticalSection.Leave(); } ; __context__.SourceCodeLine = 110; // RegisterEvent( MYBRIDGE , SETQUICKCONTROLCHANGE , HANDLEQUICKCONTROLCHANGE ) try { g_criticalSection.Enter(); MYBRIDGE.SetQuickControlChange += HANDLEQUICKCONTROLCHANGE; } finally { g_criticalSection.Leave(); } ; __context__.SourceCodeLine = 111; // RegisterEvent( MYBRIDGE , SETLISTDIGITALCONTROLCHANGE , HANDLELISTDIGITALCONTROLCHANGE ) try { g_criticalSection.Enter(); MYBRIDGE.SetListDigitalControlChange += HANDLELISTDIGITALCONTROLCHANGE; } finally { g_criticalSection.Leave(); } ; __context__.SourceCodeLine = 113; MYBRIDGE.RegisterWithCore( ); } catch (Exception e) { ObjectCatchHandler(e); } finally { ObjectFinallyHandler(__SignalEventArg__); } return(this); }
object INIT_COMPLETE_OnPush_0(Object __EventInfo__) { Crestron.Logos.SplusObjects.SignalEventArgs __SignalEventArg__ = (Crestron.Logos.SplusObjects.SignalEventArgs)__EventInfo__; try { SplusExecutionContext __context__ = SplusThreadStartCode(__SignalEventArg__); ushort I = 0; __context__.SourceCodeLine = 78; if (Functions.TestForTrue((Functions.BoolToInt(GetSymbolReferenceName() == "DEBUG")))) { __context__.SourceCodeLine = 78; MYBRIDGE.DebugOn = (ushort)(1); } __context__.SourceCodeLine = 79; MYBRIDGE.SymbolName = ("P" + Functions.ItoA((int)(GetProgramNumber())) + ":" + GetSymbolInstanceName( )).ToString(); __context__.SourceCodeLine = 80; MYBRIDGE.SymbolFileName = (FILE_NAME).ToString(); __context__.SourceCodeLine = 81; MYBRIDGE.FriendlyId = (ushort)(SYSTEM_NUMBER.Value); __context__.SourceCodeLine = 82; MYBRIDGE.NumScenes = (ushort)(12); __context__.SourceCodeLine = 83; MYBRIDGE.AccessLevel = (ushort)(ACCESS_LEVEL.Value); __context__.SourceCodeLine = 84; MYBRIDGE.FriendlyName = (SYSTEM_NAME).ToString(); __context__.SourceCodeLine = 85; MYBRIDGE.ReadAtBootup = (READ_AT_BOOTUP).ToString(); __context__.SourceCodeLine = 87; ushort __FN_FORSTART_VAL__1 = (ushort)(300); ushort __FN_FOREND_VAL__1 = (ushort)1; int __FN_FORSTEP_VAL__1 = (int)Functions.ToLongInteger(-(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 = 89; if (Functions.TestForTrue((IsSignalDefined(D_IN[I])))) { __context__.SourceCodeLine = 91; GINUMDIGITALS = (ushort)(I); __context__.SourceCodeLine = 92; break; } __context__.SourceCodeLine = 87; } __context__.SourceCodeLine = 96; ushort __FN_FORSTART_VAL__2 = (ushort)(100); ushort __FN_FOREND_VAL__2 = (ushort)1; int __FN_FORSTEP_VAL__2 = (int)Functions.ToLongInteger(-(1)); for (I = __FN_FORSTART_VAL__2; (__FN_FORSTEP_VAL__2 > 0) ? ((I >= __FN_FORSTART_VAL__2) && (I <= __FN_FOREND_VAL__2)) : ((I <= __FN_FORSTART_VAL__2) && (I >= __FN_FOREND_VAL__2)); I += (ushort)__FN_FORSTEP_VAL__2) { __context__.SourceCodeLine = 98; if (Functions.TestForTrue((IsSignalDefined(A_IN[I])))) { __context__.SourceCodeLine = 100; GINUMANALOGS = (ushort)(I); __context__.SourceCodeLine = 101; break; } __context__.SourceCodeLine = 96; } __context__.SourceCodeLine = 105; ushort __FN_FORSTART_VAL__3 = (ushort)(100); ushort __FN_FOREND_VAL__3 = (ushort)1; int __FN_FORSTEP_VAL__3 = (int)Functions.ToLongInteger(-(1)); for (I = __FN_FORSTART_VAL__3; (__FN_FORSTEP_VAL__3 > 0) ? ((I >= __FN_FORSTART_VAL__3) && (I <= __FN_FOREND_VAL__3)) : ((I <= __FN_FORSTART_VAL__3) && (I >= __FN_FOREND_VAL__3)); I += (ushort)__FN_FORSTEP_VAL__3) { __context__.SourceCodeLine = 107; if (Functions.TestForTrue((IsSignalDefined(S_IN[I])))) { __context__.SourceCodeLine = 109; GINUMSERIALS = (ushort)(I); __context__.SourceCodeLine = 110; break; } __context__.SourceCodeLine = 105; } __context__.SourceCodeLine = 114; MYBRIDGE.NumDigitals = (ushort)(GINUMDIGITALS); __context__.SourceCodeLine = 115; MYBRIDGE.NumAnalogs = (ushort)(GINUMANALOGS); __context__.SourceCodeLine = 116; MYBRIDGE.NumSerials = (ushort)(GINUMSERIALS); __context__.SourceCodeLine = 117; MYBRIDGE.NumScenes = (ushort)(12); __context__.SourceCodeLine = 119; // RegisterEvent( MYBRIDGE , ONREFRESHINPUTSEVENT , HANDLEREFRESHCHANGE ) try { g_criticalSection.Enter(); MYBRIDGE.OnRefreshInputsEvent += HANDLEREFRESHCHANGE; } finally { g_criticalSection.Leave(); } ; __context__.SourceCodeLine = 121; // RegisterEvent( MYBRIDGE , ONDIGITALOUTPUTCHANGE , HANDLEDIGITALOUTPUT ) try { g_criticalSection.Enter(); MYBRIDGE.OnDigitalOutputChange += HANDLEDIGITALOUTPUT; } finally { g_criticalSection.Leave(); } ; __context__.SourceCodeLine = 122; // RegisterEvent( MYBRIDGE , ONANALOGOUTPUTCHANGE , HANDLEANALOGOUTPUT ) try { g_criticalSection.Enter(); MYBRIDGE.OnAnalogOutputChange += HANDLEANALOGOUTPUT; } finally { g_criticalSection.Leave(); } ; __context__.SourceCodeLine = 123; // RegisterEvent( MYBRIDGE , ONSERIALOUTPUTCHANGE , HANDLESERIALOUTPUT ) try { g_criticalSection.Enter(); MYBRIDGE.OnSerialOutputChange += HANDLESERIALOUTPUT; } finally { g_criticalSection.Leave(); } ; __context__.SourceCodeLine = 125; MYBRIDGE.RegisterWithCore( ); } catch (Exception e) { ObjectCatchHandler(e); } finally { ObjectFinallyHandler(__SignalEventArg__); } return(this); }
public static void Clear() { InternalDictionaryLock.Enter(); InternalDictionary.Clear(); InternalDictionaryLock.Leave(); }
object INIT_OnPush_0(Object __EventInfo__) { Crestron.Logos.SplusObjects.SignalEventArgs __SignalEventArg__ = (Crestron.Logos.SplusObjects.SignalEventArgs)__EventInfo__; try { SplusExecutionContext __context__ = SplusThreadStartCode(__SignalEventArg__); __context__.SourceCodeLine = 100; if (Functions.TestForTrue((Functions.BoolToInt(GetSymbolReferenceName() == "DEBUG")))) { __context__.SourceCodeLine = 100; MYBRIDGE.DebugOn = (ushort)(1); } __context__.SourceCodeLine = 101; MYBRIDGE.SymbolName = ("P" + Functions.ItoA((int)(GetProgramNumber())) + ":" + GetSymbolInstanceName( )).ToString(); __context__.SourceCodeLine = 102; MYBRIDGE.SymbolFileName = (FILE_NAME).ToString(); __context__.SourceCodeLine = 103; MYBRIDGE.FriendlyId = (ushort)(HANDHELD_ID.Value); __context__.SourceCodeLine = 104; MYBRIDGE.FriendlyName = (HANDHELD_NAME + Functions.ItoA((int)(HANDHELD_ID.Value))).ToString(); __context__.SourceCodeLine = 105; MYBRIDGE.InterfaceType = (ushort)(INTERFACE_TYPE.Value); __context__.SourceCodeLine = 106; MYBRIDGE.NumSourceButtons = (ushort)(NUM_SOURCE_BUTTONS.Value); __context__.SourceCodeLine = 107; MYBRIDGE.DefaultRoomNum = (ushort)(DEFAULT_ROOM.Value); __context__.SourceCodeLine = 108; MYBRIDGE.AccessLevel = (ushort)(ACCESS_LEVEL.Value); __context__.SourceCodeLine = 109; MYBRIDGE.ReadAtBootup = (READ_AT_BOOTUP).ToString(); __context__.SourceCodeLine = 110; MYBRIDGE.MaxNumRooms = (ushort)(50); __context__.SourceCodeLine = 111; MYBRIDGE.MaxNumSources = (ushort)(50); __context__.SourceCodeLine = 113; // RegisterEvent( MYBRIDGE , SETROOMZONEONFEEDBACKCHANGE , HANDLEROOMZONEONFEEDBACK ) try { g_criticalSection.Enter(); MYBRIDGE.SetRoomZoneOnFeedbackChange += HANDLEROOMZONEONFEEDBACK; } finally { g_criticalSection.Leave(); } ; __context__.SourceCodeLine = 114; // RegisterEvent( MYBRIDGE , SETROOMZONEOFFFEEDBACKCHANGE , HANDLEROOMZONEOFFFEEDBACK ) try { g_criticalSection.Enter(); MYBRIDGE.SetRoomZoneOffFeedbackChange += HANDLEROOMZONEOFFFEEDBACK; } finally { g_criticalSection.Leave(); } ; __context__.SourceCodeLine = 115; // RegisterEvent( MYBRIDGE , SETROOMMUTEONFEEDBACKCHANGE , HANDLEROOMMUTEONFEEDBACK ) try { g_criticalSection.Enter(); MYBRIDGE.SetRoomMuteOnFeedbackChange += HANDLEROOMMUTEONFEEDBACK; } finally { g_criticalSection.Leave(); } ; __context__.SourceCodeLine = 116; // RegisterEvent( MYBRIDGE , SETROOMVOLUMEFEEDBACKCHANGE , HANDLEROOMVOLUMEFEEDBACK ) try { g_criticalSection.Enter(); MYBRIDGE.SetRoomVolumeFeedbackChange += HANDLEROOMVOLUMEFEEDBACK; } finally { g_criticalSection.Leave(); } ; __context__.SourceCodeLine = 117; // RegisterEvent( MYBRIDGE , SETROOMSOURCEFEEDBACKCHANGE , HANDLEROOMSOURCEFEEDBACK ) try { g_criticalSection.Enter(); MYBRIDGE.SetRoomSourceFeedbackChange += HANDLEROOMSOURCEFEEDBACK; } finally { g_criticalSection.Leave(); } ; __context__.SourceCodeLine = 118; // RegisterEvent( MYBRIDGE , SETCONNECTEDROOMNUMFEEDBACKCHANGE , HANDLEROOMNUMFEEDBACK ) try { g_criticalSection.Enter(); MYBRIDGE.SetConnectedRoomNumFeedbackChange += HANDLEROOMNUMFEEDBACK; } finally { g_criticalSection.Leave(); } ; __context__.SourceCodeLine = 120; MYBRIDGE.RegisterWithCore( ); } catch (Exception e) { ObjectCatchHandler(e); } finally { ObjectFinallyHandler(__SignalEventArg__); } return(this); }