8 Commits

Author SHA1 Message Date
TD
09c2eb37fe 修改界面 2025-03-25 15:33:35 +08:00
TD
2a6019bfbd 初步界面测试 2025-03-25 13:56:48 +08:00
fabc7606e7 代码清理 2025-03-24 19:24:16 +08:00
fb1ae0bb08 修改标签 2025-03-24 19:20:16 +08:00
8619d8ba2e yb 2025-03-24 19:04:03 +08:00
b60d2759b1 修改标签路径 2025-03-24 19:03:30 +08:00
959a2bf642 只有在没数据库的情况下才初始化种子 2025-03-24 18:41:23 +08:00
cb7e216b3a 提交单例模式释放错误 2025-03-24 18:26:01 +08:00
20 changed files with 1166 additions and 754 deletions

View File

@ -752,7 +752,17 @@ namespace DH.Commons.Base
[Description("中处理-模型标签路径")] [Description("中处理-模型标签路径")]
public string In_lable_path public string In_lable_path
{ {
get => _in_lable_path; get
{
if (string.IsNullOrEmpty(ModelPath) || string.IsNullOrWhiteSpace(ModelPath))
{
return string.Empty;
}
string dir = Path.GetDirectoryName(ModelPath);
string file = $"{Path.GetFileNameWithoutExtension(ModelPath)}.txt";
return Path.Combine(dir, file);
}
set set
{ {
if (_in_lable_path == value) return; if (_in_lable_path == value) return;

View File

@ -71,38 +71,45 @@ namespace DH.Commons.Enums
public enum EnumPLCOutputIO public enum EnumPLCOutputIO
{ {
=0, =0,
=1, ,
使=2, 使,
=3, ,
=4, ,
绿=5, 绿,
=6, ,
=7, ,
=8, ,
=9, ,
=10, ,
1=11, 1,
2=12, 2,
3=13, 3,
4=14, 4,
5=15, 5,
6 = 16, 6 ,
7 = 17, 7 ,
8 = 18, 8 ,
9 = 19, 9 ,
10 = 20, 10 ,
OK料盒 =21, OK料盒 ,
NG料盒=22, NG料盒,
OK吹气时间=23, OK吹气时间,
NG吹气时间=24, NG吹气时间,
=25, ,
=26, ,
=27, ,
=28, ,
=29, ,
=30, ,
, ,
, ,
,
,
,
,
OK脉冲,
NG脉冲,

View File

@ -1,7 +1,9 @@
using System; using System;
using System.Diagnostics;
using System.IO; using System.IO;
using System.Text.Json; using System.Text.Json;
using System.Text.Json.Serialization; using System.Text.Json.Serialization;
using AntdUI;
using DH.Commons.Base; using DH.Commons.Base;
using DH.Commons.Models; using DH.Commons.Models;
@ -88,6 +90,11 @@ namespace DH.Commons.Helper
Directory.CreateDirectory(CurrentBackupDir); Directory.CreateDirectory(CurrentBackupDir);
File.Copy(CurrentConfigPath, backupPath); File.Copy(CurrentConfigPath, backupPath);
} }
//重置标签文件路径和内容
ConfigModel.DetectionList.ForEach(config =>
{
GenerateLabelFile(config);
});
// 序列化当前配置 // 序列化当前配置
var json = JsonSerializer.Serialize(new var json = JsonSerializer.Serialize(new
@ -100,7 +107,39 @@ namespace DH.Commons.Helper
// 写入新配置 // 写入新配置
File.WriteAllText(CurrentConfigPath, json); File.WriteAllText(CurrentConfigPath, json);
} }
private static void GenerateLabelFile(DetectionConfig config)
{
try
{
if (config.DetectionLableList == null || string.IsNullOrEmpty(config.In_lable_path))
return;
// 确保目录存在
var directory = Path.GetDirectoryName(config.In_lable_path);
if (!string.IsNullOrEmpty(directory) && !Directory.Exists(directory))
{
Directory.CreateDirectory(directory);
}
// 写入文件内容
using (var writer = new StreamWriter(config.In_lable_path, false))
{
foreach (var label in config.DetectionLableList)
{
// 根据实际需求格式化输出
writer.WriteLine(label.LabelName.ToString()); // 假设DetectionLable重写了ToString()
// 或者明确指定格式:
// writer.WriteLine($"{label.Id},{label.Name},{label.Confidence}");
}
}
}
catch (Exception ex)
{
Debug.WriteLine($"生成标签文件失败: {ex.Message}");
// 可以考虑记录更详细的日志
}
}
/// <summary> /// <summary>
/// 加载当前方案配置 /// 加载当前方案配置
/// </summary> /// </summary>

View File

@ -13,6 +13,7 @@ using DH.Commons.Enums;
using HslCommunication; using HslCommunication;
using HslCommunication.Enthernet; using HslCommunication.Enthernet;
using HslCommunication.Profinet.XINJE; using HslCommunication.Profinet.XINJE;
using OpenCvSharp;
namespace DH.Devices.PLC namespace DH.Devices.PLC
{ {
@ -59,7 +60,7 @@ namespace DH.Devices.PLC
TcpNet.Write("M122", true); TcpNet.Write("M122", true);
MonitorPieces(); MonitorPieces();
TurntableStop(); TurntableStop();
PrepareMotion();//心跳监听
return true; return true;
} }
else else
@ -440,6 +441,22 @@ namespace DH.Devices.PLC
OnNewPieces?.Invoke(axisIndex, pieceNumber); OnNewPieces?.Invoke(axisIndex, pieceNumber);
}); });
}
public async Task HeartbeatAsync1()
{
while (Connected)
{
PLCItem pLCItem = PLCItemList.FirstOrDefault(u => u.Name == "心跳地址");
if (pLCItem == null)
return;
string HeartbeatAddress = pLCItem.Type + pLCItem.Address;
TcpNet.Write(HeartbeatAddress, true);
await Task.Delay(900); // 非阻塞等待1秒
}
} }
/// <summary> /// <summary>
/// 入料监听 /// 入料监听
@ -451,6 +468,7 @@ namespace DH.Devices.PLC
PLCItem pLCItem= PLCItemList.FirstOrDefault(u => u.Name == "产品计数"); PLCItem pLCItem= PLCItemList.FirstOrDefault(u => u.Name == "产品计数");
if (pLCItem == null) if (pLCItem == null)
return; return;
string Count = pLCItem.Type + pLCItem.Address;
DateTime startTime = DateTime.Now; DateTime startTime = DateTime.Now;
DateTime endTime = startTime; DateTime endTime = startTime;
TimeSpan timeSpan = endTime - startTime; TimeSpan timeSpan = endTime - startTime;
@ -462,7 +480,8 @@ namespace DH.Devices.PLC
uint tmpPieceNumber = 0; uint tmpPieceNumber = 0;
sw.Start(); sw.Start();
var ret = TcpNet.ReadUInt16("D1016"); // var ret = TcpNet.ReadUInt16("D1016");
var ret = TcpNet.ReadUInt16(Count);
sw.Stop(); sw.Stop();
if (ret.IsSuccess) if (ret.IsSuccess)
@ -504,51 +523,539 @@ namespace DH.Devices.PLC
/// <summary> /// <summary>
/// 转盘开启操作 /// 转盘开启操作
/// </summary> /// </summary>
public void TurntableOpen(int speed, bool Direction) public void TurntableOpen()
{ {
WriteBool("M122", true); PLCItem pLCItem = PLCItemList.FirstOrDefault(u => u.Name == "计数清零");
if (pLCItem == null)
return;
string CountToZero = pLCItem.Type + pLCItem.Address;
PLCItem DiskSpeedItem = PLCItemList.FirstOrDefault(u => u.Name == "转盘速度");
if (DiskSpeedItem == null)
return;
string diskSpeedadress = DiskSpeedItem.Type + DiskSpeedItem.Address;
int diskSpeedValue= Convert.ToInt32( DiskSpeedItem.Value);
PLCItem DiskDirectionItem = PLCItemList.FirstOrDefault(u => u.Name == "转盘方向");
if (DiskDirectionItem == null)
return;
string diskDirectionadress = DiskDirectionItem.Type + DiskDirectionItem.Address;
bool Direction =Convert.ToBoolean( DiskDirectionItem.Value);
PLCItem DiskOpenItem = PLCItemList.FirstOrDefault(u => u.Name == "转盘使能");
if (DiskOpenItem == null)
return;
string diskopenadress = DiskOpenItem.Type + DiskOpenItem.Address;
PLCItem DiskRunItem = PLCItemList.FirstOrDefault(u => u.Name == "转盘启动");
if (DiskRunItem == null)
return;
string diskadress = DiskRunItem.Type + DiskRunItem.Address;
WriteBool(CountToZero, true);
Thread.Sleep(10); Thread.Sleep(10);
WriteBool("M10", false); WriteBool("M10", false);
Thread.Sleep(10); Thread.Sleep(10);
//速度 //速度
TcpNet.Write("HD10", (ushort)speed); TcpNet.Write(diskSpeedadress, (ushort)diskSpeedValue);
Thread.Sleep(10); Thread.Sleep(10);
//方向 //方向
WriteBool("M1", Direction); WriteBool(diskDirectionadress, Direction);
Thread.Sleep(10); Thread.Sleep(10);
//使能 //使能
WriteBool("M2", true); WriteBool(diskopenadress, true);
Thread.Sleep(10); Thread.Sleep(10);
//启动 //启动
WriteBool("M0", true); WriteBool(diskadress, true);
//WriteBool("M122", true);
//Thread.Sleep(10);
//WriteBool("M10", false);
//Thread.Sleep(10);
////速度
//TcpNet.Write("HD10", (ushort)10000);
//Thread.Sleep(10);
////方向
//WriteBool("M1", Direction);
//Thread.Sleep(10);
////使能
//WriteBool("M2", true);
//Thread.Sleep(10);
////启动
//WriteBool("M0", true);
Thread.Sleep(10); Thread.Sleep(10);
// _mainMotion.CurrentState = DeviceState.DSOpen; // _mainMotion.CurrentState = DeviceState.DSOpen;
piecesCount = 0; piecesCount = 0;
} }
/// <summary> /// <summary>
/// 转盘停止操作 /// 转盘停止操作
/// </summary> /// </summary>
public void TurntableStop() public void TurntableStop()
{ {
WriteBool("M122", true); PLCItem pLCItem = PLCItemList.FirstOrDefault(u => u.Name == "计数清零");
if (pLCItem == null)
return;
string CountToZero = pLCItem.Type + pLCItem.Address;
PLCItem DiskRunItem = PLCItemList.FirstOrDefault(u => u.Name == "转盘启动");
if (DiskRunItem == null)
return;
string diskadress = DiskRunItem.Type + DiskRunItem.Address;
PLCItem DiskOpenItem = PLCItemList.FirstOrDefault(u => u.Name == "转盘使能");
if (DiskOpenItem == null)
return;
string diskopenadress = DiskOpenItem.Type + DiskOpenItem.Address;
WriteBool(CountToZero, true);
Thread.Sleep(50); Thread.Sleep(50);
WriteBool("M0", false); WriteBool(diskadress, false);
Thread.Sleep(50); Thread.Sleep(50);
WriteBool("M2", false); WriteBool(diskopenadress, false);
Thread.Sleep(50); Thread.Sleep(50);
WriteBool("M50", false); WriteBool("M10", false);
//WriteBool("M122", true);
//Thread.Sleep(50);
//WriteBool("M0", false);
//Thread.Sleep(50);
//WriteBool("M2", false);
//Thread.Sleep(50);
//WriteBool("M50", false);
piecesCount = 0; piecesCount = 0;
} }
private void PrepareMotion()
{
//心跳
//if (X018PLCConfig.Heartbeat)
//{
Task.Run(async () => await HeartbeatAsync1());
//}
////写入工件最大值、最小值
ProjectValue();
////写入工位脉冲
Workstation1Pulse();
Workstation2Pulse();
Workstation3Pulse();
Workstation4Pulse();
Workstation5Pulse();
////写入吹气时间
ChuiQiTime();
////写入吹气脉冲
OKPulse();
NGPulse();
//if (_GC01Driver == null)
//{
// _GC01Driver = DeviceCollection.FirstOrDefault(u => u is GC01Driver) as GC01Driver;
//}
//if (_GC01Driver == null)
//{
// throw new ProcessException($"未能获取激光位移传感器驱动");
//}
//if (_vibrationDriver == null)
//{
// _vibrationDriver = DeviceCollection.FirstOrDefault(u => u is JYDAMDriver) as JYDAMDriver;
//}
//if (_vibrationDriver == null)
//{
// throw new ProcessException($"未能获取振动盘控制器驱动");
//}
// ResetTimer = new Timer(FullResetProcessExcute, null, -1, -1);
//feedingProductTimer = new Timer(FeedingProductTriggerExcute, null, -1, -1);
//feedingProductTimerTimer = new Timer(UpdateFeedingProductTrigger, null, -1, -1);
//_mainMotion.OnAxisPositionChanged -= MainMotion_OnAxisPositionChanged;
//_mainMotion.OnAxisPositionChanged += MainMotion_OnAxisPositionChanged;
//_mainMotion.OnCapturePositionChanged -= MainMotion_OnCapturePositionChanged;
//_mainMotion.OnCapturePositionChanged += MainMotion_OnCapturePositionChanged;
// _mainMotion.OnNewPieces -= MainMotion_NewPieces;
// _mainMotion.OnNewPieces += MainMotion_NewPieces;
//_mainMotion.OnAlarmVibrationDisk -= MainMotion_AlarmVibrationDisk;
//_mainMotion.OnAlarmVibrationDisk += MainMotion_AlarmVibrationDisk;
// PrepareLightIndexes();
}
/// <summary>
/// 挡料电机操作
/// true: 顺时针
/// False: 逆时针
/// </summary>
/// <param name="u"></param>
public void FeedingMotor( bool direction)
{
// 设置最大等待时间,假设为 3 秒
int timeout = 3000;
int elapsedTime = 0;
int checkInterval = 100; // 每次检查等待 100ms
PLCItem pLCItem = PLCItemList.FirstOrDefault(u => u.Name == "挡料电机回原点");
if (pLCItem == null)
return;
PLCItem zerospeeditem = PLCItemList.FirstOrDefault(u => u.Name == "挡料电机回原点速度");
if (zerospeeditem == null)
return;
PLCItem CunSpeed = PLCItemList.FirstOrDefault(u => u.Name == "挡料电机速度");
if (CunSpeed == null)
return;
PLCItem CunClockwiseItem = PLCItemList.FirstOrDefault(u => u.Name == "挡料电机顺时针");
if (CunClockwiseItem == null)
return;
PLCItem CunCounterclockwiseItem = PLCItemList.FirstOrDefault(u => u.Name == "挡料电机逆时针");
if (CunCounterclockwiseItem == null)
return;
PLCItem CunPosItem = PLCItemList.FirstOrDefault(u => u.Name == "挡料电机位置");
if (CunPosItem == null)
return;
string CunToZero = pLCItem.Type + pLCItem.Address;
string CunToZeroSpeed = zerospeeditem.Type + zerospeeditem.Address;
string CunSpeedadress = CunSpeed.Type + CunSpeed.Address;
string CunClockwise = CunClockwiseItem.Type + CunClockwiseItem.Address;
string CunCounterclockwise = CunCounterclockwiseItem.Type + CunCounterclockwiseItem.Address;
string CunPos = CunPosItem.Type + CunPosItem.Address;
short zerospeed = (short)Convert.ToInt32(zerospeeditem.Value);
short cunSpeed = (short)Convert.ToInt32(CunSpeed.Value);
short u = (short)Convert.ToInt32(CunPosItem.Value);
// WriteBool(CountToZero, true);
// 检查是否不在原点,如果不在,则回原点
if (!ReadBool(CunToZero))
{
WriteShort(CunToZeroSpeed, (short)zerospeed); // 速度
Thread.Sleep(10);
// 发送回原点指令
WriteBool(CunToZero, true);
Thread.Sleep(1000); // 给设备一些时间响应
// 等待回到原点
while (!ReadBool(CunToZero))
{
if (elapsedTime >= timeout)
{
break;
}
Thread.Sleep(checkInterval);
elapsedTime += checkInterval;
}
}
// 无论是刚回到原点还是已经在原点,执行目标位置、速度和方向设置
WriteShort(CunSpeedadress, (short)cunSpeed);
Thread.Sleep(2000);
string dir = string.Empty;
if (direction)
{
WriteBool(CunClockwise, true); // 顺时针转动
dir = "顺时针";
}
else
{
WriteBool(CunCounterclockwise, true); // 逆时针转动
dir = "逆时针";
}
Thread.Sleep(10);
WriteShort(CunPos, (short)u); // 目标位置
Thread.Sleep(2000);
}
/// <summary> /// <summary>
/// 计数清零 /// 计数清零
/// </summary> /// </summary>
public void CountToZero() public void CountToZero()
{ {
WriteBool("M120", true); PLCItem pLCItem = PLCItemList.FirstOrDefault(u => u.Name == "计数清零");
if (pLCItem == null)
return;
string CountToZero = pLCItem.Type + pLCItem.Address;
WriteBool(CountToZero, true);
Thread.Sleep(10);
}
public void RedLight(bool b)
{
PLCItem pLCItem = PLCItemList.FirstOrDefault(u => u.Name == "指示灯红");
if (pLCItem == null)
return;
string RedLight = pLCItem.Type + pLCItem.Address;
WriteBool(RedLight, b);
Thread.Sleep(10);
}
public void GreenLight(bool b)
{
PLCItem pLCItem = PLCItemList.FirstOrDefault(u => u.Name == "指示灯绿");
if (pLCItem == null)
return;
string Light = pLCItem.Type + pLCItem.Address;
WriteBool(Light, b);
// WriteBool(IIConfig.GreenLight, b);
Thread.Sleep(10);
} }
public void YellowLight(bool b)
{
PLCItem pLCItem = PLCItemList.FirstOrDefault(u => u.Name == "指示灯黄");
if (pLCItem == null)
return;
string Light = pLCItem.Type + pLCItem.Address;
WriteBool(Light, b);
Thread.Sleep(10);
}
public void Buzzer(bool b)
{
PLCItem pLCItem = PLCItemList.FirstOrDefault(u => u.Name == "蜂鸣器");
if (pLCItem == null)
return;
string Light = pLCItem.Type + pLCItem.Address;
WriteBool(Light, b);
Thread.Sleep(10);
}
public void Belt(bool b)
{
PLCItem pLCItem = PLCItemList.FirstOrDefault(u => u.Name == "皮带");
if (pLCItem == null)
return;
string Light = pLCItem.Type + pLCItem.Address;
WriteBool(Light, b);
Thread.Sleep(10);
}
public void Workstation1Pulse()
{
PLCItem pLCItem = PLCItemList.FirstOrDefault(u => u.Name == "工位1");
if (pLCItem == null)
return;
string Workstation1Pulse = pLCItem.Type + pLCItem.Address;
int Pulse=Convert.ToInt32(pLCItem.Value);
string result = Regex.Replace(Workstation1Pulse, @"\D", "");
int r = Convert.ToInt32(result) + 1;
result = "HD" + r.ToString();
short high = (short)(Pulse >> 16); // 高 16 位
short low = (short)(Pulse & 0xFFFF); // 低 16 位
WriteShort(result, high);
Thread.Sleep(10);
WriteShort(Workstation1Pulse, low);
Thread.Sleep(10);
}
public void Workstation2Pulse()
{
PLCItem pLCItem = PLCItemList.FirstOrDefault(u => u.Name == "工位2");
if (pLCItem == null)
return;
string Workstation1Pulse = pLCItem.Type + pLCItem.Address;
int Pulse=Convert.ToInt32(pLCItem.Value);
string result = Regex.Replace(Workstation1Pulse, @"\D", "");
int r = Convert.ToInt32(result) + 1;
result = "HD" + r.ToString();
short high = (short)(Pulse >> 16); // 高 16 位
short low = (short)(Pulse & 0xFFFF); // 低 16 位
WriteShort(result, high);
Thread.Sleep(10);
WriteShort(Workstation1Pulse, low);
Thread.Sleep(10);
}
public void Workstation3Pulse()
{
PLCItem pLCItem = PLCItemList.FirstOrDefault(u => u.Name == "工位3");
if (pLCItem == null)
return;
string Workstation1Pulse = pLCItem.Type + pLCItem.Address;
int Pulse = Convert.ToInt32(pLCItem.Value);
string result = Regex.Replace(Workstation1Pulse, @"\D", "");
int r = Convert.ToInt32(result) + 1;
result = "HD" + r.ToString();
short high = (short)(Pulse >> 16); // 高 16 位
short low = (short)(Pulse & 0xFFFF); // 低 16 位
WriteShort(result, high);
Thread.Sleep(10);
WriteShort(Workstation1Pulse, low);
Thread.Sleep(10);
}
public void Workstation4Pulse()
{
PLCItem pLCItem = PLCItemList.FirstOrDefault(u => u.Name == "工位4");
if (pLCItem == null)
return;
string Workstation1Pulse = pLCItem.Type + pLCItem.Address;
int Pulse = Convert.ToInt32(pLCItem.Value);
string result = Regex.Replace(Workstation1Pulse, @"\D", "");
int r = Convert.ToInt32(result) + 1;
result = "HD" + r.ToString();
short high = (short)(Pulse >> 16); // 高 16 位
short low = (short)(Pulse & 0xFFFF); // 低 16 位
WriteShort(result, high);
Thread.Sleep(10);
WriteShort(Workstation1Pulse, low);
Thread.Sleep(10);
}
public void Workstation5Pulse()
{
PLCItem pLCItem = PLCItemList.FirstOrDefault(u => u.Name == "工位5");
if (pLCItem == null)
return;
string Workstation1Pulse = pLCItem.Type + pLCItem.Address;
int Pulse = Convert.ToInt32(pLCItem.Value);
string result = Regex.Replace(Workstation1Pulse, @"\D", "");
int r = Convert.ToInt32(result) + 1;
result = "HD" + r.ToString();
short high = (short)(Pulse >> 16); // 高 16 位
short low = (short)(Pulse & 0xFFFF); // 低 16 位
WriteShort(result, high);
Thread.Sleep(10);
WriteShort(Workstation1Pulse, low);
Thread.Sleep(10);
}
public void ProjectValue()
{
PLCItem pLCItemmax = PLCItemList.FirstOrDefault(u => u.Name == "工件最大值");
if (pLCItemmax == null)
return;
PLCItem pLCItemmin = PLCItemList.FirstOrDefault(u => u.Name == "工件最小值");
if (pLCItemmin == null)
return;
int productMax =Convert.ToInt32( pLCItemmax.Value);
int productMin = Convert.ToInt32( pLCItemmin.Value);
string ProductMax = pLCItemmax.Type + pLCItemmax.Address;
string ProductMin = pLCItemmin.Type + pLCItemmin.Address;
WriteShort(ProductMax, (short)productMax);
Thread.Sleep(10);
WriteShort(ProductMin, (short)productMin);
Thread.Sleep(10);
}
public void OKPulse()
{
PLCItem pLCItem = PLCItemList.FirstOrDefault(u => u.Name == "OK脉冲");
if (pLCItem == null)
return;
string OKPulse = pLCItem.Type + pLCItem.Address;
int Pulse =Convert.ToInt32( pLCItem.Value);
string result = Regex.Replace(OKPulse, @"\D", "");
int r = Convert.ToInt32(result) + 1;
result = "HD" + r.ToString();
short high = (short)(Pulse >> 16); // 高 16 位
short low = (short)(Pulse & 0xFFFF); // 低 16 位
WriteShort(result, high);
Thread.Sleep(10);
WriteShort(OKPulse, low);
Thread.Sleep(10);
}
public void NGPulse()
{
PLCItem pLCItem = PLCItemList.FirstOrDefault(u => u.Name == "NG脉冲");
if (pLCItem == null)
return;
string NGPulse = pLCItem.Type + pLCItem.Address;
int Pulse=Convert.ToInt32(pLCItem.Value);
string result = Regex.Replace(NGPulse, @"\D", "");
int r = Convert.ToInt32(result) + 1;
result = "HD" + r.ToString();
short high = (short)(Pulse >> 16); // 高 16 位
short low = (short)(Pulse & 0xFFFF); // 低 16 位
WriteShort(result, high);
Thread.Sleep(10);
WriteShort(NGPulse, low);
Thread.Sleep(10);
}
public void TurnClear(bool b)
{
PLCItem pLCItem = PLCItemList.FirstOrDefault(u => u.Name == "转盘清料");
if (pLCItem == null)
return;
string TurnClear = pLCItem.Type + pLCItem.Address;
WriteBool(TurnClear, b);
Thread.Sleep(10);
}
public void OpenHeartbeat(bool v)
{
PLCItem pLCItem = PLCItemList.FirstOrDefault(u => u.Name == "心跳功能");
if (pLCItem == null)
return;
string Heartbeat = pLCItem.Type + pLCItem.Address;
WriteBool(Heartbeat, v);
Thread.Sleep(10);
}
public void Vibratory(bool v)
{
PLCItem pLCItem = PLCItemList.FirstOrDefault(u => u.Name == "振动盘");
if (pLCItem == null)
return;
string Vibratory = pLCItem.Type + pLCItem.Address;
WriteBool(Vibratory, v);
Thread.Sleep(10);
}
public void ChuiQiTime()
{
PLCItem pLCItem = PLCItemList.FirstOrDefault(u => u.Name == "吹气时间");
if (pLCItem == null)
return;
string ChuiQiTime = pLCItem.Type + pLCItem.Address;
short time = (short)Convert.ToInt32(pLCItem.Value);
WriteShort(ChuiQiTime, time);
Thread.Sleep(10);
}
} }
} }

