summaryrefslogtreecommitdiffstats
path: root/Documentation/user-manual.txt
blob: 720bda7b1c00223ce051c849bc8c080343702fd8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
// Subsurface 4.8 User Manual
// ==========================
// :author: Manual authors: Jacco van Koll, Dirk Hohndel, Reinout Hoornweg,
// Linus Torvalds, Miika Turkia, Amit Chaudhuri, Jan Schubert, Willem
// Ferguson, Salvador Cuñat, Pedro Neves
// :revnumber: 4.8.2
// :revdate:September 2018
:icons:
:toc2:
:toc-placement: manual
:numbered:
// :website: https://subsurface-divelog.org

image::images/Subsurface4Banner.jpg["Banner",align="center"]

[big]#USER MANUAL#

*Manual authors*: Willem Ferguson, Jacco van Koll, Dirk Hohndel, Reinout Hoornweg,
Linus Torvalds, Miika Turkia, Amit Chaudhuri, Jan Schubert, Salvador Cuñat, Pedro Neves,
Stefan Fuchs

[blue]#_Version 4.9, February 2019_#

Welcome as a user of _Subsurface_, an advanced dive logging program with
extensive infrastructure to describe, organize, interpret and print scuba
and free dives. _Subsurface_ offers many advantages over other similar
software solutions:

 - Do you need a flexible way of logging dives using recreational equipment,
   even without a dive computer?
 - Do you wish to seamlessly include GPS locations of dive sites into your dive log?
 - Do you use two different dive computer brands, each with its own proprietary
   software for downloading dive logs? Do you dive with rebreathers as well
   as open circuit or recreational equipment? Do you use a Reefnet Sensus time-depth
   recorder along with a dive computer? _Subsurface_ offers a standard
   interface for downloading dive logs from all of these different pieces of
   equipment, storing and analyzing the dive logs within a unified system.
 - Do you use more than one operating system? _Subsurface_ is fully compatible
   with Mac, Linux and Windows, letting you access your dive log on a range of
   operating systems using a single application.
 - Do you use Linux or Mac, but your dive computer has only Windows-based software
   for downloading dive information (e.g. Mares or Scubapro)? _Subsurface_ provides a way of
   downloading and analyzing your dive logs on other operating systems.
 - Do you need an intuitive graphical dive planner that integrates with, and takes
   into account, dives you’ve already logged?
 - Do you need a way of storing or backing up your dive log on the Internet, letting
   you view your dive log from anywhere using an Internet browser?
 - Do you wish to access or modify your dive log using a mobile phone?

_Subsurface_ binaries are available for Windows PCs (Win 7 or later from
version 4.6 of _Subsurface_ onwards), Intel based Macs (OS/X) and many
Linux distributions. _Subsurface_ can be built for
many more hardware platforms and software environments where Qt and
libdivecomputer are available.

This manual explains how to use the _Subsurface_ program. To install
the software, consult the _Downloads_ page on the
https://subsurface-divelog.org/[_Subsurface_ web site].
Please discuss issues with this program by sending an email to
mailto:subsurface@subsurface-divelog.org[our mailing list] and report bugs at
https://github.com/Subsurface-divelog/subsurface/issues[our bugtracker].  For instructions on how to build the
software and (if needed) its dependencies please consult the INSTALL file
included with the source code.

*Audience*: Recreational Scuba Divers, Free Divers, Tec Divers, Professional
Divers

toc::[]


Using this manual
-----------------
When opened from within _Subsurface_, this manual does not have external controls for
paging or selecting previous pages. However, two facilities are provided:

- The _SEARCH_ function is activated by pressing control-F or command-F on
the keyboard. A text box appears at the bottom right-hand of the window (see image below).
For instance, typing the word "_weights_" into the search text
box, searches throughout the user manual. To the right of the
search text box are two arrows pointing up and down. These find
the previous and the next occurrence of the search term.

image::images/UserManualSearch.jpg["User manual functions",align="center"]


- _PREVIOUS/NEXT LINK_. Move between links (underlined words that
jump to specific sections in the user manual) by right-clicking on the text of the manual.
This brings up a context menu to PREVIOUS links selected.
(see image below). For instance if a link has been selected, then the option
to _Go Back_ shows the text at the previous link selected
(similar to the Previous Page button in a browser). Conversely the _Go Forward_ option
jumps to the
text seen before selecting the _Go Back_ option. The _Reload_
option reloads the complete user manual into the window.

image::images/UserManualLinksBack.jpg["User manual functions",align="center"]


[[S_UserSurvey]]
The user survey
---------------
In order to develop _Subsurface_ to serve its users in the best possible way,
it’s important to have user information. Upon launching _Subsurface_
and using the software for a week or so, a one-box user survey pops up. It is entirely
optional and the user controls what, if any, data are sent to the _Subsurface_ development
team. All data the user sends is useful, and will only be
used to steer future development and to customize the software to fit the needs of
the _Subsurface_ users. If you complete the survey, or click the option not to
be asked again, that should be the last communication of this type you receive.
However, if your diving and/or subsurface habits change and you wish to fill in
another survey, just launch _Subsurface_ with the _--survey_ option on the command line.

[[S_StartUsing]]
Start Using the Program
-----------------------

The _Subsurface_ window is usually divided into four panels with a *Main
Menu* (File Edit Import Log View Help) at the top of the window (for Windows
and Linux) or the top of the screen (for Mac and Ubuntu Unity). The four panels are:

1. The *Dive List* on the bottom left, showing all the dives in the
user's
dive log. A dive can be selected and highlighted on the dive list by clicking on
it. In most situations the up/down keys can be used to switch
between dives. The *Dive List* is an important tool for manipulating a dive log.

2. The *Dive Map* on the bottom right, showing the user's dive sites on a world map
and centered on the site of the last dive selected in the *Dive List*. The map
scale can be increased or decreased.

3. The *Info* on the top left, giving more detailed information on the
dive selected in the *Dive List*, including some statistics for the selected dive or for all
highlighted dive(s).

4. The *Dive Profile* on the top right, showing a graphical dive profile of the
selected dive in the *Dive List*. You can zoom
into the dive profile for a more detailed view.

The dividers between panels can be dragged to change the size of any of
the panels. _Subsurface_ remembers the position of the dividers, so the next
time _Subsurface_ starts it uses the positions of the dividers from the last time the program was used.

If a single dive is selected in the *Dive List*, the dive location, detailed information
and profile of
the _selected dive_ are shown in the respective panels. If
several dives are selected, the last highlighted dive is the _selected
dive_, but summary data of all _highlighted dives_ is shown in the *Stats* tab
of the *Info* panel (maximum, minimum and average depths, durations, water
temperatures and SAC; total time and number of dives selected).

[[S_ViewPanels]]

image::images/MainWindow.jpg["The Main Window",align="center"]

Decide which of the four panels are displayed by selecting the
*View* option on the main menu. This feature has several choices of display:

*All*: show all four of the panels as in the screenshot above.

*Divelist*: Show only the Dive List.

*Profile*: Show only the Dive Profile of the selected dive.

*Info*: Show only the Notes about the last selected dive and statistics for
all highlighted dives.

*Globe*: Show only the world map, centered on the last selected dive.

Like other functions that can be accessed via the Main Menu, these options
can also be triggered using keyboard shortcuts. The shortcuts
are shown with an underline in the main menu entries, with the Alt-key pressed,
or are denoted after the menu item.

When the program is started for the first time, it shows no
information at all, because it does not have any dive information available. In the
following sections, the procedures to create a new logbook will be explained.

[[S_NewLogbook]]
Creating a new logbook
----------------------
Select _File ->  New Logbook_ from the main menu. All existing dive data are
cleared so new information can be added. If there are unsaved data in an
open logbook, the user is asked whether the open logbook should be
saved before a new logbook is created.

[[S_GetInformation]]
== Storing dive information in the logbook
Now that a new logbook is created, it is simple to add dive data it.
_Subsurface_ allows several ways of adding dive data to a logbook.

1) If the user has a handwritten divelog, a spreadsheet or another form of
 manually maintained divelog, dive data can be added to the logbook using
 one of these approaches:

 - Enter dive information by hand. This is useful if the diver didn’t
 use a dive computer and dives were recorded in a written logbook. See:
 xref:S_EnterData[Entering dive information by hand]

 - Import dive log information that has been maintained either as a spreadsheet
 or as a CSV file. Refer to: xref:S_Appendix_D[APPENDIX D: Exporting a spreadsheet to CSV format] and
 to xref:S_ImportingCSVDives[Importing dives in CSV format].

2) If a dive is recorded using a dive computer, the depth profile
and a large amount of additional information can be accessed.
These dives can be imported from:

 - The dive computer itself. See: xref:S_ImportDiveComputer[Importing new dive information from a Dive Computer];
 - Proprietary software distributed by manufacturers of dive computers. Refer
 to: xref:S_ImportingAlienDiveLogs[Importing dive information from other digital data sources or other data formats].
 - Spreadsheet or CSV files containing dive profiles.
 See: xref:S_ImportingCSVDives[Importing dives in CSV format from dive computers or other dive log software]


[[S_EnterData]]
=== Entering dive information by hand

This is usually the approach for dives without a dive computer. The basic record
of information within _Subsurface_ is a dive. The most important information
in a simple dive logbook usually includes dive type, date, time, duration,
depth, the names of your dive buddy and the divemaster or dive guide, and
some remarks about the dive. _Subsurface_ can store much more
information for each dive.  To add a dive to a dive log, select _Log
->  Add Dive_ from the Main Menu. The program then shows three panels
on which to enter
information for a dive: two tabs in the *Info* panel (*Notes* and
*Equipment*), as well as the *Dive Profile* panel that displays a graphical profile
of each dive. These panels are respectively marked [red]#A#, [red]#B# and
[red]#C#
in the figure below. Each of these tabs will now be explained for data entry.

image::images/AddDive1_f22.jpg["FIGURE: Add dive",align="center"]
When you edit a field in Notes or Equipment panels, _Subsurface_ enters *Editing Mode*,
indicated by the message in the blue box at the top of the *Notes* panel (see the image below). This message is
displayed in all the panels under Notes and Equipment when in *Editing Mode*.

image::images/BlueEditBar_f22.jpg["Blue edit bar",align="center"]

The _Apply changes_ button should only be selected after all the parts of a dive have been entered.
When entering dives by hand, the _Info_, _Equipment_ and _Profile_ tabs should be completed
before applying the information. By selecting the _Apply changes_ button, a local copy of the information
for this specific dive is saved in memory but NOT written to disk.
The _Apply changes_ button should ONLY be selected after all parts
of a dive have been entered. When closing Subsurface, the program will
ask again, this time whether the complete dive log should be saved on disk or not.

[[S_CreateProfile]]
==== Creating a Dive Profile

The *Dive Profile* (a graphical representation of the depth of the dive as a
function of time) is shown in the panel on the top right hand of the
_Subsurface_ window. When a dive is manually added to a logbook, _Subsurface_
presents a default dive profile that needs to be modified to best represent the
dive described:

image::images/DiveProfile1_f20.jpg["FIGURE: Initial dive profile",align="center"]

_Modifying the dive profile_: When the cursor is moved around the dive profile,
its position is shown by two right-angled red lines as seen below.
The time and depth
represented by the cursor are indicated at the top of the black information box
(@ and D). The units (metric/imperial) on the axes are determined by the
*Preference* settings. The dive profile itself comprises several
line segments demarcated by waypoints (white dots on the profile, as shown
above). The default dive depth is 15 m.
If the dive depth was 20 m then you need to drag the appropriate waypoints
downward to 20 m. To add a waypoint, double-click on
any line segment. To move an additional waypoint, drag it. Moving can also
be done by selecting the waypoint and using the arrow keys.
To remove a waypoint, right-click on it and choose "Remove this point" from the
context menu. Drag the waypoints to represent an
accurate
time duration for the dive. Below is a dive profile for a dive
to 20 m for 30 min, followed by a 5 minute safety stop at 5 m.

image::images/DiveProfile2_f20.jpg["FIGURE: Edited dive profile",align="center"]

_Specifying the gas composition:_ The gas composition used is indicated
along the line segments of the dive profile. This defaults to the first gas
mixture specified in the *Equipment* tab, which was air in the case of the
profile above. The gas mixtures of segments of the dive profile can
be changed by right-clicking on the particular
waypoint and selecting the appropriate gas from the context menu. Changing
the gas for a waypoint affects the gas shown in the segment _to the right_ of
that
waypoint. Note that only the gases defined in the *Equipment* tab appear in the
context menu (see image below).

image::images/DiveProfile3_f20.jpg["FIGURE: Gas composition context menu",align="center"]

With the profile now defined, more details must be added to have
a fuller record of the dive. To do this,
the *Notes* and the *Equipment* tabs on the top left hand of the
_Subsurface_ window should be used. Click on
xref:S_Notes_dc[*this link*] for instructions on how to use these tabs.
[[S_ImportDiveComputer]]
=== Importing new dive information from a Dive Computer

==== Connecting and importing data from a dive computer.

The use of dive computers allows the collection of a large amount of
information about
each dive, e.g. a detailed record of depth, duration, rates of ascent/descent
and of gas partial pressures. _Subsurface_ can capture this information,
using dive details from a wide range of dive computers. The latest list of supported
dive computers can be found at:
link:https://subsurface-divelog.org/documentation/supported-dive-computers/[
Supported dive computers].

[icon="images/icons/warning2.png"]
[WARNING]
Several dive computers consume more power when they are in
PC-Communication mode. **This could drain the dive computer's battery**. We
recommend the user checks to be sure the dive computer is charged when
connected to the USB port of a PC. For example, several Suunto and Mares dive
computers do not recharge through the USB connection. Users should refer to
the dive computer's manual
if they are unsure whether the dive computer recharges its batteries
while connected to the USB port.

To import dive information from a dive computer to a computer with
_Subsurface_,
the two pieces of equipment must communicate with one another.
This
involves setting up the communications port (or mount point) of the computer
with _Subsurface_ that communicates with the dive computer. To set up
this communication, users need to find the appropriate information to
instruct
_Subsurface_ where and how to import the dive information.
xref:_appendix_a_operating_system_specific_information_for_importing_dive_information_from_a_dive_computer[Appendix A]
provides the technical information to help the user achieve this for different
operating
systems and
xref:_appendix_b_dive_computer_specific_information_for_importing_dive_information[Appendix B]
has dive computer specific information.

After this, the dive computer can be hooked up to the user's PC using these steps:

1. The interface cable should be connected to a free USB port (or the Infra-red
	or Bluetooth connection set up as described later in this manual)

2. The dive computer should be placed into PC Communication mode.
	(Refer to the manual of the specific dive computer)

3. In _Subsurface_, from the Main Menu, select _Import ->  Import
   From Dive Computer_.
   dialog *A* in the figure below appears:


image::images/DC_import_f20.jpg["FIGURE: Download dialog 1",align="center"]

Dive computers tend to keep a certain number of dives in memory, even
though these dives have already been imported to _Subsurface_. For that reason, if
the dive computer allows this,
_Subsurface_ only imports dives that have not been downloaded before. This makes
the download process faster on most dive computers and also saves battery power
of the dive computer (at least for those not charging while connected via USB).

 - The dialog has two drop-down lists, *Vendor* and *Dive Computer*. On the
   *vendor* drop-down list select the make of the computer, e.g.
   Suunto, Oceanic,
   Uwatec, Mares. On the *Dive Computer* drop-down list, the model name of
   the dive computer must be selected, e.g. D4 (Suunto), Veo200 (Oceanic), or Puck
   (Mares).

 - The *Device or Mount Point* drop-down list contains the USB or Bluetooth port
   name that _Subsurface_ needs in order to communicate with the dive computer.
   The appropriate port name must be selected. Consult
   xref:_appendix_a_operating_system_specific_information_for_importing_dive_information_from_a_dive_computer[Appendix A]
   and
   xref:_appendix_b_dive_computer_specific_information_for_importing_dive_information[Appendix B]
   for technical details on how to find the appropriate port information for a
   specific dive
   computer and, in some cases, how to do the correct settings to the operating
   system of the computer on which _Subsurface_ is running.
   Some dive computers disable this drop-down as they use other means to find and
   connect to the device. For some dive computers the data entered here is actually
   the mount point of the USB storage device as which the dive computer identifies
   itself.

 - Below the three drop downs are up to four shortcut buttons that allow you to
   easily switch between multiple dive computers that you are frequently downloading
   from. These buttons only appear once you have downloaded from different dive
   computers.

 - If all the dives on the dive computer need to be downloaded, check the
   checkbox _Force download of all dives_. Normally, _Subsurface_ only downloads
   dives after the date-time of the last dive in the *Dive List* panel. If one
   or more of your dives in _Subsurface_ has been accidentally deleted or if there
   are older dives that still need to be downloaded from the dive computer, this
   box needs to be checked. Some dive computers (e.g. Mares Puck) do not provide
   a contents list to _Subsurface_ before the download in order to select only new dives.
   Consequently, for these dive computers, all dives are downloaded
   irrespective of the status of this check box.

 - If the checkbox _Always prefer downloaded dives_
   has been checked and, during download, dives with identical date-times exist on
   the dive computer and on the _Subsurface_
   *Dive List* panel, the dive in the _Subsurface_ divelog will be overwritten
   by the dive record from the computer.

 - The checkbox marked _Download into new trip_ ensures that, after upload, the downloaded dives
   are grouped together as a new trip(s) in the *Dive List*.

 - Do *not* check the checkboxes labelled _Save libdivecomputer logfile_ and
   _Save libdivecomputer dumpfile_. These are only used as diagnostic tools
   when there are problems with downloads(see below).
 - Then select the _Download_ button.
   With communication established, you can see how the data are
   retrieved from the dive computer.
   Depending on the make of the dive computer and/or number of recorded dives, this
   could take some time. Be patient. The _Download_ dialog
   shows a
   progress bar at the bottom of the dialog. Remember for some dive computers
   progress information could be inaccurate since _Subsurface_ doesn’t know how much
   downloadable data there are until the download is complete.
   After the dives have been downloaded, they appear in a tabular format on the right-hand
   side of the dialog (see image *B*, above). Each dive comprises a row in the table, showing the date, duration
   and depth. Next to each dive is a checkbox: check all the dives that need to
   be transferred to the *Dive List*. In the case of the image above, the last six dives are
   checked and will be transferred to the *Dive List*. Then
   click the _OK_ button at the bottom of the dialog. All the imported dives appear
   in the *Dive List*, sorted by date and time. Disconnect and
   switch off the dive
   computer to conserve its battery power.

 - If there is a problem in communicating with the dive computer, an error
   message is shown, similar to this text: "Unable to open /dev/ttyUSB0 Mares
   (Puck Pro)". Refer to the text in the box below.


****
*PROBLEMS WITH DATA DOWNLOAD FROM A DIVE COMPUTER?*
[icon="images/icons/important.png"]
[IMPORTANT]
Check the following:

 - Is the dive computer still in PC-communication or
   Upload mode?

 - Is the dive computer’s battery fully charged? If not then charge or replace it.

 - Is the connecting cable faulty? Does the cable work using other
   software? Has it worked before, or is this the first time the cable is being used? Are the contacts
   on the dive computer and the cable clean?

 - Consult
   xref:_appendix_a_operating_system_specific_information_for_importing_dive_information_from_a_dive_computer[Appendix A]
   to be sure the correct Mount Point
   was specified (see above).

 - On Unix-like operating systems, does the user have write permission to the
   USB port? If not, consult
   xref:_appendix_a_operating_system_specific_information_for_importing_dive_information_from_a_dive_computer[Appendix A]

If the _Subsurface_ computer does not recognize the USB adapter by
showing an appropriate device name next to the Mount Point, then there is a
possibility the cable or USB adapter is faulty. A faulty cable is the most
common cause of communication failure between a dive computer and _Subsurface_.
It’s also possible _Subsurface_ cannot interpret
the data. Perform a download for diagnostic purposes with the following
two boxes checked in the download dialog discussed above:

	Save libdivecomputer logfile
	Save libdivecomputer dumpfile

*Important*: These check boxes are only used when problems are encountered
during the download process. Under normal circumstances they should not be checked.
When checking these boxes, the user is prompted to select a folder where the information will be saved. The default folder is the one in which the
_Subsurface_
dive log is kept.

*Important:* _After downloading with the above checkboxes
checked, no dives are added to the
*Dive List* but two files are created in the folder selected above_:

	subsurface.log
	subsurface.bin

These files should be send to the _Subsurface_ mail list:
_subsurface@subsurface-divelog.org_ with a
request for the files to be analyzed. Provide the dive computer
make and model
as well as contextual information about the dives recorded on the dive computer.
****

[[S_Bluetooth]]
==== Connecting _Subsurface_ to a Bluetooth-enabled dive computer
[icon="images/icons/bluetooth.jpg"]

Bluetooth is becoming a more common way of communication between dive computers
and _Subsurface_. _Subsurface_ provides a largely operating system independent
Bluetooth interface. An increasing number of dive computers use Bluetooth Low Energy (BTLE)
as a means of communication. However, BTLE is not a standardised protocol,
consequently adaptations need to be made for communicating with each different dive computer model. See the
link:https://subsurface-divelog.org/documentation/supported-dive-computers/[list of supported dive computers].
Bluetooth communication is often more reliable if all Bluetooth devices seen by the
_Subsurface_ computer are removed and pairing with the Bluetooth dive computer
is performed from afresh. The Bluetooth and BTLE interfaces are under active development
with respect to new dive computers that use this mechanism of communication.

Setting up _Subsurface_ for Bluetooth communication requires
four steps:

- Ensure Bluetooth is activated on the host computer running _Subsurface_.
- Ensure _Subsurface_ sees the Bluetooth adapter on the host computer.
- Ensure the Bluetooth-enabled dive computer is Bluetooth-discoverable and in PC upload mode.
- Ensure _Subsurface_ is paired with the Bluetooth-enabled dive computer.

Select the Download dialog by selecting
_Import -> Import from dive computer_ from the *Main Menu*. After checking the
box labelled _"Choose Bluetooth download mode"_, the dialog below appears.

===== On Linux or MacOS:

image::images/DC_import_Bluetooth.jpg["FIGURE: Download Bluetooth",align="center"]

Although the _Subsurface_ Bluetooth interface is intended to function without
Bluetooth pairing at the operating system level, it is always prudent to follow up
initial Bluetooth pairing problems by pairing the Bluetooth dive computer with
the _Subsurface_ computer using the operating system services of the desktop computer. Delete all
existing pairings and start by scanning for Bluetooth devices from an empty list
(on the desktop) of Bluetooth devices. Once _Subsurface_ has recognised the Bluetooth dive
computer, subsequent divelog downloads are likely to be simple.

On the _Linux_ or _MacOS_ platforms the name
of the _Subsurface_ computer and its Bluetooth address are shown on the right hand side.
The power state (on/off) of the Bluetooth adapter is shown below
the address and can be changed by checking the _Turn on/off_ box.
If the Bluetooth address is not shown, then _Subsurface_ does not see the local
Bluetooth device. Ensure the Bluetooth driver is installed correctly on the
_Subsurface_ computer and check if it can be used by other Bluetooth utilities like
_bluetoothctl_ or _bluemoon_. This completes the first two steps above.
Ensure the Bluetooth-enabled dive computer is in PC-upload mode and it
is discoverable by other Bluetooth devices. Consult the manual of the dive
computer for more information. Now the third item in the list above has been finished.
Select the _Scan_ button towards the bottom left of the dialog above. After
searching, the dive computer should be listed
(perhaps as one of a number of Bluetooth devices) in the main list box on the
lefthand side of the dialog (see image above). If this does not work, select
the _Clear_ button, then scan again for Bluetooth devices using the _Scan_
button. After taking these actions _Subsurface_ should see the dive computer.
On the left hand side, if the
computer has more than one local Bluetooth devices connected, use
the list box to indicate which one needs to connect to _Subsurface_.
The label of the discovered dive computer contains the name of the device, its
address and its pairing status. For BTLE devices the address often starts with "LE".
If the device is not paired and has a red
background color, a context menu can be opened by selecting the item with a
right-click.
Select the _Pair_ option and wait for the task to complete. If this dive computer
is being paired to Subsurface for the first time, it’s possible Subsurface will
request a Pass Code or PIN number. The most commonly-used Pass Code is 0000,
and this works for the Shearwater Petrel. If necessary, consult the user manual of the
dive computer being used.

****
[icon="images/icons/important.png"]
[IMPORTANT]
Currently _Subsurface_ does not support Bluetooth pairing with dive
computers that require a custom PIN code. In order to pair the devices, use other
OS utilities as suggested below.

One way to achieve this is to use +bluetoothctl+:

	$ bluetoothctl
	[bluetooth]# agent KeyboardOnly
	Agent registered
	[bluetooth]# default-agent
	Default agent request successful
	[bluetooth]# pair 00:80:25:49:6C:E3
	Attempting to pair with 00:80:25:49:6C:E3
	[CHG] Device 00:80:25:49:6C:E3 Connected: yes
	Request PIN code
	[agent] Enter PIN code: 0000
****

After the devices are paired, press the _Save_ button of the dialog.
This closes the Bluetooth dialog. Now select _Download_ in the _Download from
dive computer_ dialog which should still be open. The downloaded dives are
shown on the righthand side of the download dialog.

===== On Windows:
image::images/DC_import_Bluetooth_Windows.png["FIGURE: Download Bluetooth on Windows",align="center"]

On _Windows_ platforms the _Local Bluetooth device details section_ on the right is not displayed as
is the case on the Linux/Mac systems.
To start a scan (by pressing the _Scan_ button)
check that the Bluetooth device on the _Subsurface_ computer is turned on by selecting
the dive computer from the list of available Bluetooth devices (see image above). If the dive computer
is being accessed by Subsurface for the first time, it’s possible Subsurface will
request a Pass Code or PIN number. Supply the Pass Code recommended in the user manual of the dive computer.
A Pass Code or PIN of 0000 is often the default.

The pairing step is checked and done automatically during
the download process. If the devices have never been paired the system will ask
permission and put a message on the right side of the screen: _Add a
device, Tap to set up your DC device_. Always allow this pairing. After a
discovered item is selected, select the _Save_ button.
Finally select the _Download_ button on the _Download_ dialog and wait for the process to complete.

[icon="images/icons/important.png"]
[IMPORTANT]
Currently _Subsurface_ works only with local Bluetooth
adapters which use Microsoft Bluetooth Stack. If the local device uses
_Widcomm_,  _Stonestreet One Bluetopia Bluetooth_ or _BlueSoleil_ drivers it
will not work. However, Bluetooth hardware/dongles from these manufacturers
(e.g. iSonic) that support the Microsoft Bluetooth Stack do work.

A log message on the bottom left of the _Remote Bluetooth device selection_
shows details about the current status of the Bluetooth agent. To
select another dive computer for download using the "Remote Bluetooth selection dialog"
press the three-dots button from the _"Choose Bluetooth download mode"_ option.

[icon="images/icons/important.png"]
[IMPORTANT]
The Subsurface support for BLTE dive computers on Windows is *EXPERIMENTAL* and only
supported on Windows 10.
Please make sure that you have the latest version of Windows 10.
link:https://en.wikipedia.org/wiki/Windows_10_version_history#Version_1803_(April_2018_Update)[Version 1803] is a minimum
requirement. Also make sure that you have installed the latest drivers for your
motherboard and/or BTLE dongle.

[icon="images/icons/important.png"]
[IMPORTANT]

*IN CASE OF PROBLEMS*:  If the Bluetooth adapter from the _Subsurface_ computer
gets stuck and the _Download_ process fails repeatedly,
 _unpair_ the devices and then repeat the above steps. If this is not successful,
 xref:S_HowFindBluetoothDeviceName[_Appendix A_] contains
information for manually setting up and inspecting the Bluetooth connection
with _Subsurface_.

[[S_DeviceNames]]
==== Changing the name of a dive computer

It may be necessary to distinguish between different dive computers used to
upload dive logs to _Subsurface_. For instance if a buddy’s dive computer is the
same make and model as your own and dive logs are uploaded from both dive computers
to the same _Subsurface_ computer, then
you might like to call one "Alice's Suunto D4" and the other
"Bob's Suunto D4". Alternatively, consider a technical diver who dives with two or more
dive computers of the same model, the logs of both (or all) being uploaded.
In this case it might be prudent to call one of them
"Suunto D4 (1)" and another "Suunto D4 (2)". This is easily done in _Subsurface_.
On the *Main Menu*, select _Log ->  Edit device names_. A dialog box opens, showing the
current Model, ID and Nickname of the dive computers used for upload. Edit the Nickname
field for the appropriate dive computer. After saving the Nickname, the dive logs
show the nickname for that particular device instead of the model name,
allowing easy identification of devices.

[[S_MultipleDiveComputers]]
==== Uploading data for a specific dive from more than one dive computer

Some divers use more than one dive computer at the same time, e.g. during technical diving.
If you import the dive profiles from these different dive computers into _Subsurface_, the
profiles can be viewed independently. During upload the data from the dive computers are automatically
merged into a single dive. The different profiles are presented on the _Profile_ panel with
the name of each dive computer indicated at the bottom left.
*While the dive is highlighted in the _Dive List_*, switch between the profiles of the
different dive computers by using either the left/right arrow keyboard keys or
by selecting _View -> Previous DC_ or _View -> Next DC_. The data in the _Notes_ panel
are not affected by the specific dive computer that is selected.

[[S_EditDiveInfo]]
==== Updating the dive information imported from the dive computer.

With the uploaded dives in the *Dive List*, the information from the dive
computer is not complete and more details must be added to have
a full record of the dives. To do this,
the *Notes* and the *Equipment* tabs on the top left hand of the
_Subsurface_ window should be used.

[[S_Notes_dc]]
===== Notes

To have a more complete dive record, the user needs to add
additional information by hand. The procedure
below is virtually identical for hand-entered dives and for dives downloaded from a dive computer.

In some cases,
you must provide the date and time of the dive, for example when entering a dive by hand or when a
dive computer doesn’t provide the date and time of the dive.
(Usually the date and time of the dive, gas mixture and water temperature are
shown as obtained from the dive computer)
If the contents of the *Notes tab* is changed or edited in any way, the message in a blue box at
the top of the panel shows the dive is being edited. If you
click on the *Notes* tab, the following fields are
visible (left hand image, below):

