初步界面测试

This commit is contained in:
TD
2025-03-25 13:56:48 +08:00
parent fabc7606e7
commit 2a6019bfbd
4 changed files with 585 additions and 107 deletions

View File

@ -176,11 +176,11 @@ namespace DHSoftware
InitData();
//绑定事件
BindEventHandler();
UserConfigFrm userControlFrm = new UserConfigFrm();
//UserConfigFrm userControlFrm = new UserConfigFrm();
userControlFrm.Window = this;
userControlFrm.Dock = DockStyle.Fill;
tabPage2.Controls.Add(userControlFrm);
//userControlFrm.Window = this;
//userControlFrm.Dock = DockStyle.Fill;
//tabPage2.Controls.Add(userControlFrm);
}
/// <summary>
@ -267,7 +267,7 @@ namespace DHSoftware
cam.CameraIP = cameraBase.CameraIP;
cam.IsEnabled = cameraBase.IsEnabled;
Cameras.Add(cam);
//cam.CameraConnect();
cam.CameraConnect();
cam.OnHImageOutput += OnCameraHImageOutput;
}
else if (cameraBase.CamType == EnumCamType.hik)
@ -294,6 +294,7 @@ namespace DHSoftware
if (plcBase.PLCType == EnumPLCType.XC网口)
{
PLC.IP = plcBase.IP;
PLC.PLCType = plcBase.PLCType;
PLC.Enable = plcBase.Enable;
PLC.PLCName = plcBase.PLCName;
PLC.PLCItemList = plcBase.PLCItemList;
@ -321,8 +322,10 @@ namespace DHSoftware
detectionConfig.ModelHeight = detection.ModelHeight;
detectionConfig.In_lable_path = detection.In_lable_path;
detectionConfig.IsEnabled = detection.IsEnabled;
detectionConfig.ShowLocation.X = detection.ShowLocation.X;
detectionConfig.ShowLocation.Y = detection.ShowLocation.Y;
detectionConfig.ShowLocation.X = (i + 1) % 5+ (i + 1) / 5;
// detectionConfig.ShowLocation.X = detection.ShowLocation.X;
detectionConfig.ShowLocation.Y = (i + 1) / 5+1;
// detectionConfig.ShowLocation.Y = detection.ShowLocation.Y;
DetectionConfigs.Add(detectionConfig);
}
}
@ -354,6 +357,7 @@ namespace DHSoftware
//初始化模型 加载模型
_visionEngine.Init();
CtrlVisionRunBase ctrlVisionRun = new CtrlVisionRunBase(_visionEngine);
ctrlVisionRun.Dock = DockStyle.Fill;
tabImgDisplay.Controls.Add(ctrlVisionRun);
}
@ -581,10 +585,12 @@ namespace DHSoftware
PieceCount = 0;
//吹气点位归置
currentRegister = 411;
if (_PLCConfig?.Enable == true)
if (PLC?.Enable == true)
{
PLC.CountToZero();
PLC.OnNewPieces -= MainMotion_NewPieces;
PLC.OnNewPieces += MainMotion_NewPieces;
}
ConfigModel.CameraBaseList.ForEach(d =>
@ -691,7 +697,7 @@ namespace DHSoftware
PLCItem itemSpeed = PLC.PLCItemList.FirstOrDefault(u => u.Name == "转盘速度");
if (itemSpeed != null)
{
PLC.TurntableOpen(Convert.ToInt32(itemSpeed.Value), true);
PLC.TurntableOpen();
}
Thread.Sleep(500);