View File

@ -1,10 +1,4 @@
using System; namespace DHSoftware.Languages
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DHSoftware.Languages
{ {
public class Localizer_enus : AntdUI.ILocalization public class Localizer_enus : AntdUI.ILocalization
{ {
@ -14,125 +8,182 @@ namespace DHSoftware.Languages
{ {
case "search": case "search":
return "Search"; return "Search";
case "welcome": case "welcome":
return "Welcome to the AntdUI Demo"; return "Welcome to the AntdUI Demo";
case "home": case "home":
return "Home"; return "Home";
case "closeall": case "closeall":
return "Close all tabs"; return "Close all tabs";
#region systemset #region systemset
case "systemset": case "systemset":
return "System Settings"; return "System Settings";
case "baseset": case "baseset":
return "Basic Settings"; return "Basic Settings";
case "messageconfig": case "messageconfig":
return "Message configuration"; return "Message configuration";
case "animationon": case "animationon":
return "Turn on animation"; return "Turn on animation";
case "shadowon": case "shadowon":
return "Enable shadow"; return "Enable shadow";
case "scrollbarhide": case "scrollbarhide":
return "Hide scrollbar"; return "Hide scrollbar";
case "showinwindow": case "showinwindow":
return "Show in window"; return "Show in window";
case "windowOffsetXY": case "windowOffsetXY":
return "WindowOffsetXY"; return "WindowOffsetXY";
case "tip": case "tip":
return "Tip"; return "Tip";
case "switchsuccess": case "switchsuccess":
return "Switch successful."; return "Switch successful.";
#endregion
#endregion systemset
#region Button #region Button
case "Button.Text": case "Button.Text":
return "Button"; return "Button";
case "Button.Description": case "Button.Description":
return "To trigger an operation."; return "To trigger an operation.";
case "type": case "type":
return "Type"; return "Type";
case "wave": case "wave":
return "Wave"; return "Wave";
case "loading": case "loading":
return "Loading"; return "Loading";
case "ghost": case "ghost":
return "Ghost"; return "Ghost";
case "border": case "border":
return "Border"; return "Border";
case "icon": case "icon":
return "Icon"; return "Icon";
case "arrow": case "arrow":
return "Arrow"; return "Arrow";
case "join": case "join":
return "Join"; return "Join";
case "gradient": case "gradient":
return "Gradient"; return "Gradient";
case "toggle": case "toggle":
return "Toggle"; return "Toggle";
#endregion
#endregion Button
#region FloatButton #region FloatButton
case "FloatButton.Text": case "FloatButton.Text":
return "FloatButton"; return "FloatButton";
case "FloatButton.Description": case "FloatButton.Description":
return "A button that floats at the top of the page."; return "A button that floats at the top of the page.";
case "FloatButton.Tip": case "FloatButton.Tip":
return "FloatButton does not have a toolbox control and is called code."; return "FloatButton does not have a toolbox control and is called code.";
case "control_option": case "control_option":
return "Control Options"; return "Control Options";
case "button_option": case "button_option":
return "Button Options"; return "Button Options";
case "open": case "open":
return "Open"; return "Open";
case "close": case "close":
return "Close"; return "Close";
case "reset": case "reset":
return "Reset"; return "Reset";
#endregion
#endregion FloatButton
#region Icon #region Icon
case "Icon.Text": case "Icon.Text":
return "Icon"; return "Icon";
case "Icon.Description": case "Icon.Description":
return "Semantic vector graphics."; return "Semantic vector graphics.";
case "Icon.Tip": case "Icon.Tip":
return "Icon does not have a toolbox control and is used for Svg property assignments."; return "Icon does not have a toolbox control and is used for Svg property assignments.";
case "outlined": case "outlined":
return "Outlined"; return "Outlined";
case "filled": case "filled":
return "Filled"; return "Filled";
case "directionalicon": case "directionalicon":
return "Directional icons"; return "Directional icons";
case "suggestionicon": case "suggestionicon":
return "Suggestion Icon"; return "Suggestion Icon";
case "editingicon": case "editingicon":
return "Editing Icons"; return "Editing Icons";
case "dataicon": case "dataicon":
return "Data icons"; return "Data icons";
case "brand": case "brand":
return "Brand and logo"; return "Brand and logo";
case "universal": case "universal":
return "Universal Icons for Websites"; return "Universal Icons for Websites";
case "copysuccess": case "copysuccess":
return "Copy successful!"; return "Copy successful!";
case "copyfail": case "copyfail":
return "Copy failed!"; return "Copy failed!";
#endregion
#endregion Icon
#region Divider #region Divider
case "Divider.Text": case "Divider.Text":
return "Divider"; return "Divider";
case "Divider.Description": case "Divider.Description":
return "A divider line separates different content."; return "A divider line separates different content.";
case "basicusage": case "basicusage":
return "Basic Usage"; return "Basic Usage";
case "vertical": case "vertical":
return "Vertical"; return "Vertical";
case "horizontal": case "horizontal":
return "Horizontal"; return "Horizontal";
#endregion
#endregion Divider
default: default:
return null; return null;
} }
} }
} }

View File

@ -1,35 +1,33 @@
using AntdUI; using AntdUI;
using DHSoftware.Models; using DHSoftware.Models;
using DHSoftware.Services; using DHSoftware.Services;
namespace DHSoftware namespace DHSoftware
{ {
public partial class LoginWindow : AntdUI.Window public partial class LoginWindow : AntdUI.Window
{ {
public LoginWindow() public LoginWindow()
{ {
InitializeComponent(); InitializeComponent();
button_ok.Click += Button_ok_Click; button_ok.Click += Button_ok_Click;
button_cancel.Click += Button_cancel_Click; button_cancel.Click += Button_cancel_Click;
} }
/// <summary> /// <summary>
/// 窗体对象实例 /// 窗体对象实例
/// </summary> /// </summary>
private static LoginWindow _instance; private static LoginWindow _instance;
internal static LoginWindow Instance internal static LoginWindow Instance
{ {
get get
{ {
if (_instance == null) if (_instance == null || _instance.IsDisposed)
_instance = new LoginWindow(); _instance = new LoginWindow();
return _instance; return _instance;
} }
} }
private void Button_cancel_Click(object? sender, EventArgs e) private void Button_cancel_Click(object? sender, EventArgs e)
{ {
this.Dispose(); this.Dispose();
@ -47,9 +45,8 @@ namespace DHSoftware
AntdUI.Message.warn(this, "密码不能为空!", autoClose: 3); AntdUI.Message.warn(this, "密码不能为空!", autoClose: 3);
return; return;
} }
if(AuthService.Login(iptName.Text, iptPwd.Text)) if (AuthService.Login(iptName.Text, iptPwd.Text))
{ {
if (this.Owner is MainWindow parent) if (this.Owner is MainWindow parent)
{ {
List<string> UserPermissions = AuthService.GetUserPermissions(); List<string> UserPermissions = AuthService.GetUserPermissions();
@ -87,10 +84,9 @@ namespace DHSoftware
parent.Deleteschememe = false; parent.Deleteschememe = false;
} }
parent.LoginName = iptName.Text;
parent.LoginName=iptName.Text;
} }
this.Dispose(); this.Dispose();
} }
else else
{ {
@ -100,7 +96,6 @@ namespace DHSoftware
private void LoginWindow_Load(object sender, EventArgs e) private void LoginWindow_Load(object sender, EventArgs e)
{ {
} }
} }
} }

View File

@ -28,19 +28,18 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
AntdUI.Tabs.StyleCard styleCard1 = new AntdUI.Tabs.StyleCard();
AntdUI.Tabs.StyleCard styleCard2 = new AntdUI.Tabs.StyleCard();
AntdUI.Tabs.StyleCard styleCard3 = new AntdUI.Tabs.StyleCard(); AntdUI.Tabs.StyleCard styleCard3 = new AntdUI.Tabs.StyleCard();
AntdUI.SegmentedItem segmentedItem1 = new AntdUI.SegmentedItem(); AntdUI.Tabs.StyleCard styleCard4 = new AntdUI.Tabs.StyleCard();
AntdUI.SegmentedItem segmentedItem6 = new AntdUI.SegmentedItem();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainWindow)); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainWindow));
AntdUI.SegmentedItem segmentedItem2 = new AntdUI.SegmentedItem(); AntdUI.SegmentedItem segmentedItem7 = new AntdUI.SegmentedItem();
AntdUI.SegmentedItem segmentedItem3 = new AntdUI.SegmentedItem(); AntdUI.SegmentedItem segmentedItem8 = new AntdUI.SegmentedItem();
AntdUI.SegmentedItem segmentedItem4 = new AntdUI.SegmentedItem(); AntdUI.SegmentedItem segmentedItem9 = new AntdUI.SegmentedItem();
AntdUI.SegmentedItem segmentedItem5 = new AntdUI.SegmentedItem(); AntdUI.SegmentedItem segmentedItem10 = new AntdUI.SegmentedItem();
titlebar = new AntdUI.PageHeader(); titlebar = new AntdUI.PageHeader();
lbName = new AntdUI.Label(); lbName = new AntdUI.Label();
pageHeader1 = new AntdUI.PageHeader(); pageHeader1 = new AntdUI.PageHeader();
label1 = new Label(); labuph = new Label();
divider2 = new AntdUI.Divider(); divider2 = new AntdUI.Divider();
panelmain = new AntdUI.Panel(); panelmain = new AntdUI.Panel();
panel2 = new AntdUI.Panel(); panel2 = new AntdUI.Panel();
@ -49,9 +48,6 @@
splitContainer1 = new SplitContainer(); splitContainer1 = new SplitContainer();
splitContainer2 = new SplitContainer(); splitContainer2 = new SplitContainer();
tabImgDisplay = new AntdUI.Tabs(); tabImgDisplay = new AntdUI.Tabs();
tabMain = new AntdUI.TabPage();
tabsStas = new AntdUI.Tabs();
tabPage3 = new AntdUI.TabPage();
richTextBox1 = new RichTextBox(); richTextBox1 = new RichTextBox();
tabsConfig = new AntdUI.Tabs(); tabsConfig = new AntdUI.Tabs();
tabPage2 = new AntdUI.TabPage(); tabPage2 = new AntdUI.TabPage();
@ -76,9 +72,6 @@
splitContainer2.Panel1.SuspendLayout(); splitContainer2.Panel1.SuspendLayout();
splitContainer2.Panel2.SuspendLayout(); splitContainer2.Panel2.SuspendLayout();
splitContainer2.SuspendLayout(); splitContainer2.SuspendLayout();
tabImgDisplay.SuspendLayout();
tabsStas.SuspendLayout();
tabPage3.SuspendLayout();
tabsConfig.SuspendLayout(); tabsConfig.SuspendLayout();
panel1.SuspendLayout(); panel1.SuspendLayout();
panel3.SuspendLayout(); panel3.SuspendLayout();
@ -116,7 +109,7 @@
// //
// pageHeader1 // pageHeader1
// //
pageHeader1.Controls.Add(label1); pageHeader1.Controls.Add(labuph);
pageHeader1.Controls.Add(divider2); pageHeader1.Controls.Add(divider2);
pageHeader1.DividerShow = true; pageHeader1.DividerShow = true;
pageHeader1.Dock = DockStyle.Bottom; pageHeader1.Dock = DockStyle.Bottom;
@ -127,14 +120,14 @@
pageHeader1.TabIndex = 7; pageHeader1.TabIndex = 7;
pageHeader1.Text = "UPH"; pageHeader1.Text = "UPH";
// //
// label1 // labuph
// //
label1.AutoSize = true; labuph.AutoSize = true;
label1.Location = new Point(979, 10); labuph.Location = new Point(59, 10);
label1.Name = "label1"; labuph.Name = "labuph";
label1.Size = new Size(64, 21); labuph.Size = new Size(64, 21);
label1.TabIndex = 1; labuph.TabIndex = 1;
label1.Text = "100000"; labuph.Text = "100000";
// //
// divider2 // divider2
// //
@ -203,7 +196,7 @@
splitContainer1.Panel2.BackColor = SystemColors.ButtonFace; splitContainer1.Panel2.BackColor = SystemColors.ButtonFace;
splitContainer1.Panel2.Controls.Add(tabsConfig); splitContainer1.Panel2.Controls.Add(tabsConfig);
splitContainer1.Size = new Size(1024, 500); splitContainer1.Size = new Size(1024, 500);
splitContainer1.SplitterDistance = 580; splitContainer1.SplitterDistance = 606;
splitContainer1.SplitterIncrement = 2; splitContainer1.SplitterIncrement = 2;
splitContainer1.SplitterWidth = 10; splitContainer1.SplitterWidth = 10;
splitContainer1.TabIndex = 0; splitContainer1.TabIndex = 0;
@ -221,8 +214,8 @@
// //
// splitContainer2.Panel2 // splitContainer2.Panel2
// //
splitContainer2.Panel2.Controls.Add(tabsStas); splitContainer2.Panel2.Controls.Add(richTextBox1);
splitContainer2.Size = new Size(580, 500); splitContainer2.Size = new Size(606, 500);
splitContainer2.SplitterDistance = 320; splitContainer2.SplitterDistance = 320;
splitContainer2.TabIndex = 0; splitContainer2.TabIndex = 0;
// //
@ -231,46 +224,17 @@
tabImgDisplay.Dock = DockStyle.Fill; tabImgDisplay.Dock = DockStyle.Fill;
tabImgDisplay.Location = new Point(0, 0); tabImgDisplay.Location = new Point(0, 0);
tabImgDisplay.Name = "tabImgDisplay"; tabImgDisplay.Name = "tabImgDisplay";
tabImgDisplay.Pages.Add(tabMain); tabImgDisplay.Size = new Size(606, 320);
tabImgDisplay.Size = new Size(580, 320); tabImgDisplay.Style = styleCard3;
tabImgDisplay.Style = styleCard1;
tabImgDisplay.TabIndex = 1; tabImgDisplay.TabIndex = 1;
tabImgDisplay.Text = "tabs1"; tabImgDisplay.Text = "tabs1";
// //
// tabMain
//
tabMain.Location = new Point(3, 28);
tabMain.Name = "tabMain";
tabMain.Size = new Size(574, 289);
tabMain.TabIndex = 0;
tabMain.Text = "检测";
//
// tabsStas
//
tabsStas.Dock = DockStyle.Fill;
tabsStas.Location = new Point(0, 0);
tabsStas.Name = "tabsStas";
tabsStas.Pages.Add(tabPage3);
tabsStas.Size = new Size(580, 176);
tabsStas.Style = styleCard2;
tabsStas.TabIndex = 3;
tabsStas.Text = "tabs3";
//
// tabPage3
//
tabPage3.Controls.Add(richTextBox1);
tabPage3.Location = new Point(3, 28);
tabPage3.Name = "tabPage3";
tabPage3.Size = new Size(574, 145);
tabPage3.TabIndex = 0;
tabPage3.Text = "日志";
//
// richTextBox1 // richTextBox1
// //
richTextBox1.Dock = DockStyle.Fill; richTextBox1.Dock = DockStyle.Fill;
richTextBox1.Location = new Point(0, 0); richTextBox1.Location = new Point(0, 0);
richTextBox1.Name = "richTextBox1"; richTextBox1.Name = "richTextBox1";
richTextBox1.Size = new Size(574, 145); richTextBox1.Size = new Size(606, 176);
richTextBox1.TabIndex = 0; richTextBox1.TabIndex = 0;
richTextBox1.Text = ""; richTextBox1.Text = "";
// //
@ -280,8 +244,8 @@
tabsConfig.Location = new Point(0, 0); tabsConfig.Location = new Point(0, 0);
tabsConfig.Name = "tabsConfig"; tabsConfig.Name = "tabsConfig";
tabsConfig.Pages.Add(tabPage2); tabsConfig.Pages.Add(tabPage2);
tabsConfig.Size = new Size(434, 500); tabsConfig.Size = new Size(408, 500);
tabsConfig.Style = styleCard3; tabsConfig.Style = styleCard4;
tabsConfig.TabIndex = 2; tabsConfig.TabIndex = 2;
tabsConfig.Text = "tabs2"; tabsConfig.Text = "tabs2";
// //
@ -289,7 +253,7 @@
// //
tabPage2.Location = new Point(3, 28); tabPage2.Location = new Point(3, 28);
tabPage2.Name = "tabPage2"; tabPage2.Name = "tabPage2";
tabPage2.Size = new Size(428, 469); tabPage2.Size = new Size(402, 469);
tabPage2.TabIndex = 0; tabPage2.TabIndex = 0;
tabPage2.Text = "配置"; tabPage2.Text = "配置";
// //
@ -370,66 +334,66 @@
segmented1.Font = new Font("Microsoft YaHei UI", 9F); segmented1.Font = new Font("Microsoft YaHei UI", 9F);
segmented1.ForeColor = Color.White; segmented1.ForeColor = Color.White;
segmented1.Full = true; segmented1.Full = true;
segmentedItem1.Badge = null; segmentedItem6.Badge = null;
segmentedItem1.BadgeAlign = AntdUI.TAlignFrom.TR; segmentedItem6.BadgeAlign = AntdUI.TAlignFrom.TR;
segmentedItem1.BadgeBack = null; segmentedItem6.BadgeBack = null;
segmentedItem1.BadgeMode = false; segmentedItem6.BadgeMode = false;
segmentedItem1.BadgeOffsetX = 0; segmentedItem6.BadgeOffsetX = 0;
segmentedItem1.BadgeOffsetY = 0; segmentedItem6.BadgeOffsetY = 0;
segmentedItem1.BadgeSize = 0.6F; segmentedItem6.BadgeSize = 0.6F;
segmentedItem1.BadgeSvg = null; segmentedItem6.BadgeSvg = null;
segmentedItem1.IconActiveSvg = resources.GetString("segmentedItem1.IconActiveSvg"); segmentedItem6.IconActiveSvg = resources.GetString("segmentedItem6.IconActiveSvg");
segmentedItem1.IconSvg = resources.GetString("segmentedItem1.IconSvg"); segmentedItem6.IconSvg = resources.GetString("segmentedItem6.IconSvg");
segmentedItem1.Text = "启动"; segmentedItem6.Text = "启动";
segmentedItem2.Badge = null; segmentedItem7.Badge = null;
segmentedItem2.BadgeAlign = AntdUI.TAlignFrom.TR; segmentedItem7.BadgeAlign = AntdUI.TAlignFrom.TR;
segmentedItem2.BadgeBack = null; segmentedItem7.BadgeBack = null;
segmentedItem2.BadgeMode = false; segmentedItem7.BadgeMode = false;
segmentedItem2.BadgeOffsetX = 0; segmentedItem7.BadgeOffsetX = 0;
segmentedItem2.BadgeOffsetY = 0; segmentedItem7.BadgeOffsetY = 0;
segmentedItem2.BadgeSize = 0.6F; segmentedItem7.BadgeSize = 0.6F;
segmentedItem2.BadgeSvg = null; segmentedItem7.BadgeSvg = null;
segmentedItem2.IconActiveSvg = resources.GetString("segmentedItem2.IconActiveSvg"); segmentedItem7.IconActiveSvg = resources.GetString("segmentedItem7.IconActiveSvg");
segmentedItem2.IconSvg = resources.GetString("segmentedItem2.IconSvg"); segmentedItem7.IconSvg = resources.GetString("segmentedItem7.IconSvg");
segmentedItem2.Text = "停止"; segmentedItem7.Text = "停止";
segmentedItem3.Badge = null; segmentedItem8.Badge = null;
segmentedItem3.BadgeAlign = AntdUI.TAlignFrom.TR; segmentedItem8.BadgeAlign = AntdUI.TAlignFrom.TR;
segmentedItem3.BadgeBack = null; segmentedItem8.BadgeBack = null;
segmentedItem3.BadgeMode = false; segmentedItem8.BadgeMode = false;
segmentedItem3.BadgeOffsetX = 0; segmentedItem8.BadgeOffsetX = 0;
segmentedItem3.BadgeOffsetY = 0; segmentedItem8.BadgeOffsetY = 0;
segmentedItem3.BadgeSize = 0.6F; segmentedItem8.BadgeSize = 0.6F;
segmentedItem3.BadgeSvg = null; segmentedItem8.BadgeSvg = null;
segmentedItem3.IconActiveSvg = resources.GetString("segmentedItem3.IconActiveSvg"); segmentedItem8.IconActiveSvg = resources.GetString("segmentedItem8.IconActiveSvg");
segmentedItem3.IconSvg = resources.GetString("segmentedItem3.IconSvg"); segmentedItem8.IconSvg = resources.GetString("segmentedItem8.IconSvg");
segmentedItem3.Text = "复位"; segmentedItem8.Text = "复位";
segmentedItem4.Badge = null; segmentedItem9.Badge = null;
segmentedItem4.BadgeAlign = AntdUI.TAlignFrom.TR; segmentedItem9.BadgeAlign = AntdUI.TAlignFrom.TR;
segmentedItem4.BadgeBack = null; segmentedItem9.BadgeBack = null;
segmentedItem4.BadgeMode = false; segmentedItem9.BadgeMode = false;
segmentedItem4.BadgeOffsetX = 0; segmentedItem9.BadgeOffsetX = 0;
segmentedItem4.BadgeOffsetY = 0; segmentedItem9.BadgeOffsetY = 0;
segmentedItem4.BadgeSize = 0.6F; segmentedItem9.BadgeSize = 0.6F;
segmentedItem4.BadgeSvg = null; segmentedItem9.BadgeSvg = null;
segmentedItem4.IconActiveSvg = resources.GetString("segmentedItem4.IconActiveSvg"); segmentedItem9.IconActiveSvg = resources.GetString("segmentedItem9.IconActiveSvg");
segmentedItem4.IconSvg = resources.GetString("segmentedItem4.IconSvg"); segmentedItem9.IconSvg = resources.GetString("segmentedItem9.IconSvg");
segmentedItem4.Text = "登录"; segmentedItem9.Text = "登录";
segmentedItem5.Badge = null; segmentedItem10.Badge = null;
segmentedItem5.BadgeAlign = AntdUI.TAlignFrom.TR; segmentedItem10.BadgeAlign = AntdUI.TAlignFrom.TR;
segmentedItem5.BadgeBack = null; segmentedItem10.BadgeBack = null;
segmentedItem5.BadgeMode = false; segmentedItem10.BadgeMode = false;
segmentedItem5.BadgeOffsetX = 0; segmentedItem10.BadgeOffsetX = 0;
segmentedItem5.BadgeOffsetY = 0; segmentedItem10.BadgeOffsetY = 0;
segmentedItem5.BadgeSize = 0.6F; segmentedItem10.BadgeSize = 0.6F;
segmentedItem5.BadgeSvg = null; segmentedItem10.BadgeSvg = null;
segmentedItem5.IconActiveSvg = resources.GetString("segmentedItem5.IconActiveSvg"); segmentedItem10.IconActiveSvg = resources.GetString("segmentedItem10.IconActiveSvg");
segmentedItem5.IconSvg = resources.GetString("segmentedItem5.IconSvg"); segmentedItem10.IconSvg = resources.GetString("segmentedItem10.IconSvg");
segmentedItem5.Text = "设置"; segmentedItem10.Text = "设置";
segmented1.Items.Add(segmentedItem1); segmented1.Items.Add(segmentedItem6);
segmented1.Items.Add(segmentedItem2); segmented1.Items.Add(segmentedItem7);
segmented1.Items.Add(segmentedItem3); segmented1.Items.Add(segmentedItem8);
segmented1.Items.Add(segmentedItem4); segmented1.Items.Add(segmentedItem9);
segmented1.Items.Add(segmentedItem5); segmented1.Items.Add(segmentedItem10);
segmented1.Location = new Point(0, 0); segmented1.Location = new Point(0, 0);
segmented1.Name = "segmented1"; segmented1.Name = "segmented1";
segmented1.Size = new Size(491, 68); segmented1.Size = new Size(491, 68);
@ -467,9 +431,6 @@
splitContainer2.Panel2.ResumeLayout(false); splitContainer2.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)splitContainer2).EndInit(); ((System.ComponentModel.ISupportInitialize)splitContainer2).EndInit();
splitContainer2.ResumeLayout(false); splitContainer2.ResumeLayout(false);
tabImgDisplay.ResumeLayout(false);
tabsStas.ResumeLayout(false);
tabPage3.ResumeLayout(false);
tabsConfig.ResumeLayout(false); tabsConfig.ResumeLayout(false);
panel1.ResumeLayout(false); panel1.ResumeLayout(false);
panel3.ResumeLayout(false); panel3.ResumeLayout(false);
@ -487,15 +448,11 @@
private AntdUI.Panel panel2; private AntdUI.Panel panel2;
private AntdUI.Panel panel4; private AntdUI.Panel panel4;
private AntdUI.Panel panel6; private AntdUI.Panel panel6;
private Label label1; private Label labuph;
private AntdUI.Splitter splitter1; private AntdUI.Splitter splitter1;
private SplitContainer splitContainer1; private SplitContainer splitContainer1;
private SplitContainer splitContainer2; private SplitContainer splitContainer2;
private AntdUI.Tabs tabImgDisplay; private AntdUI.Tabs tabImgDisplay;
private AntdUI.TabPage tabMain;
private AntdUI.Tabs tabsStas;
private AntdUI.TabPage tabPage3;
private RichTextBox richTextBox1;
private AntdUI.Tabs tabsConfig; private AntdUI.Tabs tabsConfig;
private AntdUI.TabPage tabPage2; private AntdUI.TabPage tabPage2;
private AntdUI.Label lbName; private AntdUI.Label lbName;
@ -504,5 +461,6 @@
private AntdUI.Button btnAddProject; private AntdUI.Button btnAddProject;
private AntdUI.Button btnLoadProject; private AntdUI.Button btnLoadProject;
public AntdUI.Select sltProjects; public AntdUI.Select sltProjects;
private RichTextBox richTextBox1;
} }
} }

View File

