private void button_StartSearchDev_Click(object sender, EventArgs e) { int DeviceNumber, paraInt; string DevID; DeviceNumber = ZLDM.StartSearchDev(); this.dataGridView1.Rows.Clear(); if (DeviceNumber > 0) { this.dataGridView1.Rows.Add(DeviceNumber); } for (int i = 0; i < DeviceNumber; i++) { //设备ID //DevID = ZLDM.GetDevID(0);//只能显示第一个设备 DevID = ZLDM.GetDevID(i); this.dataGridView1.Rows[i].Cells[Index设备ID].Value = DevID; //类型 paraInt = ZLDM.GetDevParamInt(DevID, ZLDM.PARAM_DEV_EXIST_IN_SUBNET); this.dataGridView1.Rows[i].Cells[Index类型].Value = Enum.Parse(typeof(ParamDevExitInSubnet), paraInt.ToString()).ToString(); //设备名称 this.dataGridView1.Rows[i].Cells[Index设备名称].Value = ZLDM.GetDevParamString(DevID, ZLDM.PARAM_DEV_NAME); //设备IP this.dataGridView1.Rows[i].Cells[Index设备IP].Value = ZLDM.GetDevParamString(DevID, ZLDM.PARAM_DEV_LOCAL_IP); //目的IP this.dataGridView1.Rows[i].Cells[Index目的IP].Value = ZLDM.GetDevParamString(DevID, ZLDM.PARAM_DEST_IP); //模式 paraInt = ZLDM.GetDevParamInt(DevID, ZLDM.PARAM_WORK_MODE); this.dataGridView1.Rows[i].Cells[Index模式].Value = Enum.Parse(typeof(ParamWorkMode), paraInt.ToString()).ToString(); //TCP连接状态 paraInt = ZLDM.GetDevParamInt(DevID, ZLDM.PARAM_LINK_STATUS); this.dataGridView1.Rows[i].Cells[IndexTCP连接].Value = Enum.Parse(typeof(ParamLinkStatus), paraInt.ToString()).ToString(); } this.toolStripStatusLabel1.Text = "搜索到" + DeviceNumber.ToString() + "个设备"; }
public void WriteConfigFile(XmlTextWriter xmlWriter) { if (DeviceName.Length < 1) { DeviceName = "Settings " + DateTime.Now; } xmlWriter.WriteStartElement("CameraSettings"); Settings.WriteElement(xmlWriter, "DeviceName", DeviceName); Settings.WriteElement(xmlWriter, "DeviceNumber", DeviceNumber.ToString()); Settings.WriteElement(xmlWriter, "DeviceMode", DeviceMode.ToString()); Settings.WriteElement(xmlWriter, "Brightness", Brightness.ToString()); Settings.WriteElement(xmlWriter, "BrightnessAuto", BrightnessAuto.ToString()); Settings.WriteElement(xmlWriter, "Contrast", Contrast.ToString()); Settings.WriteElement(xmlWriter, "ContrastAuto", ContrastAuto.ToString()); Settings.WriteElement(xmlWriter, "Saturation", Saturation.ToString()); Settings.WriteElement(xmlWriter, "SaturationAuto", SaturationAuto.ToString()); Settings.WriteElement(xmlWriter, "Sharpness", Sharpness.ToString()); Settings.WriteElement(xmlWriter, "SharpnessAuto", SharpnessAuto.ToString()); Settings.WriteElement(xmlWriter, "Zoom", Zoom.ToString()); Settings.WriteElement(xmlWriter, "ZoomAuto", ZoomAuto.ToString()); Settings.WriteElement(xmlWriter, "Focus", Focus.ToString()); Settings.WriteElement(xmlWriter, "FocusAuto", FocusAuto.ToString()); Settings.WriteElement(xmlWriter, "Exposure", Exposure.ToString()); Settings.WriteElement(xmlWriter, "ExposureAuto", ExposureAuto.ToString()); Settings.WriteElement(xmlWriter, "FlipImage", FlipImage.ToString()); xmlWriter.WriteEndElement(); }
public override string ToString() { return($"AdapterIndex={AdapterIndex.ToString()},BusNumber={BusNumber.ToString()},DeviceNumber={DeviceNumber.ToString()},AdapterName={AdapterName}"); }