image::images/AddDive3_f22.jpg["FIGURE: The Notes tab",align="center"]

The right hand image, above, shows a *Notes tab* filled with dive information.
The *Date* and *Time* fields reflects the date and time of the dive. By clicking
the date, a calendar is displayed for selecting
the correct date. Press ESC to close the calendar.
The time values (hour and minutes) can also be
edited directly by clicking on each of them in the text box and by over-typing the
information displayed.

*Air/water temperatures*: Air and water temperatures during the dive are shown
in text boxes to the right of the Start time. Many dive computers supply water
temperature information and this box may have information.
If air temperature isn’t provided by the dive computer, the first temperature reading
might be used for the air temperature. Generally this is close to the real air temperature.
If editing is required, only a value is required, the units of temperature will be
automatically supplied by
_Subsurface_ (following the _Preferences_, metric or imperial units will
be used).

[[S_locations]]
*Location*:
[icon="images/icons/warning2.png"]
[WARNING]
Dive locations are managed as a *separate* part of the dive log (See the section entitled xref:S_DiveSiteManagement[Manipulating Dive Site Information]).
The dive information in the *Notes* and *Equipment* tabs can therefore NOT be edited at the same
time as the dive site information. Save all the other dive information (e.g.
divemaster, buddy, protective gear, notes about the dive) by selecting _Apply changes_ on the
*Notes* tab BEFORE editing the dive site information. Then supply a dive site name in the
textbox labelled _Location_ on the *Notes* tab. 

*Using existing dive locations:* Type in the name of the dive site, e.g. "Tihany, Lake Balaton, Hungary".
If several dives are
made at the same location, the site information for the first dive is re-used.
Therefore, if a dive site has been used before, the name of that site (and sometimes
the names of similar sites) appears below the dive site text box (image below). Double-click on
the appropriate dive site name and the dive location will be associated with the
dive being entered. Then select _Apply Changes_ (image below) to save the geolocation for this dive site.

image::images/Location1.jpg["FIGURE:Location choice panel",align="center"]

*Entering a new dive location:* On the other hand, having dived at a new dive location,
a new record needs to be created
that could be used for the new and for later dives at this new site. Type the name of the new dive site into the text box
(image A below).

image::images/Globe_image1.jpg["FIGURE:Location creation panel",align="center"]

Double-click on the blue bar below the new dive location name. The blue bar disappears (image B above) and
the globe icon on the right-hand of the location name text box turns blue.  In the Dive Map part of the _Subsurface_ window, a world map appears (image C above). Click on the
blue globe icon to the right of the dive site name in the _Notes_ panel (image B above). This opens a window for entering the details of the new dive location (image A below).
The globe icon changes to indicate that the location data are being edited. The only important
data here are the geographic coordinates of the dive location.

image::images/Globe_image2.jpg["FIGURE:Location creation panel",align="center"]

There are three ways of adding the coordinates:

*(1):* Enter coordinates by hand if they are known, using one of
   four formats with latitude followed by longitude:

	ISO 6709 Annex D format e.g. 30°13'28.9"N 30°49'1.5"E
	Degrees and decimal minutes, e.g. N30° 13.49760' , E30° 49.30788'
	Degrees minutes seconds, e.g. N30° 13' 29.8" , E30° 49' 1.5"
	Decimal degrees, e.g. 30.22496 , 30.821798

Southern hemisphere latitudes are given with a *S*, e.g. S30°, or with a
negative value, e.g. -30.22496. Similarly western longitudes are given with a
*W*, e.g. W07°, or with a negative value, e.g. -7.34323. Some keyboards
don't have the degree sign (°). It can be replaced by a *d* like this: N30d W20d.
Enter any other contextual information about the dive site (Description and Notes),
then select _Apply Changes_ to save the geolocation for this dive site.
The dive site information can later be edited by clicking the globe icon to the right of the
dive site name in the *Notes tab*.

*(2):* Use the Dive Map to specify the coordinates. The Dive map now shows
all the existing dive locations in grey as well as an additional marker in red
(image B above). Drag the red marker to the location of the dive site being entered.
The map can be dragged and zoomed using the mouse wheel. Position the red marker
by dragging it on the map, zooming in on the appropriate part of the map and placing
the marker at an appropriate position (image B below). The coordinates of the dive
location are automatically inserted into the appropriate text box in the dive location
information window (image A below). Enter any other contextual information about the dive site (Description and Notes),
then select _Apply Changes_ to save the geolocation for this dive site.
The dive site information can later be edited by clicking the globe icon to the right of the
dive site name in the *Notes tab*.

image::images/Globe_image3.jpg["FIGURE:Location creation panel",align="center"]

Once the dive location data have been saved, the dive on the Dive List has
a globe icon immediately to the left of the location name of a particular dive.

*(3):* Obtain the coordinates using the _Subsurface-mobile_ App on an
   Android or iPhone device with GPS and if the dive site coordinates
   were stored using one of this app.

[icon="images/icons/warning2.png"]
[WARNING]
GPS coordinates of a dive site are linked to the location
name - so *saving* a dive site with only coordinates and no name
causes problems. (Subsurface will think all of these
dives have the same location and try to keep their GPS coordinates the
same).

*Dive site name lookup:* If you typed coordinates into the appropriate
text box, you can do an automated name lookup based on the coordinates.
This is done when _Subsurface_ uses the Internet to find the name of the dive site
based on the coordinates that were given. If a name has been found, it is
automatically inserted into the tags box. The list box
(Titled _Dive sites on same coordinates_") at the bottom
of the dive site panel contains the names of other dives sites used at the
current location. For instance if the dive site is "Blue Hole" and there are several
sites named "Blue Hole", all of them are listed.

Enter any other contextual information about the dive site (Description and Notes),
then select _Apply Changes_ to save the geolocation for this dive site.
The dive site information can later be edited by clicking the globe icon to the right of the
dive site name in the *Notes tab*.

*Dive mode*: This is a dropdown box allowing you to choose the type of dive
performed. The options are OC (Open Circuit SCUBA, the default setting, for most recreational dives),
Freedive (dive without SCUBA equipment), CCR (Closed-circuit
rebreather) and pSCR (Passive semi-closed rebreather).

*Divemaster*: The name of the divemaster or dive guide should be
entered in this field
which offers auto selection based on the list of divemasters in
the current logbook.

*Buddy*: In this field, enter the name(s) of the buddy or buddies
(separated with commas) who were on the
dive. Auto selection based on the list of buddies in the current logbook is
offered.

*Suit*: Here the type of dive suit used can be entered.
Auto selection of the suit description is available.
Some dry-suit users may choose to use this field to record what combination of
suit and thermal under suit was used.

*Rating*: Provide a subjective overall rating of the dive on a
5-point scale by clicking the appropriate star on the rating scale.

*Visibility*: Provide a rating of visibility during the
dive on a 5-point scale by clicking the appropriate star.

*Tags*: Tags that describe the type of dive done can be entered
here (separated by commas). Examples of common tags are boat, drift, training,
cave, etc.
_Subsurface_ has many built-in tags. By starting to type a tag, _Subsurface_ lists
the tags that correspond to the typing. For instance, by typing
+cav+, the tags *cave* and *cavern* are shown to choose from.

*Notes*: Any additional information for the dive can be entered here.

The _Apply changes_ and _Discard changes_ buttons are used to save all the information for tabs
in the *Info* panel and in the *Dive Profile* panel. Use them
when *ALL* other information has been added. The image xref:S_Notes_dc[at the beginning of this section]
shows an example of a *Notes tab* after completing the dive information.

===== Equipment

The Equipment tab allow entering information about the type of
cylinder and gas used, as well as the weights used for the dive. The
message in the blue box at the top of the panel:

image::images/BlueEditBar_f22.jpg["FIGURE: Blue edit bar",align="center"]

shows the equipment is being edited. This is a highly interactive part of
_Subsurface_ and the information on
cylinders and gases (entered here) determines the behavior of the *Dive profile*
(top right-hand panel).

[[cylinder_definitions]]
*Cylinders*: The cylinder information is entered through a dialog that looks
like this:

image::images/DC_gas-dialogue1_f20.jpg["FIGURE: Initial cylinder dialog",align="center"]

For hand-entered dives, this information needs to be typed in. For dive computers,
_Subsurface_ often gets the gas used from the dive computer and
automatically inserts the gas composition(% oxygen or % helium) in the table. The + button
at the top right allows adding more cylinders for this dive. The dark
dustbin icon on the left allows you to delete information for a cylinder.
Note that it is not possible to delete a cylinder if it is used during the
dive. A cylinder might be implicitly used in the dive, even without a gas change event.
Start by selecting a cylinder type on the left-hand side of the
table.  To select a cylinder, the _Type_ box should be clicked. This
brings up a list button that can be used to display a dropdown list of
cylinders:

image::images/DC_gas-dialogue2_f20.jpg["FIGURE: The cylinder drop-down list button",align="center"]

The drop-down list can then be used to select the cylinder type that was used
for this dive, or just start typing in the box which shows the available
options for the entered characters. The
*Size* of the cylinder as well as its working pressure (_Work.press_) will
automatically be shown in the dialog.

Next, indicate the starting pressure and the ending pressure of the
specified gas during the dive. The unit of pressure (metric/imperial)
corresponds to the settings chosen in the _Preferences_.

Finally, provide the gas mixture used. If air was used, the
value of 21%  can be entered into the oxygen box or this field can be left blank. If nitrox or
trimix were used, their percentages of oxygen and/or helium should be entered.
Any inappropriate fields should be left empty. After typing the
information for the cylinder, save the data
either by pressing _ENTER_ on the keyboard or by clicking outside the cell
containing
the cursor. Information for any additional cylinders can be added by using the + button
at the top right hand. Here is an example of a complete description
for a dive using two cylinders (air and EAN50):

image::images/CylinderDataEntry3_f20.jpg["FIGURE: a completed cylinder dive information table",align="center"]

*Weights*: Information about the weight system used can be entered
using a dialog similar to that of the cylinder information. If you click
the + button on the top right of the weights dialog, the table looks like
this:

image::images/WeightsDataEntry1_f20.jpg["FIGURE:The Weights dialog",align="center"]

By clicking on the _Type_ field, a drop-down list becomes accessible through a
down-arrow:

image::images/WeightsDataEntry2_f20.jpg["FIGURE:Weights type drop-down list button",align="center"]
This can be used to select the type of weight system
used during the dive. You may start typing in the box
to specify a different weighting mechanism that will be saved by _Subsurface_.
In the *Weight*
field, type in the amount of weight used during the dive. After
specifying the weight
system, save the data by pressing _ENTER_ on the keyboard or by clicking outside the
cell with the cursor.
It’s possible to enter information for more than one weight system by adding
an additional system
using the + button on the top right hand. Weight systems can be deleted using
the dust bin icon on the left hand. Here is an example of information for a dive
with two types of weights: integrated as well as a weight belt:

image::images/WeightsDataEntry3_f20.jpg["FIGURE: A completed weights information table",align="center"]

==== Editing several selected dives simultaneously

_METHOD 1_: After downloading dives from
a dive computer, the dive profiles of each is shown in the *Dive profile* tab, as well
as a few items of information
in the *Notes* tab (e.g. water temperature) and in the *Equipment* tab (e.g. gas pressures
and gas composition). Other fields remain empty.
It may be useful to simultaneously edit some of the
fields in the *Notes* and *Equipment* tabs.  For instance, it’s possible
that a diver performed several dives during a single day, using identical equipment at the same
dive site, or with the same divemaster and/or buddy or tags. Instead
of completing the information for each
dive separately, select all the dives for that day in the *Dive List* and
insert the same information in the *Notes* and *Equipment* fields that need
identical information. This is done by editing the dive notes or the equipment for any one
of the selected dives.

Simultaneous editing only works with fields that do not already contain information.
This means if some fields have been edited for a particular dive among the selected dives,
these are not changed while
editing the dives simultaneously. Technically, the rule for editing several dives simultaneously is:
if the data field being edited contains _exactly the same information_ for all the dives that have been
selected, the new, edited information is substituted for all the selected dives. Otherwise only the
edited dive is
changed, even though several dives have been selected in the *Dive List*. This speeds
up the completion of the dive log after several similar dives.

[[S_CopyComponents]]
_METHOD 2_:There is a different way of achieving the same goal. Select a dive with all the appropriate information
typed into the *Notes* and *Equipment* tabs. Then, from the main menu, select _Log ->  Copy dive components_.
A box is presented with a selection of check boxes for most of the fields in the *Notes* and *Equipment* tabs.
Select the fields to be copied from the currently selected dive, then select _OK_. Now, in the *Dive List*,
select the dives
into which this information is to be pasted. Then, from the main menu, select _Log ->  Paste dive components_.
All the selected dives now contain the data initially selected in the original source dive log.

[[S_Bookmarks]]
==== Adding Bookmarks to a dive

Many divers wish to annotate dives with text that indicate particular events,
e.g. "Saw dolphins", or "Released surface buoy". This is easily
done:

 - Right-click at the appropriate point on the dive profile.
   This brings up the dive profile context menu. Select _Add bookmark_. A red flag is
   placed on the dive profile at that point (see *A* below).

 - Right-click on the red flag. This brings up the context menu (see *B* below). Select _Edit name_.

 - A text box is shown. Type the explanatory text for the bookmark (see *C* below). Select _OK_.
   This saves the text associated with the bookmark.

 - Hovering the mouse over the red bookmark, the appropriate text is shown at
   the bottom of the information box (see *D* below).

image::images/Bookmarks.jpg["FIGURE: Bookmark dialog",align="center"]


==== Saving the updated dive information

The information entered in the *Notes* tab and the *Equipment* tab can be
saved by using the
two buttons on the top right hand of the *Notes* tab. If the _Apply changes_ button
is clicked,
the dive data are saved in the memory image of the dive. If the _Discard changes_
button is clicked, the newly entered dive data are
erased from the computer memory, although the dive profile is
retained. When the user exits _Subsurface_ there is a final prompt to confirm
the new data should now be saved permanently on the computer disk.

=== Importing dive information from other digital data sources or other data formats

[[S_ImportingAlienDiveLogs]]

Many divers log their dives using the proprietary software provided by the
manufacturers of their dive computers.  _Subsurface_ can import dive logs from a range of
other dive log software. While import from some software is supported natively,
others require
export of the dive log to an intermediate format that can then be imported
into _Subsurface_.
Currently, _Subsurface_ supports importing CSV log files from several sources.
Dive log import from APD LogViewer, XP5, Sensus and Seabear files are
preconfigured, but because the import is flexible, users can configure their own
imports.
Manually kept log files (e.g. a spreadsheet) can also be imported by
configuring the CSV import.
_Subsurface_ can also import UDDF and UDCF files used by some dive log
software and some dive computers, like the Heinrichs & Weikamp DR5. Finally,
for some dive log software like Mares Dive Organizer we currently recommend
importing the logbook first into a web service like _divelogs.de_ and then import
from there with
_Subsurface_. Divelogs.de supports a few additional logbook formats that
_Subsurface_ currently cannot handle.

If the format of other software is supported natively on Subsurface, select
either _Import ->  Import log files_ or _File ->  Open log file_. Notice that
the import adds the imported data to the current *Dive list*, and the open style
starts a new dive list. _Subsurface_ supports the data formats
of many dive computers, including Suunto, Shearwater and some CCR equipment. When importing dives, _Subsurface_
tries to detect multiple records for
the same dive and merges the information as best as it can. If
there are no time zone issues (or other reasons that would cause the
beginning time of the dives to be significantly different) _Subsurface_
will not create duplicate entries. Below is more specific information
to import data to _Subsurface_.

==== Using the universal import dialog
[[Unified_import]]

Importing dives from other software is done through a universal interface
activated by selecting _Import_ from the Main Menu, then clicking on
_Import Log Files_ to bring up dialog *A*, below. The exact appearance
of this dialog differs between operating systems.

image::images/Import1_f20.jpg["FIGURE: Import dialog: step 1",align="center"]

Towards the bottom right is a dropdown selector with a default label
of _Dive Log Files_ which accesses different types of direct imports
available, as in dialog *B*, above. Currently these are:

 - XML-formatted dive logs (DivingLog 5.0, MacDive and several other dive log systems)
 - Cochran dive logs
 - UDDF-formatted dive logs (e.g. Kenozooid)
 - UDCF-formatted dive logs
 - Poseidon MkVI CCR logs
 - APD Inspiration/Evolution CCR logs
 - LiquiVision logs
 - divelogs.de logs
 - OSTC Tools logs
 - JDiveLog
 - Suunto Dive Manager (DM3, DM4, DM5)
 - DL7 files used by Diver's Alert network (DAN)
 - Underwater technologies AV1 dive logs
 - Divesoft dive logs
 - Poseidon MK VI eCCR dive logs
 - CSV (text-based and spreadsheet-based) dive logs, including APD CCR logs

Selecting the appropriate format from the dropdown list and then the specific log file in the main window
containing the file list. Then select the _Open_ button near the bottom right. 

If the dive log being imported is in CSV format, the user is given the
opportunity to perform manual edits to the column headers before it is imported
to _Subsurface_ (see image below).

image::images/Import_csv.jpg["FIGURE: Import dialog: step 2",align="center"]

For more information on configuring a CSV import, see
xref:S_ImportingCSVDives[Importing data in CSV format].
In many cases changes to the column headers are not required because
they are pre-configured for the specific type of import and
the CSV import screen can be bypassed by selecting the _OK_ button.
This opens the imported dive log in the _Subsurface_ *Dive List*. 

Some other formats not accessible through the Import dialog are also supported, as explained below.

==== Importing from  OSTCTools

_OSTC Tools_ is a Microsoft-based suite of dive download and dive management tools for the OSTC
family of dive computers. _OSTC Tools_ downloads dive data from the dive computer and stores it
as a binary file with file extension _.dive_ . Subsurface can directly import these files when using
the universal import dialog. From the dropdown list at the bottom right select
_OSTCTools Files (.dive .DIVE)_. This makes the _OSTC Tools_ dive logs visible in the file list
panel. Select one or more dive, then click the _Open_ button. The OSTC dives are shown in the
*Dive List* panel.

All H&W devices supported by OSTCTools can be imported to _Subsurface_. This includes
OSTC, OSTC Mk2, OSTC 2N/2C, OSTC3, OSTC Sport, and probably although untested, Frog, OSTC2 and
OSTC CR.

Please remember that OSTCTools is *not* true diving log software, but rather a useful set of tools
for analysis and management of OSTC devices. Only raw dive computer data will be
imported to _Subsurface_; the rest of the
data (buddies, equipment, notes, etc) need to be completed manually.

==== Importing from Mares Dive Organizer V2.1

Since Mares uses proprietary Windows software not compatible with
multi-platform applications, these dive logs cannot be
directly imported into
_Subsurface_. Mares dive logs need to be imported using a three-step process,
using _www.divelogs.de_ as a gateway to extract the dive log information.

1. Export the dive log data from Mares Dive Organizer to your
   desktop, using
   a _.sdf_ file name extension. Refer to xref:Mares_Export[Appendix C] for more
   information.
2. Data should then be imported into _www.divelogs.de_. First, create a user
   account in
   _www.divelogs.de_ and Log into that web site, then
   select _Import Logbook ->  Dive Organizer from the menu on the left hand side.
   The instructions must be carefully followed to transfer the dive information
   (in _.sdf_ format) from the Dive Organizer database to _www.divelogs.de_.
3. Finally,  import the dives
   from _divelogs.de_ to _Subsurface_, using the instructions below.


[[S_SmartTrakImport]]
==== Importing Scubapro _SmartTrak_ divelogs

_SmartTrak_ stores the raw data from a Uwatec/Scubapro dive computer along with a plethora
of other data manually added by the user, ranging from dive points to buddies data or DAN survey
info. However, this is Microsoft Windows-based proprietary software by Uwatec (today Scubapro)
using Microsoft Access databases, preventing the integration the importer into the _Subsurface_
core application.

A stand alone tool for Linux has been developed to import the _.slg_ files
generated by SmartTrak to Subsurface's _.xml_ format. It can be downloaded
from https://subsurface-divelog.org/downloads[the usual _Subsurface_ repository],
as a Windows installer or a Linux AppImage.
The application is not currently supported on Mac.

It can also be built for Linux systems. Two dependencies need to be met in your
system before building: _glib2.0_ and _mdbtools_ (see below).

In addition, a web service is available for divelog conversions from SmartTrak to _Subsurface_ (see below).

Feel free to contact the _Subsurface_ development team on mailto:subsurface@subsurface-divelog.org[our mailing list]
for assistance in importing _SmartTrak_ dive logs.

===== Building _smtk2ssrf_

Assuming the above dependencies
have been installed and the _Subsurface_ source tree is in the directory _~/src/subsurface_, then:

- Move to the source tree directory out of _Subsurface_ (e.g. ~/src)
- Run  " $ ./subsurface/scripts/smtk2ssrf-build.sh ", if every thing has gone
  fine, you will now have an executable named smtk2ssrf in
  ~/src/subsurface/smtk-import/build
- You can run it from this directory, copy it to another one, e.g. _~/bin_ or
  simply run "sudo make install", and the binary will be installed in
  /usr/local/bin (which is commonly included in every $PATH).
- The script has some options mostly useful for development purposes. If you
  think you may need them, please read comments on script header itself.
- *WARNING*: While building smtk2ssrf, a light version of _Subsurface_ is
  built (usable but lacking a lot of features). So, if you commonly use the
  built executable placed at ~/subsurface/build/, you will need to rebuild it as
  explained in this manual above.

===== Running

_smtk2ssrf_ accepts 0, 2 or more parameters. If it is launched without
parameters in a graphical user interface, a simple window
opens for choosing the _.slg_ file(s) to import and a destination file to store the
_Subsurface_-formatted data into (see image below).

image::images/smtk2ssrf.jpg["FIGURE:Download from SmartTrak",align="center"]

[icon="images/icons/warning2.png"]
[WARNING]
Existing data in the destination file will be
erased, so *DO NOT* use a regular subsurface divelog file as a destination:
rather, specify a *new* filename as a destination.

If launched from a command line with two or more parameters, the format is as follows:

	$ smrtk2ssrf /input/file_1.slg /input/file_2.slg /output/file3.xml

where _input_ is the directory containing the .slg file(s) and _output_ is the
directory where the _Subsurface_-formatted output is written to.
Files _file_1.slg_ and _file_2.slg_ in the _input_ directory are imported and stored
in _file3.xml_ in the _output_ directory. Check any warning and error messages
in the console or in the graphical window: some may be
relevant as support for Galileo family of dive computers is still a work in
progress.

===== For the lazy: a web service to convert _SmartTrak_ to _Subsurface_

Open the website at:

_https://thetheoreticaldiver.org/rch-cgi-bin/smtk2ssrf.pl_

This is a no-frills
web service for converting _SmartTrak_ dive logs to _Subsurface_. Select the browse button. This allows
you to browse your computer directories and to select the _SmartTrak_ divelog to be converted. Once it has been selected,
click the _Submit query_ button. After a short while, a dialog box appears (image below) for saving the converted file to
the local computer.

image::images/strk2ssrf_web.jpg["FIGURE:Web service to convert SmartTrak divelog",align="center"]

===== Merging the imported dives with the existing divelog

Open the new file (generated in the previous steps) using _Subsurface_ and check the dives and data.
If everything is fine, close the _.xml_ file and open your regular divelog.
Then from the *Main Menu* select _Import -> Import log file_ and choose the
_.xml_ file containing the imported dives: these will show in the *Dive List*, time
ordered, along with the existing dives.
The new dives, although time ordered, will keep the numbering system from
_SmartTrak_, so a renumbering action is needed. See the section on xref:S_Renumber[Renumbering
the dives] for instructions on this topic.

[[S_ImportingDivelogsDe]]
==== Importing dives from *divelogs.de*

Importing dive information from _divelogs.de_ is simple, using a single
dialog box. The _Import ->  Import from Divelogs.de_ option should be selected
from the Main Menu. This
brings up a dialog box (see image *A* below). Enter a
user-ID and password for _divelogs.de_  and then
select
the _Download_ button. Download from _divelogs.de_ starts immediately,
displaying a progress bar in the dialog box. At the end of the download, the
success status is shown (see image *B*, below). The
_Apply_ button should then be selected, after which the imported dives appear in the
_Subsurface_ *Dive List* panel.

image::images/Divelogs1.jpg["FIGURE:Download from Divelogs.de",align="center"]

[[S_ImportingCSVData]]
==== Importing data in CSV format

A comma-separated file (.csv) can be used to import dive information either as dive profiles
(as in the case of the APD Inspiration and Evolution closed circuit rebreathers) or as dive
metadata (in case the user keeps dive data in a spreadsheet). The _CSV_ format is a universal
simplified format that allows easy information exchange between different computers or
software packages. For an introduction to CSV-formatted files see xref:S_CSV_Intro[A Diver's
Introduction To CSV Files]. _Subsurface_ dive logs can also be exported in _CSV_ format to
other software that reads this format. See xref:S_Appendix_D[APPENDIX D: Exporting a spreadsheet
to CSV format] for information that may be helpful for importing spreadsheet-based data
into _Subsurface_.

[[S_ImportingCSVDives]]
===== Importing dives in CSV format from dive computers or other dive log software

_CSV_ files can be viewed using an ordinary text editor. A _CSV_ file is normally organized into
a single line that provides the headers (or _field names_ or _column headings_) of the data
columns, followed by the data, one record per line.

There are two types of _CSV_ dive logs that can be imported into _Subsurface_:

1. _CSV dive details_: This dive log format contains similar information to that of a
   typical written dive log, e.g. dive date and time, dive depth, dive duration, names of
   buddy and divemaster and information about cylinder pressures before and
   after the dive, as well as comments about the dive. All the data for a single
   dive go on a single line of text, following the order of the column headings.

2. _CSV dive profile_: This dive log format includes much more information about a single
   dive. For instance there may be information at 30-second intervals, indicating depth, water
   temperature, and cylinder pressure at that moment in time. Each line contains
   the information for a single instant in time during the dive, 30 seconds after that
   of the previous instant. Many lines
   are required to complete the depth profile information for a single dive. This is a common
   export format used by closed-circuit rebreather (CCR) dive equipment and many software
   packages that handle dive computer data and/or dive logs.

Before being able to import the _CSV_ data to _Subsurface_ *you need to know a few
things about the data being imported*:

a. Which character separates the different columns within a single line of
   data? This field separator should be either a comma (,) a semicolon (;) or a TAB character.
   This can be determined by opening the file with a text editor. If it is
   comma-delimited or semicolon-delimited, the comma or semicolon
   characters between the values are clearly visible. If these are not evident and
   the numbers are aligned in columns,
   the file is probably TAB-delimited (i.e. it uses a TAB as a field separator).

b. Which data columns need to be imported into _Subsurface_? Is it a _CSV dive details_
   file or a _CSV dive profile_ file? Open the file using a text editor and note
   the titles of the columns to be imported and their column positions.

c. Is the numeric information (e.g. dive depth) in metric or in imperial units?

With this information, importing the data into _Subsurface_ is
straightforward. Select
_Import ->  Import Log Files_ from the main menu. In the resulting file
selection menu, select _CSV files_ (towards the bottom right). This shows all .CSV files in the selected
directory. Select the file that needs to be imported. A configuration panel
appears as depicted below:

image::images/csv_import1_f20.jpg["FIGURE: CSV download dialog 1",align="center"]

At the top left, there is a dropdown list containing pre- configured
settings for common dive computers and software packages.
 If the _CSV_ file being imported originated from any of
these pre-configured items, select it. Otherwise use the _Manual Import_
option. The configuration panel also has dropdown lists for the specification of the appropriate
field separator (Tab, comma or semicolon), the date format used in the _CSV_ file,
the time units (seconds, minutes or minutes:seconds), as well as the unit system
(metric or imperial). Selecting the appropriate options among these is critical for
successful data import.

Complete this by ensuring that all the data columns have the appropriate
column headings. The top blue row of the data table contains the column
headings found in the _CSV_ data file. The blue row of balloons immediately above these
contains the names understood by _Subsurface_. These balloons can be moved using a drag-and-drop action. For
instance, _Subsurface_ expects the column heading for Dive number (" # ") to be "Dive # ". If
the column heading that _Subsurface_ expects is not in the blue row, drag the
appropriate balloon from the upper area and drop it in the appropriate blue
cell at the top of the table. For example, to indicate the correct column for "Dive #", drag
the ballooned item labelled "Dive # " and drop it in the blue
cell immediately above the white cell containing " # ", depicted in
the image below.

image::images/csv_import2_f20.jpg["FIGURE: CSV download dialog 2",align="center"]

Continue in this way to ensure all the column headings in the blue row of
cells correspond to the headings listed in the top part of the dialog.
When finished, select the _OK_ button on the bottom right of the dialog.
The data from the _CSV_ file are imported and shown in the *Dive List* panel.

[[S_CSV_Intro]]
****
*A Diver's Introduction to _CSV_ Files*
[icon="images/icons/important.png"]
[IMPORTANT]

_CSV_ is an abbreviation for a data file format: _Comma-Separated Values_. It is a
file format that allows you to view or edit information using a text editor like
Notepad (Windows), gedit (Linux) or TextWrangler (OS/X). There are two main advantages of
the _CSV_ format.  First, the data are easily editable as text without any proprietary software.
Second, all information is human-readable, not obscured by any custom or
proprietary attributes that proprietary software inserts into files.
Because of its simplicity the _CSV_ format is used
as an interchange format between many software packages, e.g. between
spreadsheet, statistical, graphics, database and diving software. Within _Subsurface_, _CSV_ files can also
be used to import information from other sources like spreadsheet-based dive logs and
some dive computers.

The most important attribute of a
_CSV_ file is the _field separator_, the character used to separate fields within a single line. The
field separator is frequently a comma, a colon, a SPACE character or a TAB character. When exporting data from
spreadsheet software, the field separator needs to be specified in order to create the _CSV_ file. _CSV_ files are
normally organized into a single line that provides the headers (or _field names_) of the data columns,
followed by the data, one record per line. Note that each field name
may comprise more than one word separated by spaces; for instance _Dive site_, below. Here is an example of
dive information for four dives using a comma as a field separator:

	Dive site,Dive date,Time,Dive_duration, Dive_depth,Dive buddy
	Illovo Beach,2012-11-23,10:45,46:15,18.4,John Smith
	Key Largo,2012-11-24,09:12,34:15,20.4,Jason McDonald
	Wismar Baltic,2012-12-01,10:13,35:27,15.4,Dieter Albrecht
	Pulau Weh,2012-12-20,09:46,55:56,38.6,Karaeng Bontonompo

The above data are not easily read by a human. Here is the same information in TAB-delimited format:

	Dive site      Dive date	Time	Dive_duration	Dive_depth	Dive buddy
	Illovo Beach   2012-11-23	10:45	46:15	18.4	John Smith
	Key Largo      2012-11-24	09:12	34:15	20.4	Jason McDonald
	Wismar Baltic  2012-12-01	10:13	35:27	15.4	Dieter Albrecht
	Pulau Weh      2012-12-20	09:46	55:56	38.6	Karaeng Bontonompo

It is clear why many people prefer the TAB-delimited format to the comma-delimited format. The
disadvantage is that you cannot see
the TAB characters. For instance, the space between _Dive_ and _date_ in the top line may be
a SPACE character or a TAB character (in this case it is a SPACE character: the tabs are before and
after _Dive date_). If the field names in the first line are long, the alignment with data in the other lines
cannot be maintained. Here is a highly simplified and shortened TAB-delimited example of a _CSV_ dive log
from an APD closed-circuit rebreather (CCR) dive computer:

	Dive Time (s)	Depth (m)	pO~2~ - Setpoint (Bar) 	pO~2~ - C1 Cell 1 (Bar)	Ambient temp. (Celsius)
	0       0.0     0.70    0.81    13.1
	0       1.2     0.70    0.71    13.1
	0       0.0     0.70    0.71    13.1
	0       1.2     0.70    0.71    13.2
	0       1.2     0.70    0.71    13.1
	10      1.6     0.70    0.72    12.7
	20      1.6     0.70    0.71    12.6
	30      1.7     0.70    0.71    12.6
	40      1.8     0.70    0.68    12.5

When a _CSV_ file is selected for import, _Subsurface_ displays the column headers as well as some of the data
in the first few lines of the _CSV_ file, making it much easier to work with _CSV_ files.
_CSV_ files can be used in many contexts for importing data into a _Subsurface_ dive log.
Knowing a few basic things about the content of the _CSV_ file helps with a smooth import
of the dives into _Subsurface_.

****

[icon="images/icons/important.png"]
[IMPORTANT]
But, the _CSV_ import has a couple of caveats. Avoid some special characters
like ampersand (&), less than (<), greater than (>) and double quotes (") as part
of the numbers or text within a cell. The
file should use UTF-8 character set, if using non-ASCII characters. Also the
size of the _CSV_ file might cause problems. Importing 100 dives at a time
(_CSV dive details_) works, but larger files might exceed
the limits of the parser used. When encountering problems with _CSV_ imports, first try with
a smaller file to make sure everything works.

[[S_DiveSiteManagement]]
=== Manipulating Dive Site Information

The dive site information of all dives is managed as a separate entity independent of the dive information.
Selecting the rightmost tab of the *Notes panel*,
labelled "Dive sites" brings up the _dive sites management panel_ (image below).
Linking a dive to a dive site is performed from within the Notes tab showing the information for
that dive (see the section on xref:S_locations[Locations]). On the other hand the dive sites management panel allows
dive-independent data to be managed. A new dive site can be created either while editing a dive (within the *Notes* tab,
see xref:S_locations[Locations]) or it could be created within the dive sites management panel (image below).
 
image::images/DiveSitesTab.jpg["FIGURE: Dive sites tab",align="center"]

If a description for a dive site has previously been entered, this is shown in the panel
as well as the number of dives at each site. The list of sites can be ordered by clicking
on any of the three headings. A dustbin and an edit icon are on the left of each dive site name.
The following actions are possible for managing the collection of dive sites:

==== Filter the list of dive sites

At the top right of the dive site management panel is a text box (see image above). If you wish to only show dives
from a particular site, then type a partial dive site name such as "Genova". This shows only the dive sites
that have been described for Genova, assuming that the word "Genova" forms part of the dive site name
or description.

==== Edit a dive site

The information for each dive site can be edited either from from within the *Notes* tab or
within the *Dive sites* tab.  In order to edit the dive site information, select the
Edit icon to the left of the dive site name (see image above). Editing dive site information
from within the *Notes* tab is discussed in the section on xref:S_locations[Locations] where
each of the fields in the dive site edit panel is explained.

image::images/DiveSiteEdit.jpg["FIGURE: Dive site edit",align="center"]

Add any desirable information to the tab. Editing of coordinates is explained in the
section dealing with xref:S_locations[Locations]. Having finished editing the dive site information,
select the Done button at the top. This returns you to the dive sites management panel.

==== Merge dive sites

Merging two or more dives is achieved in the dive site edit panel (see image above). We assume that the dive
sites that need merging are not far apart. Merging is performed by selecting a dive site and then merging
other dives with this selected dive site. In the edit panel, above, select the text box labelled "Show dive sites
in the range of:" and provide a critical distance that would include the site that needs to be merged with the present site.
A list of sites within this range is presented (see image below).

image::images/DiveSiteMerge.jpg["FIGURE: Dive sites merge",align="center"]

Select the dive site to be merged by right-clicking it. A confirmation
message is presented (see image above). Clicking the confirmation message merges the selected dive with
the dive named at the top of the panel and returns you to the dive sites management panel.

==== Add a dive site

At the top right of the dive sites management table is a round button with a "+". Clicking that button inserts a
new site entitled "New dive site" into the list (image below). The new site can also be deleted (maybe after erroneously
clicking the + icon or you realised the dive site already exists) by selecting _Edit -> Undo_ from the main menu or by typing Cntrl-Z while the dive sites management table has focus. Edit this new site by selecting its edit icon and provide a name,
coordinates and, if preferred, a description. Clicking
the "Done" button in the edit panel returns you to the dive sites management panel.

image::images/DiveSiteInsert.jpg["FIGURE: Add dive site",align="center"]

==== Delete a dive site

On the left of each dive site is a dustbin icon. Clicking the dustbin deletes that site. If there are any
dives performed at that site, a warning message is shown (see image below). If this site is then deleted,
the location(s) of dives that used this site would need to be created. 

image::images/DiveSiteDelete.jpg["FIGURE: Delete a dive site",align="center"]

==== General approach to the use of the dive sites list

Since the dive sites list is managed separately from the dive list, it is possible to add dive sites to the list
even though these sites have not been used for any dives. In this case the column labelled "# of dives" shows a zero.
This makes it possible for divers to share dive sites and sites can be created before any of them are dived. Alternatively
a site can be created with a useful description such as "Ann dived this site last summer and she saw huge numbers of
bumphead parrotfish. She said Jan - Apr is the best time. I hope to dive there myself". In this way the dive sites
list becomes a repository of useful information outside of the dive list.

==== Delete unused dive sites

At the top left of the dive sites management panel is a button "Purge unused dive sites". Selecting this button
deletes all the dive sites that do not have associated dives.

=== Importing Dive coordinates from a mobile device with GPS.

A smartphone with built-in GPS facilities can be used to store the locations of dives.
This is performed by:

1) Taking the mobile device along on the dive boat / liveabord while
automatically collecting dive site coordinate information.

2) Adding collected coordinate information to the dives using the _Subsurface-mobile_ app.

