共有变量添加

This commit is contained in:
hsc
2026-06-23 14:21:13 +08:00
parent 5b721d2557
commit cd3cbe7c35
11 changed files with 174 additions and 34 deletions

View File

@@ -621,10 +621,7 @@ namespace UIShare
{
LoggerHelper.WarnWithNotify(tmp.Item2);
}
//if (currentPara.IsSave && _scopedContext.Program.Parameters.FirstOrDefault(x => x.ID == currentPara.ID) != null)
//{
// _ = SaveDataToDatabase(_scopedContext.Program.ID, currentPara);
//}
}
var returnType = returnValue?.GetType();
if (returnType != null)

View File

@@ -9,6 +9,7 @@ using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using UIShare.UIViewModel;
using static UIShare.UIViewModel.ParameterVM;
namespace UIShare.GlobalVariable
{
@@ -27,6 +28,53 @@ namespace UIShare.GlobalVariable
public string DefaultBLFFilePath { get; set; } = "";
public string DefaultDBCFilePath { get; set; } = "";
public ObservableCollection<DeviceInfoVM> DeviceList = new();
public ObservableCollection<SharedParameter> SharedParameterList = new();
[JsonIgnore]
public ObservableCollection<ParameterVM> ParameterList = new()
{
new ParameterVM
{
Category = ParameterCategory.Input,
Type = typeof(int),
Name = "继电器占位1",
Value = 0,
},
new ParameterVM
{
Category = ParameterCategory.Input,
Type = typeof(int),
Name = "继电器占位2",
Value = 1,
},
new ParameterVM
{
Category = ParameterCategory.Input,
Type = typeof(int),
Name = "CAN通道",
Value = 0,
},
new ParameterVM
{
Category = ParameterCategory.Input,
Type = typeof(int),
Name = "示波器通道",
Value = 0,
},
new ParameterVM
{
Category = ParameterCategory.Input,
Type = typeof(int),
Name = "功率分析仪通道1",
Value = 0,
},
new ParameterVM
{
Category = ParameterCategory.Input,
Type = typeof(int),
Name = "功率分析仪通道2",
Value = 0,
},
};
// public ObservableCollection<DeviceInfoVM> DeviceList { get; set; } = new()
//{
// new DeviceInfoVM