Skip to content

Commit

Permalink
Added simulator details to README
Browse files Browse the repository at this point in the history
  • Loading branch information
davewalker5 committed Sep 22, 2023
1 parent 956ed87 commit fd3f419
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ dotnet ef database update -s ../BaseStationReader.Terminal/BaseStationReader.Ter
- The record for a given address should only be updated while the aircraft in question remains in range
- Once it passes out of range, or when a new tracking session is started, if the address is seen again it should result in a new tracking record
- This is achieved using the "Locked" flag on tracking records (see the screenshot, above):
- This is achieved using the "Locked" status on tracking records (see the screenshot, above):
- When an aircraft moves out of range and is removed from the tracking collection, a notional "lock timer" starts
- If it's seen again within the timout, the record remains unlocked to avoid duplication of aircraft records for the same flight
- Once the timeout is reached, the record is locked and any further updates for that ICAO address result in a new record
Expand Down Expand Up @@ -213,6 +213,24 @@ FROM AIRCRAFT
WHERE Address = '3949F8';
```

## Simulator

- The project includes a simulator that broadcasts messages in BaseStation format on the local machine
- A set of simulated aircraft, with random ICAO addresses and callsigns, are created
- At specified intervals, an MSG message with a random transmission type and a randomly selected aircraft is generated and sent to all connected clients
- Simulated aircraft have a configurable lifespan after which no further messages are sent from them, to simulate real behaviour and exercise the tracking lifecycle (see above)
- The simulator is intended for development use when no ADS-B receiver is available to provide a real message stream
- The simulator is controlled via an "appsettings.json" configuration file, supporting the following keys:

| Section | Key | Command Line | Short Name | Purpose |
| ------------------- | ---------------- | --------------- | ---------- | ----------------------------------------------------------------------- |
| ApplicationSettings | Port | --port | -p | Port the simlator broadcasts on |
| ApplicationSettings | SendInterval | --send-interval | -s | Interval at which messages are sent (ms) |
| ApplicationSettings | NumberOfAircraft | --number | -n | Number of active simulated aircraft |
| ApplicationSettings | AircraftLifespan | --lifespan | -ls | Aircraft lifespan (ms) |
| ApplicationSettings | LogFile | --log-file | -l | Path and name of the log file. If this is blank, no log file is created |
| ApplicationSettings | MinimumLogLevel | --log-level | -ll | Minimum message severity to log (Debug, Info, Warning or Error) |

## Authors

- **Dave Walker** - _Initial work_ - [LinkedIn](https://www.linkedin.com/in/davewalker5/)
Expand Down
4 changes: 2 additions & 2 deletions src/BaseStationReader.Simulator/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"SendInterval": 100,
"NumberOfAircraft": 10,
"AircraftLifespan": 60000,
"LogFile": "ReceiverSimulator.log",
"LogFile": "C:\\MyApps\\ReceiverSimulator.log",
"MinimumLogLevel": "Info"
}
}
}

0 comments on commit fd3f419

Please sign in to comment.