private void OnSelectCameraUC2(object sender, EventArgs e) { ItemPickerForm form = new ItemPickerForm(); form.KindFilter = Kind.Camera; form.AutoAccept = true; form.Init(userContext2.Configuration.GetItems()); // Ask user to select a camera if (form.ShowDialog() == DialogResult.OK) { Close2(); _selectItem2 = form.SelectedItem; buttonSelectCamera2.Text = _selectItem2.Name; _jpegLiveSource2 = new JPEGLiveSource(_selectItem2); try { _jpegLiveSource2.Width = pictureBoxUC2.Width; _jpegLiveSource2.Height = pictureBoxUC2.Height; _jpegLiveSource2.LiveModeStart = true; _jpegLiveSource2.Init(); _jpegLiveSource2.LiveContentEvent += new EventHandler(JpegLiveSource1LiveNotificationEvent2); //_jpegLiveSource.LiveStatusEvent += new EventHandler(JpegLiveStatusNotificationEvent); } catch (Exception ex) { MessageBox.Show("Could not Init:" + ex.Message); _jpegLiveSource2 = null; } } }
private void comboBoxPresets_SelectedIndexChanged(object sender, EventArgs e) { // This is the Item which represents the preset we selected in the combo box. VideoOS.Platform.Item item = comboBoxPresets.SelectedItem as VideoOS.Platform.Item; if (item != null) { // This constucts a "trigger" message VideoOS.Platform.Messaging.Message triggerMessage = new VideoOS.Platform.Messaging.Message(MessageId.Control.TriggerCommand); // This sends the trigger message to the preset, eventually causing the camera to actually move. EnvironmentManager.Instance.SendMessage(triggerMessage, item.FQID); buttonUpdatePreset.Enabled = true; buttonDeletePreset.Enabled = true; } }
private void OnSelectCameraUC1(object sender, EventArgs e) { ItemPickerForm form = new ItemPickerForm(); form.KindFilter = Kind.Camera; form.AutoAccept = true; List <Item> system = userContext1.Configuration.GetItemsByKind(Kind.Camera, ItemHierarchy.SystemDefined); List <Item> user = userContext1.Configuration.GetItemsByKind(Kind.Camera, ItemHierarchy.UserDefined); var systemItems = system.All(i => i.FQID.FolderType == FolderType.No); var userItems = user.All(i => i.FQID.FolderType == FolderType.No); form.Init(userContext1.Configuration.GetItems()); // Ask user to select a camera if (form.ShowDialog() == DialogResult.OK) { Close1(); _selectItem1 = form.SelectedItem; buttonSelect.Text = _selectItem1.Name; _jpegLiveSource = new JPEGLiveSource(_selectItem1); try { _jpegLiveSource.Width = pictureBoxRC1.Width; _jpegLiveSource.Height = pictureBoxRC1.Height; _jpegLiveSource.LiveModeStart = true; _jpegLiveSource.Init(); _jpegLiveSource.LiveContentEvent += new EventHandler(JpegLiveSource1LiveNotificationEvent); //_jpegLiveSource.LiveStatusEvent += new EventHandler(JpegLiveStatusNotificationEvent); } catch (Exception ex) { MessageBox.Show("Could not Init:" + ex.Message); _jpegLiveSource = null; } } }
private void ItemSelected2(Item item) { _selectItem2 = item; buttonSelectCamera2.Text = _selectItem2.Name; Close2(); _jpegLiveSource2 = new JPEGLiveSource(_selectItem2); try { _jpegLiveSource2.Width = pictureBoxUC2.Width; _jpegLiveSource2.Height = pictureBoxUC2.Height; _jpegLiveSource2.LiveModeStart = true; _jpegLiveSource2.Init(); _jpegLiveSource2.LiveContentEvent += new EventHandler(JpegLiveSource1LiveNotificationEvent2); //_jpegLiveSource.LiveStatusEvent += new EventHandler(JpegLiveStatusNotificationEvent); } catch (Exception ex) { MessageBox.Show("Could not Init:" + ex.Message); _jpegLiveSource2 = null; } }