This commit is contained in:
2025-02-12 01:21:05 -07:00
parent 75f68b1f59
commit e25b04f8cb
6 changed files with 46 additions and 44 deletions

View File

@ -30,7 +30,7 @@ class DataNode(BaseNode):
self.add_text_input('value', 'Value', text='')
# Initialize the value from the widget property.
self.process_widget_event()
self.set_name(f"Data Node: {self.value}")
self.set_name(f"Data Node")
def post_create(self):
"""
@ -50,7 +50,7 @@ class DataNode(BaseNode):
"""
current_text = self.get_property('value')
self.value = current_text
self.set_name(f"Data Node: {self.value}")
self.set_name(f"Data Node")
def property_changed(self, property_name):
"""
@ -113,9 +113,8 @@ class DataNode(BaseNode):
"""
Receives data from connected nodes and updates the internal value.
"""
print(f"DataNode received data from {source_port_name}: {data}") # Debugging
self.set_property('value', str(data)) # Ensure it's always stored as a string
self.set_name(f"Data Node: {data}")
self.set_name(f"Data Node")
# Transmit data further if there's an output connection
output_port = self.output(0)