diff options
-rw-r--r-- | dive.h | 2 | ||||
-rw-r--r-- | file.c | 12 | ||||
-rw-r--r-- | qt-ui/divelogimportdialog.cpp | 3 | ||||
-rw-r--r-- | tests/testparse.cpp | 2 | ||||
-rw-r--r-- | xslt/manualcsv2xml.xslt | 10 |
5 files changed, 22 insertions, 7 deletions
@@ -654,7 +654,7 @@ extern int parse_file(const char *filename); extern int parse_csv_file(const char *filename, int time, int depth, int temp, int po2f, int cnsf, int ndlf, int ttsf, int stopdepthf, int pressuref, int sepidx, const char *csvtemplate, int units); extern int parse_seabear_csv_file(const char *filename, int time, int depth, int temp, int po2f, int cnsf, int ndlf, int ttsf, int stopdepthf, int pressuref, int sepidx, const char *csvtemplate, int units, const char *delta); extern int parse_txt_file(const char *filename, const char *csv); -extern int parse_manual_file(const char *filename, int separator_index, int units, int dateformat, int durationformat, int number, int date, int time, int duration, int location, int gps, int maxdepth, int meandepth, int divemaster, int buddy, int notes, int weight, int tags, int cylsizef, int startpresf, int endpresf, int o2f, int hef, int airtempf, int watertempf); +extern int parse_manual_file(const char *filename, int separator_index, int units, int dateformat, int durationformat, int number, int date, int time, int duration, int location, int gps, int maxdepth, int meandepth, int divemaster, int buddy, int suit, int notes, int weight, int tags, int cylsizef, int startpresf, int endpresf, int o2f, int hef, int airtempf, int watertempf); extern int save_dives(const char *filename); extern int save_dives_logic(const char *filename, bool select_only); @@ -1016,18 +1016,18 @@ int parse_seabear_csv_file(const char *filename, int timef, int depthf, int temp int parse_manual_file(const char *filename, int sepidx, int units, int dateformat, int durationformat, int numberf, int datef, int timef, int durationf, int locationf, int gpsf, int maxdepthf, int meandepthf, - int divemasterf, int buddyf, int notesf, int weightf, int tagsf, int cylsizef, int startpresf, int endpresf, + int divemasterf, int buddyf, int suitf, int notesf, int weightf, int tagsf, int cylsizef, int startpresf, int endpresf, int o2f, int hef, int airtempf, int watertempf) { if (verbose > 4) { fprintf(stderr, "filename %s, sepidx %d, units %d, dateformat %d, durationformat %d\n", filename, sepidx, units, dateformat, durationformat); fprintf(stderr, "numberf %d, datef %d, timef %d, durationf %d, locationf %d, gpsf %d, maxdepthf %d, meandepthf %d\n", numberf, datef, timef, durationf, locationf, gpsf, maxdepthf, meandepthf); - fprintf(stderr, "divemasterf %d, buddyf %d, notesf %d, weightf %d, tagsf %d, cylsizef %d, startpresf %d, endpresf %d\n", divemasterf, buddyf, notesf, weightf, tagsf, cylsizef, startpresf, endpresf); + fprintf(stderr, "divemasterf %d, buddyf %d, suitf %d, notesf %d, weightf %d, tagsf %d, cylsizef %d, startpresf %d, endpresf %d\n", divemasterf, buddyf, suitf, notesf, weightf, tagsf, cylsizef, startpresf, endpresf); fprintf(stderr, "o2f %d, hef %d, airtempf %d, watertempf %d\n", o2f, hef, airtempf, watertempf); } struct memblock mem; int pnr = 0; - char *params[53]; + char *params[55]; char numberbuf[MAXCOLDIGITS]; char datebuf[MAXCOLDIGITS]; char timebuf[MAXCOLDIGITS]; @@ -1038,6 +1038,7 @@ int parse_manual_file(const char *filename, int sepidx, int units, int dateforma char meandepthbuf[MAXCOLDIGITS]; char divemasterbuf[MAXCOLDIGITS]; char buddybuf[MAXCOLDIGITS]; + char suitbuf[MAXCOLDIGITS]; char notesbuf[MAXCOLDIGITS]; char weightbuf[MAXCOLDIGITS]; char tagsbuf[MAXCOLDIGITS]; @@ -1058,7 +1059,7 @@ int parse_manual_file(const char *filename, int sepidx, int units, int dateforma char curtime[6]; int ret; - if (numberf >= MAXCOLS || datef >= MAXCOLS || timef >= MAXCOLS || durationf >= MAXCOLS || locationf >= MAXCOLS || gpsf >= MAXCOLS || maxdepthf >= MAXCOLS || meandepthf >= MAXCOLS || buddyf >= MAXCOLS || notesf >= MAXCOLS || weightf >= MAXCOLS || tagsf >= MAXCOLS || cylsizef >= MAXCOLS || startpresf >= MAXCOLS || endpresf >= MAXCOLS || o2f >= MAXCOLS || hef >= MAXCOLS || airtempf >= MAXCOLS || watertempf >= MAXCOLS) + if (numberf >= MAXCOLS || datef >= MAXCOLS || timef >= MAXCOLS || durationf >= MAXCOLS || locationf >= MAXCOLS || gpsf >= MAXCOLS || maxdepthf >= MAXCOLS || meandepthf >= MAXCOLS || buddyf >= MAXCOLS || suitf >= MAXCOLS || notesf >= MAXCOLS || weightf >= MAXCOLS || tagsf >= MAXCOLS || cylsizef >= MAXCOLS || startpresf >= MAXCOLS || endpresf >= MAXCOLS || o2f >= MAXCOLS || hef >= MAXCOLS || airtempf >= MAXCOLS || watertempf >= MAXCOLS) return report_error(translate("gettextFromC", "Maximum number of supported columns on CSV import is %d"), MAXCOLS); snprintf(numberbuf, MAXCOLDIGITS, "%d", numberf); @@ -1071,6 +1072,7 @@ int parse_manual_file(const char *filename, int sepidx, int units, int dateforma snprintf(meandepthbuf, MAXCOLDIGITS, "%d", meandepthf); snprintf(divemasterbuf, MAXCOLDIGITS, "%d", divemasterf); snprintf(buddybuf, MAXCOLDIGITS, "%d", buddyf); + snprintf(suitbuf, MAXCOLDIGITS, "%d", suitf); snprintf(notesbuf, MAXCOLDIGITS, "%d", notesf); snprintf(weightbuf, MAXCOLDIGITS, "%d", weightf); snprintf(tagsbuf, MAXCOLDIGITS, "%d", tagsf); @@ -1113,6 +1115,8 @@ int parse_manual_file(const char *filename, int sepidx, int units, int dateforma params[pnr++] = divemasterbuf; params[pnr++] = "buddyField"; params[pnr++] = buddybuf; + params[pnr++] = "suitField"; + params[pnr++] = suitbuf; params[pnr++] = "notesField"; params[pnr++] = notesbuf; params[pnr++] = "weightField"; diff --git a/qt-ui/divelogimportdialog.cpp b/qt-ui/divelogimportdialog.cpp index 763476d9f..409064833 100644 --- a/qt-ui/divelogimportdialog.cpp +++ b/qt-ui/divelogimportdialog.cpp @@ -24,7 +24,7 @@ const DiveLogImportDialog::CSVAppConfig DiveLogImportDialog::CSVApps[CSVAPPS] = ColumnNameProvider::ColumnNameProvider(QObject *parent) : QAbstractListModel(parent) { columnNames << tr("Dive #") << tr("Date") << tr("Time") << tr("Duration") << tr("Location") << tr("GPS") << tr("Weight") << tr("Cyl. size") << tr("Start pressure") << - tr("End pressure") << tr("Max. depth") << tr("Avg. depth") << tr("Divemaster") << tr("Buddy") << tr("Notes") << tr("Tags") << tr("Air temp.") << tr("Water temp.") << + tr("End pressure") << tr("Max. depth") << tr("Avg. depth") << tr("Divemaster") << tr("Buddy") << tr("Suit") << tr("Notes") << tr("Tags") << tr("Air temp.") << tr("Water temp.") << tr("O₂") << tr("He") << tr("Sample time") << tr("Sample depth") << tr("Sample temperature") << tr("Sample pO₂") << tr("Sample CNS") << tr("Sample NDL") << tr("Sample TTS") << tr("Sample stopdepth") << tr("Sample pressure"); } @@ -639,6 +639,7 @@ void DiveLogImportDialog::on_buttonBox_accepted() r.indexOf(tr("Avg. depth")), r.indexOf(tr("Divemaster")), r.indexOf(tr("Buddy")), + r.indexOf(tr("Suit")), r.indexOf(tr("Notes")), r.indexOf(tr("Weight")), r.indexOf(tr("Tags")), diff --git a/tests/testparse.cpp b/tests/testparse.cpp index 818827bca..0257614cb 100644 --- a/tests/testparse.cpp +++ b/tests/testparse.cpp @@ -15,7 +15,7 @@ void TestParse::testParseCSV() 1, // mm/dd/yyyy 2, // min:sec 0, 1, 2, 3, -1, -1, 4, -1, // Dive #, date, time, duration, maxdepth, avgdepth - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1), 0); + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1), 0); fprintf(stderr, "number of dives %d \n", dive_table.nr); } diff --git a/xslt/manualcsv2xml.xslt b/xslt/manualcsv2xml.xslt index 15eb8f00d..83c543581 100644 --- a/xslt/manualcsv2xml.xslt +++ b/xslt/manualcsv2xml.xslt @@ -17,6 +17,7 @@ <xsl:param name="meanDepthField" select="meanDepthField"/> <xsl:param name="divemasterField" select="divemasterField"/> <xsl:param name="buddyField" select="buddyField"/> + <xsl:param name="suitField" select="suitField"/> <xsl:param name="notesField" select="notesField"/> <xsl:param name="weightField" select="weightField"/> <xsl:param name="dateformat" select="dateformat"/> @@ -343,6 +344,15 @@ </buddy> </xsl:if> + <xsl:if test="$suitField >= 0"> + <suit> + <xsl:call-template name="getFieldByIndex"> + <xsl:with-param name="index" select="$suitField"/> + <xsl:with-param name="line" select="$line"/> + </xsl:call-template> + </suit> + </xsl:if> + <xsl:if test="$notesField >= 0"> <notes> <xsl:call-template name="getFieldByIndex"> |