Commit graph

952 commits

Author SHA1 Message Date
Malcolm Robb 7ea2e8fdef Bug Fix in modesReadFromClient()
The modesReadFromClient() funtion is called from modesReadFromClients(),
which in turn is called from backgroundTasks(). backgroundTasks() is
called from within the main processing loop.

However, modesReadFromClient() can and does block. It attempts to read
characters from the input stream, and loops whilst there was no error.
This stalls the main RTL processing loop until an error occurs. In order
to support simultaneous local reception (via our RTL dongle) and remote
forwarding (data received from the interweb) we cannot allow this
internet read to stall.

To fix this, in modesReadFromClient() attempt to read a buffer of data
(currently 0x400 bytes). If we get a full buffer of bytes, then process
them, and attempt to read another full buffer. Keep doing thios untill
we read only a partial buffer (less than 0x400 bytes). Process the
partial buffer bytes and return.

This allows us to occasionally process data that is arriving from the
internet (which is buffered anyway in the TCP stack), without blocking
local RTL dongle decoding.
2013-09-20 16:48:15 +01:00
Malcolm Robb 52ac50b018 Remove some local filtering
Oops - Left some personal ModeA/C filtering in the release code that
only applies if you happen to be within 25 miles of Yeovilton.
2013-08-19 19:04:49 +01:00
Malcolm Robb 6997715fed Split into separate module files
Ok - this is likely to upset some people. Up until now, the vast
majority of the code has been in just one file - dump1090.c. This file
has grown so that it was approaching of 5000 lines long, and it was
becoming unmanagable. So I've split the file into several modules,
hopefully along fairly logical boundaries. The files are :

1) dump1090.c : Basically just the main() entry function, the help
function, the RTL dongle hardware interface, and a few orphan functions
that  don't really fit anywhere else.

2) mode_s.c : This contains all the mode S / ADSB decoding functions.

3) mode_ac.c : This contains all the mode A & C decoding functions

4) interactive.c : This contains all the functions to maintain an
internal list of aircraft seen over the last period, and functions to
print them out to the local console.

5) net_io.c : This contains all the network input/output functions
allowing data to be passed in/out to/from other receivers, in formats
such as SBS-1/3, Beast, AVR and JavaScript.

Hopefully this should provide an easier way forward if/when more
functions are added.
2013-08-19 18:57:03 +01:00
Malcolm Robb 1ebdd6d7a7 Interactive list aircraft display and delete changes
Create two different Time-To-Live parameters for the interactive display
list.

1) Modes.interactive_display_ttl defines for how long the display of an
aircraft persists after the last received message. The default is
MODES_INTERACTIVE_DISPLAY_TTL, which is set to 60 seconds. This replaces
the previous Modes.interactive_ttl/MODES_INTERACTIVE_TTL settings (which
were also 60 seconds)

2) Add an additional Modes.interactive_delete_ttl  parameter, and
default it to  MODES_INTERACTIVE_DELETE_TTL, shich is set to 300
seconds/5 minutes. This defines for how long an aircraft persists in the
list structure after the last received message before being deleted.

Also tidy up a few comments.
2013-08-19 15:55:17 +01:00
MalcolmRobb da8151dd70 Merge pull request #8 from bdavenport/master
I can't pretend that I understand what you guys are up to with all this Java stuff, but since the changes to the maon dump1090.c file are minimal I'll trust you :-)
2013-06-21 15:34:12 -07:00
terribl 82b61f267d Merge mapRefactor -> master 2013-06-03 11:27:17 +03:00
terribl b161004d8b Merge mapRefactor -> master 2013-06-03 11:22:02 +03:00
terribl f53632b00d Merge branch 'mapRefactor' into masterMerge
Conflicts:
	.gitignore
	public_html/gmap.html
	public_html/script.js

  All conflicts fixed but you are still merging.

	modified:   .gitignore
	modified:   dump1090.c
	new file:   public_html/config.js
	new file:   public_html/coolclock/coolclock.js
	new file:   public_html/coolclock/excanvas.js
	new file:   public_html/coolclock/moreskins.js
	new file:   public_html/extension.js
	modified:   public_html/gmap.html
	new file:   public_html/options.js
	new file:   public_html/planeObject.js
	modified:   public_html/script.js
	modified:   public_html/style.css
