From 65226e3826a50957d973aae2f9ad3b5342fdb7ad Mon Sep 17 00:00:00 2001
From: hdw <hdw@192.168.7.127>
Date: 星期二, 15 一月 2019 17:19:05 +0800
Subject: [PATCH] 添加设备版本号

---
 gx_tieta/WebRoot/js/elecircle.content.js |  173 ++++++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 164 insertions(+), 9 deletions(-)

diff --git a/gx_tieta/WebRoot/js/elecircle.content.js b/gx_tieta/WebRoot/js/elecircle.content.js
index 4ce250c..3b3767c 100644
--- a/gx_tieta/WebRoot/js/elecircle.content.js
+++ b/gx_tieta/WebRoot/js/elecircle.content.js
@@ -1,5 +1,18 @@
 var eleCircle = new EleCircle('eleCircle', {});
+var signalGood = new Image();
+signalGood.src="image/eleCircle/signalGood.gif";
+var signalBad = new Image();
+signalBad.src="image/eleCircle/signalBad.gif";
 $(function() {
+	eleCircle.drawImg({
+		startX: 10,
+		startY: 30,
+		width: 30,
+		height: 30,
+		isShow:false,
+		id: 'signal'
+	});
+	
 	// 鏈�涓婃柟鐨勬í绾�
 	eleCircle.drawLine({
 		startX: 120,
@@ -463,12 +476,12 @@
 	});
 	
 	// 鎷撴墤鍥惧悕绉�
-	eleCircle.drawText({
+	/*eleCircle.drawText({
 		id: 'title',
 		startX: 400,
 		startY: 40,
-		name: '鐢垫睜缁勬诞鍏呯姸鎬佺數娴佹柟鍚�',
-	});
+		name: '璁惧娴厖鐘舵�佺數娴佹柟鍚�',
+	});*/
 	
 	// 璁惧鍐呴儴娓╁害
 	eleCircle.drawText({
@@ -476,6 +489,14 @@
 		startX: 270,
 		startY: 100,
 		name: '璁惧娓╁害锛�0鈩�',
+	});
+	
+	// dcdc妯″潡鍛婅
+	eleCircle.drawText({
+		id: 'dcdcWarn',
+		startX: 250,
+		startY: 390,
+		name: 'DCDC妯″潡鍛婅锛�0x8000/0x8000',
 	});
 	
 	var currentObj = {
@@ -487,7 +508,7 @@
 			[430, 520], [430, 360],[320,360]
 		],
 		clockwise: 0,
-		name: '鐢垫睜缁勬诞鍏呯姸鎬佺數娴佹柟鍚�'
+		name: '璁惧娴厖鐘舵�佺數娴佹柟鍚�'
 	}
 	
 	currentObj = $.extend({}, currentObj, floatCharge);
@@ -799,7 +820,18 @@
         }
         this.ele.append(_ul);
     };
-
+    
+    // 璁剧疆閰嶇疆椤�
+    _prop.setOpts = function(options) {
+    	this.options = options;
+        
+        this._init();
+        
+        if(this.options.length != 0) {
+            this.show();
+        }
+    };
+    
     // 鏍规嵁閰嶇疆椤圭殑鍊艰幏鍙杔i
     _prop._setLi = function(li, option) {
         var _i, _a = $('<a></a>');
@@ -825,6 +857,9 @@
         	}
         	var list = option.content.list[option.status]?option.content.list[option.status]:'鏈煡';
         	var txt = option.content.text+list;
+        	_a.append(txt);
+        }else if(option.type == 'text') {
+        	var txt = option.content.text;
         	_a.append(txt);
         }
         
@@ -871,6 +906,41 @@
             }
         }
 
+    };
+    
+    // 璁剧疆鏂囨湰鍐呭
+    _prop.setText = function(name, text, notShow) {
+    	var _itemList = this.ele.find('li');
+    	// 閬嶅巻閰嶇疆椤�
+        for(var i =0; i<this.options.length; i++) {
+        	var _opts = this.options[i];    // 鑾峰彇褰撳墠寰幆鐨勫彉閲�
+        	// 鏍规嵁鍚嶇О纭畾鏇存敼鐨勫唴瀹�
+            if(_opts.name == name) {
+                var _tmp = $.extend({}, _opts); // 鑾峰彇鍏ㄦ柊瀵硅薄锛岄伩鍏嶅紩鐢ㄤ紶閫�
+                _tmp.content.text = text;
+                
+                // 璁剧疆鏄惁鏄剧ず
+                if(notShow) {
+                	_tmp.notShow = true;
+                }else {
+                	_tmp.notShow = false;
+                }
+                
+                this._setLi(_itemList.eq(i), _tmp); // 鏇存柊li鐨勫唴瀹�
+            }
+        }
+    };
+    
+    // 鏇存柊閰嶇疆椤圭殑鍊�
+    _prop.updateOpts = function(name, options, update) {
+    	// 閬嶅巻閰嶇疆椤�
+        for(var i =0; i<options.length; i++) {
+        	var _opts = options[i];    // 鑾峰彇褰撳墠寰幆鐨勫彉閲�
+        	// 鏍规嵁鍚嶇О纭畾鏇存敼鐨勫唴瀹�
+            if(_opts.name == name) {
+            	$.extend(_opts, update);
+            }
+        }
     };
     var options = [
 		{
@@ -922,8 +992,87 @@
         	}
         }
     ];
