Skip to content

Conversation

@lizlooney
Copy link

Make it work on systemcore.

In port.py:
When compare port_type with PortType.BASE_COMPOUND, use .value to get the numeric value. Added type hints for function returns.
Modified get_type to just return self.type.

In component.py:
Changed port.get_type to port.get_type().

In mrc_port.ts, in pythonFromBlock:
Changed _generator to generator.
Added generator.addImport('port');
Changed Port to port.Port in generated python code. Changed PortType to port.PortType in generated python code. Changed MOTOR_PORT to EXPANSION_HUB_MOTOR_PORT.
Changed SERVO_PORT to EXPANSION_HUB_SERVO_PORT.

Updated external_samples_data.json.

When compare port_type with PortType.BASE_COMPOUND, use .value to get the numeric value.
Added type hints for function returns.
Modified get_type to just return self.type.

In component.py:
Changed port.get_type to port.get_type().

In mrc_port.ts, in pythonFromBlock:
Changed _generator to generator.
Added generator.addImport('port');
Changed Port to port.Port in generated python code.
Changed PortType to port.PortType in generated python code.
Changed MOTOR_PORT to EXPANSION_HUB_MOTOR_PORT.
Changed SERVO_PORT to EXPANSION_HUB_SERVO_PORT.

Updated external_samples_data.json.
Copy link
Owner

@alan412 alan412 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for testing this and getting it working!!

@alan412 alan412 merged commit 605e441 into alan412:pr_multiple_ports Aug 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants