You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
120 lines
3.6 KiB
120 lines
3.6 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using Monitor.LogService;
|
|
using DataBase.Real.Redis;
|
|
|
|
namespace Module.FireCtrl.ModBusTcp
|
|
{
|
|
/// <summary>
|
|
/// 参数值发送到Redis
|
|
/// </summary>
|
|
public class FireValueToRedis
|
|
{
|
|
/// <summary>
|
|
/// Redis类实例化
|
|
/// </summary>
|
|
private RedisBaseHelper _redis = new RedisBaseHelper(6);
|
|
|
|
/// <summary>
|
|
/// 存储消防状态信息
|
|
/// </summary>
|
|
internal void StoredFireStatusValue(string eqmNo, MFireStatusValue value)
|
|
{
|
|
try
|
|
{
|
|
//保存到Redis
|
|
//Task<bool> result = _redis.SetStrValueAsync(eqmNo+"FireStatusValue", value, TimeSpan.FromSeconds(300));
|
|
//Task<bool> result = _redis.SetStrValueAsync(eqmNo + "FireStatusValue", value);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex.ToString();
|
|
return;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 存储消防故障信息
|
|
/// </summary>
|
|
internal void StoredFireFaultInfo(string eqmNo, List<MFaultInformation> value)
|
|
{
|
|
try
|
|
{
|
|
if (value != null)
|
|
{
|
|
//保存到Redis
|
|
//Task<bool> result = _redis.SetStrValueAsync(eqmNo+"FireFaultInfo", value, TimeSpan.FromSeconds(300));
|
|
//Task<bool> result = _redis.SetStrValueAsync(eqmNo + "FireFaultInfo", value);
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex.ToString();
|
|
return;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 存储消防传感器信息
|
|
/// </summary>
|
|
internal void StoredFireSensorInfo(string eqmNo, List<MSensorInformation> value)
|
|
{
|
|
try
|
|
{
|
|
if (value != null)
|
|
{
|
|
//保存到Redis
|
|
//Task<bool> result = _redis.SetStrValueAsync(eqmNo+"FireSensorInfo", value, TimeSpan.FromSeconds(300));
|
|
//Task<bool> result = _redis.SetStrValueAsync(eqmNo + "FireSensorInfo", value);
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex.ToString();
|
|
return;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 存储消防分区信息
|
|
/// </summary>
|
|
internal void StoredFirePartitionValue(string eqmNo, MPartitionValue value)
|
|
{
|
|
try
|
|
{
|
|
//保存到Redis
|
|
//Task<bool> result = _redis.SetStrValueAsync(eqmNo+"FirePartitionValue", value, TimeSpan.FromSeconds(300));
|
|
//Task<bool> result = _redis.SetStrValueAsync(eqmNo + "FirePartitionValue", value);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex.ToString();
|
|
return;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 存储消防灭火器状态信息
|
|
/// </summary>
|
|
internal void StoredFireExtinguisher(string eqmNo, MFireExtinguisher value)
|
|
{
|
|
try
|
|
{
|
|
//保存到Redis
|
|
//Task<bool> result = _redis.SetStrValueAsync(eqmNo+"FireExtinguisher", value, TimeSpan.FromSeconds(300));
|
|
//Task<bool> result = _redis.SetStrValueAsync(eqmNo + "FireExtinguisher", value);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex.ToString();
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|