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测试上位机";
///
/// 设备列表:每个工位独立一份(SystemConfig 已注册为 Scoped)。
/// 当前阶段预置几条模拟设备,便于设置界面直接展示左侧列表。
///
public ObservableCollection 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 },
};
}
}