2013-06-03 10:53:17 +03:00
terribl 5f0e295580 From DE8MSH: Plane markers!
Now markers look like planes! Thank You | Tak!

(And bug pointed out by DE8MSH :))

	modified:   public_html/planeObject.js
	modified:   public_html/script.js
2013-06-02 20:49:45 +03:00
terribl e91b0a6be1 Added warning label when 7x00 squawk is shown.
"Please don't call authorities"-warning label is show on map if any special squawk is show.

	modified:   public_html/gmap.html
	modified:   public_html/script.js
	modified:   public_html/style.css
2013-06-02 16:51:38 +03:00
terribl 92d665e0da Hide Settings-windows text while page is loading.
modified:   public_html/gmap.html
	modified:   public_html/script.js
2013-06-02 13:45:53 +03:00
terribl 0e3426d46b "Reset Map" deselects plane correctly.
modified:   public_html/script.js
2013-05-31 10:29:51 +03:00
terribl 10e33892e8 Fixed resetMap() bug
Fixed resetMap()-funtion to reset map-settings to default. Map saves last location and zoom values to localStorage.

Also added new css-class '.pointer'.

	modified:   public_html/gmap.html
	modified:   public_html/script.js
	modified:   public_html/style.css
2013-05-31 10:04:11 +03:00
Brian Davenport 072fba8718 Rolling back a couple changes and spawning a branch from here. 2013-05-30 21:26:16 +00:00
Brian Davenport 21229d58ea The start of a crummy looking options. It is bugged right now.
Brought back the reset map.
2013-05-30 17:45:10 +00:00
Brian Davenport 5c3f6dac50 Merge branch 'mapRefactor' of https://github.com/bdavenport/dump1090 into mapRefactor
Conflicts:
	public_html/script.js
2013-05-30 17:35:57 +00:00
Brian Davenport 4752578b8b Working on making an options window 2013-05-30 17:32:36 +00:00
terribl fd0c116424 Tyop corrected 2013-05-30 12:31:41 +03:00
terribl 9904c22859 Added option to draw measurement circles around site
Options:
SiteCircles = true;
SiteCirclesDistances = new Array(100,150,200);

Circles are only shown if 'SiteShow' is true. SiteCirclesDistances is array of numbers. Distances are in NM or km depending 'Metric'-settings.

	modified:   public_html/config.js
	modified:   public_html/script.js
2013-05-30 12:22:52 +03:00
terribl 3000baf184 Added metric-option to web-view
Added option to show values in metric system.
Metric = false; // true|false

Removed unused conversion from aircraftsToJson() at dump1090.c-file.
Tweaked distance calculation to use google map api.

	modified:   dump1090.c
	modified:   public_html/config.js
	modified:   public_html/gmap.html
	modified:   public_html/script.js
2013-05-28 12:15:18 +03:00
terribl ca314fcf2c Added distance to plane from site
Just for fun. Distance is only shown if SiteShow is true in config.js-file.

	modified:   public_html/script.js
2013-05-27 11:36:23 +03:00
terribl 8b8f74697c Added site marker (and settings for that)
Shows radars location on map. Default is not showing.

Settings:
SiteShow is boolean [true|false]
SiteLat & SiteLon in decimal format.

If using untrackedDeveloperSettings.js-file these settings can be
copy-pasted on that file:

SiteShow    = false;
SiteLat     = 45.0;
SiteLon     = 9.0;

	modified:   public_html/config.js
	modified:   public_html/script.js
	modified:   public_html/style.css
2013-05-26 23:34:38 +03:00
terribl 6cb5c2b0ff Merge remote-tracking branch 'upstream/master' into mapRefactor 2013-05-26 22:45:37 +03:00
terribl 11d69cb54b Tweaks and Fixes
Tweaked selected planes display so it won't push plane-table around. Added
link to FlightStats service and speed to selected plane table.

	modified:   public_html/script.js
	modified:   public_html/style.css
