Files
ADP/UIShare/GlobalVariable/SystemConfig.cs
2026-06-05 10:57:09 +08:00

42 lines
2.2 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using Logger;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using UIShare.UIViewModel;
namespace UIShare.GlobalVariable
{
public class SystemConfig
{
[JsonIgnore]
public string SystemPath { get; set; } = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "UIShare");
public string Title { get; set; } = string.Empty;
public int PerformanceLevel { get; set; } = 50;
public string DLLFilePath { get; set; } = @"D:\ADP\指令\";
public string SubProgramFilePath { get; set; } = @"D:\ADP\子程序\";
public string DefaultProgramFilePath { get; set; } = "";
public string DefaultBLFFilePath { get; set; } = "";
public string DefaultDBCFilePath { get; set; } = "";
public string TSMasterName { get; set; } = "ADP测试上位机";
/// <summary>
/// 设备列表每个工位独立一份SystemConfig 已注册为 Scoped
/// 当前阶段预置几条模拟设备,便于设置界面直接展示左侧列表。
/// </summary>
public ObservableCollection<DeviceInfoModel> DeviceList { get; set; } = new()
{
new DeviceInfoModel { DeviceName = "DAQ_001", DeviceType = "数据采集卡", Remark = "8 通道电压采集", IsEnabled = true, IsConnected = false },
new DeviceInfoModel { DeviceName = "PSU_002", DeviceType = "可编程电源", Remark = "0-30V / 0-5A", IsEnabled = true, IsConnected = false },
new DeviceInfoModel { DeviceName = "CAN_003", DeviceType = "CAN 通讯卡", Remark = "双通道 CAN-FD", IsEnabled = false, IsConnected = false },
new DeviceInfoModel { DeviceName = "IO_004", DeviceType = "数字 I/O", Remark = "16 进 16 出", IsEnabled = true, IsConnected = false },
new DeviceInfoModel { DeviceName = "Serial_005", DeviceType = "串口", Remark = "RS232 / RS485", IsEnabled = true, IsConnected = false },
};
}
}