using Yw;
|
|
namespace IStation
|
{
|
/// <summary>
|
/// 全局辅助类
|
/// </summary>
|
public class RealTimeScadaHelper
|
{
|
/// <summary>
|
/// 众毅实时数据
|
/// </summary>
|
public class ZyRealTimeDataDto
|
{
|
|
/// <summary>
|
///
|
/// </summary>
|
public string msg { get; set; }
|
|
/// <summary>
|
///
|
/// </summary>
|
public Dictionary<string, Dictionary<string, string>> data { get; set; }
|
|
/// <summary>
|
///
|
/// </summary>
|
public int status { get; set; }
|
}
|
|
/// <summary>
|
/// 获取实时众毅Scada数据列表
|
/// </summary>
|
public static string GetRealTimeZyScadaList(out List<List<Model.ZyScada>> zy_scada_list_list)
|
{
|
zy_scada_list_list = new List<List<Model.ZyScada>>();
|
var foler_path = $"{AppDomain.CurrentDomain.BaseDirectory}Data\\实时数据";
|
if (!Directory.Exists(foler_path))
|
{
|
return "!Directory.Exists(foler_path)";
|
}
|
|
var file_path_list = Directory.GetFiles(foler_path);
|
if (file_path_list==null|| !file_path_list.Any())
|
{
|
return "file_path_list==null|| !file_path_list.Any()";
|
}
|
|
foreach (var file_path in file_path_list)
|
{
|
var file_json = File.ReadAllText(file_path);
|
var zy_scada_list = JsonHelper.Json2Object<List<Model.ZyScada>>(file_json);
|
if (zy_scada_list == null || !zy_scada_list.Any())
|
{
|
continue;
|
}
|
|
zy_scada_list_list.Add(zy_scada_list);
|
}
|
|
|
return string.Empty;
|
}
|
|
|
|
|
}
|
}
|