2013-05-26 15:19:38 +03:00
terribl 3eb21ea18e Merge remote-tracking branch 'upstream/master' 2013-05-26 10:49:36 +03:00
terribl 498b512894 Merge branch 'mapRefactor' of https://github.com/bdavenport/dump1090 into mapRefactor
modified:   public_html/script.js
2013-05-25 23:57:39 +03:00
terribl e2b552eba0 Merge branch 'mapRefactor' of https://github.com/bdavenport/dump1090 into mapRefactor
Missing semicolon;

	modified:   public_html/script.js
2013-05-25 23:55:13 +03:00
terribl 5cd8a096b2 Merge branch 'mapRefactor' of https://github.com/bdavenport/dump1090 into mapRefactor 2013-05-25 23:52:19 +03:00
terribl 40c666b732 Changed table and selected planes info display
Changed table and selected planes info to show 'n/a' when data is not present.

	modified:   public_html/script.js
2013-05-25 23:44:40 +03:00
Brian Davenport b5d0038315 Fixes the selection bugs 2013-05-25 15:53:56 +00:00
Brian Davenport 29d413eb7c Merge pull request #9 from MalcolmRobb/master
Pulling in from MalcomRobb's master updates
2013-05-25 08:04:45 -07:00
terribl e22cff4bd2 Small bugs and cleaned squawkdisplay
modified:   public_html/script.js
	modified:   public_html/style.css
2013-05-25 14:08:26 +03:00
terribl 9c465c174b Added untrackedDeveloperSettings to this branch too.
Load devel settings file after config.js and settings are saved for
developers even after merges.

	modified:   .gitignore
	modified:   public_html/config.js
	modified:   public_html/gmap.html
	modified:   public_html/script.js

Example file
--- untrackedDeveloperSettings.js ---
// Load this file after config.js so these settings are used

var CONST_CENTERLAT = 35.21928;
var CONST_CENTERLON = -80.94406;
var CONST_ZOOMLVL   = 9;
--- untrackedDeveloperSettings.js END ---
2013-05-25 11:56:32 +03:00
terribl 242738b178 Removed 0000 squawks from table 2013-05-25 11:03:30 +03:00
Malcolm Robb 228b770be8 Move declarations into a headed file
This is the start of breaking the main dump109.c file into smaller
modules to make it a bit more maintainable.

Move all the #define and structure declarations into dump1090.h
2013-05-24 23:32:12 +01:00
Malcolm Robb e86eb3921e VK1ET : Numerous changes to Port handling
Changes based on ideas from John VK1ET. His commit notes are as follows
:

1. Change input socket handling to avoid unnecessary memmove (use
pointers instead)

2. Add ability to read and decode binary beast format TCP.

3. Change output socket handling same as sbs_output - only call output
handler if there is a current client connected use separate ports for
beast in and out - no need for --net-beast flag. Will input/output
format defined by socket connected to. avr raw, beast binary and sbs can
be handled simultaneously.

4. Some comments changes, filtering of ModeAC to json,.
2013-05-24 22:29:00 +01:00
Malcolm Robb f64a65b5a2 Tidy up of UKUEHN's improvements
Resolves some merge conflicts that I couldn't find a way to fix during
the previous merge.

Remove a few Tabs that escaped in the edit/merge

Rename the fix_errors flag variable to nFix_crc since it now represents
the number of crc errors to attempt to fix.

Remove the aggressive variable since it's now part of nFix_crc

Only print phase correction statistics when phase correction is enabled.

Add an additional Modes.stat_ph_bit_fix[] to count the bits fixed during
phase correction
2013-05-24 21:51:44 +01:00
Malcolm Robb 9edba9332a UKUEHN : Various Improvements
Sorry Ulrich - I can't get Github to resolve the merge errors and
preserve your commit notes, so I'll add them here.
Improvements on bit error correction, doc update, preparation for
program installation/package build

