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 { /// /// 参数值发送到Redis /// public class FireValueToRedis { /// /// Redis类实例化 /// private RedisBaseHelper _redis = new RedisBaseHelper(6); /// /// 存储消防状态信息 /// internal void StoredFireStatusValue(string eqmNo, MFireStatusValue value) { try { //保存到Redis //Task result = _redis.SetStrValueAsync(eqmNo+"FireStatusValue", value, TimeSpan.FromSeconds(300)); //Task result = _redis.SetStrValueAsync(eqmNo + "FireStatusValue", value); } catch (Exception ex) { ex.ToString(); return; } } /// /// 存储消防故障信息 /// internal void StoredFireFaultInfo(string eqmNo, List value) { try { if (value != null) { //保存到Redis //Task result = _redis.SetStrValueAsync(eqmNo+"FireFaultInfo", value, TimeSpan.FromSeconds(300)); //Task result = _redis.SetStrValueAsync(eqmNo + "FireFaultInfo", value); } } catch (Exception ex) { ex.ToString(); return; } } /// /// 存储消防传感器信息 /// internal void StoredFireSensorInfo(string eqmNo, List value) { try { if (value != null) { //保存到Redis //Task result = _redis.SetStrValueAsync(eqmNo+"FireSensorInfo", value, TimeSpan.FromSeconds(300)); //Task result = _redis.SetStrValueAsync(eqmNo + "FireSensorInfo", value); } } catch (Exception ex) { ex.ToString(); return; } } /// /// 存储消防分区信息 /// internal void StoredFirePartitionValue(string eqmNo, MPartitionValue value) { try { //保存到Redis //Task result = _redis.SetStrValueAsync(eqmNo+"FirePartitionValue", value, TimeSpan.FromSeconds(300)); //Task result = _redis.SetStrValueAsync(eqmNo + "FirePartitionValue", value); } catch (Exception ex) { ex.ToString(); return; } } /// /// 存储消防灭火器状态信息 /// internal void StoredFireExtinguisher(string eqmNo, MFireExtinguisher value) { try { //保存到Redis //Task result = _redis.SetStrValueAsync(eqmNo+"FireExtinguisher", value, TimeSpan.FromSeconds(300)); //Task result = _redis.SetStrValueAsync(eqmNo + "FireExtinguisher", value); } catch (Exception ex) { ex.ToString(); return; } } } }