@ -36,16 +36,12 @@ using ResultState = DH.Commons.Base.ResultState;
namespace DHSoftware namespace DHSoftware
{ {
public partial class MainWindow : AntdUI.Window public partial class MainWindow : AntdUI.Window
{ {
private Dictionary<string, List<string>> _cameraRelatedDetectionDict = null;
Dictionary<string, List<string>> _cameraRelatedDetectionDict = null;
private string _loginName; private string _loginName;
public string LoginName public string LoginName
{ {
get { return _loginName; } get { return _loginName; }
@ -55,7 +51,9 @@ namespace DHSoftware
UpdateLabel(); UpdateLabel();
} }
} }
private bool _ShowConfig; private bool _ShowConfig;
public bool ShowConfig public bool ShowConfig
{ {
get { return _ShowConfig; } get { return _ShowConfig; }
@ -66,41 +64,44 @@ namespace DHSoftware
} }
} }
private bool _addscheme;
private bool _addscheme; public bool Addscheme
public bool Addscheme {
{ get { return _addscheme; }
get { return _addscheme; } set
set
{
_addscheme = value;
UpdateScheme();
}
}
private bool _deletescheme;
public bool Deleteschememe
{ {
get { return _deletescheme; } _addscheme = value;
set
{
_deletescheme = value;
UpdateScheme(); UpdateScheme();
}
} }
private bool _loadscheme; }
public bool Loadscheme
private bool _deletescheme;
public bool Deleteschememe
{
get { return _deletescheme; }
set
{ {
get { return _loadscheme; } _deletescheme = value;
set
{
_loadscheme = value;
UpdateScheme(); UpdateScheme();
}
} }
}
private bool _loadscheme;
public bool Loadscheme
{
get { return _loadscheme; }
set
{
_loadscheme = value;
UpdateScheme();
}
}
private void UpdateScheme() private void UpdateScheme()
{ {
if (this.InvokeRequired) if (this.InvokeRequired)
{ {
this.Invoke(new Action(UpdateScheme)); this.Invoke(new Action(UpdateScheme));
@ -142,6 +143,7 @@ namespace DHSoftware
} }
lbName.Text = _loginName; lbName.Text = _loginName;
} }
private void UpdateConfig() private void UpdateConfig()
{ {
if (ShowConfig) if (ShowConfig)
@ -163,8 +165,8 @@ namespace DHSoftware
} }
segmented1.Items.Remove(itemToHide); segmented1.Items.Remove(itemToHide);
} }
} }
public MainWindow() public MainWindow()
{ {
InitializeComponent(); InitializeComponent();
@ -174,18 +176,18 @@ namespace DHSoftware
InitData(); InitData();
//绑定事件 //绑定事件
BindEventHandler(); 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> /// <summary>
/// 窗体对象实例 /// 窗体对象实例
/// </summary> /// </summary>
private static MainWindow _instance; private static MainWindow _instance;
internal static MainWindow Instance internal static MainWindow Instance
{ {
get get
@ -195,12 +197,13 @@ namespace DHSoftware
return _instance; return _instance;
} }
} }
SegmentedItem itemToHide;
private SegmentedItem itemToHide;
private void InitData() private void InitData()
{ {
itemToHide = segmented1.Items[4]; itemToHide = segmented1.Items[4];
segmented1.Items.Remove(itemToHide); segmented1.Items.Remove(itemToHide);
} }
public void LoadScheme() public void LoadScheme()
@ -215,7 +218,7 @@ namespace DHSoftware
//如果是空,新增默认数据 //如果是空,新增默认数据
if (list == null || list.Count <= 0) if (list == null || list.Count <= 0)
{ {
list = new() { CurrentScheme }; list = new() { CurrentScheme };
//显示到方案列表 //显示到方案列表
sltProjects.Items.Clear(); sltProjects.Items.Clear();
@ -264,7 +267,7 @@ namespace DHSoftware
cam.CameraIP = cameraBase.CameraIP; cam.CameraIP = cameraBase.CameraIP;
cam.IsEnabled = cameraBase.IsEnabled; cam.IsEnabled = cameraBase.IsEnabled;
Cameras.Add(cam); Cameras.Add(cam);
//cam.CameraConnect(); cam.CameraConnect();
cam.OnHImageOutput += OnCameraHImageOutput; cam.OnHImageOutput += OnCameraHImageOutput;
} }
else if (cameraBase.CamType == EnumCamType.hik) else if (cameraBase.CamType == EnumCamType.hik)
@ -277,7 +280,6 @@ namespace DHSoftware
// cam.CameraConnect(); // cam.CameraConnect();
cam.OnHImageOutput += OnCameraHImageOutput; cam.OnHImageOutput += OnCameraHImageOutput;
} }
} }
} }
} }
@ -291,8 +293,8 @@ namespace DHSoftware
var plcBase = ConfigModel.PLCBaseList[i]; var plcBase = ConfigModel.PLCBaseList[i];
if (plcBase.PLCType == EnumPLCType.XC网口) if (plcBase.PLCType == EnumPLCType.XC网口)
{ {
PLC.IP = plcBase.IP; PLC.IP = plcBase.IP;
PLC.PLCType = plcBase.PLCType;
PLC.Enable = plcBase.Enable; PLC.Enable = plcBase.Enable;
PLC.PLCName = plcBase.PLCName; PLC.PLCName = plcBase.PLCName;
PLC.PLCItemList = plcBase.PLCItemList; PLC.PLCItemList = plcBase.PLCItemList;
@ -300,7 +302,6 @@ namespace DHSoftware
PLC.PLCConnect(); PLC.PLCConnect();
} }
} }
} }
} }
@ -311,7 +312,6 @@ namespace DHSoftware
if (ConfigModel.DetectionList.Count > 0) if (ConfigModel.DetectionList.Count > 0)
{ {
for (int i = 0; i < ConfigModel.DetectionList.Count; i++) for (int i = 0; i < ConfigModel.DetectionList.Count; i++)
{ {
DetectionConfig detectionConfig = ConfigModel.DetectionList[i]; DetectionConfig detectionConfig = ConfigModel.DetectionList[i];
@ -322,14 +322,15 @@ namespace DHSoftware
detectionConfig.ModelHeight = detection.ModelHeight; detectionConfig.ModelHeight = detection.ModelHeight;
detectionConfig.In_lable_path = detection.In_lable_path; detectionConfig.In_lable_path = detection.In_lable_path;
detectionConfig.IsEnabled = detection.IsEnabled; detectionConfig.IsEnabled = detection.IsEnabled;
detectionConfig.ShowLocation.X = detection.ShowLocation.X; detectionConfig.ShowLocation.X = (i + 1) % 5+ (i + 1) / 5;
detectionConfig.ShowLocation.Y = detection.ShowLocation.Y; // detectionConfig.ShowLocation.X = detection.ShowLocation.X;
detectionConfig.ShowLocation.Y = (i + 1) / 5+1;
// detectionConfig.ShowLocation.Y = detection.ShowLocation.Y;
DetectionConfigs.Add(detectionConfig); DetectionConfigs.Add(detectionConfig);
} }
} }
DetectionConfigs.ForEach(detection => DetectionConfigs.ForEach(detection =>
{ {
detection.CameraCollects.ForEach(cam => detection.CameraCollects.ForEach(cam =>
{ {
List<string> Dets = new List<string> List<string> Dets = new List<string>
@ -344,14 +345,11 @@ namespace DHSoftware
{ {
_cameraRelatedDetectionDict[cam.CameraSourceId].Add(detection.Id); _cameraRelatedDetectionDict[cam.CameraSourceId].Add(detection.Id);
} }
} }
); );
}); });
string inferenceDevice = "CPU"; string inferenceDevice = "CPU";
// //
_visionEngine = new SimboVisionDriver(); _visionEngine = new SimboVisionDriver();
_visionEngine.DetectionConfigs = DetectionConfigs; _visionEngine.DetectionConfigs = DetectionConfigs;
@ -359,17 +357,15 @@ namespace DHSoftware
//初始化模型 加载模型 //初始化模型 加载模型
_visionEngine.Init(); _visionEngine.Init();
CtrlVisionRunBase ctrlVisionRun = new CtrlVisionRunBase(_visionEngine); CtrlVisionRunBase ctrlVisionRun = new CtrlVisionRunBase(_visionEngine);
ctrlVisionRun.Dock = DockStyle.Fill;
tabImgDisplay.Controls.Add(ctrlVisionRun); tabImgDisplay.Controls.Add(ctrlVisionRun);
} }
private void BindEventHandler() private void BindEventHandler()
{ {
btnAddProject.Click += BtnAddProject_Click; btnAddProject.Click += BtnAddProject_Click;
btnDeleteProject.Click += BtnDeleteProject_Click; btnDeleteProject.Click += BtnDeleteProject_Click;
btnLoadProject.Click += BtnLoadProject_Click; btnLoadProject.Click += BtnLoadProject_Click;
} }
private void BtnDeleteProject_Click(object? sender, EventArgs e) private void BtnDeleteProject_Click(object? sender, EventArgs e)
@ -400,16 +396,12 @@ namespace DHSoftware
SchemeHelper.SetCurrentScheme(SystemModel.CurrentScheme); SchemeHelper.SetCurrentScheme(SystemModel.CurrentScheme);
//加载当前方案配置 //加载当前方案配置
ConfigHelper.LoadConfig(); ConfigHelper.LoadConfig();
} }
else else
{ {
sltProjects.SelectedIndex = -1; // 清空选择 sltProjects.SelectedIndex = -1; // 清空选择
AntdUI.Modal.open(this, "空方案警告!", "当前方案全部删除,需重启程序!", TType.Warn); AntdUI.Modal.open(this, "空方案警告!", "当前方案全部删除,需重启程序!", TType.Warn);
} }
} }
} }
catch (Exception ex) catch (Exception ex)
@ -436,7 +428,8 @@ namespace DHSoftware
ConfigHelper.LoadConfig(); ConfigHelper.LoadConfig();
AntdUI.Message.success(this, $"载入方案{SystemModel.CurrentScheme}成功!", autoClose: 3); AntdUI.Message.success(this, $"载入方案{SystemModel.CurrentScheme}成功!", autoClose: 3);
} }
catch (Exception ex) { catch (Exception ex)
{
AntdUI.Message.error(this, ex.Message, autoClose: 3); AntdUI.Message.error(this, ex.Message, autoClose: 3);
} }
} }
@ -481,23 +474,20 @@ namespace DHSoftware
{ {
AntdUI.Message.error(this, ex.Message, autoClose: 3); AntdUI.Message.error(this, ex.Message, autoClose: 3);
} }
}
}
public List<HikVisionCamera> HKCameras { get; } = new List<HikVisionCamera>(); public List<HikVisionCamera> HKCameras { get; } = new List<HikVisionCamera>();
public List<Do3ThinkCamera> Cameras { get; } = new List<Do3ThinkCamera>(); public List<Do3ThinkCamera> Cameras { get; } = new List<Do3ThinkCamera>();
public Dictionary<string, SimboObjectDetection> Dectection { get; } = new Dictionary<string, SimboObjectDetection>(); public Dictionary<string, SimboObjectDetection> Dectection { get; } = new Dictionary<string, SimboObjectDetection>();
public XinJEPLCTcpNet PLC { get; } = XinJEPLCTcpNet.Instance; public XinJEPLCTcpNet PLC { get; } = XinJEPLCTcpNet.Instance;
SLDMotion sLDMotion = new SLDMotion(); private SLDMotion sLDMotion = new SLDMotion();
private void MainWindow_Load(object sender, EventArgs e) private void MainWindow_Load(object sender, EventArgs e)
{ {
} }
private bool _isClosing = false; // 状态标志 private bool _isClosing = false; // 状态标志
private void MainWindow_FormClosing(object sender, FormClosingEventArgs e) private void MainWindow_FormClosing(object sender, FormClosingEventArgs e)
{ {
if (_isClosing) return; if (_isClosing) return;
@ -509,34 +499,30 @@ namespace DHSoftware
this.Hide(); this.Hide();
// 显示关闭界面 // 显示关闭界面
CloseWindow.Instance.Show(); CloseWindow.Instance.Show();
Thread.Sleep(200); Thread.Sleep(200);
try try
{
// 执行关闭操作
foreach (var camera in Cameras)
{ {
// 执行关闭操作 camera.CameraDisConnect();
foreach (var camera in Cameras) }
{ foreach (var camera in HKCameras)
camera.CameraDisConnect(); {
} camera.CameraDisConnect();
foreach (var camera in HKCameras) }
{ PLC.PLCDisConnect();
camera.CameraDisConnect(); CloseWindow.Instance.Close();// 关闭提示窗口
} //Application.Exit();
PLC.PLCDisConnect(); System.Environment.Exit(0);
CloseWindow.Instance.Close();// 关闭提示窗口
//Application.Exit();
System.Environment.Exit(0);
} }
catch (Exception ex) catch (Exception ex)
{ {
CloseWindow.Instance.Close(); CloseWindow.Instance.Close();
System.Environment.Exit(0); System.Environment.Exit(0);
} }
} }
private void segmented1_SelectIndexChanged(object sender, EventArgs e) private void segmented1_SelectIndexChanged(object sender, EventArgs e)
@ -550,23 +536,29 @@ namespace DHSoftware
case 0: // "启动" (Start) case 0: // "启动" (Start)
HandleStartButton(); HandleStartButton();
break; break;
case 1: // "停止" (Stop) case 1: // "停止" (Stop)
HandleStopButton(); HandleStopButton();
break; break;
case 2: // "复位" (Reset) case 2: // "复位" (Reset)
HandleResetButton(); HandleResetButton();
break; break;
case 3: // "设置" (Settings) case 3: // "设置" (Settings)
HandleLoginButton(); HandleLoginButton();
break; break;
case 4: // "登录" (Login) case 4: // "登录" (Login)
HandleSettingsButton(); HandleSettingsButton();
break; break;
default: default:
break; break;
} }
segmented1.SelectIndex = -1; segmented1.SelectIndex = -1;
} }
public bool CurrentMachine = false; public bool CurrentMachine = false;
public volatile int ProductNum_Total = 0; public volatile int ProductNum_Total = 0;
public volatile int ProductNum_OK = 0; public volatile int ProductNum_OK = 0;
@ -574,27 +566,32 @@ namespace DHSoftware
public SimboVisionDriver? _visionEngine = null; public SimboVisionDriver? _visionEngine = null;
public PLCBase? _PLCConfig = null; public PLCBase? _PLCConfig = null;
List<DetectionConfig> DetectionConfigs = new List<DetectionConfig>(); private List<DetectionConfig> DetectionConfigs = new List<DetectionConfig>();
List<SimboStationMLEngineSet> SimboStationMLEngineList = new List<SimboStationMLEngineSet>(); private List<SimboStationMLEngineSet> SimboStationMLEngineList = new List<SimboStationMLEngineSet>();
Dictionary<string, HDevEngineTool> HalconToolDict = new Dictionary<string, HDevEngineTool>(); private Dictionary<string, HDevEngineTool> HalconToolDict = new Dictionary<string, HDevEngineTool>();
public List<RecongnitionLabel> RecongnitionLabelList { get; set; } = new List<RecongnitionLabel>(); public List<RecongnitionLabel> RecongnitionLabelList { get; set; } = new List<RecongnitionLabel>();
public DateTime startTime; public DateTime startTime;
private void HandleStartButton() private void HandleStartButton()
{ {
StartProcess(); StartProcess();
} }
private static int currentRegister = 411; // 初始为 D411 private static int currentRegister = 411; // 初始为 D411
private void StartProcess() private void StartProcess()
{ {
startTime= DateTime.Now;
//计数清零 //计数清零
PieceCount = 0; PieceCount = 0;
//吹气点位归置 //吹气点位归置
currentRegister = 411; currentRegister = 411;
if (PLC?.Enable == true)
if (_PLCConfig?.Enable == true)
{ {
PLC.CountToZero(); PLC.CountToZero();
PLC.OnNewPieces -= MainMotion_NewPieces;
PLC.OnNewPieces += MainMotion_NewPieces;
} }
ConfigModel.CameraBaseList.ForEach(d => ConfigModel.CameraBaseList.ForEach(d =>
@ -606,12 +603,12 @@ namespace DHSoftware
}); });
//PrepareBatchNO(); //PrepareBatchNO();
// isInPositionChecking = false; // isInPositionChecking = false;
//isFullTrayChecking = false; //isFullTrayChecking = false;
//队列清空 //队列清空
// var temp = new List<ITriggerSet>(); // var temp = new List<ITriggerSet>();
// temp.AddRange(XKRSPLCConfig.TriggerConfigCollection); // temp.AddRange(XKRSPLCConfig.TriggerConfigCollection);
// temp.AddRange(XKRSPLCConfig.SnapshotTriggerConfigCollection); // temp.AddRange(XKRSPLCConfig.SnapshotTriggerConfigCollection);
//temp.ForEach(t => //temp.ForEach(t =>
//{ //{
@ -632,22 +629,20 @@ namespace DHSoftware
// return new ProcessResponse(false); // return new ProcessResponse(false);
//} //}
// _diskInfoListInOrder = XKRSPLCConfig.DiskInfoList.OrderBy(u => u.DiskSequence).ToList();
// var axisNumList = _diskInfoListInOrder.Select(u => u.DiskAxisNum).ToList();
// _diskInfoListInOrder = XKRSPLCConfig.DiskInfoList.OrderBy(u => u.DiskSequence).ToList(); /// PrepareMLEngine();
// var axisNumList = _diskInfoListInOrder.Select(u => u.DiskAxisNum).ToList();
/// PrepareMLEngine(); // if (_PLCConfig?.Enable == true)
//挡料电机操作
// _PLC.FeedingMotor(_PLCConfig.CunToZeroSpeed, _PLCConfig.CunPos, _PLCConfig.CunSpeed, _PLCConfig.CunDirection);
// if (_PLCConfig?.Enable == true)
//挡料电机操作
// _PLC.FeedingMotor(_PLCConfig.CunToZeroSpeed, _PLCConfig.CunPos, _PLCConfig.CunSpeed, _PLCConfig.CunDirection);
//流程开启操作配置 //流程开启操作配置
// ProcessInitialAction(); // ProcessInitialAction();
// if (_PLC?Enabled == true) // if (_PLC?Enabled == true)
//皮带 //皮带
// _PLC.Belt(true); // _PLC.Belt(true);
//DeviceCollection.ForEach(d => //DeviceCollection.ForEach(d =>
//{ //{
@ -659,15 +654,18 @@ namespace DHSoftware
// } // }
//}); //});
_productLists.Clear(); _productLists.Clear();
#region
#region
//mOfflineImageTimer = new System.Timers.Timer(); //mOfflineImageTimer = new System.Timers.Timer();
//mOfflineImageTimer.Elapsed += OnEmitSerialPortAsync; //mOfflineImageTimer.Elapsed += OnEmitSerialPortAsync;
//mOfflineImageTimer.Interval = 1000; //mOfflineImageTimer.Interval = 1000;
//mOfflineImageTimer.Start(); //mOfflineImageTimer.Start();
#endregion
var settings = _visionEngine.DetectionConfigs.Where(u => u.IsEnabled && u.IsAddStation ).ToList(); #endregion
var settings = _visionEngine.DetectionConfigs.Where(u => u.IsEnabled && u.IsAddStation).ToList();
if (settings != null) if (settings != null)
{ {
settings = settings.Where(s => s.IsEnabled).ToList(); settings = settings.Where(s => s.IsEnabled).ToList();
@ -680,7 +678,6 @@ namespace DHSoftware
} }
} }
// _MGSCameraList = DeviceCollection // _MGSCameraList = DeviceCollection
//.OfType<MGSCameraDriver>() // 直接筛选出 MGSCameraDriver 类型的元素 //.OfType<MGSCameraDriver>() // 直接筛选出 MGSCameraDriver 类型的元素
//.Where(camera => camera.IConfig != null && camera.IConfig.IsEnabled) // 进一步筛选 IConfig 不为 null 且 IsEnabled 为 true //.Where(camera => camera.IConfig != null && camera.IConfig.IsEnabled) // 进一步筛选 IConfig 不为 null 且 IsEnabled 为 true
@ -694,7 +691,6 @@ namespace DHSoftware
_productLists.Add(products); _productLists.Add(products);
} }
// 转盘操作 // 转盘操作
// if (_PLC?.IIConfig?.IsEnabled == true) // if (_PLC?.IIConfig?.IsEnabled == true)
@ -702,8 +698,7 @@ namespace DHSoftware
PLCItem itemSpeed = PLC.PLCItemList.FirstOrDefault(u => u.Name == "转盘速度"); PLCItem itemSpeed = PLC.PLCItemList.FirstOrDefault(u => u.Name == "转盘速度");
if (itemSpeed != null) if (itemSpeed != null)
{ {
PLC.TurntableOpen(Convert.ToInt32(itemSpeed.Value), true); PLC.TurntableOpen();
} }
Thread.Sleep(500); Thread.Sleep(500);
@ -715,12 +710,11 @@ namespace DHSoftware
// _PLC.Vibratory(true); // _PLC.Vibratory(true);
//} //}
//InitialOEEStatistic(); //InitialOEEStatistic();
// MachineState = MachineState.Running; // MachineState = MachineState.Running;
} }
private void PrepareMLEngine() private void PrepareMLEngine()
{ {
//if (_visionEngine == null) //if (_visionEngine == null)
@ -733,9 +727,6 @@ namespace DHSoftware
// throw new ProcessException($"未能获取检测设备"); // throw new ProcessException($"未能获取检测设备");
//} //}
//相机模组 //相机模组
//_cameraRelatedDetectionDict = new(); //_cameraRelatedDetectionDict = new();
@ -756,7 +747,6 @@ namespace DHSoftware
// _cameraRelatedDetectionDict[cam.CameraSourceId].Add(detection.Id); // _cameraRelatedDetectionDict[cam.CameraSourceId].Add(detection.Id);
// } // }
// }); // });
//}); //});
@ -766,8 +756,6 @@ namespace DHSoftware
#if false #if false
private void HandleStartButton2() private void HandleStartButton2()
{ {
CurrentMachine = true; CurrentMachine = true;
//_visionEngine.Start(); //_visionEngine.Start();
@ -798,8 +786,6 @@ namespace DHSoftware
RecongnitionLabelList.Add(recongnition2); RecongnitionLabelList.Add(recongnition2);
RecongnitionLabelList.Add(recongnition3); RecongnitionLabelList.Add(recongnition3);
var det1 = new DetectionConfig("相机1", ModelType., @"D:\PROJECTS\X015\Vision\Cam1.onnx", false, "Cam1"); var det1 = new DetectionConfig("相机1", ModelType., @"D:\PROJECTS\X015\Vision\Cam1.onnx", false, "Cam1");
var det2 = new DetectionConfig("相机2", ModelType., @"D:\PROJECTS\X015\Vision\Cam2.onnx", false, "Cam2"); var det2 = new DetectionConfig("相机2", ModelType., @"D:\PROJECTS\X015\Vision\Cam2.onnx", false, "Cam2");
var det3 = new DetectionConfig("相机3", ModelType., @"D:\PROJECTS\X015\Vision\Cam3.onnx", false, "Cam3"); var det3 = new DetectionConfig("相机3", ModelType., @"D:\PROJECTS\X015\Vision\Cam3.onnx", false, "Cam3");
@ -827,7 +813,6 @@ namespace DHSoftware
float Conf = 0.5f; float Conf = 0.5f;
det1.CameraCollects = CameraCollects; det1.CameraCollects = CameraCollects;
det1.ModelconfThreshold = Conf; det1.ModelconfThreshold = Conf;
det1.ModelWidth = 640; det1.ModelWidth = 640;
@ -864,8 +849,6 @@ namespace DHSoftware
det4.ShowLocation.X = 4; det4.ShowLocation.X = 4;
det4.ShowLocation.Y = 1; det4.ShowLocation.Y = 1;
det5.CameraCollects = CameraCollects5; det5.CameraCollects = CameraCollects5;
det5.ModelconfThreshold = Conf; det5.ModelconfThreshold = Conf;
det5.ModelWidth = 640; det5.ModelWidth = 640;
@ -926,8 +909,6 @@ namespace DHSoftware
camera.CameraConnect(); camera.CameraConnect();
camera.OnHImageOutput += OnCameraHImageOutput; camera.OnHImageOutput += OnCameraHImageOutput;
HKCameras.Add(camera); HKCameras.Add(camera);
} }
#else #else
//Do3ThinkCamera do3ThinkCamera1 = new Do3ThinkCamera(); //Do3ThinkCamera do3ThinkCamera1 = new Do3ThinkCamera();
@ -939,7 +920,6 @@ namespace DHSoftware
// Cameras.Add(do3ThinkCamera1); // Cameras.Add(do3ThinkCamera1);
for (int i = 1; i <= 8; i++) for (int i = 1; i <= 8; i++)
{ {
Do3ThinkCamera cam = new Do3ThinkCamera(); Do3ThinkCamera cam = new Do3ThinkCamera();
if (i == 1) if (i == 1)
{ {
@ -956,13 +936,10 @@ namespace DHSoftware
cam.OnHImageOutput += OnCameraHImageOutput; cam.OnHImageOutput += OnCameraHImageOutput;
} }
#endif #endif
DetectionConfigs.ForEach(detection => DetectionConfigs.ForEach(detection =>
{ {
detection.CameraCollects.ForEach(cam => detection.CameraCollects.ForEach(cam =>
{ {
List<string> Dets = new List<string> List<string> Dets = new List<string>
@ -977,15 +954,11 @@ namespace DHSoftware
{ {
_cameraRelatedDetectionDict[cam.CameraSourceId].Add(detection.Id); _cameraRelatedDetectionDict[cam.CameraSourceId].Add(detection.Id);
} }
} }
); );
}); });
string inferenceDevice = "CPU"; string inferenceDevice = "CPU";
_visionEngine = new SimboVisionDriver(); _visionEngine = new SimboVisionDriver();
_visionEngine.DetectionConfigs = DetectionConfigs; _visionEngine.DetectionConfigs = DetectionConfigs;
@ -1016,12 +989,9 @@ namespace DHSoftware
sLDMotion.IODefinitionCollection = new List<IODefinition>(); sLDMotion.IODefinitionCollection = new List<IODefinition>();
Motion(sLDMotion.IODefinitionCollection); Motion(sLDMotion.IODefinitionCollection);
sLDMotion.SnapshotSettings = new List<SnapshotSetting>(); sLDMotion.SnapshotSettings = new List<SnapshotSetting>();
int[] cameraPositions = { 24161, 33608, 39702, 45701 }; int[] cameraPositions = { 24161, 33608, 39702, 45701 };
sLDMotion.SnapshotSettings.Add(new SnapshotSetting sLDMotion.SnapshotSettings.Add(new SnapshotSetting
{ {
IsEnabled = true, IsEnabled = true,
@ -1040,8 +1010,6 @@ namespace DHSoftware
}); });
} }
sLDMotion.BlowSettings = new List<BlowSetting>(); sLDMotion.BlowSettings = new List<BlowSetting>();
int[] BlowPositions = { 61353, 68566 }; int[] BlowPositions = { 61353, 68566 };
sLDMotion.BlowSettings.Add(new BlowSetting sLDMotion.BlowSettings.Add(new BlowSetting
@ -1065,8 +1033,6 @@ namespace DHSoftware
//sna1.CameraPosition = 17000; //sna1.CameraPosition = 17000;
//sna1.StationNumber = 0; //sna1.StationNumber = 0;
// sLDMotion.SnapshotSettings.Add(sna1); // sLDMotion.SnapshotSettings.Add(sna1);
sLDMotion.AxisSettings.Add(axis1); sLDMotion.AxisSettings.Add(axis1);
sLDMotion.Init(); sLDMotion.Init();
@ -1114,11 +1080,11 @@ namespace DHSoftware
} }
#endif #endif
private uint PieceCount = 0; private uint PieceCount = 0;
private List<ConcurrentDictionary<uint, ProductData>> _productLists = new List<ConcurrentDictionary<uint, ProductData>>(); private List<ConcurrentDictionary<uint, ProductData>> _productLists = new List<ConcurrentDictionary<uint, ProductData>>();
private int ProductListMulti = 2; private int ProductListMulti = 2;
private int ProductBaseCount = 0; private int ProductBaseCount = 0;
private int PieceNumberToIndex(uint pn) private int PieceNumberToIndex(uint pn)
{ {
// 物料编号,取余 集合数量 // 物料编号,取余 集合数量
@ -1126,7 +1092,9 @@ namespace DHSoftware
int ret = (int)(pn % (ProductBaseCount * ProductListMulti)); int ret = (int)(pn % (ProductBaseCount * ProductListMulti));
return ret; return ret;
} }
DateTime _ctTime = DateTime.Now;
private DateTime _ctTime = DateTime.Now;
public async void MainMotion_NewPieces(int axisIndex, uint pieceNumber) public async void MainMotion_NewPieces(int axisIndex, uint pieceNumber)
{ {
//if (MachineState != MachineState.Running && MachineState != MachineState.Warning) //if (MachineState != MachineState.Running && MachineState != MachineState.Warning)
@ -1134,10 +1102,8 @@ namespace DHSoftware
// return; // return;
//} //}
PieceCount++; PieceCount++;
int index = PieceNumberToIndex(pieceNumber); int index = PieceNumberToIndex(pieceNumber);
// productDatas.Add(pData); // productDatas.Add(pData);
//转盘2 的物料是不是重新覆盖之前的pDta //转盘2 的物料是不是重新覆盖之前的pDta
@ -1150,14 +1116,12 @@ namespace DHSoftware
Task.Run(() => Task.Run(() =>
{ {
//this.BeginInvoke(new MethodInvoker(delegate () { richTextBox1.AppendText(logStr); })); //this.BeginInvoke(new MethodInvoker(delegate () { richTextBox1.AppendText(logStr); }));
}); });
DateTime dtNow = DateTime.Now; DateTime dtNow = DateTime.Now;
UpdateCT(null, (float)(dtNow - _ctTime).TotalSeconds); UpdateCT(null, (float)(dtNow - _ctTime).TotalSeconds);
_ctTime = dtNow; _ctTime = dtNow;
} }
public async Task UpdateCT(object objData, float ctTime) public async Task UpdateCT(object objData, float ctTime)
{ {
await Task.Run(() => await Task.Run(() =>
@ -1165,6 +1129,7 @@ namespace DHSoftware
//OnUpdateCT?.Invoke(objData, ctTime); //OnUpdateCT?.Invoke(objData, ctTime);
}); });
} }
/// <summary> /// <summary>
/// 相机回调 /// 相机回调
/// </summary> /// </summary>
@ -1173,7 +1138,6 @@ namespace DHSoftware
/// <param name="imageSet"></param> /// <param name="imageSet"></param>
private void OnCameraHImageOutput(DateTime dt, CameraBase camera, Mat imageSet) private void OnCameraHImageOutput(DateTime dt, CameraBase camera, Mat imageSet)
{ {
//if (camera.CameraName.Equals("cam1", StringComparison.OrdinalIgnoreCase)) //if (camera.CameraName.Equals("cam1", StringComparison.OrdinalIgnoreCase))
//{ //{
// Console.WriteLine(); // Console.WriteLine();
@ -1230,7 +1194,6 @@ namespace DHSoftware
localImageSet.Dispose(); localImageSet.Dispose();
this.BeginInvoke(new MethodInvoker(delegate () this.BeginInvoke(new MethodInvoker(delegate ()
{ {
int currentScrollPosition = richTextBox1.GetPositionFromCharIndex(richTextBox1.TextLength).Y; int currentScrollPosition = richTextBox1.GetPositionFromCharIndex(richTextBox1.TextLength).Y;
richTextBox1.AppendText(productNumber + "提前推出" + camera.CameraName); richTextBox1.AppendText(productNumber + "提前推出" + camera.CameraName);
@ -1252,11 +1215,9 @@ namespace DHSoftware
if (!_cameraRelatedDetectionDict.ContainsKey(camera.CameraName)) if (!_cameraRelatedDetectionDict.ContainsKey(camera.CameraName))
{ {
localImageSet.Dispose(); localImageSet.Dispose();
this.BeginInvoke(new MethodInvoker(delegate () this.BeginInvoke(new MethodInvoker(delegate ()
{ {
int currentScrollPosition = richTextBox1.GetPositionFromCharIndex(richTextBox1.TextLength).Y; int currentScrollPosition = richTextBox1.GetPositionFromCharIndex(richTextBox1.TextLength).Y;
richTextBox1.AppendText(productNumber + "提前推出" + camera.CameraName); richTextBox1.AppendText(productNumber + "提前推出" + camera.CameraName);
@ -1276,33 +1237,23 @@ namespace DHSoftware
return; return;
} }
double totalTime = 0.0; double totalTime = 0.0;
List<ResultState> resultStates = new List<ResultState>(); List<ResultState> resultStates = new List<ResultState>();
List<string>? detectionDict = _cameraRelatedDetectionDict[camera.CameraName]; List<string>? detectionDict = _cameraRelatedDetectionDict[camera.CameraName];
for (int i = 0; i < detectionDict.Count; i++) for (int i = 0; i < detectionDict.Count; i++)
{ {
string detectionId = detectionDict[i]; string detectionId = detectionDict[i];
// 1. 预处理 // 1. 预处理
using (Mat inferenceImage = localImageSet.Clone()) // 仅在此处克隆,确保推理过程中 Mat 有独立副本 using (Mat inferenceImage = localImageSet.Clone()) // 仅在此处克隆,确保推理过程中 Mat 有独立副本
{ {
DetectStationResult temp1=_visionEngine.RunInference(inferenceImage, detectionId); DetectStationResult temp1 = _visionEngine.RunInference(inferenceImage, detectionId);
resultStates.Add(temp1.ResultState); resultStates.Add(temp1.ResultState);
product.ResultCollection.Add(temp1); product.ResultCollection.Add(temp1);
} }
} }
product.InferenceOne(); product.InferenceOne();
@ -1311,14 +1262,12 @@ namespace DHSoftware
if (!product.InferenceFinished()) if (!product.InferenceFinished())
{ {
return; return;
} }
ProductNum_Total++; ProductNum_Total++;
CalculateOEE(); CalculateOEE();
this.BeginInvoke(new MethodInvoker(delegate () this.BeginInvoke(new MethodInvoker(delegate ()
{ {
int currentScrollPosition = richTextBox1.GetPositionFromCharIndex(richTextBox1.TextLength).Y; int currentScrollPosition = richTextBox1.GetPositionFromCharIndex(richTextBox1.TextLength).Y;
richTextBox1.AppendText($"统计结果成功,{productNumber} 吹气!\n"); richTextBox1.AppendText($"统计结果成功,{productNumber} 吹气!\n");
@ -1327,20 +1276,16 @@ namespace DHSoftware
richTextBox1.SelectionStart = richTextBox1.TextLength; richTextBox1.SelectionStart = richTextBox1.TextLength;
richTextBox1.ScrollToCaret(); richTextBox1.ScrollToCaret();
})); }));
#region 6. #region 6.
product.ProductResult = product.ResultCollection.Any(u => u.ResultState != ResultState.OK) product.ProductResult = product.ResultCollection.Any(u => u.ResultState != ResultState.OK)
? ResultState.B_NG ? ResultState.B_NG
: ResultState.OK; : ResultState.OK;
product.ProductLabelCategory = product.ProductResult.GetEnumDescription(); product.ProductLabelCategory = product.ProductResult.GetEnumDescription();
product.ProductLabel = product.ProductResult.GetEnumDescription(); product.ProductLabel = product.ProductResult.GetEnumDescription();
#endregion
#region 7.
#endregion
#endregion 6.
// 出列 // 出列
ProductData temp = null; ProductData temp = null;
@ -1362,7 +1307,6 @@ namespace DHSoftware
$"当前队列产品数量:{tmpDic.Count}"; $"当前队列产品数量:{tmpDic.Count}";
this.BeginInvoke(new MethodInvoker(delegate () this.BeginInvoke(new MethodInvoker(delegate ()
{ {
int currentScrollPosition = richTextBox1.GetPositionFromCharIndex(richTextBox1.TextLength).Y; int currentScrollPosition = richTextBox1.GetPositionFromCharIndex(richTextBox1.TextLength).Y;
richTextBox1.AppendText(logStr); richTextBox1.AppendText(logStr);
@ -1381,7 +1325,6 @@ namespace DHSoftware
$"当前队列产品数量:{tmpDic.Count}"; $"当前队列产品数量:{tmpDic.Count}";
this.BeginInvoke(new MethodInvoker(delegate () this.BeginInvoke(new MethodInvoker(delegate ()
{ {
int currentScrollPosition = richTextBox1.GetPositionFromCharIndex(richTextBox1.TextLength).Y; int currentScrollPosition = richTextBox1.GetPositionFromCharIndex(richTextBox1.TextLength).Y;
richTextBox1.AppendText(logStr); richTextBox1.AppendText(logStr);
@ -1396,7 +1339,6 @@ namespace DHSoftware
{ {
sw.WriteLine(logStr); sw.WriteLine(logStr);
} }
} }
catch (Exception) { } catch (Exception) { }
finally finally
@ -1409,8 +1351,6 @@ namespace DHSoftware
// UpdateCT((float)(dtNow - _ctTime).TotalSeconds); // UpdateCT((float)(dtNow - _ctTime).TotalSeconds);
//_ctTime = dtNow; //_ctTime = dtNow;
// }); // });
} }
catch (Exception ex) catch (Exception ex)
{ {
@ -1418,18 +1358,11 @@ namespace DHSoftware
product?.Dispose(); product?.Dispose();
} }
} }
}); });
} }
public void SetResult() public void SetResult()
{ {
//// detectResult.IsPreTreatDone = detectResult.VisionImageSet.PreTreatedFlag //// detectResult.IsPreTreatDone = detectResult.VisionImageSet.PreTreatedFlag
////2024-02-29 目标检测不能全是NG ////2024-02-29 目标检测不能全是NG
//if (IsPreTreatNG || IsObjectDetectNG) //if (IsPreTreatNG || IsObjectDetectNG)
@ -1437,25 +1370,25 @@ namespace DHSoftware
// return; // return;
//} //}
//if (IsPreTreatDone && IsMLDetectDone && IsAfterTreatDone) //if (IsPreTreatDone && IsMLDetectDone && IsAfterTreatDone)
//{ //{
// ResultState = ResultState.OK; // ResultState = ResultState.OK;
// ResultLabel = ResultState.OK.GetEnumDescription(); // ResultLabel = ResultState.OK.GetEnumDescription();
//} //}
} }
private void HandleStopButton() private void HandleStopButton()
{ {
Cameras.Clear(); Cameras.Clear();
Dectection.Clear(); Dectection.Clear();
// Add the code for the "停止" button click here // Add the code for the "停止" button click here
PLC.TurntableStop(); PLC.TurntableStop();
CurrentMachine = true; CurrentMachine = true;
sLDMotion.Stop(); sLDMotion.Stop();
} }
public int UPH = 0; public int UPH = 0;
public void CalculateOEE() public void CalculateOEE()
{ {
TimeSpan timeSpan = DateTime.Now - startTime; TimeSpan timeSpan = DateTime.Now - startTime;
@ -1464,12 +1397,10 @@ namespace DHSoftware
//UPM = (int)UPH / 60; //UPM = (int)UPH / 60;
this.BeginInvoke(new MethodInvoker(delegate () this.BeginInvoke(new MethodInvoker(delegate ()
{ {
label1.Text = UPH.ToString(); labuph.Text = UPH.ToString();
})); }));
} }
private void HandleResetButton() private void HandleResetButton()
{ {
// Add the code for the "复位" button click here // Add the code for the "复位" button click here
@ -1481,19 +1412,17 @@ namespace DHSoftware
// Add the code for the "设置" button click here // Add the code for the "设置" button click here
SettingWindow.Instance.Show(); SettingWindow.Instance.Show();
} }
private void HandleLoginButton() private void HandleLoginButton()
{ {
// Add the code for the "登录" button click here // Add the code for the "登录" button click here
LoginWindow.Instance.Owner = this; LoginWindow.Instance.Owner = this;
LoginWindow.Instance.Show(); LoginWindow.Instance.Show();
} }
private void splitter1_SplitterMoved(object sender, SplitterEventArgs e) private void splitter1_SplitterMoved(object sender, SplitterEventArgs e)
{ {
} }
} }
} }

View File

@ -117,34 +117,34 @@
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<data name="segmentedItem1.IconActiveSvg" xml:space="preserve"> <data name="segmentedItem6.IconActiveSvg" xml:space="preserve">
<value>&lt;svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"&gt;&lt;path d="M731.818667 500.280889L386.844444 239.729778a14.677333 14.677333 0 0 0-23.495111 11.719111v521.159111a14.677333 14.677333 0 0 0 23.495111 11.662222l344.860445-260.608a14.677333 14.677333 0 0 0 0.113778-23.381333z" fill="#FFFFFF"/&gt;&lt;path d="M512 1024a512 512 0 1 1 512-512 512.568889 512.568889 0 0 1-512 512z m0-946.915556A434.915556 434.915556 0 1 0 946.915556 512 435.427556 435.427556 0 0 0 512 77.084444z" fill="#FFFFFF"/&gt;&lt;/svg&gt;</value> <value>&lt;svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"&gt;&lt;path d="M731.818667 500.280889L386.844444 239.729778a14.677333 14.677333 0 0 0-23.495111 11.719111v521.159111a14.677333 14.677333 0 0 0 23.495111 11.662222l344.860445-260.608a14.677333 14.677333 0 0 0 0.113778-23.381333z" fill="#FFFFFF"/&gt;&lt;path d="M512 1024a512 512 0 1 1 512-512 512.568889 512.568889 0 0 1-512 512z m0-946.915556A434.915556 434.915556 0 1 0 946.915556 512 435.427556 435.427556 0 0 0 512 77.084444z" fill="#FFFFFF"/&gt;&lt;/svg&gt;</value>
</data> </data>
<data name="segmentedItem1.IconSvg" xml:space="preserve"> <data name="segmentedItem6.IconSvg" xml:space="preserve">
<value>&lt;svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"&gt;&lt;path d="M731.818667 500.280889L386.844444 239.729778a14.677333 14.677333 0 0 0-23.495111 11.719111v521.159111a14.677333 14.677333 0 0 0 23.495111 11.662222l344.860445-260.608a14.677333 14.677333 0 0 0 0.113778-23.381333z" fill="#FFFFFF"/&gt;&lt;path d="M512 1024a512 512 0 1 1 512-512 512.568889 512.568889 0 0 1-512 512z m0-946.915556A434.915556 434.915556 0 1 0 946.915556 512 435.427556 435.427556 0 0 0 512 77.084444z" fill="#FFFFFF"/&gt;&lt;/svg&gt;</value> <value>&lt;svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"&gt;&lt;path d="M731.818667 500.280889L386.844444 239.729778a14.677333 14.677333 0 0 0-23.495111 11.719111v521.159111a14.677333 14.677333 0 0 0 23.495111 11.662222l344.860445-260.608a14.677333 14.677333 0 0 0 0.113778-23.381333z" fill="#FFFFFF"/&gt;&lt;path d="M512 1024a512 512 0 1 1 512-512 512.568889 512.568889 0 0 1-512 512z m0-946.915556A434.915556 434.915556 0 1 0 946.915556 512 435.427556 435.427556 0 0 0 512 77.084444z" fill="#FFFFFF"/&gt;&lt;/svg&gt;</value>
</data> </data>
<data name="segmentedItem2.IconActiveSvg" xml:space="preserve"> <data name="segmentedItem7.IconActiveSvg" xml:space="preserve">
<value>&lt;svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"&gt;&lt;path d="M365.014704 657.815846H657.084939V365.74561H365.014704V657.815846zm584.140471-146.035118c0-240.906781-197.125482-438.105353-438.105353-438.105353-240.979872 0-438.105353 197.198572-438.105354 438.105353 0 240.979872 197.125482 438.178444 438.105354 438.178444 240.979872 0 438.105353-197.198572 438.105353-438.178444zM511.634547 0.730906c281.399001 0 511.634547 230.235546 511.634547 511.634547s-230.235546 511.634547-511.634547 511.634547-511.634547-230.235546-511.634547-511.634547 230.235546-511.634547 511.634547-511.634547z" fill="#FFFFFF"/&gt;&lt;/svg&gt;</value> <value>&lt;svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"&gt;&lt;path d="M365.014704 657.815846H657.084939V365.74561H365.014704V657.815846zm584.140471-146.035118c0-240.906781-197.125482-438.105353-438.105353-438.105353-240.979872 0-438.105353 197.198572-438.105354 438.105353 0 240.979872 197.125482 438.178444 438.105354 438.178444 240.979872 0 438.105353-197.198572 438.105353-438.178444zM511.634547 0.730906c281.399001 0 511.634547 230.235546 511.634547 511.634547s-230.235546 511.634547-511.634547 511.634547-511.634547-230.235546-511.634547-511.634547 230.235546-511.634547 511.634547-511.634547z" fill="#FFFFFF"/&gt;&lt;/svg&gt;</value>
</data> </data>
<data name="segmentedItem2.IconSvg" xml:space="preserve"> <data name="segmentedItem7.IconSvg" xml:space="preserve">
<value>&lt;svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"&gt;&lt;path d="M365.014704 657.815846H657.084939V365.74561H365.014704V657.815846zm584.140471-146.035118c0-240.906781-197.125482-438.105353-438.105353-438.105353-240.979872 0-438.105353 197.198572-438.105354 438.105353 0 240.979872 197.125482 438.178444 438.105354 438.178444 240.979872 0 438.105353-197.198572 438.105353-438.178444zM511.634547 0.730906c281.399001 0 511.634547 230.235546 511.634547 511.634547s-230.235546 511.634547-511.634547 511.634547-511.634547-230.235546-511.634547-511.634547 230.235546-511.634547 511.634547-511.634547z" fill="#FFFFFF"/&gt;&lt;/svg&gt;</value> <value>&lt;svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"&gt;&lt;path d="M365.014704 657.815846H657.084939V365.74561H365.014704V657.815846zm584.140471-146.035118c0-240.906781-197.125482-438.105353-438.105353-438.105353-240.979872 0-438.105353 197.198572-438.105354 438.105353 0 240.979872 197.125482 438.178444 438.105354 438.178444 240.979872 0 438.105353-197.198572 438.105353-438.178444zM511.634547 0.730906c281.399001 0 511.634547 230.235546 511.634547 511.634547s-230.235546 511.634547-511.634547 511.634547-511.634547-230.235546-511.634547-511.634547 230.235546-511.634547 511.634547-511.634547z" fill="#FFFFFF"/&gt;&lt;/svg&gt;</value>
</data> </data>
<data name="segmentedItem3.IconActiveSvg" xml:space="preserve"> <data name="segmentedItem8.IconActiveSvg" xml:space="preserve">
<value>&lt;svg viewBox="0 0 1027 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"&gt;&lt;path d="M512 0C229.376 0 0 229.376 0 512s229.376 512 512 512 512-229.376 512-512S794.624 0 512 0zm0 963.584c-249.344 0-451.584-202.24-451.584-451.584S262.656 60.416 512 60.416s451.584 202.24 451.584 451.584-202.24 451.584-451.584 451.584z" fill="#FFFFFF"/&gt;&lt;path d="M527.36 351.744V292.864L410.624 380.416 527.36 468.48V410.624c72.192 8.192 124.416 73.216 116.224 145.408-8.192 72.192-73.216 124.416-145.408 116.224-66.56-7.168-117.248-64-117.248-131.072-0.512-5.12-0.512-9.728 0-14.848H323.584c-0.512 5.12-0.512 9.728 0 14.848 0 104.96 85.504 189.952 190.464 189.952s189.952-85.504 189.952-190.464c-0.512-99.328-77.312-181.76-176.64-188.928z" fill="#FFFFFF"/&gt;&lt;/svg&gt;</value> <value>&lt;svg viewBox="0 0 1027 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"&gt;&lt;path d="M512 0C229.376 0 0 229.376 0 512s229.376 512 512 512 512-229.376 512-512S794.624 0 512 0zm0 963.584c-249.344 0-451.584-202.24-451.584-451.584S262.656 60.416 512 60.416s451.584 202.24 451.584 451.584-202.24 451.584-451.584 451.584z" fill="#FFFFFF"/&gt;&lt;path d="M527.36 351.744V292.864L410.624 380.416 527.36 468.48V410.624c72.192 8.192 124.416 73.216 116.224 145.408-8.192 72.192-73.216 124.416-145.408 116.224-66.56-7.168-117.248-64-117.248-131.072-0.512-5.12-0.512-9.728 0-14.848H323.584c-0.512 5.12-0.512 9.728 0 14.848 0 104.96 85.504 189.952 190.464 189.952s189.952-85.504 189.952-190.464c-0.512-99.328-77.312-181.76-176.64-188.928z" fill="#FFFFFF"/&gt;&lt;/svg&gt;</value>
</data> </data>
<data name="segmentedItem3.IconSvg" xml:space="preserve"> <data name="segmentedItem8.IconSvg" xml:space="preserve">
<value>&lt;svg viewBox="0 0 1027 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"&gt;&lt;path d="M512 0C229.376 0 0 229.376 0 512s229.376 512 512 512 512-229.376 512-512S794.624 0 512 0zm0 963.584c-249.344 0-451.584-202.24-451.584-451.584S262.656 60.416 512 60.416s451.584 202.24 451.584 451.584-202.24 451.584-451.584 451.584z" fill="#FFFFFF"/&gt;&lt;path d="M527.36 351.744V292.864L410.624 380.416 527.36 468.48V410.624c72.192 8.192 124.416 73.216 116.224 145.408-8.192 72.192-73.216 124.416-145.408 116.224-66.56-7.168-117.248-64-117.248-131.072-0.512-5.12-0.512-9.728 0-14.848H323.584c-0.512 5.12-0.512 9.728 0 14.848 0 104.96 85.504 189.952 190.464 189.952s189.952-85.504 189.952-190.464c-0.512-99.328-77.312-181.76-176.64-188.928z" fill="#FFFFFF"/&gt;&lt;/svg&gt;</value> <value>&lt;svg viewBox="0 0 1027 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"&gt;&lt;path d="M512 0C229.376 0 0 229.376 0 512s229.376 512 512 512 512-229.376 512-512S794.624 0 512 0zm0 963.584c-249.344 0-451.584-202.24-451.584-451.584S262.656 60.416 512 60.416s451.584 202.24 451.584 451.584-202.24 451.584-451.584 451.584z" fill="#FFFFFF"/&gt;&lt;path d="M527.36 351.744V292.864L410.624 380.416 527.36 468.48V410.624c72.192 8.192 124.416 73.216 116.224 145.408-8.192 72.192-73.216 124.416-145.408 116.224-66.56-7.168-117.248-64-117.248-131.072-0.512-5.12-0.512-9.728 0-14.848H323.584c-0.512 5.12-0.512 9.728 0 14.848 0 104.96 85.504 189.952 190.464 189.952s189.952-85.504 189.952-190.464c-0.512-99.328-77.312-181.76-176.64-188.928z" fill="#FFFFFF"/&gt;&lt;/svg&gt;</value>
</data> </data>
<data name="segmentedItem4.IconActiveSvg" xml:space="preserve"> <data name="segmentedItem9.IconActiveSvg" xml:space="preserve">
<value>&lt;svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"&gt;&lt;path d="M512 0C229.376 0 0 229.376 0 512s229.376 512 512 512 512-229.376 512-512S794.624 0 512 0zm0 963.584c-249.344 0-451.584-202.24-451.584-451.584S262.656 60.416 512 60.416s451.584 202.24 451.584 451.584-202.24 451.584-451.584 451.584z" fill="#FFFFFF"/&gt;&lt;path transform="scale(0.8) translate(128,128)" d="M960.853333 903.816533a463.633067 463.633067 0 0 0-11.264-39.185066c-1.536-4.539733-3.413333-8.942933-5.051733-13.448534a484.078933 484.078933 0 0 0-9.557333-24.4736c-2.2528-5.188267-4.881067-10.274133-7.338667-15.394133-3.413333-7.099733-6.8608-14.165333-10.6496-21.0944-2.901333-5.3248-6.075733-10.513067-9.181867-15.701333-2.423467-4.061867-4.573867-8.226133-7.133866-12.219734-1.604267-2.4576-3.413333-4.778667-5.0176-7.202133-1.501867-2.218667-2.730667-4.608-4.266667-6.792533-0.4096-0.6144-1.058133-0.887467-1.501867-1.4336a461.482667 461.482667 0 0 0-90.385066-96.768c-13.5168-10.786133-27.7504-20.48-42.257067-29.5936-0.477867-0.341333-0.7168-0.8192-1.194667-1.1264-3.6864-2.286933-7.509333-4.3008-11.264-6.485334-4.266667-2.491733-8.4992-5.051733-12.868266-7.441066-6.826667-3.6864-13.789867-7.099733-20.753067-10.478934-3.618133-1.7408-7.202133-3.618133-10.8544-5.290666a449.194667 449.194667 0 0 0-31.607467-12.731734c-0.7168-0.273067-1.365333-0.6144-2.082133-0.8192-3.140267-1.1264-6.417067-1.911467-9.557333-2.935466-4.164267-1.399467-8.328533-2.833067-12.561067-4.096a259.9936 259.9936 0 0 0 129.194667-225.450667 260.061867 260.061867 0 0 0-76.629334-185.002667 259.9936 259.9936 0 0 0-185.002666-76.629333H512h-0.034133a259.857067 259.857067 0 0 0-185.002667 76.629333 259.925333 259.925333 0 0 0-76.629333 185.002667 259.584 259.584 0 0 0 76.629333 185.002667c15.906133 15.940267 33.655467 29.2864 52.565333 40.448-4.266667 1.262933-8.430933 2.730667-12.663466 4.096-3.140267 1.058133-6.3488 1.8432-9.489067 2.935466-0.7168 0.238933-1.365333 0.580267-2.048 0.8192-10.683733 3.822933-21.265067 8.0896-31.675733 12.765867-3.584 1.604267-7.0656 3.4816-10.615467 5.154133-7.099733 3.413333-14.165333 6.826667-21.0944 10.615467-4.266667 2.321067-8.3968 4.8128-12.561067 7.2704-3.822933 2.218667-7.748267 4.266667-11.502933 6.621867-0.512 0.3072-0.750933 0.8192-1.2288 1.160533-14.506667 9.147733-28.706133 18.807467-42.222933 29.559467a459.6736 459.6736 0 0 0-90.385067 96.768c-0.443733 0.546133-1.092267 0.8192-1.501867 1.4336-1.536 2.184533-2.7648 4.573867-4.266666 6.792533-1.604267 2.423467-3.447467 4.744533-5.0176 7.202133-2.56 3.9936-4.7104 8.157867-7.133867 12.219734-3.106133 5.188267-6.280533 10.376533-9.181867 15.701333-3.7888 6.929067-7.202133 13.994667-10.6496 21.0944-2.4576 5.12-5.051733 10.205867-7.338666 15.394133-3.515733 8.021333-6.519467 16.247467-9.557334 24.4736-1.672533 4.5056-3.549867 8.9088-5.051733 13.448534-4.3008 12.868267-8.0896 25.941333-11.264 39.185066-3.072 12.970667 2.594133 25.770667 13.073067 32.802134a31.3344 31.3344 0 0 0 9.966933 4.608 30.9248 30.9248 0 0 0 34.030933-15.2576 30.446933 30.446933 0 0 0 3.345067-7.7824c2.833067-11.844267 6.178133-23.483733 10.0352-34.9184 0.6144-1.8432 1.399467-3.549867 2.013867-5.358934 3.447467-9.762133 7.133867-19.456 11.332266-28.945066 0.512-1.160533 1.1264-2.2528 1.6384-3.447467 4.7104-10.308267 9.728-20.48 15.291734-30.344533l0.068266-0.1024a402.773333 402.773333 0 0 1 19.694934-31.4368l0.136533-0.375467a397.4144 397.4144 0 0 1 116.599467-111.2064c0.136533-0.1024 0.3072-0.068267 0.443733-0.170667a397.824 397.824 0 0 1 94.993067-42.973866c2.7648-0.8192 5.495467-1.7408 8.2944-2.491734 5.7344-1.604267 11.5712-3.003733 17.373866-4.334933a367.8208 367.8208 0 0 1 47.342934-7.953067c3.8912-0.443733 7.7824-0.9216 11.6736-1.2288 10.410667-0.785067 20.8896-1.3312 31.505066-1.3312s21.060267 0.546133 31.505067 1.3312c3.8912 0.3072 7.816533 0.785067 11.707733 1.2288a361.3696 361.3696 0 0 1 47.240534 7.953067c5.870933 1.3312 11.707733 2.730667 17.5104 4.334933 2.696533 0.750933 5.358933 1.6384 8.021333 2.4576 33.348267 10.103467 65.365333 24.405333 95.197867 43.008 0.136533 0.1024 0.3072 0.068267 0.443733 0.170667a396.151467 396.151467 0 0 1 116.599467 111.2064c0.1024 0.136533 0.1024 0.273067 0.170666 0.375467 13.687467 19.7632 25.3952 40.5504 35.191467 62.1568l1.467733 3.037866c4.3008 9.659733 8.055467 19.592533 11.605334 29.5936 0.546133 1.604267 1.2288 3.106133 1.774933 4.7104 3.822933 11.4688 7.236267 23.176533 10.0352 35.0208a31.061333 31.061333 0 0 0 60.450133-14.336zm-249.275733-560.2304A199.850667 199.850667 0 0 1 512 543.197867a199.850667 199.850667 0 0 1-199.5776-199.611734A199.816533 199.816533 0 0 1 512 144.008533a199.816533 199.816533 0 0 1 199.5776 199.5776z" fill="#FFFFFF"/&gt;&lt;/svg&gt;</value> <value>&lt;svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"&gt;&lt;path d="M512 0C229.376 0 0 229.376 0 512s229.376 512 512 512 512-229.376 512-512S794.624 0 512 0zm0 963.584c-249.344 0-451.584-202.24-451.584-451.584S262.656 60.416 512 60.416s451.584 202.24 451.584 451.584-202.24 451.584-451.584 451.584z" fill="#FFFFFF"/&gt;&lt;path transform="scale(0.8) translate(128,128)" d="M960.853333 903.816533a463.633067 463.633067 0 0 0-11.264-39.185066c-1.536-4.539733-3.413333-8.942933-5.051733-13.448534a484.078933 484.078933 0 0 0-9.557333-24.4736c-2.2528-5.188267-4.881067-10.274133-7.338667-15.394133-3.413333-7.099733-6.8608-14.165333-10.6496-21.0944-2.901333-5.3248-6.075733-10.513067-9.181867-15.701333-2.423467-4.061867-4.573867-8.226133-7.133866-12.219734-1.604267-2.4576-3.413333-4.778667-5.0176-7.202133-1.501867-2.218667-2.730667-4.608-4.266667-6.792533-0.4096-0.6144-1.058133-0.887467-1.501867-1.4336a461.482667 461.482667 0 0 0-90.385066-96.768c-13.5168-10.786133-27.7504-20.48-42.257067-29.5936-0.477867-0.341333-0.7168-0.8192-1.194667-1.1264-3.6864-2.286933-7.509333-4.3008-11.264-6.485334-4.266667-2.491733-8.4992-5.051733-12.868266-7.441066-6.826667-3.6864-13.789867-7.099733-20.753067-10.478934-3.618133-1.7408-7.202133-3.618133-10.8544-5.290666a449.194667 449.194667 0 0 0-31.607467-12.731734c-0.7168-0.273067-1.365333-0.6144-2.082133-0.8192-3.140267-1.1264-6.417067-1.911467-9.557333-2.935466-4.164267-1.399467-8.328533-2.833067-12.561067-4.096a259.9936 259.9936 0 0 0 129.194667-225.450667 260.061867 260.061867 0 0 0-76.629334-185.002667 259.9936 259.9936 0 0 0-185.002666-76.629333H512h-0.034133a259.857067 259.857067 0 0 0-185.002667 76.629333 259.925333 259.925333 0 0 0-76.629333 185.002667 259.584 259.584 0 0 0 76.629333 185.002667c15.906133 15.940267 33.655467 29.2864 52.565333 40.448-4.266667 1.262933-8.430933 2.730667-12.663466 4.096-3.140267 1.058133-6.3488 1.8432-9.489067 2.935466-0.7168 0.238933-1.365333 0.580267-2.048 0.8192-10.683733 3.822933-21.265067 8.0896-31.675733 12.765867-3.584 1.604267-7.0656 3.4816-10.615467 5.154133-7.099733 3.413333-14.165333 6.826667-21.0944 10.615467-4.266667 2.321067-8.3968 4.8128-12.561067 7.2704-3.822933 2.218667-7.748267 4.266667-11.502933 6.621867-0.512 0.3072-0.750933 0.8192-1.2288 1.160533-14.506667 9.147733-28.706133 18.807467-42.222933 29.559467a459.6736 459.6736 0 0 0-90.385067 96.768c-0.443733 0.546133-1.092267 0.8192-1.501867 1.4336-1.536 2.184533-2.7648 4.573867-4.266666 6.792533-1.604267 2.423467-3.447467 4.744533-5.0176 7.202133-2.56 3.9936-4.7104 8.157867-7.133867 12.219734-3.106133 5.188267-6.280533 10.376533-9.181867 15.701333-3.7888 6.929067-7.202133 13.994667-10.6496 21.0944-2.4576 5.12-5.051733 10.205867-7.338666 15.394133-3.515733 8.021333-6.519467 16.247467-9.557334 24.4736-1.672533 4.5056-3.549867 8.9088-5.051733 13.448534-4.3008 12.868267-8.0896 25.941333-11.264 39.185066-3.072 12.970667 2.594133 25.770667 13.073067 32.802134a31.3344 31.3344 0 0 0 9.966933 4.608 30.9248 30.9248 0 0 0 34.030933-15.2576 30.446933 30.446933 0 0 0 3.345067-7.7824c2.833067-11.844267 6.178133-23.483733 10.0352-34.9184 0.6144-1.8432 1.399467-3.549867 2.013867-5.358934 3.447467-9.762133 7.133867-19.456 11.332266-28.945066 0.512-1.160533 1.1264-2.2528 1.6384-3.447467 4.7104-10.308267 9.728-20.48 15.291734-30.344533l0.068266-0.1024a402.773333 402.773333 0 0 1 19.694934-31.4368l0.136533-0.375467a397.4144 397.4144 0 0 1 116.599467-111.2064c0.136533-0.1024 0.3072-0.068267 0.443733-0.170667a397.824 397.824 0 0 1 94.993067-42.973866c2.7648-0.8192 5.495467-1.7408 8.2944-2.491734 5.7344-1.604267 11.5712-3.003733 17.373866-4.334933a367.8208 367.8208 0 0 1 47.342934-7.953067c3.8912-0.443733 7.7824-0.9216 11.6736-1.2288 10.410667-0.785067 20.8896-1.3312 31.505066-1.3312s21.060267 0.546133 31.505067 1.3312c3.8912 0.3072 7.816533 0.785067 11.707733 1.2288a361.3696 361.3696 0 0 1 47.240534 7.953067c5.870933 1.3312 11.707733 2.730667 17.5104 4.334933 2.696533 0.750933 5.358933 1.6384 8.021333 2.4576 33.348267 10.103467 65.365333 24.405333 95.197867 43.008 0.136533 0.1024 0.3072 0.068267 0.443733 0.170667a396.151467 396.151467 0 0 1 116.599467 111.2064c0.1024 0.136533 0.1024 0.273067 0.170666 0.375467 13.687467 19.7632 25.3952 40.5504 35.191467 62.1568l1.467733 3.037866c4.3008 9.659733 8.055467 19.592533 11.605334 29.5936 0.546133 1.604267 1.2288 3.106133 1.774933 4.7104 3.822933 11.4688 7.236267 23.176533 10.0352 35.0208a31.061333 31.061333 0 0 0 60.450133-14.336zm-249.275733-560.2304A199.850667 199.850667 0 0 1 512 543.197867a199.850667 199.850667 0 0 1-199.5776-199.611734A199.816533 199.816533 0 0 1 512 144.008533a199.816533 199.816533 0 0 1 199.5776 199.5776z" fill="#FFFFFF"/&gt;&lt;/svg&gt;</value>
</data> </data>
<data name="segmentedItem4.IconSvg" xml:space="preserve"> <data name="segmentedItem9.IconSvg" xml:space="preserve">
<value>&lt;svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"&gt;&lt;path d="M512 0C229.376 0 0 229.376 0 512s229.376 512 512 512 512-229.376 512-512S794.624 0 512 0zm0 963.584c-249.344 0-451.584-202.24-451.584-451.584S262.656 60.416 512 60.416s451.584 202.24 451.584 451.584-202.24 451.584-451.584 451.584z" fill="#FFFFFF"/&gt;&lt;path transform="scale(0.8) translate(128,128)" d="M960.853333 903.816533a463.633067 463.633067 0 0 0-11.264-39.185066c-1.536-4.539733-3.413333-8.942933-5.051733-13.448534a484.078933 484.078933 0 0 0-9.557333-24.4736c-2.2528-5.188267-4.881067-10.274133-7.338667-15.394133-3.413333-7.099733-6.8608-14.165333-10.6496-21.0944-2.901333-5.3248-6.075733-10.513067-9.181867-15.701333-2.423467-4.061867-4.573867-8.226133-7.133866-12.219734-1.604267-2.4576-3.413333-4.778667-5.0176-7.202133-1.501867-2.218667-2.730667-4.608-4.266667-6.792533-0.4096-0.6144-1.058133-0.887467-1.501867-1.4336a461.482667 461.482667 0 0 0-90.385066-96.768c-13.5168-10.786133-27.7504-20.48-42.257067-29.5936-0.477867-0.341333-0.7168-0.8192-1.194667-1.1264-3.6864-2.286933-7.509333-4.3008-11.264-6.485334-4.266667-2.491733-8.4992-5.051733-12.868266-7.441066-6.826667-3.6864-13.789867-7.099733-20.753067-10.478934-3.618133-1.7408-7.202133-3.618133-10.8544-5.290666a449.194667 449.194667 0 0 0-31.607467-12.731734c-0.7168-0.273067-1.365333-0.6144-2.082133-0.8192-3.140267-1.1264-6.417067-1.911467-9.557333-2.935466-4.164267-1.399467-8.328533-2.833067-12.561067-4.096a259.9936 259.9936 0 0 0 129.194667-225.450667 260.061867 260.061867 0 0 0-76.629334-185.002667 259.9936 259.9936 0 0 0-185.002666-76.629333H512h-0.034133a259.857067 259.857067 0 0 0-185.002667 76.629333 259.925333 259.925333 0 0 0-76.629333 185.002667 259.584 259.584 0 0 0 76.629333 185.002667c15.906133 15.940267 33.655467 29.2864 52.565333 40.448-4.266667 1.262933-8.430933 2.730667-12.663466 4.096-3.140267 1.058133-6.3488 1.8432-9.489067 2.935466-0.7168 0.238933-1.365333 0.580267-2.048 0.8192-10.683733 3.822933-21.265067 8.0896-31.675733 12.765867-3.584 1.604267-7.0656 3.4816-10.615467 5.154133-7.099733 3.413333-14.165333 6.826667-21.0944 10.615467-4.266667 2.321067-8.3968 4.8128-12.561067 7.2704-3.822933 2.218667-7.748267 4.266667-11.502933 6.621867-0.512 0.3072-0.750933 0.8192-1.2288 1.160533-14.506667 9.147733-28.706133 18.807467-42.222933 29.559467a459.6736 459.6736 0 0 0-90.385067 96.768c-0.443733 0.546133-1.092267 0.8192-1.501867 1.4336-1.536 2.184533-2.7648 4.573867-4.266666 6.792533-1.604267 2.423467-3.447467 4.744533-5.0176 7.202133-2.56 3.9936-4.7104 8.157867-7.133867 12.219734-3.106133 5.188267-6.280533 10.376533-9.181867 15.701333-3.7888 6.929067-7.202133 13.994667-10.6496 21.0944-2.4576 5.12-5.051733 10.205867-7.338666 15.394133-3.515733 8.021333-6.519467 16.247467-9.557334 24.4736-1.672533 4.5056-3.549867 8.9088-5.051733 13.448534-4.3008 12.868267-8.0896 25.941333-11.264 39.185066-3.072 12.970667 2.594133 25.770667 13.073067 32.802134a31.3344 31.3344 0 0 0 9.966933 4.608 30.9248 30.9248 0 0 0 34.030933-15.2576 30.446933 30.446933 0 0 0 3.345067-7.7824c2.833067-11.844267 6.178133-23.483733 10.0352-34.9184 0.6144-1.8432 1.399467-3.549867 2.013867-5.358934 3.447467-9.762133 7.133867-19.456 11.332266-28.945066 0.512-1.160533 1.1264-2.2528 1.6384-3.447467 4.7104-10.308267 9.728-20.48 15.291734-30.344533l0.068266-0.1024a402.773333 402.773333 0 0 1 19.694934-31.4368l0.136533-0.375467a397.4144 397.4144 0 0 1 116.599467-111.2064c0.136533-0.1024 0.3072-0.068267 0.443733-0.170667a397.824 397.824 0 0 1 94.993067-42.973866c2.7648-0.8192 5.495467-1.7408 8.2944-2.491734 5.7344-1.604267 11.5712-3.003733 17.373866-4.334933a367.8208 367.8208 0 0 1 47.342934-7.953067c3.8912-0.443733 7.7824-0.9216 11.6736-1.2288 10.410667-0.785067 20.8896-1.3312 31.505066-1.3312s21.060267 0.546133 31.505067 1.3312c3.8912 0.3072 7.816533 0.785067 11.707733 1.2288a361.3696 361.3696 0 0 1 47.240534 7.953067c5.870933 1.3312 11.707733 2.730667 17.5104 4.334933 2.696533 0.750933 5.358933 1.6384 8.021333 2.4576 33.348267 10.103467 65.365333 24.405333 95.197867 43.008 0.136533 0.1024 0.3072 0.068267 0.443733 0.170667a396.151467 396.151467 0 0 1 116.599467 111.2064c0.1024 0.136533 0.1024 0.273067 0.170666 0.375467 13.687467 19.7632 25.3952 40.5504 35.191467 62.1568l1.467733 3.037866c4.3008 9.659733 8.055467 19.592533 11.605334 29.5936 0.546133 1.604267 1.2288 3.106133 1.774933 4.7104 3.822933 11.4688 7.236267 23.176533 10.0352 35.0208a31.061333 31.061333 0 0 0 60.450133-14.336zm-249.275733-560.2304A199.850667 199.850667 0 0 1 512 543.197867a199.850667 199.850667 0 0 1-199.5776-199.611734A199.816533 199.816533 0 0 1 512 144.008533a199.816533 199.816533 0 0 1 199.5776 199.5776z" fill="#FFFFFF"/&gt;&lt;/svg&gt;</value> <value>&lt;svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"&gt;&lt;path d="M512 0C229.376 0 0 229.376 0 512s229.376 512 512 512 512-229.376 512-512S794.624 0 512 0zm0 963.584c-249.344 0-451.584-202.24-451.584-451.584S262.656 60.416 512 60.416s451.584 202.24 451.584 451.584-202.24 451.584-451.584 451.584z" fill="#FFFFFF"/&gt;&lt;path transform="scale(0.8) translate(128,128)" d="M960.853333 903.816533a463.633067 463.633067 0 0 0-11.264-39.185066c-1.536-4.539733-3.413333-8.942933-5.051733-13.448534a484.078933 484.078933 0 0 0-9.557333-24.4736c-2.2528-5.188267-4.881067-10.274133-7.338667-15.394133-3.413333-7.099733-6.8608-14.165333-10.6496-21.0944-2.901333-5.3248-6.075733-10.513067-9.181867-15.701333-2.423467-4.061867-4.573867-8.226133-7.133866-12.219734-1.604267-2.4576-3.413333-4.778667-5.0176-7.202133-1.501867-2.218667-2.730667-4.608-4.266667-6.792533-0.4096-0.6144-1.058133-0.887467-1.501867-1.4336a461.482667 461.482667 0 0 0-90.385066-96.768c-13.5168-10.786133-27.7504-20.48-42.257067-29.5936-0.477867-0.341333-0.7168-0.8192-1.194667-1.1264-3.6864-2.286933-7.509333-4.3008-11.264-6.485334-4.266667-2.491733-8.4992-5.051733-12.868266-7.441066-6.826667-3.6864-13.789867-7.099733-20.753067-10.478934-3.618133-1.7408-7.202133-3.618133-10.8544-5.290666a449.194667 449.194667 0 0 0-31.607467-12.731734c-0.7168-0.273067-1.365333-0.6144-2.082133-0.8192-3.140267-1.1264-6.417067-1.911467-9.557333-2.935466-4.164267-1.399467-8.328533-2.833067-12.561067-4.096a259.9936 259.9936 0 0 0 129.194667-225.450667 260.061867 260.061867 0 0 0-76.629334-185.002667 259.9936 259.9936 0 0 0-185.002666-76.629333H512h-0.034133a259.857067 259.857067 0 0 0-185.002667 76.629333 259.925333 259.925333 0 0 0-76.629333 185.002667 259.584 259.584 0 0 0 76.629333 185.002667c15.906133 15.940267 33.655467 29.2864 52.565333 40.448-4.266667 1.262933-8.430933 2.730667-12.663466 4.096-3.140267 1.058133-6.3488 1.8432-9.489067 2.935466-0.7168 0.238933-1.365333 0.580267-2.048 0.8192-10.683733 3.822933-21.265067 8.0896-31.675733 12.765867-3.584 1.604267-7.0656 3.4816-10.615467 5.154133-7.099733 3.413333-14.165333 6.826667-21.0944 10.615467-4.266667 2.321067-8.3968 4.8128-12.561067 7.2704-3.822933 2.218667-7.748267 4.266667-11.502933 6.621867-0.512 0.3072-0.750933 0.8192-1.2288 1.160533-14.506667 9.147733-28.706133 18.807467-42.222933 29.559467a459.6736 459.6736 0 0 0-90.385067 96.768c-0.443733 0.546133-1.092267 0.8192-1.501867 1.4336-1.536 2.184533-2.7648 4.573867-4.266666 6.792533-1.604267 2.423467-3.447467 4.744533-5.0176 7.202133-2.56 3.9936-4.7104 8.157867-7.133867 12.219734-3.106133 5.188267-6.280533 10.376533-9.181867 15.701333-3.7888 6.929067-7.202133 13.994667-10.6496 21.0944-2.4576 5.12-5.051733 10.205867-7.338666 15.394133-3.515733 8.021333-6.519467 16.247467-9.557334 24.4736-1.672533 4.5056-3.549867 8.9088-5.051733 13.448534-4.3008 12.868267-8.0896 25.941333-11.264 39.185066-3.072 12.970667 2.594133 25.770667 13.073067 32.802134a31.3344 31.3344 0 0 0 9.966933 4.608 30.9248 30.9248 0 0 0 34.030933-15.2576 30.446933 30.446933 0 0 0 3.345067-7.7824c2.833067-11.844267 6.178133-23.483733 10.0352-34.9184 0.6144-1.8432 1.399467-3.549867 2.013867-5.358934 3.447467-9.762133 7.133867-19.456 11.332266-28.945066 0.512-1.160533 1.1264-2.2528 1.6384-3.447467 4.7104-10.308267 9.728-20.48 15.291734-30.344533l0.068266-0.1024a402.773333 402.773333 0 0 1 19.694934-31.4368l0.136533-0.375467a397.4144 397.4144 0 0 1 116.599467-111.2064c0.136533-0.1024 0.3072-0.068267 0.443733-0.170667a397.824 397.824 0 0 1 94.993067-42.973866c2.7648-0.8192 5.495467-1.7408 8.2944-2.491734 5.7344-1.604267 11.5712-3.003733 17.373866-4.334933a367.8208 367.8208 0 0 1 47.342934-7.953067c3.8912-0.443733 7.7824-0.9216 11.6736-1.2288 10.410667-0.785067 20.8896-1.3312 31.505066-1.3312s21.060267 0.546133 31.505067 1.3312c3.8912 0.3072 7.816533 0.785067 11.707733 1.2288a361.3696 361.3696 0 0 1 47.240534 7.953067c5.870933 1.3312 11.707733 2.730667 17.5104 4.334933 2.696533 0.750933 5.358933 1.6384 8.021333 2.4576 33.348267 10.103467 65.365333 24.405333 95.197867 43.008 0.136533 0.1024 0.3072 0.068267 0.443733 0.170667a396.151467 396.151467 0 0 1 116.599467 111.2064c0.1024 0.136533 0.1024 0.273067 0.170666 0.375467 13.687467 19.7632 25.3952 40.5504 35.191467 62.1568l1.467733 3.037866c4.3008 9.659733 8.055467 19.592533 11.605334 29.5936 0.546133 1.604267 1.2288 3.106133 1.774933 4.7104 3.822933 11.4688 7.236267 23.176533 10.0352 35.0208a31.061333 31.061333 0 0 0 60.450133-14.336zm-249.275733-560.2304A199.850667 199.850667 0 0 1 512 543.197867a199.850667 199.850667 0 0 1-199.5776-199.611734A199.816533 199.816533 0 0 1 512 144.008533a199.816533 199.816533 0 0 1 199.5776 199.5776z" fill="#FFFFFF"/&gt;&lt;/svg&gt;</value>
</data> </data>
<data name="segmentedItem5.IconActiveSvg" xml:space="preserve"> <data name="segmentedItem10.IconActiveSvg" xml:space="preserve">
<value>&lt;svg viewBox="0 0 1027 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"&gt;&lt;path d="M512 0C229.376 0 0 229.376 0 512s229.376 512 512 512 512-229.376 512-512S794.624 0 512 0zm0 963.584c-249.344 0-451.584-202.24-451.584-451.584S262.656 60.416 512 60.416s451.584 202.24 451.584 451.584-202.24 451.584-451.584 451.584z" fill="#FFFFFF"/&gt;&lt;path d="M437.314 840.84l-18.967-5.795c-43.935-13.425-84.182-35.551-119.623-65.767l-15.203-12.962 11.199-16.544c17.376-25.668 17.938-59.158 1.433-85.319-14.356-22.787-39.028-36.385-66.006-36.385-4.102 0-8.229 0.328-12.267 0.974l-19.752 3.158-5.301-19.288c-8.196-29.823-12.353-59.896-12.353-89.381 0-19.675 1.863-39.491 5.694-60.582l3.652-20.105 20.349 1.862c2.343 0.214 4.726 0.323 7.081 0.323 29.007 0 55.436-15.908 68.974-41.516 14.941-28.2 11.264-62.223-9.356-86.694l-13.166-15.625L278.1 276.7c38.694-38.954 86.677-68.095 138.76-84.273l19.741-6.132 7.631 19.211c11.88 29.908 40.312 49.234 72.432 49.234 32.097 0 60.521-19.328 72.413-49.241l7.632-19.197 19.73 6.122c43.968 13.642 84.295 36.164 119.862 66.938l15.414 13.337-11.883 16.561c-18.636 25.975-19.684 60.166-2.671 87.105 14.369 22.78 39.055 36.373 66.04 36.372 4.344 0 8.71-0.366 12.978-1.087l20.143-3.403 5.176 19.762c7.539 28.792 11.362 57.566 11.362 85.522 0 21.328-2.143 43.048-6.365 64.554l-3.859 19.65-19.952-1.709a77.999 77.999 0 0 0-6.612-0.281c-28.998 0-55.44 15.917-69.009 41.542-14.47 27.405-11.311 60.816 8.063 85.095l12.496 15.661-14.222 14.111c-38.674 38.378-86.551 67.041-138.455 82.892l-18.968 5.792-7.988-18.152c-12.462-28.318-40.459-46.617-71.325-46.617-30.883 0-58.893 18.299-71.36 46.619l-7.99 18.152zm-95.455-94.18c22.324 16.82 46.59 30.174 72.469 39.881 22.445-34.023 60.731-55.125 102.336-55.125 41.59 0 79.862 21.1 102.303 55.12 32.745-12.298 63.249-30.557 89.663-53.667-19.709-35.774-20.525-79.555-1.04-116.455 19.699-37.203 56.634-61.386 98.053-64.883 1.705-12.731 2.565-25.453 2.565-38 0-18.339-1.923-37.155-5.729-56.144-42.123-0.241-80.616-21.581-103.077-57.189-22.944-36.331-25.024-81.029-6.697-118.768-22.165-16.932-46.203-30.4-71.788-40.221-8.847 14.328-20.577 26.719-34.618 36.447-20.522 14.219-44.602 21.735-69.635 21.735-25.044 0-49.131-7.516-69.657-21.734-14.042-9.727-25.773-22.116-34.618-36.441-32.551 12.503-62.856 30.935-89.106 54.196 21.198 36.233 22.547 80.974 2.407 118.987-19.71 37.285-56.808 61.499-98.402 64.875-1.45 11.713-2.161 23.035-2.161 34.255 0 19.715 2.166 39.792 6.449 59.894 41.851 0.474 80.029 21.785 102.35 57.214 22.218 35.217 24.782 78.871 7.933 116.023z" fill="#FFFFFF"/&gt;&lt;path d="M516.664 633.864c-66.246 0-120.141-53.897-120.141-120.147 0-66.249 53.895-120.146 120.141-120.146 66.237 0 120.127 53.897 120.127 120.146 0 66.25-53.89 120.147-120.127 120.147zm0-195.641c-41.625 0-75.488 33.866-75.488 75.494s33.863 75.495 75.488 75.495c41.617 0 75.475-33.867 75.475-75.495s-33.858-75.494-75.475-75.494z" fill="#FFFFFF"/&gt;&lt;/svg&gt;</value> <value>&lt;svg viewBox="0 0 1027 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"&gt;&lt;path d="M512 0C229.376 0 0 229.376 0 512s229.376 512 512 512 512-229.376 512-512S794.624 0 512 0zm0 963.584c-249.344 0-451.584-202.24-451.584-451.584S262.656 60.416 512 60.416s451.584 202.24 451.584 451.584-202.24 451.584-451.584 451.584z" fill="#FFFFFF"/&gt;&lt;path d="M437.314 840.84l-18.967-5.795c-43.935-13.425-84.182-35.551-119.623-65.767l-15.203-12.962 11.199-16.544c17.376-25.668 17.938-59.158 1.433-85.319-14.356-22.787-39.028-36.385-66.006-36.385-4.102 0-8.229 0.328-12.267 0.974l-19.752 3.158-5.301-19.288c-8.196-29.823-12.353-59.896-12.353-89.381 0-19.675 1.863-39.491 5.694-60.582l3.652-20.105 20.349 1.862c2.343 0.214 4.726 0.323 7.081 0.323 29.007 0 55.436-15.908 68.974-41.516 14.941-28.2 11.264-62.223-9.356-86.694l-13.166-15.625L278.1 276.7c38.694-38.954 86.677-68.095 138.76-84.273l19.741-6.132 7.631 19.211c11.88 29.908 40.312 49.234 72.432 49.234 32.097 0 60.521-19.328 72.413-49.241l7.632-19.197 19.73 6.122c43.968 13.642 84.295 36.164 119.862 66.938l15.414 13.337-11.883 16.561c-18.636 25.975-19.684 60.166-2.671 87.105 14.369 22.78 39.055 36.373 66.04 36.372 4.344 0 8.71-0.366 12.978-1.087l20.143-3.403 5.176 19.762c7.539 28.792 11.362 57.566 11.362 85.522 0 21.328-2.143 43.048-6.365 64.554l-3.859 19.65-19.952-1.709a77.999 77.999 0 0 0-6.612-0.281c-28.998 0-55.44 15.917-69.009 41.542-14.47 27.405-11.311 60.816 8.063 85.095l12.496 15.661-14.222 14.111c-38.674 38.378-86.551 67.041-138.455 82.892l-18.968 5.792-7.988-18.152c-12.462-28.318-40.459-46.617-71.325-46.617-30.883 0-58.893 18.299-71.36 46.619l-7.99 18.152zm-95.455-94.18c22.324 16.82 46.59 30.174 72.469 39.881 22.445-34.023 60.731-55.125 102.336-55.125 41.59 0 79.862 21.1 102.303 55.12 32.745-12.298 63.249-30.557 89.663-53.667-19.709-35.774-20.525-79.555-1.04-116.455 19.699-37.203 56.634-61.386 98.053-64.883 1.705-12.731 2.565-25.453 2.565-38 0-18.339-1.923-37.155-5.729-56.144-42.123-0.241-80.616-21.581-103.077-57.189-22.944-36.331-25.024-81.029-6.697-118.768-22.165-16.932-46.203-30.4-71.788-40.221-8.847 14.328-20.577 26.719-34.618 36.447-20.522 14.219-44.602 21.735-69.635 21.735-25.044 0-49.131-7.516-69.657-21.734-14.042-9.727-25.773-22.116-34.618-36.441-32.551 12.503-62.856 30.935-89.106 54.196 21.198 36.233 22.547 80.974 2.407 118.987-19.71 37.285-56.808 61.499-98.402 64.875-1.45 11.713-2.161 23.035-2.161 34.255 0 19.715 2.166 39.792 6.449 59.894 41.851 0.474 80.029 21.785 102.35 57.214 22.218 35.217 24.782 78.871 7.933 116.023z" fill="#FFFFFF"/&gt;&lt;path d="M516.664 633.864c-66.246 0-120.141-53.897-120.141-120.147 0-66.249 53.895-120.146 120.141-120.146 66.237 0 120.127 53.897 120.127 120.146 0 66.25-53.89 120.147-120.127 120.147zm0-195.641c-41.625 0-75.488 33.866-75.488 75.494s33.863 75.495 75.488 75.495c41.617 0 75.475-33.867 75.475-75.495s-33.858-75.494-75.475-75.494z" fill="#FFFFFF"/&gt;&lt;/svg&gt;</value>
</data> </data>
<data name="segmentedItem5.IconSvg" xml:space="preserve"> <data name="segmentedItem10.IconSvg" xml:space="preserve">
<value>&lt;svg viewBox="0 0 1027 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"&gt;&lt;path d="M512 0C229.376 0 0 229.376 0 512s229.376 512 512 512 512-229.376 512-512S794.624 0 512 0zm0 963.584c-249.344 0-451.584-202.24-451.584-451.584S262.656 60.416 512 60.416s451.584 202.24 451.584 451.584-202.24 451.584-451.584 451.584z" fill="#FFFFFF"/&gt;&lt;path d="M437.314 840.84l-18.967-5.795c-43.935-13.425-84.182-35.551-119.623-65.767l-15.203-12.962 11.199-16.544c17.376-25.668 17.938-59.158 1.433-85.319-14.356-22.787-39.028-36.385-66.006-36.385-4.102 0-8.229 0.328-12.267 0.974l-19.752 3.158-5.301-19.288c-8.196-29.823-12.353-59.896-12.353-89.381 0-19.675 1.863-39.491 5.694-60.582l3.652-20.105 20.349 1.862c2.343 0.214 4.726 0.323 7.081 0.323 29.007 0 55.436-15.908 68.974-41.516 14.941-28.2 11.264-62.223-9.356-86.694l-13.166-15.625L278.1 276.7c38.694-38.954 86.677-68.095 138.76-84.273l19.741-6.132 7.631 19.211c11.88 29.908 40.312 49.234 72.432 49.234 32.097 0 60.521-19.328 72.413-49.241l7.632-19.197 19.73 6.122c43.968 13.642 84.295 36.164 119.862 66.938l15.414 13.337-11.883 16.561c-18.636 25.975-19.684 60.166-2.671 87.105 14.369 22.78 39.055 36.373 66.04 36.372 4.344 0 8.71-0.366 12.978-1.087l20.143-3.403 5.176 19.762c7.539 28.792 11.362 57.566 11.362 85.522 0 21.328-2.143 43.048-6.365 64.554l-3.859 19.65-19.952-1.709a77.999 77.999 0 0 0-6.612-0.281c-28.998 0-55.44 15.917-69.009 41.542-14.47 27.405-11.311 60.816 8.063 85.095l12.496 15.661-14.222 14.111c-38.674 38.378-86.551 67.041-138.455 82.892l-18.968 5.792-7.988-18.152c-12.462-28.318-40.459-46.617-71.325-46.617-30.883 0-58.893 18.299-71.36 46.619l-7.99 18.152zm-95.455-94.18c22.324 16.82 46.59 30.174 72.469 39.881 22.445-34.023 60.731-55.125 102.336-55.125 41.59 0 79.862 21.1 102.303 55.12 32.745-12.298 63.249-30.557 89.663-53.667-19.709-35.774-20.525-79.555-1.04-116.455 19.699-37.203 56.634-61.386 98.053-64.883 1.705-12.731 2.565-25.453 2.565-38 0-18.339-1.923-37.155-5.729-56.144-42.123-0.241-80.616-21.581-103.077-57.189-22.944-36.331-25.024-81.029-6.697-118.768-22.165-16.932-46.203-30.4-71.788-40.221-8.847 14.328-20.577 26.719-34.618 36.447-20.522 14.219-44.602 21.735-69.635 21.735-25.044 0-49.131-7.516-69.657-21.734-14.042-9.727-25.773-22.116-34.618-36.441-32.551 12.503-62.856 30.935-89.106 54.196 21.198 36.233 22.547 80.974 2.407 118.987-19.71 37.285-56.808 61.499-98.402 64.875-1.45 11.713-2.161 23.035-2.161 34.255 0 19.715 2.166 39.792 6.449 59.894 41.851 0.474 80.029 21.785 102.35 57.214 22.218 35.217 24.782 78.871 7.933 116.023z" fill="#FFFFFF"/&gt;&lt;path d="M516.664 633.864c-66.246 0-120.141-53.897-120.141-120.147 0-66.249 53.895-120.146 120.141-120.146 66.237 0 120.127 53.897 120.127 120.146 0 66.25-53.89 120.147-120.127 120.147zm0-195.641c-41.625 0-75.488 33.866-75.488 75.494s33.863 75.495 75.488 75.495c41.617 0 75.475-33.867 75.475-75.495s-33.858-75.494-75.475-75.494z" fill="#FFFFFF"/&gt;&lt;/svg&gt;</value> <value>&lt;svg viewBox="0 0 1027 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"&gt;&lt;path d="M512 0C229.376 0 0 229.376 0 512s229.376 512 512 512 512-229.376 512-512S794.624 0 512 0zm0 963.584c-249.344 0-451.584-202.24-451.584-451.584S262.656 60.416 512 60.416s451.584 202.24 451.584 451.584-202.24 451.584-451.584 451.584z" fill="#FFFFFF"/&gt;&lt;path d="M437.314 840.84l-18.967-5.795c-43.935-13.425-84.182-35.551-119.623-65.767l-15.203-12.962 11.199-16.544c17.376-25.668 17.938-59.158 1.433-85.319-14.356-22.787-39.028-36.385-66.006-36.385-4.102 0-8.229 0.328-12.267 0.974l-19.752 3.158-5.301-19.288c-8.196-29.823-12.353-59.896-12.353-89.381 0-19.675 1.863-39.491 5.694-60.582l3.652-20.105 20.349 1.862c2.343 0.214 4.726 0.323 7.081 0.323 29.007 0 55.436-15.908 68.974-41.516 14.941-28.2 11.264-62.223-9.356-86.694l-13.166-15.625L278.1 276.7c38.694-38.954 86.677-68.095 138.76-84.273l19.741-6.132 7.631 19.211c11.88 29.908 40.312 49.234 72.432 49.234 32.097 0 60.521-19.328 72.413-49.241l7.632-19.197 19.73 6.122c43.968 13.642 84.295 36.164 119.862 66.938l15.414 13.337-11.883 16.561c-18.636 25.975-19.684 60.166-2.671 87.105 14.369 22.78 39.055 36.373 66.04 36.372 4.344 0 8.71-0.366 12.978-1.087l20.143-3.403 5.176 19.762c7.539 28.792 11.362 57.566 11.362 85.522 0 21.328-2.143 43.048-6.365 64.554l-3.859 19.65-19.952-1.709a77.999 77.999 0 0 0-6.612-0.281c-28.998 0-55.44 15.917-69.009 41.542-14.47 27.405-11.311 60.816 8.063 85.095l12.496 15.661-14.222 14.111c-38.674 38.378-86.551 67.041-138.455 82.892l-18.968 5.792-7.988-18.152c-12.462-28.318-40.459-46.617-71.325-46.617-30.883 0-58.893 18.299-71.36 46.619l-7.99 18.152zm-95.455-94.18c22.324 16.82 46.59 30.174 72.469 39.881 22.445-34.023 60.731-55.125 102.336-55.125 41.59 0 79.862 21.1 102.303 55.12 32.745-12.298 63.249-30.557 89.663-53.667-19.709-35.774-20.525-79.555-1.04-116.455 19.699-37.203 56.634-61.386 98.053-64.883 1.705-12.731 2.565-25.453 2.565-38 0-18.339-1.923-37.155-5.729-56.144-42.123-0.241-80.616-21.581-103.077-57.189-22.944-36.331-25.024-81.029-6.697-118.768-22.165-16.932-46.203-30.4-71.788-40.221-8.847 14.328-20.577 26.719-34.618 36.447-20.522 14.219-44.602 21.735-69.635 21.735-25.044 0-49.131-7.516-69.657-21.734-14.042-9.727-25.773-22.116-34.618-36.441-32.551 12.503-62.856 30.935-89.106 54.196 21.198 36.233 22.547 80.974 2.407 118.987-19.71 37.285-56.808 61.499-98.402 64.875-1.45 11.713-2.161 23.035-2.161 34.255 0 19.715 2.166 39.792 6.449 59.894 41.851 0.474 80.029 21.785 102.35 57.214 22.218 35.217 24.782 78.871 7.933 116.023z" fill="#FFFFFF"/&gt;&lt;path d="M516.664 633.864c-66.246 0-120.141-53.897-120.141-120.147 0-66.249 53.895-120.146 120.141-120.146 66.237 0 120.127 53.897 120.127 120.146 0 66.25-53.89 120.147-120.127 120.147zm0-195.641c-41.625 0-75.488 33.866-75.488 75.494s33.863 75.495 75.488 75.495c41.617 0 75.475-33.867 75.475-75.495s-33.858-75.494-75.475-75.494z" fill="#FFFFFF"/&gt;&lt;/svg&gt;</value>
</data> </data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />

View File

@ -1,16 +1,12 @@
using AntdUI; using AntdUI;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DHSoftware.Models namespace DHSoftware.Models
{ {
public class DataModel public class DataModel
{ {
} }
public class DefectRow:NotifyProperty
public class DefectRow : NotifyProperty
{ {
private bool selected = false; private bool selected = false;
public string LabelId { get; set; } public string LabelId { get; set; }

View File

@ -1,6 +1,4 @@
using System.Collections.Generic; namespace AntdUIDemo.Models
namespace AntdUIDemo.Models
{ {
public class DataUtil public class DataUtil
{ {
@ -220,9 +218,5 @@ namespace AntdUIDemo.Models
{ "Chat", "MessageOutlined" }, { "Chat", "MessageOutlined" },
{ "Other", "SettingOutlined" } { "Other", "SettingOutlined" }
}; };
} }
} }

View File

@ -1,9 +1,4 @@
using System; using SqlSugar;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SqlSugar;
namespace DHSoftware.Models namespace DHSoftware.Models
{ {

View File

@ -1,12 +1,4 @@
using System; namespace DHSoftware.Models
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DHSoftware.Models
{ {
public class Camera public class Camera
{ {
@ -14,7 +6,4 @@ namespace DHSoftware.Models
public string Alias { get; set; } public string Alias { get; set; }
public string ImagePath { get; set; } public string ImagePath { get; set; }
} }
}
}

View File

@ -1,15 +1,9 @@
using System; using DHSoftware.Models;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DHSoftware.Models;
using DHSoftware.Utils; using DHSoftware.Utils;
using SqlSugar; using SqlSugar;
namespace DHSoftware.Services namespace DHSoftware.Services
{ {
public static class AuthService public static class AuthService
{ {
public static User CurrentUser { get; private set; } public static User CurrentUser { get; private set; }
@ -37,11 +31,11 @@ namespace DHSoftware.Services
using (var db = DatabaseUtil.GetDatabase()) using (var db = DatabaseUtil.GetDatabase())
{ {
return db.Queryable<UserRole>() return db.Queryable<UserRole>()
.InnerJoin<RolePermission>((ur, rp) => ur.RoleId == rp.RoleId) .InnerJoin<RolePermission>((ur, rp) => ur.RoleId == rp.RoleId)
.Where((ur, rp) => ur.UserId == CurrentUser.Id) .Where((ur, rp) => ur.UserId == CurrentUser.Id)
.Where((ur, rp) => rp.PermissionCode == permissionCode) .Where((ur, rp) => rp.PermissionCode == permissionCode)
.Any(); .Any();
} }
} }

View File

@ -1,18 +1,9 @@
using System; namespace DHSoftware.Utils
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using AntdUI;
namespace DHSoftware.Utils
{ {
public static class AdaptiveHelper public static class AdaptiveHelper
{ {
#region #region
public static void setTag(Control cons) public static void setTag(Control cons)
{ {
foreach (Control con in cons.Controls) foreach (Control con in cons.Controls)
@ -42,8 +33,6 @@ namespace DHSoftware.Utils
} }
} }
#endregion
#endregion
} }
} }

View File

@ -1,9 +1,4 @@
using System; using DHSoftware.Models;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DHSoftware.Models;
using SqlSugar; using SqlSugar;
namespace DHSoftware.Utils namespace DHSoftware.Utils
@ -21,17 +16,23 @@ namespace DHSoftware.Utils
EnsureDirectoryExists(); EnsureDirectoryExists();
using (var db = GetDatabase()) using (var db = GetDatabase())
{ {
// 创建所有表 // 检查初始化状态(通过检查是否存在系统表)
db.CodeFirst.InitTables( bool isInitialized = db.DbMaintenance.IsAnyTable("RolePermission");
typeof(User),
typeof(Role),
typeof(Permission),
typeof(UserRole),
typeof(RolePermission)
);
// 初始化基础数据 if (!isInitialized)
InitializeSeedData(db); {
// 创建所有表
db.CodeFirst.InitTables(
typeof(User),
typeof(Role),
typeof(Permission),
typeof(UserRole),
typeof(RolePermission)
);
// 初始化基础数据
InitializeSeedData(db);
}
} }
} }

View File

@ -1,9 +1,5 @@
using System; using System.Security.Cryptography;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text; using System.Text;
using System.Threading.Tasks;
namespace DHSoftware.Utils namespace DHSoftware.Utils
{ {

View File

@ -1,5 +1,4 @@
using Microsoft.Win32; using Microsoft.Win32;
using System.Drawing;
namespace DHSoftware.Utils namespace DHSoftware.Utils
{ {

View File

@ -4,187 +4,182 @@ using DH.Commons.Helper;
using DH.Commons.Models; using DH.Commons.Models;
using DHSoftware.Utils; using DHSoftware.Utils;
using DH.Commons.Base; using DH.Commons.Base;
namespace DHSoftware.Views namespace DHSoftware.Views
{ {
public partial class SettingWindow : Window public partial class SettingWindow : Window
{ {
private UserControl currControl; private UserControl currControl;
public SettingWindow() public SettingWindow()
{ {
InitializeComponent(); InitializeComponent();
BindEventHandler(); BindEventHandler();
InitData(); InitData();
} }
/// <summary> /// <summary>
/// 窗体对象实例 /// 窗体对象实例
/// </summary> /// </summary>
private static SettingWindow _instance; private static SettingWindow _instance;
internal static SettingWindow Instance internal static SettingWindow Instance
{ {
get get
{ {
if (_instance == null) if (_instance == null || _instance.IsDisposed)
_instance = new SettingWindow(); _instance = new SettingWindow();
return _instance; return _instance;
} }
} }
private void BindEventHandler() private void BindEventHandler()
{ {
Resize += SettingWindow1_Resize; Resize += SettingWindow1_Resize;
btnAdd.SelectedValueChanged += btnAdd_SelectedValueChanged; btnAdd.SelectedValueChanged += btnAdd_SelectedValueChanged;
btnSave.Click += BtnSave_Click; btnSave.Click += BtnSave_Click;
menu1.SelectChanged += Menu1_SelectChanged; menu1.SelectChanged += Menu1_SelectChanged;
} }
private void Menu1_SelectChanged(object sender, MenuSelectEventArgs e) 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;
{
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;
}
} }
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 x; //定义当前窗体的宽度
private float y; //定义当前窗体的高度 private float y; //定义当前窗体的高度
private void InitData() private void InitData()
{ {
btnAdd.Items.Clear(); btnAdd.Items.Clear();
@ -196,68 +191,60 @@ namespace DHSoftware.Views
y = Height; y = Height;
AdaptiveHelper.setTag(this); AdaptiveHelper.setTag(this);
if (ConfigModel.CameraBaseList.Count > 0)
{
var workstationItem = FindMenuItem(menu1.Items, "相机设置");
if (ConfigModel.CameraBaseList.Count > 0) if (workstationItem != null)
{ {
var workstationItem = FindMenuItem(menu1.Items, "相机设置"); foreach (var item in ConfigModel.CameraBaseList)
if (workstationItem != null)
{ {
foreach (var item in ConfigModel.CameraBaseList) var newItem = new MenuItem();
{ newItem.Text = item.CameraName;
var newItem = new MenuItem(); newItem.IconSvg = "VideoCameraOutlined";
newItem.Text = item.CameraName; workstationItem.Sub.Add(newItem);
newItem.IconSvg = "VideoCameraOutlined";
workstationItem.Sub.Add(newItem);
}
} }
} }
if (ConfigModel.DetectionList.Count > 0) }
if (ConfigModel.DetectionList.Count > 0)
{
var workstationItem = FindMenuItem(menu1.Items, "工位设置");
if (workstationItem != null)
{ {
var workstationItem = FindMenuItem(menu1.Items, "工位设置"); foreach (var item in ConfigModel.DetectionList)
if (workstationItem != null)
{ {
foreach (var item in ConfigModel.DetectionList) var newItem = new MenuItem();
{ newItem.Text = item.Name;
var newItem = new MenuItem(); newItem.IconSvg = "AppstoreOutlined";
newItem.Text = item.Name; workstationItem.Sub.Add(newItem);
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);
}
} }
} }
} }
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) private void BtnSave_Click(object? sender, EventArgs e)
{ {
ConfigHelper.SaveConfig();
ConfigHelper.SaveConfig(); AntdUI.Message.success(this, "保存成功!", autoClose: 3);
AntdUI.Message.success(this, "保存成功!", autoClose: 3);
} }
private void SettingWindow1_Resize(object? sender, EventArgs e) private void SettingWindow1_Resize(object? sender, EventArgs e)
{ {
var newx = Width / x; var newx = Width / x;
@ -265,13 +252,6 @@ namespace DHSoftware.Views
AdaptiveHelper.setControls(newx, newy, this); AdaptiveHelper.setControls(newx, newy, this);
} }
// 递归查找菜单项 // 递归查找菜单项
private MenuItem FindMenuItem(MenuItemCollection items, string targetText) private MenuItem FindMenuItem(MenuItemCollection items, string targetText)
{ {
@ -287,17 +267,12 @@ namespace DHSoftware.Views
return null; return null;
} }
private bool isUpdatingTabs = false;
bool isUpdatingTabs = false;
private void menu1_MouseDown(object sender, MouseEventArgs e) 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); Point clickPoint = new Point(e.X, e.Y + menu1.ScrollBar.Value);
@ -324,7 +299,6 @@ namespace DHSoftware.Views
{ {
IconSvg = "DeleteOutlined" IconSvg = "DeleteOutlined"
} }
}; };
AntdUI.ContextMenuStrip.open(menu1, it => AntdUI.ContextMenuStrip.open(menu1, it =>
{ {
@ -346,6 +320,7 @@ namespace DHSoftware.Views
} }
ConfigModel.CameraBaseList.RemoveAll(c => c.CameraName == clickedItem.Text); ConfigModel.CameraBaseList.RemoveAll(c => c.CameraName == clickedItem.Text);
break; break;
case "重命名": case "重命名":
// 保存原始名称用于查找 // 保存原始名称用于查找
string originalName = clickedItem.Text; string originalName = clickedItem.Text;
@ -374,7 +349,7 @@ namespace DHSoftware.Views
return; return;
} }
clickedItem.Text= newName; clickedItem.Text = newName;
var camera = ConfigModel.CameraBaseList.FirstOrDefault(c => var camera = ConfigModel.CameraBaseList.FirstOrDefault(c =>
c.CameraName.Equals(originalName, StringComparison.OrdinalIgnoreCase)); c.CameraName.Equals(originalName, StringComparison.OrdinalIgnoreCase));
camera.CameraName = newName; camera.CameraName = newName;
@ -393,9 +368,9 @@ namespace DHSoftware.Views
} }
break; break;
} }
}, menulist); }, menulist);
break; break;
case "工位设置": case "工位设置":
var menulist1 = new AntdUI.IContextMenuStripItem[] var menulist1 = new AntdUI.IContextMenuStripItem[]
{ new AntdUI.ContextMenuStripItem("重命名", "") { new AntdUI.ContextMenuStripItem("重命名", "")
@ -406,7 +381,6 @@ namespace DHSoftware.Views
{ {
IconSvg = "DeleteOutlined" IconSvg = "DeleteOutlined"
} }
}; };
AntdUI.ContextMenuStrip.open(menu1, it => AntdUI.ContextMenuStrip.open(menu1, it =>
{ {
@ -427,6 +401,7 @@ namespace DHSoftware.Views
} }
ConfigModel.DetectionList.RemoveAll(c => c.Name == clickedItem.Text); ConfigModel.DetectionList.RemoveAll(c => c.Name == clickedItem.Text);
break; break;
case "重命名": case "重命名":
// 保存原始名称用于查找 // 保存原始名称用于查找
string originalName = clickedItem.Text; string originalName = clickedItem.Text;
@ -488,13 +463,12 @@ namespace DHSoftware.Views
{ {
IconSvg = "DeleteOutlined" IconSvg = "DeleteOutlined"
} }
}; };
AntdUI.ContextMenuStrip.open(menu1, it => AntdUI.ContextMenuStrip.open(menu1, it =>
{ {
switch (it.Text) switch (it.Text)
{ {
case "删除运控": case "删除运控":
menu1.Remove(clickedItem); menu1.Remove(clickedItem);
foreach (var tab in tabs1.Pages) foreach (var tab in tabs1.Pages)
{ {
@ -512,7 +486,8 @@ namespace DHSoftware.Views
ConfigModel.PLCBaseList.RemoveAll(c => c.PLCName == clickedItem.Text); ConfigModel.PLCBaseList.RemoveAll(c => c.PLCName == clickedItem.Text);
break; break;
case "重命名":
case "重命名":
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) AntdUI.Modal.open(new AntdUI.Modal.Config(this, "", form, TType.None)
@ -553,23 +528,15 @@ namespace DHSoftware.Views
} }
} }
break;
break;
} }
}, menulist2); }, menulist2);
break; break;
} }
} }
} }
} }
private MenuItem FindClickedItem(MenuItemCollection items, Point clickPoint) private MenuItem FindClickedItem(MenuItemCollection items, Point clickPoint)
{ {
foreach (MenuItem item in items) foreach (MenuItem item in items)
@ -590,8 +557,6 @@ namespace DHSoftware.Views
return null; return null;
} }
private void btnAdd_SelectedValueChanged(object sender, ObjectNEventArgs e) private void btnAdd_SelectedValueChanged(object sender, ObjectNEventArgs e)
{ {
string selectedValue = e.Value.ToString(); string selectedValue = e.Value.ToString();
@ -602,8 +567,7 @@ namespace DHSoftware.Views
if (workstationItem != null) 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) AntdUI.Modal.open(new AntdUI.Modal.Config(this, "", form, TType.None)
{ {
BtnHeight = 0, BtnHeight = 0,
@ -627,14 +591,14 @@ namespace DHSoftware.Views
} }
} }
break; break;
case "工位设置": case "工位设置":
// 查找工位设置项 // 查找工位设置项
var workstationItem1= FindMenuItem(menu1.Items, "工位设置"); var workstationItem1 = FindMenuItem(menu1.Items, "工位设置");
if (workstationItem1 != null) 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) AntdUI.Modal.open(new AntdUI.Modal.Config(this, "", form, TType.None)
{ {
BtnHeight = 0, BtnHeight = 0,
@ -647,7 +611,7 @@ namespace DHSoftware.Views
if (!workstationItem1.Sub.Cast<MenuItem>().Any(m => m.Text == newItem.Text)) if (!workstationItem1.Sub.Cast<MenuItem>().Any(m => m.Text == newItem.Text))
{ {
workstationItem1.Sub.Add(newItem); workstationItem1.Sub.Add(newItem);
DetectionConfig detection = new DetectionConfig(); DetectionConfig detection = new DetectionConfig();
detection.Name = form.CubicleName; detection.Name = form.CubicleName;
ConfigModel.DetectionList.Add(detection); ConfigModel.DetectionList.Add(detection);
} }
@ -658,13 +622,13 @@ namespace DHSoftware.Views
} }
} }
break; break;
case "运控设置": case "运控设置":
var workstationItem2 = FindMenuItem(menu1.Items, "运控设置"); var workstationItem2 = FindMenuItem(menu1.Items, "运控设置");
if (workstationItem2 != null) 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) AntdUI.Modal.open(new AntdUI.Modal.Config(this, "", form, TType.None)
{ {
BtnHeight = 0, BtnHeight = 0,
@ -692,4 +656,3 @@ namespace DHSoftware.Views
} }
} }
} }