Allow comma separated CSV files

The separator selector in the CSV import dialog was unused. This passes
the value into the xslt and adds ',' as possible value.

I'm sure this could be done much better (pass the actual character instead
of the index), but I couldn't get that to work and this does seem to do
the trick.

Also added a test dive to test this feature.

Fixes #321

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2013-12-04 15:19:28 -08:00
parent 5fc50b2aab
commit b5d3476b0b
5 changed files with 43 additions and 4 deletions

27
dives/TestComma.csv Normal file
View file

@ -0,0 +1,27 @@
Dive Time (s),Depth (m),PPO2 - Setpoint (Bar),PPO2 - C1 Cell 1 (Bar),PPO2 - C1 Cell 2 (Bar),PPO2 - C1 Cell 3 (Bar),PPO2 - C1 Measured (Bar),PPO2 - C2 Cell 1 (Bar),PPO2 - C2 Cell 2 (Bar),PPO2 - C2 Cell 3 (Bar),PPO2 - C2 Measured (Bar),C1 Battery 1 (Volts),C1 Battery 2 (Volts),C2 Battery 1 (Volts),C2 Battery 2 (Volts),Ambient Temp. (Celcius),OTU Exposure (%),CNS Exposure (%),Deco Ceiling (m),Gradient Factor
0,0.0,0,0,0,0,0,0,0,0,0,0,0,0,0,19.00,0,0,0,0
60,2.5,0,0,0,0,0,0,0,0,0,0,0,0,0,18.00,0,0,0,0
120,4.5,0,0,0,0,0,0,0,0,0,0,0,0,0,18.00,0,0,0,0
180,5.0,0,0,0,0,0,0,0,0,0,0,0,0,0,18.00,0,0,0,0
240,5.5,0,0,0,0,0,0,0,0,0,0,0,0,0,18.00,0,0,0,0
300,5.0,0,0,0,0,0,0,0,0,0,0,0,0,0,18.00,0,0,0,0
360,5.5,0,0,0,0,0,0,0,0,0,0,0,0,0,17.00,0,0,0,0
420,7.0,0,0,0,0,0,0,0,0,0,0,0,0,0,17.00,0,0,0,0
480,9.0,0,0,0,0,0,0,0,0,0,0,0,0,0,17.00,0,0,0,0
540,11.5,0,0,0,0,0,0,0,0,0,0,0,0,0,16.00,0,0,0,0
600,11.5,0,0,0,0,0,0,0,0,0,0,0,0,0,16.00,0,0,0,0
660,12.5,0,0,0,0,0,0,0,0,0,0,0,0,0,16.00,0,0,0,0
720,13.5,0,0,0,0,0,0,0,0,0,0,0,0,0,16.00,0,0,0,0
780,16.0,0,0,0,0,0,0,0,0,0,0,0,0,0,15.00,0,0,0,0
840,17.0,0,0,0,0,0,0,0,0,0,0,0,0,0,15.00,0,0,0,0
900,18.0,0,0,0,0,0,0,0,0,0,0,0,0,0,15.00,0,0,0,0
960,18.5,0,0,0,0,0,0,0,0,0,0,0,0,0,15.00,0,0,0,0
1020,20.0,0,0,0,0,0,0,0,0,0,0,0,0,0,15.00,0,0,0,0
1080,18.5,0,0,0,0,0,0,0,0,0,0,0,0,0,15.00,0,0,0,0
1140,16.0,0,0,0,0,0,0,0,0,0,0,0,0,0,16.00,0,0,0,0
1200,10.5,0,0,0,0,0,0,0,0,0,0,0,0,0,17.00,0,0,0,0
1260,5.0,0,0,0,0,0,0,0,0,0,0,0,0,0,18.00,0,0,0,0
1320,4.0,0,0,0,0,0,0,0,0,0,0,0,0,0,18.00,0,0,0,0
1380,2.0,0,0,0,0,0,0,0,0,0,0,0,0,0,18.00,0,0,0,0
1440,1.5,0,0,0,0,0,0,0,0,0,0,0,0,0,18.00,0,0,0,0
1460,0.0,0,0,0,0,0,0,0,0,0,0,0,0,0,18.00,0,0,0,0
1 Dive Time (s) Depth (m) PPO2 - Setpoint (Bar) PPO2 - C1 Cell 1 (Bar) PPO2 - C1 Cell 2 (Bar) PPO2 - C1 Cell 3 (Bar) PPO2 - C1 Measured (Bar) PPO2 - C2 Cell 1 (Bar) PPO2 - C2 Cell 2 (Bar) PPO2 - C2 Cell 3 (Bar) PPO2 - C2 Measured (Bar) C1 Battery 1 (Volts) C1 Battery 2 (Volts) C2 Battery 1 (Volts) C2 Battery 2 (Volts) Ambient Temp. (Celcius) OTU Exposure (%) CNS Exposure (%) Deco Ceiling (m) Gradient Factor
2 0 0.0 0 0 0 0 0 0 0 0 0 0 0 0 0 19.00 0 0 0 0
3 60 2.5 0 0 0 0 0 0 0 0 0 0 0 0 0 18.00 0 0 0 0
4 120 4.5 0 0 0 0 0 0 0 0 0 0 0 0 0 18.00 0 0 0 0
5 180 5.0 0 0 0 0 0 0 0 0 0 0 0 0 0 18.00 0 0 0 0
6 240 5.5 0 0 0 0 0 0 0 0 0 0 0 0 0 18.00 0 0 0 0
7 300 5.0 0 0 0 0 0 0 0 0 0 0 0 0 0 18.00 0 0 0 0
8 360 5.5 0 0 0 0 0 0 0 0 0 0 0 0 0 17.00 0 0 0 0
9 420 7.0 0 0 0 0 0 0 0 0 0 0 0 0 0 17.00 0 0 0 0
10 480 9.0 0 0 0 0 0 0 0 0 0 0 0 0 0 17.00 0 0 0 0
11 540 11.5 0 0 0 0 0 0 0 0 0 0 0 0 0 16.00 0 0 0 0
12 600 11.5 0 0 0 0 0 0 0 0 0 0 0 0 0 16.00 0 0 0 0
13 660 12.5 0 0 0 0 0 0 0 0 0 0 0 0 0 16.00 0 0 0 0
14 720 13.5 0 0 0 0 0 0 0 0 0 0 0 0 0 16.00 0 0 0 0
15 780 16.0 0 0 0 0 0 0 0 0 0 0 0 0 0 15.00 0 0 0 0
16 840 17.0 0 0 0 0 0 0 0 0 0 0 0 0 0 15.00 0 0 0 0
17 900 18.0 0 0 0 0 0 0 0 0 0 0 0 0 0 15.00 0 0 0 0
18 960 18.5 0 0 0 0 0 0 0 0 0 0 0 0 0 15.00 0 0 0 0
19 1020 20.0 0 0 0 0 0 0 0 0 0 0 0 0 0 15.00 0 0 0 0
20 1080 18.5 0 0 0 0 0 0 0 0 0 0 0 0 0 15.00 0 0 0 0
21 1140 16.0 0 0 0 0 0 0 0 0 0 0 0 0 0 16.00 0 0 0 0
22 1200 10.5 0 0 0 0 0 0 0 0 0 0 0 0 0 17.00 0 0 0 0
23 1260 5.0 0 0 0 0 0 0 0 0 0 0 0 0 0 18.00 0 0 0 0
24 1320 4.0 0 0 0 0 0 0 0 0 0 0 0 0 0 18.00 0 0 0 0
25 1380 2.0 0 0 0 0 0 0 0 0 0 0 0 0 0 18.00 0 0 0 0
26 1440 1.5 0 0 0 0 0 0 0 0 0 0 0 0 0 18.00 0 0 0 0
27 1460 0.0 0 0 0 0 0 0 0 0 0 0 0 0 0 18.00 0 0 0 0