3) Synchronizing the logbook with the _Subsurface_ cloud using the _Subsurface-mobile_ app.

Existing users might still be using the legacy _Companion app_. However, the Companion App
hasn't been under development in several years and has now been removed from both Android
and iOS app stores. The functionality is fully integrated into _Subsurface-mobile_.
Please note that the old GPS fix internet service will be shut down by the end 2018 at which
point the _Companion app_ will no longer be usable. Please switch to _Subsurface-mobile_ instead.

==== Storing and and using GPS locations using  _Subsurface-mobile_

===== Install _Subsurface-mobile_

Find _Subsurface-mobile_ on Google Play and install it on an Android device. The app
is free. The iOS version is currently experimental. _Subsurface-mobile_ has an extensive
https://subsurface-divelog.org/documentation/subsurface-mobile-user-manual[user manual]
accessible from within that app.

===== Create a _Subsurface-mobile_ account

This topic is discussed at length in the _Subsurface-mobile_ user manual. In the
Credentials screen of _Subsurface-mobile_ provide an e-mail address and a user
password that enables subsequent access. A PIN number is e-mailed from the
_Subsurface_ Internet server to the e-mail address that has been provided.
Type the PIN into the appropriate text field in the Credentials screen (see image below).
The _Subsurface_ Internet server notifies the user that a new user has been registered.

*N.B.:* To successfully create a user account, the mobile device must have Internet connectivity,
either through the cellular network or via wifi.

image::images/MobileCredentials.jpg["FIGURE: Subsurface-mobile, credentials screen",align="center"]


===== Configure auto-collecting of GPS coordinates

Activate the main menu of _Subsurface-mobile_ by selecting the "hamburger" menu button
at the bottom left of the _Subsurface-mobile_ screen (see image above), then select
_GPS_  -> _Preferences_ (see image below). The collection of GPS locations is done in the background and
automatically, using two settings:

- _Time threshold._ (minutes). The app will try to get a location every X minutes

- _Distance threshold._ (meters). Minimum distance between two locations.

*How are GPS coordinates collected?* Assuming the diver sets 5 minutes and 50
meters in the settings above, the app will start by recording a location at the current
location, followed by another one at every 5 minutes *or* every time you move 50 m
from previous location, whichever happens first.
If subsequent locations are within a radius of 50 meters from the previous one,
a new location is not saved. If the diver is not moving, only one location is
saved, at least until the _Time-threshold_ period has elapsed.
If the diver moves, a trace of the route is obtained by saving a location every 50 meters.

===== Activate the automated recording of GPS locations

The _Subsurface-mobile_ GPS menu has an option at the bottom labled
_Run location service_ (see image below). Selecting this starts the automated recording
of GPS positions.

image::images/MobileGpsMenu.jpg["FIGURE: Subsurface-mobile GPS menu",align="center"]

===== After the dive, stop the automated recording of GPS locations

Select the menu option _Disable location service_ at the bottom of the _Subsurface-mobile_ GPS menu.


===== Apply the stored GPS locations to dives on the _Subsurface_ dive list.

_Subsurface_ collects the first GPS location recorded after the start of a dive
(obtained within _Subsurface_ from either the dive computer or from the
manually-entered dive information) and before the end of a dive. These
coordinates are shown in the _Coordinates_ field of the dive site panel
for each dive. Within the dive site panel, provide a name for the
coordinates that have been assigned to the dive, following the instructions
under the heading above xref:S_locations[_Location_ management].

The https://subsurface-divelog.org/documentation/subsurface-mobile-user-manual[user manual for _Subsurface-mobile_] (accessible from within that app)
contains detailed instructions for
performing the collection of GPS data and for managing, uploading and
synchronising this information.


[[S_LoadImage]]
=== Adding photographs or videos to dives

Many (if not most) divers take photographs or videos
during a dive. We term these as _media_, meaning either photos or videos. _Subsurface_
allows the storage and display of these media for each dive. Images are
superimposed on the dive profile at the times during the dive when they were taken. Media can be viewed either
from the dive profile or from the _Media_ tab in the *Notes Panel*. _Subsurface_ allows viewing of photographs
as well as video files in a unified interface.

==== Loading media and synchronizing between dive computer and camera

Right-click on a dive or on a group of dives on the dive list, bringing up the xref:S_DiveListContextMenu[Dive list context Menu].
Select the appropriate option to import media either from
file or from the Internet. The system file browser appears. Select the folder and
media that need to be loaded into _Subsurface_ and click the _Open_ button. Towards the
bottom of the file browser is a filter that allows showing media (photos and videos),
only photographs, only videos, or all files. Choose the appropriate option.

image::images/LoadImage2_f20.jpg["FIGURE: Load images option",align="center"]

If media are imported from the Internet, provide a URL pointing to a single media.
If the URL points to a directory, no images are imported: images from the Internet
need to be imported one at a time. If media are loaded from the Internet, _Subsurface_
assumes there is an Internet connection each time this item is viewed within
_Subsurface_.

Having selected the local folder or Internet image to be imported, the time
synchronization dialog appears (see image below). The time
synchronization is not perfect between the dive computer used during a dive
and the camera used during that same dive. These two devices
often differ by several minutes. _Subsurface_ attempts to synchronize them
so that the exact times of media can be used to position media on
the dive profile.

_Subsurface_ synchronizes camera with dive computer in three ways:

- *Pro-actively*: Before the dive, ensure synchronization of the dive computer time settings with
  the time settings of the camera by changing the date-time settings on one or both of these devices.
- *Manually*: Writing down the exact camera time at the start of a dive allows using the
  difference in time between the two devices. As long as the device
  settings for time has not been changed in either device, the times of
  both devices after the dive or even at the end of the day allows manually setting the time
  difference in the _Time shift_ dialog (see image below). Towards the top of the dialog is a time
  setting tool immediately under the heading _Shift times of image(s) by_, in the image below.
  If the camera time is 7 minutes later than that of the dive computer, set the time setting
  tool to a value of 00:07 and select the _Earlier_ radio button.
  This is appropriate, since the media need to be shifted
  7 minutes earlier (camera is 7 minutes ahead of dive computer). Ignore any "AM" or "PM" suffix
  in that tool. Click the _OK_ button and synchronization is done.

image::images/LoadImage3b_f23.jpg["FIGURE: Synchronization dialog",align="center"]


- *By photograph*: There is a very slick way of achieving synchronization, requiring a
  photograph of the face of the dive computer showing the time. _Subsurface_ gets
  the exact time the photograph was taken, using the metadata the camera stores within
  each photo and compares this with the time visible on the photo. To do this, use the
  bottom half of the _Time shift_ dialog. In this case the top part of the dialog is ignored. Click on
  the horizontal bar called _Select image of dive computer showing time_. This brings up
  a file browser for selecting the photograph of the dive computer time. Select the
  photograph using the file browser and click on _OK_. This photograph of the dive computer
  appears in the bottom panel of the _Shift times_ dialog. Now _Subsurface_ knows exactly
  when the photograph was taken. Now set the date-time dialog to the left of the photo
  so it reflects the date and time of the dive computer in the photo. When the
  date-time tool has been set, _Subsurface_ knows exactly what the time difference between
  camera and dive computer is, and it can synchronize the devices. The image below shows
  a photograph of the face of the dive computer and with the date-time tool set to the
  date-time.

image::images/LoadImage3c_f23.jpg["FIGURE: Synchronization dialog",align="center"]

If the timestamp of a photograph or video is more than 30 minutes before or after the dive, it is not placed on
the dive profile (see the red warning in the image above). However, If the appropriate checkbox is
selected (see image above) these images can still be placed on the _Media_ tab of the *Notes* panel
so that all media associated with a dive are visible, including images taken before or after the dive.

[[S_ViewMedia]]

==== Viewing the media

****
*Ensuring that thumbnails are created for video files*
[icon="images/icons/important.png"]
[IMPORTANT]

Within a panel _Subsurface_ represents media by means of thumbnails (i.e. small versions of images
that allows listing many images. For a photograph, a thumbnail can easily be
created because the image is well defined. But, since a video comprises many images, the question arises of
which image should be used for the thumbnail. Two actions are required to create thumbnails of videos:

* The appropriate settings need to be set in the _Preferences_.

* The program _ffmpeg_ needs to be installed in the computer that runs Subsurface.

Full details are provided in <<S_APPENDIX_F,APPENDIX F>>.
****

After the media have been loaded, they appear in two places:

 - the _Media_ tab of the *Notes Panel* (left part of image below).
 - as tiny icons (stubs) on the dive profile at the appropriate positions reflecting the time
   each photograph or video was taken.
   To view the media on the dive profile, activate the _Toggle media_ button in the tool bar
   to the left of the dive profile:

image::images/icons/ShowPhotos_f20.png["FIGURE:Show photos toolbar button",align="left"]

This results in a profile display as in the image below:

image::images/LoadImage4.jpg["FIGURE: Media on dive profile",align="center"]

Hover the mouse over any of the media stubs. A thumbnail image
is shown of the appropriate media. See the image below:

image::images/LoadImage5.jpg["FIGURE:Thumbnail photo on dive profile",align="center"]

Clicking on the thumbnail brings up a full size
photo or video overlaid on the _Subsurface_ window, allowing a good view of
the media (see the image below). *Note* that the thumbnail on the dive profile
has a small dustbin icon in the bottom right hand corner (see image above). Selecting
the dustbin removes the image from the dive. Be careful
when clicking on a thumbnail. Images
can also be deleted using the _Media_ tab (see text below).

image::images/LoadImage6_f20.jpg["FIGURE: Full-screen photo on dive profile",align="center"]

==== The _Media_ tab

Media associated with a dive are shown as thumbnails in the _Media_ tab of the *Notes
Panel*. Media taken in rapid succession during a dive (therefore sometimes with large
overlap on the dive profile) can easily be accessed in the _Media_ tab. This tab serves as
a tool for individually accessing the media of a dive, while the stubs on the dive profile
show when during a dive when a photo/video was taken. The size of the thumbnails in the _Media_ tab can be changed using
the _Zoom level_ slider at the bottom of the panel. Single-click a thumbnail in
the _Media_ panel to select a photo/video. Double-click a thumbnail to view the full-sized image
or play the video, overlaying the _Subsurface_ window. Delete media from the _Media_ panel by selecting
it (single-click) and then by pressing the _Del_ key on the keyboard. This removes it BOTH
from the _Media_ tab as well as the dive profile.

By right-clicking on a video and selecting the "Save dive data as subtitles" option, a subtitles
file with the same name as the video but with an ".ass" extension is created that contains
time dependent dive data (runtime, depth, temperature, NDL, TTS, surface GF) to be overlayed
with the video. The VLC video player automatically finds this file upon playing the video
and overlays the dive data. Alternatively, the ffmpeg video encoder can be used to create a 
new video file with the dive data encoded in the video stream. To do so run

	ffmpeg -v video.mp4 -vf "ass=video.ass" video_with_data.mp4

from the command line. You need to have the libass library installed.

==== Media on an external hard disk
Most underwater photographers store media on an external drive. If such a drive can be mapped by the operating system
(almost always the case) the media can be directly accessed by _Subsurface_. This eases the interaction
between _Subsurface_ and an external repository of media. When associating a dive profile with media from an
external drive, the normal procedure of selection and synchronization (see text above) is used.
After the external drive has been disconnected, _Subsurface_ cannot access these media any more.
If the display of media is activated (using the toolbox icon to the left of the _Dive Profile_), the
program shows only the thumbnails and the images cannot be viewed at full-screen size.
If the external drive with the media is re-connected, the media can be seen in the normal way.

==== Finding out which dives have associated media.
Inspecting each individual dive in order to determine whether there are associated media can be time consuming. There is a
rapid way of seeing which dives have associated media and which not: activate the _Media_ checkbox in the dropdown
list obtained by right-clicking on the header bar of the *Divelist*. In the *Divelist*, all dives with associated media
have an icon indicating whether the media were taken during the dive, just before/after the dive or both during and before/after the dive.
More information is provided in the section dealing with <<S_Divelist_columns, photo icons on the *Divelist*>>.

[[S_FindMovedImages]]
==== Moving media among directories, hard disks or computers

After a photograph or video has been loaded into _Subsurface_ and associated with a specific dive,
_Subsurface_ saves the path to the directory where the media lie as well as the file name of the each photo/video,
in order to find it when the dive is opened again.
If the media or the whole media collection is moved to another drive or to a different
 machine, the path to the media changes. Now, _Subsurface_ looks for the photos/videos at their original location before they were moved,
cannot find them and cannot display them. Because, after moving media, large numbers of files
 may need to be deleted and re-imported from the new disk, _Subsurface_ can locate the media based on their filename and path.

This is done by selecting from the Main Menu: _File ->      Find moved images_. This brings up a window within
which the searching of the images can be controlled. The search is started by clicking on _Select folder and scan_.
Since recorded during different dive trips might have the same filename, the names of the parent folders are likewise compared.
Therefore, the root folder of the NEW picture collection should be chosen. For finer control, it is possible to search
only for media of the currently selected dive(s) by selecting the appropriate option.

After the searching has completed, the original filenames and the new locations of the photographs will be shown.
The matching parts of the paths are emphasized. Media that are found at their known positions are
not listed. The proposed changes can be applied by clicking _Apply_ or rejected by clicking _Cancel_.

image::images/FindMovedImages1.jpg["FIGURE:Find moved images",align="center"]

=== Logging special types of dives

This section gives examples of the versatility of _Subsurface_ as a dive logging tool.


[[S_MulticylinderDives]]
==== Multicylinder dives

_Subsurface_ easily handles dives involving more than one cylinder. Multi-cylinder diving usually happens
(a) if a diver doesn’t have enough gas for the complete dive in a single cylinder; (b) if a diver
needs more than one gas mixture because of the depth or the decompression needs of the dive. For this reason
multi-cylinder dives are often used by technical divers who dive deep or long. As far
as _Subsurface_ is concerned, there are only two types of information that need to be provided:

- *Describe the cylinders used during the dive* This is performed in the *Equipment tab* of
  the *Info* panel, as xref:cylinder_definitions[described above]. Enter the cylinders one by one,
  specifying its size and pressure, as well as the gas composition within it.

- *Record the times at which the switch from one cylinder to another was done:* This is information
  tracked by some dive computers (provided the diver indicated these changes to the dive computer
  by pressing specific buttons). If the dive computer does not provide the information, the diver has to
  record these changes using a different method, e.g. writing it on a slate or by creating a bookmark on the dive
  computer.

- *Record the cylinder changes on the dive profile*: If the latter option
  was followed, the diver needs to indicate the gas change event by right-clicking at the appropriate point
  in time on the *Dive Profile* panel and indicating the cylinder to which the change was made. After
  right-clicking, follow the context menu to "Add gas change" and select the appropriate cylinder from
  those defined during the first step, above (see image below). If the
  *gas bar* button in the toolbar has been activated, the cylinder switches are also indicated in the
  gas bar (image below).

When this is complete, _Subsurface_ indicates the appropriate use of cylinders in the dive profile.
Below is a two-cylinder dive, starting off with EAN28, then changing cylinders to EAN50 after 26 minutes
for decompression.

image::images/multicylinder_dive.jpg["FIGURE: Multicylinder profile",align="center"]

Several dive computers perform automatic recording of cylinder pressure. In this case no manual intervention is needed.
Older dive computers (e.g. Uwatec Galileo, several Suunto models) handle more than one pressure transducer on cylinders,
switching from one sensor to another as the diver switches among cylinders and providing a sequential record of cylinders pressures during a dive. Some of the latest models (e.g. Shearwater Perdix AI, Scubapro G2) record two or more pressure transducers concurrently and continuously during the whole dive. In these cases _Suburface correctly interprets the data.
There is continuous effort within the _Subsurface_ development team to add new dive computer models to those that can be
downloaded from and to represent cylinder pressures correctly. Regardless of the type of sensor handling of dive computers, technical divers are likely to use both automated and manual methods of cylinder pressure logging when more than two gases are used. However,
automated recording of cylinder pressure simplifies logging of sidemount dives (where two cylinders are used). See the
link:https://subsurface-divelog.org/documentation/supported-dive-computers/[list of supported dive computers].

==== Sidemount dives

Sidemount diving is just another form of multi-cylinder diving, often with both or all cylinders having
the same gas mixture. Although it’s a popular configuration for cave divers, sidemount
diving can be done by recreational divers who have completed the appropriate training. See the comments in the
last paragraph, above, about automated recording of cylinder pressures. Manual
logging of cylinder pressures during sidemount involves three steps, exactly as with multi-cylinder dives above:

- *During the dive, record cylinder switch events*. Since sidemount diving normally involves two
  cylinders with air or with the same gas mixture, _Subsurface_ distinguishes between these different
  cylinders. In contrast, many dive computers that allow gas switching only distinguish between different
  _gases_ used, not among different _cylinders_ used. This means when sidemount dives are downloaded
  from these dive computers, the switching event between cylinders with the same gas is not downloaded. This may mean
  that a diver may have to keep a written log of cylinder switch times using a slate, or (if the dive computer
  has the capability) marking each cylinder switch with a bookmark that can be retrieved later. Returning
  from a dive with the times of cylinder changes is the only tedious part of logging sidemount dives.
- *Within _Subsurface_ describe the cylinders used during the dive*. The diver needs to provide the
  specifications of the different cylinders, using the *Equipment* tab of the *Info Panel* (see
  image below where two 12 litre cylinders were used).
- *Indicate cylinder change events on the _Subsurface_ dive profile*. Once the dive log has been imported
  from a dive computer into _Subsurface_, the cylinder switch events need to be shown on the dive profile.
  Cylinder changes are recorded by right-clicking at the appropriate point on the dive profile, then
  selecting _Add gas change_. A list of the appropriate cylinders is shown with the
  currently used cylinder greyed out. In the image below Tank 1 is greyed out, leaving only Tank 2
  to be selected. Select the appropriate cylinder. The cylinder change is then shown on the dive
  profile with a cylinder symbol. If the *gas bar* is activated using the toolbar to the left of the
  profile, then the cylinder change is also shown on the gas bar (see image below). After all
  the cylinder change events have been recorded on the dive profile, the correct cylinder pressures
  for both cylinders are shown on the dive profile, as in the image below.

image::images/sidemount1.jpg["FIGURE: Sidemount profile",align="center"]

[[S_sSCR_dives]]
==== Passive semi-closed circuit rebreather (pSCR) dives

[icon="images/halcyon_RB80.jpg"]
[NOTE]
Passive semi-closed rebreathers (pSCR) are a technical advance in diving equipment that
recirculates the breathing gas a diver uses, while removing carbon dioxide from
the exhaled gas. While a small amount (typically a tenth) of the exhaled breathing gas is released into the water,
a small amount of fresh gas is released from the driving gas cylinder.
A diver using a single cylinder of breathing gas can therefore dive for much longer periods than
using a recreational open-circuit configuration. With pSCR equipment, a very small amount of breathing
gas is released every time the diver inhales. With active SCR (aSCR) equipment, in contrast, a small amount of
breathing gas is released continuously from the driving cylinder.

To log pSCR dives, no special procedures are required. Use the normal steps outlined above:

- Select pSCR in the _Dive Mode_ dropdown list on the *Info* panel.

- pSCR diving often involves gas changes, requiring an additional cylinder.
  Define all the appropriate cylinders as described above
  and indicate the cylinder/gas changes as described above in the section on xref:S_MulticylinderDives[multicylinder dives].

In pSCR diving, the inspired gas often has a pO~2~ below that of the fresh gas from cylinder. This is
because fresh gas is only supplied at a slow rate and the diver continuously uses oxygen from the loop for metabolism,
resulting in the so-called "pO~2~ drop over the mouthpiece". For pSCR dive profiles the dive ceiling is adjusted for this oxygen
drop, and often requires longer decompression periods. Below is a dive profile
of a pSCR dive using EAN36 as bottom gas and oxygen for decompression. Note that this dive lasted
over two hours.

image::images/pSCR_profile.jpg["FIGURE: pSCR profile",align="center"]

_Visualising the pO~2~ drop_: The difference between the pO~2~ of the fresh cylinder gas and the pO~2~
in the loop can be visualised in _Subsurface_ by opening the _Profile_
panel in the _File -> Preferences_ menu item and then providing suitable information in the section
labelled _pSCR options_. The _pSCR metabolic rate_ is your rate of oxygen metabolism in liters/min (commonly
between 0.5 and 2.5). The _Dilution ratio_ is the ratio indicating how much gas in the loop is replaced with
fresh gas, relative to the gas being breathed (common values are between 1:3 and 1:10). These values are also
used when planning pSCR dives. If the oxygen content of the loop is not recorded by an oxygen sensor, _Subsurface_
estimates the pO~2~ in the loop using the information supplied above. This pO~2~ is shown as the green line
representing the oxygen partial pressure in the dive profile. If the oxygen pressure in the loop is measured using
an oxygen sensor connected to a dive computer, this information is probably recorded by the dive computer and these
measured pO~2~ values are shown on the dive profile. In addition, the _Preferences_ panel allows one to activate
a checkbox labelled _Show equivalent OC pO~2~ with pSCR pO~2~_. This activates display of the pO~2~ in the
fresh gas from the cylinder (an orange line). The vertical distance between the orange graph and the green graph
indicates the "pO~2~ drop over the mouthpiece". Much of pSCR diving involves managing this pO~2~ difference.

[icon="images/DiveModeChange.jpg"]
[NOTE]
_pSCR and bailout_: Gases used in pSCR often yield very low pO~2~ values in shallow water. For this reason one
often completes the shallow sections of a dive using open circuit (OC) rather than the rebreather. In this case
parts of the dive are
performed OC, while the rest of the dive is performed on the pSCR loop. To indicate such changes in divemode,
right-click on the dive profile at the appropriate time. From the context menu, select _Change divemode_ and choose
the appropriate option (see image on left). Some dive computers record such changes in divemode as part of the dive log.
The appropriate icon is shown on the depth profile (see image below).
Below is a pSCR dive with the shallow
sections using OC. An OC divemode was entered right at the start, followed by
a change to pSCR at 18m. During the ascent, there was a bailout to OC at 14m. Note,
for the OC sections, the pO~2~ is identical to the OC-pO~2~ whereas for the pSCR section, the pO~2~ (green line)
differs from the OC-pO~2~ (orange line).

image::images/pSCR_profile_bailout.jpg["FIGURE: pSCR profile with bailout",align="center"]

[[S_CCR_dives]]
==== Closed circuit rebreather (CCR) dives

[icon="images/APD.jpg"]
[NOTE]
Closed system rebreathers also recirculate
gas that has been breathed. However, they use advanced technology to maintain a
breathable oxygen concentration:
a) remove carbon dioxide from the exhaled gas.
b) regulate the oxygen concentration to remain within safe diving limits.
The CCR interface of _Subsurface_ is currently experimental
and under active development. Subsurface currently supports Poseidon MkVI
and APD Discovery/Evolution dive computers, as well as Shearwater dive computers connected
to CCR systems. In contrast to a conventional recreational
dive computer, a CCR system computer usually does not allow the download of a log
containing multiple dives. Rather, each dive is stored independently. This
means that _Subsurface_ cannot download a dive log directly from a CCR
dive computer, but that it imports individual CCR dive profiles in the same way it
imports dive log data from other digital databases: one dive at a time. However, the Shearwater
based CCR systems are different in this respect and allow multi-dive downloads.

