@@ -226,9 +226,11 @@ def format_od_object(
226226 # Fetch the dictionary values and the parameters, if present
227227 if index in node .Dictionary :
228228 values = node .GetEntry (index , aslist = True , compute = not raw )
229+ raw_values = node .GetEntry (index , aslist = True , compute = False )
229230 else :
230231 # Fill the values with N/A if the entry is not present
231232 values = ['__N/A__' ] * len (obj ["values" ])
233+ raw_values = values
232234
233235 if index in node .ParamsDictionary :
234236 # FIXME: Is there a risk that this return less than the length of
@@ -238,16 +240,22 @@ def format_od_object(
238240 params = [maps .DEFAULT_PARAMS ] * len (values )
239241
240242 # For mypy to ensure that values and entries are lists
241- assert isinstance (values , list ) and isinstance (params , list )
243+ assert isinstance (values , list ) and isinstance (raw_values , list ) and isinstance ( params , list )
242244
243245 infos = []
244246 # The strict=True will capture if the values and params are not the same
245- for i , (value , param ) in enumerate (zip (values , params , strict = True )):
247+ for i , (value , raw_value , param ) in enumerate (zip (values , raw_values , params , strict = True )):
246248
247249 # Prepare data for printing
248250 info = node .GetSubentryInfos (index , i )
249251 typename = node .GetTypeName (info ['type' ])
250252
253+ # Adding +NODEID text?
254+ if 'COB ID' in info ["name" ] and isinstance (raw_value , str ) and "$NODEID" in raw_value and not node .ID :
255+ t_node = f"{ Fore .GREEN } +NODEID{ Style .RESET_ALL } "
256+ else :
257+ t_node = ''
258+
251259 # Type specific formatting of the value
252260 if value == "__N/A__" :
253261 t_value = f'{ Fore .LIGHTBLACK_EX } N/A{ Style .RESET_ALL } '
@@ -269,11 +277,11 @@ def format_od_object(
269277 t_value = f"0x{ value :x} { suffix } "
270278 elif index_range and index_range .name in ('rpdop' , 'tpdop' ):
271279 assert isinstance (value , int )
272- t_value = f"0x{ value :x} " if 'COB ID' in info ["name" ] else str ( value )
280+ t_value = f"0x{ value :x} { t_node } " if 'COB ID' in info ["name" ] else f" { value } { t_node } "
273281 if i == 1 and value & 0x80000000 :
274- t_value += f" { Fore .LIGHTYELLOW_EX } DISABLED{ Style .RESET_ALL } "
282+ t_value += f" { Fore .LIGHTYELLOW_EX } < DISABLED> { Style .RESET_ALL } "
275283 elif i and value and (index in (4120 , ) or 'COB ID' in info ["name" ]):
276- t_value = f"0x{ value :x} "
284+ t_value = f"0x{ value :x} { t_node } "
277285 else :
278286 t_value = str (value )
279287
0 commit comments