// FIXME: The actual conditions for ignoring 'usb:' ones is // when it is the only entry for that device. I'm not 100% how // to handle to of the same device when they are represented by // 'usb:' as opposed to the fully qualified name private static CameraList RemoveDuplicates(CameraList cameras) { CameraList list = new CameraList(); try { int count = cameras.Count(); for (int i = 0; i < count; i++) { string name = cameras.GetName(i); string value = cameras.GetValue(i); if (value == "usb:") { continue; } list.Append(name, value); } } catch { list.Dispose(); throw; } return(list); }
internal void DiscoverDevices() { DeviceList.Clear(); CameraList.Clear(); foreach (var userCamera in SavedCameras) { if (userCamera.DeviceInfo != null) { try { DeviceList.Add(userCamera.DeviceInfo); } catch (Exception ex) { } } if (userCamera.Camera != null) { try { CameraList.Add(userCamera.Camera); } catch (Exception ex) { } } } DiscoverUsbDevices(); IPCameraFactory.DiscoverDevices(); }
public void AddCameraList() { CameraList entityToInsert = new CameraList(); //entityToInsert. new CameraListRepository().Update(entityToInsert); }
public static void ShowTurntableControlForm(Control control) { if (DeviceIDs[selectedIndex] == null) { return; } TurntableControlForm.VideoDeviceGuid = new Guid(DeviceIDs[selectedIndex]); TurntableControlForm.UserGuid = new Guid(); TCF.TurntableDeviceDataInit(); CameraList camera = Class1.cameraList.Find(_ => _.DeviceID.Equals(TurntableControlForm.VideoDeviceGuid)); if (camera == null) { return; } TurntableControlForm.VideoType = int.Parse(camera.VideoType); TCF.StartPosition = FormStartPosition.Manual; Point p = LocationOnClient(control); if (p.X + control.Width + TCF.Width > Screen.PrimaryScreen.WorkingArea.Width) { p.X -= TCF.Width; } else { p.X += control.Width; } TCF.Location = new Point(p.X, p.Y); TCF.Show(); }
public int Delete(CameraList entityToInsert) { using (Conn) { return(Conn.Delete(entityToInsert)); } }
private void GetFileList(string dir) { if (camera_fs == null) { throw new InvalidOperationException(); } //workaround for nikon dslr in ptp mode if (dir == "/special/") { return; } //files CameraList filelist = camera_fs.ListFiles(dir, context); for (int i = 0; i < filelist.Count(); i++) { files.Add(new GPhotoCameraFile(dir, filelist.GetName(i))); } //subdirectories CameraList folderlist = camera_fs.ListFolders(dir, context); for (int i = 0; i < folderlist.Count(); i++) { GetFileList(dir + folderlist.GetName(i) + "/"); } }
public int Update(CameraList entityToInsert) { using (Conn) { return(Conn.Update(entityToInsert)); } }
public Guid Insert(CameraList entityToInsert) { using (Conn) { return(Conn.Insert <Guid>(entityToInsert)); } }
public void Init() { if (CameraList.Count == 0) { foreach (Module module in Enum.GetValues(typeof(Module))) { CameraList.Add(module, new Dictionary <Camera, CameraConfig>()); foreach (Camera camera in Enum.GetValues(typeof(Camera))) { CameraList[module].Add(camera, new CameraConfig()); if (CameraList[module][camera].Mat2D.Count == 0) { if (camera == Config.Camera.Top || camera == Config.Camera.Label) { CameraList[module][camera].Mat2D.Add(new Vision.HalCali()); } else { CameraList[module][camera].Mat2D.Add(new Vision.HalCali()); CameraList[module][camera].Mat2D.Add(new Vision.HalCali()); } } } } } }
public CustomerViewModel(Customer customer, IList <Camera> cameraList) { this._customer = customer; this._name = _customer.Name; foreach (var camera in cameraList) { CameraList.Add(new CameraViewModel(camera)); } }
public CustomerViewModel(IVideoService videoService, Customer customer, IList <Camera> cameraList) { _videoService = videoService; this._customer = customer; this._name = _customer.Name; foreach (var camera in cameraList) { CameraList.Add(new CameraViewModel(_videoService, camera)); } }
private void ToolStripMenuItem_add_Click(object sender, EventArgs e) { CameraList _tmpData = null; Add_Modify_Camera tmpAdd_Modify_Camera = new Add_Modify_Camera(_tmpData); tmpAdd_Modify_Camera.ShowDialog(); if (tmpAdd_Modify_Camera.result == DialogResult.OK) { GetCameraList(); } }
public bool RemoveCamera(Camera camera) { for (var i = CameraList.Count - 1; i >= 0; i--) { if (CameraList[i].CameraInfo != camera.CameraInfo) { continue; } return(CameraList.Remove(CameraList.FirstOrDefault(c => c.CameraInfo.Equals(camera.CameraInfo)))); } return(false); }
private void CameraData(CameraList _tmpData) { txtname.Text = _tmpData.VideoName; comboBoxstreammedia.SelectedValue = _tmpData.StreamMedia_DeviceID; txtchanle.Text = _tmpData.VideoChannel.ToString(); comboBoxvideotype.SelectedValue = Convert.ToInt32(_tmpData.VideoType); txtdepthmax.Text = _tmpData.DepthMAX.ToString(); txtfocusmax.Text = _tmpData.FocusMAX.ToString(); txthorizontalmax.Text = _tmpData.HorizontalMAX.ToString(); txtverticalmax.Text = _tmpData.VerticalMAX.ToString(); txtdistancemax.Text = _tmpData.VisualDistanceMAX.ToString(); cbx_Turntable.SelectedValue = _tmpData.Turntable_PTZ_DeviceID; txtdiscription.Text = _tmpData.Description; }
/// <summary> /// Initializes a new instance of the MainViewModel class. /// </summary> public MainViewModel() { ////if (IsInDesignMode) ////{ //// // Code runs in Blend --> create design time data. ////} ////else ////{ //// // Code runs "for real" ////} /// Title = $"USBÉãÏñÍ·²âÊÔ¹¤¾ß V{Assembly.GetExecutingAssembly().GetName().Version.ToString()}"; foreach (var item in MultimediaUtil.VideoInputDevices) { CameraList.Add(item); } SelectionChangedCmd = new RelayCommand <SelectionChangedEventArgs>(args => { VideoSource = CurrentDevice?.Name; }); ScreenShotCmd = new RelayCommand <FrameworkElement>(element => { string fileName = $"½Øͼ {DateTime.Now:yyyy-MM-dd HHmmss}.jpg"; System.IO.FileStream fs = new System.IO.FileStream(fileName, System.IO.FileMode.Create); RenderTargetBitmap bmp = new RenderTargetBitmap((int)element.ActualWidth, (int)element.ActualHeight, 0, 0, PixelFormats.Pbgra32); bmp.Render(element); BitmapEncoder encoder = new PngBitmapEncoder(); encoder.Frames.Add(BitmapFrame.Create(bmp)); encoder.Save(fs); fs.Close(); }); if (!IsInDesignMode) { if (CameraList.Count > 0) { CurrentDevice = CameraList[0]; VideoSource = CurrentDevice.Name; } } }
public Add_Modify_Camera(CameraList tmpData) { InitializeComponent(); if (tmpData == null) { tmpCamera = tmpData; TypeNameDataBinding(); } else { tmpCamera = tmpData; TypeNameDataBinding(); CameraData(tmpCamera); } }
//设备在线后重新登录设备,更新登录信息 public static int AddLogIn(string VideoDeviceID) { CHCNetSDK.NET_DVR_Init(); Guid DeviceID = new Guid(VideoDeviceID); CameraList device = Class1.cameraList.Find( delegate(CameraList camera) { return(camera.DeviceID.Equals(DeviceID)); } ); if (device == null) { return(-1); } StreamMediaList streamMedia = Class1.streamMediaList.Find( delegate(StreamMediaList sm) { return(sm.DeviceID.Equals(device.StreamMedia_DeviceID)); }); if (streamMedia == null) { return(-1); } CHCNetSDK.NET_DVR_DEVICEINFO_V30 DeviceInfo = new CHCNetSDK.NET_DVR_DEVICEINFO_V30(); //登录设备 Login the device int m_lUserID = CHCNetSDK.NET_DVR_Login_V30(streamMedia.VideoIP, streamMedia.Port, streamMedia.UserName, streamMedia.PassWord, ref DeviceInfo); if (m_lUserID < 0) { return(-1); } else { //登录成功 Console.WriteLine("Login Success!"); if (!userIDList.Keys.Contains(streamMedia.VideoIP)) { userIDList.Add(streamMedia.VideoIP, m_lUserID); } else { userIDList[streamMedia.VideoIP] = m_lUserID; } return(0); } }
public VMDFormat(BinaryReader bin, string path, string clip_name) { try { this.clip_name = clip_name; header = new Header(bin); read_count++; motion_list = new MotionList(bin); read_count++; skin_list = new SkinList(bin); read_count++; camera_list = new CameraList(bin); read_count++; light_list = new LightList(bin); read_count++; self_shadow_list = new SelfShadowList(bin); read_count++; } catch (EndOfStreamException ex) { Debug.Log((object)ex.Message); if (read_count <= 0) { header = null; } if (read_count <= 1 || motion_list.motion_count == 0) { motion_list = null; } if (read_count <= 2 || skin_list.skin_count == 0) { skin_list = null; } if (read_count <= 3 || camera_list.camera_count == 0) { camera_list = null; } if (read_count <= 4 || light_list.light_count == 0) { light_list = null; } if (read_count <= 5 || self_shadow_list.self_shadow_count == 0) { self_shadow_list = null; } } }
public DataTable GetCameraListByVideoSupplierID(uint id) { DataTable t = new DataTable(); var key = t.Columns.Add("ID"); t.PrimaryKey = new DataColumn[] { key }; t.Columns.Add("CameraName"); t.Columns.Add("CameraID"); t.Columns.Add("VideoSupplierChannelID"); t.Columns.Add("PosCoordX"); t.Columns.Add("PosCoordY"); foreach (var item in CameraList.FindAll(it => it.VideoSupplierDeviceID == id)) { t.Rows.Add(item.ID, item.CameraName, item.CameraID, item.VideoSupplierChannelID, item.PosCoordX, item.PosCoordY); } return(t); }
/// <summary> /// Detects all usable cameras which are connected to the system /// </summary> /// <returns>A list containing all cameras which can be connected to</returns> public static List <Camera> Detect() { if (Utilities.Is64Bit && Environment.OSVersion.Platform != PlatformID.Unix) { Console.WriteLine("A 64bit windows system has been detected. This is not supported"); Console.WriteLine("due to the complexity of interoperating with libgphoto2"); Console.WriteLine("as it exposes variable length 'long' types in it's API."); Console.WriteLine("The API is unlikely to change before version 3 of the library"); Console.WriteLine("The current status of this can be found on the libgphoto2"); Console.WriteLine("mailing list. A detailed explanation can be found in the"); Console.WriteLine("README file for libgphoto2-sharp"); return(new List <Camera>()); } List <Camera> cameras = new List <Camera>(); Context c = new Context(); using (CameraAbilitiesList abilities = new CameraAbilitiesList()) using (PortInfoList portInfoList = new PortInfoList()) using (CameraList cameraList = new CameraList()) { // Get the list of all devices that are currently supported abilities.Load(c); // Get the list of all the (usb?) ports that are currently available portInfoList.Load(); // Create the list of all the connected devices which can be used abilities.Detect(portInfoList, cameraList, c); // Scan through all the detected cameras and remove any duplicates using (CameraList cams = RemoveDuplicates(cameraList)) { int count = cams.Count(); for (int i = 0; i < count; i++) { CameraAbilities ability = abilities.GetAbilities(abilities.LookupModel(cams.GetName(i))); PortInfo portInfo = portInfoList.GetInfo(portInfoList.LookupPath(cams.GetValue(i))); cameras.Add(new Gphoto2.Camera(ability, portInfo, c)); } } } return(cameras); }
public GPhotoCamera() { context = new Context(); port_info_list = new PortInfoList(); port_info_list.Load(); abilities_list = new CameraAbilitiesList(); abilities_list.Load(context); camera_list = new CameraList(); selected_camera__camera_list_index = -1; camera = null; port_info = null; camera_fs = null; }
public Contract(BasicTriListWithSmartObject[] devices) { if (devices == null) { throw new ArgumentNullException("Devices is null"); } ComponentMediator = new ComponentMediator(); InternalContactList = new ContactList(ComponentMediator, 1); InternalSourceList = new SourceList(ComponentMediator, 32); InternalRoom = new Room(ComponentMediator, 41); InternalCameraList = new CameraList(ComponentMediator, 82); for (int index = 0; index < devices.Length; index++) { AddDevice(devices[index]); } }
private void dataGridViewX_CameraExceptionList_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex < 0 || e.RowIndex < 0) return; DataGridViewColumn column = dataGridViewX_CameraExceptionList.Columns[e.ColumnIndex]; if (column is DataGridViewButtonColumn) { string deviceID = dataGridViewX_CameraExceptionList.Rows[e.RowIndex].Cells[0].Value.ToString(); CameraList cameraList = OMClientManager.deviceInfo.CameraList.Find(_ => _.DeviceID == Guid.Parse(deviceID)); TurnTableList turnTableList = OMClientManager.deviceInfo.TurnTableList.Find(_ => _.DeviceID == cameraList.Turntable_PTZ_DeviceID); if (turnTableList == null) return; if (!turnTableList.Lat.HasValue || !turnTableList.Lon.HasValue) return; mapControl.Position = new PointLatLng(turnTableList.Lat.Value, turnTableList.Lon.Value); mapControl.Zoom = MapSkipLevel; } }
private void ToolStripMenuItem_edittype_Click(object sender, EventArgs e) { CameraList _tmpData = new CameraList(); for (int i = 0; i < tmpListCamera.Count; i++) { if (_tmpCameraList.DeviceID == tmpListCamera[i].DeviceID) { _tmpData = tmpListCamera[i]; break; } } Add_Modify_Camera tmpAdd_Modify_Camera = new Add_Modify_Camera(_tmpData); tmpAdd_Modify_Camera.ShowDialog(); if (tmpAdd_Modify_Camera.result == DialogResult.OK) { GetCameraList(); } }
internal static string GetDeviceName(string p) { string name = p; var task = Framework.Container.Instance.TaskManager.GetAllTasks().Find(it => it.TaskId == p); if (task == null) { var cam = CameraList.Find(it => it.ID == p); if (cam != null) { name = cam.FullName; } } else { name = task.TaskName; } return(name); }
public VMDFormat(BinaryReader bin, string path, string clip_name) { // 読み込み失敗した場合はだいたいデータがない // 失敗しても読み込み続けることがあるので例外でキャッチして残りはnullにしておく try { this.clip_name = clip_name; this.header = new MMD.VMD.VMDFormat.Header(bin); read_count++; this.motion_list = new MMD.VMD.VMDFormat.MotionList(bin); read_count++; this.skin_list = new MMD.VMD.VMDFormat.SkinList(bin); read_count++; this.camera_list = new MMD.VMD.VMDFormat.CameraList(bin); read_count++; this.light_list = new MMD.VMD.VMDFormat.LightList(bin); read_count++; this.self_shadow_list = new MMD.VMD.VMDFormat.SelfShadowList(bin); read_count++; } catch (EndOfStreamException e) { Debug.Log(e.Message); if (read_count <= 0) { this.header = null; } if (read_count <= 1 || this.motion_list.motion_count <= 0) { this.motion_list = null; } if (read_count <= 2 || this.skin_list.skin_count <= 0) { this.skin_list = null; } if (read_count <= 3 || this.camera_list.camera_count <= 0) { this.camera_list = null; } if (read_count <= 4 || this.light_list.light_count <= 0) { this.light_list = null; } if (read_count <= 5 || this.self_shadow_list.self_shadow_count <= 0) { this.self_shadow_list = null; } } }
public CameraSelectionDialog(CameraList camera_list) { camlist = camera_list; }
public VMDFormat(BinaryReader bin, string path, string clip_name) { // 読み込み失敗した場合はだいたいデータがない // 失敗しても読み込み続けることがあるので例外でキャッチして残りはnullにしておく try { this.clip_name = clip_name; this.header = new MMD.VMD.VMDFormat.Header(bin); read_count++; this.motion_list = new MMD.VMD.VMDFormat.MotionList(bin); read_count++; this.skin_list = new MMD.VMD.VMDFormat.SkinList(bin); read_count++; this.camera_list = new MMD.VMD.VMDFormat.CameraList(bin); read_count++; this.light_list = new MMD.VMD.VMDFormat.LightList(bin); read_count++; this.self_shadow_list = new MMD.VMD.VMDFormat.SelfShadowList(bin); read_count++; } catch (EndOfStreamException e) { Debug.Log(e.Message); if (read_count <= 0) this.header = null; if (read_count <= 1 || this.motion_list.motion_count <= 0) this.motion_list = null; if (read_count <= 2 || this.skin_list.skin_count <= 0) this.skin_list = null; if (read_count <= 3 || this.camera_list.camera_count <= 0) this.camera_list = null; if (read_count <= 4 || this.light_list.light_count <= 0) this.light_list = null; if (read_count <= 5 || this.self_shadow_list.self_shadow_count <= 0) this.self_shadow_list = null; } }
public override void Initialize() { base.Initialize(); if (App.CurrentAccount == null) { return; } /* List<VATRPDevice> cameraList = ServiceManager.Instance.GetAvailableCameras(); * string storedCameraId = App.CurrentAccount.SelectedCameraId; * if (cameraList != null) * { * List<string> cameraNames = new List<string>(); * foreach (VATRPDevice device in cameraList) * { * cameraNames.Add(device.displayName); * if (!string.IsNullOrEmpty(storedCameraId) && storedCameraId.Equals(device.deviceId)) * { * _selectedCamera = device.displayName; * } * } * Cameras = cameraNames.ToArray(); * } */ foreach (var item in PreferredVideoSizeComboBox.Items) { var tb = item as TextBlock; if (GetPreferredVideoSizeId(tb).Equals(App.CurrentAccount.PreferredVideoId)) { PreferredVideoSizeComboBox.SelectedItem = item; break; } } List <VATRPDevice> availableCameras = ServiceManager.Instance.GetAvailableCameras(); VATRPDevice selectedCamera = ServiceManager.Instance.GetSelectedCamera(); CameraList.Clear(); if (availableCameras == null) { return; } foreach (VATRPDevice camera in availableCameras) { CameraList.Add(camera); if ((selectedCamera != null) && selectedCamera.deviceId.Trim().Equals(camera.deviceId.Trim())) { SelectCameraComboBox.SelectedItem = camera; } } List <VATRPDevice> availableMicrophones = ServiceManager.Instance.GetAvailableMicrophones(); VATRPDevice selectedMicrophone = ServiceManager.Instance.GetSelectedMicrophone(); MicrophoneList.Clear(); foreach (VATRPDevice microphone in availableMicrophones) { MicrophoneList.Add(microphone); if ((selectedMicrophone != null) && selectedMicrophone.deviceId.Trim().Equals(microphone.deviceId.Trim())) { SelectMicrophoneComboBox.SelectedItem = microphone; } } List <VATRPDevice> availableSpeakers = ServiceManager.Instance.GetAvailableSpeakers(); VATRPDevice selectedSpeaker = ServiceManager.Instance.GetSelectedSpeakers(); SpeakerList.Clear(); foreach (VATRPDevice speaker in availableSpeakers) { SpeakerList.Add(speaker); if ((selectedSpeaker != null) && selectedSpeaker.deviceId.Trim().Equals(speaker.deviceId.Trim())) { SelectSpeakerComboBox.SelectedItem = speaker; } } /* string selectedCameraId = App.CurrentAccount.SelectedCameraId; * if (string.IsNullOrEmpty(selectedCameraId)) * { * VATRPDevice selectedCamera = ServiceManager.Instance.GetSelectedCamera(); * // SelectedCameraLabel.Content = selectedCamera.displayName; * // SelectedCameraLabel.ToolTip = selectedCamera.displayName; * } * else * { * foreach (VATRPDevice camera in availableCameras) * { * if (!string.IsNullOrEmpty(selectedCameraId) && selectedCameraId.Equals(camera.deviceId)) * { * SelectCameraComboBox.SelectedItem = camera; * // SelectedCameraLabel.Content = camera.displayName; * // SelectedCameraLabel.ToolTip = camera.displayName; * } * } * } * * List<VATRPDevice> availableMicrophones = ServiceManager.Instance.GetAvailableMicrophones(); * string selectedMicrophoneId = App.CurrentAccount.SelectedMicrophoneId; * if (string.IsNullOrEmpty(selectedMicrophoneId)) * { * VATRPDevice selectedMicrophone = ServiceManager.Instance.GetSelectedMicrophone(); * SelectedMicrophoneLabel.Content = selectedMicrophone.displayName; * SelectedMicrophoneLabel.ToolTip = selectedMicrophone.displayName; * } * else * { * foreach (VATRPDevice microphone in availableMicrophones) * { * if (!string.IsNullOrEmpty(selectedMicrophoneId) && selectedMicrophoneId.Equals(microphone.deviceId)) * { * SelectedMicrophoneLabel.Content = microphone.displayName; * SelectedMicrophoneLabel.ToolTip = microphone.displayName; * } * } * } * * List<VATRPDevice> availableSpeakers = ServiceManager.Instance.GetAvailableSpeakers(); * string selectedSpeakerId = App.CurrentAccount.SelectedSpeakerId; * if (string.IsNullOrEmpty(selectedSpeakerId)) * { * VATRPDevice selectedSpeaker = ServiceManager.Instance.GetSelectedSpeakers(); * SelectedSpeakerLabel.Content = selectedSpeaker.displayName; * SelectedSpeakerLabel.ToolTip = selectedSpeaker.displayName; * } * else * { * foreach (VATRPDevice speaker in availableSpeakers) * { * if (!string.IsNullOrEmpty(selectedSpeakerId) && selectedSpeakerId.Equals(speaker.deviceId)) * { * SelectedSpeakerLabel.Content = speaker.displayName; * SelectedSpeakerLabel.ToolTip = speaker.displayName; * } * } * } * */ }
/// <summary> /// Applies the provided settings to the Teleporter prefab. /// </summary> /// <param name="playAreaAlias">The PlayArea alias.</param> /// <param name="headsetAlias">The Headset alias.</param> /// <param name="sceneCameras">The scene cameras.</param> /// <param name="targetValidity">The rules to determine validity.</param> protected virtual void ApplySettings(GameObject playAreaAlias, GameObject headsetAlias, CameraList sceneCameras, RuleContainer targetValidity) { foreach (SurfaceLocator currentLocator in surfaceLocatorAliases.EmptyIfNull()) { currentLocator.searchOrigin = headsetAlias; } foreach (SurfaceLocator currentLocator in surfaceLocatorRules.EmptyIfNull()) { currentLocator.targetValidity = targetValidity; } foreach (TransformPropertyApplier currentApplier in transformPropertyApplierAliases.EmptyIfNull()) { currentApplier.target = playAreaAlias; currentApplier.offset = headsetAlias; } foreach (CameraColorOverlay currentOverlay in cameraColorOverlays.EmptyIfNull()) { currentOverlay.validCameras = sceneCameras; } }
private void btnsure_Click(object sender, EventArgs e) { int VideoChannel = 0; double DepthMAX = 0; double FocusMAX = 0; double HorizontalMAX = 0; double VerticalMAX = 0; double VisualDistanceMAX = 0; List <CameraList> tmpCameraList = new List <CameraList>(); CameraList _CameraList = new CameraList(); Camera_Command tmpCamera_Command = new Camera_Command(); if (txtname.Text.Trim() == "") { MessageBox.Show("请填写摄像机名称!"); return; } else if (txtname.Text.Trim().ToString().Length > 25) { MessageBox.Show("摄像机名称超过25个字符!"); return; } if (txtchanle.Text.Trim() == "") { MessageBox.Show("请填写通道号"); return; } else { if (!Int32.TryParse(txtchanle.Text.Trim(), out VideoChannel)) { MessageBox.Show("通道号为数字格式"); return; } } if (txtdepthmax.Text.Trim() == "") { MessageBox.Show("请填写变倍值"); return; } else { if (!double.TryParse(txtdepthmax.Text.Trim(), out DepthMAX)) { MessageBox.Show("最大变倍为数字格式"); return; } } if (txtfocusmax.Text.Trim() == "") { MessageBox.Show("请填写聚焦值"); return; } else { if (!double.TryParse(txtfocusmax.Text.Trim(), out FocusMAX)) { MessageBox.Show("最大聚焦为数字格式"); return; } } if (txthorizontalmax.Text.Trim() == "") { MessageBox.Show("请填写水平视场"); return; } else { if (!double.TryParse(txthorizontalmax.Text.Trim(), out HorizontalMAX)) { MessageBox.Show("最大水平视场角为数字格式"); return; } } if (txtverticalmax.Text.Trim() == "") { MessageBox.Show("请填写俯仰视场"); return; } else { if (!double.TryParse(txtverticalmax.Text.Trim(), out VerticalMAX)) { MessageBox.Show("最大俯仰视场角为数字格式"); return; } } if (txtdistancemax.Text.Trim() == "") { MessageBox.Show("请填写最大视距"); return; } else { if (!double.TryParse(txtdistancemax.Text.Trim(), out VisualDistanceMAX)) { MessageBox.Show("最大视距为数字格式"); return; } } if (tmpCamera != null) { _CameraList.DeviceID = tmpCamera.DeviceID; } _CameraList.VideoName = txtname.Text.Trim(); _CameraList.StreamMedia_DeviceID = new Guid(comboBoxstreammedia.SelectedValue.ToString()); _CameraList.VideoChannel = Convert.ToInt32(txtchanle.Text.Trim()); _CameraList.Stream_MainID = null; _CameraList.Stream_SubID = null; _CameraList.VideoType = comboBoxvideotype.SelectedValue.ToString(); _CameraList.DepthMAX = Convert.ToDouble(txtdepthmax.Text.Trim()); _CameraList.FocusMAX = Convert.ToDouble(txtfocusmax.Text.Trim()); _CameraList.HorizontalMAX = Convert.ToDouble(txthorizontalmax.Text.Trim()); _CameraList.VerticalMAX = Convert.ToDouble(txtverticalmax.Text.Trim()); _CameraList.VisualDistanceMAX = Convert.ToDouble(txtdistancemax.Text.Trim()); _CameraList.TypeID = Convert.ToInt32(cbxtypename.SelectedValue.ToString()); _CameraList.Turntable_PTZ_DeviceID = new Guid(cbx_Turntable.SelectedValue.ToString()); _CameraList.Description = txtdiscription.Text.Trim(); tmpCameraList.Add(_CameraList); if (tmpCamera == null) { tmpCamera_Command._AddData(tmpCameraList); result = MessageBox.Show("添加成功", "提示", MessageBoxButtons.OK); } else { tmpCamera_Command._ReviseData(tmpCameraList); result = MessageBox.Show("修改成功", "提示", MessageBoxButtons.OK); } this.Close(); }