===== Import a CCR dive

For Shearwater CCR controllers, or independent Shearwater CCR logs, just download the dive log as would
be the case for non-CCR dives. _Subsurface_ interprets the CCR dive log correctly.
Except for Shearwater CCR dive computers, CCR dive data are currently obtained from the proprietary software
provided when purchasing CCR dive equipment. See the section dealing with xref:S_ImportingAlienDiveLogs[Importing dive information from other
digital sources] and <<_appendix_b_dive_computer_specific_information_for_importing_dive_information,Appendix B>>
for more complete information. Use that software to download the dive data into
a known directory. From the main menu of _Subsurface_, select _Import ->  Import
log files_ to bring up the xref:Unified_import[universal import dialog]. As
explained in that section, the bottom right
hand of the import dialog contains a dropdown list (labelled _Filter:_) of appropriate devices
that currently include (Poseidon) MkVI or APD log viewer files. Import for other
CCR equipment is under active development. Having selected the appropriate CCR format and
the directory where the original dive logs have been stored from the CCR dive
computer, select a particular dive log file (in the case of the MkVI
it is a file with a .txt extension). After selecting the appropriate dive log,
click the _Open_ button at the bottom right hand of the universal import dialog.
The selected dive is imported to the _Subsurface_ dive list.

===== Displayed information for a CCR dive

_Partial pressures of gases_: The graph of oxygen partial pressure shows the
information from the oxygen sensors of the CCR equipment. In contrast to recreational
equipment (where pO~2~ values are calculated based on gas composition and dive depth),
CCR equipment provide actual measurements of pO~2~, derived from oxygen sensors.
In this case the graph for oxygen partial pressure
should be fairly flat, reflecting the setpoint settings during the dive. The mean
pO~2~ is NOT the mean oxygen partial pressure as given by the CCR equipment, but
a value calculated by _Subsurface_ as follows:

- For TWO O~2~ sensors the mean value of the two sensors are given.

- For THREE-sensor systems (e.g. APD), the mean value is also used. However
  differences of more than 0,1 bar in the simultaneous readings of different sensors are
  treated as false. If one of the three sensors provides false data, it is ignored.

- If no sensor data are available, the pO~2~ value is assumed to be equal to the setpoint.

The mean pO~2~ of the sensors is indicated with a green line,

The oxygen setpoint values as well as the readings from the individual
oxygen sensors can be shown. The display of additional CCR information is turned on by
checking the appropriate boxes in the _Preferences_ panel (accessible by
selecting xref:S_CCR_options[_File ->  Preferences ->  Profile_]). This part of
the _Preferences_ panel is shown in the image below, representing two checkboxes that modify
the display of pO~2~ when the appropriate toolbar button on the Dive Profile
has been checked.

image::images/CCR_preferences_f20.jpg["FIGURE: CCR preferences panel",align="center"]

Checking any of these boxes allows the display of additional oxygen-related
information whenever the pO~2~ toolbar button on the _Profile_ panel is activated.
The first checkbox allows the display of setpoint information. This is an orange line
superimposed on the green oxygen partial pressure graph and allows a comparison of the
mean measured oxygen partial pressure and the setpoint values, as shown below.

image::images/CCR_setpoint_f20.jpg["FIGURE: CCR setpoint and pO~2~ graph",align="center"]

The second checkbox allows the display of the data from each individual oxygen sensor
of the CCR equipment. The data for each sensor is color-coded as follows:

- Sensor 1: grey
- Sensor 2: blue
- Sensor 3: brown

The mean oxygen pO~2~ is indicated by the green line. This allows the direct comparison
of data from each of the oxygen sensors, useful for detecting abnormally low or erratic
readings from a particular sensor.

image::images/CCR_sensor_data_f20.jpg["FIGURE: CCR sensor data graph",align="center"]

The setpoint data can be overlaid on the oxygen sensor data by activating both of the above
check boxes. Partial pressures for nitrogen (and helium, if applicable) are shown in the
usual way as for open circuit dives.

_Events_: Several events are logged, e.g. switching the mouthpiece to open circuit.
These events are indicated by yellow triangles and, if you hover over a triangle,
a description of that event is given as the bottom line in the xref:S_InfoBox[Information Box].

_Bailout_: Bailout events during a CCR dive can be recorded in a _Subsurface_ divelog. Right-click
on the dive profile to generate a dive profile context menu. Select _Change divemode_ and choose
the appropriate bailout option (probably OC). An appropriate icon is shown on the depth profile (see
image below). In most CCR equipment it is also
possible to bailout to pSCR, especially in cases where the electronics died and the diluent supply
is limited. This can also be reflected in the dive log and Subsurface will calculate and graph the
appropriate pO~2~ values. The case during CCR training is more complex if the instructor prefers
a low setpoint such as 0.7 to be maintained during bailout. In this case the CCR equipment
maintains the low setpoint and overrides the OC or pSCR conditions. In such cases it is probably
more accurate not to record a bailout event in the dive log since _Subsurface_ will calculate pO~2~
values based on the erroneous assumption that there is no setpoint.
Below is a dive profile for a CCR dive with bailout at 57 minutes. In this profile
the green pO~2~ graph diverges from the setpoint value and reflects the pO~2~ in the OC diluent gas
(in this case air).
The pO~2~ in the loop (shown as a meandering graph for each oxygen sensor) is irrelevant because
the actual inspired gas comes directly from the diluent cylinder. In cases where bailout occurs using
a stage cylinder, indicate the bailout as well as the gas change event and _Subsurface_ will calculate
all the appropriate pO~2~ values. Some dive computers record bailout events as well as gas change
events: in this case the events are shown automatically in the dive log.

image::images/CCR_bailout.jpg["FIGURE: CCR bailout profileh",align="center"]

_Deco ceiling_: The deco ceiling calculated by Subsurface is not very accurate because the precise pressure of nitrogen
in the loop can usually not be determined from the dive log imported from the CCR equipment. Many CCR dive
computers, however, report an internally-calculated deco ceiling that is reported in the dive log,
reflecting a more accurate assessment. The display of this ceiling is activated
by clicking the appropriate button to the left of the dive profile:

image::images/icons/cceiling.jpg["DC ceiling icon"]

The default color of the computer-generated deco ceiling is white. This can be set to red
by checking the appropriate check box after selecting _File  ->  Preferences  ->  Profile_.
The profile above indicates the dive computer-generated deco ceiling in red.

_Cylinder pressures_: Some CCR dive computers like Poseidon record the
pressures of the oxygen and diluent cylinders. The pressures of these two cylinders
are shown as green lines overlapping the depth profile. In addition, start and
end pressures for both oxygen and diluent cylinders are shown in the _Equipment Tab_.
Below is a dive profile for a CCR dive, including an overlay
of setpoint and oxygen sensor data, as well as the cylinder pressure data. In this
case there is agreement from the readings of the two oxygen sensors.

image::images/CCR_dive_profile_f22.jpg["FIGURE: CCR dive profile",align="center"]

_Equipment-specific information_: Equipment-specific information gathered by
_Subsurface_ is shown in the xref:S_ExtraDataTab[Extra data tab]. This may include setup information
or metadata about the dive.

More equipment-specific procedures and information for downloading CCR dive logs for
Poseidon and APD equipment can be found in xref:_appendix_b_dive_computer_specific_information_for_importing_dive_information[Appendix B].

== Obtaining more information about dives entered into the logbook

=== Using the Dive Map to obtain more dive information

The Dive Map has buttons useful for obtaining spatial information about a dive. These are:

[icon="images/icons/MapViewMode.jpg"]
[NOTE]
Select this button to show the Dive Map as a satellite image or as a Google Maps
representation.

[icon="images/icons/MapViewPlus.jpg"]
[NOTE]
Zoom in. Select a smaller area of the map.

[icon="images/icons/MapViewMinus.jpg"]
[NOTE]
Zoom out. Select a larger area of the map.

image::images/MapMenu.jpg["FIGURE: Map menu",align="left"]

The "Hamburger" button on the top right-hand of the Dive Map
activates the Map menu. The items are:

* Open location in _Google Maps_. Open the location of the active dive in a separate Google Maps window with the
  dive site indicated by a Google Maps teardrop marker.

* Copy location to clipboard (decimal). Copy the coordinates of the active dive to the clipboard in decimal degrees
  e.g. -25.933905 30.710572

* Copy location to clipboard (sexagesimal). Copy the coordinates of the active dive to the clipboard in sexagecimal, e.g. 25°56'02.058"S
  30°42'38.059"E

* Select visible dive locations. In the Dive List panel, highlight all the dive sites visible in the Dive Map. This allows easy
  selection of the dives within a particular geographical area to inspect them or to calculate statistics for them.

=== The *Info* tab (for individual dives)

The Info tab gives some summary information about a particular dive that
has been selected in the *Dive List*. Useful information here includes the
surface interval before the dive, the maximum and mean depths of the dive, the
gas volume consumed, the surface air consumption (SAC) and the number of oxygen
toxicity units (OTU) incurred.

[icon="images/icons/info.jpg"]
[NOTE]
Gas consumption and SAC calculations:
_Subsurface_ calculates SAC and Gas consumption taking in account gas
incompressibility, particularly at tank pressures above 200 bar, making them more accurate.
Refer to xref:SAC_CALCULATION[Appendix F] for more information.

[[S_ExtraDataTab]]
=== The *Extra Data* tab (usually for individual dives)

When using a dive computer, it often reports several data items that cannot easily be
presented in a standardised way because the nature of the information differs from one
dive computer to another. These data often comprise setup information, metadata about
a dive, battery levels, no fly times, or gradient factors used during the dive. When
possible, this information is presented in the *Extra Data* tab. Below is an
image showing extra data for a dive using a Poseidon rebreather.

image::images/ExtraDataTab_f20.jpg["FIGURE: Extra Data tab",align="center"]

=== The *Stats* tab (for groups of dives)

The Stats tab gives summary statistics for more than one dive, assuming that
more than one dive has been selected in the *Dive List* using the standard
Ctrl-click or Shift-click of the mouse. If only one
dive has been selected, figures for only that dive are given. This tab
shows the number of dives selected, the total amount of dive time in these
dives,
as well as the minimum, maximum and mean for the dive duration,
water temperature and surface air consumption (SAC). It also shows the depth of the
shallowest and deepest dives of those selected.

[[S_DiveProfile]]
=== The *Dive Profile*

image::images/Profile2.jpg["Typical dive profile",align="center"]

Of all the panels in _Subsurface_, the Dive Profile contains the most detailed
information about each dive. The Dive Profile has a *button bar* on the left hand side,
allowing control of several display options. The functions of these
buttons are described below. The main item in the Dive
Profile is the graph of
dive depth as a function of time. In addition to
depth, it also shows the ascent and descent rates compared to the recommended
speed of going up or down in the water column. This information is given using
different colors:
|====================
|*Color*|*Descent speed (m/min)*|*Ascent speed (m/min)*
|Red|> 30|> 18
|Orange|18 - 30|9 - 18
|Yellow|9 - 18|4 - 9
|Light green|1.5 - 9|1.5 - 4
|Dark green|< 1.5|< 1.5
|=====================

The profile also includes depth readings for the peaks and troughs in the graph.
So users should see the depth of the deepest point and other peaks. Mean depth
is plotted as a grey line, indicating mean dive depth up to a particular moment during the dive.

[icon="images/icons/scale.jpg"]
[NOTE]
In some cases the dive profile does not fill the whole area of the *Dive Profile*
panel. Clicking the *Scale* button in the toolbar on the left of the dive profile
increases the size of the dive profile to fill the area of the panel.

*Water temperature* is shown as a blue line with temperature values
placed adjacent to significant changes.

[[S_InfoBox]]
==== The *Information Box*
The Information box displays a large range of information about the dive
profile. Normally the Information Box is located to the top left of the *Dive
Profile* panel. The Information Box can be moved around in the *Dive Profile*
panel by click-dragging it with the mouse so that it is not obstructing
important detail. The position of the Information Box is saved and used again
during subsequent dive analyses.

image::images/InfoBox2.jpg["Figure: Information Box",align="center"]

When the mouse points inside the *Dive Profile* panel, the information box  expands and
shows many data items. In this situation, the data reflect the time point along
the dive profile shown by the mouse cursor (see right-hand part of figure (*B*) above
where the Information Box reflects the situation at the position of the cursor
[arrow] in that image). Moving the cursor horizontally lets the Information Box show information for any point
along the dive profile. It gives extensive statistics about depth, gas
and ceiling characteristics of the particular dive. These include: Time period
into the dive (indicated by a @), depth, cylinder pressure (P), temperature,
ascent/descent rate, surface air consumption (SAC), oxygen partial pressure,
maximum operating depth, equivalent air depth (EAD), equivalent narcotic depth
(END), equivalent air density depth (EADD, also as gas density in g/l), decompression requirements at that
instant in time (Deco), the surface GF (a measure of inert gas loading of the diver's body defined as the excess
over the surface pressure normalized such that the maximally allowed over pressure at the surface, the 
M-value, corresponds to 100%), the time to surface (TTS), the calculated ceiling, as well
as of the statistics in the Information Box, shown as four
buttons on the left of the profile panel. These are:

[icon="images/icons/MOD.jpg"]
[NOTE]
Show the *Maximum Operating Depth (MOD)* of the dive, given the
gas mixture used. MOD is dependent on the oxygen concentration in the breathing gas.
For air (21% oxygen) it is around 57 m if a maximum pO~2~ of 1.4 is specified in the *Preferences* section
(select _File -> Preferences -> Profile_ and edit the text box _pO~2~ in calculating MOD_.
When diving below the MOD there is a markedly increased risk of exposure to the dangers of oxygen toxicity.

[icon="images/icons/NDL.jpg"]
[NOTE]
Show either the *No-deco Limit (NDL)* or the
*Total Time to Surface (TTS)*. NDL is the time duration that a diver can continue with a
dive, given the present depth, that does not require decompression (that is, before an
ascent ceiling appears). Once a diver has exceeded the NDL and decompression is required (that
is, there is an ascent ceiling above the diver) then TTS gives the number of minutes
required before the diver can surface. TTS includes ascent time as well as decompression
time. Even if the profile contains several gas
switches, TTS at a specific moment during the dive is calculated using the current gas.
TTS longer than 2 hours is not accurately calculated and Subsurface only indicates _TTS > 2h_.

[icon="images/icons/GFLow.jpg"]
[NOTE]
Show *Deco information*. When enabled, the information box shows the surface GF and the momentary
ceilings for the individual tissue compartments. The surface GF is an indication of to what degree
the partial pressure of nitrogen in the blood exceeds the partial pressure required for safely
reaching the surface. Surface GF > 100% means that it is unsafe to surface.

[icon="images/icons/SAC.jpg"]
[NOTE]
Show the *Surface Air Consumption (SAC)*, an indication of the surface-normalized respiration
rate of a diver. The value of SAC is less than the real
respiration rate because a diver at 10m uses breathing gas at a rate roughly double that of
the equivalent rate at the surface. SAC gives an indication of breathing gas consumption rate
independent of the depth of the dive, so the respiratory rates of different dives
can be compared. The units for SAC is liters/min or cubic ft/min.

[icon="images/icons/EAD.jpg"]
[NOTE]
Show the *Equivalent Air Depth (EAD)* for
nitrox dives as well as the *Equivalent
Narcotic Depth (END)* for trimix dives. These are
important to divers breathing gases other than air. Their
values are dependent on the composition of the breathing gas. The EAD
is the depth of a hypothetical air dive that has the same partial
pressure of nitrogen as the current depth of the nitrox dive at
hand. A nitrox dive leads to the same decompression obligation as an
air dive to the depth equaling the EAD. The END is the depth of a
hypothetical air dive that has the same sum of partial pressures of
the narcotic gases nitrogen and oxygen as the current trimix dive. A
trimix diver can expect the same narcotic effect as a diver breathing
air diving at a depth equaling the END.

If at some point a isobaric counter diffusion situation is encountered
in the leading tissue (defined to be a moment in time where helium is
off-gassing while nitrogen is on-gassing and the net effect is
on-gassing) this is indicated in the infobox as well. Note that this
condition not only depends on the gas that is currently breathed but
on the tissue loadings as well.

Figure (*B*) above shows an information box with a nearly complete set of data.


[[S_gas_pressure_graph]]
===== The Gas Pressure Bar Graph

On the left of the *Information Box* is a vertical bar graph showing the
pressures of the nitrogen (and other inert gases, e.g. helium, if applicable) that the diver
was inhaling _at a particular instant during the dive_, shown by the position
of the cursor on the *Dive Profile*. The drawing on the left below indicates the
meaning of the different parts of the Gas Pressure Bar Graph.

image::images/GasPressureBarGraph.jpg["FIGURE:Gas Pressure bar Graph",align="center"]

- The light green area indicates the gas pressure, with the top margin of the light green
  area showing the total gas pressure of ALL gases inhaled by the diver and measured from the bottom
  of the graph to the top of the light green area. This pressure has a _relative_ value in the graph
  and does not indicate absolute pressure.

- The horizontal black line underneath the light green margin indicates the equilibrium pressure
  of the INERT gases inhaled by the diver, usually nitrogen. In
  the case of trimix, it is the pressures of nitrogen and helium combined. In this example,
  the user is diving with EAN32, so the equilibrium inert gas pressure is 68% of the distance from the
  bottom of the graph to the total gas pressure value.

- The dark green area at the bottom of the graph represents the pressures of inert gas in each
  of the 16 tissue compartments, following the Bühlmann algorithm, with fast tissues on the
  left hand side.

- The top black horizontal line indicates the inert gas pressure limit determined by the gradient
  factor that applies to the depth of
  the diver at the particular point on the *Dive Profile*. The gradient factor shown is an
  interpolation between the GFLow and GFHigh values specified in the _Profile_ tab of the *Preferences
  Panel* of _Subsurface_.

- The bottom margin of the red area in the graph indicates the Bühlman-derived M-value. That is the
  pressure value of inert gases at which bubble formation is expected to be severe, resulting
  in a significant risk of decompression sickness.

These five values are shown on the left in the image above. The way the Gas Pressure Bar Graph changes
during a dive can be seen on the right hand side of the above figure for a diver using EAN32.

- Graph *A* indicates the start of a dive with the diver at the surface. The pressures in all
  the tissue compartments are still at the surface equilibrium pressure because no diving has taken place.

- Graph *B* indicates the situation after a descent to 30 meters. Few of the tissue compartments have had
  time to respond to the descent, so their gas pressures are far below the equilibrium gas pressure.

- Graph *C* represents the pressures after 30 minutes at 30 m. The fast compartments have attained
  equilibrium (i.e. they have reached the height of the black line indicating the equilibrium pressure). The
  slower compartments (towards the right) have not reached equilibrium and are in the process of slowly
  increasing in pressure.

- Graph *D* shows the pressures after ascent to a depth of 4.5 meters. Since during ascent the total
  inhaled gas pressure has decreased strongly from 4 bar to 1.45 bar, the pressures in the different tissue
  compartments now exceed that of the total gas pressure and approach the gradient factor value (i.e.
  the top black horizontal line). Further ascent will result in exceeding the gradient
  factor value (GFHigh), endangering the diver.

- Graph *E* indicates the situation after remaining at 4.5 meters for 10 minutes. The fast compartments
  have decreased in pressure. As expected, the pressures in the slow compartments have not changed much.
  The pressures in the fast compartments do not approach the GFHigh value any more and the diver is safer
  than in the situation indicated in graph *D*.

==== Computer-reported events during dive
Many dive computers record events during a dive. For instance,
most dive computers report alarms relating to high partial pressures of oxygen,
to rapid ascents or the exceeding of no-deco limits (NDL).
On the other hand, other events are classified as warnings and, for instance, occur when
the remaining gas in a cylinder falls below a predetermined limit, a deep stop needs to be performed or
the need to change gas during multicylinder dives. Some dive computers also report notifications,
e.g. when a safety stop is initiated or terminated or when a predetermined amount of OTUs have been incurred.
The alarms, warnings and notifications differs from one dive computer to another: some dive computers do not
report any of the above events, while others provide an extensive log of events. The reporting of events
is therefore a function of the dive computer used. In addition, _Subsurface_ does not always
have the ability to detect all the events reported by a specific dive computer.

Events are indicated by symbols on the dive profile. Notifications are shown as a white, round symbol with a letter _i_;
warnings are indicated by a yellow triangle and alarms by a red triangle. By moving the cursor over a symbol,
the explanation is given in the bottom-most line of the _Information Box_ (see image below, where the cursor is positioned
over the alarm that was reported).

image::images/profile_symbols.jpg["FIGURE: Profile notification symbols",align="center"]

Some dive computers report _bookmarks_ that the diver has set during the dive. These are indicated as
a small red flag on the profile and are discussed more fully in the section on
<<S_Bookmarks,_inserting bookmarks_>>.

==== The Profile Toolbar

The dive profile can include graphs of the *partial pressures*
of O~2~, N~2~, and He during the dive (see figure above) as well as a calculated and dive computer
reported deco ceilings (only visible for deep, long, or repetitive dives).
Partial pressures of oxygen are indicated in green, nitrogen in black,
and helium in dark red. These
partial pressure graphs are shown below the profile data.

[icon="images/icons/O2.jpg"]
[NOTE]
Show the partial pressure of *oxygen* during the
dive. This is shown below the dive depth and water temperature graphs.

[icon="images/icons/N2.jpg"]
[NOTE]
Show the partial pressure of *nitrogen* during the dive.

[icon="images/icons/He.jpg"]
[NOTE]
Display of the partial pressure of *helium* during the dive.
This is only important to divers using Trimix, Helitrox or similar breathing gases.

The *air consumption* graph displays the tank pressure and its change during the
dive. The air consumption takes depth into account so that even when manually
entering the start and end pressures the graph, is not a straight line.
Like the depth graph, the slope of the tank pressure provides information
about the
momentary SAC rate (Surface Air Consumption) when using an air integrated dive computer.
Here the color
coding is not relative to some absolute values but relative to the mean
normalized air consumption during the dive. So areas in red or orange
indicate
times of increased normalized air consumption while dark green reflects times
when the diver was using less gas than average.

When in planner mode, the SAC is set to be constant during the bottom part
of the dive as well during decompression. Therefore, when planning a dive,
the color is a representation of the breathing gas density.

[icon="images/icons/Heartbutton.png"]
[NOTE]
Clicking on the heart rate button allows display of heart rate information
during the dive if the dive computer was attached to a heart rate sensor.

It is possible to *zoom* into the profile graph. This is done either by using
the scroll wheel / scroll gesture of the mouse or trackpad. By default
_Subsurface_ always shows a profile area large enough for at least 30 minutes
and 30m (100ft) – this way short or shallow dives are easily recognizable;
something free divers won’t care about.

image::images/MeasuringBar.png["FIGURE: Measuring Bar",align="center"]

[icon="images/icons/ruler.jpg"]
[NOTE]
Measurements of *depth or time differences* can be achieved by using the
*ruler button* on the left of the dive profile panel.
The measurement is done by dragging the red dots to the two points
on the dive profile that you wish to measure. Information is then given
in the horizontal white area underneath the
two red dots.

[icon="images/icons/ShowPhotos.png"]
[NOTE]
Photographs and videos that have been added to a dive can be shown on the profile
by selecting
the *Show-media* button. The position of a photo or video on the profile
shows the exact time when it was taken.
The runtime of videos is represented by a bar if _Subsurface_ was able to
extract this information from the video file.
If this button is not active, the media are hidden.


The profile can also include the dive computer reported *ceiling* (more
precisely, the deepest deco stop that the dive computer calculated for each
particular moment in time) as a red overlay on  the dive profile. Ascent ceilings
occur when a direct ascent to the surface increases
the risk of a diver suffering from decompression sickness (DCS) and it is necessary
to either ascend
slower or to perform decompression stop(s) before ascending to the surface. Not
all dive computers record this information and make it available for download;
for example none of the Suunto dive computers make these data
available to divelog software. _Subsurface_ also calculates ceilings independently,
shown as a green overlay on the dive profile.
Because of the differences in algorithms used
and amount of data available (and other factors taken into consideration at the time
of the calculation) it’s unlikely that ceilings from dive computers and from _Subsurface_
are the same, even if the same algorithm and _gradient factors_ (see below) are used.
It’s also quite common that _Subsurface_ calculates a ceiling for
non-decompression dives when the dive computer stayed in no-deco mode during
the whole dive (represented by the [green]#dark green# section in the profile
at the beginning of this section). This is because _Subsurface’s_
calculations describe the deco obligation at each moment during a dive,
while dive computers usually take the upcoming ascent into account. During the
ascent some excess nitrogen (and possibly helium) are already breathed off so
even though the diver technically encountered a ceiling at depth, the dive still does
not require a specific deco stop. This feature lets dive computers offer
longer non-stop bottom times.

Strictly speaking, the green calculated ceiling is a direct representation of
the inert gas loadings of the simulated tissues only and is independent of 
any assumed ascent velocities. It indicates the deco model's minimal allowed
depth at this instant of time given the inert gas loadings and is not a statement
about a possible ascent schedule in the remaining dive. To obtain the latter,
use the "Edit dive in planner" option from the Log menu.

[icon="images/icons/cceiling.jpg"]
[NOTE]
If the dive computer itself calculates a ceiling and makes it available to
_Subsurface_ during upload of dives, this can be
shown as a red area by checking *Dive computer reported ceiling* button on the Profile Panel.

[icon="images/icons/ceiling1.jpg"]
[NOTE]
If the *Calculated ceiling* button on the Profile Panel is clicked, then a ceiling,
calculated by _Subsurface_, is shown in green if it exists for
a particular dive (*A* in figure below). This setting can be modified in two ways:

[icon="images/icons/ceiling2.jpg"]
[NOTE]
If, in addition, the *show all tissues* button on the Profile Panel is clicked, the ceiling is shown for the tissue
compartments following the Bühlmann model (*B* in figure below).

[icon="images/icons/ceiling3.jpg"]
[NOTE]
===============================================================================================================
If, in addition, the *3m increments* button on the Profile Panel is clicked, then the ceiling is indicated in 3 m increments
(*C* in figure below).

image::images/Ceilings2.jpg["Figure: Ceiling with 3m resolution",align="center"]

Gradient Factor settings strongly affect the calculated ceilings and their depths. For more information about Gradient factors, see the section on xref:GradientFactors_Ref[Gradient Factor Preference settings]. The currently used gradient factors (e.g. GF 35/75) are shown above the depth profile if the appropriate toolbar buttons are activated. N.B.: The indicated gradient factors are NOT the gradient factors in use by the dive computer, but those used by Subsurface to calculate deco obligations during the dive. For more information external to this manual see:

 *** http://www.tek-dive.com/portal/upload/M-Values.pdf[Understanding M-values by Erik Baker, _Immersed_ Vol. 3, No. 3.]

 *** link:http://www.rebreatherworld.com/general-and-new-to-rebreather-articles/5037-gradient-factors-for-dummies.html[Gradient factors for dummies, by Kevin Watts]
===============================================================================================================



[icon="images/icons/ShowCylindersButton.jpg"]
[NOTE]
By selecting this icon, the different cylinders used during a dive can be represented as a colored bar at the bottom
of the *Dive Profile*. In general oxygen is represented by a green bar, nitrogen a yellow bar and helium a
red bar. The image below shows a dive which first uses a trimix cylinder (red and green), followed by a switch to a nitrox cylinder
(yellow and green) after 23 minutes. Cylinders with air are shown as a light blue bar.

image::images/ShowCylinders_f20.jpg["Figure: Cylinder use graph",align="center"]



[icon="images/icons/heatmap.png"]
[NOTE]
====================================================================================
Display the tissue heat-map. The heat map summarises, for the duration of the dive, the inert gas tissue pressures
for each of the 16 tissue compartments of the Bühlmann model. Blue colors mean low gas pressures in a tissue compartment
and thus on-gassing, green to red means excess gas in the tissue and thus off-gassing. Fast to slow tissues are indicated from
top to bottom. The figure below explains in greater detail how the heat map can be interpreted.

image::images/Heatmap.jpg["Figure: Inert gas tissue pressure heat-map",align="center"]

Image *A* on the left shows the xref:S_gas_pressure_graph[Gas Pressure Graph] in the
*Information box*, representing a snapshot of inert gas pressures at a particular point in time
during the dive. The inert gas pressures of 16 tissue compartments are shown as dark green vertical
bars with the quick tissue compartments on the left and the slow tissue compartments
on the right. Refer to the section on the xref:S_gas_pressure_graph[Gas Pressure Graph]
for more details on the different elements of this graph.

Image *B* shows a gradient of unique colors, spanning the whole range of inert gas pressures.
It is possible to map the height of each of the dark green vertical bars of *A* to a
color in *B*. For instance, the fastest (leftmost) dark green vertical bar in *A* has
a height corresponding to the medium green part of *B*. The height of this bar can therefore be summarised
using a medium green color. Similarly, the highest dark green bar in *A* is as high
as the yellow part of *B*. The 14 remaining tissue pressure bars in *A* can also be
translated to colors. The colors represent three ranges of tissue inert gas pressure:

 -  The bottom range in *B* (marked _On-gassing_) includes colors from light blue to black, representing tissue gas pressures
    below the equilibrium pressure of inert gas (bottom horizontal line in *A*). The measurement
    unit is the % of inert gas pressure, relative to the equilibrium inert gas pressure. In this range
    on-gassing of inert gas takes place because the inert gas pressure in the tissue compartment is lower than
    in the surrounding environment. Black areas in the heat map indicate that a tissue compartment has reached
    the equilibrium inert gas pressure, i.e. the inert gas pressure in the tissue compartment equals that
    of the water in which the diver is. The equilibrium pressure changes according to depth.

 -  The central range in *B* includes the colors from black to light green, when the inert gas pressure of a tissue
    compartment is higher than the equilibrium pressure but less than the ambient pressure.
    In this zone decompression is not very efficient
    because the gradient of inert gas pressure from tissue to the environment is relatively small
    and indicated by dark green areas of the heat map.

 -  The top range in *B* (marked _Off-gassing_) includes colors from light green to red and white, representing tissue gas
    pressures above that of the total ambient pressure (top of light green area of *A*). The measurement
    unit is the % of inert gas pressure above ambient pressure, relative to the Bühlmann M-value gradient (bottom of red area
    in *A*). These tissue pressures are normally reached while ascending to a shallower depth.
    Below a value of 100%, this range indicates efficient off-gassing of inert gas from the tissue compartment into the
    environment. Usually, efficient off-gassing is indicated by light green, yellow or orange colors.
    Above 100% (red to white in *B*) the M-value gradient is exceeded and the probability of decompression sickness
    increases markedly.

Image *C* shows the color mapping of each of the vertical bars in *A*, the fast
tissues (on the left in *A*) depicted at the top
and the slow tissue compartments at the bottom of *C*. The highest vertical bar in *A*
(vertical bar 3rd from the left) is presented as the yellow rectangle 3rd from the top
in *C*. The 16 vertical bars in *A* are now presented as a vertical
column of 16 colored rectangles, representing a snapshot of tissue compartment gas pressures
at a particular instant during the dive.

Image *D* is a compilation of similar color mappings of 16 tissue compartments
during a 10-minute period of a dive, the colors representing the
inert gas loading of a tissue compartment at a point in time during the dive. Faster tissues
are shown at the top and slower tissues at the bottom, with time
forming the horizontal axis of the graph. The column of rectangles in *C* can be found
on the horizontal axis between 9 and 10 minutes.

The colors of the heat map are not affected by the gradient factor settings.
This is because the heat map indicates tissue pressures relative to the Bühlmann M-value gradient, and
not relative to any specific gradient factor. For more information external to this manual see:

http://www.tek-dive.com/portal/upload/M-Values.pdf[Understanding M-values by Erik Baker, _Immersed_ Vol. 3, No. 3.]

Since the colors of the heat map are not affected by the gradient factor(s), the heat map is also
applicable when using the VPM-B decompression model.

The image below compares the profiles and heat maps for two planned decompression dives to 60m:
the first using the Bühlmann decompression model, the second using the VPM-B decompression model.
Both profiles have the same total decompression time, but the VPM-B model requires deeper stops early in the ascent phase.

In both profiles, the inert gas pressures in the faster tissues rise much more rapidly than the slower tissues during
the descent and bottom phase, with the colors transitioning from light blue through blue and purple to black.
Similarly, the inert gas pressure in the fast tissues reduces more rapidly than the slow tissues at each decompression stop,
with colors transitioning from red, orange and yellow to green and black.

The comparison of the two profiles and heatmaps shows that by including deep stops, the oversaturation gradient in the
faster tissues early in ascent phase is reduced.
However, on-gassing of slower tissues continues during the deep stops, which leads to greater oversaturation gradient
in slower tissues at the end of the dive.

image::images/tissueHeatmap.jpg["Figure: Inert gas tissue pressure heat-map",align="center"]
===================================================================================

==== The Dive Profile context menu

The context menu for the Dive Profile is accessed by right-clicking while the
mouse cursor is over the Dive Profile panel. The menu allows creating
Bookmarks, Gas Change Event markers, or manual CCR set-point changes
other than the ones that might have been
imported from a Dive Computer. Markers are placed against the depth profile line,
with the time of the event determined by the mouse cursor when the right
mouse button was clicked to bring up the menu. Gas Change events
involve a selection of which gas is being switched TO. The list of choices is based on
the available gases defined in the *Equipment* Tab. Setpoint change
events open a dialog letting you choose the next setpoint value. As
in the planner, a setpoint value of zero shows the diver is
breathing from an open circuit system while any non-zero value
shows the use of a closed circuit rebreather (CCR).
By right-clicking while over
an existing marker a menu appears, adding options to allow deletion of the
marker, or to allow all markers of that type to be hidden. Hidden events can be
restored to view by selecting Unhide all events from the context menu.

[[S_Filter]]
=== Filtering the dive list

The dives in the *Dive List* can be filtered, selecting only some
of the dives based on attributes such as dive tags, dive site, divemaster or buddy.
For instance, filtering lets you list the dives during a particular year at a specific
dive site, or otherwise the cave dives with a particular buddy. Filtering can be performed
based on any information in the _Info Panel_.

To open the filter, select _Log ->  Filter divelist_ from the main menu. This replaces the
_Dive Map Panel_ with a _Filter Panel_. The top window bar contains the number of dives that satisfy the
current selections of the filter (see image below).

image::images/FilterWindowBar.jpg["Figure: Filter Window Bar",align="center"]

When opened, the filter contains default values that include all the dives in the _Dive list_. Filter the
_Dive list_ by either changing some of the default values in the panel, or by typing specific
values or words in any of the text boxes. For instance, in the image below the open circuit dives using
a drysuit at a specific location (Simonstad) are shown in the _Dive list_. There is no button to
activate the filter action: the action of typing text into a textbox or specifying a range
in any of the fields automatically performs the filtering. 

During filtering the Dive Mode (Open circuit, CCR, pSCR, Freedive) is added to the tag list of a dive, allowing
only specific types of dive (e.g. CCR) to be selected in the tag attribute of the filter. This is
useful for rebreather divers and free divers who also do some open circuit diving.

image::images/FilterPanel.jpg["Figure: Filter panel",align="center"]

The filter criteria can be any of the following: 

1) Using different text boxes in the _Filter panel_ performs an AND operator on different attributes. For example,
   typing "Peter" for the Persons attribute and "Sipadan" for the Location attribute results in a dive list containing
   all dives with Peter at Sipadan.

