代码清理
This commit is contained in:
@ -4,25 +4,26 @@ using DH.Commons.Helper;
|
||||
using DH.Commons.Models;
|
||||
using DHSoftware.Utils;
|
||||
using DH.Commons.Base;
|
||||
|
||||
namespace DHSoftware.Views
|
||||
{
|
||||
public partial class SettingWindow : Window
|
||||
{
|
||||
private UserControl currControl;
|
||||
|
||||
|
||||
public SettingWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
BindEventHandler();
|
||||
InitData();
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 窗体对象实例
|
||||
/// </summary>
|
||||
private static SettingWindow _instance;
|
||||
|
||||
internal static SettingWindow Instance
|
||||
{
|
||||
get
|
||||
@ -32,159 +33,153 @@ namespace DHSoftware.Views
|
||||
return _instance;
|
||||
}
|
||||
}
|
||||
|
||||
private void BindEventHandler()
|
||||
{
|
||||
Resize += SettingWindow1_Resize;
|
||||
btnAdd.SelectedValueChanged += btnAdd_SelectedValueChanged;
|
||||
btnSave.Click += BtnSave_Click;
|
||||
menu1.SelectChanged += Menu1_SelectChanged;
|
||||
|
||||
}
|
||||
|
||||
private void Menu1_SelectChanged(object sender, MenuSelectEventArgs e)
|
||||
{
|
||||
|
||||
MenuItem clickedItem = e.Value;
|
||||
MenuItem clickedItem = e.Value;
|
||||
|
||||
if (clickedItem != null)
|
||||
if (clickedItem != null)
|
||||
{
|
||||
if (clickedItem.PARENTITEM == null)
|
||||
{
|
||||
if (clickedItem.PARENTITEM == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
switch (clickedItem.PARENTITEM.Text)
|
||||
{
|
||||
case "相机设置":
|
||||
foreach (var tab in tabs1.Pages)
|
||||
{
|
||||
if (tab is AntdUI.TabPage existingTab && existingTab.Text == $"{clickedItem.PARENTITEM.Text}-{clickedItem.Text}")
|
||||
{
|
||||
isUpdatingTabs = true;
|
||||
tabs1.SelectedTab = existingTab; // 直接跳转到已存在的 TabPage
|
||||
isUpdatingTabs = false;
|
||||
currControl = existingTab.Controls.Count > 0 ? existingTab.Controls[0] as UserControl : null;
|
||||
return;
|
||||
}
|
||||
}
|
||||
//先获取是否存在该名称的配置
|
||||
//如果没有新建项
|
||||
CameraBase? CameraBase = ConfigModel.CameraBaseList.Where(c => c.CameraName == clickedItem.Text).FirstOrDefault();
|
||||
if (CameraBase == null)
|
||||
{
|
||||
CameraBase = new CameraBase();
|
||||
}
|
||||
UserControl control = null;
|
||||
control = new CameraControl(this, CameraBase);
|
||||
if (control != null)
|
||||
{
|
||||
//容器添加控件,需要调整dpi
|
||||
control.Dock = DockStyle.Fill;
|
||||
AutoDpi(control);
|
||||
AntdUI.TabPage tabPage = new AntdUI.TabPage()
|
||||
{
|
||||
Text = $"{clickedItem.PARENTITEM.Text}-{clickedItem.Text}",
|
||||
ReadOnly = false,
|
||||
|
||||
};
|
||||
tabPage.Controls.Add(control);
|
||||
tabs1.Pages.Add(tabPage);
|
||||
isUpdatingTabs = true;
|
||||
tabs1.SelectedTab = tabPage;
|
||||
isUpdatingTabs = false;
|
||||
currControl = control;
|
||||
}
|
||||
break;
|
||||
case "工位设置":
|
||||
// 检查是否已存在同名 TabPage
|
||||
foreach (var tab in tabs1.Pages)
|
||||
{
|
||||
if (tab is AntdUI.TabPage existingTab && existingTab.Text == $"{clickedItem.PARENTITEM.Text}-{clickedItem.Text}")
|
||||
{
|
||||
isUpdatingTabs = true;
|
||||
tabs1.SelectedTab = existingTab; // 直接跳转到已存在的 TabPage
|
||||
isUpdatingTabs = false;
|
||||
currControl = existingTab.Controls.Count > 0 ? existingTab.Controls[0] as UserControl : null;
|
||||
return;
|
||||
}
|
||||
}
|
||||
DetectionConfig? detectionConfig = ConfigModel.DetectionList.Where(c => c.Name == clickedItem.Text).FirstOrDefault();
|
||||
if (detectionConfig == null)
|
||||
{
|
||||
detectionConfig = new DetectionConfig();
|
||||
}
|
||||
UserControl control1 = null;
|
||||
control1 = new DetectControl(this, detectionConfig);
|
||||
if (control1 != null)
|
||||
{
|
||||
//容器添加控件,需要调整dpi
|
||||
control1.Dock = DockStyle.Fill;
|
||||
AutoDpi(control1);
|
||||
AntdUI.TabPage tabPage = new AntdUI.TabPage()
|
||||
{
|
||||
Text = $"{clickedItem.PARENTITEM.Text}-{clickedItem.Text}",
|
||||
ReadOnly = false,
|
||||
|
||||
};
|
||||
tabPage.Controls.Add(control1);
|
||||
tabs1.Pages.Add(tabPage);
|
||||
isUpdatingTabs = true;
|
||||
tabs1.SelectedTab = tabPage;
|
||||
isUpdatingTabs = false;
|
||||
currControl = control1;
|
||||
}
|
||||
break;
|
||||
|
||||
case "运控设置":
|
||||
foreach (var tab in tabs1.Pages)
|
||||
{
|
||||
if (tab is AntdUI.TabPage existingTab && existingTab.Text == $"{clickedItem.PARENTITEM.Text}-{clickedItem.Text}")
|
||||
{
|
||||
isUpdatingTabs = true;
|
||||
tabs1.SelectedTab = existingTab; // 直接跳转到已存在的 TabPage
|
||||
isUpdatingTabs = false;
|
||||
currControl = existingTab.Controls.Count > 0 ? existingTab.Controls[0] as UserControl : null;
|
||||
return;
|
||||
}
|
||||
}
|
||||
//先获取是否存在该名称的配置
|
||||
//如果没有新建项
|
||||
PLCBase? pLCBase = ConfigModel.PLCBaseList.Where(c => c.PLCName == clickedItem.Text).FirstOrDefault();
|
||||
if (pLCBase == null)
|
||||
{
|
||||
pLCBase = new PLCBase();
|
||||
}
|
||||
UserControl control2 = null;
|
||||
control = new MotionControl(this, pLCBase);
|
||||
if (control != null)
|
||||
{
|
||||
//容器添加控件,需要调整dpi
|
||||
control.Dock = DockStyle.Fill;
|
||||
AutoDpi(control);
|
||||
AntdUI.TabPage tabPage = new AntdUI.TabPage()
|
||||
{
|
||||
Text = $"{clickedItem.PARENTITEM.Text}-{clickedItem.Text}",
|
||||
ReadOnly = false,
|
||||
|
||||
};
|
||||
tabPage.Controls.Add(control);
|
||||
tabs1.Pages.Add(tabPage);
|
||||
isUpdatingTabs = true;
|
||||
tabs1.SelectedTab = tabPage;
|
||||
isUpdatingTabs = false;
|
||||
currControl = control;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
switch (clickedItem.PARENTITEM.Text)
|
||||
{
|
||||
case "相机设置":
|
||||
foreach (var tab in tabs1.Pages)
|
||||
{
|
||||
if (tab is AntdUI.TabPage existingTab && existingTab.Text == $"{clickedItem.PARENTITEM.Text}-{clickedItem.Text}")
|
||||
{
|
||||
isUpdatingTabs = true;
|
||||
tabs1.SelectedTab = existingTab; // 直接跳转到已存在的 TabPage
|
||||
isUpdatingTabs = false;
|
||||
currControl = existingTab.Controls.Count > 0 ? existingTab.Controls[0] as UserControl : null;
|
||||
return;
|
||||
}
|
||||
}
|
||||
//先获取是否存在该名称的配置
|
||||
//如果没有新建项
|
||||
CameraBase? CameraBase = ConfigModel.CameraBaseList.Where(c => c.CameraName == clickedItem.Text).FirstOrDefault();
|
||||
if (CameraBase == null)
|
||||
{
|
||||
CameraBase = new CameraBase();
|
||||
}
|
||||
UserControl control = null;
|
||||
control = new CameraControl(this, CameraBase);
|
||||
if (control != null)
|
||||
{
|
||||
//容器添加控件,需要调整dpi
|
||||
control.Dock = DockStyle.Fill;
|
||||
AutoDpi(control);
|
||||
AntdUI.TabPage tabPage = new AntdUI.TabPage()
|
||||
{
|
||||
Text = $"{clickedItem.PARENTITEM.Text}-{clickedItem.Text}",
|
||||
ReadOnly = false,
|
||||
};
|
||||
tabPage.Controls.Add(control);
|
||||
tabs1.Pages.Add(tabPage);
|
||||
isUpdatingTabs = true;
|
||||
tabs1.SelectedTab = tabPage;
|
||||
isUpdatingTabs = false;
|
||||
currControl = control;
|
||||
}
|
||||
break;
|
||||
|
||||
case "工位设置":
|
||||
// 检查是否已存在同名 TabPage
|
||||
foreach (var tab in tabs1.Pages)
|
||||
{
|
||||
if (tab is AntdUI.TabPage existingTab && existingTab.Text == $"{clickedItem.PARENTITEM.Text}-{clickedItem.Text}")
|
||||
{
|
||||
isUpdatingTabs = true;
|
||||
tabs1.SelectedTab = existingTab; // 直接跳转到已存在的 TabPage
|
||||
isUpdatingTabs = false;
|
||||
currControl = existingTab.Controls.Count > 0 ? existingTab.Controls[0] as UserControl : null;
|
||||
return;
|
||||
}
|
||||
}
|
||||
DetectionConfig? detectionConfig = ConfigModel.DetectionList.Where(c => c.Name == clickedItem.Text).FirstOrDefault();
|
||||
if (detectionConfig == null)
|
||||
{
|
||||
detectionConfig = new DetectionConfig();
|
||||
}
|
||||
UserControl control1 = null;
|
||||
control1 = new DetectControl(this, detectionConfig);
|
||||
if (control1 != null)
|
||||
{
|
||||
//容器添加控件,需要调整dpi
|
||||
control1.Dock = DockStyle.Fill;
|
||||
AutoDpi(control1);
|
||||
AntdUI.TabPage tabPage = new AntdUI.TabPage()
|
||||
{
|
||||
Text = $"{clickedItem.PARENTITEM.Text}-{clickedItem.Text}",
|
||||
ReadOnly = false,
|
||||
};
|
||||
tabPage.Controls.Add(control1);
|
||||
tabs1.Pages.Add(tabPage);
|
||||
isUpdatingTabs = true;
|
||||
tabs1.SelectedTab = tabPage;
|
||||
isUpdatingTabs = false;
|
||||
currControl = control1;
|
||||
}
|
||||
break;
|
||||
|
||||
case "运控设置":
|
||||
foreach (var tab in tabs1.Pages)
|
||||
{
|
||||
if (tab is AntdUI.TabPage existingTab && existingTab.Text == $"{clickedItem.PARENTITEM.Text}-{clickedItem.Text}")
|
||||
{
|
||||
isUpdatingTabs = true;
|
||||
tabs1.SelectedTab = existingTab; // 直接跳转到已存在的 TabPage
|
||||
isUpdatingTabs = false;
|
||||
currControl = existingTab.Controls.Count > 0 ? existingTab.Controls[0] as UserControl : null;
|
||||
return;
|
||||
}
|
||||
}
|
||||
//先获取是否存在该名称的配置
|
||||
//如果没有新建项
|
||||
PLCBase? pLCBase = ConfigModel.PLCBaseList.Where(c => c.PLCName == clickedItem.Text).FirstOrDefault();
|
||||
if (pLCBase == null)
|
||||
{
|
||||
pLCBase = new PLCBase();
|
||||
}
|
||||
UserControl control2 = null;
|
||||
control = new MotionControl(this, pLCBase);
|
||||
if (control != null)
|
||||
{
|
||||
//容器添加控件,需要调整dpi
|
||||
control.Dock = DockStyle.Fill;
|
||||
AutoDpi(control);
|
||||
AntdUI.TabPage tabPage = new AntdUI.TabPage()
|
||||
{
|
||||
Text = $"{clickedItem.PARENTITEM.Text}-{clickedItem.Text}",
|
||||
ReadOnly = false,
|
||||
};
|
||||
tabPage.Controls.Add(control);
|
||||
tabs1.Pages.Add(tabPage);
|
||||
isUpdatingTabs = true;
|
||||
tabs1.SelectedTab = tabPage;
|
||||
isUpdatingTabs = false;
|
||||
currControl = control;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private float x; //定义当前窗体的宽度
|
||||
private float y; //定义当前窗体的高度
|
||||
|
||||
private void InitData()
|
||||
{
|
||||
btnAdd.Items.Clear();
|
||||
@ -196,68 +191,60 @@ namespace DHSoftware.Views
|
||||
y = Height;
|
||||
AdaptiveHelper.setTag(this);
|
||||
|
||||
|
||||
if (ConfigModel.CameraBaseList.Count > 0)
|
||||
if (ConfigModel.CameraBaseList.Count > 0)
|
||||
{
|
||||
var workstationItem = FindMenuItem(menu1.Items, "相机设置");
|
||||
|
||||
if (workstationItem != null)
|
||||
{
|
||||
var workstationItem = FindMenuItem(menu1.Items, "相机设置");
|
||||
|
||||
if (workstationItem != null)
|
||||
foreach (var item in ConfigModel.CameraBaseList)
|
||||
{
|
||||
foreach (var item in ConfigModel.CameraBaseList)
|
||||
{
|
||||
var newItem = new MenuItem();
|
||||
newItem.Text = item.CameraName;
|
||||
newItem.IconSvg = "VideoCameraOutlined";
|
||||
workstationItem.Sub.Add(newItem);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ConfigModel.DetectionList.Count > 0)
|
||||
{
|
||||
var workstationItem = FindMenuItem(menu1.Items, "工位设置");
|
||||
|
||||
if (workstationItem != null)
|
||||
{
|
||||
foreach (var item in ConfigModel.DetectionList)
|
||||
{
|
||||
var newItem = new MenuItem();
|
||||
newItem.Text = item.Name;
|
||||
newItem.IconSvg = "AppstoreOutlined";
|
||||
workstationItem.Sub.Add(newItem);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ConfigModel.PLCBaseList.Count > 0)
|
||||
{
|
||||
var workstationItem = FindMenuItem(menu1.Items, "运控设置");
|
||||
|
||||
if (workstationItem != null)
|
||||
{
|
||||
foreach (var item in ConfigModel.PLCBaseList)
|
||||
{
|
||||
var newItem = new MenuItem();
|
||||
newItem.Text = item.PLCName;
|
||||
newItem.IconSvg = "ControlOutlined";
|
||||
workstationItem.Sub.Add(newItem);
|
||||
|
||||
}
|
||||
var newItem = new MenuItem();
|
||||
newItem.Text = item.CameraName;
|
||||
newItem.IconSvg = "VideoCameraOutlined";
|
||||
workstationItem.Sub.Add(newItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ConfigModel.DetectionList.Count > 0)
|
||||
{
|
||||
var workstationItem = FindMenuItem(menu1.Items, "工位设置");
|
||||
|
||||
if (workstationItem != null)
|
||||
{
|
||||
foreach (var item in ConfigModel.DetectionList)
|
||||
{
|
||||
var newItem = new MenuItem();
|
||||
newItem.Text = item.Name;
|
||||
newItem.IconSvg = "AppstoreOutlined";
|
||||
workstationItem.Sub.Add(newItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ConfigModel.PLCBaseList.Count > 0)
|
||||
{
|
||||
var workstationItem = FindMenuItem(menu1.Items, "运控设置");
|
||||
|
||||
if (workstationItem != null)
|
||||
{
|
||||
foreach (var item in ConfigModel.PLCBaseList)
|
||||
{
|
||||
var newItem = new MenuItem();
|
||||
newItem.Text = item.PLCName;
|
||||
newItem.IconSvg = "ControlOutlined";
|
||||
workstationItem.Sub.Add(newItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void BtnSave_Click(object? sender, EventArgs e)
|
||||
{
|
||||
|
||||
ConfigHelper.SaveConfig();
|
||||
AntdUI.Message.success(this, "保存成功!", autoClose: 3);
|
||||
|
||||
ConfigHelper.SaveConfig();
|
||||
AntdUI.Message.success(this, "保存成功!", autoClose: 3);
|
||||
}
|
||||
|
||||
|
||||
private void SettingWindow1_Resize(object? sender, EventArgs e)
|
||||
{
|
||||
var newx = Width / x;
|
||||
@ -265,13 +252,6 @@ namespace DHSoftware.Views
|
||||
AdaptiveHelper.setControls(newx, newy, this);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 递归查找菜单项
|
||||
private MenuItem FindMenuItem(MenuItemCollection items, string targetText)
|
||||
{
|
||||
@ -287,17 +267,12 @@ namespace DHSoftware.Views
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool isUpdatingTabs = false;
|
||||
|
||||
private bool isUpdatingTabs = false;
|
||||
|
||||
private void menu1_MouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
|
||||
if (e.Button == MouseButtons.Right)
|
||||
if (e.Button == MouseButtons.Right)
|
||||
{
|
||||
|
||||
// 转换坐标到控件内部坐标系(考虑滚动条)
|
||||
Point clickPoint = new Point(e.X, e.Y + menu1.ScrollBar.Value);
|
||||
|
||||
@ -315,7 +290,7 @@ namespace DHSoftware.Views
|
||||
{
|
||||
case "相机设置":
|
||||
var menulist = new AntdUI.IContextMenuStripItem[]
|
||||
{
|
||||
{
|
||||
new AntdUI.ContextMenuStripItem("重命名", "")
|
||||
{
|
||||
IconSvg = "RetweetOutlined"
|
||||
@ -324,7 +299,6 @@ namespace DHSoftware.Views
|
||||
{
|
||||
IconSvg = "DeleteOutlined"
|
||||
}
|
||||
|
||||
};
|
||||
AntdUI.ContextMenuStrip.open(menu1, it =>
|
||||
{
|
||||
@ -346,6 +320,7 @@ namespace DHSoftware.Views
|
||||
}
|
||||
ConfigModel.CameraBaseList.RemoveAll(c => c.CameraName == clickedItem.Text);
|
||||
break;
|
||||
|
||||
case "重命名":
|
||||
// 保存原始名称用于查找
|
||||
string originalName = clickedItem.Text;
|
||||
@ -374,7 +349,7 @@ namespace DHSoftware.Views
|
||||
return;
|
||||
}
|
||||
|
||||
clickedItem.Text= newName;
|
||||
clickedItem.Text = newName;
|
||||
var camera = ConfigModel.CameraBaseList.FirstOrDefault(c =>
|
||||
c.CameraName.Equals(originalName, StringComparison.OrdinalIgnoreCase));
|
||||
camera.CameraName = newName;
|
||||
@ -393,9 +368,9 @@ namespace DHSoftware.Views
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
}, menulist);
|
||||
break;
|
||||
|
||||
case "工位设置":
|
||||
var menulist1 = new AntdUI.IContextMenuStripItem[]
|
||||
{ new AntdUI.ContextMenuStripItem("重命名", "")
|
||||
@ -406,7 +381,6 @@ namespace DHSoftware.Views
|
||||
{
|
||||
IconSvg = "DeleteOutlined"
|
||||
}
|
||||
|
||||
};
|
||||
AntdUI.ContextMenuStrip.open(menu1, it =>
|
||||
{
|
||||
@ -427,6 +401,7 @@ namespace DHSoftware.Views
|
||||
}
|
||||
ConfigModel.DetectionList.RemoveAll(c => c.Name == clickedItem.Text);
|
||||
break;
|
||||
|
||||
case "重命名":
|
||||
// 保存原始名称用于查找
|
||||
string originalName = clickedItem.Text;
|
||||
@ -479,7 +454,7 @@ namespace DHSoftware.Views
|
||||
|
||||
case "运控设置":
|
||||
var menulist2 = new AntdUI.IContextMenuStripItem[]
|
||||
{
|
||||
{
|
||||
new AntdUI.ContextMenuStripItem("重命名", "")
|
||||
{
|
||||
IconSvg = "RetweetOutlined"
|
||||
@ -488,13 +463,12 @@ namespace DHSoftware.Views
|
||||
{
|
||||
IconSvg = "DeleteOutlined"
|
||||
}
|
||||
|
||||
};
|
||||
AntdUI.ContextMenuStrip.open(menu1, it =>
|
||||
{
|
||||
switch (it.Text)
|
||||
{
|
||||
case "删除运控":
|
||||
switch (it.Text)
|
||||
{
|
||||
case "删除运控":
|
||||
menu1.Remove(clickedItem);
|
||||
foreach (var tab in tabs1.Pages)
|
||||
{
|
||||
@ -512,7 +486,8 @@ namespace DHSoftware.Views
|
||||
ConfigModel.PLCBaseList.RemoveAll(c => c.PLCName == clickedItem.Text);
|
||||
|
||||
break;
|
||||
case "重命名":
|
||||
|
||||
case "重命名":
|
||||
|
||||
var form = new AddMotionControl(this, "重命名运动控制操作") { Size = new Size(300, 200) };
|
||||
AntdUI.Modal.open(new AntdUI.Modal.Config(this, "", form, TType.None)
|
||||
@ -553,23 +528,15 @@ namespace DHSoftware.Views
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}, menulist2);
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private MenuItem FindClickedItem(MenuItemCollection items, Point clickPoint)
|
||||
{
|
||||
foreach (MenuItem item in items)
|
||||
@ -590,20 +557,17 @@ namespace DHSoftware.Views
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void btnAdd_SelectedValueChanged(object sender, ObjectNEventArgs e)
|
||||
{
|
||||
string selectedValue = e.Value.ToString();
|
||||
switch (selectedValue)
|
||||
switch (selectedValue)
|
||||
{
|
||||
case "相机设置":
|
||||
var workstationItem = FindMenuItem(menu1.Items, "相机设置");
|
||||
|
||||
if (workstationItem != null)
|
||||
{
|
||||
|
||||
var form = new AddCameraControl(this,"新增相机操作") { Size = new Size(300, 200) };
|
||||
var form = new AddCameraControl(this, "新增相机操作") { Size = new Size(300, 200) };
|
||||
AntdUI.Modal.open(new AntdUI.Modal.Config(this, "", form, TType.None)
|
||||
{
|
||||
BtnHeight = 0,
|
||||
@ -627,14 +591,14 @@ namespace DHSoftware.Views
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case "工位设置":
|
||||
// 查找工位设置项
|
||||
var workstationItem1= FindMenuItem(menu1.Items, "工位设置");
|
||||
var workstationItem1 = FindMenuItem(menu1.Items, "工位设置");
|
||||
|
||||
if (workstationItem1 != null)
|
||||
{
|
||||
|
||||
var form = new AddCubicleControl(this,"新增工位操作") { Size = new Size(300, 200) };
|
||||
var form = new AddCubicleControl(this, "新增工位操作") { Size = new Size(300, 200) };
|
||||
AntdUI.Modal.open(new AntdUI.Modal.Config(this, "", form, TType.None)
|
||||
{
|
||||
BtnHeight = 0,
|
||||
@ -647,7 +611,7 @@ namespace DHSoftware.Views
|
||||
if (!workstationItem1.Sub.Cast<MenuItem>().Any(m => m.Text == newItem.Text))
|
||||
{
|
||||
workstationItem1.Sub.Add(newItem);
|
||||
DetectionConfig detection = new DetectionConfig();
|
||||
DetectionConfig detection = new DetectionConfig();
|
||||
detection.Name = form.CubicleName;
|
||||
ConfigModel.DetectionList.Add(detection);
|
||||
}
|
||||
@ -658,13 +622,13 @@ namespace DHSoftware.Views
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case "运控设置":
|
||||
var workstationItem2 = FindMenuItem(menu1.Items, "运控设置");
|
||||
|
||||
if (workstationItem2 != null)
|
||||
{
|
||||
|
||||
var form = new AddMotionControl(this,"新增运动控制操作") { Size = new Size(300, 200) };
|
||||
var form = new AddMotionControl(this, "新增运动控制操作") { Size = new Size(300, 200) };
|
||||
AntdUI.Modal.open(new AntdUI.Modal.Config(this, "", form, TType.None)
|
||||
{
|
||||
BtnHeight = 0,
|
||||
@ -691,5 +655,4 @@ namespace DHSoftware.Views
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user