summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2017-07-21Start cleaning up sensor indexing for multiple sensorsGravatar Linus Torvalds
This is a very timid start at making us actually use multiple sensors without the magical special case for just CCR oxygen tracking. It mainly does: - turn the "sample->sensor" index into an array of two indexes, to match the pressures themselves. - get rid of dive->{oxygen_cylinder_index,diluent_cylinder_index}, since a CCR dive should now simply set the sample->sensor[] indices correctly instead. - in a couple of places, start actually looping over the sensors rather than special-case the O2 case (although often the small "loops" are just unrolled, since it's just two cases. but in many cases we still end up only covering the zero sensor case, because the CCR O2 sensor code coverage was fairly limited. It's entirely possible (even likely) that this migth break some existing case: it tries to be a fairly direct ("stupid") translation of the old code, but unlike the preparatory patch this does actually does change some semantics. For example, right now the git loader code assumes that if the git save data contains a o2pressure entry, it just hardcodes the O2 sensor index to 1. In fact, one issue is going to simply be that our file formats do not have that multiple sensor format, but instead had very clearly encoded things as being the CCR O2 pressure sensor. But this is hopefully close to usable, and I will need feedback (and maybe test cases) from people who have existing CCR dives with pressure data. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-20Unify sample pressure and o2pressure as pressure[2] arrayGravatar Linus Torvalds
We currently carry two pressures around for all the samples and plot info, but the second pressure is reserved for CCR dives as the O2 cylinder pressure. That's kind of annoying when we *could* use it for regular sidemount dives as the secondary pressure. So start prepping for that instead: don't make it "pressure" and "o2pressure", make it just be an array of two pressure values. NOTE! This is purely mindless prepwork. It literally just does a search-and-replace, keeping the exact same semantics, so "pressure[1]" is still just O2 pressure. But at some future date, we can now start using it for a second sensor value for sidemount instead. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-19Correct list of Shearwater BLE dive computersGravatar Dirk Hohndel
Some Petrel 2 computers are dual stack. We need to list the Petrel here as well since the Petrel 2 actually identifies itself via BT/BLE as Petrel and we can't tell them appart until after we started a download. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-19BLE on iOS: use uuid instead of BT addressGravatar Dirk Hohndel
iOS doesn't give us an address of BT devices. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-19Move variable into the code block it is used inGravatar Dirk Hohndel
Avoids an "unused variable" warning. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-19BLE discovery: give the agent some timeGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-19iOS BLE support: no localBtDevice, go straight to discoveryGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-19iOS build: add BLE support filesGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-19iOS build: need to more includesGravatar Dirk Hohndel
It's kinda odd this builds fine on other OSs, but whatever. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-19BLE dive computers: add PerdixGravatar Dirk Hohndel
This is both correct (many Perdix support BLE) and necessary as the Perdix AI identifies itself (sadly) as Perdix. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-19QML UI: fix some obvious UI errorsGravatar Jan Mulder
Fixes: #490 items 1) and 2). 1) Reference to isBluetooth.leftPadding is removed as the isBooltooth checkbox is gone. 2) Do not set background color of downloaded dives. The checkbox is used to denote "selected or not". In addition, incorrect references to subsurfaceTheme.PrimaryColor (which does not exist) are replaced by the correct subsurfaceTheme.primaryColor. Finally, an obvious copy/paste error width: childrenRect.height. that is supposed to be width: childrenRect.width. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-07-19QML UI: Allow cancel of ongoing downloadGravatar Jan Mulder
This commit adds the capability to cancel a running download from DC. The actual cancel is fully handled in the underlying libdivecomputer code. As the user may be interested in the dives downloaded up to the moment of cancel, do not just close the download screen (as it was before this commit). Now, the <quit> button changes to <cancel> when the download is started, and pressing cancel, only cancels the download and does not close the download screen, but presents the so far downloaded data. When no download is running, the <quit> button just quits the screen as before. Fixes: #485 Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-07-19Android: truncate logfile and add dateGravatar Jan Mulder
Trucate the logfile on open to remove any data from previous sessions. This confused me very much, as the new logfile started from the top, leaving old data on the bottom. Also added system date for easy reference. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-07-19BLE serial read/write bufferGravatar Jan Mulder
The adapted define was confusingly wrong. Apparently, the BUFSIZ define was coming from some include file, and was dependent on platform (Linux 8K, Andorid 1K). Simple rewrite to a new define and a proper value for both Linux and Android. If 4K is big enhough, is a little uncertain, as its depends on the read behavior of all libdivecomputer parsers using this serial BLE interface. The buffer size needed (on read, as that is the most prominent direction when interfacing with DCs) is (most likely) 2x the maximum block the libdc parsers request at once. I did not study all parsers, but the Shearwater parser request 20 bytes at once (we know that from the 1 packet at the time read, we had before). The OSTC parser request 1K blocks for data that is longer than 1K (like profiles, header tables). The 1K we had on Android was working for Shearwater, Eon Steel, but not for OSTC,as its reads 1K at the time at max, and overflowing the buffer. So 32k or 64k seems way to big (as in, much bigger than any libdc read). Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-07-19Android compile fixGravatar Jan Mulder
Forgotten slash broke my Andorid build (with Qt from source). Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-07-18QML UI: set the color of the action side-buttonsGravatar Joakim Bygdell
This sets the color of the action side-buttons to the same color as the overlay drawer. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-18QML UI: correctly match BT names with productsGravatar Dirk Hohndel
And remove the remaining references to the "Paired Bluetooth Devices". Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-18QML UI: Download from DC: remove Bluetooth checkboxGravatar Dirk Hohndel
The connection already clearly defines whether this is Bluetooth or not. No reason for the separate checkbox. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-18QML UI: Download from DC: smaller font for connectionGravatar Dirk Hohndel
Also style all three drop downs the same (otherwise the left edge of the text doesn't align). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-18QML UI: remove the Paired Bluetooth Devices virtual vendorGravatar Dirk Hohndel
We now actually handle connections in a sane manner and don't need that workaround anymore. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-18Add detection of the Shearwater Predator via BTGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-17iOS build: update dummy file to include Controls 2 MaterialGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-17Resolve type confusionGravatar Dirk Hohndel
No idea why this now shows up as an error in the iOS build. We need to refer to the typedef, not the underlying struct. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-17iOS build: allow building against Qt 5.9.1 and laterGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-17iOS build: add bluetooth capability to Info.plistGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-17Merge branch 'MobileUI' of git://github.com/jbygdell/subsurfaceGravatar Dirk Hohndel
2017-07-17QML UI: automatically set the Bluetooth checkboxGravatar Dirk Hohndel
I wonder if we even need this anymore at all as the connection clearly determines whether this is a BT download or not. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-17QML UI: only change connection when finding a matchGravatar Dirk Hohndel
If we can't find a match, just leave it unchanged. This way, if we mis-recognize a device, the user can correct the product (or even vendor) without losing the correct connection. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-17QML UI: add serial interfaces to connection listGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-16QML UI: show the connection choices in Download UIGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-16Add the connections that we find to the modelGravatar Dirk Hohndel
So far this only deals with BT addresses. We also need to add other connections that we detect. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-16Add ConnectionListModelGravatar Dirk Hohndel
We'll use that to do a better job of showing the connection used when talking to a dive computer. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-15build.sh: don't fail if we can't find libusb or hidapiGravatar Dirk Hohndel
Also remove a left behind debug printout. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-15Mac build: correctly deal with no printingGravatar Dirk Hohndel
Including working around a weird hack to install the Grantlee plugins. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-15Mac build: move Qt detection to outside levelGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-15Mac build: newer Qt comes without WebKitGravatar Dirk Hohndel
Allow turning it on for those who have it, but by default build without it on Mac. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-15Mac build: deal with libdivecomputer and pkg-configGravatar Dirk Hohndel
libdivecomputer asks pkg-config for the include paths for libusb-1.0 and hidapi, but then uses #include <libusb-1.0/libusb.h> and <hidapi/hidapi.h> which fails as those directories are part of the include path. So we manually add include paths without that last directory as well as a work around. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-15Mac build: deal with SDK location and availabilityGravatar Dirk Hohndel
I really want to build against 10.10 so as many people as possible can use the binaries I create, but regular users might not have the older SDKs installed. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-15QML UI: style the GPS fixes pageGravatar Joakim Bygdell
Add styling to the GPS fixes page. The background color of the swipe list objects is wrong and also the icon overlay. This is a Kirigami issue. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-15QML UI: add material theme controlsGravatar Joakim Bygdell
In order for the theme styilng to work we need the materials definitions. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-15Fix compile errorsGravatar Dirk Hohndel
This was fixed in my local tree but I forgot to amend the commit before pushing it out. Oops. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-15Fix typoGravatar Joakim Bygdell
Simple typo. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-15QML UI: add Kirkigami theme variablesGravatar Joakim Bygdell
The built in theme in Kirigami has special variables for sertain objects, this sets the correct color for each object to match our themes. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-15QML UI: define the material accent colors for each themeGravatar Joakim Bygdell
THe editable textboxes rely on the material theme to set the correct colors. This sets the appropriate colors for each theme. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-15QML UI: style the overlay drawerGravatar Joakim Bygdell
This adds separate colors for the overlay drawer background for light and dark themes. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-15QML UI: style the GPS services checkboxGravatar Joakim Bygdell
This adds style to the GPS services checkbox so that it matches the theme. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-15QML UI: style the DC download dialogGravatar Joakim Bygdell
This sets the checkboxes in the dive computer download dialog to match the rest of the theme. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-15Fix CSV export for imperial start and end pressureGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-07-15Reflect import of subsurfaceCSV with having units in headersGravatar Miika Turkia
2017-07-15CSV export: show units on headerGravatar Miika Turkia
Let's show the units in CSV header so the actual fields have only the values. This should be easier to parse with some other programs. Fixes #472 Signed-off-by: Miika Turkia <miika.turkia@gmail.com>