2) Within a single attribute the "All of" criterion implements an AND operator. For the _People_ attribute in
   the image below, the filtered dive list contains the dives for which BOTH Bob Smith AND Stefan Schultz
   were listed as dive buddies/divemaster based on the People information in the _Info Panel_.

3) The "Any of" criterion implements an OR operator. For the _Location_ attribute in the image below,
   the filtered dive list contains dives performed EITHER at Simonstad OR at Hout Bay.

4) The "None of" criterion implements a NOT function. For the _Suit_ attribute in the image below,
   the dive list EXCLUDES all the dives during which a drysuit was used.

5) Empty field. For the _Tags_ and _Notes_ attributes in the image below, an empty text box results
   in these attributes being not being considered during filtering.

image::images/FilterOptions.jpg["Figure: Filter options",align="center"]

At the top of the _Filter Panel_ the *yellow up-arrow* is used for resetting the filter to show all dives,
and a *red button* with white cross closes the filter panel. 

IMPORTANT: The filter action can only be stopped by using the _Reset Filter_ button (yellow up-arrow) or
by manually clearing all the filter text boxes. Closing the _Filter Panel_ does not terminate
filtering: the filtered dive list remains unchanged. This is obvious from the top bar of the _Subsurface_
window indicating that only some of all the dives are shown. Closing the _Filter Panel_ activates the _Map Panel_,
allowing viewing the map locations of the filtered dive list. For instance one might wish to filter on
Bob Smith as a buddy. Closing the _Filter Panel_ allows viewing the map locations where Bob Smith was a buddy.
To re-open the _Filter Panel_ in this case, select _Log ->  Filter divelist_ from the _Main Menu_.

== Organizing the logbook (Manipulating groups of dives)

[[S_DiveListContextMenu]]
=== The Dive List context menu

Several actions on either a single dive, or a group of dives, can be performed using the Dive List
Context Menu.  It is found by selecting either a single dive or a group of dives and then right-clicking.

image::images/ContextMenu.jpg["Figure: Context Menu",align="center"]

The context menu is used in many functions described below.

[[S_Divelist_columns]]
==== Customizing the columns showed in the *Dive List* panel

image::images/DiveListOptions.jpg["Example: Dive list info options",align="center"]

The default information in the *Dive List* includes, for each dive, Dive_number, Date, Rating, Dive_depth,
Dive_duration and Dive_location. This information can be controlled and changed by right-clicking on the
header bar of the *Dive List*, bringing up a list of columns
that can be shown in the dive list (see above). Check an items to be included in the *Dive List*.
The list is immediately updated. Preferences for information
shown in the *Dive List* are saved and used when _Subsurface_ is re-opened.

[[S_Photos_divelist]]

By selecting the _Media_ checkbox in the dropdown list, an icon is shown indicating whether any media
are associated with a particular dive. There are three icons:

[icon="images/icons/duringPhoto.png"]
[NOTE]
This dive has photographs or videos taken during the dive, typically using an underwater camera.

[icon="images/icons/outsidePhoto.png"]
[NOTE]
This dive has photographs or videos taken immediately before or immediately after the dive. This is useful for
finding photos/media of dive teams or boats just before/after the dive, whales or other surface animals seen
just before or after the dive, or of landscapes as seen from the boat.

[icon="images/icons/inAndOutPhoto.png"]
[NOTE]
This dive has photographs or videos taken both during the dive and immediately before or after the dive.

[[S_Renumber]]
=== Renumbering the dives

Dives are normally numbered incrementally from non-recent dives (low sequence
numbers) to recent dives (higher sequence numbers).  Numbering
of dives is not always consistent. For instance, when non-recent dives are
added, correct numbering does not automatically follow on because
of the dives that are more recent in date/time than the newly-added dive with
an older date/time. This requires renumbering the dives.
Do this by selecting (from the Main Menu) _Log -> Renumber_. Provide
the lowest sequence number to be used.
This results in new sequence numbers (based on date/time)
for all the dives in the *Dive List* panel.

Renumber a few selected dives in the dive list by selecting only the dives that
need renumbering. Right-click on the selected list and use the Dive List Context Menu
to perform the renumbering. A popup window appears letting the user specify
the starting number for the process.

[[S_Group]]
=== Grouping dives into trips and manipulating trips

For regular divers, the dive list can rapidly become very long. _Subsurface_
can group dives into _trips_. It does this by grouping dives that have
date/times not separated by more than two days and creating
a single heading for each diving trip represented in the dive log. Below is an
ungrouped dive list (*A*, on the left) as well as the corresponding grouped dive
list of five dive trips (*B*, on the right):

image::images/Group2.jpg["Figure: Grouping dives",align="center"]

Grouping into trips allows a rapid way of accessing individual dives without
having to scan a long lists of dives. To group the dives in a dive list,
(from the Main Menu) select _Log ->  Auto group_. The *Dive List* panel
now shows only the titles for the trips.

==== Editing the title and associated information for a particular trip

Normally, in the dive list, minimal information is included in the trip title.
More information about a trip can be added by selecting its trip title bar from
the *Dive List*. This shows a *Trip Notes* tab in the *Notes* panel. Here
you can add or edit information about the date/time, the trip location and any
other general comments about the trip as a whole (e.g. the dive
company that was used, the general weather and surface conditions during the trip, etc.).
After entering this
information, select *Save* from the buttons at the top right
of the *Trip Notes*
tab. The trip title in the *Dive List* panel should now reflect the
edited information.

==== Viewing the dives during a particular trip

Once the dives have been grouped into trips, you can expand one or more
trips by clicking the expansion button [+/-] on the left of each trip title. This expands
the selected trip, revealing individual dives during the trip.

==== Merging dives from more than one trip into a single trip

After selecting a trip title, the context menu allows the merging
of trips by either merging the selected trip with the trip below or with the
trip above. (Merge trip with trip below; Merge trip with trip above)

==== Splitting a single trip into more than one trip
If a trip includes, for example, ten dives, you can split this trip into two trips (trip 1:
top four dives; trip 2: bottom six dives) by selecting and right-clicking the top
four dives. The resulting context menu lets the user create a new trip by
choosing the option *Create new trip above*. The top four dives are then
grouped
into a separate trip. The figures below show the selection and context menu
on the left (A) and
the completed action on the right (B):

image::images/SplitDive3a.jpg["FIGURE: Split a trip into 2 trips",align="center"]

=== Manipulating single dives

==== Delete a dive from the dive log

Dives can be permanently deleted from the dive log by selecting and
right-clicking them to bring up the context menu, then selecting *Delete
dive(s)*. Typically this would apply to a case where a user wishes to delete
workshop
calibration dives of the dive computer or dives of extremely short duration.

==== Unlink a dive from a trip

You can unlink dives from the trip to which they belong. To do this,
select and right-click
the relevant dives to bring up the context menu. Then select the option *Remove dive(s)
from trip*. The dive(s) now appear immediately above or below the trip to
which they belonged, depending on the date and time of the unlinked dive.

==== Add a dive to the trip immediately above

Selected dives can be moved from the trip to which they belong and placed within
a separate trip. To do this, select and right-click
the dive(s) to bring up the context menu, and then select *Create new trip above*.

==== Shift the start time of dive(s)
Sometimes it’s necessary to adjust the start time of a dive. This may apply to
situations where dives are done in different time zones or when the dive
computer has a wrong time. To do this, select and right-click
the dive(s) to be
adjusted. This brings up the context menu on which the *Shift times*
option should be selected. You must then specify the
time
(in hours and minutes) by which the dives should be adjusted and click on the
option of whether the time adjustment should be earlier or later.

==== Merge dives into a single dive

Sometimes a dive is briefly interrupted, for example, if a diver returns to the surface
for a few minutes, resulting in two or more dives being recorded by the dive
computer and appearing as different dives in the *Dive List* panel.
Merge these dives onto a single dive by selecting the appropriate dives,
right-clicking them to bring up the context menu and then selecting *Merge selected
dives*. It may be necessary to edit the dive information in the *Notes*
panel to reflect events or conditions that apply to the merged dive. The figure
below shows the depth profile of two dives that were merged:

image::images/MergedDive.png["Example: Merged dive",align="center"]

==== Split selected dives

On some occasions, a diver reaches the surface and immediately dives again. However,
it may happen that the dive computer does not register a new dive, but continues
the previous dive due to the brief surface interval. In this case it is possible to
split a dive so that the two dives are shown as independent dives on the *Dive List*.
If this operation is performed, _Subsurface_ scans the selected dive(s) and splits the
dive at points during the dive where the depth is less than a metre.

==== Load image(s) from file(s)
This topic is discussed in the section: xref:S_LoadImage[Adding photographs or videos to dives].

==== Load image from web
This topic is discussed in the section: xref:S_LoadImage[Adding photographs or videos to dives].

==== Undo dive manipulations

Important actions on dives or trips, described above, can be undone or redone.
This includes: _delete dives_, _merge dives_, _split selected dives_, _renumber dives_ and _shift dive times_.
To do this after performing any of these actions, from the *Main Menu* select
_Edit_. This brings up the possibility to _Undo_ or _Redo_ an action.

[[S_ExportLog]]
== Exporting the dive log or parts of the dive log

The export function can be found by selecting _File ->  Export_, which brings up
the Export dialog. This dialog always gives two options: save ALL dives, or save only
the dives selected in *Dive List* panel of _Subsurface_. Click the appropriate
radio button (see images below).

image::images/Export_f20.jpg["Figure: Export dialog",align="center"]

A dive log or part of it can be saved in several formats:

* _Subsurface XML_ format. This is the native format used by _Subsurface_.

* Universal Dive Data Format (_UDDF_). Refer to _http://uddf.org_ for more information.
  UDDF is a generic format that enables communication among many dive computers
  and computer programs.

* _Divelogs.de_, an Internet-based dive log repository. In order to upload to _Divelogs.de_,
  you need a user-ID as well as a password for _Divelogs.de_. Log into _http://en.divelogs.de_
  and subscribe to this service to upload dive log data from _Subsurface_.

* _DiveShare_ is also a dive log repository on the Internet focusing on recreational
  dives. To upload dives, you need a user ID, so registration with
  _http://scubadiveshare.com_ is required.

* _CSV dive details_, that includes the most critical information of the dive
  profile. Included information of a dive is: dive number, date, time, buddy,
  duration, depth, temperature and pressure: in short, most of the information
  that recreational divers enter into handwritten log books.

* _CSV dive profile_, that includes a large amount of detail for each dive, including
  the depth profile, temperature and pressure information of each dive.

* _Dive profile_, which enables easy sharing of the dive profile using social media.
  This option writes the image of the dive profile(s) in a _.png_ graphics
  format to the folder specified in the _File save_ dialog. The saved image
  looks exactly like the on-screen profile, so ensure that all the appropriate
  profile toolbar options are activated. If several dives are
  selected, the images are written as separate graphics files. Selecting the
  _Dive profile_ option opens a window to name the file(s) to which the profile(s)
  is written. Provide a filename and select _Save_ to create the graphics output.

* _HTML_ format, in which the dive(s) are stored in HTML files, readable
  with an Internet browser. Most modern web browsers are supported, but JavaScript
  must be enabled. The HTML export cannot be changed or edited.
  It contains most of the information recorded in the dive log. However, it does not show the
  calculated values in the *Dive Profile* panel, e.g. dive ceiling, calculated cylinder pressure, gas
  pressures and MOD. The HTML export contains a search
  option to search the dive log. HTML export is specified on the second tab of the
  Export dialog (image *B* above). A typical use of this option is to export all your
  dives to a smartphone or a tablet where it would serve as a  portable record
  of dives, useful for dive companies wishing to verify the dive history of a diver,
  and doing away with the need to carry an original logbook
  when doing dives with dive companies.

* _Worldmap_ format, an HTML file with a world map upon which each dive and
  some information about it are indicated. This map is not editable. If you select any
  of the dive sites on the map, a summary of the dive is available in text, as shown
  in the image below.

image::images/mapview_f20.jpg["Figure: HTML Map export view",align="center"]

* _TeX_ format, a file for printing using the TeX typesetting
  software. Choose a filename with a '.tex' extension. You will also
  need a template file, that can be obtained from
  link:http://www.atdotde.de/%7erobert/subsurfacetemplate/[http://www.atdotde.de/~robert/subsurfacetemplate/] in the same
  directory as the '.tex' file. The file can then be processed with
  plain TeX (not LaTeX), for example by running 'pdftex filename.tex'
  on the command line.

image::images/texexample.png["Figure: Export to TeX", align="center"]

* _LaTeX_. Write the dive(s) to a LaTeX document of which the typesetting is done automatically
  using TeX. LaTeX handles page content and layout while TeX handles typesetting.

* _Image depths_, which creates a text file that contains the file names of all
  photos or videos attached
  to any of the selected dives in the _Dive List_, together with the depth underwater where
  of each of those photos/videos was taken.

When the "Anonymize" option is selected for xml-based file formats, the letters A-Z
are all replaced by the letter 'X' in the notes, buddy, divemaster, divesite name
and divesite description fields. This way, you can share dive log files for debugging
purposes without revealing personal information. Please note, though, that other
characters are not replaced, so this is not useful for languages with non-latin
characters and GPS coordinates of dive sites are preserved as well.


* _General Settings_, under the HTML tab, provides the following options:

** Subsurface Numbers: if this option is checked, the dive(s) are exported with the
   numbers associated with them in Subsurface, Otherwise the dive(s) will be numbered
   starting from 1.
** Export Yearly Statistics: if this option is checked, a yearly statistics table will
   be attached to the HTML exports.
** Export List only: a list of dives only (date, time, depth, duration) will be exported
   and the detailed dive information, e.g. dive profile, will not be available.

* Under _Style Options_ some style-related options are available like font
  size and theme.

Export to other formats can be done through third party facilities, for
instance _www.divelogs.de_.

[[S_Cloud_access]]
== Keeping a _Subsurface_ dive log in the Cloud

For each diver, dive log information is highly important. Not only is it a record
of diving activities for your pleasure, but it’s important information required
for admission to training courses or sometimes even diving sites. The
security of the dive log is critical. To have a dive log that is
resistant to failure of a home computer hard drive, loss or theft of equipment, the
Cloud is an obvious solution. This also has the added benefit that you can access your dive
log from anywhere in the world. For this reason, facilities such as _divelogs.de_ and _Diving Log_ offer to store
dive log information on the Internet.

_Subsurface_ includes access to a transparently integrated cloud storage
back end that is available to all Subsurface users. Storing and retrieving a dive log
from the cloud is no more difficult than accessing the dives on the local hard disk.
The only requirement is that you should first register as a user on the cloud.
To use _Subsurface cloud storage_ , follow these steps:

=== Create a cloud storage account

** Open the *Network Preferences* by selecting _File_ -> _Preferences_ -> _Network_.
** In the section headed _Subsurface cloud storage_, enter an email address that
   _Subsurface_ can use for user registration.
** Enter a novel password that _Subsurface_ will use to store the
  dive log in the cloud.
** Click _Apply_ to send the above email address and password to the
  (remote) cloud server. The server responds by sending a verification PIN to
  the above email address (This is the *only* occasion that _Subsurface_ uses the
  email address provided above). The *Network Preferences* dialog now has a new PIN text
   box, not visible previously.
** Enter the PIN in the corresponding text box in the *Network Preferences* dialog
(this field is only visible while the server is waiting for email
address confirmation)
** Click _Apply_ again. The _Subsurface cloud storage_ account
will be marked as verified and the _Subsurface cloud storage_ service is initialised for use.

=== Using _Subsurface cloud storage_

** Once the cloud storage has been initialized, two new items appear in the
   _File_ menu of the main menu system: _Open cloud storage_ and _Save to cloud storage_.
These options let you load and save data to the _Subsurface
cloud storage_ server.
** In the _Defaults Preferences_ tab, you can select to use the _Subsurface cloud
storage_ data as the default data file by checking the box marked _Cloud storage default file_.
 This means the data from
the _Subsurface cloud storage_ is loaded when _Subsurface_ starts and saved there when _Subsurface_ closes.

** _Subsurface_ keeps a local copy of the data and the cloud facility remains fully
functional even if used while disconnected to the Internet. _Subsurface_ simply synchronizes the
data with the cloud server the next time the program is used while the computer is
connected to the Internet.

[[S_Cloud_storage]]
=== Web access to _Subsurface cloud storage_

One of the nice side benefits of using _Subsurface cloud storage_ is that
you can also access your dive data from any web browser. Simply open
https://cloud.subsurface-divelog.org[_https://cloud.subsurface-divelog.org_],
log in with the same email and password, and you can see an HTML export of
the last dive data that was synced to _Subsurface cloud storage_. The dive information
shown is only the contents of the recorded dive logs, NOT the calculated values
shown in the *Profile* panel,
including some cylinder pressures, deco ceilings and O~2~/He/N~2~ partial pressures.

=== Other cloud services

If you prefer not to use the integrated cloud storage of dive logs (and
don't need the web access), it’s simple to store
dive logs in the cloud using several of the existing facilities on the
Internet.
For instance
https://www.dropbox.com/[_Dropbox_]
offers a free application that allows
files on the Dropbox servers to be seen as a local folder on a desktop computer.

image::images/Cloud.jpg["FIGURE: Dropbox folder",align="center"]

The _Dropbox_ program creates a copy of the _Dropbox_ Internet Cloud content on your
desktop computer. When the computer is connected to the Internet, the Internet
content is automatically updated. Therefore both the _Open_ and _Save_ of dive logs are done
using the local copy of the dive log in the local _Dropbox_ folder, so there's no need
for a direct internet connection. If the local copy is modified, e.g. by adding a dive,
the remote copy in the _Dropbox_ server in the Cloud will be automatically updated whenever
Internet access is available.


[[S_user_space]]
== Several _Subsurface_ users on one desktop computer
A frequent need is for two or more persons to use _Subsurface_ on the same desktop computer. For instance
members of a household may use the same computer or one family member may perform dive uploads for other
family members/friends. There are two approaches for doing this.

*A)* If the different users of a desktop computer do not log onto the desktop/laptop under different user names
  then the simplest way is for each person to use her/his own divelog file within Subsurface. In this case John
  would work with the _Subsurface_ file _johns-divelog_ and Joan would use _joans-divelog_. Select
  the appropriate dive log by selecting, from the *Main Menu*, _File -> Open logbook_ and then select your own
  dive log file from the list of files lower down in the menu. However, a problem arises if the users
  prefer different settings for _Subsurface_. For instance, one diver may prefer to see the dive ceiling in the
  *Profile Panel* and media icons in the *Dive List*, while the other may not have these preferences. In addition,
  the cloud connection is normally unique for each _Subsurface_ installation and if more than one user wishes to save
  dive data on the cloud, it is inconvenient to open the *Preferences* and change the user-ID data every time
  the cloud is accessed. To solve these problems, launch _Subsurface_ with a _--user=<user name>_ command-line option.
  John can then activate _Subsurface_ with this command-line instruction:

	subsurface --user=John

while Joan can launch _Subsurface_ using:

	subsurface --user=Joan

In this case, each user's preferences, settings and cloud access information are stored separately, allowing
  each diver to interact with _Subsurface_ in her/his preferred way and with individual cloud access. The above
  process can be made user-friendly by creating a link/shortcut with a desktop icon that executes the above
  command-line instruction. Use of the _--user=_ option therefore enables each user to create, maintain and
  backup a separate dive log within a personalised user interface. This way, when each diver launches _Subsurface_,
  it opens with the correct dive log as well as the appropriate display and backup preferences, and each diver
  can access their own divelog on a mobile device using https://subsurface-divelog.org/documentation/subsurface-mobile-user-manual[_Subsurface-Mobile_].

*B)* On the other hand, if the users log onto the same computer using different userIDs and passwords (i.e. users each
have a separate user space), _Subsurface_ is available independently to each user and every diver automatically has a separate
user profile and settings, including unique cloud and _Subsurface-Mobile_ access.

[[S_PrintDivelog]]
== Printing a dive log

_Subsurface_ provides a simple and flexible way to print a whole dive log or only a few selected dives.
  Pre-installed templates or a custom written template can be used to choose where the data are fitted into the page.

Some decisions need to be made before printing:

- Should the whole dive log be printed or only part of it? If only part
  is required, select the required dives from the *Dive List* panel.
- If the dive profiles are printed, what gas partial pressure information should be shown? Select
  the appropriate toggle-buttons on the button bar to the left of the *Dive Profile* panel.

If _File ->  Print_ is selected from the Main menu, the dialog below (image *A*) appears. Three
specifications are needed to get the desired information and page layout:

image::images/Print1_f22.jpg["FIGURE: Print dialog",align="center"]

1. Under _Print type_ select one of two options:

- _Dive list print_: Print dives from the *Dive List* panel with profiles and other information.
- _Statistics print_: Print yearly statistics of the dives.

2. Under _Print options_ select:

- Printing only the dives selected from the dive list before
  activating the print dialog by checking the box _Print only selected dives_. If this
  check box is *not* checked ALL dives in
  the *Dive List* panel are printed.
- Printing in color, done by checking the box with _Print in color_. If this check box
  is not checked, printing is in black and white.

3. Under _Template_ select a template to be used as the page layout. There are several choices.
(see image *B*, above).

- _Table_: This prints a summary table of all dives selected (see below).

image::images/Print_summarylist_f22.jpg["FIGURE: Print summary table",align="center"]

- _Flow layout_: Print the text associated with each dive without printing the dive profiles
     of each dive (see below):

image::images/Print_flow_layout_f22.jpg["FIGURE: Print flow layout",align="center"]

- _One Dive_: Print one dive per page, also showing the dive profile (see below)

image::images/print2_f22.jpg["FIGURE: Print one dive / page",align="center"]


- _Two Dives_: Print two dives per page, also showing the dive profiles.
- _Six Dives_: Print six dives per page, also showing the dive profiles.

You can _Preview_ the printed page by selecting the _Preview_ button on the
dialog (see image *A* at the start of this section). After preview, you can change
the options in the print dialog, so the layout fits personal taste.

Next, select the _Print_ button (see image *A* at the start of this section). This activates the regular print
dialog used by the operating system,
letting you choose a printer and set its properties (see image below):

image::images/Print_print_f22.jpg["FIGURE: Print dialog",align="center"]

Set the print resolution of the printer to an appropriate value by changing
the printer _Properties_. Finally, select the _Print_ button to print the dives.
Below is a (rather small) example of the output for one particular page.

image::images/Printpreview.jpg["FIGURE: Print preview page",align="center"]

=== Writing a custom print template (advanced)

Writing a custom template is an effective way to produce highly customized printouts. Subsurface uses HTML templates
to render printing. You can create a template, export a new template, import an existing template and delete an existing template by using
the appropriate buttons under the _Template_ dropdown list in the print dialog. See <<S_APPENDIX_E,APPENDIX E>> for information on how
to write or modify a template.

[[S_Configure]]
== Configuring a dive computer

_Subsurface_ lets you configure a dive computer. Currently, the Heinrichs-Weikamp (OSTC 2/2N/2C, OSTC 3, Sport) and
Suunto Vyper (Stinger, Mosquito, D3, Vyper, Vytec,
Cobra, Gekko and Zoop) family of dive computers are supported. A large number of settings of these dive computers
can be read and changed to different values. To begin, be sure the appropriate hardware driver
is installed for the dive computer (also required for downloading dives) and the device name of the dive computer is known.
See <<_appendix_a_operating_system_specific_information_for_importing_dive_information_from_a_dive_computer,APPENDIX A>> for information on how to do this.

Once the dive computer is connected to the _Subsurface_ computer, select _File ->  Configure dive
computer_ from the _Main Menu_. Select the appropriate device name (or mount point) in the
dropdown list at the
top of the configuration panel and select the appropriate dive
computer model from the panel on the left-hand (see image below).

image::images/Configure_dc_f20.jpg["FIGURE: Configure dive computer",align="center"]

Using the appropriate buttons on the configuration panel, the following actions can be done:

 - *Retrieve available details*. This loads the existing configuration from the dive computer
   to _Subsurface_, showing it in the configuration panel.
 - *Save changes to device*. This changes the configuration of the
   dive computer to correspond to the information shown in the configuration panel.
 - *Backup*. This saves the configuration data to a file. _Subsurface_ asks for
   a file location and file name for the saved information.
 - *Restore backup*. This loads the information from a backup file and displays it
   in the configuration panel.
 - *Update firmware*. If new firmware is available for the dive computer, this is
   loaded into the dive computer.


[[S_Preferences]]
== Setting user _Preferences_ for _Subsurface_

There are several user-definable settings within _Subsurface_, found by selecting
_File ->  Preferences_, mostly affecting the way in which _Subsurface_
shows dive information to the user. The settings are in
six panels: _General_, _Units_, _Profile_, _Language_, _Network_, and _Georeference_,
all of which operate on the same principles: specified settings can be applied to the display of
the dive log by selecting _Apply_. At this stage, any new settings only apply to the present
session and are not saved. In order to apply
new settings permanently, select the _Save_ button. If you do not wish to
apply the new preferences, select _Cancel_.

=== General

There are several headings in the *General* panel:

image::images/Pref1.jpg["FIGURE: Preferences general page",align="center"]

  ** *Lists and tables*: Specify the font type and font size of the
     *Dive Table* panel: decreasing the font size allows one to see more dives on a screen.

  ** *Dives*: For the _Default Dive Log File_ specify the directory and
     file name of your
     electronic dive log book. This is a file with filename extension of either _.xml_ or _.ssrf_. When
     launched, _Subsurface_ will automatically load the specified dive log book. There are three options:
     - _No default file_: When checked, _Subsurface_ does not automatically load a dive log at startup.
     - _Local default file_: When checked, _Subsurface_ automatically loads a dive log from the local hard disk.
     - _Cloud storage default file_: When checked, _Subsurface automatically loads the dive log from the cloud
       device that was initialized using the *Preferences* _Network_ tab (see below).

  ** *Display invalid*:  Dives can be marked as invalid (when a user wishes to hide
     dives that he/she doesn't consider valid dives, e.g. pool dives, but still want to
     keep them in the dive log). This controls whether those dives are displayed in
     the dive list.

  ** *Default cylinder*: From the dropdown list, select the default cylinder to be used in
     the *Equipment* tab of the *Notes* panel.

  ** *Animations*: Some actions in showing the dive profile are performed using
     animations. For instance, the axis values for depth and time change from dive to
     dive. When viewing a different dive, these changes in axis characteristics do not
     happen instantaneously, but are animated. The _Speed_ of animations can be controlled
     by setting this slider
     with faster animation speed to the left, and a 0 value representing no animation
     at all.

  ** *Video thumbnails*: In generating thumbnails for videos associated with dives, _Subsurface_
     needs to have the appropriate information (see section on <<S_ViewMedia,View Images>>). Three preferences need to be set
     as explained in <<S_APPENDIX_F, APPENDIX F>>. These are: a) switch on thumbnails, b) specify
     the location of the _ffmpeg_ program and c) set the place within video where the thumbnail needs
     to be obtained from.

  ** *Clear all settings*: As indicated in the button below this heading, all settings are
     cleared and set to default values.

=== Units
image::images/Pref2_f23.jpg["FIGURE: Preferences Units page",align="center"]

Choose between metric and imperial units of depth, pressure,
volume, temperature and mass. By selecting the Metric or Imperial radio button
at the top, you can specify that all units are in the chosen measurement system.
Alternatively, if you select the *Personalize* radio button, units can be selected
independently, with some in the metric system and others in imperial.

Regardless
of the above settings, dive time measurements can be either in seconds or minutes.
Choose the appropriate option. GPS coordinates can be represented either as
traditional coordinates (degrees, minutes, seconds) or as decimal degrees
Choose the appropriate option.

=== Profile
This panel has three sections:

[[S_CCR_options]]
image::images/Pref4_f23.jpg["FIGURE: Preferences Graph page",align="center"]

[[S_GradientFactors]]
* *Gas pressure display setup*. Even though nitrogen and helium pressures are also included here, these items mainly pertain to oxygen management:
** _Thresholds_: _Subsurface_ can display graphs of the nitrogen, oxygen and the helium
   partial pressures during
   the dive, activated using the toolbar on the left of the *Dive Profile*
   panel. For each of these graphs, specify a threshold value. If any of the graphs go
   above the specified threshold, the graph is
   highlighted in red, indicating the particular partial pressure threshold has been exceeded.
   The pO~2~ threshold is probably the most important one and a value of 1.6 is commonly used.
** _pO~2~ in calculating MOD_ is used for calculating the maximum operative depth for a particular
   nitrox or trimix gas mixture. A value of 1.4 is commonly used.

** CCR Options: These options determine oxygen management for CCR dives:

*** _Dive planner default setpoint_: Specify the O~2~ setpoint for a
    CCR dive plan. This determines the pO~2~  maintained
    during a particular dive. Setpoint changes during the dive can be added via the
    profile context menu.

*** _CCR: Show O~2~ sensor values when viewing pO~2~:_ Show the pO~2~
    values associated with each of the individual oxygen sensors of a CCR system.
    See the section on xref:S_CCR_dives[Closed Circuit Rebreather dives].

*** _CCR: Show setpoints when viewing pO~2~:_ With this checkbox activated, the pO~2~
    graph on the dive profile has an overlay in red which indicates the CCR setpoint
    values. See the section on xref:S_CCR_dives[Closed Circuit Rebreather dives].

**  _pSCR options_. These preferences determine how passive semi-closed circuit (pSCR) dives
    are planned and how the pSCR deco ceiling is calculated:

*** _Metabolic rate:_ this is the
    volume of oxygen used by a diver during a minute. Set this value for pSCR dive planning
    and decompression calculations.

*** _pSCR ratio:_ The dilution ratio (or dump ratio) is the ratio of gas released to the
    environment to that of the gas recirculated to the diver. A 1:10 ratio is commonly used.

*** _Show equivalent OC with pSCR pO~2~_: The pO~2~ in the pSCR loop is usually lower than the
    pO~2~ of the fresh gas from the cylinder. Activating this checkbox allows the pO~2~ graph
    in the dive profile to also show the pO~2~ of the fresh gas entering the loop.

* *Ceiling display setup*. These settings mostly deal with nitrogen and helium management
   by determining how the decompression ceiling (ascent ceiling) is calculated and displayed:

** _Draw dive computer reported ceiling red_: This checkbox does exactly what it says. By default
   the computer reported ceiling is shown in white.
   Not all dive computers report ceiling values. If the dive computer does report it, it may differ
   from the ceilings calculated by _Subsurface_ because of the different algorithms and
   gradient factors, as well as the dynamic way a
   dive computer calculates ceilings during a dive.

** _Algorithm for calculating ceiling_. Choose between the Bühlmann Z1H-L16
   decompression model and the VPM-B model:
*** _VPM-B_: Provide a conservatism level for calculating the VPM-B ceiling. Values between 0
    (least conservative) and 4 (most conservative) are valid.

[[GradientFactors_Ref]]

*** Bühlmann: Set the _gradient factors_ (GFLow and GFHigh) for calculating the deco ceiling following
   the ZH-L16 algorithm. GF_Low is the gradient factor at depth and GF_High is used at the surface.
   At intermediate depths gradient factors between GF_Low and GF_High are used.
   Gradient factors add conservatism to nitrogen and helium exposure during a dive, in a
   similar way that many dive computers have a conservatism setting. The lower
   the value of a gradient factor, the more conservative the calculations are with
   respect to inert gas loading and the deeper the ceilings are. Gradient
   factors of 20/60 are considered conservative and values of 70/90 are considered
   harsh.
   For more information see:

 *** http://www.tek-dive.com/portal/upload/M-Values.pdf[Understanding M-values by Erik Baker, _Immersed_ Vol. 3, No. 3.]

 *** link:http://www.rebreatherworld.com/general-and-new-to-rebreather-articles/5037-gradient-factors-for-dummies.html[Gradient factors for dummies, by Kevin Watts]


* *Misc*

** _Show unused cylinders in Equipment Tab_: This checkbox allows display of information about unused cylinders when viewing the
*Equipment Tab*. If this box is not checked, and if any cylinders entered using the *Equipment Tab* are not used (e.g. there
was no gas switch to such a cylinder), then these cylinders are omitted from that list.
**  _Show mean depth_: If this box is checked, the *Dive Profile* panel contains a grey line that shows
    the mean depth of the dive, up to any time instant during the dive. Normally this is a u-shaped line indicating the deepest mean depth just before
   ascent.


=== Language
Choose a language that _Subsurface_ will use.

image::images/Pref3_f23.jpg["FIGURE: Preferences Language page",align="center"]

Check the _System Default_ language i.e. the language of the underlying operating system
if this is appropriate. This is the default setting in _Subsurface_.
To change it, uncheck this checkbox and pick a language / country
combination from the list of locations. The _Filter_ text box
to list similar languages. For instance there are several system variants of English
or French. *This particular preference requires a restart of _Subsurface_ to take
effect*.

In this section also specify appropriate date and time formats for showing dive details.

=== Network
This panel facilitates communication between _Subsurface_ and data sources on the Internet.
This is important, for instance, when _Subsurface_ needs to communicate with web
services such as Cloud storage, or when you want to communicate through a proxy.


image::images/Pref5_f23.jpg["FIGURE: Preferences Network page",align="center"]

This dialog has three sections:

** _Proxy_:
If a proxy server is used for Internet access, the type of proxy needs to be selected from the dropdown list,
after which the IP address of the host and the appropriate port number should
be provided. If the proxy server uses authentication, the appropriate userID and
password are required so that _Subsurface_ can automatically pass
through the proxy server to access the Internet. This information is usually obtained
from your ISP.

** _Subsurface cloud storage_: To store your dive log in the cloud, a valid email address
   and password are required. This lets _Subsurface_ email security information
   regarding cloud storage to you, and to set up cloud storage appropriately.
   Two additional options are given:
   - _Sync to cloud in the background_: This option allows saving of dive information to the cloud storage
   while you do other things within _Subsurface_.
   - _Save password locally_: This allows local storage of the cloud storage password. Note that this
   information is saved in raw text form, not encoded in any way.


=== Georeference

_Subsurface_ provides a geo-lookup service (that is, given the coordinates of a dive site) derived from
a click on the *Dive Map panel* at the bottom right of the _Subsurface_ window, or from a GPS instrument or
from the _Subsurface-Mobile_ app). A search on the Internet is done to find
the name of the closest known location. This function only works if _Subsurface_ has an
Internet connection. The preference of the dive site name can be configured, e.g. _Country/State/City_
or _City/State/Country_ (see image below).

image::images/Pref7_f23.jpg["FIGURE: Georeference panel",align="center"]

[[S_DivePlanner]]
== The _Subsurface_ dive planner
Dive planning is an advanced feature of _Subsurface_, accessed by selecting
_Log ->  Plan Dive_ from the main menu. It allows calculation of
inert gas load during a dive by using the Bühlmann ZH-L16 algorithm with the addition
of gradient factors as implemented by Erik Baker, or using the VPM-B model.

****
[icon="images/icons/warning2.png"]
[WARNING]

The _Subsurface_ dive planner IS EXPERIMENTAL
and assumes the user is already familiar with the _Subsurface_
user interface. It is explicitly used under the following conditions:

- The user is conversant with dive planning and has the necessary training to perform
  dive planning.
- The user plans dives within his/her certification limits.
- Dive planning makes large assumptions about the characteristics of the _average person_
  and cannot compensate for individual physiology or health or personal history or
  life style characteristics.
- The safety of a dive plan depends heavily on the way in which the planner is used.
- The user is familiar with the user interface of _Subsurface_.
- A user who is not absolutely sure about any of the above requirements should not use
  this feature.
****

=== The _Subsurface_ dive planner screen

Like the _Subsurface_ dive log, the planner screen is divided into several sections (see image below). The *setup*
parameters for a dive are entered into the sections on the left hand and bottom side of the screen.
They are: Available Gases, Rates, Planning, Gas Options and Notes.

At the top right hand is a green *design panel* on which the profile of the dive can be
manipulated directly by dragging and clicking as explained below. This feature makes the
_Subsurface_ dive planner unique in ease of use.

At the bottom right is a text panel with a heading of _Dive Plan Details_. This is where the details of
the dive plan are provided in a way that can easily be copied to other software. This is also where
any warning messages about the dive plan are printed.

image::images/PlannerWindow1.jpg["FIGURE: Dive planner startup window",align="center"]


=== Open circuit dives

-  Towards the center bottom of the planner (circled in blue in the image above) is a dropdown list with three options. Select the appropriate one of these:
 ** Open Circuit (the default)
 ** CCR
 ** pSCR

- Choose the Open Circuit option.
- In the top left-hand area of the planning screen, be sure the constant dive parameters are
  appropriate. These are: Start date and time of the intended dive, Atmospheric Pressure and Altitude
  above sea level of the dive site. The atmospheric pressure can also be entered as an altitude
  in meters, assuming a sea-level atmospheric pressure of 1.013 bar.

- In the table labelled _Available Gases_, add the information of the cylinders to be used
  as well as the gas composition within that cylinder. This is done in a similar way as for
  <<cylinder_definitions,providing cylinder data for dive logs>>. Choose the cylinder type by
  double clicking the cylinder type and using the dropdown list, then specify the start
  pressure of this cylinder. By leaving the oxygen concentration (O~2~%) field empty,
  the cylinder is assumed to contain air. Otherwise enter the oxygen and/or helium
  concentration in the boxes provided in this dialog. Add additional cylinders by using the
  "+" icon to the top right-hand of the dialog.

- The _Available Gases_ table includes three gas depth fields, labelled:
 ** Deco switch at: the switch depth for deco gases. Unless overridden by the user, this will be
    automatically calculated based on the Deco pO~2~ preference (default 1.6 bar)
 ** Bot. MOD: the gas Maximum Operating Depth (MOD) if it is used as a bottom mix. Automatically
    calculated based on the Bottom pO~2~ preference (default 1.4 bar). Editing this field will modify the
    O~2~% according to the depth set. Set to ''*'' to calculate the best O~2~% for the dive maximum depth.
 ** MND: the gas Maximum Narcotic Depth (MND). Automatically calculated based on the Best Mix END
    preference (default 30m / 98 ft). Editing this field will modify the He% according to the depth set.
    Set to ''*'' to calculate the best He% for the dive maximum depth.

- The profile of the planned dive can be created in two ways:
 *  Drag the waypoints
    (the small white circles) on the existing dive profile to represent the dive. Additional
    waypoints can be created by double-clicking the existing dive profile. Waypoints can be deleted
    by right-clicking a particular waypoint and selecting the _delete_ item from the resulting
    context menu.
 *  The most efficient way to create a dive profile is to enter the appropriate values into the table
    marked _Dive planner points_. The first line of the table represents the duration and the final
    depth of the descent from the surface. Subsequent segments describe the bottom phase of the dive.
    The _CC setpoint_ column is only relevant for closed circuit divers.
    The ascent is usually not specified because this is what the planner is supposed to calculate.
    Add additional segments to the profile by selecting the "+" icon at the top right hand of the
    table. Segments entered into the _Dive planner points_ table automatically appear in the *Dive
    Profile* diagram.

==== Recreational dives

Recreational mode is intended for what most divers would call "recreational", "sports"or "nontechnical" dives,
remaining within no-deco limits (NDL).
It computes the maximum time a diver can stay at the current depth without needing mandatory decompression
stops and without using more than the existing gas (minus a reserve). The planner automatically takes
into account the nitrogen load incurred in previous dives. But conventional dive tables are also used in a
way that can take into account previous dives. Why use a dive planner for recreational dives? The subsurface
dive planner provides two significant advantages over the use of recreational dive tables for dive planning.

Firstly, using recreational dive tables, the maximum depth of each previous dive is taken into account. But
few dives are done at a constant depth corresponding to the maximum depth (i.e. a "square" dive profile). This means
dive tables overestimate the nitrogen load incurred during previous dives. The _Subsurface_
dive planner calculates nitrogen load according to the real dive profiles of all uploaded previous dives,
in a similar way as dive computers calculate nitrogen load during a dive. This means that the diver gets 'credit,'
in terms of nitrogen load, for not remaining at maximum depth during
previous dives, so a longer subsequent dive can be planned.
For the planner to work it's therefore crucial to log previous dives
in _Subsurface_ before doing dive planning.

Secondly, recreational dive tables are not designed to build additional safety features into a dive. NDL times
derived from dive tables often take divers close to the limit where decompression sickness (DCS) can arise. The
Subsurface dive planner allows a diver to build more safety features into a dive plan, preventing recreational
divers from getting close to the limits of getting a DCS hit. This is performed by specifying appropriate
gradient factors for a dive plan, as explained below.

To plan a dive, the appropriate settings need to be defined.

- Ensure the date and time is set to that of the intended dive. This allows calculation of
the nitrogen load incurred during previous dives.

- Immediately under the heading _Planning_ are two checkboxes _Recreational_ and _Safety Stop_.
  Check these two boxes.

- Then define the cylinder size,
  the gas mixture (air or % oxygen) and the working cylinder pressure in the top left-hand
  section of the planner under _Available gases_.

- The planner calculates whether the specified cylinder contains enough air/gas to complete
  the planned dive. In order for this to be accurate, under _Gas options_, specify an appropriate
  surface air consumption (SAC) rate for _Bottom SAC_. Suitable values are between 15 l/min and 30 l/min,
  with novice divers or difficult dives requiring SAC rates closer to 30l/min.

- Define the amount of gas the cylinder must have at the end of the bottom section of the
  dive just before ascent. A value of 50 bar is often used. The reason for this reserve gas is to provide for the possible
  need to bring a buddy to the surface using gas sharing. How much gas is used in
  sharing depends on the depth of the ascent. This can be difficult to estimate, so most agencies assume a
  fixed amount of gas, or actually of pressure e.g. 40 or 50 bar or 25% or 33% (rule of thirds). But _Subsurface_ can do better
  because it knows about the ascent and that is why we add the amount of gas during the ascent.

- Define the depth of the dive by dragging the waypoints (white dots) on the dive profile or
  (even better) defining the appropriate depths using the table under _Dive planner points_ as
  described under the previous heading. If
  this is a multilevel dive, set the appropriate dive depths to represent the dive plan by adding
  waypoints to the dive profile or by adding appropriate dive planner points to the _Dive Planner Points_
  table. _Subsurface_ will automatically extend the bottom section of the dive to the maximum
  duration within the no-decompression limits (NDL).

- The ascent speed can be changed. The default ascent speeds are those considered safe for recreational
  divers.

- To build additional safety into the dive plan (over and above those of recreational dive tables),
  specify gradient factors less than 100% (_GFHigh_
  and _GFLow_ under the _Planning_ heading in the planner). On the other hand, to
  approximate the values in recreational dive tables, set the gradient factors to 100.
  By reducing the values of GFHigh and GFLow to values below 100, one
  can build more safety into a dive. Decreasing the values of the gradient factors below 100 will shorten the
  duration of the dive. This is the price of a larger safety margin. Reasons for using gradient factors less than 100
  may be the age of the diver, the health of a diver, or unusual conditions such as cold water or strong currents.
  Realistic conservative values for the gradient factors are GFLow=40% and GFHigh=80%. This allows you to
  create a custom dive plan, suited to yourself as well as the dive conditions.

Below is an image of a dive plan for a recreational dive at 30 meters with gradient factors of 100. Because the no-deco limit (NDL) is 22
minutes, there remains a significant amount of air in the cylinder at the end of the dive.

image::images/Planner_OC_rec1.jpg["FIGURE: A recreational dive plan: setup",align="center"]

The dive profile in the planner shows the maximum dive time within no-deco limits using the
Bühlmann ZH-L16 algorithm and the gas and depth settings specified as described above. The _Subsurface_ planner
allows rapid assessment of dive duration as a function of dive depth, given the nitrogen load incurred during previous dives. The
dive plan includes estimates of the amount of air/gas used, depending on the cylinder settings specified
under _Available gases_. If the start cylinder pressure is left blank, the dive duration shown is the
true no-deco limit (NDL) without taking into account gas used during the dive. If the surface above the dive profile is RED
it means that recreational dive limits are exceeded and either the dive duration or the dive depth needs to be reduced.

Below is the same dive plan as above, but with a safety stop and reduced gradient factors for
a larger safety margin.

image::images/Planner_OC_rec2.jpg["FIGURE: A recreational dive plan: gradient factors setup",align="center"]

==== Non-recreational open circuit dives, including decompression

Non-recreational dive planning involves exceeding the no-deco limits and/or using multiple breathing gases.
These dives are planned in three stages:

*a) Nitrogen management*: This is done by specifying the rates for descent and ascent,
as well as the deco model (GFLow, GFHigh or Conservatism level) under the headings _Rates_ and _Planning_
to the bottom left of the planning screen. Two deco models are supported the Bühlmann model and the VPM-B
model. Select one of the two models. When selecting the Bühlmann model, the gradient factors (GFHigh and GFLow
need to be specified. Initially, the GFHigh and GFLow values in the _Preferences_
panel of _Subsurface_ is used. If these are changed within the planner (see _Gas Options_ within
the planner), the new values are
used without changing the original values in the _Preferences_.
Gradient Factor settings strongly affect the calculated ceilings and their depths.
A very low GFLow value brings on decompression stops early during the dive.

 ** For more information about Gradient factors, see the section on xref:S_GradientFactors[Gradient Factor Preference settings].

If the VPM-B model is selected, the Conservatism_level needs to be specified on a scale of 0 (least conservative) to 4 (most conservative).
This model tends to give deco stops at deeper levels than the Bühlmann model and often results in slightly shorter
dive durations than the Bühlmann model, albeit at the cost of higher tissue compartment pressures in the slow tissues.
When selecting one of these models, keep in mind they are NOT exact physiological models but
only mathematical models that appear to work in practice.

Please note as well that there is an intrinsic assumption of the VPM-B
model that off-gassing only happens during the ascent phase of the
dive (which is the part controlled by the planner). Thus it is
possible to get misleading results if you manually enter waypoints
well in the decompression phase of your dive. This is particularly
relevant when editing a dive read from disk in the planner since that
will have waypoints up to the surface. Thus for those dives, first
delete all waypoints during the ascent phase. This is most easily done by
holding the Ctrl- or Command-key while clicking on the trash can icon
next to the first ascent waypoint in the table on the left hand side.

For more information external to this manual see:

 * link:http://www.tek-dive.com/portal/upload/M-Values.pdf[Understanding M-values by Erik Baker, _Immersed_ Vol. 3, No. 3.]
 * link:http://www.rebreatherworld.com/general-and-new-to-rebreather-articles/5037-gradient-factors-for-dummies.html[Gradient factors for dummies, by Kevin Watts]
 * link:https://www.amazon.com/Deco-Divers-Decompression-Theory-Physiology/dp/1905492073/ref=sr_1_1?s=books&ie=UTF8&qid=1403932320&sr=1-1&keywords=deco+for+divers[_Deco for Divers_, by Mark Powell (2008). Aquapress] Southend-on-Sea, UK. ISBN 10: 1-905492-07-3.
An excellent non-technical review that discusses both the Bühlmann deco model and the VPM-B model.

The ascent rate is critical for nitrogen off-gassing at the end of the dive and is specified
for several depth ranges, using the mean depth as a yardstick. The mean depth
of the dive plan is shown by a light grey line on the dive profile. Ascent rates
at deeper levels are often in the range of 8-12 m/min, while ascent rates near the surface are
often in the range of 4-9 m/min. The descent rate is also specified. If the option _Drop to first depth_
is activated, the descent phase of the planned dive will be at the maximal descent rate specified
in the _Rates_ section of the dive setup.

*b) Oxygen management*: In the *Gas Options* part of the dive specification, the maximum partial
pressure for oxygen needs to be specified for the
bottom part of the dive (_bottom po2_) as well as for the decompression part of the dive (_deco po2_).
Commonly used values are 1.4 bar for the bottom part of the dive and 1.6 bar for any decompression
stages. Normally, a partial pressure of 1.6 bar is not exceeded. The depth at which switching to a gas
takes place can be edited in the
_Available Gases_ dialog. Normally, the planner decides on switching to a new gas when, during
ascent, the partial pressure of the new gas has decreased to 1.6 bar.

*c) Gas management*: With open-circuit dives this is a primary
consideration. Divers need to keep within the limits of the amount of
gas within the dive
cylinder(s), allowing for an appropriate margin for a safe return to the surface, possibly
sharing with a buddy. Under the _Gas Options_ heading, specify the best (but conservative) estimate
of your surface-equivalent air consumption (SAC, also termed RMV) in
liters/min (for the time being, only SI units are supported). Specify the SAC during the
bottom part of the dive (_bottom SAC_) as well as during the decompression or safety stops of the
dive (_deco SAC_). Values of 15-30 l/min are common. For good gas management, a guess
is not sufficient and you needs to
monitor gas consumption on a regular basis, dependent on different dive conditions and/or equipment.
The planner calculates the total volume of gas used during the dive and issues a warning
if you exceeds the total amount of gas available. Good practice demands that divers not dive to
the limit of the gas supply but that an appropriate reserve is kept
for unforeseen circumstances.
For technical diving, this reserve can be up to 66% of the total available gas.
In addition to calculating the total gas consumption for every cylinder the planner provides one way
of calculating the recommended volume of bottom gas which is needed for safe ascent to the
first deco gas change depth or the surface. This procedure is called the "minimum gas" or "rock bottom"
consideration and it is used by various (but not all)
technical diving organisations. See the text below for a detailed explanation.

Now you can start the detailed time-depth planning of the dive. _Subsurface_ offers an unique
graphical interface for doing planning. The mechanics are
similar to hand-entering a dive profile in the dive log part of _Subsurface_. Upon activating the
planner, a default dive of depth 15 m for 20 min is offered in the blue design surface in the top
right hand part of the planner window. The white dots (waypoints) on the
profile can be dragged with a mouse. Create more waypoints by double-clicking on the profile
line and ensuring the profile reflects the intended dive. Drag the waypoints to represent
the depth and duration of the dive. It is NOT necessary to specify the ascent part of the dive
since the planner calculates this, based on the existing settings.
If any of the management limits (for nitrogen, oxygen or gas) are exceeded, the surface
above the dive profile changes from BLUE to RED.

Each waypoint on the dive profile creates a _Dive Planner Point_ in the table on the
left of the dive planner panel. Ensure the _Used Gas_ value in each row
of that table corresponds to one of the gas mixtures specified in the _Available Gases_ table.
Add new waypoints until the main features of the dive have been completed, e.g. the
bottom time segment and deep stops (if these are implemented). In most cases _Subsurface_
computes additional way points in order to fulfill decompression requirements for that
dive. A waypoint can also be moved by selecting it and by using the arrow keys.
The waypoints listed in the _Dive Planner Points_ dialog can be edited by hand in
order to get a precise presentation of the dive plan. In fact, it is sometimes more easy to create the
whole dive profile by editing the _Dive Planner Points_ dialog.

Show any changes in gas cylinder used by indicating gas changes as explained
in the section <<S_CreateProfile,hand-creating a dive profile>>. These changes should
reflect the cylinders and gas compositions defined in the table with _Available Gases_.
If two or more gases are used, automatic gas switches will be planned during the ascent to
the surface.

Cylinders used for the plan need to be entered in the table of _Available gases_. In the column
_Type_ select the appropriate cylinder size by using the dropdown list that appears when
double-clicking a cell in this column. By default, a large number of sizes are listed,
and a new cylinder size can be created by typing this into the text box. The cylinder size, start pressure
and default switch depths are initialised automatically. Specify the gas composition
(e.g. helium and oxygen content). A non-zero value in the "CC setpoint" column of the table of dive planner points
indicates a valid setpoint for oxygen partial pressure and that the segment
is dived using a closed circuit rebreather (CCR). If the last manually entered
segment is a CCR segment, the decompression phase is computed assuming the diver
uses a CCR with the specified set-point. If the last segment (however
short) is on open circuit (OC, indicated by a zero set-point) the
decompression is computed in OC mode and the planner only considers gas
changes in OC mode.

Enter dive profile segments in the _Dive planner points_ table by providing a time duration for
a segment as well as its final depth. If more than one cylinder is used during the dive, ensure that
the appropriate cylinder is selected for each segment of the dive plan by double-clicking the
cell and selecting the appropriate cylinder from the dropdown list in the _Used gas_ column.
If required, insert a row in the _Dive planner points_ table by adding a new line and then setting the
_Run time_ value appropriately. In image A below, a segment (using an EAN50 cylinder) has been added and
you wish to use this gas during the very start of the dive (the other gas is not breathable at the surface).
Upon pressing Enter on the keyboard, that segment is moved to the top of that table and the plan is adjusted
automatically to take into account this new segment of the dive plan (image B below).

image::images/planner1.jpg["FIGURE: Planning a dive: segments",align="center"]

Below is an example of a dive plan to 55m using Tx20/30 and the Bühlmann algorithm,
followed by an ascent using EAN50 and using the settings as described above.

image::images/Planner_OC_deco.jpg["FIGURE: Planning a dive: setup",align="center"]

Once the above steps have been completed, save by clicking the _Save_ button
towards the top middle of the planner. The saved dive plan will appear
in the *Dive List* panel of _Subsurface_.

*The dive plan details*

On the bottom right panel of the dive planner, under _Dive Plan Details_, the details
of the dive plan are provided. These may be modified by checking any of the
options under the _Notes_ section of the dive planner, immediately to the left
of the _Dive Plan Details_. If a _Verbatim dive plan_
is requested, a detailed sentence-level explanation of the dive plan is given. If any
of the management specifications have been exceeded during the planning, a warning
message is printed underneath the dive plan information.

If the option _Display segment duration_ is checked, then the duration of each depth
level is indicated in the _Dive Plan Details_. This duration INCLUDES the transition
time to get to that level. However, if the _Display transition in deco_ option is checked,
the transitions are shown separately from the segment durations at a particular level.

*Dive plan variations*: The planner has a check box _Display plan variations_. By checking this box, the planner
provides information about a dive that is a little deeper or slightly
longer than the planned dive. This is found near the top of the _Dive plan details_
where the dive duration is indicated. The information is intended to be used if it is necessary to
modify the ascent "on the fly" in the case of unexpected deviations from the dive plan during the dive.
For example, if it says "Runtime: 123min, Stop times + 2:49 /m + 1:30 /min" this means: if you dive deeper
than planned, you should add almost 3 minutes per meter you go deeper to your decompression (and
you can subtract 3 minutes per meter that you stay shallower). If you overstay your bottom
time, you need to add one and a half minutes to the stops for each minutes you overstay
and similarly, you can shorten your deco time by one and a half minute for each minute
you stay shorter. These variations of depth and time are based on the last manually entered segment of the
dive (not necessarily the deepest). The additional minutes should be distributed
over the different stops in a way proportional to the stop length, i.e. add more of the
additional minutes to the longer, shallower stops. The given times refer to the
duration of the decompression phase and do not include the extended bottom time!
This way of altering dive plans becomes inaccurate for large deviations from the original
plan. So it should not be trusted for more than a few minutes or meters of
deviations from the planned bottom time. Checking this option creates a lot of additional computation,
to such a degree that the planner is slower than otherwise.

*Minimum gas requirements*: The planner also estimates the _minimum gas_ pressure
required for safe ascent after an event that causes the dive to be aborted. The
calculation assumes that in worst case an out of gas (OoG)
situation occurs at the end of the planned bottom time at maximum depth, requiring
additional time at maximum depth to solve the problem and forcing
the buddy pair the share the gas of one diver. In addition the combined SAC of both
divers is increased by an estimated factor compared to the SAC of a single diver under normal conditions.
The result of the minimum gas calculation for the bottom gas is printed to the planner output. There
are two selector boxes on the left of the _Dive plan details_:

 * _SAC factor_. This is an estimate of the degree to which your SAC increases if a critical problem arises underwater,
   e.g. gas sharing or entanglement. Realistic values range from 3 to 5, reflecting the gas use of two divers sharing
   a single gas cylinder after an OoG situation.
 * _Problem solving time_. This is an estimate of how long you would take to solve the problem before starting the ascent
   to terminate the dive. The default value is 2 minutes.

Using the above information, the planner then estimates what the minimum bottom gas cylinder pressure needs to be for a
safe ascent. This information is given near the bottom of the _Dive plan details_, following the calculation of
bottom gas used during the dive if it exactly follows the plan. the minimum gas is typically given as:

  Minimum gas (based on 2.0xSAC/+1min@81m): 2130 l/90bar/Δ:+80bar

This indicates:

 * Within parentheses, the _SAC factor_ and _Problem solving time_ specified.
 * The number of liters of back gas required for a safe ascent (2130 litres in the example above)
 * The number of bars of back gas required for a safe ascent (90 bars in the example above).
 * The delta-value: number of bars of back gas available at the end of the bottom section of the dive, _over and above_ the minimum
   gas requirement (80 bars in the above example). A positive delta reflects a safe plan; a negative delta indicates insufficient gas for a
   safe ascent.

No automatic checks are performed based on this result.
The feature only gives valid results for simple, rectangular shaped single
level dive profiles. For multi level dives one would need to check every leg of the profile independently.

*Isobaric counterdiffusion information*: For gas switches during the ascent in hypoxic open-circuit trimix dives information
about isobaric counterdiffusion (icd) is given near the bottom of the _Dive plan details_, based on the
rule-of-fifths (i.e. during a gas change, the increase in nitrogen partial pressure should not exceed
one fifth of the corresponding decrease in partial pressure of helium). For each gas change, two lines
are printed, indicating the changes in gas fractions (%) and the equivalent changes in partial pressures. If the
rule-of-fifths is not met, the relevant information is highlighted in red and a warning message appears
at the bottom of that table. The gas change events on the dive profile also provide information on icd,
visible at the bottom of the _Information box_ when the mouse hovers on the respective gas change icon. This information
is only shown for gas changes relevant with respect to icd. If the rule-of-fifths is not met,
a red warning exclamation mark is shown over the gas change icon. When relevant, the _Information box_ contains
information such as: ICD ΔHe:-13% ΔN₂+3%>2.6%. This means: for this gas change, the helium
decreased with 13% while the nitrogen increased with 3% which
is more than the 2.6% maximum increase in nitrogen suggested by the rule-of-fifths.

****
[icon="images/icons/warning2.png"]
[WARNING]
The *plan variations* and *minimum gas* estimates are only guidelines for a diver performing
dive planning, intended to enhance the safety of executing a particular dive plan and do not
replace formal contingency planning for a specific dive. They are NOT precise and should
NOT be relied upon as the only safety features in dive planning. Interpret these estimates
within the framework of your formal training to perform dive planning.
****

=== Planning pSCR dives

To plan a dive using a passive semi-closed rebreather (pSCR), select _pSCR_ rather than
_Open circuit_ in the dropdown list.
The parameters of the pSCR dive can be set by selecting  _File ->   Preferences ->   Profile_
from the main menu, where the gas consumption calculation takes into account the pSCR dump
ratio (default 1:8) as well as the metabolic rate. Specify the bottom and deco SAC rates.
Here the SAC in the planner is the volume of gas per minute
that is exhaled into the loop on the surface, *not* the amount of gas that escapes into the water.
The calculation takes the oxygen drop
across the mouthpiece of the rebreather into account. If the
pO~2~ drops below what is considered safe, a warning appears in the _Dive plan
details_. A typical pSCR cylinder setup is very similar to an open circuit dive;
one or more dive cylinders, possibly with different bottom and decompression
gases, including gas switches during the dive like in open circuit diving.
Therefore, the setup of the _Available gases_ and the _Dive planner points_ tables
are very similar to that of a open circuit dive plan, described above. However, no oxygen setpoints
are specified for pSCR dives. Below is a dive plan for a pSCR dive. The dive is comparable
to that of the CCR dive below, but note the longer ascent duration due to the lower oxygen
in the loop due to the oxygen drop across the mouthpiece of the pSCR equipment.

image::images/Planner_pSCR.jpg["FIGURE: Planning a pSCR dive: setup",align="center"]

==== Planning for pSCR bailout

[icon="images/pscr_b1.jpg"]
[NOTE]
Open circuit diving is often part of a pSCR dive because, at shallow depths, the pO~2~ in the loop is often
too low for breathing and the shallow parts of a pSCR dive are often done on OC. The change
from rebreather mode to OC or _vice versa_ is indicated using bailout events. There are two ways to plan
bailout in rebreather dives: 1) Check the _Bailout_ checkbox in the _Dive mode_ section of the planner. In this
case, bailout requirements will be calculated starting at the last segment of the dive specified in the _Dive planner points_ table. 2) If
bailout takes place at another point in the dive (see example of cave dive below) then bailout is planned
by manipulating the *Dive mode* column of the *Dive planner points* table. The image on the
left shows a pSCR dive plan (using three cylinders) where the shallow parts of the dive are performed using EAN50 in
order to have a sufficient pO~2~. The bottom part of the dive is performed with EAN31 (Cyl. 2 in the
*Available gases* table, also indicated in the *Dive planner points* table). The third cylinder,
also EAN31, is a bailout cylinder which is, initially, not used.
In this case the plan is for a cave dive with a bottom time of 20 minutes
and the turning point in the bottom part of the dive is at 16 minutes (i.e. ten minutes
into the bottom part of the dive). The orange pO~2~ graph indicates the equivalent OC pO~2~ during
the dive and the green pO~2~ indicates the estimated pO~2~ in the loop, the
whole dive being performed in rebreather mode. We wish to plan
for a worst-case scenario with bailout at the turning point (i.e. the furthest point into
the cave). In the *Dive planner points* table, change the *Dive mode* of the last two segments
to *OC* (indicated in the left-hand image, labelled *A*, below). In this case the existing EAN31
cylinder (Cyl.2 in the *Dive planner points* table is used for bailout (i.e. the bailout
cylinder [Cyl. 3] has not been used yet). Note that the pO~2~ graph now indicates the appropriate
pO~2~ values, since the gas breathed now has the pO~2~ of an OC configuration. In order to switch
to the bailout cylinder (Cyl. 3), indicate this by selecting the appropriate cylinder in the *Dive planner points* table as
indicated in the image on the right, below (labelled *B*). The icon on the depth profile
now shows an overlapping bailout event with cylinder change. As in the graph on the left, the appropriate
pO~2~ values are shown in the pO~2~ graphs. The volumes of gas required can be obtained at the bottom of the
*Dive plan details* panel.

image::images/pscr_b2.jpg["FIGURE: Planning a pSCR dive: setup",align="center"]

In the case of a pSCR dive plan for open water, the worst-case scenario is probably bailout at the end of the deepest part of the dive
and this could be achieved using the _Bailout_ checkbox of the planner.
Alternatively create a 1-minute segment at the end of the deepest part of the dive plan. This
last segment (represented by the bottom row of the *Dive planner points* table) is then manipulated using the *Dive mode* and *Used gas*
columns, as in the cave example, above. See the example of bailout for a CCR dive, below, that uses this approach.

=== Planning CCR dives

To plan a dive using a closed circuit rebreather, select the _CCR_ option in the dropdown
list, circled in blue in the image below.

*Available gases*: In the _Available gases_ table, enter the cylinder information for the
diluent cylinder and for any bail-out cylinders. Do NOT enter the information for the oxygen
cylinder since it is implied when the _CCR_ dropdown selection is made.

*Entering setpoints*: Specify a default setpoint in the Preferences tab, by selecting _File ->  Preferences ->  Profile_ from
the main menu. All user-entered segments in the _Dive planner points_ table
use the default setpoint value. Then, different setpoints can be specified for dive segments
in the _Dive planner points_ table. A zero setpoint
means the diver bails out to open circuit mode for that segment. Decompression is always calculated
using the setpoint of the last manually entered segment. So, to plan a bail out ascent for a
CCR dive, add a one-minute dive segment to the end with a setpoint value of 0. The decompression
algorithm does not switch deco-gases automatically while in CCR mode (i.e. when a positive setpoint is specified) but
this is calculated for bail out ascents.

The dive profile for a CCR dive may look something like the image below.

image::images/Planner_CCR.jpg["FIGURE: Planning a CCR dive: setup",align="center"]

Note that, in the _Dive plan details_, the gas consumption for a CCR segment is not calculated,
so gas consumptions of 0 liters are the norm.

==== Planning for CCR bailout

[icon="images/CCR_b1.jpg"]
[NOTE]
It is often necessary to plan for a worst-case bailout event in order to ensure sufficient bailout gas to reach the
surface, taking into account decompression. This is done by 1) checking the _Bailout_ checkbox of the dive planner
(bailout will be calculated starting at the last segment of the dive specified in the _Dive planner points_ table);
2) defining a 1-minute segment at the end of the bottom part
of the dive, as in the image on the left where a CCR dive to 40m for 21 minutes is planned;
3) changing to an OC-gas during any segment in the _Dive planner points_ table.


[icon="images/CCR_b2.jpg"]
[NOTE]
In the _Dive planner points
table_, change the _Dive mode_ of this 1-minute segment to _OC_. This signifies bailout. In this case there is bailout to
the existing diluent cylinder (assuming this cylinder has sufficient gas). The appropriate pO~2~ and cylinder pressure
graphs are shown in the dive profile, as in the image on the left. Note that the setpoint drops to zero after bailout, since
this value does not apply to breathed bailout gas.


[icon="images/CCR_b3.jpg"]
[NOTE]
In order to plan for bailout to an external bailout cylinder, change  the _Used gas_ for the 1-minute segment to the
appropriate cylinder, as in the example on the left. Note that the cylinder change as well as the bailout are indicated with
overlapping icons.

The volumes of gases required for bailout can be found at the bottom of the *Dive plan details* panel.

[[S_Replan]]
=== Modifying an existing dive plan

Normally, when a dive plan has been saved, it is accessible from the *Dive List*, like any
other dive log. Within the *Dive List* there is no way to change a saved dive plan.
To change a dive plan, select it on the *Dive List*. Then, in the main menu,
select _Log ->  Re-plan dive_. This will open the selected dive plan within the dive planner,
allowing changes to be made and saved as usual.

In addition, there is the option "Save new". This keeps the original
planned dive and adds a (possibly modified, - earlier dives are now taken into account -) copy to the dive list. If
that copy is saved with the same start time as the original, the two
dives are considered two versions of the same dive and do not
influence other each during decompression calculation (see next section).

=== Planning for repetitive dives

Repetitive dives can easily be planned if the dates and start times of the
repetitive dive set
are specified appropriately in the top left-hand _Start Time_ field. _Subsurface_
calculates the gas loading figures and the affect of the first dive is
evaluated on later dives.

If you have just completed a long/deep dive and are planning
another dive, then highlight, in the *Dive List*, the dive that has just been logged
then activate the planner. Depending on the start time of the planned dive,
the planner takes into account the gas loading during the completed dive
and plans accordingly.

If only a few standard configurations are used (e.g. in GUE), then a template dive can
be created conforming to one of the configurations. If you want to plan a dive using
this configuration, highlight the template dive in the *Dive List* and activate the
planner: the planner takes into account the configuration in the highlighted dive.

=== Printing the dive plan

Selecting the _Print_ button in the planner allows printing of the _Dive Plan Details_
for wet notes. You can also cut and paste the _Dive Plan Details_ to
include in a text file or word processing document.

However, after the plan has been saved, it is
represented in a way very similar to a dive log and the gas calculations cannot be
accessed in the same way as during the planning process. The only way to print the
dive plan is to use the _File ->  Print_ function on the main menu in the
same way as for dive logs or by copy and paste to a word processor.

[[S_MergeDivePlan]]
=== Saving a dive with its dive plan

In the section dealing with <<S_MultipleDiveComputers, dives using more than one dive computer>>
we discussed the way in which multiple profiles for a single dive can be viewed using the
left-arrow and right-arrow keyboard keys. A similar method can be used for saving a dive plan
with the profile of the actual dive, once this has been uploaded into _Subsurface_.
In order to do this:

- Do the dive planning and save the final plan in the _Dive List_.
- After diving, upload the dive data from the dive computer.
- Change the date and time of the _dive plan_ to coincide with that of the
  real-life dive from the _dive computer_.
- In the _Dive List_, highlight the dive plan as well as the data for the real dive
  and merge the two dives, making use of the Dive List Context Menu
  (available by right-clicking a dive).

The text version of the dive plan is appended to the Notes in the _Notes Tab_. With this
merged dive highlighted in the _Dive List_, switch
between the planned profile and the real-life profile using the right-arrow/left-arrow keyboard keys.

== Running _Subsurface_ from the command-line
_Subsurface_ can be launched from the command-line to set some specialised settings or as
part of an script-based automated process for manipulating a dive log. The format for launching _Subsurface_ from the
command-line is:

	subsurface [options] [logfile ...] [--import logfile ...]

The options include:
|====================
|*Command-line option*|*Description*
|--help|Print a summary of the command-line options
| -h|Print a summary of the command-line options
|--import logfile ...|A file name before this option is treated as an existing dive log, everything after is imported into the existing dive log
|--verbose|Print debug information while running _Subsurface_
| -v|Print debug information while running _Subsurface_
| -v -v| Print even more debug information while running _Subsurface_
|--version|Prints the current version of _Subsurface_
|--survey|Opens the xref:S_UserSurvey[user survey] immediately after starting _Subsurface_
|--user=<username>|Choose the xref:S_user_space[configuration space] of user <username>
|--cloud-timeout=<duration>|Set the timeout for cloud connection (0 < duration < 60). This enables longer timeouts for slow Internet connections
|====================

== Description of the Subsurface Main Menu items

This section describes the functions and operation of the items in the Main Menu
of Subsurface. Several of the items below are links to sections of this manual
dealing with the appropriate operations.

=== File
- <<S_NewLogbook,_New Logbook_>> - Close the currently open dive logbook and
  clear all dive information.
- _Open logbook_ - Open the file manager to select a dive
  logbook to open.
- _Save_ - Save the dive logbook currently open.
- _Save as_ - Save the current logbook under a different file name.
- _Open cloud storage_ - Open the dive log previously saved in <<S_Cloud_storage,_Cloud storage_>>.
- _Save to cloud storage_ - Save the current dive log to <<S_Cloud_storage,_Cloud storage_>>.
- _Cloud storage online_ - Switch between the online version of the logbook,  and the locally stored one.
- _Close_ -  Close the dive logbook currently open.
- <<S_ExportLog,_Export_>> -  Export the currently open dive logbook (or
  the selected dives in the logbook) to one of several formats.
- <<S_PrintDivelog,_Print_>> -  Print the currently open logbook.
- <<S_Preferences,_Preferences_>> -  Set the _Subsurface_ preferences.
- <<S_FindMovedImages, _Find moved media_>> - If photos/videos taken during dives have been moved to
      a different disk or directory, locate them and link them to the appropriate dives.
- <<S_Configure,_Configure dive computer_>> - Edit the configuration of a dive computer.
- _Quit_ - Quit _Subsurface_.


=== Edit
- The Edit option allows one to undo or redo an action, e.g. deleting dives.

=== Import
- <<S_ImportDiveComputer,_Import from dive computer_>> - Import dive information
  from a dive computer.
- <<Unified_import,_Import Log Files_>> - Import dive information from a file in
  in a _Subsurface_-compatible format.
- <<S_ImportingDivelogsDe,_Import from Divelogs.de_>> - Import dive information
  from _www.Divelogs.de_.

=== Log
- <<S_EnterData,_Add Dive_>> - Manually add a new dive to the *Dive List* panel.
- <<S_DivePlanner,_Plan Dive_>> - Plan  dives.
- <<S_Replan,_Edit dive in planner_>> - Edit a dive plan that has been saved into the *Dive List*.
- <<S_CopyComponents,_Copy dive components_>> - Copy information
  from several fields of a dive log onto the clipboard.
- _Paste dive components_ - Paste, into the selected dives in the *Dive List*,
  the information copied using the _Copy dive components_ option.
- <<S_Renumber,_Renumber_>> - Renumber the dives listed in the *Dive List*
  panel.
- <<S_Group,_Auto Group_>> - Group the dives in the *Dive List* panel into dive
  trips.
- <<S_DeviceNames,_Edit Device Names_>> - Edit the names of dive computers to coordinate your logs.
- <<S_Filter,_Filter divelist_>> - Select only some dives, based on specific tags or dive criteria.

=== View
- <<S_ViewPanels,_All_>> - View the four main _Subsurface_ panels
  all at once.
- <<S_ViewPanels,_Dive List_>> - View only the *Dive List* panel.
- <<S_ViewPanels,_Profile_>> - View only the *Dive Profile* panel.
- <<S_ViewPanels,_Info_>> - View only the *Notes* panel.
- <<S_ViewPanels,_Globe_>> - View only the *World Map* panel.
- _Yearly Statistics_ - Display summary statistics about dives during this and past
  years.
- _Prev DC_ - Switch to data from previous dive computer, if a single dive was logged from more than one.
  See the sections on <<S_MultipleDiveComputers,using multiple dive computers for the same dive>> and <<S_MergeDivePlan,
  Saving an uploaded dive with its dive plan>>.
- _Next DC_ - Switch to next dive computer.
- _Full Screen_ - Toggles Full Screen mode.

=== Help
- _About Subsurface_ - Show a panel with the version number of _Subsurface_ as
  well as licensing information.
- _Check for updates_ - Find out whether a newer version of Subsurface is available
  on the https://subsurface-divelog.org/[_Subsurface_ web site].
- <<S_UserSurvey,_User survey_>>  - Help to make _Subsurface_ even better by taking part in our user survey
  or by completing another survey if your diving habits have changed.
- _User manual_ - Open a window showing this user manual.



== APPENDIX A: Operating system specific information for importing dive information from a dive computer.

=== Make sure that the OS has the required drivers installed
[icon="images/icons/drivers.jpg"]
[NOTE]
The operating system of the desktop computer needs the appropriate drivers in
order to communicate with the dive computer, the way the dive
computer prefers (e.g. Bluetooth, USB, infra-red).

	* On Linux users need to have the correct kernel
	  module loaded. Most distributions will do this automatically, so the
	  user does not need to load kernel modules. However, some communication
	  protocols require an additional driver, especially for rarely used
	  technology such as infra-red.

	* On Windows, the OS should offer to download the correct
	  driver once the user connects the dive computer to the USB port and
	  operating system sees the equipment for the first time.

	* On a Mac users sometimes have to manually hunt for the correct
	  driver. For example the correct driver for the Mares Puck
	  devices or any other dive computer using a USB-to-serial interface
	  based on the Silicon Labs CP2101 or similar chip can be found as
	  _Mac_OSX_VCP_Driver.zip_ at the
https://www.silabs.com/support/pages/document-library.aspx?p=Interface&f=USB%20Bridges&pn=CP2101[Silicon Labs document and software repository].

[[S_HowFindDeviceName]]
=== How to Find the Device Name for USB devices and set its write permission
[icon="images/icons/usb.jpg"]
[NOTE]
When connecting a dive computer by using a USB connector, usually
_Subsurface_ will either propose a drop down list with the
correct device name (or mount point for the Uemis Zurich), or it will
disable the device select drop down if no device name is needed at
all. In the rare cases where this doesn't work, here are some
ways to find out what the device name is:

.On Windows:

Simply try COM1, COM2, etc. The drop down list should contain all connected COM
devices.

.On MacOS:

The drop down box should find all connected dive computers.

.On Linux:

There is a definitive way to find the port:

 - Disconnect the USB cable from the dive computer
 - Open a terminal
 - Type the command: 'dmesg' and press enter
 - Plug in the USB cable of the dive computer
 - Type the command: 'dmesg' and press enter

A message similar to this one should appear:

	usb 2-1.1: new full speed USB device number 14 using ehci_hcd
	usbcore: registered new interface driver usbserial
	USB Serial support registered for generic
	usbcore: registered new interface driver usbserial_generic
	usbserial: USB Serial Driver core
	USB Serial support registered for FTDI USB Serial Device
	ftdi_sio 2-1.1:1.0: FTDI USB Serial Device converter detected
	usb 2-1.1: Detected FT232BM
	usb 2-1.1: Number of endpoints 2
	usb 2-1.1: Endpoint 1 MaxPacketSize 64
	usb 2-1.1: Endpoint 2 MaxPacketSize 64
	usb 2-1.1: Setting MaxPacketSize 64
	usb 2-1.1: FTDI USB Serial Device converter now attached to ttyUSB3
	usbcore: registered new interface driver ftdi_sio
	ftdi_sio: v1.6.0:USB FTDI Serial Converters Driver

The third line from the bottom shows that the FTDI USB adapter is
detected and connected to +ttyUSB3+. This information can now be used in
the import settings as +/dev/ttyUSB3+ which directs Subsurface to the correct
USB port.

Ensuring the user has write permission to the USB serial port:

On Unix-like operating systems the USB ports can only be accessed by users who
are members special group that can be e.g.
+dialout+ or +uucp+. This can be verified by listing the appropriate
device permissions e.g. by +ls -l /dev/ttyUSB0+. Note that the number in
the file name depends on how many USB devices you have connected, and
must be adjusted appropriately.
If you are not root, you may not be a member of
that group and
won't be able to use the USB port. Let us assume your username is 'johnB'.

 - As root, type: +usermod -a -G dialout johnB+  (Ubuntu users: +sudo usermod
-a -G dialout johnB+)
This makes johnB a member of the +dialout+ group.
 - Type: +id johnB+     This lists all the groups that johnB belongs to and
verifies that
the appropriate group membership has been created. The +dialout+ group should
be listed
among the different IDs.
 - Under some circumstances this change takes only effect (eg. on Ubuntu) after
you log out and then log in again.

With the appropriate device name (e.g. +dev/ttyUSB3+) and with write permission
to the USB
port, the dive computer interface can connect and you should be able to import
dives.


[[S_HowFindBluetoothDeviceName]]
=== Manually setting up Bluetooth enabled devices
[icon="images/icons/bluetooth.jpg"]
[NOTE]
For dive computers communicating through Bluetooth like the Heinrichs
Weikamp Frog or the Shearwater Predator, Petrel and Nerd there is a
different procedure to get the device’s name to communicate with
_Subsurface_. Follow these steps:

 * *For the dive computer, after enabling Bluetooth, be sure it is in Upload mode.*

For Bluetooth pairing of the dive computer, refer to the
manufacturer's user guide. When using a Shearwater Predator/Petrel/Nerd, select
_Dive Log ->  Upload Log_ and wait for the _Wait PC_ message.

 * *Pair the _Subsurface_ computer with the dive computer.*

==== On Windows:

Bluetooth is most likely already enabled. For pairing with the dive computer choose
_Control Panel ->  Bluetooth Devices ->  Add Wireless Device_.
This should bring up a dialog showing your dive computer (which should be in Bluetooth mode) and
allowing pairing. Right click on it and choose _Properties->  COM
Ports_ to identify the port used for your dive computer. If there are several
ports listed, use the one saying "Outgoing" instead of "Incoming".

For downloading to _Subsurface_, the _Subsurface_ drop-down list should contain
this COM port already. If not, enter it manually.

Note: If there are issues afterwards when downloading from the dive computer using
other software, remove the existing pairing with the dive computer.

==== On MacOS:

Click on the Bluetooth symbol in the menu bar and select _Set up
Bluetooth Device..._. The dive computer should then show up in the list of devices. Select it and go
through the pairing process. This step should only be needed once for
initial setup.

Once the pairing is complete, the correct device is shown in the
'Device or Mount Point' drop-down in the _Subsurface_ *Import* dialog.

==== On Linux
Be sure Bluetooth is enabled on the _Subsurface_ computer.
On most common distributions this should be true out of the box and
pairing should be straightforward. For instance, Gnome3 shows a
Bluetooth icon on the right of the toolbar at the top of the screen.
Users have reported difficulties with some Bluetooth controllers.  If you have an onboard controller,
try that first.  It is simplest if you remove any USB Bluetooth dongles.  If you have a USB dongle that
came with your dive computer, try that before any others.

Setting up a connection to download dives from your Bluetooth-enabled device, such as the
_Shearwater Petrel_, is not yet an automated process and will generally require the command prompt.
It is essentially a three step process.

 - Enable the Bluetooth controller and pair your dive computer
 - Establish an RFCOMM connection
 - Download the dives with Subsurface

Ensure the dive computer is in upload mode. On the _Shearwater Petrel_, _Petrel 2_ and _Nerd_
cycle through the menu, select 'Dive Log', then 'Upload Log'.  The display will read 'Initializing', then
'Wait PC 3:00' and will countdown.  Once the connection is established, the display reads 'Wait CMD ...'
and the countdown continues. When downloading the dive from Subsurface, the display reads 'Sending' then
'Sent Dive'.

To establish the connection, establish root access through +sudo+ or +su+.
The correct permission is required to download the dives in the computer. On most Linux systems this means becoming
a member of the dialout group (This is identical as for many dive computers using a Linux USB port, described
in the previous section). On the command terminal, enter:

+sudo usermod -a -G dialout username+

Then log out and log in for the change to take effect.

===== Enabling the Bluetooth controller and pairing your dive computer

Attempt to set up the Bluetooth controller and pair your dive computer using the graphical
environment of the operating system. After setting the dive computer to upload mode, click the Bluetooth icon in the system tray
and select 'Add new device'. The dive computer should appear. If asked for a password, enter 0000.
Write down or copy the MAC address of your dive computer - this needed later and should be in the form 	00:11:22:33:44:55.

If the graphical method doesn't work, pair the device from the command line. Open a terminal
and use +hciconfig+ to check the Bluetooth controller status.

	$ hciconfig
	hci0:	Type: BR/EDR  Bus: USB
		BD Address: 01:23:45:67:89:AB  ACL MTU: 310:10  SCO MTU: 64:8
		*DOWN*
		RX bytes:504 acl:0 sco:0 events:22 errors:0
		TX bytes:92 acl:0 sco:0 commands:21 errors:0

This indicates a Bluetooth controller with MAC address 01:23:45:67:89:AB, connected as hci0.
Its status is 'DOWN', i.e. not powered.  Additional controllers will appear as hci1, etc.
If there is not a Bluetooth dongle plugged in upon booting the computer, hci0 is probably the onboard.
Now power on the controller and enable authentication:

	sudo hciconfig hci0 up auth+  (enter password when prompted)
	hciconfig
	hci0:  Type: BR/EDR  Bus: USB
		BD Address: 01:23:45:67:89:AB  ACL MTU: 310:10  SCO MTU: 64:8
		*UP RUNNING PSCAN AUTH*
		RX bytes:1026 acl:0 sco:0 events:47 errors:0
		TX bytes:449 acl:0 sco:0 commands:46 errors:0

Check that the status now includes '+UP+', '+RUNNING+' AND '+AUTH+'.

If there are multiple controllers running, it's easiest to turn off the unused controller(s). For example, for +hci1+:

	sudo hciconfig hci1 down

Next step is to 'trust' and 'pair' the dive computer. On distros with Bluez 5, such as Fedora 22,
you can use a tool called +blutootctl+, which will bring up its own command prompt.

	bluetoothctl
	[NEW] Controller 01:23:45:67:89:AB localhost.localdomain [default]
	[bluetooth]# agent on
	Agent registered
	[bluetooth]# default-agent
	Default agent request successful
	[bluetooth]# scan on                        <----now set your dive computer to upload mode
	Discovery started
	[CHG] Controller 01:23:45:67:89:AB Discovering: yes
	[NEW] Device 00:11:22:33:44:55 Petrel
	[bluetooth]# trust 00:11:22:33:44:55        <----you can use the tab key to autocomplete the MAC address
	[CHG] Device 00:11:22:33:44:55 Trusted: yes
	Changing 00:11:22:33:44:55 trust succeeded
	[bluetooth]# pair 00:11:22:33:44:55
	Attempting to pair with 00:11:22:33:44:55
	[CHG] Device 00:11:22:33:44:55 Connected: yes
	[CHG] Device 00:11:22:33:44:55 UUIDs: 00001101-0000-1000-8000-0089abc12345
	[CHG] Device 00:11:22:33:44:55 Paired: yes
	Pairing successful
	[CHG] Device 00:11:22:33:44:55 Connected: no

If asked for a password, enter 0000. It's ok if the last line says 'Connected: no'. The important part
is the line above, +Pairing successful+.

If the system has Bluez version 4 (e.g. Ubuntu 12.04 through to 15.04), there is probably not a
+bluetoothctl+, but  a script called +bluez-simple-agent+ or just +simple-agent+.

	hcitool -i hci0 scanning
	Scanning ...
		00:11:22:33:44:55       Petrel
		bluez-simple-agent hci0 00:11:22:33:44:55

Once the dive computer is paired, set up the RFCOMM connection.

===== Establishing the RFCOMM connection

The command to establish an RFCOMM connection is:

+sudo rfcomm -i <controller> connect <dev> <bdaddr> [channel]+

- +<controller>+ is the Bluetooth controller, +hci0+.
- +<dev>+ is the RFCOMM device file, +rfcomm0+
- +<bdaddr>+ is the dive computer's MAC address, +00:11:22:33:44:55+
- +[channel]+ is the dive computer's Bluetooth channel we need to connect to.

If you omit it, channel 1 is assumed.  Based on a limited number of user reports,
the appropriate channel for the dive computer is probably:

