历史服务修复变量在线状态显示错误
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
]
|
||||
|
@@ -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>
|
||||
/// 变量值
|
||||
|
@@ -382,12 +382,9 @@ public class AlarmWorker : BackgroundService
|
||||
}
|
||||
|
||||
private void DeviceVariableChange(DeviceVariableRunTime variable)
|
||||
{
|
||||
if (!IsExited)
|
||||
{
|
||||
//这里不能序列化变量,报警服务需改变同一个变量指向的属性
|
||||
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);
|
||||
|
@@ -165,7 +165,7 @@ public class HistoryValueWorker : BackgroundService
|
||||
{
|
||||
await Task.Yield();//
|
||||
_logger?.LogInformation($"历史数据线程开始");
|
||||
|
||||
IsExited = false;
|
||||
try
|
||||
{
|
||||
|
||||
|
@@ -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>
|
||||
}
|
||||
|
||||
|
@@ -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):
|
||||
|
Reference in New Issue
Block a user