Exemplo n.º 1
0
 /// <summary>
 /// Removes the event group from the global list
 /// </summary>
 /// <param name="eventGroup"></param>
 public static void RemoveEventGroup(ScheduledEventGroup eventGroup)
 {
     if (!EventGroups.ContainsKey(eventGroup.Name))
     {
         EventGroups.Remove(eventGroup.Name);
     }
 }
Exemplo n.º 2
0
        public RoomOnToDefaultSourceWhenOccupied(DeviceConfig config) :
            base(config)
        {
            PropertiesConfig = JsonConvert.DeserializeObject <RoomOnToDefaultSourceWhenOccupiedConfig>(config.Properties.ToString());

            FeatureEventGroup = new ScheduledEventGroup(this.Key);

            FeatureEventGroup.RetrieveAllEvents();

            // Add to the global class for tracking
            Scheduler.AddEventGroup(FeatureEventGroup);

            AddPostActivationAction(() =>
            {
                // Subscribe to room event to know when RoomOccupancy is set and ready to be subscribed to
                if (Room != null)
                {
                    Room.RoomOccupancyIsSet += new EventHandler <EventArgs>(RoomOccupancyIsSet);
                }

                else
                {
                    Debug.Console(1, this, "Room has no RoomOccupancy object set");
                }

                var fusionRoomKey = PropertiesConfig.RoomKey + "-fusion";

                FusionRoom = DeviceManager.GetDeviceForKey(fusionRoomKey) as Core.Fusion.EssentialsHuddleSpaceFusionSystemControllerBase;

                if (FusionRoom == null)
                {
                    Debug.Console(1, this, "Unable to get Fusion Room from Device Manager with key: {0}", fusionRoomKey);
                }
            });
        }
Exemplo n.º 3
0
 public Scheduler()
 {
     if (this.schGroup == null)
     {
         this.schGroup = new ScheduledEventGroup("ecloud");
     }
 }
Exemplo n.º 4
0
 /// <summary>
 /// Adds the event group to the global list
 /// </summary>
 /// <param name="name"></param>
 /// <returns></returns>
 public static void AddEventGroup(ScheduledEventGroup eventGroup)
 {
     // Add this group to the global collection
     if (!EventGroups.ContainsKey(eventGroup.Name))
     {
         EventGroups.Add(eventGroup.Name, eventGroup);
     }
 }
        public ControlSystem()
            : base()
        {
            try
            {
                Thread.MaxNumberOfUserThreads = 20;

                //Subscribe to the controller events (System, Program, and Ethernet)
                CrestronEnvironment.SystemEventHandler        += new SystemEventHandler(ControlSystem_ControllerSystemEventHandler);
                CrestronEnvironment.ProgramStatusEventHandler += new ProgramStatusEventHandler(ControlSystem_ControllerProgramEventHandler);
                CrestronEnvironment.EthernetEventHandler      += new EthernetEventHandler(ControlSystem_ControllerEthernetEventHandler);

                #region UIs

                myKeypad = new HzKpcn(0x07, this);
                myKeypad.Register();
                myKeypad.ButtonStateChange += new ButtonEventHandler(myKeypad_ButtonStateChange);

                #endregion

                #region Scheduler

                myEventGroup = new ScheduledEventGroup("myEventGroup");
                myEventGroup.RetrieveAllEvents();

                #endregion


                if (this.SupportsComPort)
                {
                    this.ComPorts[1].Register();
                    this.ComPorts[1].SetComPortSpec(
                        ComPort.eComBaudRates.ComspecBaudRate9600,
                        ComPort.eComDataBits.ComspecDataBits8,
                        ComPort.eComParityType.ComspecParityNone,
                        ComPort.eComStopBits.ComspecStopBits1,
                        ComPort.eComProtocolType.ComspecProtocolRS232,
                        ComPort.eComHardwareHandshakeType.ComspecHardwareHandshakeNone,
                        ComPort.eComSoftwareHandshakeType.ComspecSoftwareHandshakeNone,
                        false);
                }
            }
            catch (Exception e)
            {
                ErrorLog.Error("Error in the constructor: {0}", e.Message);
            }
        }
 /// <summary>
 /// SIMPL+ can only execute the default constructor. If you have variables that require initialization, please
 /// use an Initialize method
 /// </summary>
 public BuiltInSchedulerExample()
 {
     myGroup = new ScheduledEventGroup("Mike");
 }
 /// <summary>
 /// SIMPL+ can only execute the default constructor. If you have variables that require initialization, please
 /// use an Initialize method
 /// </summary>
 public BuiltInSchedulerExample()
 {
     myGroup = new ScheduledEventGroup("Mike");
 }