Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add README documentation for port drayage #617

Merged
merged 10 commits into from
Jun 17, 2024
Merged

Conversation

dan-du-car
Copy link
Collaborator

@dan-du-car dan-du-car commented Jun 14, 2024

PR Details

Description

Add README documentation for port drayage

Related Issue

CF-859

Motivation and Context

Update documentation

How Has This Been Tested?

Local Integration testing

Types of changes

  • Defect fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that cause existing functionality to change)

Checklist:

  • I have added any new packages to the sonar-scanner.properties file
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
    V2XHUB Contributing Guide
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@@ -0,0 +1,73 @@
## Introduction
The Port Drayage Plugin in V2x-Hub facilitates infrastructure, vehicle and container handling equipment (CHE) communication for port drayage operations. The plugin provides and montior drayage actions for a freight truck inside and between a mock port and staging area. The list of actions includes ENTER_STAGING_AREA, PICKUP, EXIT_STAGING_AREA, ENTER_PORT, DROPOFF, PORT_CHECKPOINT, HOLDING_AREA, and EXIT_PORT.
### Deployment Instructions
Copy link
Contributor

Choose a reason for hiding this comment

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

No need to include V2X-Hub deployment instructions, just instructions specific to port drayage plugin


Open another tab and type in `localhost:8090` to navigate to port drayage web UI. Click `Staging Area` or `Port Area` button to test V2x-Hub located at staging or port area.

Open a terminal, and run [a python script](https://raw.githubusercontent.com/usdot-fhwa-OPS/V2X-Hub/develop/configuration/mysql/suntrax/momscript_port_drayage.py) to send mocked mobility operation message to test each action at a particular location.
Copy link
Contributor

Choose a reason for hiding this comment

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

Any documentation about step to regression test this functionality can go under a section

Regression Test

or

Functionality Test

Copy link
Contributor

Choose a reason for hiding this comment

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

Ideally this page should have similar topic to

Port Drayage Plugin Documentation

Introduction

Introduce functionality

Configuration/Deployment

Any plugin specific configuration/deployment steps for plugin.
Example, under recently updated initialization script you must select to enable port drayage functionality when prompted to deploy port drayage plugin(

read -r -p "Enable Port Drayage functionality (TRUE/FALSE, or press Enter to use default as $PORT_DRAYAGE_ENABLED_DEFAULT): " PORT_DRAYAGE_ENABLED
)

Functionality Testing or Regression Testing

How to use your script to test if functionality is deployed correctly

Remember this is for external users that may not be developers so our documentation should always use existing scripts instead of manual commands where possible and be high level enough for less technical people to for their purposes.

Copy link
Contributor

@paulbourelly999 paulbourelly999 left a comment

Choose a reason for hiding this comment

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

I think we can probably improve this documentation using the existing documentation.

Copy link
Contributor

Choose a reason for hiding this comment

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

To improve this script in the future I recommend passing in arguments link IP and udp port and using python ArgParser to help document your script and how to use it similar to https://github.com/usdot-fhwa-stol/carma-streets/blob/develop/collect_kafka_logs.py. Using this will allow you to document what your script is for and help text to appear for the script and the arguments.

Another potential improvement is to use the python shebang #!/usr/bin/python3 and remove the file extension. This makes calls to you script more concise and abstracts away to implementation specifics from users calling you script.

# Current call you your script
python3 momscript_port_drayage.py <arguments>
# with shebang
./momscript_port_drayage <arguments>

Copy link
Contributor

Choose a reason for hiding this comment

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

Another future improvement is that your script could also listen for outgoing messages from immediate forward. So essentially you send a message then your script waits until it gets a response before "driving to the next location for 5 seconds" and then sending its next message. This way your script can test both receiving functionality and sending functionality.

Copy link

sonarcloud bot commented Jun 17, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

Copy link
Contributor

@paulbourelly999 paulbourelly999 left a comment

Choose a reason for hiding this comment

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

Look good.

@dan-du-car dan-du-car merged commit 8979d91 into develop Jun 17, 2024
3 checks passed
@dan-du-car dan-du-car deleted the add_doc_port_drayage branch June 17, 2024 17:40
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