コード例 #1
0
        public UsbRoutingViewController(UIViewController parentViewController)
            : base(parentViewController, Digitals.SubPageTechUsb, string.Empty, TimeSpan.Zero)
        {
            try
            {
                var ui = parentViewController.UIController as UIControllerWithSmartObjects;
                _lists    = new Dictionary <uint, UIDynamicButtonList>();
                _buttons  = new Dictionary <uint, ButtonCollection>();
                _pcInputs = new Dictionary <uint, uint>
                {
                    { 1, 11 },
                    { 2, 12 },
                    { 3, 13 },
                    { 4, 14 },
                };
                for (uint i = 0; i < 4; i++)
                {
                    var list = new UIDynamicButtonList(ui,
                                                       ui.Device.SmartObjects[Joins.SmartObjects.UsbRoutingList1 + i]);
                    _lists[i + 1]   = list;
                    _buttons[i + 1] = new ButtonCollection(list);

                    for (uint j = 1; j <= 3; j++)
                    {
                        switch (j)
                        {
                        case 1:
                            list.AddItem("Aud 1 Lectern", new[] { 1U, 2U });
                            break;

                        case 2:
                            list.AddItem("Aud 2 Lectern", new[] { 3U, 4U });
                            break;

                        case 3:
                            list.AddItem("Control Room", new[] { 10U });
                            break;
                        }
                    }
                }
            }
            catch (Exception e)
            {
                CloudLog.Error("Error loading {0}, {1}", GetType().Name, e.Message);
            }
        }
コード例 #2
0
        protected override void WillShow()
        {
            base.WillShow();

            _tabs.ButtonEvent           += TabsOnButtonEvent;
            _channelButtons.ButtonEvent += ChannelButtonsOnButtonEvent;

            if (_currentId == 0)
            {
                _tabs.SetInterlockedFeedback(1);
                _currentId = _receiverIds[1];
            }

            Device.BooleanInput[Digitals.IptvTabsVisible].BoolValue = _receiverIds.Count > 1;

            TripleCare.GetChannels(ConfigManager.Config.TriplePlayServerAddress, -1, (success, channels) =>
            {
                if (success && channels != null)
                {
                    var channelOrder = channels
                                       .OrderBy(c => c.Number)
                                       .Take((int)_channelList.MaxNumberOfItems)
                                       .ToArray();

                    CloudLog.Debug("Received {0} channels from server", channelOrder.Count());
                    try
                    {
                        _channelList.ClearList(true);
                        foreach (var channel in channelOrder)
                        {
                            _channelList.AddItem(channel.Name, channel, true);
                        }
                        _channelList.SetListSizeToItemCount();
                    }
                    catch (Exception e)
                    {
                        CloudLog.Exception(e, "Error loading channels into list");
                    }
                }
                else
                {
                    CloudLog.Warn("Could not load channel list from server");
                }
            });
        }
コード例 #3
0
        protected override void WillShow()
        {
            base.WillShow();
            _closeBtn.ButtonEvent += CloseBtnOnButtonEvent;
            _sourceButtons.ButtonEvent += SourceButtonsOnButtonEvent;
            
            Codec.Conference.Presentation.StatusChange += PresentationOnStatusChange;

            _list.ClearList(true);
            foreach (var source in UIController.Room.Sources
                .Where(s => s.Type != SourceType.VideoConference)
                .Cast<ASource>())
            {
                var index = _list.AddItem(source.Name, source, true);
                _list[index].IconNumber = (ushort) source.Icon;
            }
            _list.SetListSizeToItemCount();
            UpdateFeedback();
        }
コード例 #4
0
        private void SelectedProcessorOnUpdateReceived(OneBeyond device, UpdateFeedbackEventArgs args)
        {
            switch (args.Type)
            {
            case UpdateType.LayoutsUpdated:
                _layoutsList.ClearList();
                foreach (var item in ((Dictionary <ushort, string>)args.Value))
                {
                    _layoutsList.AddItem(item.Value, item.Key, true);
                }
                _layoutsList.SetListSizeToItemCount();
                break;

            case UpdateType.CurrentLayoutUpdated:
                _layoutsList.SetSelectedItem(_layoutsList[(ushort)args.Value]);
                break;

            case UpdateType.RoomConfigsUpdated:
                _roomConfigsList.ClearList();
                foreach (var item in ((Dictionary <ushort, string>)args.Value))
                {
                    _roomConfigsList.AddItem(item.Value, item.Key, true);
                }
                _roomConfigsList.SetListSizeToItemCount();
                break;

            case UpdateType.CurrentRoomConfigUpdated:
                _layoutsList.SetSelectedItem(_roomConfigsList[(ushort)args.Value]);
                var cameras = SelectedProcessor.GetCamerasForConfig((ushort)args.Value);
                _cameraSelectList.ClearList(true);
                SelectedCamera = null;
                foreach (var camera in cameras)
                {
                    _cameraSelectList.AddItem(camera.Name, camera, true);
                }
                _cameraSelectList.SetListSizeToItemCount();
                break;

            case UpdateType.AutoSwitchStatusUpdated:
                _autoSwitchEnableButton.Feedback = Convert.ToBoolean(args.Value);
                break;

            case UpdateType.CameraSelectUpdated:
                _cameraSelectList.SetSelectedItem(_cameraSelectList[(ushort)args.Value]);
                var cam = _cameraSelectList[(ushort)args.Value].LinkedObject as OneBeyondCameraConfig;
                if (cam != null)
                {
                    SelectedCamera = ((ASystem)UIController.System).Cameras[cam.Id];
                    Debug.WriteInfo("Selected camera", "{0} {1}", cam.Name, cam.IpAddress);
                }
                break;

            case UpdateType.RecordStatusUpdated:
                _cameraButtons[Digitals.CameraRecordBtn].Feedback = Convert.ToBoolean(args.Value);
                break;

            case UpdateType.StreamStatusUpdated:
                _cameraButtons[Digitals.CameraStreamBtn].Feedback = Convert.ToBoolean(args.Value);
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
        }