Skip to content

Conversation

lizlooney
Copy link
Collaborator

@lizlooney lizlooney commented Sep 26, 2025

Fixes #249

Fixes #256

In mrc_port.ts.

  • Added constants for port types.
  • Added constants for field prefixes.
  • Added constants for visible port labels.
  • Removed type MrcPortType, ports_ from PortMixin, and ports from PortExtraState.
  • Renamed PortMixin portType_ to mrcPortType.
  • Added mrcPortCount to PortMixin.
  • Rewrote loadExtraState to create the appropriate fields for the portType.
  • Removed updateShape.
  • Simplified the code in pythonFromBlock that collects the ports.
  • Generate code for CompoundPort without trailing backslashes.
  • Changed Order.ATOMIC to Order.FUNCTION_CALL.
  • Updated createPort to specify the field values.

In field_number_dropdown.ts:
Removed defaultVal parameter in createFieldNumberDropdown function.

In external_samples/port.py:
Replace PortType enum value BASE_COMPOUND with a module variable named _base_compound. Removed PortType enum value SERVO_PORT.
Added PortType enum value USB_HUB_PORT.

Removed external_samples/servo.py.

- Added constants for port types.
- Added constants for field prefixes.
- Added constants for visible port labels.
- Removed type MrcPortType, ports_ from PortMixin, and ports from PortExtraState.
- Renamed PortMixin portType_ to mrcPortType.
- Added mrcPortCount to PortMixin.
- Rewrote loadExtraState to create the appropriate fields for the portType.
- Removed updateShape.
- Simplified the code in pythonFromBlock that collects the ports.
- Generate code for CompoundPort without trailing backslashes.
- Changed Order.ATOMIC to Order.FUNCTION_CALL.
- Updated createPort to specify the field values.

In field_number_dropdown.ts:
Removed defaultVal parameter in createFieldNumberDropdown function.

In external_samples/port.py:
Replace PortType enum value BASE_COMPOUND with a module variable named _base_compound.
Removed PortType enum value SERVO_PORT.
Added PortType enum value USB_HUB_PORT.

Removed external_samples/servo.py.
@lizlooney lizlooney requested a review from alan412 September 26, 2025 06:21
@lizlooney lizlooney linked an issue Sep 26, 2025 that may be closed by this pull request
Copy link
Collaborator

@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.

In general, this looks great and is a huge improvement. I did have one minor change to the python code.

@lizlooney lizlooney requested a review from alan412 September 28, 2025 05:39
Copy link
Collaborator

@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.

LGTM

@alan412 alan412 merged commit d9e16a6 into wpilibsuite:main Sep 29, 2025
1 check passed
@lizlooney lizlooney deleted the pr_mrc_port branch October 2, 2025 03:00
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.

Check Order values used in python generators Port for expansion hub servo and motor should be 0, 1, 2, 3, 4, 5 and 0, 1, 2, 3, 4
2 participants