Getting started
Prerequisites
To debug GlobalDcc you need the following:
- Visual Studio 2022+
- .NET Core 7 SDK
- C++ 2015-2022 runtime (vc_dist)
- Docker Desktop
- Windows 10 or higher
- A checkout of this repository
Configuration
All of the configuration needed for GlobalDcc to run is already set when you check out this repository, if you want to change the configuration you might want to read Configuring GlobalDcc.
Use Windows containers
To run Global DCC Docker Desktop needs to be using Windows containers. To make sure this is the case, click the "^" in the right hand side of the Windows taskbar and right click the Docker Desktop icon. The contex menu will contain one of the following options:
- "Switch to Linux containers...". This means you are already using Windows containers, do nothing.
- "Switch to Windows containers...". This means you are using Linux containers, click this option to switch to Windows containers.
Set the FEED_ACCESSTOKEN environment variable
When restoring NuGet packages Global DCC needs a personal access token (PAT), which should be stored in an environment variable called "FEED_ACCESSTOKEN".
To set this first create the token:
- Go to ADO.
- Click user settings (the icon showing a person in the upper right hand corner).
- Select "Personal access tokens".
- Click "+ New Token".
- Fill in the formula.
- It might be a good idea to name the token FEED_ACCESSTOKEN, so it is easy to find.
- Set the expiration to a year from now (the longest possible).
- Check the "Read" box under "Packaging".
- Click "Create".
- Copy the created token.
Then set the token as an environment variable:
- Press the windows key.
- Start typing "Edit the system environment variables".
- When a match with that name appears - click it.
- In the "Advanced" tab click "Environment Variables...".
- In the User variables box click "New...".
- Set "Variable key" to "FEED_ACCESSTOKEN" and paste the access token into "Variable value".
Connect to AMCS' VPN
Sometimes the Global DCC Docker projects will not work without VPN. This is not always the case, but it is recommended to connect to AMCS' VPN to avoid problems.
Start debugging
In VS right click the docker-compose project and choose "Set as Startup Project", then press F5 to start debugging. This will start an instance of GlobalDcc.Api.Server, GlobalDcc.Backend.Server, and GlobalDcc.RoadNetManager.Server all of them attached to the debugger, and it will start a Dapr service for each. Finally it will open the Open API page http://localhost:5000/swagger/index.html, from which requests to the Global DCC API can be send.
The backend will use the road net and DccMulti.xml from /assets/default
. This
is the Danish road net, so this setup of Global Dcc can handle coordinates in
Denmark.
You can find a sample payload (a distance request) in Test payload section.
Writing Documentation
Make sure to document your changes. See the guide to Writing Documentation: