From 9fcc469afa01fc9ea42e4cbb96c5b195c5bcd371 Mon Sep 17 00:00:00 2001 From: Tom Date: Wed, 11 Jan 2012 17:00:30 +0100 Subject: all reupped --- .../.history/0/809df803a7f2001019c79f38f40e52ba | 57 ++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 Src/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/809df803a7f2001019c79f38f40e52ba (limited to 'Src/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/809df803a7f2001019c79f38f40e52ba') diff --git a/Src/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/809df803a7f2001019c79f38f40e52ba b/Src/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/809df803a7f2001019c79f38f40e52ba new file mode 100644 index 0000000..55df466 --- /dev/null +++ b/Src/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/809df803a7f2001019c79f38f40e52ba @@ -0,0 +1,57 @@ +import datetime +import gtk +import math + +class BaseStationInformation: + def __init__ (self): + self.country = 'Nowhere' + self.provider = 'Carry' + self.arfcn = 0 + self.rxlev = 0 + self.system_info_t2 = [] + self.discovery_time = datetime.datetime.now().strftime('%T') + + def get_list_model(self): + return (self.provider, self.arfcn, self.rxlev, self.discovery_time) + + def get_neighbour_arfcn(self): + #TODO: examine plmn permitted byte + #TODO: examine emergency call capability + neighbours = self.system_info_t2[3:19] + bin_representation = '' + neighbour_arfcn = [] + + for value in neighbours: + bin_representation += str(bin(int(value, 16))[2:].zfill(8)) + + for x in xrange(1,125): + index = 0-x + bit = bin_representation[index] + if bit == '1': + neighbour_arfcn.append(abs(index)) + return neighbour_arfcn +class BaseStationInformationList: + def __init__(self): + self._base_station_list = [] + + def add_station(self, base_station): + for item in self._base_station_list: + if item.arfcn == base_station.arfcn: + item.discovery_time = datetime.datetime.now().strftime('%T') + break + else: + self._base_station_list.append(base_station) + + def get_dot_code(self): + preamble = r'digraph bsnetwork{ ' + postamble = r'}' + code = '' + for item in self._base_station_list: + code += item.arfcn + r'; ' + return preamble + code + postamble + + def refill_store(self, store): + store.clear() + for item in self._base_station_list: + store.append(item.get_list_model()) + \ No newline at end of file -- cgit v1.2.3-55-g7522