- _Shearwater Petrel 1_: channel 1
- _Shearwater Petrel 2_: channel 5
- _Shearwater Nerd_: channel 5
- _Heinrichs-Weikamp OSTC Sport_: channel 1

E.g. to connect a _Shearwater Petrel 2_, set the dive computer to upload mode and enter:

	sudo rfcomm -i hci0 connect rfcomm0 00:11:22:33:44:55 5 (enter a password, probably 0000, when prompted)

This gives the response:

	Connected /dev/rfcomm0 to 00:11:22:33:44:55 on channel 5
	Press CTRL-C for hangup

To connect a _Shearwater Petrel 1+ or + HW OSTC Sport+, set the dive computer to upload mode and enter:

	sudo rfcomm -i hci0 connect rfcomm0 00:11:22:33:44:55   (enter a password, probably 0000, when prompted)
	Connected /dev/rfcomm0 to 00:11:22:33:44:55 on channel 1
	Press CTRL-C for hangup

If the specific channel the dive computer needs is not known, or the channel in the list above doesn't
work, the command +sdptool records+ should help determine the appropriate channel. The output
below is for a _Shearwater Petrel 2_.

	sdptool -i hci0 records 00:11:22:33:44:55
	Service Name: Serial Port
	Service RecHandle: 0x10000
	Service Class ID List:
		"Serial Port" (0x1101)
		Protocol Descriptor List:
		"L2CAP" (0x0100)
		"RFCOMM" (0x0003)
		Channel: 5

For a Bluetooth dive computer not in the list above, or if the channel listed is not correct, please
let the Subsurface developers know on the user forum or the developer mailing list _subsurface@subsurface-divelog.org_.

===== Download the dives with Subsurface
After establishing the RFCOMM connection and while the dive computer's upload mode countdown is still running, go to_Subsurface_, select _Import->Import from dive computer_ and enter appropriate Vendor (e.g. _Shearwater_), Dive Computer (_Petrel_), Device or Mount Point (_/dev/rfcomm0_) and click _Download_.




[[_appendix_b_dive_computer_specific_information_for_importing_dive_information]]

== APPENDIX B: Dive Computer specific information for importing dive data.

[[S_ImportUemis]]
=== Importing from Uemis Zurich

[icon="images/icons/iumis.jpg"]
[NOTE]
_Subsurface_ downloads the information
stored on the SDA (the built-in file system of the Uemis) including
information about dive spots and
equipment. Buddy information is not yet downloadable.
Things are very similar to a normal USB-connected dive computer
(the Uemis is one of those that recharge when connected to the USB port).
The main difference is that you don’t enter a
device name, but instead the location where the UEMISSDA file system is
mounted once connected to the dive computer. On Windows this is a drive letter (
often 'E:' or 'F:'), on a Mac this is
'/Volumes/UEMISSDA' and on Linux systems this differs depending on the
distribution. On Fedora it usually is
'/var/run/media/<your_username>/UEMISSDA'. In all cases _Subsurface_
should suggest the correct location in the drop down list.

After selecting the above device name, download the
dives from the Uemis Zurich. One technical issue with the Uemis Zurich
download implementation (this is a Uemis firmware limitation, not a
_Subsurface_ issue) is that you cannot download more than about 40-50
dives without running out of memory on the SDA. This will usually only
happen the very first time you download dives from the Uemis Zurich.
Normally when downloading at the end of a day or even after a dive
trip, the capacity is sufficient. If _Subsurface_ displays an error
that the dive computer ran out of space, the solution is straightforward.
Disconnect the SDA, turn it off and on again, and reconnect
it. You can now retry (or start a new download session) and the
download will continue where it stopped previously. You
may have to do this more than once, depending on how many dives are
stored on the dive computer.

[[S_ImportingGalileo]]
=== Importing from Uwatec Galileo

[icon="images/icons/Galileo.jpg"]
[NOTE]
The Uwatec Galileo dive computers use infra red (IrDA) communication
between the dive computer and Subsurface. The Uwatec hardware uses
a USB dongle based on the serial infra-red (SIR) protocol and the
MSC7780 IrDA controller manufactured by MosChip
and marketed by Scubapro and some electronics companies.
Under Linux, the kernel
already provides for communication using the IrDA protocol. However,
the user additionally needs to load a driver for the IrDA interface
with the dive computer. The easiest way is to load the *irda-tools*
package from the http://irda.sourceforge.net/docs/startirda.html[Linux IrDA Project].
After the installation of the irda-tools, the *root user* can specify a device name
from the console as follows:
+irattach irda0+

After executing this command, Subsurface will recognize the Galileo
dive computer and download dive information.

Under Windows, a similar situation exists. Drivers for the MCS7780 are
available from some Internet web sites e.g.
http://www.drivers-download.com/Drv/MosChip/MCS7780/[www.drivers-download.com]. Windows-based IrDA
drivers for the Uwatec can also be downloaded from the ScubaPro web site, with drivers located on
the download page for the ScubaPro SmartTrak software.

For the Apple Mac, IrDA communication via the MCS7780 link is not
available for OSX 10.6 or higher.

[[S_ImportingDR5]]
=== Importing from Heinrichs Weikamp DR5

[icon="images/icons/HW_DR5.jpg"]
[NOTE]
When mounted as a USB drive the Heinrichs Weikamp DR5 saves a single UDDF file
for every dive.
Mark all the dives you'd like to import or open.
Note: The DR5 does not seem to store gradient factors nor deco information, so
for _Subsurface_ it is not possible to display them. Adjust the gradient
factors in the _Profile Settings_ in _Subsurface_ to generate a deco overlay in the
_Subsurface_ *Dive Profile* panel but please note that the deco calculated by
_Subsurface_ will most likely differ from the one displayed on the DR5.


[[S_ImportingXDeep]]
=== Importing from xDEEP BLACK

[icon="images/icons/HW_xdeepblack.jpg"]
[NOTE]
Each dive has to be individually saved as UDDF file using "Export UDDF" option in BLACK's logbook menu.
When mounted as a USB drive UDDF files are available in LOGBOOK directory.
Note: The xDEEP BLACK saves NDL time but does not seem to store gradient factors nor deco information, so
for _Subsurface_ it is not possible to display them. Adjust the gradient
factors in the _Profile Settings_ in _Subsurface_ to generate a deco overlay in the
_Subsurface_ *Dive Profile* panel but please note that the deco calculated by
_Subsurface_ will most likely differ from the one displayed on the xDEEP BLACK.


=== Importing from Shearwater Predator/Petrel/Nerd using Bluetooth

[icon="images/icons/predator.jpg"]
[NOTE]
Specific instructions for downloading dives using Bluetooth are  given in the section above, <<S_Bluetooth,_Connecting Subsurface to a Bluetooth-enabled dive computer_>>.

[[S_PoseidonMkVI]]
=== Importing from Poseidon MkVI Discovery

[icon="images/MkVI.jpeg"]
[NOTE]
Download of dive logs from the MkVI is performed using a custom communications
adapter and the _Poseidon PC Configuration Software_, obtained when purchasing
the MKVI equipment. The latter is a Windows application allowing configuration
of equipment and storage of dive logs. Communication between dive computer and
desktop computer utilizes the IrDA infra-red protocol. Only data for one dive
can be downloaded at a time, in three files:

- Setup configuration for the dive and key dive parameters (file with a .txt
  extension)
- Dive log details (file with a .csv extension)
- Redbook format dive log (file with .cvsr extension). This is a compressed
  version of the dive log using a proprietary format.

_Subsurface_ accesses the .txt and the .csv files to get dive log information.


=== Importing from APD Inspiration/Evolution CCR

[icon="images/APDComputer.jpg"]
[NOTE]
The dive logs of an APD Inspiration or similar CCR dive computer are downloaded using
a communications adapter and _AP Communicator_, obtained when
purchasing the equipment. The dive logs can be viewed using the _AP Log Viewer_,
within Windows or Mac/OS. However, APD logs can be viewed and managed from within
_Subsurface_ (together with dives using many other types of dive computer). The
APD inspiration dive logs are imported into _Subsurface_ as follows:

- Download the dive using _AP Communicator_.
- Open a dive within the _AP Log Viewer_.
- Select the tab at the top of the screen, entitled "_Data_".
- With the raw dive log data show on the screen, click on "_Copy to Clipboard_".
- Open a text editor, e.g. Notepad (Windows) or TextWrangler (Mac).
- Copy the contents of the clipboard into the text editor and save the text file
  with a filename extension of _.apd_.
- Within _Subsurface_, select _Import ->  Import log files_ to open the xref:Unified_import[universal import dialog].
- In the dropdown list towards the bottom right of the dialog (labelled 'Filter:'), select "APD log viewer".
- On the list of file names select the _.apd_ file  created. An import
  dialog opens showing the default settings for the data in the
_.apd_ file. If changes are required,
  do this as for xref:S_ImportingCSVDives[CSV imports].

image::images/APD_CSVimportF22.jpg["Figure: APD log viewer import",align="center"]

- The top left hand dropdown box in the import panel lets you select the APD dive computer
  for which the dive log needs to be imported. The default it is DC1, _i.e._ the
  first of the two dive computers the APD uses. It is possible to sequentially
  import the data for both dive computers by first importing CD1 and then DC2.(*Hint*: The logs
  for the two dive computers are viewed by selecting _View  ->  Next DC_ from
  the Main Menu after the uploading has been completed)
- Click the _Ok_ button at the bottom of the import panel.

The APD dive log will appear within _Subsurface_. The dive computer- generated ceiling
provided by the Inspiration can be viewed by selecting the appropriate
button on the left of the *Dive Profile*. Cylinder pressure data are not logged
by the APD equipment but can be manually entered in the _Equipment_ Tab.

== APPENDIX C: Exporting Dive log information from external dive log software.

The import of dive log data from external dive log software is mostly performed
using
the dialog found by selecting _Import_ from the Main Menu, then clicking on
_Import Log Files_. This is a single-step process, more information about which
can be found
xref:Unified_import[here.]
However, in some cases, a two-step process may be required:

1. Export the foreign dive log data to format that is accessible from
  _Subsurface_.
2. Import the accessible dive log data into _Subsurface_.

This appendix provides some information about approaches to export dive log
data from foreign
dive log software. The procedures below mostly apply to Linux and/or Windows.

[[S_ImportingDivesSuunto]]
=== Exporting from *Suunto Divemanager (DM3, DM4 or DM5)*
[icon="images/icons/suuntologo.jpg"]
[NOTE]
DiveManager is a Windows application for Suunto dive computers.
Divemanager 3 (DM3) is an older version of the Suunto software. More recent
Suunto dive computers use Divemanager version 4 or 5 (DM4 or DM5). The
different versions of Divemanager use different methods and different file naming
conventions to export dive log data.

*Divemanager 3 (DM3):*

1. Start 'Suunto Divemanager 3' and log in with the name containing the logs
2. Do not start the import wizard to import dives from the dive computer.
3. In the navigation tree on the left side of the program-window, select the appropriate
   dives.
4. Within the list of dives, select the dives you would like to import later:
	* To select certain dives: hold 'ctrl' and click the dive
	* To select all dives:  Select the first dive, hold down shift and
	  select the last dive
5. With the dives marked, use the program menu _File ->  Export_
6. The export pop-up will show. Within this pop-up, there is one field called 'Export Path'.
	* Click the browse button next to the field Export Path
		** A file-manager like window pops up
		** Navigate to the directory for storing the
   Divelog.SDE file
		** Optionally change the name of the file for saving
		** Click 'Save'
	* Back in the Export pop-up, press the button 'Export'
7. The dives are now exported to the file Divelog.SDE.

*Divemanager 4 (DM4) and Divemanager 5 (DM5):*

DM4 and DM5 use identical mechanisms for exporting dive logs.
To export a divelog from Divemanager you need to locate the DM4/DM5 database
where the dives are stored. You can either look for the original
database or make a backup of the dives. Both methods are described here.

Locating the Suunto DM4 (or DM5) database:

1. Start Suunto DM4/DM5
2. Select 'Help ->  About'
3. Click 'Copy' after text 'Copy log folder path to clipboard'
4. Open Windows Explorer
5. Paste the address to the path box at the top of the File Explorer
6. The database is called DM4.db or DM5.db

Making a backup copy of the Suunto DM4/DM5 database:

1. Start Suunto DM4/DM5
2. Select 'File - Create backup'
3. From the file menu select the location and name for the backup, we'll
   use DM4 (or DM5) in here with the default extension .bak
4. Click 'Save'
5. The dives are now exported to the file DM4.bak (or DM5.bak)


=== Exporting from Atomic Logbook
[[Atomic_Export]]

[icon="images/icons/atomiclogo.jpg"]
[NOTE]
Atomic Logbook is Windows software by Atomic Aquatics. It allows
downloading of dive information from Cobalt and Cobalt 2 dive computers.
The divelog is kept in a SQLite database at
C:\ProgramData\AtomicsAquatics\Cobalt-Logbook\Cobalt.db. This file can
be directly imported to Subsurface.


=== Exporting from Mares Dive Organiser V2.1
[[Mares_Export]]

[icon="images/icons/mareslogo.jpg"]
[NOTE]
Mares Dive Organizer is a Windows application. The dive log is kept as a
Microsoft SQL Compact Edition database with a '.sdf' filename extension. The
database includes all Dive Organizer-registered divers on the particular
computer and all Mares dive computers used. The safest way to get a copy
of the dive database is to export the information to another compatible format
which can then be imported into _Subsurface_.

1. Within Dive Organizer, select
   _Database ->  Backup_ from the main menu and back up the database to the desk
   top.
   This creates a zipped file DiveOrganizerxxxxx.dbf.
2. Rename the file to
   DiveOrganizerxxxxx.zip. Inside the zipped directory is a file
   _DiveOrganizer.sdf_.
3. Extract the _.sdf_ file from the zipped folder to your Desktop.
4. The password for accessing the .zip file is _mares_.

[[S_ImportingDivingLog]]
=== Exporting from *DivingLog 5.0 and 6.0*

[icon="images/icons/divingloglogo.jpg"]
[NOTE]
The best way to bring your logs from DivingLog to Subsurface is to
convert the whole database. This is because other export formats do not
include all the details, and would lack, for example, gas switches and
information of what units are used. With database import, all this
information is included and readily available.

To transfer all files from DivingLog to Subsurface:

1. In DivingLog open the 'File ->  Export ->  SQLite' menu
2. Select 'Settings' button
3. Set the 'RTF2Plaintext' to 'true'
4. Close the Settings dialog
5. Click 'Export' button and select the filename

Once this is done, open the saved database file with Subsurface and the
dives are automatically converted to Subsurface’s own format. Last step to do is
save the log file in Subsurface.

== APPENDIX D: Exporting a spreadsheet to CSV format
[[S_Appendix_D]]

Many divers keep a dive log in some form of digital file, commonly a spreadsheet
with various fields of information. These logs can be easily imported into _Subsurface_ after the
spreadsheet is converted in a .CSV file.
This section explains the procedure to convert a diving logbook stored in a spreadsheet
to a .CSV file that will later be imported to _Subsurface_.
Creating a .CSV is straightforward, although the procedure is somewhat different
according to which spreadsheet program is used.

Organize the diving data in the spreadsheet, so the first row
contains the names (or titles) of each column and the information for each dive is stored in a single row.
_Subsurface_ supports many data items (Dive number, Date,
Time, Duration, Location, GPS, Max. Depth, Mean Depth, Buddy, Notes, Weight and Tags).
Organize dive data following a few simple rules:

1. Date: use one of the following formats: yyyy-mm-dd, dd.mm.yyyy, mm/dd/yyyy
2. Duration: the format should be minutes:seconds.
3. Unit system: only one unit system should be used (no mix of imperial and metric units)
4. Tags and buddies: values should be separated using a comma.
5. GPS position: use decimal degrees, e.g. 30.22496 30.821798

=== _LibreOffice Calc_ and _OpenOffice Calc_

These are open source spreadsheet applications forming parts of larger open source office suite applications. The user interaction with _LibreOffice_ and _OpenOffice_ is very similar.
In Libreoffice Calc the time format should be set to minutes:seconds - [mm]:ss and dates should be set to one of: yyyy-mm-dd, dd.mm.yyyy, mm/dd/yyyy. A typical dive log may look like this:

image::images/LOffice_spreadsheetdata.jpg["FIGURE: Spreadsheet data",align="center"]

To export the data as a .CSV file from within LibreOffice click _File ->  Save As_. On the dialog that comes up, select the _Text CSV (.csv)_ as the file type and select the option _Edit filter settings_.

image::images/LOffice_save_as_options.jpg["FIGURE: Save as options",align="center"]

After selecting _Save_, select the appropriate field delimiter (choose _Tab_ to prevent conflicts with the comma when using this as a decimal point), then select _OK_.

image::images/LOffice_field_options.jpg["FIGURE: Field options",align="center"]

Double check the .CSV file by opening it with a text editor, and then import the dive data as explained on the section xref:S_ImportingCSVDives[Importing CSV dives].

=== Microsoft _Excel_

The field delimiter (called "_list separator_" in Microsoft manuals) is not accessible
from within _Excel_ and needs to be set through the _Microsoft Control Panel_. After changing the
separator character, all software on the Windows machine uses the new character as a separator.
You can change the character back to the default character by following the same procedure, outlined below.

- In Microsoft Windows, click the *Start* button, then select _Control Panel_ from the list on the right-hand side.
- Open the _Regional and Language Options_ dialog box.
- Do the following:
  ** In Windows 7, click the _Formats_ tab, and then click _Customize this format_.
- Type a new separator in the _List separator_ box. To use a TAB-delimited file, type the word TAB in the box.
- Click _OK_ twice.

Below is an image of the _Control Panel_:

image::images/Win_SaveCSV2.jpg["FIGURE: Win List separator",align="center"]

To export the dive log in CSV format:

With the dive log opened in _Excel_, select the round Windows button at the top left, then _Save As_.

image::images/Win_SaveCSV1.jpg["FIGURE: Excel save as option",align="center"]

Click on the left-hand part of the _Save as_ option, NOT on the arrow on the right-hand. This brings up a dialog for saving the
spreadsheet in an alternative format. From the dropdown list at the
bottom of the dialog, marked _Save as Type:_, select _CSV(Comma delimited) (*.CSV)_. Be sure the appropriate folder has been
selected to save the CSV file into.

image::images/Win_SaveCSV3.jpg["FIGURE: Excel save CSV dialog",align="center"]

Select the _Save_ button. The CSV-formatted file is saved into the
folder that was selected. You can double check the .CSV file by
opening it with a text editor, then import the dive data as
explained on the section xref:S_ImportingCSVDives[Importing CSV dives].
[[S_APPENDIX_E]]
== APPENDIX E: Writing a custom print template

_Subsurface_ has a way to create or modify templates for printing dive logs to
produce customized printouts of them. Templates written in HTML, as well as a simple
Grantlee instruction set, are rendered to the print device by _Subsurface_.

Templates are accessed using the print dialog (see image *B* below).

image::images/Print1_f22.jpg["FIGURE: Print dialog",align="center"]

The buttons under the _Template_ dropdown box lets you _Edit_, _Delete_,
_Import_ and  _Export_ templates (see image *A* above). New or modified templates are stored as HTML
files in the same directory as the dive log being processed. In order to create or modify
a template, select one of the templates from the template dropdown list in the print dialog
(see image *B* above). Choose an existing template that resembles the final desired printout. Then select _Edit_.

The Edit Panel has three tabs:

image::images/Template1_f22.jpg["FIGURE: template edit dialog",align="center"]

1) The _Style_ tab (image *A* above) controls the font, line spacing and color template used for printing the dive log.
   The style attributes are editable. Choose one of the four color palettes used for color printing.

2) The _Colors_ tab (image *B* above) allows editing the colors used for printing the dive log. The colors are highly
   customizable: the _Edit_ buttons in the _Colors_ tab allows choosing arbitrary colors for different
   components of the dive log printout.

3) The _Template_ tab of the Edit Panel (see image below) allows creating a template using HTML as well as a few
   Grantlee programming primitives. Grantlee can create and format HTML code in
   a highly simple but efficient way (see below). The HTML of the template can be edited and saved. The saved
   template is stored in the same directory as the dive being processed. By default, a _Custom_
   template is a skeleton with no specific print instructions. The information printed
   needs to be specified and formatted in the template by replacing the section marked with:
   "<!-- Template must be filled -->". Writing HTML code with Grantlee instructions allows unlimited
   freedom in determining what is printed and in which way it should be rendered.

image::images/Template2_f22.jpg["FIGURE:Template tab",align="center"]

You can adapt any of the existing templates and save it to the dive log directory. The standard templates (e.g. One dive, Six dives,
Table) can be modified in this way. After completing the edits, use the _Export_ button in the print
dialog to save the new template using a new template name.

To write a custom template, the following elements must exist so  the template will be correctly handled and rendered.

=== Main dive loop
_Subsurface_ exports a dive list called (*dives*) to the _Grantlee_ back end. It is possible to iterate over the list as follows:
.template.html
....
	{% for dive in dives %}
		<h1> {{ dive.number }} </h1>
	{% endfor %}
....

.output.html
....
	<h1> 1 </h1>
	<h1> 2 </h1>
	<h1> 3 </h1>
....

Additional information about _Grantlee_ can be found http://www.grantlee.org/apidox/for_themers.html[here]

=== Grantlee exported variables
Only a subset of the dive data is exported:
|====================
|*Name*|*Description*
|number| (*int*) dive number
|id| (*int*) unique dive ID, should be used to fetch the dive profile
|date| (*string*) date of the dive
|time| (*string*) time of the dive
|location| (*string*) location of the dive
|duration| (*string*) duration of the dive
|depth| (*string*) depth of the dive
|divemaster| (*string*) divemaster for the dive
|buddy| (*string*) buddy for the dive
|airTemp| (*string*) air temperature of the dive
|waterTemp| (*string*) water temperature of the dive
|notes| (*string*) dive notes
|rating| (*int*) dive rating which ranges from 0 to 5
|sac| (*string*) SAC value for the dive
|tags| (*string*) list of dive tags for the dive
|gas| (*string*) list of gases used in the dive
|suit| (*string*) the suit used for the dive
|cylinders| (*string*) complete information of all used cylinders
|cylinder0-7| (*string*) information about a specific cylinder
|weights| (*string*) complete information of all used weight systems
|weight0-5| (*string*) information about a specific weight system
|maxcns| (*string*) maxCNS value for the dive
|otu| (*string*) OTU value for the dive
|sumWeight| (*string*) the summed weight of all used weight systems
|startPressure| (*string*) the start pressure
|endPressure| (*string*) the end pressure
|firstGas| (*string*) first used gas
|=====================

Please note that some of the variables like 'notes' need to be extended with '|safe' to support HTML tags:
....
	<p> {{ dive.notes|safe }} </p>
....
Otherwise tags like 'br' would not be converted to line breaks.

_Subsurface_ also exports *template_options* data. This data must be used as _CSS_ values to provide a dynamically
editable template. The exported data is shown in the following table:
|====================
|*Name*|*Description*
|font| (*string*) font family
|borderwidth| (*int*) border-width value dynamically calculated as 0.1% of the page width with minimum value of 1px
|font_size| (*double*) size of fonts in vw, ranges between 1.0 and 2.0
|line_spacing| (*double*) distance between text lines, ranges between 1.0 and 3.0
|color1| (*string*) background color
|color2| (*string*) primary table cell color
|color3| (*string*) secondary table cell color
|color4| (*string*) primary text color
|color5| (*string*) secondary text color
|color6| (*string*) border colors
|=====================

.template.html
....
	border-width: {{ template_options.borderwidth }}px;
....

.output.html
....
	border-width: 3px;
....

Another variable that _Subsurface_ exports is *print_options*. This variable contains a single member:
|=====================
|*Name*|*Description*
|grayscale | Use _CSS_ filters to convert the page into grayscale (should be added to body style to enable printing grayscale prints)
|=====================


.template.html
....
	body {
		{{ print_options.grayscale }};
	}
....

.output.html
....
	body {
		-webkit-filter: grayscale(100%);
	}
....

=== Defined CSS selectors
As the dive profile is placed after rendering, _Subsurface_ uses special _CSS_ selectors to search
in the HTML output. The _CSS_ selectors in the following table should be added.

|====================
|*Selector*|*Type*|*Description*
|dive_{{ dive.id }} | id | is used to fetch the relevant dive profile
|diveProfile | class | each dive that will contain a dive profile should have this class selector in addition to the dive_{{ dive.id }} id selector
|dontbreak | class | prevents the dive with this class from being divided into two pages. This can be used
in flow layout templates only (when data-numberofdives = 0)
|=====================

IMPORTANT: Rendering dive profiles is not supported for flow layout templates (when data-numberofdives = 0).

=== Special attributes

There are two ways of rendering- either rendering a specific number of dives in each page or make _Subsurface_ try to
fit as many dives as possible into one page (_flow_ rendering).

The *data-numberofdives* data attribute is added to the body tag to set the rendering mode.

- render 6 dives per page:

....
	<body data-numberofdives = 6>
....

- render as much dives as possible:

....
	<body data-numberofdives = 0>
....

IMPORTANT: All CSS units should be in relative lengths only, to support printing on any page size.

[[S_APPENDIX_F]]

== APPENDIX F: Setting up video thumbnails.

=== Setting up the appropriate thumbnails for videos that are associated with dives.

In handling video associated with dives, _Subsurface_ needs to create a thumbnail for each video that can be shown
either on the dive profile or in the _Media_ tab. By default this is a nonspecific placeholder thumbnail.
To see thumbnails that represent individual videos, _Subsurface_ uses an external program calle _FFmpeg_.
To create thumbnails for videos, do two things:

1. Install _FFmpeg_ on the computer that runs _Subsurface_. The program can be downloaded from the FFmpeg web site:
https://www.ffmpeg.org/download.html. Most Linux distributions ship with an _ffmpeg_ package and therefore do not need an additional download.

** On Windows, put the _ffmpeg.exe_ file in the directory containing the _Subsurface_ executable.
On Mac and Linux, make sure the _ffmpeg_ command is in the path. This should be the case for
_FFmpeg_ installed from official packages.


2. In the _General_ tab of the <<S_Preferences, _Preferences_>>, set the preferences for generating video thumbnails. This is achieved by:

** Checking the _Extract video thumbnails_ box. If _Subsurface_ fails to load the _FFmpeg_ executable,
this option will be turned off. Re-enable it after successfully installing _FFmpeg_.

** Specifying the path to the _FFmpeg_ executable.

** Choose the position in the video where _Subsurface_
should try to extract the thumbnail. The left-most and right-most positions of the _Extract at position_
slider signify the beginning and the end of the video, respectively. Note that if _Subsurface_ cannot
determine the length of the video (this can be the case for AVI files), the first frame
of the video will be used.

This should complete the setup of video thumbnails and they should now appear on the dive profile and in the _Media_ tab.

== APPENDIX G: FAQs.
[[S_APPENDIX_G]]
=== Subsurface appears to miscalculate gas consumption and SAC
[[SAC_CALCULATION]]
'Question': I dived with a 12.2 l tank, starting with 220 bar and ending with 100 bar, and I calculate a different SAC compared what _Subsurface_ calculates. Is _Subsurface_
miscalculating?

'Answer': Not really. What happens is that _Subsurface_ actually calculates gas
consumption differently - and better - than you expect.
In particular, it takes the incompressibility of the gas into account.
Traditionally, gas consumption and SAC should be:
+consumption = tank size x (start pressure - end pressure)+

and that's true for an ideal gas, and it's what you get taught in dive theory.
But an "ideal gas" doesn't actually exist, and real gases actually don't compress
linearly with pressure. Also, you are missing the fact that one atmosphere of
pressure isn't actually one bar.
So the *real* calculation is:

+consumption = (amount_of_air_at_beginning - amount_of_air_at_end)+

where the amount of air is *not* just "tank size times pressure in bar".
It's a combination of: "take compressibility into account" (which is a fairly
small issue under 220 bar - you'll see more differences when you do high-pressure
tanks with 300bar) and "convert bar to atm" (which is the majority of your discrepancy).
Remember: one ATM is ~1.013 bar, so without the compressibility, your gas use is:

+12.2*((220-100)/1.013)+

which is about 1445, not 1464. So there was 19 l too much in your simple
calculation that ignored the difference between 1 bar and one ATM.
The compressibility does show up above 200 bar, and takes that 1445 down
about eight litres more, so you really did use only about 1437 l of air at surface pressure.

So be happy: your SAC really is better than your calculations indicated.
Or be sad: your cylinder contains less air than you thought it did.
And as mentioned, the "contains less air than you thought it did" really
starts becoming much more noticeable at high pressure. A 400 bar really does not
contain twice as much air as a 200 bar one. At lower pressures, air acts pretty much like an ideal gas.

=== Some dive profiles have time discrepancies with the recorded samples from my dive computer...

_Subsurface_ ends up ignoring surface time for many things (average depth, divetime, SAC, etc).
'Question':  Why do dive durations in my dive computer differ from that given by _Subsurface_?

'Answer': For example, if you end up doing a weight check (deep enough to trigger the "dive started")
but then come back up and wait five minutes for your buddies, your dive computer may say
that your dive is 50 minutes long - because you have fifty minutes worth of samples - but
subsurface will say it's 45 minutes - because you were actually diving for 45 minutes.
It's even more noticeable if you do things like divemastering the initial OW dives, when
you may stay in the water for a long time, but spend most of it at the surface. And then
you don't want that to count as some kind of long dive”.

=== Some dive profiles are missing from the download

[[DC_HISTORY]]
'Question': I cannot download all my dives, only the most recent ones,
even though my dive computer's manual states that it records history of
e.g. 999 dives?
'Answer': Dive history is different than the dive profiles on the log.
The history only keeps track of the total number of dives and total
amount of time spent below surface. The logs, on the other hand, store
the dive profile, but they have a limited amount of memory to do so. The
exact amount of dive profiles that can be stored on the device depends on
sample interval and duration of the dives. Once the memory is full the
oldest dives get overwritten with new dives. Thus we are only able to
download the last 13, 30 or 199 dives.

If you have downloaded your dives to different dive logging software
before they were overwritten, there is a good chance that Subsurface can
import these. However, if the logs are only on your dive computer, they
cannot be salvaged after being overwritten by new dives.