历史服务修复变量在线状态显示错误

This commit is contained in:
2248356998 qq.com
2023-07-15 15:46:39 +08:00
parent 8ad693f717
commit 9246a6e797
6 changed files with 12 additions and 14 deletions

View File

@@ -11,7 +11,7 @@
"IsInitDb": true, //是否初始化数据库,适用于codefirst
"IsUnderLine": false, //是否驼峰转下划线
"IsSeedData": true, //是否初始化种子数据
"IsUpdateSeedData": true
"IsUpdateSeedData": false
},
{
"ConfigId": "ThingsGateway", //租户ID
@@ -21,7 +21,7 @@
"IsInitDb": true, //是否初始化数据库,适用于codefirst
"IsUnderLine": false, //是否驼峰转下划线
"IsSeedData": true, //是否初始化种子数据
"IsUpdateSeedData": true
"IsUpdateSeedData": false
}
]

View File

@@ -45,10 +45,10 @@ public class HistoryValue : PrimaryIdEntity
[Description("变量名称")]
public string Name { get; set; }
/// <summary>
/// 质量戳
/// 是否在线
/// </summary>
[Description("质量戳")]
public int Quality { get; set; }
[Description("是否在线")]
public bool IsOnline { get; set; }
/// <summary>
/// 变量值

View File

@@ -383,11 +383,8 @@ public class AlarmWorker : BackgroundService
private void DeviceVariableChange(DeviceVariableRunTime variable)
{
if (!IsExited)
{
//这里不能序列化变量,报警服务需改变同一个变量指向的属性
DeviceVariables.Enqueue(variable);
}
//这里不能序列化变量,报警服务需改变同一个变量指向的属性
DeviceVariables.Enqueue(variable);
}
/// <summary>
@@ -437,6 +434,7 @@ public class AlarmWorker : BackgroundService
{
await Task.Yield();//
_logger?.LogInformation($"历史报警线程开始");
IsExited = false;
try
{
await Task.Delay(500, StoppingToken.Token);

View File

@@ -165,7 +165,7 @@ public class HistoryValueWorker : BackgroundService
{
await Task.Yield();//
_logger?.LogInformation($"历史数据线程开始");
IsExited = false;
try
{

View File

@@ -62,9 +62,9 @@
</SearchTemplate>
<ItemColTemplate>
@if (context.Header.Value == nameof(context.Item.Quality))
@if (context.Header.Value == nameof(context.Item.IsOnline))
{
<EnableChip Value="context.Item.Quality==192" DisabledLabel=@context.Item.Quality.ToString() EnabledLabel=@context.Item.Quality.ToString()>
<EnableChip Value="context.Item.IsOnline" DisabledLabel=离线 EnabledLabel=在线>
</EnableChip>
}

View File

@@ -61,7 +61,7 @@ namespace ThingsGateway.Web.Page
case nameof(HistoryValue.Name):
item.Sortable = true;
break;
case nameof(HistoryValue.Quality):
case nameof(HistoryValue.IsOnline):
item.Sortable = true;
break;
case nameof(HistoryValue.CollectTime):