コード例 #1
0
ファイル: SysFunc.cs プロジェクト: tabtu/119CRT
 /// <summary>
 /// 获取在用设备类型列表
 /// </summary>
 /// <returns></returns>
 public IList <EquipType> GetEquipType()
 {
     try
     {
         DEquipType det = new DEquipType();
         return(det.SELECT_BY_ISUSED(true));
     }
     catch
     {
         return(null);
     }
 }
コード例 #2
0
ファイル: SysFunc.cs プロジェクト: tabtu/119CRT
 /// <summary>
 /// 获取设备状态
 /// </summary>
 /// <param name="id">状态ID</param>
 /// <returns></returns>
 public EquipType GetEquipType(short id)
 {
     try
     {
         DEquipType det = new DEquipType();
         return(det.SELECT_BY_ID(id));
     }
     catch
     {
         return(null);
     }
 }
コード例 #3
0
ファイル: LbsMaker.cs プロジェクト: tabtu/119CRT
        /// <summary>
        /// 获取设备信息地图
        /// </summary>
        /// <param name="nd"></param>
        /// <param name="le"></param>
        /// <returns></returns>
        public static string MakeEquipMap(NodeData nd, IList <EquipData> le, int lid)
        {
            DSCfunction       dsc    = new DSCfunction();
            DEquipType        edt    = new DEquipType();
            IList <EquipType> letype = edt.SELECT_BY_ISUSED(true);
            string            points = "";
            string            pclick = "\r\n<script type=\"text/javascript\">\r\n";

            for (int i = 0; i < le.Count; i++)
            {
                string curicon = "";
                string curtype = "";
                for (int j = 0; j < letype.Count; j++)
                {
                    curtype = letype[j].Name;
                    if (le[i].Type == letype[j].Id)
                    {
                        //curicon = iconurl + letype[j].Icon;
                        SC_NODE sn = new SC_NODE();
                        try
                        {
                            sn = dsc.SELECT_NODE_ID(lid, le[i].Logicid);
                        }
                        catch
                        {
                            sn = null;
                        }

                        string[] tmp     = letype[j].Icon.Split('.');
                        string   tmpicon = "";
                        if (sn != null)
                        {
                            if (sn.STATE == '0')                  // 恢复(正常)
                            {
                                tmpicon = tmp[0] + "1." + tmp[1]; // 绿色
                            }
                            else if (sn.STATE == '1')             // 故障
                            {
                                tmpicon = tmp[0] + "4." + tmp[1]; // 黄色
                            }
                            else if (sn.STATE == '2')             // 火警
                            {
                                tmpicon = tmp[0] + "3." + tmp[1]; // 红色
                            }
                            else if (sn.STATE == '3')             // 隔离
                            {
                                tmpicon = tmp[0] + "2." + tmp[1]; // 灰色
                            }
                            else if (sn.STATE == '4')             // 启动
                            {
                                tmpicon = tmp[0] + "5." + tmp[1]; // 深蓝色
                            }
                            else if (sn.STATE == '5')             // 预警
                            {
                                tmpicon = tmp[0] + "8." + tmp[1]; // 粉色
                            }
                            else if (sn.STATE == '6')             // 回答
                            {
                                tmpicon = tmp[0] + "7." + tmp[1]; // 浅蓝色
                            }
                            //else if (sn.STATE == "10")
                            //{
                            //    tmpicon = tmp[0] + "8" + tmp[1];
                            //}
                            //else if (sn.STATE == "12")
                            //{
                            //    tmpicon = tmp[0] + "2" + tmp[1];
                            //}
                            else
                            {
                                tmpicon = letype[j].Icon;  // 白色
                            }
                        }
                        else
                        {
                            tmpicon = letype[j].Icon;
                        }
                        curicon = iconurl + tmpicon;
                        break;
                    }
                }
                points += "<div class=\"jt\" style=\"left:" + le[i].X + "px;top:" + le[i].Y + "px;\"><img id=\"imge_" + le[i].Id + "\" src=\"" + curicon + "\"/></div>\r\n    ";
                //pclick += "C$('imge_" + le[i].Id + "').onclick = function () {var info = \'设备描述:" + le[i].Description + "<br/>设备编码:" + le[i].Logicid + "<br/>设备链接:<a href=\"" + le[i].Url + "\" target=\"_eurl\">点击显示</a>\';cwxbox.box.show(info);}\r\n";
                pclick += "C$('imge_" + le[i].Id + "').onclick = function () {var info = \'设备描述:" + le[i].Description + "<br/>设备编码:" + le[i].Logicid + "<br/>设备类型:" + curtype + "\';cwxbox.box.show(info);}\r\n";
            }
            pclick += "\r\n</script>\r\n";
            string h0 = "<!DOCTYPE html>\r\n<html>\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\r\n<title>";
            string h1 = "</title>\r\n<style>\r\n.jt{position:absolute;}\r\n*{ margin:0px; padding:0px;}\r\nbody{ font-size:12px; font:Arial, Helvetica, sans-serif; margin:25PX 0PX; background:#eee;}\r\n.botton{ color:#F00; cursor:pointer;}\r\n.mybody{width:600px; margin:0 auto; height:1500px; border:1px solid #ccc; padding:20px 25px; background:#fff}\r\n#cwxBg{ position:absolute; display:none; background:#000; width:100%; height:100%; left:0px; top:0px; z-index:1000;}\r\n#cwxWd{ position:absolute; display:none; border:10px solid #CCC; padding:10px;background:#FFF; z-index:1500;}\r\n#cwxCn{ background:#FFF; display:block;}\r\n.imgd{ width:400px; height:300px;}\r\n</style>\r\n</head>\r\n<body>\r\n<div style=\"position:relative;\">\r\n<script type = \"text/javascript\" src = \"./Scripts/DropBox.js\"></script>\r\n<img src=\"";
            string h2 = "\"/>\r\n";
            string h3 = "\r\n</div>\r\n</body>\r\n</html>";

            return(h0 + nd.PicName + h1 + mapurl + nd.PicPath + h2 + points + pclick + h3);
        }