|
@@ -160,8 +160,13 @@ namespace CameraModel
|
|
devices.Add(ModelName, input1.Text);
|
|
devices.Add(ModelName, input1.Text);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ LogListBox("输入型号!!!");
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
-
|
|
|
|
}
|
|
}
|
|
else //断开
|
|
else //断开
|
|
{
|
|
{
|
|
@@ -201,13 +206,13 @@ namespace CameraModel
|
|
|
|
|
|
if (!devices.TryGetValue(ModelName, out string value) && string.IsNullOrEmpty(input1.Text))
|
|
if (!devices.TryGetValue(ModelName, out string value) && string.IsNullOrEmpty(input1.Text))
|
|
{
|
|
{
|
|
- AntdUI.Input input = new AntdUI.Input() { Size = new Size(300, 80), MaxLength = 15 };
|
|
|
|
- if (AntdUI.Modal.open(new AntdUI.Modal.Config(ParentForm, "输入型号", input) { CancelText = null,MaskClosable = false }) == DialogResult.No)
|
|
|
|
- {
|
|
|
|
- return "";
|
|
|
|
- }
|
|
|
|
- return input.Text;
|
|
|
|
-
|
|
|
|
|
|
+ //AntdUI.Input input = new AntdUI.Input() { Size = new Size(300, 80), MaxLength = 15 };
|
|
|
|
+ //if (AntdUI.Modal.open(new AntdUI.Modal.Config(ParentForm, "输入型号", input) { CancelText = null,MaskClosable = false }) == DialogResult.No)
|
|
|
|
+ //{
|
|
|
|
+ // return "";
|
|
|
|
+ //}
|
|
|
|
+ //return input.Text;
|
|
|
|
+ return "";
|
|
}
|
|
}
|
|
if (!string.IsNullOrEmpty(input1.Text))
|
|
if (!string.IsNullOrEmpty(input1.Text))
|
|
{
|
|
{
|
|
@@ -348,7 +353,7 @@ namespace CameraModel
|
|
bool accessible = DeviceEnumerator.IsDeviceAccessible(devInfoList[cbDeviceList.SelectedIndex], DeviceAccessMode.AccessExclusive);
|
|
bool accessible = DeviceEnumerator.IsDeviceAccessible(devInfoList[cbDeviceList.SelectedIndex], DeviceAccessMode.AccessExclusive);
|
|
if (accessible)
|
|
if (accessible)
|
|
{
|
|
{
|
|
- nRet = _IGigEDevice.Open();
|
|
|
|
|
|
+ nRet = _IGigEDevice.Open(DeviceAccessMode.AccessControl,0);
|
|
if (MvError.MV_OK != nRet)
|
|
if (MvError.MV_OK != nRet)
|
|
{
|
|
{
|
|
nRet = _IGigEDevice.SetIpConfig(IpConfigType.Static);
|
|
nRet = _IGigEDevice.SetIpConfig(IpConfigType.Static);
|
|
@@ -362,7 +367,7 @@ namespace CameraModel
|
|
if (SetIp(_IGigEDevice))
|
|
if (SetIp(_IGigEDevice))
|
|
{
|
|
{
|
|
// 打开并修改
|
|
// 打开并修改
|
|
- nRet = _IGigEDevice.Open();
|
|
|
|
|
|
+ nRet = _IGigEDevice.Open(DeviceAccessMode.AccessControl, 0);
|
|
|
|
|
|
if (MvError.MV_OK != nRet)
|
|
if (MvError.MV_OK != nRet)
|
|
{
|
|
{
|
|
@@ -485,7 +490,13 @@ namespace CameraModel
|
|
|
|
|
|
// 查找型号
|
|
// 查找型号
|
|
string ModelName = _device.DeviceInfo.ModelName;
|
|
string ModelName = _device.DeviceInfo.ModelName;
|
|
- input1.Text = GetDeviceId(ModelName);
|
|
|
|
|
|
+ string UserName = GetDeviceId(ModelName);
|
|
|
|
+ if(String.IsNullOrEmpty(UserName) || UserName.Length > 15)
|
|
|
|
+ {
|
|
|
|
+ LogListBox("输入型号!!!");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ input1.Text = UserName;
|
|
//m_MyCamera.MV_CC_SetDeviceUserID_NET(input1.Text);
|
|
//m_MyCamera.MV_CC_SetDeviceUserID_NET(input1.Text);
|
|
int nRet = _device.Parameters.SetStringValue("DeviceUserID", input1.Text);
|
|
int nRet = _device.Parameters.SetStringValue("DeviceUserID", input1.Text);
|
|
if (nRet != MvError.MV_OK)
|
|
if (nRet != MvError.MV_OK)
|