导出、导入增加"触发"字段

This commit is contained in:
iioter 2024-06-01 08:58:02 +08:00
parent 2f8c01adc6
commit e717ef6274
2 changed files with 6 additions and 3 deletions

View File

@ -175,7 +175,7 @@ namespace IoTGateway.ViewModel.BasicData
#region
string[] colName = { "设备名", "变量名", "方法", "地址", "类型", "大小端", "表达式", "别名","上传", "排序" };
string[] colName = { "设备名", "变量名", "方法", "地址", "类型", "大小端", "表达式", "别名","上传", "排序", "触发" };
IRow row = sheet.CreateRow(currentRow);
row.HeightInPoints = 20;
@ -211,6 +211,8 @@ namespace IoTGateway.ViewModel.BasicData
rowData.CreateCell(currentCol).SetCellValue(deviceVariable.IsUpload);
currentCol++;
rowData.CreateCell(currentCol).SetCellValue(deviceVariable.Index);
currentCol++;
rowData.CreateCell(currentCol).SetCellValue(deviceVariable.IsTrigger);
currentRow++;
}
@ -282,11 +284,11 @@ namespace IoTGateway.ViewModel.BasicData
var allDevices = GetAllDevices();
book = GenerateDevicesSheet(book, allDevices);
//Sheet2-通讯设
//Sheet2-变量配
var allDeviceVariables = GetAllDeviceVariables();
book = GenerateDeviceVariablesSheet(book, allDeviceVariables);
//Sheet3-变量配
//Sheet3-通讯设
var allDeviceConfigs = GetAllDeviceConfigs();
book = GenerateDeviceConfigsSheet(book, allDeviceConfigs);

View File

@ -178,6 +178,7 @@ namespace IoTGateway.ViewModel.BasicData
variable.Index = string.IsNullOrWhiteSpace(row.GetCell(9)?.ToString())
? 999
: uint.Parse(row.GetCell(9).ToString());
variable.IsTrigger = row.GetCell(10)?.ToString().ToLower() == "false" ? false : true;
deviceVariables.Add(variable);
}