+    // 61850閰嶇疆椤�
+    gl.circleStatus.e61850Opts = options;
+    
+    var optionsBts = [
+		{
+			name: 'workstatus',
+			type: 'list',
+			notShow: false,
+			//imgCallback: gl.statusImg.getImg,
+			status: 0,
+			content: {
+				list:gl.BTS9100.workstates,
+				text: '璁惧鐘舵�侊細'
+			}
+		},
+		{
+			name: 'stop',
+			type: 'list',
+			status: 0,
+			notShow: false,
+			content: {
+				list:gl.BTS9100.alarmstates,
+				text: '涓婁竴娆℃牳瀹圭粓姝㈠師鍥狅細'
+			}
+		},
+		{
+			name: 'count',
+			type: 'text',
+			status: 0,
+			notShow: false,
+			content: {
+				text: '閫氫俊璁℃暟锛�'
+			}
+		},
+		{
+			name: 'percent',
+			type: 'text',
+			status: 0,
+			notShow: false,
+			content: {
+				text:'閫氫俊涓㈠寘鐜囷細'
+			}
+		},
+		{
+			name: 'sdCard',
+			type: 'text',
+			status: 0,
+			notShow: false,
+			content: {
+				text: 'SD鍗$姸鎬侊細锛燂紵锛�'
+			}
+		},
+		{
+			name:'devVersion',
+			type: 'text',
+			status: 0,
+			notShow: false,
+			content: {
+				text: '璁惧鐗堟湰鍙凤細锛燂紵锛�'
+			}
+		},
+		{
+			name: 'signal',
+			type: 'text',
+			status: 0,
+			notShow: true,
+			content:  {
+				text: '淇″彿寮哄害锛�'
+			}
+		}
+    ];
+    // bts9100閰嶇疆椤�
+    gl.circleStatus.btsOpts = optionsBts;
+    
+    // 61850鎷撴墤鍥剧姸鎬�
     var status = new Status($('#eleCircleStatus'), options);
     gl.circleStatus.status = status;
+    
+    // BTS9100鎷撴墤鍥剧姸鎬�
+    var statusBts = new Status($('#eleCircleStatus'), optionsBts);
+    gl.circleStatus.statusBts = statusBts;
     
     // 璁剧疆鍏ㄥ眬楠岃瘉璁惧绫诲瀷鐨勬鍒欒〃杈惧紡
 	var globalPattern = {
@@ -942,10 +1091,9 @@
     		var data = model.data[0];
         	var alarmstatus = data.dev_alarmstate;	//[0:'鏃�',1:'鏆傚仠',2:'鏀剧數娴嬭瘯',3:'鏀剧數绛夊緟',4:'闄愭祦鍏呯數',5:'鐩存祦鍏呯數',6:'鍏呯數绛夊緟',7:'娴嬭瘯鏃堕棿鍒�',8:'娴嬭瘯瀹归噺鍒�',9:'鍗曚綋涓嬮檺鍒�',10:'缁勭涓嬮檺鍒�',11:'甯傜數寮傚父',12:'瀛樺偍鍗′笉瓒�',13:'璐熻浇娓╁害楂�',14:'鐢垫祦寮傚父',15:'杩滅▼閫氫俊鍧�',16:'璐熻浇閫氫俊鍧�',17:'閫夋嫨閫氫俊鍧�',18:'璐熻浇鐢垫祦鍧�',19:'鍐呭瓨鐢宠鍧�',20:'鏈煡'];
     		var workstatus =parseInt(data.dev_workstate) ;	//[0:'鍦ㄧ嚎鐩戞祴',1:'鏀剧數娴嬭瘯',2:'鍏呯數娴嬭瘯',3:'鍐呴樆娴嬭瘯',4:'鏈煡'];
-        	if(typeof callback == 'function') {
-        		callback.call({}, data);
-        	}
-        	// 鍒ゆ柇workstatus
+        	// console.log(workstatus);
+        	// console.log(data.dev_testgroupnum+'***'+(batt.GroupIndexInFBSDevice+1)+'***'+mygraph.battstate);
+    		// 鍒ゆ柇workstatus
         	switch(workstatus) {
         		case 0:	{	// 娴厖鐘舵��
         			mygraph.graphtype = 0;
@@ -1007,7 +1155,13 @@
         		}
         		break;
         	}
+        	
+        	// 璁剧疆宸︿笂鏂瑰唴瀹�
+        	if(typeof callback == 'function') {
+        		callback.apply({}, [batt, data, mygraph]);
+        	}
     	}else {
+    		// console.log(123);
     		mygraph.graphtype = 4 ;
 			_str = '(鏈繛鎺�)';
 	    	// 鍥炶皟鍑芥暟
@@ -1015,6 +1169,7 @@
 				callback();
 			}
     	}
+    	// console.log(lasttype+"**"+mygraph.graphtype);
     	// 鍒ゆ柇鏄惁鏇存柊鎷撴墤鍥�
     	if(lasttype != mygraph.graphtype){
 			mygraph.ischange = 1;

--
Gitblit v1.9.1