Hi,
I committed some further improvements on the bit error correction code,
updated the readme, and implemented a way to install the program in the
linux file system hierarchy (allows for package building).

Regards,
Ulrich
2013-05-24 21:24:16 +01:00
Malcolm Robb ee742cf8db SBS Output Format changes
Bug fixes in the SBS output code as a result of an EMAIL from Liviu

Some software gets upset if null fields are output where the software is
expecting a valid value. This was being caused by DF0's outputting and
SBS MSG5. MSG5 needs Atert and SPI flags, which are derived from the FS
field. DF0 doesn't have an FS field, so cannot output a MSG5. Change so
that DF0 results in an SBS MSG7.

Also DF17/DF18 metypes 5 to 18 contain raw Lat/Lon data. However they
cannot be decoded into real Lat/Lon values unless both even and odd
parts are available Therefore, when we receive a DF17/DF18 we need to
check that we have successfully decoded the Lat/Lon before we attempt to
send an SBS MSG2 or MSG3. If we don't have a decoded Lat/Lon, send a
MSG7 instead.
2013-05-24 12:26:06 +01:00
Malcolm Robb 4c0ed6d5f1 Set AOG_VALID for DF-17/18 metype 19 2013-05-24 11:10:16 +01:00
Malcolm Robb 77bd1f40dc Include Vertical rate in aircraft structure 2013-05-24 11:07:49 +01:00
Brian Davenport 8b5c74ded8 Split into multiple JS files,
Selecting planes now works,
Started work on settings window,
Created extension.js, an area for new ideas to be tested or loaded out of.
2013-05-24 02:15:37 +00:00
Brian Davenport b0e0f96c94 Merge pull request #8 from MalcolmRobb/master
Pulling in from MalcomRobb's Master
2013-05-23 04:45:30 -07:00
terribl e0c752bb94 Merge branch 'master' of https://github.com/terribl/dump1090 2013-05-23 13:21:28 +03:00
terribl 143606209e Merge remote-tracking branch 'upstream/master' 2013-05-23 13:20:42 +03:00
terribl e309025c11 Merge remote-tracking branch 'upstream/master' 2013-05-23 13:16:14 +03:00
terribl 6bf2f2b54b Added global settings and untrackedDeveloperSettings.js-file.
untrackedDeveloperSettings.js
Create file and add line `var developerSettings = true;` on top of it.
After that some settings can be overwritten with deleloper's flavour.

-- Example File w/o line numbers --
var developerSettings = true;

var CONST_CENTERLAT = 60.0; // 45.0
var CONST_CENTERLON = 20.0; // 9.0
var CONST_ZOOMLVL   = 6; //5
-- End of Example File --

	modified:   .gitignore
	modified:   public_html/gmap.html
	modified:   public_html/script.js
2013-05-23 12:47:29 +03:00
Brian Davenport d2a15659e7 Couple more small tweaks to the tails of planes.
Added "CoolClock" both local and GMT to the info pane, http://randomibis.com/coolclock/
2013-05-22 17:09:12 +00:00
Malcolm Robb e50c2a5a54 Phase Enhancement changes
Phase enhancement is used to try and increase the signal amplitude when
Nyquist sample aliasing is suspected. In previous versions, this was
enabled by default. In this version, the default is off. There is now an
additional command line switch --phase-enhance to turn it on.

There are also additional debug statistics which count the number of
phase demodulation failures in for both uncorrected and phase corrected
passes.
2013-05-22 13:23:54 +01:00
Malcolm Robb b481c76909 mm structure initialisation
Ideally we should clear down the mm structure every loop of our
ModeA/C/S bit detector. However, we're getting 2Mbits of data per
second, and the structure is several tens of bytes long. Clearing down
every loop would require us to zero up to 100Mb per second. The memset
function may be fast, but it's still going to take up valuable processor
time.

So instead of clearing the whole structure every loop, just clear the
important parts.
2013-05-22 11:49:03 +01:00