From 39ba81554f82a99cd85a1889e34ec67207af0d6a Mon Sep 17 00:00:00 2001 From: Triatmoko Date: Sat, 19 Nov 2011 00:10:15 +0100 Subject: modify truth message for manual testing --- Code/Server-Code/truthtableClass.py | 41 ++++++++++++++++++++++++++----------- 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/Code/Server-Code/truthtableClass.py b/Code/Server-Code/truthtableClass.py index df6738b..85fd5c6 100644 --- a/Code/Server-Code/truthtableClass.py +++ b/Code/Server-Code/truthtableClass.py @@ -25,7 +25,7 @@ class trueTable: if self.nanoBts == '': self.found = False else: - found = False + self.found = False for y in self.nanoBts: #find the existing nanoBts result name = y[0] if name == btsName: @@ -182,15 +182,32 @@ class trueTable: if found != True: self.nanoBts.append([btsName,False]) - elif (str(result) == '801' or str(result) == '999') and key == call: - #self.lookingBTSname(key) - if self.lookingBTSname(key) != True: - self.nanoBts.append([key,result]) + elif (str(result) == '801' or str(result) == '999') and key == call: + exist = False + if self.nanoBts != '': + for device in self.nanoBts: + if device[0]== key: + exist = True + if exist!= True: + self.nanoBts.append([key,result]) + + elif (str(result) == '802' or str(result) == '998') and key == dest: + exist = False + if self.nanoBts != '': + for device in self.nanoBts: + if device[0]== key: + exist = True + if exist!= True: + self.nanoBts.append([key,result]) - elif (str(result) == '802' or str(result) == '998') and key == dest: - #self.lookingBTSname(key) - if self.lookingBTSname(key) != True: - self.nanoBts.append([key,result]) + elif (key == call or key == dest ) and str(result) == '402': + exist = False + if self.nanoBts != '': + for device in self.nanoBts: + if device[0]== key: + exist = True + if exist!= True: + self.nanoBts.append([key,result]) j = j+1 elif j == i: @@ -205,7 +222,7 @@ class trueTable: for y in self.nanoBts: #find the existing result for GSM external in the list name = y[0] if name == call: - if int(result) == 200: + if int(result) == 200 or int(y[1]) == 402: if int(y[1]) == 486 or int(y[1]) == 999 or int(y[1]) == 998 or int(y[1]) == 801 or int(y[1]) == 802 or int(y[1]) == 402: self.nanoBts.remove(y) else: @@ -223,8 +240,8 @@ class trueTable: for y in self.nanoBts: name = y[0] if name == dest: - if int(result) == 200: - if int(y[1]) == 486 or int(y[1]) == 999 or int(y[1]) == 998 or int(y[1]) == 402 or int(y[1]) == 802 or int(y[1]) == 801: + if int(result) == 200 or int(y[1]) == 402: + if int(y[1]) == 486 or int(y[1]) == 999 or int(y[1]) == 998 or int(y[1]) == 802 or int(y[1]) == 801: self.nanoBts.remove(y) else: found = True -- cgit v1.2.3-55-g7522