|
|
|
@ -290,16 +290,21 @@ class tmc_segment: |
|
|
|
class tmc_location: |
|
|
|
class tmc_location: |
|
|
|
def __ref_locs(self,lcn,name_string=""): |
|
|
|
def __ref_locs(self,lcn,name_string=""): |
|
|
|
if(lcn==34196):#europe |
|
|
|
if(lcn==34196):#europe |
|
|
|
|
|
|
|
#print("reached eu: "+name_string) |
|
|
|
return(name_string) |
|
|
|
return(name_string) |
|
|
|
else: |
|
|
|
else: |
|
|
|
try: |
|
|
|
try: |
|
|
|
loc_dict=self.lcl_obj.get_area(lcn) |
|
|
|
area=self.lcl_obj.get_area(lcn) |
|
|
|
loc_name=self.lcl_obj.get_name(int(self.point.N1ID)) |
|
|
|
loc_name=self.lcl_obj.get_name(int(area.NID)).encode('utf-8') |
|
|
|
aref=int(loc_dict[u'POL_LCD']) |
|
|
|
aref=int(area.POL_LCD) |
|
|
|
return(self.__ref_locs(aref,name_string+","+loc_name)) |
|
|
|
return(self.__ref_locs(aref,name_string+","+loc_name)) |
|
|
|
except KeyError:#no area with lcn |
|
|
|
except KeyError as e:#no area with lcn |
|
|
|
|
|
|
|
#print(e) |
|
|
|
|
|
|
|
#print("KeyError on:"+name_string) |
|
|
|
return(name_string) |
|
|
|
return(name_string) |
|
|
|
except ValueError:#POL_LCD was empty (no int) |
|
|
|
except ValueError as e:#POL_LCD was empty (no int) |
|
|
|
|
|
|
|
#print(e) |
|
|
|
|
|
|
|
#print("ValueError on:"+name_string) |
|
|
|
return(name_string+loc_name) |
|
|
|
return(name_string+loc_name) |
|
|
|
def __getitem__(self,item): |
|
|
|
def __getitem__(self,item): |
|
|
|
return self.loc_dict[item] |
|
|
|
return self.loc_dict[item] |
|
|
|
@ -315,7 +320,7 @@ class tmc_location: |
|
|
|
if self.lcl_obj.lcn_allocated(lcn) and self.lcl_obj.points.has_key(lcn): |
|
|
|
if self.lcl_obj.lcn_allocated(lcn) and self.lcl_obj.points.has_key(lcn): |
|
|
|
try: |
|
|
|
try: |
|
|
|
self.point=self.lcl_obj.get_point(lcn) |
|
|
|
self.point=self.lcl_obj.get_point(lcn) |
|
|
|
self.reflocs=self.__ref_locs(lcn) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self.ltype=self.point.CLASS+self.point.TCD |
|
|
|
self.ltype=self.point.CLASS+self.point.TCD |
|
|
|
try: |
|
|
|
try: |
|
|
|
@ -340,6 +345,8 @@ class tmc_location: |
|
|
|
self.linRef=tmc_segment(int(self.point.SEG_LCD),tableobj) |
|
|
|
self.linRef=tmc_segment(int(self.point.SEG_LCD),tableobj) |
|
|
|
elif not self.point.ROA_LCD==u"": |
|
|
|
elif not self.point.ROA_LCD==u"": |
|
|
|
self.linRef=tmc_segment(int(self.point.ROA_LCD),tableobj) |
|
|
|
self.linRef=tmc_segment(int(self.point.ROA_LCD),tableobj) |
|
|
|
|
|
|
|
if not self.point.POL_LCD==u"": |
|
|
|
|
|
|
|
self.reflocs=self.__ref_locs(int(self.point.POL_LCD),self.first_name.encode('utf-8')) |
|
|
|
self.negative_offset=self.lcl_obj.get_poffsets(lcn).NEG_OFF_LCD |
|
|
|
self.negative_offset=self.lcl_obj.get_poffsets(lcn).NEG_OFF_LCD |
|
|
|
self.positive_offset=self.lcl_obj.get_poffsets(lcn).POS_OFF_LCD |
|
|
|
self.positive_offset=self.lcl_obj.get_poffsets(lcn).POS_OFF_LCD |
|
|
|
try: |
|
|
|
try: |
|
|
|
|