@@ -455,16 +455,23 @@ async function update_monitor2(containerElement, monitor2Div, yukon_state, force
455455 continue ;
456456 }
457457 // Getting info about more links than necessary for later highlighting purposes
458- const relatedLinks = getRelatedLinks ( port . port , yukon_state ) ;
458+ const relatedLinks = getRelatedLinks ( port . port , port . type , yukon_state ) ;
459459 const currentLinkObjects = relatedLinks . filter ( link => link . port === port . port && link . type === matchingPort . type && link . node_id === avatar . node_id ) ;
460460 function doStuff ( currentLinkObject ) {
461461 let toggledOn = { value : false } ;
462462 let currentLinkDsdlDatatype = null ;
463463 let fixed_datatype_short = null ;
464464 let fixed_datatype_full = null ;
465465 if ( datatypes_response [ "fixed_id_messages" ] && datatypes_response [ "fixed_id_messages" ] [ port . port ] !== undefined ) {
466- fixed_datatype_short = datatypes_response [ "fixed_id_messages" ] [ port . port ] [ "short_name" ] ;
467- fixed_datatype_full = datatypes_response [ "fixed_id_messages" ] [ port . port ] [ "name" ] ;
466+ const type_of_interest = datatypes_response [ "fixed_id_messages" ] [ port . port ] ;
467+ console . log ( `Type of interest is ${ type_of_interest } and is_service is ${ type_of_interest . is_service } ` ) ;
468+ const is_a_service_and_for_a_service = type_of_interest . is_service && ( port . type === "cln" || port . type === "srv" ) ;
469+ const is_a_message_and_for_a_message = ! type_of_interest . is_service && ( port . type === "pub" || port . type === "sub" ) ;
470+ console . log ( `Port type is ${ port . type } and is_a_service_and_for_a_service is ${ is_a_service_and_for_a_service } and is_a_message_and_for_a_message is ${ is_a_message_and_for_a_message } , port id is ${ port . port } ` ) ;
471+ if ( is_a_service_and_for_a_service || is_a_message_and_for_a_message ) {
472+ fixed_datatype_short = datatypes_response [ "fixed_id_messages" ] [ port . port ] [ "short_name" ] ;
473+ fixed_datatype_full = datatypes_response [ "fixed_id_messages" ] [ port . port ] [ "name" ] ;
474+ }
468475 }
469476 if ( currentLinkObject && ! fixed_datatype_full ) {
470477 currentLinkDsdlDatatype = currentLinkObject . datatype || "" ;
@@ -931,8 +938,8 @@ function addHorizontalElements(monitor2Div, matchingPort, currentLinkDsdlDatatyp
931938 horizontal_line_label . style . width = "fit-content" ; // settings.LinkInfoWidth - settings.LabelLeftMargin + "px";
932939 horizontal_line_label . style . height = "fit-content" ;
933940 horizontal_line_label . style . position = "absolute" ;
934- if ( currentLinkDsdlDatatype . endsWith ( ".Response" ) ) {
935- currentLinkDsdlDatatype = currentLinkDsdlDatatype . replace ( ".Response" , "" ) ;
941+ if ( currentLinkDsdlDatatype . endsWith ( ".Response" ) || currentLinkDsdlDatatype . endsWith ( ".Request" ) ) {
942+ currentLinkDsdlDatatype = currentLinkDsdlDatatype . replace ( ".Response" , "" ) . replace ( ".Request" , "" ) ;
936943 }
937944 horizontal_line_label . innerHTML = currentLinkDsdlDatatype ;
938945 horizontal_line_label . style . zIndex = "3" ;
@@ -1126,7 +1133,7 @@ function addVerticalLines(monitor2Div, ports, y_counter, containerElement, setti
11261133 potentialPopup . remove ( ) ;
11271134 potentialPopup = null ;
11281135 } else {
1129- const datatypes = await getDatatypesForPort ( port . port , yukon_state ) ;
1136+ const datatypes = await getDatatypesForPort ( port . port , port . type , yukon_state ) ;
11301137 potentialPopup = document . createElement ( "div" ) ;
11311138 potentialPopup . classList . add ( "popup" ) ;
11321139 potentialPopup . style . position = "absolute" ;
0 commit comments