public string GetData()
 {
     BLL.TN_RealtimeMonitor realdata = new BLL.TN_RealtimeMonitor();
     //realdata.CoalCode = "300";
     //realdata.DevCode = "0-0";
     realdata.PageSize = 10;
     realdata.CurrentPageIndex = 1;
     return realdata.GetRecordsAndPager();
 }
        public string GetJSON(string coalCode,string devCode,bool first)
        {
            first = true;
            BLL.TN_RealtimeMonitor realtime = new BLL.TN_RealtimeMonitor();
            List<string> collierys = new List<string>();

            collierys.Add(coalCode);
            realtime.CoalCode = collierys;
            realtime.DevCode = devCode;

            return realtime.BuildChartJSON(first);
        }
        /// <summary>
        /// 获取传感器报警上限和量程上限
        /// <param name="coalCode">煤矿编号</param>
        /// <param name="devCode">设备编号</param>
        /// <returns>传感器报警上限和量程上限</returns>
        /// </summary>
        public void GetAlarmURVAndMonitorURV(string coalCode, string devCode)
        {
            BLL.TN_RealtimeMonitor realtime = new BLL.TN_RealtimeMonitor();
            List<string> collierys = new List<string>();
            collierys.Add(coalCode);
            realtime.CoalCode = collierys;
            realtime.DevCode = devCode;

            string retval= realtime.GetAlarmURVAndMonitorURV();
            hfAlarmURV.Value = retval.Split(',')[0];
            hfMonitorURV.Value = retval.Split(',')[1];
        }
        public string GetJson(string coalCode, string devType, string devName, string devState, string devCode, int currentPageIndex, int pageSize)
        {
            BLL.TN_RealtimeMonitor rtData = new BLL.TN_RealtimeMonitor();
            rtData.CoalCode = BulidCoals(coalCode);
            rtData.DevType = devType;
            rtData.DevState = devState;
            rtData.DevCode = devCode;
            rtData.CurrentPageIndex = currentPageIndex;
            rtData.PageSize = pageSize;

            return rtData.GetRecordsAndPager();
        }
 public string GetJSON(string coalCode, string devCode, bool first)
 {
     BLL.TN_RealtimeMonitor realtime = new BLL.TN_RealtimeMonitor();
     List<string> collierys = new List<string>();
     collierys.Add(coalCode);
     realtime.CoalCode = collierys;
     realtime.DevCode = devCode;
     #region add by tangcy 传感器列表
     List<string> devcodelist = new List<string>();
     devcodelist.Add(devCode);
     realtime.devcodelist = devcodelist;
     #endregion
     return realtime.BuildMorChartJSON(first);
 }
 /// <summary>
 /// 获取JSON数据
 /// </summary>
 /// <returns>JSON</returns>
 public string BulidJSON()
 {
     BLL.TN_RealtimeMonitor realMonitor = new BLL.TN_RealtimeMonitor();
     StringBuilder sb = new StringBuilder();
     sb.Append("[");
     foreach(Model.TN_UpLoadState state in _uploadStateList)
     {
         sb.Append("{");
         sb.AppendFormat("'CoalCode':'{0}',",state.CoalCode);
         sb.AppendFormat("'CoalName':'{0}',",state.CoalName);
         sb.AppendFormat("'CoalIP':'{0}',",state.CoalIP);
         sb.AppendFormat("'UpLoadState':'{0}',",state.UpLoadState);
         sb.AppendFormat("'NetState':'{0}',",state.NetState);
         sb.AppendFormat("'RealTime':'{0}',",state.RealTime);
         sb.AppendFormat("'StartTime':'{0}',",state.StartTime);
         sb.AppendFormat("'PersistSpan':'{0}',",state.PersistSpan);
         sb.AppendFormat("'FaultCount':'{0}',",realMonitor.GetFaultCount(state.CoalCode).ToString());
         sb.AppendFormat("'AlarmCount':'{0}'",realMonitor.GetAlarmCount(state.CoalCode).ToString());
         sb.Append("}");
         sb.Append(",");
     }
     string retVal = sb.ToString().TrimEnd(',');
     return retVal += "]";
 }
 public string GetDevTypeJSON(string coalCode)
 {
     BLL.TN_RealtimeMonitor rtData = new BLL.TN_RealtimeMonitor();
     return rtData.BuildDevTypeJSON(BulidCoals(coalCode));
 }
 public string GetCoalJSON()
 {
     BLL.TN_RealtimeMonitor rtData = new BLL.TN_RealtimeMonitor();
     return rtData.BuildCoalsJSON();
 }