aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2015-08-22Cloud storage: use merge options to avoid conflictsGravatar Dirk Hohndel
In many cases Subsurface will do something "reasonable" if we have conflicting edits and then try to merge. GIT_MERGE_FILE_FAVOR_UNION means that both edits will be added to the final file and then Subsurface should quietly take one or the other - this will need quite a bit of testing. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-22Cloud storage: merge local and remote changes if there is no conflictGravatar Dirk Hohndel
We still punt if there are any conflicts (which are likely to occur if we have touched dive sites in both changes). But in my testing at least for fairly simple, non-conflicting changes this works and creates a correctly merged tree. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-22Continue to separate logic code from UI codeGravatar Dirk Hohndel
We don't want to call into the MainWindow from C code. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-21Cmake: fix cross compiling on WindowsGravatar Dirk Hohndel
Cmake has a bug that causes the moc process not being handed the necessary defines for the architecture we are building for. Also we were missing a library to make the BT implementation on Windows work. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-21Display error messages in plannerGravatar Robert C. Helling
After a replot, check if there is an error message to display. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-21Use our pressure type to avoid bar / mbar confusionGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-21Don't do computationally expensive Boyle compensation when not using VPM-BGravatar Robert C. Helling
Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-21Don't do Boyle compensation when still on first stopGravatar Robert C. Helling
There is nothing to compensate but we would hit a 0/0 numerical instability there. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-21Save Properties for each State of the mainWindowGravatar Tomaz Canabrava
Each state can have the same widgets but with different properties - currently I'm using "enabled" : true and false for the DiveSiteEdit, it looks like a big amount of code for such a small thing but it was the cleaner way that I tougth of doing. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-20Updates to the ReleaseNotesGravatar Dirk Hohndel
Including a quick note about the two known issues on Macs. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-20Open subsurface on attaching divecomputerGravatar Venkatesh Shukla
Added USB usage permissions in manifest. Also added various FTDI based USB devices in xml/device_filter.xml. When any device matching the VID and PID provided in the device_filter.xml is attached, subsurface application is opened automatically. Also, the USB permissions are granted to the application. This simplifies the USB file generation approach. Signed-off-by: Venkatesh Shukla <venkatesh.shukla.eee11@iitbhu.ac.in> Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-20Connect up serial_ftdi custom serialGravatar Anton Lundin
This connects the serial_ftdi implementation to subsurface, and builds libftdi1 for the android builds. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-20Turn serial_ftdi.c into a custom_serialGravatar Anton Lundin
This cleans up serial_ftdi.c from being a libdivecomputer source and making it into a subsurface custom_serial. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-20Re-indent and style up serial ftdiGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-20serial_ftdi.c for communication with ftdi devicesGravatar Venkatesh Shukla
This script is based on serial_posix.c and is primarily meant to work on android, but could be used elsewhere as well. This script communicates with libftdi devices connected to the system using libftdi library. ftdi_read_data returns 0 if no data is received from the device. Allowing to continue on recieving 0 might end up in an infinite loop. But it works in OSTC3. This needs to be checked further. libftdi returns -3 when it could not find any device corresponding to the pid and vid given. (Different from -3 of libusb which means you do not have permissions to access the device) Use this to return value to check for other accepted chipsets including the custom pids used by divecomputer manufacturers such as Cressi (Leonardo), Suunto and Oceanic. ftdi_read_data returns the number of bytes read (+ve), 0 when there is no data to read, and negative when there is an error. Instead of infinitely waiting for the data to appear, it is better to implement an exponential backoff which times out after MAX_BACKOFF. [Anton Lundin: This code was originally intended to be included in libdivecomputer, but because we now got the custom-serial patches, its included in subsurface instead, and wired in from there - renamed the resulting file to serial_ftdi.c] Signed-off-by: Venkatesh Shukla <venkatesh.shukla.eee11@iitbhu.ac.in> Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org> Rename serial_ftdi.c for subsurface source Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-20Wire up get_usb_fd to libusb_set_android_open_callbackGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-20Extract usb file descriptor of ftdi on AndroidGravatar Venkatesh Shukla
Using JNI implementation of QtAndroid, usb file descriptor of attached ftdi usb device is extracted. This would then be used for opening usb device on android. This implementation assumes that permission for usage of device is already present. This is because of the device_filter due to which on attaching a recognised usb device (Only ftdi for now) to android, a dialog pops up asking for permission to use it with subsurface. Not an ideal assumption but works sufficiently well. Signed-off-by: Venkatesh Shukla <venkatesh.shukla.eee11@iitbhu.ac.in> Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-20Enable android logging from libusbGravatar Anton Lundin
This makes libusb to log straight to the android logging system. This makes sure we can reach the logs and debug things. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-20Patch libusb for android custom open functionGravatar Anton Lundin
This idea was inspired by: https://github.com/PointCloudLibrary/mobile/blob/master/3rdparty/android/patches/libusb.patch The whole thing is re-written from scratch but the idea came from there, and its a way simpler way of getting a system-opened fd to the right place than patching every call in the stack to pass a fd down. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-20Add implementation for device discovery agent initialization (Windows)Gravatar Claudiu Olteanu
Register the metatypes needed for Windows platforms and initialize our custom device discovery agent. Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-20Get a pretty print message when a device discovery error occuredGravatar Claudiu Olteanu
Try to get a pretty print message when a device discovery error is raised and it is unknown. Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-20Add implementation for BTH device item selection on Windows platformsGravatar Claudiu Olteanu
When a Bluetooth device is selected from the discovered list display information about its address and enable the save button. On Windows we don't need to check if the devices are paired because the pairing process is done automatically on the connection step. If the devices are not paired Windows will ask for user's permission to continue the process. Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-20Use the address of the BTH device if its name is emptyGravatar Claudiu Olteanu
There are moments when the name of the device is not collected properly and it is unavailable. Instead of showing an empty string then print the address of the device. Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-20Add implementation for add remote Bluetooth device handlerGravatar Claudiu Olteanu
On Windows we cannot determine the pairing status of the device. Therefore we print only information about its name and about its BTH address. Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-20Wait for BTH device discovery thread to finish on stop callGravatar Claudiu Olteanu
We should wait for the WinBluetoothDeviceDiscoveryAgent completion when the stop method was called. Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-20Initialize WinSock and hide the information about the local deviceGravatar Claudiu Olteanu
On Windows we cannot select a device or show information about the local device. Therefore we disable the UI section related to local device details. Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-20Add implementation for our custom BTH device discovery serviceGravatar Claudiu Olteanu
Implement a custom lookup service for remote Bluetooth devices discovery. This will be used on Windows platforms to collect information about the name and the address of a remote Bluetooth device. In the beginning we initialize the queryset with the necessary flags and we start the lookup service. When a device is discovered we collect information about its name and its address and we raise a signal with it using the same signature as the one emitted by QtBluetoothDeviceDiscoveryAgent implementation. Finally we end the lookup service and we reset the internal flags. This code was written with the help of the sample code documenting the relevant APIs provided by Microsoft Corporation at https://code.msdn.microsoft.com/windowsdesktop/Bluetooth-Connection-e3263296 which is under the MS-LPL. No code from the samples was copied and the code in this commit is covered by the GPL and not the MS-LPL. Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-20Add implementation for BTH custom serial write method used on WindowsGravatar Claudiu Olteanu
Implement the write method used for our custom serial implementation on Windows platforms. Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-20Add implementation for BTH custom serial read method used on WindowsGravatar Claudiu Olteanu
Implement the read method used for our custom serial implementation on Windows platforms. Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-20Add implementation for BTH custom serial close method on WindowsGravatar Claudiu Olteanu
Implement the close method used on Windows platforms for our custom serial implementation. Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-20Add implementation for BTH custom serial open method on Windows platformsGravatar Claudiu Olteanu
Implement the custom serial open method using the WinSocket2 API. First the device address is converted from text representation into a sockaddr structure. Then a connection is initiated to the device using device's Serial Port service. Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-20Add skeleton for Bluetooth custom serial implementation on Windows platformsGravatar Claudiu Olteanu
Add a skeleton which will be used to develop the Bluetooth custom serial implementation for Windows platforms. Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-20Add set_timeout callback for Bluetooth custom serial implementationGravatar Claudiu Olteanu
The new callback will be usefull when we will implement the support for Windows. The implementation of native serial set_timeout method uses a HANDLER on Windows and we will use the WinSock2 API which has a socket descriptor. Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-20Reimplement pairingFinished methodGravatar Claudiu Olteanu
The old implementation didn't use the correct deviceLabel pattern. When the pairing status of a device was changed the name of the device was missing from the new label. With the new implementation when the pairing status is changed we replace the old state with the new one and maintain the device information from the old label. Also we set the same pairing background colors used in the addRemoteDevice callback. In this way the label's state is consistent and the UX is improved. Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-20Clear the BTH discovered devices list on each searchGravatar Claudiu Olteanu
Clear the Bluetooth discovered devices list on each search. In this way we will show only the devices that are in range and active during the last scannning. Also if we clear the list before each call we don't need to check anymore if the discovered device is already in the list. Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-20Check the last error when the BTH device scanning is finishedGravatar Claudiu Olteanu
If there is no error reported when the device scanning is finished then report to the dialog status that the scanning finished successfully. Otherwise report the last error. Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-20Cleanup Bluetooth local device and the discovery agent on exitGravatar Claudiu Olteanu
Do some extra cleanup when the BtDeviceSelectionDialog is destroyed. Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-20Display dives from the same location on the listGravatar Tomaz Canabrava
Some dive sites are separated in more than one real dive site (for instance, a 'blue hole' dive site that has different entry points on the gps), so instead of checking only the dive_site id, also check it's name. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-20Always save taxonomy data, even if disabled in the prefsGravatar Dirk Hohndel
Otherwise, if one of the systems used with cloud storage doesn't have the preference for geo encoding enabled, the taxonomy data will be lost. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-20Use boyle_compensation in profileGravatar Robert C. Helling
otherwise VPM-B planned profiles seem to violate the ceiling. This needs the first_stop_pressure to be available also in the profile, so I made it global in planner.c Important lesson: If you want to use deco_allowed_depth on a tissue_tolerance that comes from a VPM-B planned dive, you have to call boyles_law() before add_segment()! Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-20Leftovers from introduction of in_planner() helper functionGravatar Robert C. Helling
I have no idea how these could have been left behind Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-19Avoid duplicate divesites on Liquivision importGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-19More precise commentsGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-19Restore selection after renumbering dives.Gravatar Sander Kleijwegt
After renumbering any number of selected dives, the selected dives would still be selected, but this was not visible from the divelist view. Clicking on subsequent dives would deselect them while the GUI shows them as selected, any further action like delete would not be done on the visible selection, but on the invisible dive->selected state, leading to apparently very weird behaviour. Fixes #917 Signed-off-by: Sander Kleijwegt <sander@myowndomain.nl> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-19Fix startup crash with missing HOME or LOGNAME environment variablesGravatar Sander Kleijwegt
Check whether setenv returns NULL and if so default to '~' for HOME and 'default' for LOGNAME. Signed-off-by: Sander Kleijwegt <sander@myowndomain.nl> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-18VPM-B: Update critical_volume_lambdaGravatar Rick Walsh
The default value for critical_volume_lambda is 6500 fsw.min (= 199.58 bar.min) for VPM-B, rather than 7500 fsw.min (= 230.284 bar.min) for VPM. This is consistent with V-Planner, MultiDeco, GUE DecoPlanner, HLPlanner and the comments in the Fortran code explanation. Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-18Replace global in_planner variable by helper functionGravatar Robert C. Helling
as promised earlier Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-18Get rid of is_ok_vpmbGravatar Robert C. Helling
Since a8ce8, that made deco_allowed_depth work for VPM-B as well, this function became obsolete but was reintroduced by one of Jan's latest patches. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-18Compare ceiling to next stop rather than try to ascent for VPM-BGravatar Robert C. Helling
For VPM-B, to stay within the reference implementation, to decide if we need to stop we check if the current ceiling is above the next stop depth rather than trying to ascent and check if we violate a ceiling. This leads to more conservative profiles. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-18Revert "Pref. to ascent to next stop only when stop is below ceiling"Gravatar Dirk Hohndel
This reverts commit a6ed36fb7368254d694a4f397d6d033326c37ef2.